@aws-sdk/client-backup-gateway 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.
@@ -154,7 +154,7 @@ export const se_UpdateHypervisorCommand = async (input, context) => {
154
154
  };
155
155
  export const de_AssociateGatewayToServerCommand = async (output, context) => {
156
156
  if (output.statusCode >= 300) {
157
- return de_AssociateGatewayToServerCommandError(output, context);
157
+ return de_CommandError(output, context);
158
158
  }
159
159
  const data = await parseBody(output.body, context);
160
160
  let contents = {};
@@ -165,37 +165,9 @@ export const de_AssociateGatewayToServerCommand = async (output, context) => {
165
165
  };
166
166
  return response;
167
167
  };
168
- const de_AssociateGatewayToServerCommandError = async (output, context) => {
169
- const parsedOutput = {
170
- ...output,
171
- body: await parseErrorBody(output.body, context),
172
- };
173
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
174
- switch (errorCode) {
175
- case "ConflictException":
176
- case "com.amazonaws.backupgateway#ConflictException":
177
- throw await de_ConflictExceptionRes(parsedOutput, context);
178
- case "InternalServerException":
179
- case "com.amazonaws.backupgateway#InternalServerException":
180
- throw await de_InternalServerExceptionRes(parsedOutput, context);
181
- case "ThrottlingException":
182
- case "com.amazonaws.backupgateway#ThrottlingException":
183
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
184
- case "ValidationException":
185
- case "com.amazonaws.backupgateway#ValidationException":
186
- throw await de_ValidationExceptionRes(parsedOutput, context);
187
- default:
188
- const parsedBody = parsedOutput.body;
189
- return throwDefaultError({
190
- output,
191
- parsedBody,
192
- errorCode,
193
- });
194
- }
195
- };
196
168
  export const de_CreateGatewayCommand = async (output, context) => {
197
169
  if (output.statusCode >= 300) {
198
- return de_CreateGatewayCommandError(output, context);
170
+ return de_CommandError(output, context);
199
171
  }
200
172
  const data = await parseBody(output.body, context);
201
173
  let contents = {};
@@ -206,34 +178,9 @@ export const de_CreateGatewayCommand = async (output, context) => {
206
178
  };
207
179
  return response;
208
180
  };
209
- const de_CreateGatewayCommandError = async (output, context) => {
210
- const parsedOutput = {
211
- ...output,
212
- body: await parseErrorBody(output.body, context),
213
- };
214
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
215
- switch (errorCode) {
216
- case "InternalServerException":
217
- case "com.amazonaws.backupgateway#InternalServerException":
218
- throw await de_InternalServerExceptionRes(parsedOutput, context);
219
- case "ThrottlingException":
220
- case "com.amazonaws.backupgateway#ThrottlingException":
221
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
222
- case "ValidationException":
223
- case "com.amazonaws.backupgateway#ValidationException":
224
- throw await de_ValidationExceptionRes(parsedOutput, context);
225
- default:
226
- const parsedBody = parsedOutput.body;
227
- return throwDefaultError({
228
- output,
229
- parsedBody,
230
- errorCode,
231
- });
232
- }
233
- };
234
181
  export const de_DeleteGatewayCommand = async (output, context) => {
235
182
  if (output.statusCode >= 300) {
236
- return de_DeleteGatewayCommandError(output, context);
183
+ return de_CommandError(output, context);
237
184
  }
238
185
  const data = await parseBody(output.body, context);
239
186
  let contents = {};
@@ -244,37 +191,9 @@ export const de_DeleteGatewayCommand = async (output, context) => {
244
191
  };
245
192
  return response;
246
193
  };
247
- const de_DeleteGatewayCommandError = async (output, context) => {
248
- const parsedOutput = {
249
- ...output,
250
- body: await parseErrorBody(output.body, context),
251
- };
252
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
253
- switch (errorCode) {
254
- case "InternalServerException":
255
- case "com.amazonaws.backupgateway#InternalServerException":
256
- throw await de_InternalServerExceptionRes(parsedOutput, context);
257
- case "ResourceNotFoundException":
258
- case "com.amazonaws.backupgateway#ResourceNotFoundException":
259
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
260
- case "ThrottlingException":
261
- case "com.amazonaws.backupgateway#ThrottlingException":
262
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
263
- case "ValidationException":
264
- case "com.amazonaws.backupgateway#ValidationException":
265
- throw await de_ValidationExceptionRes(parsedOutput, context);
266
- default:
267
- const parsedBody = parsedOutput.body;
268
- return throwDefaultError({
269
- output,
270
- parsedBody,
271
- errorCode,
272
- });
273
- }
274
- };
275
194
  export const de_DeleteHypervisorCommand = async (output, context) => {
276
195
  if (output.statusCode >= 300) {
277
- return de_DeleteHypervisorCommandError(output, context);
196
+ return de_CommandError(output, context);
278
197
  }
279
198
  const data = await parseBody(output.body, context);
280
199
  let contents = {};
@@ -285,43 +204,9 @@ export const de_DeleteHypervisorCommand = async (output, context) => {
285
204
  };
286
205
  return response;
287
206
  };
288
- const de_DeleteHypervisorCommandError = async (output, context) => {
289
- const parsedOutput = {
290
- ...output,
291
- body: await parseErrorBody(output.body, context),
292
- };
293
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
294
- switch (errorCode) {
295
- case "AccessDeniedException":
296
- case "com.amazonaws.backupgateway#AccessDeniedException":
297
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
298
- case "ConflictException":
299
- case "com.amazonaws.backupgateway#ConflictException":
300
- throw await de_ConflictExceptionRes(parsedOutput, context);
301
- case "InternalServerException":
302
- case "com.amazonaws.backupgateway#InternalServerException":
303
- throw await de_InternalServerExceptionRes(parsedOutput, context);
304
- case "ResourceNotFoundException":
305
- case "com.amazonaws.backupgateway#ResourceNotFoundException":
306
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
307
- case "ThrottlingException":
308
- case "com.amazonaws.backupgateway#ThrottlingException":
309
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
310
- case "ValidationException":
311
- case "com.amazonaws.backupgateway#ValidationException":
312
- throw await de_ValidationExceptionRes(parsedOutput, context);
313
- default:
314
- const parsedBody = parsedOutput.body;
315
- return throwDefaultError({
316
- output,
317
- parsedBody,
318
- errorCode,
319
- });
320
- }
321
- };
322
207
  export const de_DisassociateGatewayFromServerCommand = async (output, context) => {
323
208
  if (output.statusCode >= 300) {
324
- return de_DisassociateGatewayFromServerCommandError(output, context);
209
+ return de_CommandError(output, context);
325
210
  }
326
211
  const data = await parseBody(output.body, context);
327
212
  let contents = {};
@@ -332,40 +217,9 @@ export const de_DisassociateGatewayFromServerCommand = async (output, context) =
332
217
  };
333
218
  return response;
334
219
  };
335
- const de_DisassociateGatewayFromServerCommandError = async (output, context) => {
336
- const parsedOutput = {
337
- ...output,
338
- body: await parseErrorBody(output.body, context),
339
- };
340
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
341
- switch (errorCode) {
342
- case "ConflictException":
343
- case "com.amazonaws.backupgateway#ConflictException":
344
- throw await de_ConflictExceptionRes(parsedOutput, context);
345
- case "InternalServerException":
346
- case "com.amazonaws.backupgateway#InternalServerException":
347
- throw await de_InternalServerExceptionRes(parsedOutput, context);
348
- case "ResourceNotFoundException":
349
- case "com.amazonaws.backupgateway#ResourceNotFoundException":
350
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
351
- case "ThrottlingException":
352
- case "com.amazonaws.backupgateway#ThrottlingException":
353
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
354
- case "ValidationException":
355
- case "com.amazonaws.backupgateway#ValidationException":
356
- throw await de_ValidationExceptionRes(parsedOutput, context);
357
- default:
358
- const parsedBody = parsedOutput.body;
359
- return throwDefaultError({
360
- output,
361
- parsedBody,
362
- errorCode,
363
- });
364
- }
365
- };
366
220
  export const de_GetBandwidthRateLimitScheduleCommand = async (output, context) => {
367
221
  if (output.statusCode >= 300) {
368
- return de_GetBandwidthRateLimitScheduleCommandError(output, context);
222
+ return de_CommandError(output, context);
369
223
  }
370
224
  const data = await parseBody(output.body, context);
371
225
  let contents = {};
@@ -376,37 +230,9 @@ export const de_GetBandwidthRateLimitScheduleCommand = async (output, context) =
376
230
  };
377
231
  return response;
378
232
  };
379
- const de_GetBandwidthRateLimitScheduleCommandError = async (output, context) => {
380
- const parsedOutput = {
381
- ...output,
382
- body: await parseErrorBody(output.body, context),
383
- };
384
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
385
- switch (errorCode) {
386
- case "InternalServerException":
387
- case "com.amazonaws.backupgateway#InternalServerException":
388
- throw await de_InternalServerExceptionRes(parsedOutput, context);
389
- case "ResourceNotFoundException":
390
- case "com.amazonaws.backupgateway#ResourceNotFoundException":
391
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
392
- case "ThrottlingException":
393
- case "com.amazonaws.backupgateway#ThrottlingException":
394
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
395
- case "ValidationException":
396
- case "com.amazonaws.backupgateway#ValidationException":
397
- throw await de_ValidationExceptionRes(parsedOutput, context);
398
- default:
399
- const parsedBody = parsedOutput.body;
400
- return throwDefaultError({
401
- output,
402
- parsedBody,
403
- errorCode,
404
- });
405
- }
406
- };
407
233
  export const de_GetGatewayCommand = async (output, context) => {
408
234
  if (output.statusCode >= 300) {
409
- return de_GetGatewayCommandError(output, context);
235
+ return de_CommandError(output, context);
410
236
  }
411
237
  const data = await parseBody(output.body, context);
412
238
  let contents = {};
@@ -417,37 +243,9 @@ export const de_GetGatewayCommand = async (output, context) => {
417
243
  };
418
244
  return response;
419
245
  };
420
- const de_GetGatewayCommandError = async (output, context) => {
421
- const parsedOutput = {
422
- ...output,
423
- body: await parseErrorBody(output.body, context),
424
- };
425
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
426
- switch (errorCode) {
427
- case "InternalServerException":
428
- case "com.amazonaws.backupgateway#InternalServerException":
429
- throw await de_InternalServerExceptionRes(parsedOutput, context);
430
- case "ResourceNotFoundException":
431
- case "com.amazonaws.backupgateway#ResourceNotFoundException":
432
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
433
- case "ThrottlingException":
434
- case "com.amazonaws.backupgateway#ThrottlingException":
435
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
436
- case "ValidationException":
437
- case "com.amazonaws.backupgateway#ValidationException":
438
- throw await de_ValidationExceptionRes(parsedOutput, context);
439
- default:
440
- const parsedBody = parsedOutput.body;
441
- return throwDefaultError({
442
- output,
443
- parsedBody,
444
- errorCode,
445
- });
446
- }
447
- };
448
246
  export const de_GetHypervisorCommand = async (output, context) => {
449
247
  if (output.statusCode >= 300) {
450
- return de_GetHypervisorCommandError(output, context);
248
+ return de_CommandError(output, context);
451
249
  }
452
250
  const data = await parseBody(output.body, context);
453
251
  let contents = {};
@@ -458,37 +256,9 @@ export const de_GetHypervisorCommand = async (output, context) => {
458
256
  };
459
257
  return response;
460
258
  };
461
- const de_GetHypervisorCommandError = async (output, context) => {
462
- const parsedOutput = {
463
- ...output,
464
- body: await parseErrorBody(output.body, context),
465
- };
466
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
467
- switch (errorCode) {
468
- case "InternalServerException":
469
- case "com.amazonaws.backupgateway#InternalServerException":
470
- throw await de_InternalServerExceptionRes(parsedOutput, context);
471
- case "ResourceNotFoundException":
472
- case "com.amazonaws.backupgateway#ResourceNotFoundException":
473
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
474
- case "ThrottlingException":
475
- case "com.amazonaws.backupgateway#ThrottlingException":
476
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
477
- case "ValidationException":
478
- case "com.amazonaws.backupgateway#ValidationException":
479
- throw await de_ValidationExceptionRes(parsedOutput, context);
480
- default:
481
- const parsedBody = parsedOutput.body;
482
- return throwDefaultError({
483
- output,
484
- parsedBody,
485
- errorCode,
486
- });
487
- }
488
- };
489
259
  export const de_GetHypervisorPropertyMappingsCommand = async (output, context) => {
490
260
  if (output.statusCode >= 300) {
491
- return de_GetHypervisorPropertyMappingsCommandError(output, context);
261
+ return de_CommandError(output, context);
492
262
  }
493
263
  const data = await parseBody(output.body, context);
494
264
  let contents = {};
@@ -499,37 +269,9 @@ export const de_GetHypervisorPropertyMappingsCommand = async (output, context) =
499
269
  };
500
270
  return response;
501
271
  };
502
- const de_GetHypervisorPropertyMappingsCommandError = async (output, context) => {
503
- const parsedOutput = {
504
- ...output,
505
- body: await parseErrorBody(output.body, context),
506
- };
507
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
508
- switch (errorCode) {
509
- case "InternalServerException":
510
- case "com.amazonaws.backupgateway#InternalServerException":
511
- throw await de_InternalServerExceptionRes(parsedOutput, context);
512
- case "ResourceNotFoundException":
513
- case "com.amazonaws.backupgateway#ResourceNotFoundException":
514
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
515
- case "ThrottlingException":
516
- case "com.amazonaws.backupgateway#ThrottlingException":
517
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
518
- case "ValidationException":
519
- case "com.amazonaws.backupgateway#ValidationException":
520
- throw await de_ValidationExceptionRes(parsedOutput, context);
521
- default:
522
- const parsedBody = parsedOutput.body;
523
- return throwDefaultError({
524
- output,
525
- parsedBody,
526
- errorCode,
527
- });
528
- }
529
- };
530
272
  export const de_GetVirtualMachineCommand = async (output, context) => {
531
273
  if (output.statusCode >= 300) {
532
- return de_GetVirtualMachineCommandError(output, context);
274
+ return de_CommandError(output, context);
533
275
  }
534
276
  const data = await parseBody(output.body, context);
535
277
  let contents = {};
@@ -540,37 +282,9 @@ export const de_GetVirtualMachineCommand = async (output, context) => {
540
282
  };
541
283
  return response;
542
284
  };
543
- const de_GetVirtualMachineCommandError = async (output, context) => {
544
- const parsedOutput = {
545
- ...output,
546
- body: await parseErrorBody(output.body, context),
547
- };
548
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
549
- switch (errorCode) {
550
- case "InternalServerException":
551
- case "com.amazonaws.backupgateway#InternalServerException":
552
- throw await de_InternalServerExceptionRes(parsedOutput, context);
553
- case "ResourceNotFoundException":
554
- case "com.amazonaws.backupgateway#ResourceNotFoundException":
555
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
556
- case "ThrottlingException":
557
- case "com.amazonaws.backupgateway#ThrottlingException":
558
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
559
- case "ValidationException":
560
- case "com.amazonaws.backupgateway#ValidationException":
561
- throw await de_ValidationExceptionRes(parsedOutput, context);
562
- default:
563
- const parsedBody = parsedOutput.body;
564
- return throwDefaultError({
565
- output,
566
- parsedBody,
567
- errorCode,
568
- });
569
- }
570
- };
571
285
  export const de_ImportHypervisorConfigurationCommand = async (output, context) => {
572
286
  if (output.statusCode >= 300) {
573
- return de_ImportHypervisorConfigurationCommandError(output, context);
287
+ return de_CommandError(output, context);
574
288
  }
575
289
  const data = await parseBody(output.body, context);
576
290
  let contents = {};
@@ -581,40 +295,9 @@ export const de_ImportHypervisorConfigurationCommand = async (output, context) =
581
295
  };
582
296
  return response;
583
297
  };
584
- const de_ImportHypervisorConfigurationCommandError = async (output, context) => {
585
- const parsedOutput = {
586
- ...output,
587
- body: await parseErrorBody(output.body, context),
588
- };
589
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
590
- switch (errorCode) {
591
- case "AccessDeniedException":
592
- case "com.amazonaws.backupgateway#AccessDeniedException":
593
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
594
- case "ConflictException":
595
- case "com.amazonaws.backupgateway#ConflictException":
596
- throw await de_ConflictExceptionRes(parsedOutput, context);
597
- case "InternalServerException":
598
- case "com.amazonaws.backupgateway#InternalServerException":
599
- throw await de_InternalServerExceptionRes(parsedOutput, context);
600
- case "ThrottlingException":
601
- case "com.amazonaws.backupgateway#ThrottlingException":
602
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
603
- case "ValidationException":
604
- case "com.amazonaws.backupgateway#ValidationException":
605
- throw await de_ValidationExceptionRes(parsedOutput, context);
606
- default:
607
- const parsedBody = parsedOutput.body;
608
- return throwDefaultError({
609
- output,
610
- parsedBody,
611
- errorCode,
612
- });
613
- }
614
- };
615
298
  export const de_ListGatewaysCommand = async (output, context) => {
616
299
  if (output.statusCode >= 300) {
617
- return de_ListGatewaysCommandError(output, context);
300
+ return de_CommandError(output, context);
618
301
  }
619
302
  const data = await parseBody(output.body, context);
620
303
  let contents = {};
@@ -625,34 +308,9 @@ export const de_ListGatewaysCommand = async (output, context) => {
625
308
  };
626
309
  return response;
627
310
  };
628
- const de_ListGatewaysCommandError = async (output, context) => {
629
- const parsedOutput = {
630
- ...output,
631
- body: await parseErrorBody(output.body, context),
632
- };
633
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
634
- switch (errorCode) {
635
- case "InternalServerException":
636
- case "com.amazonaws.backupgateway#InternalServerException":
637
- throw await de_InternalServerExceptionRes(parsedOutput, context);
638
- case "ThrottlingException":
639
- case "com.amazonaws.backupgateway#ThrottlingException":
640
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
641
- case "ValidationException":
642
- case "com.amazonaws.backupgateway#ValidationException":
643
- throw await de_ValidationExceptionRes(parsedOutput, context);
644
- default:
645
- const parsedBody = parsedOutput.body;
646
- return throwDefaultError({
647
- output,
648
- parsedBody,
649
- errorCode,
650
- });
651
- }
652
- };
653
311
  export const de_ListHypervisorsCommand = async (output, context) => {
654
312
  if (output.statusCode >= 300) {
655
- return de_ListHypervisorsCommandError(output, context);
313
+ return de_CommandError(output, context);
656
314
  }
657
315
  const data = await parseBody(output.body, context);
658
316
  let contents = {};
@@ -663,34 +321,9 @@ export const de_ListHypervisorsCommand = async (output, context) => {
663
321
  };
664
322
  return response;
665
323
  };
666
- const de_ListHypervisorsCommandError = async (output, context) => {
667
- const parsedOutput = {
668
- ...output,
669
- body: await parseErrorBody(output.body, context),
670
- };
671
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
672
- switch (errorCode) {
673
- case "InternalServerException":
674
- case "com.amazonaws.backupgateway#InternalServerException":
675
- throw await de_InternalServerExceptionRes(parsedOutput, context);
676
- case "ThrottlingException":
677
- case "com.amazonaws.backupgateway#ThrottlingException":
678
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
679
- case "ValidationException":
680
- case "com.amazonaws.backupgateway#ValidationException":
681
- throw await de_ValidationExceptionRes(parsedOutput, context);
682
- default:
683
- const parsedBody = parsedOutput.body;
684
- return throwDefaultError({
685
- output,
686
- parsedBody,
687
- errorCode,
688
- });
689
- }
690
- };
691
324
  export const de_ListTagsForResourceCommand = async (output, context) => {
692
325
  if (output.statusCode >= 300) {
693
- return de_ListTagsForResourceCommandError(output, context);
326
+ return de_CommandError(output, context);
694
327
  }
695
328
  const data = await parseBody(output.body, context);
696
329
  let contents = {};
@@ -701,37 +334,9 @@ export const de_ListTagsForResourceCommand = async (output, context) => {
701
334
  };
702
335
  return response;
703
336
  };
704
- const de_ListTagsForResourceCommandError = async (output, context) => {
705
- const parsedOutput = {
706
- ...output,
707
- body: await parseErrorBody(output.body, context),
708
- };
709
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
710
- switch (errorCode) {
711
- case "InternalServerException":
712
- case "com.amazonaws.backupgateway#InternalServerException":
713
- throw await de_InternalServerExceptionRes(parsedOutput, context);
714
- case "ResourceNotFoundException":
715
- case "com.amazonaws.backupgateway#ResourceNotFoundException":
716
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
717
- case "ThrottlingException":
718
- case "com.amazonaws.backupgateway#ThrottlingException":
719
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
720
- case "ValidationException":
721
- case "com.amazonaws.backupgateway#ValidationException":
722
- throw await de_ValidationExceptionRes(parsedOutput, context);
723
- default:
724
- const parsedBody = parsedOutput.body;
725
- return throwDefaultError({
726
- output,
727
- parsedBody,
728
- errorCode,
729
- });
730
- }
731
- };
732
337
  export const de_ListVirtualMachinesCommand = async (output, context) => {
733
338
  if (output.statusCode >= 300) {
734
- return de_ListVirtualMachinesCommandError(output, context);
339
+ return de_CommandError(output, context);
735
340
  }
736
341
  const data = await parseBody(output.body, context);
737
342
  let contents = {};
@@ -742,75 +347,9 @@ export const de_ListVirtualMachinesCommand = async (output, context) => {
742
347
  };
743
348
  return response;
744
349
  };
745
- const de_ListVirtualMachinesCommandError = async (output, context) => {
746
- const parsedOutput = {
747
- ...output,
748
- body: await parseErrorBody(output.body, context),
749
- };
750
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
751
- switch (errorCode) {
752
- case "InternalServerException":
753
- case "com.amazonaws.backupgateway#InternalServerException":
754
- throw await de_InternalServerExceptionRes(parsedOutput, context);
755
- case "ThrottlingException":
756
- case "com.amazonaws.backupgateway#ThrottlingException":
757
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
758
- case "ValidationException":
759
- case "com.amazonaws.backupgateway#ValidationException":
760
- throw await de_ValidationExceptionRes(parsedOutput, context);
761
- default:
762
- const parsedBody = parsedOutput.body;
763
- return throwDefaultError({
764
- output,
765
- parsedBody,
766
- errorCode,
767
- });
768
- }
769
- };
770
- export const de_PutBandwidthRateLimitScheduleCommand = async (output, context) => {
771
- if (output.statusCode >= 300) {
772
- return de_PutBandwidthRateLimitScheduleCommandError(output, context);
773
- }
774
- const data = await parseBody(output.body, context);
775
- let contents = {};
776
- contents = _json(data);
777
- const response = {
778
- $metadata: deserializeMetadata(output),
779
- ...contents,
780
- };
781
- return response;
782
- };
783
- const de_PutBandwidthRateLimitScheduleCommandError = async (output, context) => {
784
- const parsedOutput = {
785
- ...output,
786
- body: await parseErrorBody(output.body, context),
787
- };
788
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
789
- switch (errorCode) {
790
- case "InternalServerException":
791
- case "com.amazonaws.backupgateway#InternalServerException":
792
- throw await de_InternalServerExceptionRes(parsedOutput, context);
793
- case "ResourceNotFoundException":
794
- case "com.amazonaws.backupgateway#ResourceNotFoundException":
795
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
796
- case "ThrottlingException":
797
- case "com.amazonaws.backupgateway#ThrottlingException":
798
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
799
- case "ValidationException":
800
- case "com.amazonaws.backupgateway#ValidationException":
801
- throw await de_ValidationExceptionRes(parsedOutput, context);
802
- default:
803
- const parsedBody = parsedOutput.body;
804
- return throwDefaultError({
805
- output,
806
- parsedBody,
807
- errorCode,
808
- });
809
- }
810
- };
811
- export const de_PutHypervisorPropertyMappingsCommand = async (output, context) => {
350
+ export const de_PutBandwidthRateLimitScheduleCommand = async (output, context) => {
812
351
  if (output.statusCode >= 300) {
813
- return de_PutHypervisorPropertyMappingsCommandError(output, context);
352
+ return de_CommandError(output, context);
814
353
  }
815
354
  const data = await parseBody(output.body, context);
816
355
  let contents = {};
@@ -821,43 +360,22 @@ export const de_PutHypervisorPropertyMappingsCommand = async (output, context) =
821
360
  };
822
361
  return response;
823
362
  };
824
- const de_PutHypervisorPropertyMappingsCommandError = async (output, context) => {
825
- const parsedOutput = {
826
- ...output,
827
- body: await parseErrorBody(output.body, context),
828
- };
829
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
830
- switch (errorCode) {
831
- case "AccessDeniedException":
832
- case "com.amazonaws.backupgateway#AccessDeniedException":
833
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
834
- case "ConflictException":
835
- case "com.amazonaws.backupgateway#ConflictException":
836
- throw await de_ConflictExceptionRes(parsedOutput, context);
837
- case "InternalServerException":
838
- case "com.amazonaws.backupgateway#InternalServerException":
839
- throw await de_InternalServerExceptionRes(parsedOutput, context);
840
- case "ResourceNotFoundException":
841
- case "com.amazonaws.backupgateway#ResourceNotFoundException":
842
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
843
- case "ThrottlingException":
844
- case "com.amazonaws.backupgateway#ThrottlingException":
845
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
846
- case "ValidationException":
847
- case "com.amazonaws.backupgateway#ValidationException":
848
- throw await de_ValidationExceptionRes(parsedOutput, context);
849
- default:
850
- const parsedBody = parsedOutput.body;
851
- return throwDefaultError({
852
- output,
853
- parsedBody,
854
- errorCode,
855
- });
363
+ export const de_PutHypervisorPropertyMappingsCommand = async (output, context) => {
364
+ if (output.statusCode >= 300) {
365
+ return de_CommandError(output, context);
856
366
  }
367
+ const data = await parseBody(output.body, context);
368
+ let contents = {};
369
+ contents = _json(data);
370
+ const response = {
371
+ $metadata: deserializeMetadata(output),
372
+ ...contents,
373
+ };
374
+ return response;
857
375
  };
858
376
  export const de_PutMaintenanceStartTimeCommand = async (output, context) => {
859
377
  if (output.statusCode >= 300) {
860
- return de_PutMaintenanceStartTimeCommandError(output, context);
378
+ return de_CommandError(output, context);
861
379
  }
862
380
  const data = await parseBody(output.body, context);
863
381
  let contents = {};
@@ -868,40 +386,9 @@ export const de_PutMaintenanceStartTimeCommand = async (output, context) => {
868
386
  };
869
387
  return response;
870
388
  };
871
- const de_PutMaintenanceStartTimeCommandError = async (output, context) => {
872
- const parsedOutput = {
873
- ...output,
874
- body: await parseErrorBody(output.body, context),
875
- };
876
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
877
- switch (errorCode) {
878
- case "ConflictException":
879
- case "com.amazonaws.backupgateway#ConflictException":
880
- throw await de_ConflictExceptionRes(parsedOutput, context);
881
- case "InternalServerException":
882
- case "com.amazonaws.backupgateway#InternalServerException":
883
- throw await de_InternalServerExceptionRes(parsedOutput, context);
884
- case "ResourceNotFoundException":
885
- case "com.amazonaws.backupgateway#ResourceNotFoundException":
886
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
887
- case "ThrottlingException":
888
- case "com.amazonaws.backupgateway#ThrottlingException":
889
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
890
- case "ValidationException":
891
- case "com.amazonaws.backupgateway#ValidationException":
892
- throw await de_ValidationExceptionRes(parsedOutput, context);
893
- default:
894
- const parsedBody = parsedOutput.body;
895
- return throwDefaultError({
896
- output,
897
- parsedBody,
898
- errorCode,
899
- });
900
- }
901
- };
902
389
  export const de_StartVirtualMachinesMetadataSyncCommand = async (output, context) => {
903
390
  if (output.statusCode >= 300) {
904
- return de_StartVirtualMachinesMetadataSyncCommandError(output, context);
391
+ return de_CommandError(output, context);
905
392
  }
906
393
  const data = await parseBody(output.body, context);
907
394
  let contents = {};
@@ -912,40 +399,9 @@ export const de_StartVirtualMachinesMetadataSyncCommand = async (output, context
912
399
  };
913
400
  return response;
914
401
  };
915
- const de_StartVirtualMachinesMetadataSyncCommandError = async (output, context) => {
916
- const parsedOutput = {
917
- ...output,
918
- body: await parseErrorBody(output.body, context),
919
- };
920
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
921
- switch (errorCode) {
922
- case "AccessDeniedException":
923
- case "com.amazonaws.backupgateway#AccessDeniedException":
924
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
925
- case "InternalServerException":
926
- case "com.amazonaws.backupgateway#InternalServerException":
927
- throw await de_InternalServerExceptionRes(parsedOutput, context);
928
- case "ResourceNotFoundException":
929
- case "com.amazonaws.backupgateway#ResourceNotFoundException":
930
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
931
- case "ThrottlingException":
932
- case "com.amazonaws.backupgateway#ThrottlingException":
933
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
934
- case "ValidationException":
935
- case "com.amazonaws.backupgateway#ValidationException":
936
- throw await de_ValidationExceptionRes(parsedOutput, context);
937
- default:
938
- const parsedBody = parsedOutput.body;
939
- return throwDefaultError({
940
- output,
941
- parsedBody,
942
- errorCode,
943
- });
944
- }
945
- };
946
402
  export const de_TagResourceCommand = async (output, context) => {
947
403
  if (output.statusCode >= 300) {
948
- return de_TagResourceCommandError(output, context);
404
+ return de_CommandError(output, context);
949
405
  }
950
406
  const data = await parseBody(output.body, context);
951
407
  let contents = {};
@@ -956,37 +412,9 @@ export const de_TagResourceCommand = async (output, context) => {
956
412
  };
957
413
  return response;
958
414
  };
959
- const de_TagResourceCommandError = async (output, context) => {
960
- const parsedOutput = {
961
- ...output,
962
- body: await parseErrorBody(output.body, context),
963
- };
964
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
965
- switch (errorCode) {
966
- case "InternalServerException":
967
- case "com.amazonaws.backupgateway#InternalServerException":
968
- throw await de_InternalServerExceptionRes(parsedOutput, context);
969
- case "ResourceNotFoundException":
970
- case "com.amazonaws.backupgateway#ResourceNotFoundException":
971
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
972
- case "ThrottlingException":
973
- case "com.amazonaws.backupgateway#ThrottlingException":
974
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
975
- case "ValidationException":
976
- case "com.amazonaws.backupgateway#ValidationException":
977
- throw await de_ValidationExceptionRes(parsedOutput, context);
978
- default:
979
- const parsedBody = parsedOutput.body;
980
- return throwDefaultError({
981
- output,
982
- parsedBody,
983
- errorCode,
984
- });
985
- }
986
- };
987
415
  export const de_TestHypervisorConfigurationCommand = async (output, context) => {
988
416
  if (output.statusCode >= 300) {
989
- return de_TestHypervisorConfigurationCommandError(output, context);
417
+ return de_CommandError(output, context);
990
418
  }
991
419
  const data = await parseBody(output.body, context);
992
420
  let contents = {};
@@ -997,40 +425,9 @@ export const de_TestHypervisorConfigurationCommand = async (output, context) =>
997
425
  };
998
426
  return response;
999
427
  };
1000
- const de_TestHypervisorConfigurationCommandError = async (output, context) => {
1001
- const parsedOutput = {
1002
- ...output,
1003
- body: await parseErrorBody(output.body, context),
1004
- };
1005
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1006
- switch (errorCode) {
1007
- case "ConflictException":
1008
- case "com.amazonaws.backupgateway#ConflictException":
1009
- throw await de_ConflictExceptionRes(parsedOutput, context);
1010
- case "InternalServerException":
1011
- case "com.amazonaws.backupgateway#InternalServerException":
1012
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1013
- case "ResourceNotFoundException":
1014
- case "com.amazonaws.backupgateway#ResourceNotFoundException":
1015
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1016
- case "ThrottlingException":
1017
- case "com.amazonaws.backupgateway#ThrottlingException":
1018
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1019
- case "ValidationException":
1020
- case "com.amazonaws.backupgateway#ValidationException":
1021
- throw await de_ValidationExceptionRes(parsedOutput, context);
1022
- default:
1023
- const parsedBody = parsedOutput.body;
1024
- return throwDefaultError({
1025
- output,
1026
- parsedBody,
1027
- errorCode,
1028
- });
1029
- }
1030
- };
1031
428
  export const de_UntagResourceCommand = async (output, context) => {
1032
429
  if (output.statusCode >= 300) {
1033
- return de_UntagResourceCommandError(output, context);
430
+ return de_CommandError(output, context);
1034
431
  }
1035
432
  const data = await parseBody(output.body, context);
1036
433
  let contents = {};
@@ -1041,37 +438,9 @@ export const de_UntagResourceCommand = async (output, context) => {
1041
438
  };
1042
439
  return response;
1043
440
  };
1044
- const de_UntagResourceCommandError = async (output, context) => {
1045
- const parsedOutput = {
1046
- ...output,
1047
- body: await parseErrorBody(output.body, context),
1048
- };
1049
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1050
- switch (errorCode) {
1051
- case "InternalServerException":
1052
- case "com.amazonaws.backupgateway#InternalServerException":
1053
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1054
- case "ResourceNotFoundException":
1055
- case "com.amazonaws.backupgateway#ResourceNotFoundException":
1056
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1057
- case "ThrottlingException":
1058
- case "com.amazonaws.backupgateway#ThrottlingException":
1059
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1060
- case "ValidationException":
1061
- case "com.amazonaws.backupgateway#ValidationException":
1062
- throw await de_ValidationExceptionRes(parsedOutput, context);
1063
- default:
1064
- const parsedBody = parsedOutput.body;
1065
- return throwDefaultError({
1066
- output,
1067
- parsedBody,
1068
- errorCode,
1069
- });
1070
- }
1071
- };
1072
441
  export const de_UpdateGatewayInformationCommand = async (output, context) => {
1073
442
  if (output.statusCode >= 300) {
1074
- return de_UpdateGatewayInformationCommandError(output, context);
443
+ return de_CommandError(output, context);
1075
444
  }
1076
445
  const data = await parseBody(output.body, context);
1077
446
  let contents = {};
@@ -1082,40 +451,9 @@ export const de_UpdateGatewayInformationCommand = async (output, context) => {
1082
451
  };
1083
452
  return response;
1084
453
  };
1085
- const de_UpdateGatewayInformationCommandError = async (output, context) => {
1086
- const parsedOutput = {
1087
- ...output,
1088
- body: await parseErrorBody(output.body, context),
1089
- };
1090
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1091
- switch (errorCode) {
1092
- case "ConflictException":
1093
- case "com.amazonaws.backupgateway#ConflictException":
1094
- throw await de_ConflictExceptionRes(parsedOutput, context);
1095
- case "InternalServerException":
1096
- case "com.amazonaws.backupgateway#InternalServerException":
1097
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1098
- case "ResourceNotFoundException":
1099
- case "com.amazonaws.backupgateway#ResourceNotFoundException":
1100
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1101
- case "ThrottlingException":
1102
- case "com.amazonaws.backupgateway#ThrottlingException":
1103
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1104
- case "ValidationException":
1105
- case "com.amazonaws.backupgateway#ValidationException":
1106
- throw await de_ValidationExceptionRes(parsedOutput, context);
1107
- default:
1108
- const parsedBody = parsedOutput.body;
1109
- return throwDefaultError({
1110
- output,
1111
- parsedBody,
1112
- errorCode,
1113
- });
1114
- }
1115
- };
1116
454
  export const de_UpdateGatewaySoftwareNowCommand = async (output, context) => {
1117
455
  if (output.statusCode >= 300) {
1118
- return de_UpdateGatewaySoftwareNowCommandError(output, context);
456
+ return de_CommandError(output, context);
1119
457
  }
1120
458
  const data = await parseBody(output.body, context);
1121
459
  let contents = {};
@@ -1126,37 +464,9 @@ export const de_UpdateGatewaySoftwareNowCommand = async (output, context) => {
1126
464
  };
1127
465
  return response;
1128
466
  };
1129
- const de_UpdateGatewaySoftwareNowCommandError = async (output, context) => {
1130
- const parsedOutput = {
1131
- ...output,
1132
- body: await parseErrorBody(output.body, context),
1133
- };
1134
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1135
- switch (errorCode) {
1136
- case "InternalServerException":
1137
- case "com.amazonaws.backupgateway#InternalServerException":
1138
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1139
- case "ResourceNotFoundException":
1140
- case "com.amazonaws.backupgateway#ResourceNotFoundException":
1141
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1142
- case "ThrottlingException":
1143
- case "com.amazonaws.backupgateway#ThrottlingException":
1144
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1145
- case "ValidationException":
1146
- case "com.amazonaws.backupgateway#ValidationException":
1147
- throw await de_ValidationExceptionRes(parsedOutput, context);
1148
- default:
1149
- const parsedBody = parsedOutput.body;
1150
- return throwDefaultError({
1151
- output,
1152
- parsedBody,
1153
- errorCode,
1154
- });
1155
- }
1156
- };
1157
467
  export const de_UpdateHypervisorCommand = async (output, context) => {
1158
468
  if (output.statusCode >= 300) {
1159
- return de_UpdateHypervisorCommandError(output, context);
469
+ return de_CommandError(output, context);
1160
470
  }
1161
471
  const data = await parseBody(output.body, context);
1162
472
  let contents = {};
@@ -1167,31 +477,31 @@ export const de_UpdateHypervisorCommand = async (output, context) => {
1167
477
  };
1168
478
  return response;
1169
479
  };
1170
- const de_UpdateHypervisorCommandError = async (output, context) => {
480
+ const de_CommandError = async (output, context) => {
1171
481
  const parsedOutput = {
1172
482
  ...output,
1173
483
  body: await parseErrorBody(output.body, context),
1174
484
  };
1175
485
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1176
486
  switch (errorCode) {
1177
- case "AccessDeniedException":
1178
- case "com.amazonaws.backupgateway#AccessDeniedException":
1179
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1180
487
  case "ConflictException":
1181
488
  case "com.amazonaws.backupgateway#ConflictException":
1182
489
  throw await de_ConflictExceptionRes(parsedOutput, context);
1183
490
  case "InternalServerException":
1184
491
  case "com.amazonaws.backupgateway#InternalServerException":
1185
492
  throw await de_InternalServerExceptionRes(parsedOutput, context);
1186
- case "ResourceNotFoundException":
1187
- case "com.amazonaws.backupgateway#ResourceNotFoundException":
1188
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1189
493
  case "ThrottlingException":
1190
494
  case "com.amazonaws.backupgateway#ThrottlingException":
1191
495
  throw await de_ThrottlingExceptionRes(parsedOutput, context);
1192
496
  case "ValidationException":
1193
497
  case "com.amazonaws.backupgateway#ValidationException":
1194
498
  throw await de_ValidationExceptionRes(parsedOutput, context);
499
+ case "ResourceNotFoundException":
500
+ case "com.amazonaws.backupgateway#ResourceNotFoundException":
501
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
502
+ case "AccessDeniedException":
503
+ case "com.amazonaws.backupgateway#AccessDeniedException":
504
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1195
505
  default:
1196
506
  const parsedBody = parsedOutput.body;
1197
507
  return throwDefaultError({