@aws-sdk/client-polly 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.
@@ -1,10 +1,10 @@
1
1
  import { __assign, __awaiter, __generator } from "tslib";
2
2
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
3
- import { decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, extendedEncodeURIComponent as __extendedEncodeURIComponent, parseEpochTimestamp as __parseEpochTimestamp, strictParseInt32 as __strictParseInt32, } from "@aws-sdk/smithy-client";
3
+ import { decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, map as __map, parseEpochTimestamp as __parseEpochTimestamp, resolvedPath as __resolvedPath, strictParseInt32 as __strictParseInt32, throwDefaultError, } from "@aws-sdk/smithy-client";
4
4
  import { EngineNotSupportedException, InvalidLexiconException, InvalidNextTokenException, InvalidS3BucketException, InvalidS3KeyException, InvalidSampleRateException, InvalidSnsTopicArnException, InvalidSsmlException, InvalidTaskIdException, LanguageNotSupportedException, LexiconNotFoundException, LexiconSizeExceededException, MarksNotSupportedForFormatException, MaxLexemeLengthExceededException, MaxLexiconsNumberExceededException, ServiceFailureException, SsmlMarksNotSupportedForTextTypeException, SynthesisTaskNotFoundException, TextLengthExceededException, UnsupportedPlsAlphabetException, UnsupportedPlsLanguageException, } from "../models/models_0";
5
5
  import { PollyServiceException as __BaseException } from "../models/PollyServiceException";
6
6
  export var serializeAws_restJson1DeleteLexiconCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
7
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
7
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
8
8
  return __generator(this, function (_c) {
9
9
  switch (_c.label) {
10
10
  case 0: return [4, context.endpoint()];
@@ -12,16 +12,7 @@ export var serializeAws_restJson1DeleteLexiconCommand = function (input, context
12
12
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
13
13
  headers = {};
14
14
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/lexicons/{Name}";
15
- if (input.Name !== undefined) {
16
- labelValue = input.Name;
17
- if (labelValue.length <= 0) {
18
- throw new Error("Empty value provided for input HTTP label: Name.");
19
- }
20
- resolvedPath = resolvedPath.replace("{Name}", __extendedEncodeURIComponent(labelValue));
21
- }
22
- else {
23
- throw new Error("No value provided for input HTTP label: Name.");
24
- }
15
+ resolvedPath = __resolvedPath(resolvedPath, input, "Name", function () { return input.Name; }, "{Name}", false);
25
16
  return [2, new __HttpRequest({
26
17
  protocol: protocol,
27
18
  hostname: hostname,
@@ -43,9 +34,15 @@ export var serializeAws_restJson1DescribeVoicesCommand = function (input, contex
43
34
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
44
35
  headers = {};
45
36
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/voices";
46
- query = __assign(__assign(__assign(__assign({}, (input.Engine !== undefined && { Engine: input.Engine })), (input.LanguageCode !== undefined && { LanguageCode: input.LanguageCode })), (input.IncludeAdditionalLanguageCodes !== undefined && {
47
- IncludeAdditionalLanguageCodes: input.IncludeAdditionalLanguageCodes.toString(),
48
- })), (input.NextToken !== undefined && { NextToken: input.NextToken }));
37
+ query = map({
38
+ Engine: [, input.Engine],
39
+ LanguageCode: [, input.LanguageCode],
40
+ IncludeAdditionalLanguageCodes: [
41
+ function () { return input.IncludeAdditionalLanguageCodes !== void 0; },
42
+ function () { return input.IncludeAdditionalLanguageCodes.toString(); },
43
+ ],
44
+ NextToken: [, input.NextToken],
45
+ });
49
46
  return [2, new __HttpRequest({
50
47
  protocol: protocol,
51
48
  hostname: hostname,
@@ -60,7 +57,7 @@ export var serializeAws_restJson1DescribeVoicesCommand = function (input, contex
60
57
  });
61
58
  }); };
62
59
  export var serializeAws_restJson1GetLexiconCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
63
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
60
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
64
61
  return __generator(this, function (_c) {
65
62
  switch (_c.label) {
66
63
  case 0: return [4, context.endpoint()];
@@ -68,16 +65,7 @@ export var serializeAws_restJson1GetLexiconCommand = function (input, context) {
68
65
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
69
66
  headers = {};
70
67
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/lexicons/{Name}";
71
- if (input.Name !== undefined) {
72
- labelValue = input.Name;
73
- if (labelValue.length <= 0) {
74
- throw new Error("Empty value provided for input HTTP label: Name.");
75
- }
76
- resolvedPath = resolvedPath.replace("{Name}", __extendedEncodeURIComponent(labelValue));
77
- }
78
- else {
79
- throw new Error("No value provided for input HTTP label: Name.");
80
- }
68
+ resolvedPath = __resolvedPath(resolvedPath, input, "Name", function () { return input.Name; }, "{Name}", false);
81
69
  return [2, new __HttpRequest({
82
70
  protocol: protocol,
83
71
  hostname: hostname,
@@ -91,7 +79,7 @@ export var serializeAws_restJson1GetLexiconCommand = function (input, context) {
91
79
  });
92
80
  }); };
93
81
  export var serializeAws_restJson1GetSpeechSynthesisTaskCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
94
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
82
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
95
83
  return __generator(this, function (_c) {
96
84
  switch (_c.label) {
97
85
  case 0: return [4, context.endpoint()];
@@ -99,16 +87,7 @@ export var serializeAws_restJson1GetSpeechSynthesisTaskCommand = function (input
99
87
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
100
88
  headers = {};
101
89
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/synthesisTasks/{TaskId}";
102
- if (input.TaskId !== undefined) {
103
- labelValue = input.TaskId;
104
- if (labelValue.length <= 0) {
105
- throw new Error("Empty value provided for input HTTP label: TaskId.");
106
- }
107
- resolvedPath = resolvedPath.replace("{TaskId}", __extendedEncodeURIComponent(labelValue));
108
- }
109
- else {
110
- throw new Error("No value provided for input HTTP label: TaskId.");
111
- }
90
+ resolvedPath = __resolvedPath(resolvedPath, input, "TaskId", function () { return input.TaskId; }, "{TaskId}", false);
112
91
  return [2, new __HttpRequest({
113
92
  protocol: protocol,
114
93
  hostname: hostname,
@@ -130,7 +109,9 @@ export var serializeAws_restJson1ListLexiconsCommand = function (input, context)
130
109
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
131
110
  headers = {};
132
111
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/lexicons";
133
- query = __assign({}, (input.NextToken !== undefined && { NextToken: input.NextToken }));
112
+ query = map({
113
+ NextToken: [, input.NextToken],
114
+ });
134
115
  return [2, new __HttpRequest({
135
116
  protocol: protocol,
136
117
  hostname: hostname,
@@ -153,7 +134,11 @@ export var serializeAws_restJson1ListSpeechSynthesisTasksCommand = function (inp
153
134
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
154
135
  headers = {};
155
136
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/synthesisTasks";
156
- query = __assign(__assign(__assign({}, (input.MaxResults !== undefined && { MaxResults: input.MaxResults.toString() })), (input.NextToken !== undefined && { NextToken: input.NextToken })), (input.Status !== undefined && { Status: input.Status }));
137
+ query = map({
138
+ MaxResults: [function () { return input.MaxResults !== void 0; }, function () { return input.MaxResults.toString(); }],
139
+ NextToken: [, input.NextToken],
140
+ Status: [, input.Status],
141
+ });
157
142
  return [2, new __HttpRequest({
158
143
  protocol: protocol,
159
144
  hostname: hostname,
@@ -168,7 +153,7 @@ export var serializeAws_restJson1ListSpeechSynthesisTasksCommand = function (inp
168
153
  });
169
154
  }); };
170
155
  export var serializeAws_restJson1PutLexiconCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
171
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
156
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
172
157
  return __generator(this, function (_c) {
173
158
  switch (_c.label) {
174
159
  case 0: return [4, context.endpoint()];
@@ -178,16 +163,7 @@ export var serializeAws_restJson1PutLexiconCommand = function (input, context) {
178
163
  "content-type": "application/json",
179
164
  };
180
165
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/v1/lexicons/{Name}";
181
- if (input.Name !== undefined) {
182
- labelValue = input.Name;
183
- if (labelValue.length <= 0) {
184
- throw new Error("Empty value provided for input HTTP label: Name.");
185
- }
186
- resolvedPath = resolvedPath.replace("{Name}", __extendedEncodeURIComponent(labelValue));
187
- }
188
- else {
189
- throw new Error("No value provided for input HTTP label: Name.");
190
- }
166
+ resolvedPath = __resolvedPath(resolvedPath, input, "Name", function () { return input.Name; }, "{Name}", false);
191
167
  body = JSON.stringify(__assign({}, (input.Content != null && { Content: input.Content })));
192
168
  return [2, new __HttpRequest({
193
169
  protocol: protocol,
@@ -265,18 +241,18 @@ export var deserializeAws_restJson1DeleteLexiconCommand = function (output, cont
265
241
  if (output.statusCode !== 200 && output.statusCode >= 300) {
266
242
  return [2, deserializeAws_restJson1DeleteLexiconCommandError(output, context)];
267
243
  }
268
- contents = {
244
+ contents = map({
269
245
  $metadata: deserializeMetadata(output),
270
- };
246
+ });
271
247
  return [4, collectBody(output.body, context)];
272
248
  case 1:
273
249
  _a.sent();
274
- return [2, Promise.resolve(contents)];
250
+ return [2, contents];
275
251
  }
276
252
  });
277
253
  }); };
278
254
  var deserializeAws_restJson1DeleteLexiconCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
279
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
255
+ var parsedOutput, _a, errorCode, _b, parsedBody;
280
256
  var _c;
281
257
  return __generator(this, function (_d) {
282
258
  switch (_d.label) {
@@ -301,14 +277,14 @@ var deserializeAws_restJson1DeleteLexiconCommandError = function (output, contex
301
277
  case 5: throw _d.sent();
302
278
  case 6:
303
279
  parsedBody = parsedOutput.body;
304
- $metadata = deserializeMetadata(output);
305
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
306
- response = new __BaseException({
307
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
308
- $fault: "client",
309
- $metadata: $metadata,
280
+ throwDefaultError({
281
+ output: output,
282
+ parsedBody: parsedBody,
283
+ exceptionCtor: __BaseException,
284
+ errorCode: errorCode,
310
285
  });
311
- throw __decorateServiceException(response, parsedBody);
286
+ _d.label = 7;
287
+ case 7: return [2];
312
288
  }
313
289
  });
314
290
  }); };
@@ -320,28 +296,26 @@ export var deserializeAws_restJson1DescribeVoicesCommand = function (output, con
320
296
  if (output.statusCode !== 200 && output.statusCode >= 300) {
321
297
  return [2, deserializeAws_restJson1DescribeVoicesCommandError(output, context)];
322
298
  }
323
- contents = {
299
+ contents = map({
324
300
  $metadata: deserializeMetadata(output),
325
- NextToken: undefined,
326
- Voices: undefined,
327
- };
301
+ });
328
302
  _a = __expectNonNull;
329
303
  _b = __expectObject;
330
304
  return [4, parseBody(output.body, context)];
331
305
  case 1:
332
306
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
333
- if (data.NextToken !== undefined && data.NextToken !== null) {
307
+ if (data.NextToken != null) {
334
308
  contents.NextToken = __expectString(data.NextToken);
335
309
  }
336
- if (data.Voices !== undefined && data.Voices !== null) {
310
+ if (data.Voices != null) {
337
311
  contents.Voices = deserializeAws_restJson1VoiceList(data.Voices, context);
338
312
  }
339
- return [2, Promise.resolve(contents)];
313
+ return [2, contents];
340
314
  }
341
315
  });
342
316
  }); };
343
317
  var deserializeAws_restJson1DescribeVoicesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
344
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
318
+ var parsedOutput, _a, errorCode, _b, parsedBody;
345
319
  var _c;
346
320
  return __generator(this, function (_d) {
347
321
  switch (_d.label) {
@@ -366,14 +340,14 @@ var deserializeAws_restJson1DescribeVoicesCommandError = function (output, conte
366
340
  case 5: throw _d.sent();
367
341
  case 6:
368
342
  parsedBody = parsedOutput.body;
369
- $metadata = deserializeMetadata(output);
370
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
371
- response = new __BaseException({
372
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
373
- $fault: "client",
374
- $metadata: $metadata,
343
+ throwDefaultError({
344
+ output: output,
345
+ parsedBody: parsedBody,
346
+ exceptionCtor: __BaseException,
347
+ errorCode: errorCode,
375
348
  });
376
- throw __decorateServiceException(response, parsedBody);
349
+ _d.label = 7;
350
+ case 7: return [2];
377
351
  }
378
352
  });
379
353
  }); };
@@ -385,28 +359,26 @@ export var deserializeAws_restJson1GetLexiconCommand = function (output, context
385
359
  if (output.statusCode !== 200 && output.statusCode >= 300) {
386
360
  return [2, deserializeAws_restJson1GetLexiconCommandError(output, context)];
387
361
  }
388
- contents = {
362
+ contents = map({
389
363
  $metadata: deserializeMetadata(output),
390
- Lexicon: undefined,
391
- LexiconAttributes: undefined,
392
- };
364
+ });
393
365
  _a = __expectNonNull;
394
366
  _b = __expectObject;
395
367
  return [4, parseBody(output.body, context)];
396
368
  case 1:
397
369
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
398
- if (data.Lexicon !== undefined && data.Lexicon !== null) {
370
+ if (data.Lexicon != null) {
399
371
  contents.Lexicon = deserializeAws_restJson1Lexicon(data.Lexicon, context);
400
372
  }
401
- if (data.LexiconAttributes !== undefined && data.LexiconAttributes !== null) {
373
+ if (data.LexiconAttributes != null) {
402
374
  contents.LexiconAttributes = deserializeAws_restJson1LexiconAttributes(data.LexiconAttributes, context);
403
375
  }
404
- return [2, Promise.resolve(contents)];
376
+ return [2, contents];
405
377
  }
406
378
  });
407
379
  }); };
408
380
  var deserializeAws_restJson1GetLexiconCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
409
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
381
+ var parsedOutput, _a, errorCode, _b, parsedBody;
410
382
  var _c;
411
383
  return __generator(this, function (_d) {
412
384
  switch (_d.label) {
@@ -431,14 +403,14 @@ var deserializeAws_restJson1GetLexiconCommandError = function (output, context)
431
403
  case 5: throw _d.sent();
432
404
  case 6:
433
405
  parsedBody = parsedOutput.body;
434
- $metadata = deserializeMetadata(output);
435
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
436
- response = new __BaseException({
437
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
438
- $fault: "client",
439
- $metadata: $metadata,
406
+ throwDefaultError({
407
+ output: output,
408
+ parsedBody: parsedBody,
409
+ exceptionCtor: __BaseException,
410
+ errorCode: errorCode,
440
411
  });
441
- throw __decorateServiceException(response, parsedBody);
412
+ _d.label = 7;
413
+ case 7: return [2];
442
414
  }
443
415
  });
444
416
  }); };
@@ -450,24 +422,23 @@ export var deserializeAws_restJson1GetSpeechSynthesisTaskCommand = function (out
450
422
  if (output.statusCode !== 200 && output.statusCode >= 300) {
451
423
  return [2, deserializeAws_restJson1GetSpeechSynthesisTaskCommandError(output, context)];
452
424
  }
453
- contents = {
425
+ contents = map({
454
426
  $metadata: deserializeMetadata(output),
455
- SynthesisTask: undefined,
456
- };
427
+ });
457
428
  _a = __expectNonNull;
458
429
  _b = __expectObject;
459
430
  return [4, parseBody(output.body, context)];
460
431
  case 1:
461
432
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
462
- if (data.SynthesisTask !== undefined && data.SynthesisTask !== null) {
433
+ if (data.SynthesisTask != null) {
463
434
  contents.SynthesisTask = deserializeAws_restJson1SynthesisTask(data.SynthesisTask, context);
464
435
  }
465
- return [2, Promise.resolve(contents)];
436
+ return [2, contents];
466
437
  }
467
438
  });
468
439
  }); };
469
440
  var deserializeAws_restJson1GetSpeechSynthesisTaskCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
470
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
441
+ var parsedOutput, _a, errorCode, _b, parsedBody;
471
442
  var _c;
472
443
  return __generator(this, function (_d) {
473
444
  switch (_d.label) {
@@ -496,14 +467,14 @@ var deserializeAws_restJson1GetSpeechSynthesisTaskCommandError = function (outpu
496
467
  case 7: throw _d.sent();
497
468
  case 8:
498
469
  parsedBody = parsedOutput.body;
499
- $metadata = deserializeMetadata(output);
500
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
501
- response = new __BaseException({
502
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
503
- $fault: "client",
504
- $metadata: $metadata,
470
+ throwDefaultError({
471
+ output: output,
472
+ parsedBody: parsedBody,
473
+ exceptionCtor: __BaseException,
474
+ errorCode: errorCode,
505
475
  });
506
- throw __decorateServiceException(response, parsedBody);
476
+ _d.label = 9;
477
+ case 9: return [2];
507
478
  }
508
479
  });
509
480
  }); };
@@ -515,28 +486,26 @@ export var deserializeAws_restJson1ListLexiconsCommand = function (output, conte
515
486
  if (output.statusCode !== 200 && output.statusCode >= 300) {
516
487
  return [2, deserializeAws_restJson1ListLexiconsCommandError(output, context)];
517
488
  }
518
- contents = {
489
+ contents = map({
519
490
  $metadata: deserializeMetadata(output),
520
- Lexicons: undefined,
521
- NextToken: undefined,
522
- };
491
+ });
523
492
  _a = __expectNonNull;
524
493
  _b = __expectObject;
525
494
  return [4, parseBody(output.body, context)];
526
495
  case 1:
527
496
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
528
- if (data.Lexicons !== undefined && data.Lexicons !== null) {
497
+ if (data.Lexicons != null) {
529
498
  contents.Lexicons = deserializeAws_restJson1LexiconDescriptionList(data.Lexicons, context);
530
499
  }
531
- if (data.NextToken !== undefined && data.NextToken !== null) {
500
+ if (data.NextToken != null) {
532
501
  contents.NextToken = __expectString(data.NextToken);
533
502
  }
534
- return [2, Promise.resolve(contents)];
503
+ return [2, contents];
535
504
  }
536
505
  });
537
506
  }); };
538
507
  var deserializeAws_restJson1ListLexiconsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
539
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
508
+ var parsedOutput, _a, errorCode, _b, parsedBody;
540
509
  var _c;
541
510
  return __generator(this, function (_d) {
542
511
  switch (_d.label) {
@@ -561,14 +530,14 @@ var deserializeAws_restJson1ListLexiconsCommandError = function (output, context
561
530
  case 5: throw _d.sent();
562
531
  case 6:
563
532
  parsedBody = parsedOutput.body;
564
- $metadata = deserializeMetadata(output);
565
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
566
- response = new __BaseException({
567
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
568
- $fault: "client",
569
- $metadata: $metadata,
533
+ throwDefaultError({
534
+ output: output,
535
+ parsedBody: parsedBody,
536
+ exceptionCtor: __BaseException,
537
+ errorCode: errorCode,
570
538
  });
571
- throw __decorateServiceException(response, parsedBody);
539
+ _d.label = 7;
540
+ case 7: return [2];
572
541
  }
573
542
  });
574
543
  }); };
@@ -580,28 +549,26 @@ export var deserializeAws_restJson1ListSpeechSynthesisTasksCommand = function (o
580
549
  if (output.statusCode !== 200 && output.statusCode >= 300) {
581
550
  return [2, deserializeAws_restJson1ListSpeechSynthesisTasksCommandError(output, context)];
582
551
  }
583
- contents = {
552
+ contents = map({
584
553
  $metadata: deserializeMetadata(output),
585
- NextToken: undefined,
586
- SynthesisTasks: undefined,
587
- };
554
+ });
588
555
  _a = __expectNonNull;
589
556
  _b = __expectObject;
590
557
  return [4, parseBody(output.body, context)];
591
558
  case 1:
592
559
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
593
- if (data.NextToken !== undefined && data.NextToken !== null) {
560
+ if (data.NextToken != null) {
594
561
  contents.NextToken = __expectString(data.NextToken);
595
562
  }
596
- if (data.SynthesisTasks !== undefined && data.SynthesisTasks !== null) {
563
+ if (data.SynthesisTasks != null) {
597
564
  contents.SynthesisTasks = deserializeAws_restJson1SynthesisTasks(data.SynthesisTasks, context);
598
565
  }
599
- return [2, Promise.resolve(contents)];
566
+ return [2, contents];
600
567
  }
601
568
  });
602
569
  }); };
603
570
  var deserializeAws_restJson1ListSpeechSynthesisTasksCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
604
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
571
+ var parsedOutput, _a, errorCode, _b, parsedBody;
605
572
  var _c;
606
573
  return __generator(this, function (_d) {
607
574
  switch (_d.label) {
@@ -626,14 +593,14 @@ var deserializeAws_restJson1ListSpeechSynthesisTasksCommandError = function (out
626
593
  case 5: throw _d.sent();
627
594
  case 6:
628
595
  parsedBody = parsedOutput.body;
629
- $metadata = deserializeMetadata(output);
630
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
631
- response = new __BaseException({
632
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
633
- $fault: "client",
634
- $metadata: $metadata,
596
+ throwDefaultError({
597
+ output: output,
598
+ parsedBody: parsedBody,
599
+ exceptionCtor: __BaseException,
600
+ errorCode: errorCode,
635
601
  });
636
- throw __decorateServiceException(response, parsedBody);
602
+ _d.label = 7;
603
+ case 7: return [2];
637
604
  }
638
605
  });
639
606
  }); };
@@ -645,18 +612,18 @@ export var deserializeAws_restJson1PutLexiconCommand = function (output, context
645
612
  if (output.statusCode !== 200 && output.statusCode >= 300) {
646
613
  return [2, deserializeAws_restJson1PutLexiconCommandError(output, context)];
647
614
  }
648
- contents = {
615
+ contents = map({
649
616
  $metadata: deserializeMetadata(output),
650
- };
617
+ });
651
618
  return [4, collectBody(output.body, context)];
652
619
  case 1:
653
620
  _a.sent();
654
- return [2, Promise.resolve(contents)];
621
+ return [2, contents];
655
622
  }
656
623
  });
657
624
  }); };
658
625
  var deserializeAws_restJson1PutLexiconCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
659
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
626
+ var parsedOutput, _a, errorCode, _b, parsedBody;
660
627
  var _c;
661
628
  return __generator(this, function (_d) {
662
629
  switch (_d.label) {
@@ -701,14 +668,14 @@ var deserializeAws_restJson1PutLexiconCommandError = function (output, context)
701
668
  case 15: throw _d.sent();
702
669
  case 16:
703
670
  parsedBody = parsedOutput.body;
704
- $metadata = deserializeMetadata(output);
705
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
706
- response = new __BaseException({
707
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
708
- $fault: "client",
709
- $metadata: $metadata,
671
+ throwDefaultError({
672
+ output: output,
673
+ parsedBody: parsedBody,
674
+ exceptionCtor: __BaseException,
675
+ errorCode: errorCode,
710
676
  });
711
- throw __decorateServiceException(response, parsedBody);
677
+ _d.label = 17;
678
+ case 17: return [2];
712
679
  }
713
680
  });
714
681
  }); };
@@ -720,24 +687,23 @@ export var deserializeAws_restJson1StartSpeechSynthesisTaskCommand = function (o
720
687
  if (output.statusCode !== 200 && output.statusCode >= 300) {
721
688
  return [2, deserializeAws_restJson1StartSpeechSynthesisTaskCommandError(output, context)];
722
689
  }
723
- contents = {
690
+ contents = map({
724
691
  $metadata: deserializeMetadata(output),
725
- SynthesisTask: undefined,
726
- };
692
+ });
727
693
  _a = __expectNonNull;
728
694
  _b = __expectObject;
729
695
  return [4, parseBody(output.body, context)];
730
696
  case 1:
731
697
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
732
- if (data.SynthesisTask !== undefined && data.SynthesisTask !== null) {
698
+ if (data.SynthesisTask != null) {
733
699
  contents.SynthesisTask = deserializeAws_restJson1SynthesisTask(data.SynthesisTask, context);
734
700
  }
735
- return [2, Promise.resolve(contents)];
701
+ return [2, contents];
736
702
  }
737
703
  });
738
704
  }); };
739
705
  var deserializeAws_restJson1StartSpeechSynthesisTaskCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
740
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
706
+ var parsedOutput, _a, errorCode, _b, parsedBody;
741
707
  var _c;
742
708
  return __generator(this, function (_d) {
743
709
  switch (_d.label) {
@@ -802,14 +768,14 @@ var deserializeAws_restJson1StartSpeechSynthesisTaskCommandError = function (out
802
768
  case 25: throw _d.sent();
803
769
  case 26:
804
770
  parsedBody = parsedOutput.body;
805
- $metadata = deserializeMetadata(output);
806
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
807
- response = new __BaseException({
808
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
809
- $fault: "client",
810
- $metadata: $metadata,
771
+ throwDefaultError({
772
+ output: output,
773
+ parsedBody: parsedBody,
774
+ exceptionCtor: __BaseException,
775
+ errorCode: errorCode,
811
776
  });
812
- throw __decorateServiceException(response, parsedBody);
777
+ _d.label = 27;
778
+ case 27: return [2];
813
779
  }
814
780
  });
815
781
  }); };
@@ -819,25 +785,21 @@ export var deserializeAws_restJson1SynthesizeSpeechCommand = function (output, c
819
785
  if (output.statusCode !== 200 && output.statusCode >= 300) {
820
786
  return [2, deserializeAws_restJson1SynthesizeSpeechCommandError(output, context)];
821
787
  }
822
- contents = {
788
+ contents = map({
823
789
  $metadata: deserializeMetadata(output),
824
- AudioStream: undefined,
825
- ContentType: undefined,
826
- RequestCharacters: undefined,
827
- };
828
- if (output.headers["content-type"] !== undefined) {
829
- contents.ContentType = output.headers["content-type"];
830
- }
831
- if (output.headers["x-amzn-requestcharacters"] !== undefined) {
832
- contents.RequestCharacters = __strictParseInt32(output.headers["x-amzn-requestcharacters"]);
833
- }
790
+ ContentType: [, output.headers["content-type"]],
791
+ RequestCharacters: [
792
+ function () { return void 0 !== output.headers["x-amzn-requestcharacters"]; },
793
+ function () { return __strictParseInt32(output.headers["x-amzn-requestcharacters"]); },
794
+ ],
795
+ });
834
796
  data = output.body;
835
797
  contents.AudioStream = data;
836
- return [2, Promise.resolve(contents)];
798
+ return [2, contents];
837
799
  });
838
800
  }); };
839
801
  var deserializeAws_restJson1SynthesizeSpeechCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
840
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
802
+ var parsedOutput, _a, errorCode, _b, parsedBody;
841
803
  var _c;
842
804
  return __generator(this, function (_d) {
843
805
  switch (_d.label) {
@@ -890,23 +852,24 @@ var deserializeAws_restJson1SynthesizeSpeechCommandError = function (output, con
890
852
  case 19: throw _d.sent();
891
853
  case 20:
892
854
  parsedBody = parsedOutput.body;
893
- $metadata = deserializeMetadata(output);
894
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
895
- response = new __BaseException({
896
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
897
- $fault: "client",
898
- $metadata: $metadata,
855
+ throwDefaultError({
856
+ output: output,
857
+ parsedBody: parsedBody,
858
+ exceptionCtor: __BaseException,
859
+ errorCode: errorCode,
899
860
  });
900
- throw __decorateServiceException(response, parsedBody);
861
+ _d.label = 21;
862
+ case 21: return [2];
901
863
  }
902
864
  });
903
865
  }); };
866
+ var map = __map;
904
867
  var deserializeAws_restJson1EngineNotSupportedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
905
868
  var contents, data, exception;
906
869
  return __generator(this, function (_a) {
907
- contents = {};
870
+ contents = map({});
908
871
  data = parsedOutput.body;
909
- if (data.message !== undefined && data.message !== null) {
872
+ if (data.message != null) {
910
873
  contents.message = __expectString(data.message);
911
874
  }
912
875
  exception = new EngineNotSupportedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -916,9 +879,9 @@ var deserializeAws_restJson1EngineNotSupportedExceptionResponse = function (pars
916
879
  var deserializeAws_restJson1InvalidLexiconExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
917
880
  var contents, data, exception;
918
881
  return __generator(this, function (_a) {
919
- contents = {};
882
+ contents = map({});
920
883
  data = parsedOutput.body;
921
- if (data.message !== undefined && data.message !== null) {
884
+ if (data.message != null) {
922
885
  contents.message = __expectString(data.message);
923
886
  }
924
887
  exception = new InvalidLexiconException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -928,9 +891,9 @@ var deserializeAws_restJson1InvalidLexiconExceptionResponse = function (parsedOu
928
891
  var deserializeAws_restJson1InvalidNextTokenExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
929
892
  var contents, data, exception;
930
893
  return __generator(this, function (_a) {
931
- contents = {};
894
+ contents = map({});
932
895
  data = parsedOutput.body;
933
- if (data.message !== undefined && data.message !== null) {
896
+ if (data.message != null) {
934
897
  contents.message = __expectString(data.message);
935
898
  }
936
899
  exception = new InvalidNextTokenException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -940,9 +903,9 @@ var deserializeAws_restJson1InvalidNextTokenExceptionResponse = function (parsed
940
903
  var deserializeAws_restJson1InvalidS3BucketExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
941
904
  var contents, data, exception;
942
905
  return __generator(this, function (_a) {
943
- contents = {};
906
+ contents = map({});
944
907
  data = parsedOutput.body;
945
- if (data.message !== undefined && data.message !== null) {
908
+ if (data.message != null) {
946
909
  contents.message = __expectString(data.message);
947
910
  }
948
911
  exception = new InvalidS3BucketException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -952,9 +915,9 @@ var deserializeAws_restJson1InvalidS3BucketExceptionResponse = function (parsedO
952
915
  var deserializeAws_restJson1InvalidS3KeyExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
953
916
  var contents, data, exception;
954
917
  return __generator(this, function (_a) {
955
- contents = {};
918
+ contents = map({});
956
919
  data = parsedOutput.body;
957
- if (data.message !== undefined && data.message !== null) {
920
+ if (data.message != null) {
958
921
  contents.message = __expectString(data.message);
959
922
  }
960
923
  exception = new InvalidS3KeyException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -964,9 +927,9 @@ var deserializeAws_restJson1InvalidS3KeyExceptionResponse = function (parsedOutp
964
927
  var deserializeAws_restJson1InvalidSampleRateExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
965
928
  var contents, data, exception;
966
929
  return __generator(this, function (_a) {
967
- contents = {};
930
+ contents = map({});
968
931
  data = parsedOutput.body;
969
- if (data.message !== undefined && data.message !== null) {
932
+ if (data.message != null) {
970
933
  contents.message = __expectString(data.message);
971
934
  }
972
935
  exception = new InvalidSampleRateException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -976,9 +939,9 @@ var deserializeAws_restJson1InvalidSampleRateExceptionResponse = function (parse
976
939
  var deserializeAws_restJson1InvalidSnsTopicArnExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
977
940
  var contents, data, exception;
978
941
  return __generator(this, function (_a) {
979
- contents = {};
942
+ contents = map({});
980
943
  data = parsedOutput.body;
981
- if (data.message !== undefined && data.message !== null) {
944
+ if (data.message != null) {
982
945
  contents.message = __expectString(data.message);
983
946
  }
984
947
  exception = new InvalidSnsTopicArnException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -988,9 +951,9 @@ var deserializeAws_restJson1InvalidSnsTopicArnExceptionResponse = function (pars
988
951
  var deserializeAws_restJson1InvalidSsmlExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
989
952
  var contents, data, exception;
990
953
  return __generator(this, function (_a) {
991
- contents = {};
954
+ contents = map({});
992
955
  data = parsedOutput.body;
993
- if (data.message !== undefined && data.message !== null) {
956
+ if (data.message != null) {
994
957
  contents.message = __expectString(data.message);
995
958
  }
996
959
  exception = new InvalidSsmlException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -1000,9 +963,9 @@ var deserializeAws_restJson1InvalidSsmlExceptionResponse = function (parsedOutpu
1000
963
  var deserializeAws_restJson1InvalidTaskIdExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1001
964
  var contents, data, exception;
1002
965
  return __generator(this, function (_a) {
1003
- contents = {};
966
+ contents = map({});
1004
967
  data = parsedOutput.body;
1005
- if (data.message !== undefined && data.message !== null) {
968
+ if (data.message != null) {
1006
969
  contents.message = __expectString(data.message);
1007
970
  }
1008
971
  exception = new InvalidTaskIdException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -1012,9 +975,9 @@ var deserializeAws_restJson1InvalidTaskIdExceptionResponse = function (parsedOut
1012
975
  var deserializeAws_restJson1LanguageNotSupportedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1013
976
  var contents, data, exception;
1014
977
  return __generator(this, function (_a) {
1015
- contents = {};
978
+ contents = map({});
1016
979
  data = parsedOutput.body;
1017
- if (data.message !== undefined && data.message !== null) {
980
+ if (data.message != null) {
1018
981
  contents.message = __expectString(data.message);
1019
982
  }
1020
983
  exception = new LanguageNotSupportedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -1024,9 +987,9 @@ var deserializeAws_restJson1LanguageNotSupportedExceptionResponse = function (pa
1024
987
  var deserializeAws_restJson1LexiconNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1025
988
  var contents, data, exception;
1026
989
  return __generator(this, function (_a) {
1027
- contents = {};
990
+ contents = map({});
1028
991
  data = parsedOutput.body;
1029
- if (data.message !== undefined && data.message !== null) {
992
+ if (data.message != null) {
1030
993
  contents.message = __expectString(data.message);
1031
994
  }
1032
995
  exception = new LexiconNotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -1036,9 +999,9 @@ var deserializeAws_restJson1LexiconNotFoundExceptionResponse = function (parsedO
1036
999
  var deserializeAws_restJson1LexiconSizeExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1037
1000
  var contents, data, exception;
1038
1001
  return __generator(this, function (_a) {
1039
- contents = {};
1002
+ contents = map({});
1040
1003
  data = parsedOutput.body;
1041
- if (data.message !== undefined && data.message !== null) {
1004
+ if (data.message != null) {
1042
1005
  contents.message = __expectString(data.message);
1043
1006
  }
1044
1007
  exception = new LexiconSizeExceededException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -1048,9 +1011,9 @@ var deserializeAws_restJson1LexiconSizeExceededExceptionResponse = function (par
1048
1011
  var deserializeAws_restJson1MarksNotSupportedForFormatExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1049
1012
  var contents, data, exception;
1050
1013
  return __generator(this, function (_a) {
1051
- contents = {};
1014
+ contents = map({});
1052
1015
  data = parsedOutput.body;
1053
- if (data.message !== undefined && data.message !== null) {
1016
+ if (data.message != null) {
1054
1017
  contents.message = __expectString(data.message);
1055
1018
  }
1056
1019
  exception = new MarksNotSupportedForFormatException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -1060,9 +1023,9 @@ var deserializeAws_restJson1MarksNotSupportedForFormatExceptionResponse = functi
1060
1023
  var deserializeAws_restJson1MaxLexemeLengthExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1061
1024
  var contents, data, exception;
1062
1025
  return __generator(this, function (_a) {
1063
- contents = {};
1026
+ contents = map({});
1064
1027
  data = parsedOutput.body;
1065
- if (data.message !== undefined && data.message !== null) {
1028
+ if (data.message != null) {
1066
1029
  contents.message = __expectString(data.message);
1067
1030
  }
1068
1031
  exception = new MaxLexemeLengthExceededException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -1072,9 +1035,9 @@ var deserializeAws_restJson1MaxLexemeLengthExceededExceptionResponse = function
1072
1035
  var deserializeAws_restJson1MaxLexiconsNumberExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1073
1036
  var contents, data, exception;
1074
1037
  return __generator(this, function (_a) {
1075
- contents = {};
1038
+ contents = map({});
1076
1039
  data = parsedOutput.body;
1077
- if (data.message !== undefined && data.message !== null) {
1040
+ if (data.message != null) {
1078
1041
  contents.message = __expectString(data.message);
1079
1042
  }
1080
1043
  exception = new MaxLexiconsNumberExceededException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -1084,9 +1047,9 @@ var deserializeAws_restJson1MaxLexiconsNumberExceededExceptionResponse = functio
1084
1047
  var deserializeAws_restJson1ServiceFailureExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1085
1048
  var contents, data, exception;
1086
1049
  return __generator(this, function (_a) {
1087
- contents = {};
1050
+ contents = map({});
1088
1051
  data = parsedOutput.body;
1089
- if (data.message !== undefined && data.message !== null) {
1052
+ if (data.message != null) {
1090
1053
  contents.message = __expectString(data.message);
1091
1054
  }
1092
1055
  exception = new ServiceFailureException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -1096,9 +1059,9 @@ var deserializeAws_restJson1ServiceFailureExceptionResponse = function (parsedOu
1096
1059
  var deserializeAws_restJson1SsmlMarksNotSupportedForTextTypeExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1097
1060
  var contents, data, exception;
1098
1061
  return __generator(this, function (_a) {
1099
- contents = {};
1062
+ contents = map({});
1100
1063
  data = parsedOutput.body;
1101
- if (data.message !== undefined && data.message !== null) {
1064
+ if (data.message != null) {
1102
1065
  contents.message = __expectString(data.message);
1103
1066
  }
1104
1067
  exception = new SsmlMarksNotSupportedForTextTypeException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -1108,9 +1071,9 @@ var deserializeAws_restJson1SsmlMarksNotSupportedForTextTypeExceptionResponse =
1108
1071
  var deserializeAws_restJson1SynthesisTaskNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1109
1072
  var contents, data, exception;
1110
1073
  return __generator(this, function (_a) {
1111
- contents = {};
1074
+ contents = map({});
1112
1075
  data = parsedOutput.body;
1113
- if (data.message !== undefined && data.message !== null) {
1076
+ if (data.message != null) {
1114
1077
  contents.message = __expectString(data.message);
1115
1078
  }
1116
1079
  exception = new SynthesisTaskNotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -1120,9 +1083,9 @@ var deserializeAws_restJson1SynthesisTaskNotFoundExceptionResponse = function (p
1120
1083
  var deserializeAws_restJson1TextLengthExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1121
1084
  var contents, data, exception;
1122
1085
  return __generator(this, function (_a) {
1123
- contents = {};
1086
+ contents = map({});
1124
1087
  data = parsedOutput.body;
1125
- if (data.message !== undefined && data.message !== null) {
1088
+ if (data.message != null) {
1126
1089
  contents.message = __expectString(data.message);
1127
1090
  }
1128
1091
  exception = new TextLengthExceededException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -1132,9 +1095,9 @@ var deserializeAws_restJson1TextLengthExceededExceptionResponse = function (pars
1132
1095
  var deserializeAws_restJson1UnsupportedPlsAlphabetExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1133
1096
  var contents, data, exception;
1134
1097
  return __generator(this, function (_a) {
1135
- contents = {};
1098
+ contents = map({});
1136
1099
  data = parsedOutput.body;
1137
- if (data.message !== undefined && data.message !== null) {
1100
+ if (data.message != null) {
1138
1101
  contents.message = __expectString(data.message);
1139
1102
  }
1140
1103
  exception = new UnsupportedPlsAlphabetException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -1144,9 +1107,9 @@ var deserializeAws_restJson1UnsupportedPlsAlphabetExceptionResponse = function (
1144
1107
  var deserializeAws_restJson1UnsupportedPlsLanguageExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1145
1108
  var contents, data, exception;
1146
1109
  return __generator(this, function (_a) {
1147
- contents = {};
1110
+ contents = map({});
1148
1111
  data = parsedOutput.body;
1149
- if (data.message !== undefined && data.message !== null) {
1112
+ if (data.message != null) {
1150
1113
  contents.message = __expectString(data.message);
1151
1114
  }
1152
1115
  exception = new UnsupportedPlsLanguageException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -1157,9 +1120,6 @@ var serializeAws_restJson1LexiconNameList = function (input, context) {
1157
1120
  return input
1158
1121
  .filter(function (e) { return e != null; })
1159
1122
  .map(function (entry) {
1160
- if (entry === null) {
1161
- return null;
1162
- }
1163
1123
  return entry;
1164
1124
  });
1165
1125
  };
@@ -1167,9 +1127,6 @@ var serializeAws_restJson1SpeechMarkTypeList = function (input, context) {
1167
1127
  return input
1168
1128
  .filter(function (e) { return e != null; })
1169
1129
  .map(function (entry) {
1170
- if (entry === null) {
1171
- return null;
1172
- }
1173
1130
  return entry;
1174
1131
  });
1175
1132
  };