@aws-sdk/client-iotthingsgraph 3.504.0 → 3.509.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.
@@ -214,7 +214,7 @@ export const se_UploadEntityDefinitionsCommand = async (input, context) => {
214
214
  };
215
215
  export const de_AssociateEntityToThingCommand = async (output, context) => {
216
216
  if (output.statusCode >= 300) {
217
- return de_AssociateEntityToThingCommandError(output, context);
217
+ return de_CommandError(output, context);
218
218
  }
219
219
  const data = await parseBody(output.body, context);
220
220
  let contents = {};
@@ -225,37 +225,9 @@ export const de_AssociateEntityToThingCommand = async (output, context) => {
225
225
  };
226
226
  return response;
227
227
  };
228
- const de_AssociateEntityToThingCommandError = async (output, context) => {
229
- const parsedOutput = {
230
- ...output,
231
- body: await parseErrorBody(output.body, context),
232
- };
233
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
234
- switch (errorCode) {
235
- case "InternalFailureException":
236
- case "com.amazonaws.iotthingsgraph#InternalFailureException":
237
- throw await de_InternalFailureExceptionRes(parsedOutput, context);
238
- case "InvalidRequestException":
239
- case "com.amazonaws.iotthingsgraph#InvalidRequestException":
240
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
241
- case "ResourceNotFoundException":
242
- case "com.amazonaws.iotthingsgraph#ResourceNotFoundException":
243
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
244
- case "ThrottlingException":
245
- case "com.amazonaws.iotthingsgraph#ThrottlingException":
246
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
247
- default:
248
- const parsedBody = parsedOutput.body;
249
- return throwDefaultError({
250
- output,
251
- parsedBody,
252
- errorCode,
253
- });
254
- }
255
- };
256
228
  export const de_CreateFlowTemplateCommand = async (output, context) => {
257
229
  if (output.statusCode >= 300) {
258
- return de_CreateFlowTemplateCommandError(output, context);
230
+ return de_CommandError(output, context);
259
231
  }
260
232
  const data = await parseBody(output.body, context);
261
233
  let contents = {};
@@ -266,40 +238,9 @@ export const de_CreateFlowTemplateCommand = async (output, context) => {
266
238
  };
267
239
  return response;
268
240
  };
269
- const de_CreateFlowTemplateCommandError = async (output, context) => {
270
- const parsedOutput = {
271
- ...output,
272
- body: await parseErrorBody(output.body, context),
273
- };
274
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
275
- switch (errorCode) {
276
- case "InternalFailureException":
277
- case "com.amazonaws.iotthingsgraph#InternalFailureException":
278
- throw await de_InternalFailureExceptionRes(parsedOutput, context);
279
- case "InvalidRequestException":
280
- case "com.amazonaws.iotthingsgraph#InvalidRequestException":
281
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
282
- case "LimitExceededException":
283
- case "com.amazonaws.iotthingsgraph#LimitExceededException":
284
- throw await de_LimitExceededExceptionRes(parsedOutput, context);
285
- case "ResourceAlreadyExistsException":
286
- case "com.amazonaws.iotthingsgraph#ResourceAlreadyExistsException":
287
- throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context);
288
- case "ThrottlingException":
289
- case "com.amazonaws.iotthingsgraph#ThrottlingException":
290
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
291
- default:
292
- const parsedBody = parsedOutput.body;
293
- return throwDefaultError({
294
- output,
295
- parsedBody,
296
- errorCode,
297
- });
298
- }
299
- };
300
241
  export const de_CreateSystemInstanceCommand = async (output, context) => {
301
242
  if (output.statusCode >= 300) {
302
- return de_CreateSystemInstanceCommandError(output, context);
243
+ return de_CommandError(output, context);
303
244
  }
304
245
  const data = await parseBody(output.body, context);
305
246
  let contents = {};
@@ -310,40 +251,9 @@ export const de_CreateSystemInstanceCommand = async (output, context) => {
310
251
  };
311
252
  return response;
312
253
  };
313
- const de_CreateSystemInstanceCommandError = async (output, context) => {
314
- const parsedOutput = {
315
- ...output,
316
- body: await parseErrorBody(output.body, context),
317
- };
318
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
319
- switch (errorCode) {
320
- case "InternalFailureException":
321
- case "com.amazonaws.iotthingsgraph#InternalFailureException":
322
- throw await de_InternalFailureExceptionRes(parsedOutput, context);
323
- case "InvalidRequestException":
324
- case "com.amazonaws.iotthingsgraph#InvalidRequestException":
325
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
326
- case "LimitExceededException":
327
- case "com.amazonaws.iotthingsgraph#LimitExceededException":
328
- throw await de_LimitExceededExceptionRes(parsedOutput, context);
329
- case "ResourceAlreadyExistsException":
330
- case "com.amazonaws.iotthingsgraph#ResourceAlreadyExistsException":
331
- throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context);
332
- case "ThrottlingException":
333
- case "com.amazonaws.iotthingsgraph#ThrottlingException":
334
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
335
- default:
336
- const parsedBody = parsedOutput.body;
337
- return throwDefaultError({
338
- output,
339
- parsedBody,
340
- errorCode,
341
- });
342
- }
343
- };
344
254
  export const de_CreateSystemTemplateCommand = async (output, context) => {
345
255
  if (output.statusCode >= 300) {
346
- return de_CreateSystemTemplateCommandError(output, context);
256
+ return de_CommandError(output, context);
347
257
  }
348
258
  const data = await parseBody(output.body, context);
349
259
  let contents = {};
@@ -354,37 +264,9 @@ export const de_CreateSystemTemplateCommand = async (output, context) => {
354
264
  };
355
265
  return response;
356
266
  };
357
- const de_CreateSystemTemplateCommandError = async (output, context) => {
358
- const parsedOutput = {
359
- ...output,
360
- body: await parseErrorBody(output.body, context),
361
- };
362
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
363
- switch (errorCode) {
364
- case "InternalFailureException":
365
- case "com.amazonaws.iotthingsgraph#InternalFailureException":
366
- throw await de_InternalFailureExceptionRes(parsedOutput, context);
367
- case "InvalidRequestException":
368
- case "com.amazonaws.iotthingsgraph#InvalidRequestException":
369
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
370
- case "ResourceAlreadyExistsException":
371
- case "com.amazonaws.iotthingsgraph#ResourceAlreadyExistsException":
372
- throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context);
373
- case "ThrottlingException":
374
- case "com.amazonaws.iotthingsgraph#ThrottlingException":
375
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
376
- default:
377
- const parsedBody = parsedOutput.body;
378
- return throwDefaultError({
379
- output,
380
- parsedBody,
381
- errorCode,
382
- });
383
- }
384
- };
385
267
  export const de_DeleteFlowTemplateCommand = async (output, context) => {
386
268
  if (output.statusCode >= 300) {
387
- return de_DeleteFlowTemplateCommandError(output, context);
269
+ return de_CommandError(output, context);
388
270
  }
389
271
  const data = await parseBody(output.body, context);
390
272
  let contents = {};
@@ -395,37 +277,9 @@ export const de_DeleteFlowTemplateCommand = async (output, context) => {
395
277
  };
396
278
  return response;
397
279
  };
398
- const de_DeleteFlowTemplateCommandError = async (output, context) => {
399
- const parsedOutput = {
400
- ...output,
401
- body: await parseErrorBody(output.body, context),
402
- };
403
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
404
- switch (errorCode) {
405
- case "InternalFailureException":
406
- case "com.amazonaws.iotthingsgraph#InternalFailureException":
407
- throw await de_InternalFailureExceptionRes(parsedOutput, context);
408
- case "InvalidRequestException":
409
- case "com.amazonaws.iotthingsgraph#InvalidRequestException":
410
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
411
- case "ResourceInUseException":
412
- case "com.amazonaws.iotthingsgraph#ResourceInUseException":
413
- throw await de_ResourceInUseExceptionRes(parsedOutput, context);
414
- case "ThrottlingException":
415
- case "com.amazonaws.iotthingsgraph#ThrottlingException":
416
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
417
- default:
418
- const parsedBody = parsedOutput.body;
419
- return throwDefaultError({
420
- output,
421
- parsedBody,
422
- errorCode,
423
- });
424
- }
425
- };
426
280
  export const de_DeleteNamespaceCommand = async (output, context) => {
427
281
  if (output.statusCode >= 300) {
428
- return de_DeleteNamespaceCommandError(output, context);
282
+ return de_CommandError(output, context);
429
283
  }
430
284
  const data = await parseBody(output.body, context);
431
285
  let contents = {};
@@ -436,31 +290,9 @@ export const de_DeleteNamespaceCommand = async (output, context) => {
436
290
  };
437
291
  return response;
438
292
  };
439
- const de_DeleteNamespaceCommandError = async (output, context) => {
440
- const parsedOutput = {
441
- ...output,
442
- body: await parseErrorBody(output.body, context),
443
- };
444
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
445
- switch (errorCode) {
446
- case "InternalFailureException":
447
- case "com.amazonaws.iotthingsgraph#InternalFailureException":
448
- throw await de_InternalFailureExceptionRes(parsedOutput, context);
449
- case "ThrottlingException":
450
- case "com.amazonaws.iotthingsgraph#ThrottlingException":
451
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
452
- default:
453
- const parsedBody = parsedOutput.body;
454
- return throwDefaultError({
455
- output,
456
- parsedBody,
457
- errorCode,
458
- });
459
- }
460
- };
461
293
  export const de_DeleteSystemInstanceCommand = async (output, context) => {
462
294
  if (output.statusCode >= 300) {
463
- return de_DeleteSystemInstanceCommandError(output, context);
295
+ return de_CommandError(output, context);
464
296
  }
465
297
  const data = await parseBody(output.body, context);
466
298
  let contents = {};
@@ -471,37 +303,9 @@ export const de_DeleteSystemInstanceCommand = async (output, context) => {
471
303
  };
472
304
  return response;
473
305
  };
474
- const de_DeleteSystemInstanceCommandError = async (output, context) => {
475
- const parsedOutput = {
476
- ...output,
477
- body: await parseErrorBody(output.body, context),
478
- };
479
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
480
- switch (errorCode) {
481
- case "InternalFailureException":
482
- case "com.amazonaws.iotthingsgraph#InternalFailureException":
483
- throw await de_InternalFailureExceptionRes(parsedOutput, context);
484
- case "InvalidRequestException":
485
- case "com.amazonaws.iotthingsgraph#InvalidRequestException":
486
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
487
- case "ResourceInUseException":
488
- case "com.amazonaws.iotthingsgraph#ResourceInUseException":
489
- throw await de_ResourceInUseExceptionRes(parsedOutput, context);
490
- case "ThrottlingException":
491
- case "com.amazonaws.iotthingsgraph#ThrottlingException":
492
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
493
- default:
494
- const parsedBody = parsedOutput.body;
495
- return throwDefaultError({
496
- output,
497
- parsedBody,
498
- errorCode,
499
- });
500
- }
501
- };
502
306
  export const de_DeleteSystemTemplateCommand = async (output, context) => {
503
307
  if (output.statusCode >= 300) {
504
- return de_DeleteSystemTemplateCommandError(output, context);
308
+ return de_CommandError(output, context);
505
309
  }
506
310
  const data = await parseBody(output.body, context);
507
311
  let contents = {};
@@ -512,37 +316,9 @@ export const de_DeleteSystemTemplateCommand = async (output, context) => {
512
316
  };
513
317
  return response;
514
318
  };
515
- const de_DeleteSystemTemplateCommandError = async (output, context) => {
516
- const parsedOutput = {
517
- ...output,
518
- body: await parseErrorBody(output.body, context),
519
- };
520
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
521
- switch (errorCode) {
522
- case "InternalFailureException":
523
- case "com.amazonaws.iotthingsgraph#InternalFailureException":
524
- throw await de_InternalFailureExceptionRes(parsedOutput, context);
525
- case "InvalidRequestException":
526
- case "com.amazonaws.iotthingsgraph#InvalidRequestException":
527
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
528
- case "ResourceInUseException":
529
- case "com.amazonaws.iotthingsgraph#ResourceInUseException":
530
- throw await de_ResourceInUseExceptionRes(parsedOutput, context);
531
- case "ThrottlingException":
532
- case "com.amazonaws.iotthingsgraph#ThrottlingException":
533
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
534
- default:
535
- const parsedBody = parsedOutput.body;
536
- return throwDefaultError({
537
- output,
538
- parsedBody,
539
- errorCode,
540
- });
541
- }
542
- };
543
319
  export const de_DeploySystemInstanceCommand = async (output, context) => {
544
320
  if (output.statusCode >= 300) {
545
- return de_DeploySystemInstanceCommandError(output, context);
321
+ return de_CommandError(output, context);
546
322
  }
547
323
  const data = await parseBody(output.body, context);
548
324
  let contents = {};
@@ -553,40 +329,22 @@ export const de_DeploySystemInstanceCommand = async (output, context) => {
553
329
  };
554
330
  return response;
555
331
  };
556
- const de_DeploySystemInstanceCommandError = async (output, context) => {
557
- const parsedOutput = {
558
- ...output,
559
- body: await parseErrorBody(output.body, context),
560
- };
561
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
562
- switch (errorCode) {
563
- case "InternalFailureException":
564
- case "com.amazonaws.iotthingsgraph#InternalFailureException":
565
- throw await de_InternalFailureExceptionRes(parsedOutput, context);
566
- case "InvalidRequestException":
567
- case "com.amazonaws.iotthingsgraph#InvalidRequestException":
568
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
569
- case "ResourceInUseException":
570
- case "com.amazonaws.iotthingsgraph#ResourceInUseException":
571
- throw await de_ResourceInUseExceptionRes(parsedOutput, context);
572
- case "ResourceNotFoundException":
573
- case "com.amazonaws.iotthingsgraph#ResourceNotFoundException":
574
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
575
- case "ThrottlingException":
576
- case "com.amazonaws.iotthingsgraph#ThrottlingException":
577
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
578
- default:
579
- const parsedBody = parsedOutput.body;
580
- return throwDefaultError({
581
- output,
582
- parsedBody,
583
- errorCode,
584
- });
332
+ export const de_DeprecateFlowTemplateCommand = async (output, context) => {
333
+ if (output.statusCode >= 300) {
334
+ return de_CommandError(output, context);
585
335
  }
336
+ const data = await parseBody(output.body, context);
337
+ let contents = {};
338
+ contents = _json(data);
339
+ const response = {
340
+ $metadata: deserializeMetadata(output),
341
+ ...contents,
342
+ };
343
+ return response;
586
344
  };
587
- export const de_DeprecateFlowTemplateCommand = async (output, context) => {
345
+ export const de_DeprecateSystemTemplateCommand = async (output, context) => {
588
346
  if (output.statusCode >= 300) {
589
- return de_DeprecateFlowTemplateCommandError(output, context);
347
+ return de_CommandError(output, context);
590
348
  }
591
349
  const data = await parseBody(output.body, context);
592
350
  let contents = {};
@@ -597,78 +355,9 @@ export const de_DeprecateFlowTemplateCommand = async (output, context) => {
597
355
  };
598
356
  return response;
599
357
  };
600
- const de_DeprecateFlowTemplateCommandError = async (output, context) => {
601
- const parsedOutput = {
602
- ...output,
603
- body: await parseErrorBody(output.body, context),
604
- };
605
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
606
- switch (errorCode) {
607
- case "InternalFailureException":
608
- case "com.amazonaws.iotthingsgraph#InternalFailureException":
609
- throw await de_InternalFailureExceptionRes(parsedOutput, context);
610
- case "InvalidRequestException":
611
- case "com.amazonaws.iotthingsgraph#InvalidRequestException":
612
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
613
- case "ResourceNotFoundException":
614
- case "com.amazonaws.iotthingsgraph#ResourceNotFoundException":
615
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
616
- case "ThrottlingException":
617
- case "com.amazonaws.iotthingsgraph#ThrottlingException":
618
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
619
- default:
620
- const parsedBody = parsedOutput.body;
621
- return throwDefaultError({
622
- output,
623
- parsedBody,
624
- errorCode,
625
- });
626
- }
627
- };
628
- export const de_DeprecateSystemTemplateCommand = async (output, context) => {
629
- if (output.statusCode >= 300) {
630
- return de_DeprecateSystemTemplateCommandError(output, context);
631
- }
632
- const data = await parseBody(output.body, context);
633
- let contents = {};
634
- contents = _json(data);
635
- const response = {
636
- $metadata: deserializeMetadata(output),
637
- ...contents,
638
- };
639
- return response;
640
- };
641
- const de_DeprecateSystemTemplateCommandError = async (output, context) => {
642
- const parsedOutput = {
643
- ...output,
644
- body: await parseErrorBody(output.body, context),
645
- };
646
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
647
- switch (errorCode) {
648
- case "InternalFailureException":
649
- case "com.amazonaws.iotthingsgraph#InternalFailureException":
650
- throw await de_InternalFailureExceptionRes(parsedOutput, context);
651
- case "InvalidRequestException":
652
- case "com.amazonaws.iotthingsgraph#InvalidRequestException":
653
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
654
- case "ResourceNotFoundException":
655
- case "com.amazonaws.iotthingsgraph#ResourceNotFoundException":
656
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
657
- case "ThrottlingException":
658
- case "com.amazonaws.iotthingsgraph#ThrottlingException":
659
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
660
- default:
661
- const parsedBody = parsedOutput.body;
662
- return throwDefaultError({
663
- output,
664
- parsedBody,
665
- errorCode,
666
- });
667
- }
668
- };
669
358
  export const de_DescribeNamespaceCommand = async (output, context) => {
670
359
  if (output.statusCode >= 300) {
671
- return de_DescribeNamespaceCommandError(output, context);
360
+ return de_CommandError(output, context);
672
361
  }
673
362
  const data = await parseBody(output.body, context);
674
363
  let contents = {};
@@ -679,37 +368,9 @@ export const de_DescribeNamespaceCommand = async (output, context) => {
679
368
  };
680
369
  return response;
681
370
  };
682
- const de_DescribeNamespaceCommandError = async (output, context) => {
683
- const parsedOutput = {
684
- ...output,
685
- body: await parseErrorBody(output.body, context),
686
- };
687
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
688
- switch (errorCode) {
689
- case "InternalFailureException":
690
- case "com.amazonaws.iotthingsgraph#InternalFailureException":
691
- throw await de_InternalFailureExceptionRes(parsedOutput, context);
692
- case "InvalidRequestException":
693
- case "com.amazonaws.iotthingsgraph#InvalidRequestException":
694
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
695
- case "ResourceNotFoundException":
696
- case "com.amazonaws.iotthingsgraph#ResourceNotFoundException":
697
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
698
- case "ThrottlingException":
699
- case "com.amazonaws.iotthingsgraph#ThrottlingException":
700
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
701
- default:
702
- const parsedBody = parsedOutput.body;
703
- return throwDefaultError({
704
- output,
705
- parsedBody,
706
- errorCode,
707
- });
708
- }
709
- };
710
371
  export const de_DissociateEntityFromThingCommand = async (output, context) => {
711
372
  if (output.statusCode >= 300) {
712
- return de_DissociateEntityFromThingCommandError(output, context);
373
+ return de_CommandError(output, context);
713
374
  }
714
375
  const data = await parseBody(output.body, context);
715
376
  let contents = {};
@@ -720,37 +381,9 @@ export const de_DissociateEntityFromThingCommand = async (output, context) => {
720
381
  };
721
382
  return response;
722
383
  };
723
- const de_DissociateEntityFromThingCommandError = async (output, context) => {
724
- const parsedOutput = {
725
- ...output,
726
- body: await parseErrorBody(output.body, context),
727
- };
728
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
729
- switch (errorCode) {
730
- case "InternalFailureException":
731
- case "com.amazonaws.iotthingsgraph#InternalFailureException":
732
- throw await de_InternalFailureExceptionRes(parsedOutput, context);
733
- case "InvalidRequestException":
734
- case "com.amazonaws.iotthingsgraph#InvalidRequestException":
735
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
736
- case "ResourceNotFoundException":
737
- case "com.amazonaws.iotthingsgraph#ResourceNotFoundException":
738
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
739
- case "ThrottlingException":
740
- case "com.amazonaws.iotthingsgraph#ThrottlingException":
741
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
742
- default:
743
- const parsedBody = parsedOutput.body;
744
- return throwDefaultError({
745
- output,
746
- parsedBody,
747
- errorCode,
748
- });
749
- }
750
- };
751
384
  export const de_GetEntitiesCommand = async (output, context) => {
752
385
  if (output.statusCode >= 300) {
753
- return de_GetEntitiesCommandError(output, context);
386
+ return de_CommandError(output, context);
754
387
  }
755
388
  const data = await parseBody(output.body, context);
756
389
  let contents = {};
@@ -761,37 +394,9 @@ export const de_GetEntitiesCommand = async (output, context) => {
761
394
  };
762
395
  return response;
763
396
  };
764
- const de_GetEntitiesCommandError = async (output, context) => {
765
- const parsedOutput = {
766
- ...output,
767
- body: await parseErrorBody(output.body, context),
768
- };
769
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
770
- switch (errorCode) {
771
- case "InternalFailureException":
772
- case "com.amazonaws.iotthingsgraph#InternalFailureException":
773
- throw await de_InternalFailureExceptionRes(parsedOutput, context);
774
- case "InvalidRequestException":
775
- case "com.amazonaws.iotthingsgraph#InvalidRequestException":
776
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
777
- case "ResourceNotFoundException":
778
- case "com.amazonaws.iotthingsgraph#ResourceNotFoundException":
779
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
780
- case "ThrottlingException":
781
- case "com.amazonaws.iotthingsgraph#ThrottlingException":
782
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
783
- default:
784
- const parsedBody = parsedOutput.body;
785
- return throwDefaultError({
786
- output,
787
- parsedBody,
788
- errorCode,
789
- });
790
- }
791
- };
792
397
  export const de_GetFlowTemplateCommand = async (output, context) => {
793
398
  if (output.statusCode >= 300) {
794
- return de_GetFlowTemplateCommandError(output, context);
399
+ return de_CommandError(output, context);
795
400
  }
796
401
  const data = await parseBody(output.body, context);
797
402
  let contents = {};
@@ -802,37 +407,9 @@ export const de_GetFlowTemplateCommand = async (output, context) => {
802
407
  };
803
408
  return response;
804
409
  };
805
- const de_GetFlowTemplateCommandError = async (output, context) => {
806
- const parsedOutput = {
807
- ...output,
808
- body: await parseErrorBody(output.body, context),
809
- };
810
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
811
- switch (errorCode) {
812
- case "InternalFailureException":
813
- case "com.amazonaws.iotthingsgraph#InternalFailureException":
814
- throw await de_InternalFailureExceptionRes(parsedOutput, context);
815
- case "InvalidRequestException":
816
- case "com.amazonaws.iotthingsgraph#InvalidRequestException":
817
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
818
- case "ResourceNotFoundException":
819
- case "com.amazonaws.iotthingsgraph#ResourceNotFoundException":
820
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
821
- case "ThrottlingException":
822
- case "com.amazonaws.iotthingsgraph#ThrottlingException":
823
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
824
- default:
825
- const parsedBody = parsedOutput.body;
826
- return throwDefaultError({
827
- output,
828
- parsedBody,
829
- errorCode,
830
- });
831
- }
832
- };
833
410
  export const de_GetFlowTemplateRevisionsCommand = async (output, context) => {
834
411
  if (output.statusCode >= 300) {
835
- return de_GetFlowTemplateRevisionsCommandError(output, context);
412
+ return de_CommandError(output, context);
836
413
  }
837
414
  const data = await parseBody(output.body, context);
838
415
  let contents = {};
@@ -843,37 +420,9 @@ export const de_GetFlowTemplateRevisionsCommand = async (output, context) => {
843
420
  };
844
421
  return response;
845
422
  };
846
- const de_GetFlowTemplateRevisionsCommandError = async (output, context) => {
847
- const parsedOutput = {
848
- ...output,
849
- body: await parseErrorBody(output.body, context),
850
- };
851
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
852
- switch (errorCode) {
853
- case "InternalFailureException":
854
- case "com.amazonaws.iotthingsgraph#InternalFailureException":
855
- throw await de_InternalFailureExceptionRes(parsedOutput, context);
856
- case "InvalidRequestException":
857
- case "com.amazonaws.iotthingsgraph#InvalidRequestException":
858
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
859
- case "ResourceNotFoundException":
860
- case "com.amazonaws.iotthingsgraph#ResourceNotFoundException":
861
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
862
- case "ThrottlingException":
863
- case "com.amazonaws.iotthingsgraph#ThrottlingException":
864
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
865
- default:
866
- const parsedBody = parsedOutput.body;
867
- return throwDefaultError({
868
- output,
869
- parsedBody,
870
- errorCode,
871
- });
872
- }
873
- };
874
423
  export const de_GetNamespaceDeletionStatusCommand = async (output, context) => {
875
424
  if (output.statusCode >= 300) {
876
- return de_GetNamespaceDeletionStatusCommandError(output, context);
425
+ return de_CommandError(output, context);
877
426
  }
878
427
  const data = await parseBody(output.body, context);
879
428
  let contents = {};
@@ -884,34 +433,9 @@ export const de_GetNamespaceDeletionStatusCommand = async (output, context) => {
884
433
  };
885
434
  return response;
886
435
  };
887
- const de_GetNamespaceDeletionStatusCommandError = async (output, context) => {
888
- const parsedOutput = {
889
- ...output,
890
- body: await parseErrorBody(output.body, context),
891
- };
892
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
893
- switch (errorCode) {
894
- case "InternalFailureException":
895
- case "com.amazonaws.iotthingsgraph#InternalFailureException":
896
- throw await de_InternalFailureExceptionRes(parsedOutput, context);
897
- case "InvalidRequestException":
898
- case "com.amazonaws.iotthingsgraph#InvalidRequestException":
899
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
900
- case "ThrottlingException":
901
- case "com.amazonaws.iotthingsgraph#ThrottlingException":
902
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
903
- default:
904
- const parsedBody = parsedOutput.body;
905
- return throwDefaultError({
906
- output,
907
- parsedBody,
908
- errorCode,
909
- });
910
- }
911
- };
912
436
  export const de_GetSystemInstanceCommand = async (output, context) => {
913
437
  if (output.statusCode >= 300) {
914
- return de_GetSystemInstanceCommandError(output, context);
438
+ return de_CommandError(output, context);
915
439
  }
916
440
  const data = await parseBody(output.body, context);
917
441
  let contents = {};
@@ -922,37 +446,9 @@ export const de_GetSystemInstanceCommand = async (output, context) => {
922
446
  };
923
447
  return response;
924
448
  };
925
- const de_GetSystemInstanceCommandError = async (output, context) => {
926
- const parsedOutput = {
927
- ...output,
928
- body: await parseErrorBody(output.body, context),
929
- };
930
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
931
- switch (errorCode) {
932
- case "InternalFailureException":
933
- case "com.amazonaws.iotthingsgraph#InternalFailureException":
934
- throw await de_InternalFailureExceptionRes(parsedOutput, context);
935
- case "InvalidRequestException":
936
- case "com.amazonaws.iotthingsgraph#InvalidRequestException":
937
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
938
- case "ResourceNotFoundException":
939
- case "com.amazonaws.iotthingsgraph#ResourceNotFoundException":
940
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
941
- case "ThrottlingException":
942
- case "com.amazonaws.iotthingsgraph#ThrottlingException":
943
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
944
- default:
945
- const parsedBody = parsedOutput.body;
946
- return throwDefaultError({
947
- output,
948
- parsedBody,
949
- errorCode,
950
- });
951
- }
952
- };
953
449
  export const de_GetSystemTemplateCommand = async (output, context) => {
954
450
  if (output.statusCode >= 300) {
955
- return de_GetSystemTemplateCommandError(output, context);
451
+ return de_CommandError(output, context);
956
452
  }
957
453
  const data = await parseBody(output.body, context);
958
454
  let contents = {};
@@ -963,37 +459,9 @@ export const de_GetSystemTemplateCommand = async (output, context) => {
963
459
  };
964
460
  return response;
965
461
  };
966
- const de_GetSystemTemplateCommandError = async (output, context) => {
967
- const parsedOutput = {
968
- ...output,
969
- body: await parseErrorBody(output.body, context),
970
- };
971
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
972
- switch (errorCode) {
973
- case "InternalFailureException":
974
- case "com.amazonaws.iotthingsgraph#InternalFailureException":
975
- throw await de_InternalFailureExceptionRes(parsedOutput, context);
976
- case "InvalidRequestException":
977
- case "com.amazonaws.iotthingsgraph#InvalidRequestException":
978
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
979
- case "ResourceNotFoundException":
980
- case "com.amazonaws.iotthingsgraph#ResourceNotFoundException":
981
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
982
- case "ThrottlingException":
983
- case "com.amazonaws.iotthingsgraph#ThrottlingException":
984
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
985
- default:
986
- const parsedBody = parsedOutput.body;
987
- return throwDefaultError({
988
- output,
989
- parsedBody,
990
- errorCode,
991
- });
992
- }
993
- };
994
462
  export const de_GetSystemTemplateRevisionsCommand = async (output, context) => {
995
463
  if (output.statusCode >= 300) {
996
- return de_GetSystemTemplateRevisionsCommandError(output, context);
464
+ return de_CommandError(output, context);
997
465
  }
998
466
  const data = await parseBody(output.body, context);
999
467
  let contents = {};
@@ -1004,37 +472,9 @@ export const de_GetSystemTemplateRevisionsCommand = async (output, context) => {
1004
472
  };
1005
473
  return response;
1006
474
  };
1007
- const de_GetSystemTemplateRevisionsCommandError = async (output, context) => {
1008
- const parsedOutput = {
1009
- ...output,
1010
- body: await parseErrorBody(output.body, context),
1011
- };
1012
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1013
- switch (errorCode) {
1014
- case "InternalFailureException":
1015
- case "com.amazonaws.iotthingsgraph#InternalFailureException":
1016
- throw await de_InternalFailureExceptionRes(parsedOutput, context);
1017
- case "InvalidRequestException":
1018
- case "com.amazonaws.iotthingsgraph#InvalidRequestException":
1019
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
1020
- case "ResourceNotFoundException":
1021
- case "com.amazonaws.iotthingsgraph#ResourceNotFoundException":
1022
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1023
- case "ThrottlingException":
1024
- case "com.amazonaws.iotthingsgraph#ThrottlingException":
1025
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1026
- default:
1027
- const parsedBody = parsedOutput.body;
1028
- return throwDefaultError({
1029
- output,
1030
- parsedBody,
1031
- errorCode,
1032
- });
1033
- }
1034
- };
1035
475
  export const de_GetUploadStatusCommand = async (output, context) => {
1036
476
  if (output.statusCode >= 300) {
1037
- return de_GetUploadStatusCommandError(output, context);
477
+ return de_CommandError(output, context);
1038
478
  }
1039
479
  const data = await parseBody(output.body, context);
1040
480
  let contents = {};
@@ -1045,37 +485,9 @@ export const de_GetUploadStatusCommand = async (output, context) => {
1045
485
  };
1046
486
  return response;
1047
487
  };
1048
- const de_GetUploadStatusCommandError = async (output, context) => {
1049
- const parsedOutput = {
1050
- ...output,
1051
- body: await parseErrorBody(output.body, context),
1052
- };
1053
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1054
- switch (errorCode) {
1055
- case "InternalFailureException":
1056
- case "com.amazonaws.iotthingsgraph#InternalFailureException":
1057
- throw await de_InternalFailureExceptionRes(parsedOutput, context);
1058
- case "InvalidRequestException":
1059
- case "com.amazonaws.iotthingsgraph#InvalidRequestException":
1060
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
1061
- case "ResourceNotFoundException":
1062
- case "com.amazonaws.iotthingsgraph#ResourceNotFoundException":
1063
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1064
- case "ThrottlingException":
1065
- case "com.amazonaws.iotthingsgraph#ThrottlingException":
1066
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1067
- default:
1068
- const parsedBody = parsedOutput.body;
1069
- return throwDefaultError({
1070
- output,
1071
- parsedBody,
1072
- errorCode,
1073
- });
1074
- }
1075
- };
1076
488
  export const de_ListFlowExecutionMessagesCommand = async (output, context) => {
1077
489
  if (output.statusCode >= 300) {
1078
- return de_ListFlowExecutionMessagesCommandError(output, context);
490
+ return de_CommandError(output, context);
1079
491
  }
1080
492
  const data = await parseBody(output.body, context);
1081
493
  let contents = {};
@@ -1086,37 +498,9 @@ export const de_ListFlowExecutionMessagesCommand = async (output, context) => {
1086
498
  };
1087
499
  return response;
1088
500
  };
1089
- const de_ListFlowExecutionMessagesCommandError = async (output, context) => {
1090
- const parsedOutput = {
1091
- ...output,
1092
- body: await parseErrorBody(output.body, context),
1093
- };
1094
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1095
- switch (errorCode) {
1096
- case "InternalFailureException":
1097
- case "com.amazonaws.iotthingsgraph#InternalFailureException":
1098
- throw await de_InternalFailureExceptionRes(parsedOutput, context);
1099
- case "InvalidRequestException":
1100
- case "com.amazonaws.iotthingsgraph#InvalidRequestException":
1101
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
1102
- case "ResourceNotFoundException":
1103
- case "com.amazonaws.iotthingsgraph#ResourceNotFoundException":
1104
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1105
- case "ThrottlingException":
1106
- case "com.amazonaws.iotthingsgraph#ThrottlingException":
1107
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1108
- default:
1109
- const parsedBody = parsedOutput.body;
1110
- return throwDefaultError({
1111
- output,
1112
- parsedBody,
1113
- errorCode,
1114
- });
1115
- }
1116
- };
1117
501
  export const de_ListTagsForResourceCommand = async (output, context) => {
1118
502
  if (output.statusCode >= 300) {
1119
- return de_ListTagsForResourceCommandError(output, context);
503
+ return de_CommandError(output, context);
1120
504
  }
1121
505
  const data = await parseBody(output.body, context);
1122
506
  let contents = {};
@@ -1127,37 +511,9 @@ export const de_ListTagsForResourceCommand = async (output, context) => {
1127
511
  };
1128
512
  return response;
1129
513
  };
1130
- const de_ListTagsForResourceCommandError = async (output, context) => {
1131
- const parsedOutput = {
1132
- ...output,
1133
- body: await parseErrorBody(output.body, context),
1134
- };
1135
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1136
- switch (errorCode) {
1137
- case "InternalFailureException":
1138
- case "com.amazonaws.iotthingsgraph#InternalFailureException":
1139
- throw await de_InternalFailureExceptionRes(parsedOutput, context);
1140
- case "InvalidRequestException":
1141
- case "com.amazonaws.iotthingsgraph#InvalidRequestException":
1142
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
1143
- case "ResourceAlreadyExistsException":
1144
- case "com.amazonaws.iotthingsgraph#ResourceAlreadyExistsException":
1145
- throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context);
1146
- case "ThrottlingException":
1147
- case "com.amazonaws.iotthingsgraph#ThrottlingException":
1148
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1149
- default:
1150
- const parsedBody = parsedOutput.body;
1151
- return throwDefaultError({
1152
- output,
1153
- parsedBody,
1154
- errorCode,
1155
- });
1156
- }
1157
- };
1158
514
  export const de_SearchEntitiesCommand = async (output, context) => {
1159
515
  if (output.statusCode >= 300) {
1160
- return de_SearchEntitiesCommandError(output, context);
516
+ return de_CommandError(output, context);
1161
517
  }
1162
518
  const data = await parseBody(output.body, context);
1163
519
  let contents = {};
@@ -1168,75 +524,22 @@ export const de_SearchEntitiesCommand = async (output, context) => {
1168
524
  };
1169
525
  return response;
1170
526
  };
1171
- const de_SearchEntitiesCommandError = async (output, context) => {
1172
- const parsedOutput = {
1173
- ...output,
1174
- body: await parseErrorBody(output.body, context),
1175
- };
1176
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1177
- switch (errorCode) {
1178
- case "InternalFailureException":
1179
- case "com.amazonaws.iotthingsgraph#InternalFailureException":
1180
- throw await de_InternalFailureExceptionRes(parsedOutput, context);
1181
- case "InvalidRequestException":
1182
- case "com.amazonaws.iotthingsgraph#InvalidRequestException":
1183
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
1184
- case "ThrottlingException":
1185
- case "com.amazonaws.iotthingsgraph#ThrottlingException":
1186
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1187
- default:
1188
- const parsedBody = parsedOutput.body;
1189
- return throwDefaultError({
1190
- output,
1191
- parsedBody,
1192
- errorCode,
1193
- });
1194
- }
1195
- };
1196
527
  export const de_SearchFlowExecutionsCommand = async (output, context) => {
1197
528
  if (output.statusCode >= 300) {
1198
- return de_SearchFlowExecutionsCommandError(output, context);
529
+ return de_CommandError(output, context);
1199
530
  }
1200
531
  const data = await parseBody(output.body, context);
1201
- let contents = {};
1202
- contents = de_SearchFlowExecutionsResponse(data, context);
1203
- const response = {
1204
- $metadata: deserializeMetadata(output),
1205
- ...contents,
1206
- };
1207
- return response;
1208
- };
1209
- const de_SearchFlowExecutionsCommandError = async (output, context) => {
1210
- const parsedOutput = {
1211
- ...output,
1212
- body: await parseErrorBody(output.body, context),
1213
- };
1214
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1215
- switch (errorCode) {
1216
- case "InternalFailureException":
1217
- case "com.amazonaws.iotthingsgraph#InternalFailureException":
1218
- throw await de_InternalFailureExceptionRes(parsedOutput, context);
1219
- case "InvalidRequestException":
1220
- case "com.amazonaws.iotthingsgraph#InvalidRequestException":
1221
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
1222
- case "ResourceNotFoundException":
1223
- case "com.amazonaws.iotthingsgraph#ResourceNotFoundException":
1224
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1225
- case "ThrottlingException":
1226
- case "com.amazonaws.iotthingsgraph#ThrottlingException":
1227
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1228
- default:
1229
- const parsedBody = parsedOutput.body;
1230
- return throwDefaultError({
1231
- output,
1232
- parsedBody,
1233
- errorCode,
1234
- });
1235
- }
532
+ let contents = {};
533
+ contents = de_SearchFlowExecutionsResponse(data, context);
534
+ const response = {
535
+ $metadata: deserializeMetadata(output),
536
+ ...contents,
537
+ };
538
+ return response;
1236
539
  };
1237
540
  export const de_SearchFlowTemplatesCommand = async (output, context) => {
1238
541
  if (output.statusCode >= 300) {
1239
- return de_SearchFlowTemplatesCommandError(output, context);
542
+ return de_CommandError(output, context);
1240
543
  }
1241
544
  const data = await parseBody(output.body, context);
1242
545
  let contents = {};
@@ -1247,34 +550,9 @@ export const de_SearchFlowTemplatesCommand = async (output, context) => {
1247
550
  };
1248
551
  return response;
1249
552
  };
1250
- const de_SearchFlowTemplatesCommandError = async (output, context) => {
1251
- const parsedOutput = {
1252
- ...output,
1253
- body: await parseErrorBody(output.body, context),
1254
- };
1255
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1256
- switch (errorCode) {
1257
- case "InternalFailureException":
1258
- case "com.amazonaws.iotthingsgraph#InternalFailureException":
1259
- throw await de_InternalFailureExceptionRes(parsedOutput, context);
1260
- case "InvalidRequestException":
1261
- case "com.amazonaws.iotthingsgraph#InvalidRequestException":
1262
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
1263
- case "ThrottlingException":
1264
- case "com.amazonaws.iotthingsgraph#ThrottlingException":
1265
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1266
- default:
1267
- const parsedBody = parsedOutput.body;
1268
- return throwDefaultError({
1269
- output,
1270
- parsedBody,
1271
- errorCode,
1272
- });
1273
- }
1274
- };
1275
553
  export const de_SearchSystemInstancesCommand = async (output, context) => {
1276
554
  if (output.statusCode >= 300) {
1277
- return de_SearchSystemInstancesCommandError(output, context);
555
+ return de_CommandError(output, context);
1278
556
  }
1279
557
  const data = await parseBody(output.body, context);
1280
558
  let contents = {};
@@ -1285,34 +563,9 @@ export const de_SearchSystemInstancesCommand = async (output, context) => {
1285
563
  };
1286
564
  return response;
1287
565
  };
1288
- const de_SearchSystemInstancesCommandError = async (output, context) => {
1289
- const parsedOutput = {
1290
- ...output,
1291
- body: await parseErrorBody(output.body, context),
1292
- };
1293
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1294
- switch (errorCode) {
1295
- case "InternalFailureException":
1296
- case "com.amazonaws.iotthingsgraph#InternalFailureException":
1297
- throw await de_InternalFailureExceptionRes(parsedOutput, context);
1298
- case "InvalidRequestException":
1299
- case "com.amazonaws.iotthingsgraph#InvalidRequestException":
1300
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
1301
- case "ThrottlingException":
1302
- case "com.amazonaws.iotthingsgraph#ThrottlingException":
1303
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1304
- default:
1305
- const parsedBody = parsedOutput.body;
1306
- return throwDefaultError({
1307
- output,
1308
- parsedBody,
1309
- errorCode,
1310
- });
1311
- }
1312
- };
1313
566
  export const de_SearchSystemTemplatesCommand = async (output, context) => {
1314
567
  if (output.statusCode >= 300) {
1315
- return de_SearchSystemTemplatesCommandError(output, context);
568
+ return de_CommandError(output, context);
1316
569
  }
1317
570
  const data = await parseBody(output.body, context);
1318
571
  let contents = {};
@@ -1323,34 +576,9 @@ export const de_SearchSystemTemplatesCommand = async (output, context) => {
1323
576
  };
1324
577
  return response;
1325
578
  };
1326
- const de_SearchSystemTemplatesCommandError = async (output, context) => {
1327
- const parsedOutput = {
1328
- ...output,
1329
- body: await parseErrorBody(output.body, context),
1330
- };
1331
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1332
- switch (errorCode) {
1333
- case "InternalFailureException":
1334
- case "com.amazonaws.iotthingsgraph#InternalFailureException":
1335
- throw await de_InternalFailureExceptionRes(parsedOutput, context);
1336
- case "InvalidRequestException":
1337
- case "com.amazonaws.iotthingsgraph#InvalidRequestException":
1338
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
1339
- case "ThrottlingException":
1340
- case "com.amazonaws.iotthingsgraph#ThrottlingException":
1341
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1342
- default:
1343
- const parsedBody = parsedOutput.body;
1344
- return throwDefaultError({
1345
- output,
1346
- parsedBody,
1347
- errorCode,
1348
- });
1349
- }
1350
- };
1351
579
  export const de_SearchThingsCommand = async (output, context) => {
1352
580
  if (output.statusCode >= 300) {
1353
- return de_SearchThingsCommandError(output, context);
581
+ return de_CommandError(output, context);
1354
582
  }
1355
583
  const data = await parseBody(output.body, context);
1356
584
  let contents = {};
@@ -1361,37 +589,9 @@ export const de_SearchThingsCommand = async (output, context) => {
1361
589
  };
1362
590
  return response;
1363
591
  };
1364
- const de_SearchThingsCommandError = async (output, context) => {
1365
- const parsedOutput = {
1366
- ...output,
1367
- body: await parseErrorBody(output.body, context),
1368
- };
1369
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1370
- switch (errorCode) {
1371
- case "InternalFailureException":
1372
- case "com.amazonaws.iotthingsgraph#InternalFailureException":
1373
- throw await de_InternalFailureExceptionRes(parsedOutput, context);
1374
- case "InvalidRequestException":
1375
- case "com.amazonaws.iotthingsgraph#InvalidRequestException":
1376
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
1377
- case "ResourceNotFoundException":
1378
- case "com.amazonaws.iotthingsgraph#ResourceNotFoundException":
1379
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1380
- case "ThrottlingException":
1381
- case "com.amazonaws.iotthingsgraph#ThrottlingException":
1382
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1383
- default:
1384
- const parsedBody = parsedOutput.body;
1385
- return throwDefaultError({
1386
- output,
1387
- parsedBody,
1388
- errorCode,
1389
- });
1390
- }
1391
- };
1392
592
  export const de_TagResourceCommand = async (output, context) => {
1393
593
  if (output.statusCode >= 300) {
1394
- return de_TagResourceCommandError(output, context);
594
+ return de_CommandError(output, context);
1395
595
  }
1396
596
  const data = await parseBody(output.body, context);
1397
597
  let contents = {};
@@ -1402,37 +602,9 @@ export const de_TagResourceCommand = async (output, context) => {
1402
602
  };
1403
603
  return response;
1404
604
  };
1405
- const de_TagResourceCommandError = async (output, context) => {
1406
- const parsedOutput = {
1407
- ...output,
1408
- body: await parseErrorBody(output.body, context),
1409
- };
1410
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1411
- switch (errorCode) {
1412
- case "InternalFailureException":
1413
- case "com.amazonaws.iotthingsgraph#InternalFailureException":
1414
- throw await de_InternalFailureExceptionRes(parsedOutput, context);
1415
- case "InvalidRequestException":
1416
- case "com.amazonaws.iotthingsgraph#InvalidRequestException":
1417
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
1418
- case "ResourceAlreadyExistsException":
1419
- case "com.amazonaws.iotthingsgraph#ResourceAlreadyExistsException":
1420
- throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context);
1421
- case "ThrottlingException":
1422
- case "com.amazonaws.iotthingsgraph#ThrottlingException":
1423
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1424
- default:
1425
- const parsedBody = parsedOutput.body;
1426
- return throwDefaultError({
1427
- output,
1428
- parsedBody,
1429
- errorCode,
1430
- });
1431
- }
1432
- };
1433
605
  export const de_UndeploySystemInstanceCommand = async (output, context) => {
1434
606
  if (output.statusCode >= 300) {
1435
- return de_UndeploySystemInstanceCommandError(output, context);
607
+ return de_CommandError(output, context);
1436
608
  }
1437
609
  const data = await parseBody(output.body, context);
1438
610
  let contents = {};
@@ -1443,40 +615,9 @@ export const de_UndeploySystemInstanceCommand = async (output, context) => {
1443
615
  };
1444
616
  return response;
1445
617
  };
1446
- const de_UndeploySystemInstanceCommandError = async (output, context) => {
1447
- const parsedOutput = {
1448
- ...output,
1449
- body: await parseErrorBody(output.body, context),
1450
- };
1451
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1452
- switch (errorCode) {
1453
- case "InternalFailureException":
1454
- case "com.amazonaws.iotthingsgraph#InternalFailureException":
1455
- throw await de_InternalFailureExceptionRes(parsedOutput, context);
1456
- case "InvalidRequestException":
1457
- case "com.amazonaws.iotthingsgraph#InvalidRequestException":
1458
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
1459
- case "ResourceInUseException":
1460
- case "com.amazonaws.iotthingsgraph#ResourceInUseException":
1461
- throw await de_ResourceInUseExceptionRes(parsedOutput, context);
1462
- case "ResourceNotFoundException":
1463
- case "com.amazonaws.iotthingsgraph#ResourceNotFoundException":
1464
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1465
- case "ThrottlingException":
1466
- case "com.amazonaws.iotthingsgraph#ThrottlingException":
1467
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1468
- default:
1469
- const parsedBody = parsedOutput.body;
1470
- return throwDefaultError({
1471
- output,
1472
- parsedBody,
1473
- errorCode,
1474
- });
1475
- }
1476
- };
1477
618
  export const de_UntagResourceCommand = async (output, context) => {
1478
619
  if (output.statusCode >= 300) {
1479
- return de_UntagResourceCommandError(output, context);
620
+ return de_CommandError(output, context);
1480
621
  }
1481
622
  const data = await parseBody(output.body, context);
1482
623
  let contents = {};
@@ -1487,37 +628,9 @@ export const de_UntagResourceCommand = async (output, context) => {
1487
628
  };
1488
629
  return response;
1489
630
  };
1490
- const de_UntagResourceCommandError = async (output, context) => {
1491
- const parsedOutput = {
1492
- ...output,
1493
- body: await parseErrorBody(output.body, context),
1494
- };
1495
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1496
- switch (errorCode) {
1497
- case "InternalFailureException":
1498
- case "com.amazonaws.iotthingsgraph#InternalFailureException":
1499
- throw await de_InternalFailureExceptionRes(parsedOutput, context);
1500
- case "InvalidRequestException":
1501
- case "com.amazonaws.iotthingsgraph#InvalidRequestException":
1502
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
1503
- case "ResourceAlreadyExistsException":
1504
- case "com.amazonaws.iotthingsgraph#ResourceAlreadyExistsException":
1505
- throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context);
1506
- case "ThrottlingException":
1507
- case "com.amazonaws.iotthingsgraph#ThrottlingException":
1508
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1509
- default:
1510
- const parsedBody = parsedOutput.body;
1511
- return throwDefaultError({
1512
- output,
1513
- parsedBody,
1514
- errorCode,
1515
- });
1516
- }
1517
- };
1518
631
  export const de_UpdateFlowTemplateCommand = async (output, context) => {
1519
632
  if (output.statusCode >= 300) {
1520
- return de_UpdateFlowTemplateCommandError(output, context);
633
+ return de_CommandError(output, context);
1521
634
  }
1522
635
  const data = await parseBody(output.body, context);
1523
636
  let contents = {};
@@ -1528,37 +641,9 @@ export const de_UpdateFlowTemplateCommand = async (output, context) => {
1528
641
  };
1529
642
  return response;
1530
643
  };
1531
- const de_UpdateFlowTemplateCommandError = async (output, context) => {
1532
- const parsedOutput = {
1533
- ...output,
1534
- body: await parseErrorBody(output.body, context),
1535
- };
1536
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1537
- switch (errorCode) {
1538
- case "InternalFailureException":
1539
- case "com.amazonaws.iotthingsgraph#InternalFailureException":
1540
- throw await de_InternalFailureExceptionRes(parsedOutput, context);
1541
- case "InvalidRequestException":
1542
- case "com.amazonaws.iotthingsgraph#InvalidRequestException":
1543
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
1544
- case "ResourceNotFoundException":
1545
- case "com.amazonaws.iotthingsgraph#ResourceNotFoundException":
1546
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1547
- case "ThrottlingException":
1548
- case "com.amazonaws.iotthingsgraph#ThrottlingException":
1549
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1550
- default:
1551
- const parsedBody = parsedOutput.body;
1552
- return throwDefaultError({
1553
- output,
1554
- parsedBody,
1555
- errorCode,
1556
- });
1557
- }
1558
- };
1559
644
  export const de_UpdateSystemTemplateCommand = async (output, context) => {
1560
645
  if (output.statusCode >= 300) {
1561
- return de_UpdateSystemTemplateCommandError(output, context);
646
+ return de_CommandError(output, context);
1562
647
  }
1563
648
  const data = await parseBody(output.body, context);
1564
649
  let contents = {};
@@ -1569,37 +654,9 @@ export const de_UpdateSystemTemplateCommand = async (output, context) => {
1569
654
  };
1570
655
  return response;
1571
656
  };
1572
- const de_UpdateSystemTemplateCommandError = async (output, context) => {
1573
- const parsedOutput = {
1574
- ...output,
1575
- body: await parseErrorBody(output.body, context),
1576
- };
1577
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1578
- switch (errorCode) {
1579
- case "InternalFailureException":
1580
- case "com.amazonaws.iotthingsgraph#InternalFailureException":
1581
- throw await de_InternalFailureExceptionRes(parsedOutput, context);
1582
- case "InvalidRequestException":
1583
- case "com.amazonaws.iotthingsgraph#InvalidRequestException":
1584
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
1585
- case "ResourceNotFoundException":
1586
- case "com.amazonaws.iotthingsgraph#ResourceNotFoundException":
1587
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1588
- case "ThrottlingException":
1589
- case "com.amazonaws.iotthingsgraph#ThrottlingException":
1590
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1591
- default:
1592
- const parsedBody = parsedOutput.body;
1593
- return throwDefaultError({
1594
- output,
1595
- parsedBody,
1596
- errorCode,
1597
- });
1598
- }
1599
- };
1600
657
  export const de_UploadEntityDefinitionsCommand = async (output, context) => {
1601
658
  if (output.statusCode >= 300) {
1602
- return de_UploadEntityDefinitionsCommandError(output, context);
659
+ return de_CommandError(output, context);
1603
660
  }
1604
661
  const data = await parseBody(output.body, context);
1605
662
  let contents = {};
@@ -1610,7 +667,7 @@ export const de_UploadEntityDefinitionsCommand = async (output, context) => {
1610
667
  };
1611
668
  return response;
1612
669
  };
1613
- const de_UploadEntityDefinitionsCommandError = async (output, context) => {
670
+ const de_CommandError = async (output, context) => {
1614
671
  const parsedOutput = {
1615
672
  ...output,
1616
673
  body: await parseErrorBody(output.body, context),
@@ -1623,9 +680,21 @@ const de_UploadEntityDefinitionsCommandError = async (output, context) => {
1623
680
  case "InvalidRequestException":
1624
681
  case "com.amazonaws.iotthingsgraph#InvalidRequestException":
1625
682
  throw await de_InvalidRequestExceptionRes(parsedOutput, context);
683
+ case "ResourceNotFoundException":
684
+ case "com.amazonaws.iotthingsgraph#ResourceNotFoundException":
685
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1626
686
  case "ThrottlingException":
1627
687
  case "com.amazonaws.iotthingsgraph#ThrottlingException":
1628
688
  throw await de_ThrottlingExceptionRes(parsedOutput, context);
689
+ case "LimitExceededException":
690
+ case "com.amazonaws.iotthingsgraph#LimitExceededException":
691
+ throw await de_LimitExceededExceptionRes(parsedOutput, context);
692
+ case "ResourceAlreadyExistsException":
693
+ case "com.amazonaws.iotthingsgraph#ResourceAlreadyExistsException":
694
+ throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context);
695
+ case "ResourceInUseException":
696
+ case "com.amazonaws.iotthingsgraph#ResourceInUseException":
697
+ throw await de_ResourceInUseExceptionRes(parsedOutput, context);
1629
698
  default:
1630
699
  const parsedBody = parsedOutput.body;
1631
700
  return throwDefaultError({