@aws-sdk/client-marketplace-catalog 3.52.0 → 3.53.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.
@@ -3,6 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.deserializeAws_restJson1StartChangeSetCommand = exports.deserializeAws_restJson1ListEntitiesCommand = exports.deserializeAws_restJson1ListChangeSetsCommand = exports.deserializeAws_restJson1DescribeEntityCommand = exports.deserializeAws_restJson1DescribeChangeSetCommand = exports.deserializeAws_restJson1CancelChangeSetCommand = exports.serializeAws_restJson1StartChangeSetCommand = exports.serializeAws_restJson1ListEntitiesCommand = exports.serializeAws_restJson1ListChangeSetsCommand = exports.serializeAws_restJson1DescribeEntityCommand = exports.serializeAws_restJson1DescribeChangeSetCommand = exports.serializeAws_restJson1CancelChangeSetCommand = void 0;
4
4
  const protocol_http_1 = require("@aws-sdk/protocol-http");
5
5
  const smithy_client_1 = require("@aws-sdk/smithy-client");
6
+ const MarketplaceCatalogServiceException_1 = require("../models/MarketplaceCatalogServiceException");
7
+ const models_0_1 = require("../models/models_0");
6
8
  const serializeAws_restJson1CancelChangeSetCommand = async (input, context) => {
7
9
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
8
10
  const headers = {};
@@ -175,67 +177,31 @@ const deserializeAws_restJson1CancelChangeSetCommandError = async (output, conte
175
177
  switch (errorCode) {
176
178
  case "AccessDeniedException":
177
179
  case "com.amazonaws.marketplacecatalog#AccessDeniedException":
178
- response = {
179
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
180
- name: errorCode,
181
- $metadata: deserializeMetadata(output),
182
- };
183
- break;
180
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
184
181
  case "InternalServiceException":
185
182
  case "com.amazonaws.marketplacecatalog#InternalServiceException":
186
- response = {
187
- ...(await deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context)),
188
- name: errorCode,
189
- $metadata: deserializeMetadata(output),
190
- };
191
- break;
183
+ throw await deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context);
192
184
  case "ResourceInUseException":
193
185
  case "com.amazonaws.marketplacecatalog#ResourceInUseException":
194
- response = {
195
- ...(await deserializeAws_restJson1ResourceInUseExceptionResponse(parsedOutput, context)),
196
- name: errorCode,
197
- $metadata: deserializeMetadata(output),
198
- };
199
- break;
186
+ throw await deserializeAws_restJson1ResourceInUseExceptionResponse(parsedOutput, context);
200
187
  case "ResourceNotFoundException":
201
188
  case "com.amazonaws.marketplacecatalog#ResourceNotFoundException":
202
- response = {
203
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
204
- name: errorCode,
205
- $metadata: deserializeMetadata(output),
206
- };
207
- break;
189
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
208
190
  case "ThrottlingException":
209
191
  case "com.amazonaws.marketplacecatalog#ThrottlingException":
210
- response = {
211
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
212
- name: errorCode,
213
- $metadata: deserializeMetadata(output),
214
- };
215
- break;
192
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
216
193
  case "ValidationException":
217
194
  case "com.amazonaws.marketplacecatalog#ValidationException":
218
- response = {
219
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
220
- name: errorCode,
221
- $metadata: deserializeMetadata(output),
222
- };
223
- break;
195
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
224
196
  default:
225
197
  const parsedBody = parsedOutput.body;
226
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
227
- response = {
228
- ...parsedBody,
229
- name: `${errorCode}`,
230
- message: parsedBody.message || parsedBody.Message || errorCode,
198
+ response = new MarketplaceCatalogServiceException_1.MarketplaceCatalogServiceException({
199
+ name: parsedBody.code || parsedBody.Code || errorCode,
231
200
  $fault: "client",
232
201
  $metadata: deserializeMetadata(output),
233
- };
202
+ });
203
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
234
204
  }
235
- const message = response.message || response.Message || errorCode;
236
- response.message = message;
237
- delete response.Message;
238
- return Promise.reject(Object.assign(new Error(message), response));
239
205
  };
240
206
  const deserializeAws_restJson1DescribeChangeSetCommand = async (output, context) => {
241
207
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -295,59 +261,28 @@ const deserializeAws_restJson1DescribeChangeSetCommandError = async (output, con
295
261
  switch (errorCode) {
296
262
  case "AccessDeniedException":
297
263
  case "com.amazonaws.marketplacecatalog#AccessDeniedException":
298
- response = {
299
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
300
- name: errorCode,
301
- $metadata: deserializeMetadata(output),
302
- };
303
- break;
264
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
304
265
  case "InternalServiceException":
305
266
  case "com.amazonaws.marketplacecatalog#InternalServiceException":
306
- response = {
307
- ...(await deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context)),
308
- name: errorCode,
309
- $metadata: deserializeMetadata(output),
310
- };
311
- break;
267
+ throw await deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context);
312
268
  case "ResourceNotFoundException":
313
269
  case "com.amazonaws.marketplacecatalog#ResourceNotFoundException":
314
- response = {
315
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
316
- name: errorCode,
317
- $metadata: deserializeMetadata(output),
318
- };
319
- break;
270
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
320
271
  case "ThrottlingException":
321
272
  case "com.amazonaws.marketplacecatalog#ThrottlingException":
322
- response = {
323
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
324
- name: errorCode,
325
- $metadata: deserializeMetadata(output),
326
- };
327
- break;
273
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
328
274
  case "ValidationException":
329
275
  case "com.amazonaws.marketplacecatalog#ValidationException":
330
- response = {
331
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
332
- name: errorCode,
333
- $metadata: deserializeMetadata(output),
334
- };
335
- break;
276
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
336
277
  default:
337
278
  const parsedBody = parsedOutput.body;
338
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
339
- response = {
340
- ...parsedBody,
341
- name: `${errorCode}`,
342
- message: parsedBody.message || parsedBody.Message || errorCode,
279
+ response = new MarketplaceCatalogServiceException_1.MarketplaceCatalogServiceException({
280
+ name: parsedBody.code || parsedBody.Code || errorCode,
343
281
  $fault: "client",
344
282
  $metadata: deserializeMetadata(output),
345
- };
283
+ });
284
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
346
285
  }
347
- const message = response.message || response.Message || errorCode;
348
- response.message = message;
349
- delete response.Message;
350
- return Promise.reject(Object.assign(new Error(message), response));
351
286
  };
352
287
  const deserializeAws_restJson1DescribeEntityCommand = async (output, context) => {
353
288
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -391,67 +326,31 @@ const deserializeAws_restJson1DescribeEntityCommandError = async (output, contex
391
326
  switch (errorCode) {
392
327
  case "AccessDeniedException":
393
328
  case "com.amazonaws.marketplacecatalog#AccessDeniedException":
394
- response = {
395
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
396
- name: errorCode,
397
- $metadata: deserializeMetadata(output),
398
- };
399
- break;
329
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
400
330
  case "InternalServiceException":
401
331
  case "com.amazonaws.marketplacecatalog#InternalServiceException":
402
- response = {
403
- ...(await deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context)),
404
- name: errorCode,
405
- $metadata: deserializeMetadata(output),
406
- };
407
- break;
332
+ throw await deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context);
408
333
  case "ResourceNotFoundException":
409
334
  case "com.amazonaws.marketplacecatalog#ResourceNotFoundException":
410
- response = {
411
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
412
- name: errorCode,
413
- $metadata: deserializeMetadata(output),
414
- };
415
- break;
335
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
416
336
  case "ResourceNotSupportedException":
417
337
  case "com.amazonaws.marketplacecatalog#ResourceNotSupportedException":
418
- response = {
419
- ...(await deserializeAws_restJson1ResourceNotSupportedExceptionResponse(parsedOutput, context)),
420
- name: errorCode,
421
- $metadata: deserializeMetadata(output),
422
- };
423
- break;
338
+ throw await deserializeAws_restJson1ResourceNotSupportedExceptionResponse(parsedOutput, context);
424
339
  case "ThrottlingException":
425
340
  case "com.amazonaws.marketplacecatalog#ThrottlingException":
426
- response = {
427
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
428
- name: errorCode,
429
- $metadata: deserializeMetadata(output),
430
- };
431
- break;
341
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
432
342
  case "ValidationException":
433
343
  case "com.amazonaws.marketplacecatalog#ValidationException":
434
- response = {
435
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
436
- name: errorCode,
437
- $metadata: deserializeMetadata(output),
438
- };
439
- break;
344
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
440
345
  default:
441
346
  const parsedBody = parsedOutput.body;
442
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
443
- response = {
444
- ...parsedBody,
445
- name: `${errorCode}`,
446
- message: parsedBody.message || parsedBody.Message || errorCode,
347
+ response = new MarketplaceCatalogServiceException_1.MarketplaceCatalogServiceException({
348
+ name: parsedBody.code || parsedBody.Code || errorCode,
447
349
  $fault: "client",
448
350
  $metadata: deserializeMetadata(output),
449
- };
351
+ });
352
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
450
353
  }
451
- const message = response.message || response.Message || errorCode;
452
- response.message = message;
453
- delete response.Message;
454
- return Promise.reject(Object.assign(new Error(message), response));
455
354
  };
456
355
  const deserializeAws_restJson1ListChangeSetsCommand = async (output, context) => {
457
356
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -483,51 +382,25 @@ const deserializeAws_restJson1ListChangeSetsCommandError = async (output, contex
483
382
  switch (errorCode) {
484
383
  case "AccessDeniedException":
485
384
  case "com.amazonaws.marketplacecatalog#AccessDeniedException":
486
- response = {
487
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
488
- name: errorCode,
489
- $metadata: deserializeMetadata(output),
490
- };
491
- break;
385
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
492
386
  case "InternalServiceException":
493
387
  case "com.amazonaws.marketplacecatalog#InternalServiceException":
494
- response = {
495
- ...(await deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context)),
496
- name: errorCode,
497
- $metadata: deserializeMetadata(output),
498
- };
499
- break;
388
+ throw await deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context);
500
389
  case "ThrottlingException":
501
390
  case "com.amazonaws.marketplacecatalog#ThrottlingException":
502
- response = {
503
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
504
- name: errorCode,
505
- $metadata: deserializeMetadata(output),
506
- };
507
- break;
391
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
508
392
  case "ValidationException":
509
393
  case "com.amazonaws.marketplacecatalog#ValidationException":
510
- response = {
511
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
512
- name: errorCode,
513
- $metadata: deserializeMetadata(output),
514
- };
515
- break;
394
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
516
395
  default:
517
396
  const parsedBody = parsedOutput.body;
518
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
519
- response = {
520
- ...parsedBody,
521
- name: `${errorCode}`,
522
- message: parsedBody.message || parsedBody.Message || errorCode,
397
+ response = new MarketplaceCatalogServiceException_1.MarketplaceCatalogServiceException({
398
+ name: parsedBody.code || parsedBody.Code || errorCode,
523
399
  $fault: "client",
524
400
  $metadata: deserializeMetadata(output),
525
- };
401
+ });
402
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
526
403
  }
527
- const message = response.message || response.Message || errorCode;
528
- response.message = message;
529
- delete response.Message;
530
- return Promise.reject(Object.assign(new Error(message), response));
531
404
  };
532
405
  const deserializeAws_restJson1ListEntitiesCommand = async (output, context) => {
533
406
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -559,59 +432,28 @@ const deserializeAws_restJson1ListEntitiesCommandError = async (output, context)
559
432
  switch (errorCode) {
560
433
  case "AccessDeniedException":
561
434
  case "com.amazonaws.marketplacecatalog#AccessDeniedException":
562
- response = {
563
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
564
- name: errorCode,
565
- $metadata: deserializeMetadata(output),
566
- };
567
- break;
435
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
568
436
  case "InternalServiceException":
569
437
  case "com.amazonaws.marketplacecatalog#InternalServiceException":
570
- response = {
571
- ...(await deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context)),
572
- name: errorCode,
573
- $metadata: deserializeMetadata(output),
574
- };
575
- break;
438
+ throw await deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context);
576
439
  case "ResourceNotFoundException":
577
440
  case "com.amazonaws.marketplacecatalog#ResourceNotFoundException":
578
- response = {
579
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
580
- name: errorCode,
581
- $metadata: deserializeMetadata(output),
582
- };
583
- break;
441
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
584
442
  case "ThrottlingException":
585
443
  case "com.amazonaws.marketplacecatalog#ThrottlingException":
586
- response = {
587
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
588
- name: errorCode,
589
- $metadata: deserializeMetadata(output),
590
- };
591
- break;
444
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
592
445
  case "ValidationException":
593
446
  case "com.amazonaws.marketplacecatalog#ValidationException":
594
- response = {
595
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
596
- name: errorCode,
597
- $metadata: deserializeMetadata(output),
598
- };
599
- break;
447
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
600
448
  default:
601
449
  const parsedBody = parsedOutput.body;
602
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
603
- response = {
604
- ...parsedBody,
605
- name: `${errorCode}`,
606
- message: parsedBody.message || parsedBody.Message || errorCode,
450
+ response = new MarketplaceCatalogServiceException_1.MarketplaceCatalogServiceException({
451
+ name: parsedBody.code || parsedBody.Code || errorCode,
607
452
  $fault: "client",
608
453
  $metadata: deserializeMetadata(output),
609
- };
454
+ });
455
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
610
456
  }
611
- const message = response.message || response.Message || errorCode;
612
- response.message = message;
613
- delete response.Message;
614
- return Promise.reject(Object.assign(new Error(message), response));
615
457
  };
616
458
  const deserializeAws_restJson1StartChangeSetCommand = async (output, context) => {
617
459
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -643,179 +485,130 @@ const deserializeAws_restJson1StartChangeSetCommandError = async (output, contex
643
485
  switch (errorCode) {
644
486
  case "AccessDeniedException":
645
487
  case "com.amazonaws.marketplacecatalog#AccessDeniedException":
646
- response = {
647
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
648
- name: errorCode,
649
- $metadata: deserializeMetadata(output),
650
- };
651
- break;
488
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
652
489
  case "InternalServiceException":
653
490
  case "com.amazonaws.marketplacecatalog#InternalServiceException":
654
- response = {
655
- ...(await deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context)),
656
- name: errorCode,
657
- $metadata: deserializeMetadata(output),
658
- };
659
- break;
491
+ throw await deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context);
660
492
  case "ResourceInUseException":
661
493
  case "com.amazonaws.marketplacecatalog#ResourceInUseException":
662
- response = {
663
- ...(await deserializeAws_restJson1ResourceInUseExceptionResponse(parsedOutput, context)),
664
- name: errorCode,
665
- $metadata: deserializeMetadata(output),
666
- };
667
- break;
494
+ throw await deserializeAws_restJson1ResourceInUseExceptionResponse(parsedOutput, context);
668
495
  case "ResourceNotFoundException":
669
496
  case "com.amazonaws.marketplacecatalog#ResourceNotFoundException":
670
- response = {
671
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
672
- name: errorCode,
673
- $metadata: deserializeMetadata(output),
674
- };
675
- break;
497
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
676
498
  case "ServiceQuotaExceededException":
677
499
  case "com.amazonaws.marketplacecatalog#ServiceQuotaExceededException":
678
- response = {
679
- ...(await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)),
680
- name: errorCode,
681
- $metadata: deserializeMetadata(output),
682
- };
683
- break;
500
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
684
501
  case "ThrottlingException":
685
502
  case "com.amazonaws.marketplacecatalog#ThrottlingException":
686
- response = {
687
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
688
- name: errorCode,
689
- $metadata: deserializeMetadata(output),
690
- };
691
- break;
503
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
692
504
  case "ValidationException":
693
505
  case "com.amazonaws.marketplacecatalog#ValidationException":
694
- response = {
695
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
696
- name: errorCode,
697
- $metadata: deserializeMetadata(output),
698
- };
699
- break;
506
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
700
507
  default:
701
508
  const parsedBody = parsedOutput.body;
702
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
703
- response = {
704
- ...parsedBody,
705
- name: `${errorCode}`,
706
- message: parsedBody.message || parsedBody.Message || errorCode,
509
+ response = new MarketplaceCatalogServiceException_1.MarketplaceCatalogServiceException({
510
+ name: parsedBody.code || parsedBody.Code || errorCode,
707
511
  $fault: "client",
708
512
  $metadata: deserializeMetadata(output),
709
- };
513
+ });
514
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
710
515
  }
711
- const message = response.message || response.Message || errorCode;
712
- response.message = message;
713
- delete response.Message;
714
- return Promise.reject(Object.assign(new Error(message), response));
715
516
  };
716
517
  const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
717
- const contents = {
718
- name: "AccessDeniedException",
719
- $fault: "client",
720
- $metadata: deserializeMetadata(parsedOutput),
721
- Message: undefined,
722
- };
518
+ const contents = {};
723
519
  const data = parsedOutput.body;
724
520
  if (data.Message !== undefined && data.Message !== null) {
725
521
  contents.Message = smithy_client_1.expectString(data.Message);
726
522
  }
727
- return contents;
523
+ const exception = new models_0_1.AccessDeniedException({
524
+ $metadata: deserializeMetadata(parsedOutput),
525
+ ...contents,
526
+ });
527
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
728
528
  };
729
529
  const deserializeAws_restJson1InternalServiceExceptionResponse = async (parsedOutput, context) => {
730
- const contents = {
731
- name: "InternalServiceException",
732
- $fault: "server",
733
- $metadata: deserializeMetadata(parsedOutput),
734
- Message: undefined,
735
- };
530
+ const contents = {};
736
531
  const data = parsedOutput.body;
737
532
  if (data.Message !== undefined && data.Message !== null) {
738
533
  contents.Message = smithy_client_1.expectString(data.Message);
739
534
  }
740
- return contents;
535
+ const exception = new models_0_1.InternalServiceException({
536
+ $metadata: deserializeMetadata(parsedOutput),
537
+ ...contents,
538
+ });
539
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
741
540
  };
742
541
  const deserializeAws_restJson1ResourceInUseExceptionResponse = async (parsedOutput, context) => {
743
- const contents = {
744
- name: "ResourceInUseException",
745
- $fault: "client",
746
- $metadata: deserializeMetadata(parsedOutput),
747
- Message: undefined,
748
- };
542
+ const contents = {};
749
543
  const data = parsedOutput.body;
750
544
  if (data.Message !== undefined && data.Message !== null) {
751
545
  contents.Message = smithy_client_1.expectString(data.Message);
752
546
  }
753
- return contents;
547
+ const exception = new models_0_1.ResourceInUseException({
548
+ $metadata: deserializeMetadata(parsedOutput),
549
+ ...contents,
550
+ });
551
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
754
552
  };
755
553
  const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
756
- const contents = {
757
- name: "ResourceNotFoundException",
758
- $fault: "client",
759
- $metadata: deserializeMetadata(parsedOutput),
760
- Message: undefined,
761
- };
554
+ const contents = {};
762
555
  const data = parsedOutput.body;
763
556
  if (data.Message !== undefined && data.Message !== null) {
764
557
  contents.Message = smithy_client_1.expectString(data.Message);
765
558
  }
766
- return contents;
559
+ const exception = new models_0_1.ResourceNotFoundException({
560
+ $metadata: deserializeMetadata(parsedOutput),
561
+ ...contents,
562
+ });
563
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
767
564
  };
768
565
  const deserializeAws_restJson1ResourceNotSupportedExceptionResponse = async (parsedOutput, context) => {
769
- const contents = {
770
- name: "ResourceNotSupportedException",
771
- $fault: "client",
772
- $metadata: deserializeMetadata(parsedOutput),
773
- Message: undefined,
774
- };
566
+ const contents = {};
775
567
  const data = parsedOutput.body;
776
568
  if (data.Message !== undefined && data.Message !== null) {
777
569
  contents.Message = smithy_client_1.expectString(data.Message);
778
570
  }
779
- return contents;
571
+ const exception = new models_0_1.ResourceNotSupportedException({
572
+ $metadata: deserializeMetadata(parsedOutput),
573
+ ...contents,
574
+ });
575
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
780
576
  };
781
577
  const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (parsedOutput, context) => {
782
- const contents = {
783
- name: "ServiceQuotaExceededException",
784
- $fault: "client",
785
- $metadata: deserializeMetadata(parsedOutput),
786
- Message: undefined,
787
- };
578
+ const contents = {};
788
579
  const data = parsedOutput.body;
789
580
  if (data.Message !== undefined && data.Message !== null) {
790
581
  contents.Message = smithy_client_1.expectString(data.Message);
791
582
  }
792
- return contents;
583
+ const exception = new models_0_1.ServiceQuotaExceededException({
584
+ $metadata: deserializeMetadata(parsedOutput),
585
+ ...contents,
586
+ });
587
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
793
588
  };
794
589
  const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput, context) => {
795
- const contents = {
796
- name: "ThrottlingException",
797
- $fault: "client",
798
- $metadata: deserializeMetadata(parsedOutput),
799
- Message: undefined,
800
- };
590
+ const contents = {};
801
591
  const data = parsedOutput.body;
802
592
  if (data.Message !== undefined && data.Message !== null) {
803
593
  contents.Message = smithy_client_1.expectString(data.Message);
804
594
  }
805
- return contents;
595
+ const exception = new models_0_1.ThrottlingException({
596
+ $metadata: deserializeMetadata(parsedOutput),
597
+ ...contents,
598
+ });
599
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
806
600
  };
807
601
  const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput, context) => {
808
- const contents = {
809
- name: "ValidationException",
810
- $fault: "client",
811
- $metadata: deserializeMetadata(parsedOutput),
812
- Message: undefined,
813
- };
602
+ const contents = {};
814
603
  const data = parsedOutput.body;
815
604
  if (data.Message !== undefined && data.Message !== null) {
816
605
  contents.Message = smithy_client_1.expectString(data.Message);
817
606
  }
818
- return contents;
607
+ const exception = new models_0_1.ValidationException({
608
+ $metadata: deserializeMetadata(parsedOutput),
609
+ ...contents,
610
+ });
611
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
819
612
  };
820
613
  const serializeAws_restJson1Change = (input, context) => {
821
614
  return {
@@ -876,7 +669,7 @@ const serializeAws_restJson1ValueList = (input, context) => {
876
669
  });
877
670
  };
878
671
  const deserializeAws_restJson1ChangeSetDescription = (output, context) => {
879
- return (output || [])
672
+ const retVal = (output || [])
880
673
  .filter((e) => e != null)
881
674
  .map((entry) => {
882
675
  if (entry === null) {
@@ -884,9 +677,10 @@ const deserializeAws_restJson1ChangeSetDescription = (output, context) => {
884
677
  }
885
678
  return deserializeAws_restJson1ChangeSummary(entry, context);
886
679
  });
680
+ return retVal;
887
681
  };
888
682
  const deserializeAws_restJson1ChangeSetSummaryList = (output, context) => {
889
- return (output || [])
683
+ const retVal = (output || [])
890
684
  .filter((e) => e != null)
891
685
  .map((entry) => {
892
686
  if (entry === null) {
@@ -894,6 +688,7 @@ const deserializeAws_restJson1ChangeSetSummaryList = (output, context) => {
894
688
  }
895
689
  return deserializeAws_restJson1ChangeSetSummaryListItem(entry, context);
896
690
  });
691
+ return retVal;
897
692
  };
898
693
  const deserializeAws_restJson1ChangeSetSummaryListItem = (output, context) => {
899
694
  return {
@@ -939,7 +734,7 @@ const deserializeAws_restJson1EntitySummary = (output, context) => {
939
734
  };
940
735
  };
941
736
  const deserializeAws_restJson1EntitySummaryList = (output, context) => {
942
- return (output || [])
737
+ const retVal = (output || [])
943
738
  .filter((e) => e != null)
944
739
  .map((entry) => {
945
740
  if (entry === null) {
@@ -947,6 +742,7 @@ const deserializeAws_restJson1EntitySummaryList = (output, context) => {
947
742
  }
948
743
  return deserializeAws_restJson1EntitySummary(entry, context);
949
744
  });
745
+ return retVal;
950
746
  };
951
747
  const deserializeAws_restJson1ErrorDetail = (output, context) => {
952
748
  return {
@@ -955,7 +751,7 @@ const deserializeAws_restJson1ErrorDetail = (output, context) => {
955
751
  };
956
752
  };
957
753
  const deserializeAws_restJson1ErrorDetailList = (output, context) => {
958
- return (output || [])
754
+ const retVal = (output || [])
959
755
  .filter((e) => e != null)
960
756
  .map((entry) => {
961
757
  if (entry === null) {
@@ -963,9 +759,10 @@ const deserializeAws_restJson1ErrorDetailList = (output, context) => {
963
759
  }
964
760
  return deserializeAws_restJson1ErrorDetail(entry, context);
965
761
  });
762
+ return retVal;
966
763
  };
967
764
  const deserializeAws_restJson1ResourceIdList = (output, context) => {
968
- return (output || [])
765
+ const retVal = (output || [])
969
766
  .filter((e) => e != null)
970
767
  .map((entry) => {
971
768
  if (entry === null) {
@@ -973,6 +770,7 @@ const deserializeAws_restJson1ResourceIdList = (output, context) => {
973
770
  }
974
771
  return smithy_client_1.expectString(entry);
975
772
  });
773
+ return retVal;
976
774
  };
977
775
  const deserializeMetadata = (output) => {
978
776
  var _a;