@aws-sdk/client-ebs 3.52.0 → 3.53.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/dist-cjs/index.js +3 -0
- package/dist-cjs/models/EBSServiceException.js +11 -0
- package/dist-cjs/models/models_0.js +119 -1
- package/dist-cjs/protocols/Aws_restJson1.js +118 -352
- package/dist-es/index.js +1 -0
- package/dist-es/models/EBSServiceException.js +12 -0
- package/dist-es/models/models_0.js +111 -1
- package/dist-es/protocols/Aws_restJson1.js +189 -385
- package/dist-types/index.d.ts +1 -0
- package/dist-types/models/EBSServiceException.d.ts +10 -0
- package/dist-types/models/models_0.d.ts +58 -25
- package/dist-types/ts3.4/index.d.ts +1 -0
- package/dist-types/ts3.4/models/EBSServiceException.d.ts +6 -0
- package/dist-types/ts3.4/models/models_0.d.ts +42 -25
- package/package.json +25 -25
|
@@ -4,6 +4,8 @@ exports.deserializeAws_restJson1StartSnapshotCommand = exports.deserializeAws_re
|
|
|
4
4
|
const protocol_http_1 = require("@aws-sdk/protocol-http");
|
|
5
5
|
const smithy_client_1 = require("@aws-sdk/smithy-client");
|
|
6
6
|
const uuid_1 = require("uuid");
|
|
7
|
+
const EBSServiceException_1 = require("../models/EBSServiceException");
|
|
8
|
+
const models_0_1 = require("../models/models_0");
|
|
7
9
|
const serializeAws_restJson1CompleteSnapshotCommand = async (input, context) => {
|
|
8
10
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
9
11
|
const headers = {
|
|
@@ -249,67 +251,31 @@ const deserializeAws_restJson1CompleteSnapshotCommandError = async (output, cont
|
|
|
249
251
|
switch (errorCode) {
|
|
250
252
|
case "AccessDeniedException":
|
|
251
253
|
case "com.amazonaws.ebs#AccessDeniedException":
|
|
252
|
-
|
|
253
|
-
...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
|
|
254
|
-
name: errorCode,
|
|
255
|
-
$metadata: deserializeMetadata(output),
|
|
256
|
-
};
|
|
257
|
-
break;
|
|
254
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
258
255
|
case "InternalServerException":
|
|
259
256
|
case "com.amazonaws.ebs#InternalServerException":
|
|
260
|
-
|
|
261
|
-
...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
|
|
262
|
-
name: errorCode,
|
|
263
|
-
$metadata: deserializeMetadata(output),
|
|
264
|
-
};
|
|
265
|
-
break;
|
|
257
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
266
258
|
case "RequestThrottledException":
|
|
267
259
|
case "com.amazonaws.ebs#RequestThrottledException":
|
|
268
|
-
|
|
269
|
-
...(await deserializeAws_restJson1RequestThrottledExceptionResponse(parsedOutput, context)),
|
|
270
|
-
name: errorCode,
|
|
271
|
-
$metadata: deserializeMetadata(output),
|
|
272
|
-
};
|
|
273
|
-
break;
|
|
260
|
+
throw await deserializeAws_restJson1RequestThrottledExceptionResponse(parsedOutput, context);
|
|
274
261
|
case "ResourceNotFoundException":
|
|
275
262
|
case "com.amazonaws.ebs#ResourceNotFoundException":
|
|
276
|
-
|
|
277
|
-
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
278
|
-
name: errorCode,
|
|
279
|
-
$metadata: deserializeMetadata(output),
|
|
280
|
-
};
|
|
281
|
-
break;
|
|
263
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
282
264
|
case "ServiceQuotaExceededException":
|
|
283
265
|
case "com.amazonaws.ebs#ServiceQuotaExceededException":
|
|
284
|
-
|
|
285
|
-
...(await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)),
|
|
286
|
-
name: errorCode,
|
|
287
|
-
$metadata: deserializeMetadata(output),
|
|
288
|
-
};
|
|
289
|
-
break;
|
|
266
|
+
throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
|
|
290
267
|
case "ValidationException":
|
|
291
268
|
case "com.amazonaws.ebs#ValidationException":
|
|
292
|
-
|
|
293
|
-
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
294
|
-
name: errorCode,
|
|
295
|
-
$metadata: deserializeMetadata(output),
|
|
296
|
-
};
|
|
297
|
-
break;
|
|
269
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
298
270
|
default:
|
|
299
271
|
const parsedBody = parsedOutput.body;
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
...parsedBody,
|
|
303
|
-
name: `${errorCode}`,
|
|
304
|
-
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
272
|
+
response = new EBSServiceException_1.EBSServiceException({
|
|
273
|
+
name: parsedBody.code || parsedBody.Code || errorCode,
|
|
305
274
|
$fault: "client",
|
|
306
275
|
$metadata: deserializeMetadata(output),
|
|
307
|
-
};
|
|
276
|
+
});
|
|
277
|
+
throw smithy_client_1.decorateServiceException(response, parsedBody);
|
|
308
278
|
}
|
|
309
|
-
const message = response.message || response.Message || errorCode;
|
|
310
|
-
response.message = message;
|
|
311
|
-
delete response.Message;
|
|
312
|
-
return Promise.reject(Object.assign(new Error(message), response));
|
|
313
279
|
};
|
|
314
280
|
const deserializeAws_restJson1GetSnapshotBlockCommand = async (output, context) => {
|
|
315
281
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
@@ -347,67 +313,31 @@ const deserializeAws_restJson1GetSnapshotBlockCommandError = async (output, cont
|
|
|
347
313
|
switch (errorCode) {
|
|
348
314
|
case "AccessDeniedException":
|
|
349
315
|
case "com.amazonaws.ebs#AccessDeniedException":
|
|
350
|
-
|
|
351
|
-
...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
|
|
352
|
-
name: errorCode,
|
|
353
|
-
$metadata: deserializeMetadata(output),
|
|
354
|
-
};
|
|
355
|
-
break;
|
|
316
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
356
317
|
case "InternalServerException":
|
|
357
318
|
case "com.amazonaws.ebs#InternalServerException":
|
|
358
|
-
|
|
359
|
-
...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
|
|
360
|
-
name: errorCode,
|
|
361
|
-
$metadata: deserializeMetadata(output),
|
|
362
|
-
};
|
|
363
|
-
break;
|
|
319
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
364
320
|
case "RequestThrottledException":
|
|
365
321
|
case "com.amazonaws.ebs#RequestThrottledException":
|
|
366
|
-
|
|
367
|
-
...(await deserializeAws_restJson1RequestThrottledExceptionResponse(parsedOutput, context)),
|
|
368
|
-
name: errorCode,
|
|
369
|
-
$metadata: deserializeMetadata(output),
|
|
370
|
-
};
|
|
371
|
-
break;
|
|
322
|
+
throw await deserializeAws_restJson1RequestThrottledExceptionResponse(parsedOutput, context);
|
|
372
323
|
case "ResourceNotFoundException":
|
|
373
324
|
case "com.amazonaws.ebs#ResourceNotFoundException":
|
|
374
|
-
|
|
375
|
-
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
376
|
-
name: errorCode,
|
|
377
|
-
$metadata: deserializeMetadata(output),
|
|
378
|
-
};
|
|
379
|
-
break;
|
|
325
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
380
326
|
case "ServiceQuotaExceededException":
|
|
381
327
|
case "com.amazonaws.ebs#ServiceQuotaExceededException":
|
|
382
|
-
|
|
383
|
-
...(await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)),
|
|
384
|
-
name: errorCode,
|
|
385
|
-
$metadata: deserializeMetadata(output),
|
|
386
|
-
};
|
|
387
|
-
break;
|
|
328
|
+
throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
|
|
388
329
|
case "ValidationException":
|
|
389
330
|
case "com.amazonaws.ebs#ValidationException":
|
|
390
|
-
|
|
391
|
-
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
392
|
-
name: errorCode,
|
|
393
|
-
$metadata: deserializeMetadata(output),
|
|
394
|
-
};
|
|
395
|
-
break;
|
|
331
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
396
332
|
default:
|
|
397
333
|
const parsedBody = parsedOutput.body;
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
...parsedBody,
|
|
401
|
-
name: `${errorCode}`,
|
|
402
|
-
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
334
|
+
response = new EBSServiceException_1.EBSServiceException({
|
|
335
|
+
name: parsedBody.code || parsedBody.Code || errorCode,
|
|
403
336
|
$fault: "client",
|
|
404
337
|
$metadata: deserializeMetadata(output),
|
|
405
|
-
};
|
|
338
|
+
});
|
|
339
|
+
throw smithy_client_1.decorateServiceException(response, parsedBody);
|
|
406
340
|
}
|
|
407
|
-
const message = response.message || response.Message || errorCode;
|
|
408
|
-
response.message = message;
|
|
409
|
-
delete response.Message;
|
|
410
|
-
return Promise.reject(Object.assign(new Error(message), response));
|
|
411
341
|
};
|
|
412
342
|
const deserializeAws_restJson1ListChangedBlocksCommand = async (output, context) => {
|
|
413
343
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
@@ -451,67 +381,31 @@ const deserializeAws_restJson1ListChangedBlocksCommandError = async (output, con
|
|
|
451
381
|
switch (errorCode) {
|
|
452
382
|
case "AccessDeniedException":
|
|
453
383
|
case "com.amazonaws.ebs#AccessDeniedException":
|
|
454
|
-
|
|
455
|
-
...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
|
|
456
|
-
name: errorCode,
|
|
457
|
-
$metadata: deserializeMetadata(output),
|
|
458
|
-
};
|
|
459
|
-
break;
|
|
384
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
460
385
|
case "InternalServerException":
|
|
461
386
|
case "com.amazonaws.ebs#InternalServerException":
|
|
462
|
-
|
|
463
|
-
...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
|
|
464
|
-
name: errorCode,
|
|
465
|
-
$metadata: deserializeMetadata(output),
|
|
466
|
-
};
|
|
467
|
-
break;
|
|
387
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
468
388
|
case "RequestThrottledException":
|
|
469
389
|
case "com.amazonaws.ebs#RequestThrottledException":
|
|
470
|
-
|
|
471
|
-
...(await deserializeAws_restJson1RequestThrottledExceptionResponse(parsedOutput, context)),
|
|
472
|
-
name: errorCode,
|
|
473
|
-
$metadata: deserializeMetadata(output),
|
|
474
|
-
};
|
|
475
|
-
break;
|
|
390
|
+
throw await deserializeAws_restJson1RequestThrottledExceptionResponse(parsedOutput, context);
|
|
476
391
|
case "ResourceNotFoundException":
|
|
477
392
|
case "com.amazonaws.ebs#ResourceNotFoundException":
|
|
478
|
-
|
|
479
|
-
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
480
|
-
name: errorCode,
|
|
481
|
-
$metadata: deserializeMetadata(output),
|
|
482
|
-
};
|
|
483
|
-
break;
|
|
393
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
484
394
|
case "ServiceQuotaExceededException":
|
|
485
395
|
case "com.amazonaws.ebs#ServiceQuotaExceededException":
|
|
486
|
-
|
|
487
|
-
...(await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)),
|
|
488
|
-
name: errorCode,
|
|
489
|
-
$metadata: deserializeMetadata(output),
|
|
490
|
-
};
|
|
491
|
-
break;
|
|
396
|
+
throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
|
|
492
397
|
case "ValidationException":
|
|
493
398
|
case "com.amazonaws.ebs#ValidationException":
|
|
494
|
-
|
|
495
|
-
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
496
|
-
name: errorCode,
|
|
497
|
-
$metadata: deserializeMetadata(output),
|
|
498
|
-
};
|
|
499
|
-
break;
|
|
399
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
500
400
|
default:
|
|
501
401
|
const parsedBody = parsedOutput.body;
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
...parsedBody,
|
|
505
|
-
name: `${errorCode}`,
|
|
506
|
-
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
402
|
+
response = new EBSServiceException_1.EBSServiceException({
|
|
403
|
+
name: parsedBody.code || parsedBody.Code || errorCode,
|
|
507
404
|
$fault: "client",
|
|
508
405
|
$metadata: deserializeMetadata(output),
|
|
509
|
-
};
|
|
406
|
+
});
|
|
407
|
+
throw smithy_client_1.decorateServiceException(response, parsedBody);
|
|
510
408
|
}
|
|
511
|
-
const message = response.message || response.Message || errorCode;
|
|
512
|
-
response.message = message;
|
|
513
|
-
delete response.Message;
|
|
514
|
-
return Promise.reject(Object.assign(new Error(message), response));
|
|
515
409
|
};
|
|
516
410
|
const deserializeAws_restJson1ListSnapshotBlocksCommand = async (output, context) => {
|
|
517
411
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
@@ -555,67 +449,31 @@ const deserializeAws_restJson1ListSnapshotBlocksCommandError = async (output, co
|
|
|
555
449
|
switch (errorCode) {
|
|
556
450
|
case "AccessDeniedException":
|
|
557
451
|
case "com.amazonaws.ebs#AccessDeniedException":
|
|
558
|
-
|
|
559
|
-
...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
|
|
560
|
-
name: errorCode,
|
|
561
|
-
$metadata: deserializeMetadata(output),
|
|
562
|
-
};
|
|
563
|
-
break;
|
|
452
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
564
453
|
case "InternalServerException":
|
|
565
454
|
case "com.amazonaws.ebs#InternalServerException":
|
|
566
|
-
|
|
567
|
-
...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
|
|
568
|
-
name: errorCode,
|
|
569
|
-
$metadata: deserializeMetadata(output),
|
|
570
|
-
};
|
|
571
|
-
break;
|
|
455
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
572
456
|
case "RequestThrottledException":
|
|
573
457
|
case "com.amazonaws.ebs#RequestThrottledException":
|
|
574
|
-
|
|
575
|
-
...(await deserializeAws_restJson1RequestThrottledExceptionResponse(parsedOutput, context)),
|
|
576
|
-
name: errorCode,
|
|
577
|
-
$metadata: deserializeMetadata(output),
|
|
578
|
-
};
|
|
579
|
-
break;
|
|
458
|
+
throw await deserializeAws_restJson1RequestThrottledExceptionResponse(parsedOutput, context);
|
|
580
459
|
case "ResourceNotFoundException":
|
|
581
460
|
case "com.amazonaws.ebs#ResourceNotFoundException":
|
|
582
|
-
|
|
583
|
-
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
584
|
-
name: errorCode,
|
|
585
|
-
$metadata: deserializeMetadata(output),
|
|
586
|
-
};
|
|
587
|
-
break;
|
|
461
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
588
462
|
case "ServiceQuotaExceededException":
|
|
589
463
|
case "com.amazonaws.ebs#ServiceQuotaExceededException":
|
|
590
|
-
|
|
591
|
-
...(await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)),
|
|
592
|
-
name: errorCode,
|
|
593
|
-
$metadata: deserializeMetadata(output),
|
|
594
|
-
};
|
|
595
|
-
break;
|
|
464
|
+
throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
|
|
596
465
|
case "ValidationException":
|
|
597
466
|
case "com.amazonaws.ebs#ValidationException":
|
|
598
|
-
|
|
599
|
-
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
600
|
-
name: errorCode,
|
|
601
|
-
$metadata: deserializeMetadata(output),
|
|
602
|
-
};
|
|
603
|
-
break;
|
|
467
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
604
468
|
default:
|
|
605
469
|
const parsedBody = parsedOutput.body;
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
...parsedBody,
|
|
609
|
-
name: `${errorCode}`,
|
|
610
|
-
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
470
|
+
response = new EBSServiceException_1.EBSServiceException({
|
|
471
|
+
name: parsedBody.code || parsedBody.Code || errorCode,
|
|
611
472
|
$fault: "client",
|
|
612
473
|
$metadata: deserializeMetadata(output),
|
|
613
|
-
};
|
|
474
|
+
});
|
|
475
|
+
throw smithy_client_1.decorateServiceException(response, parsedBody);
|
|
614
476
|
}
|
|
615
|
-
const message = response.message || response.Message || errorCode;
|
|
616
|
-
response.message = message;
|
|
617
|
-
delete response.Message;
|
|
618
|
-
return Promise.reject(Object.assign(new Error(message), response));
|
|
619
477
|
};
|
|
620
478
|
const deserializeAws_restJson1PutSnapshotBlockCommand = async (output, context) => {
|
|
621
479
|
if (output.statusCode !== 201 && output.statusCode >= 300) {
|
|
@@ -647,67 +505,31 @@ const deserializeAws_restJson1PutSnapshotBlockCommandError = async (output, cont
|
|
|
647
505
|
switch (errorCode) {
|
|
648
506
|
case "AccessDeniedException":
|
|
649
507
|
case "com.amazonaws.ebs#AccessDeniedException":
|
|
650
|
-
|
|
651
|
-
...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
|
|
652
|
-
name: errorCode,
|
|
653
|
-
$metadata: deserializeMetadata(output),
|
|
654
|
-
};
|
|
655
|
-
break;
|
|
508
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
656
509
|
case "InternalServerException":
|
|
657
510
|
case "com.amazonaws.ebs#InternalServerException":
|
|
658
|
-
|
|
659
|
-
...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
|
|
660
|
-
name: errorCode,
|
|
661
|
-
$metadata: deserializeMetadata(output),
|
|
662
|
-
};
|
|
663
|
-
break;
|
|
511
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
664
512
|
case "RequestThrottledException":
|
|
665
513
|
case "com.amazonaws.ebs#RequestThrottledException":
|
|
666
|
-
|
|
667
|
-
...(await deserializeAws_restJson1RequestThrottledExceptionResponse(parsedOutput, context)),
|
|
668
|
-
name: errorCode,
|
|
669
|
-
$metadata: deserializeMetadata(output),
|
|
670
|
-
};
|
|
671
|
-
break;
|
|
514
|
+
throw await deserializeAws_restJson1RequestThrottledExceptionResponse(parsedOutput, context);
|
|
672
515
|
case "ResourceNotFoundException":
|
|
673
516
|
case "com.amazonaws.ebs#ResourceNotFoundException":
|
|
674
|
-
|
|
675
|
-
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
676
|
-
name: errorCode,
|
|
677
|
-
$metadata: deserializeMetadata(output),
|
|
678
|
-
};
|
|
679
|
-
break;
|
|
517
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
680
518
|
case "ServiceQuotaExceededException":
|
|
681
519
|
case "com.amazonaws.ebs#ServiceQuotaExceededException":
|
|
682
|
-
|
|
683
|
-
...(await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)),
|
|
684
|
-
name: errorCode,
|
|
685
|
-
$metadata: deserializeMetadata(output),
|
|
686
|
-
};
|
|
687
|
-
break;
|
|
520
|
+
throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
|
|
688
521
|
case "ValidationException":
|
|
689
522
|
case "com.amazonaws.ebs#ValidationException":
|
|
690
|
-
|
|
691
|
-
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
692
|
-
name: errorCode,
|
|
693
|
-
$metadata: deserializeMetadata(output),
|
|
694
|
-
};
|
|
695
|
-
break;
|
|
523
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
696
524
|
default:
|
|
697
525
|
const parsedBody = parsedOutput.body;
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
...parsedBody,
|
|
701
|
-
name: `${errorCode}`,
|
|
702
|
-
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
526
|
+
response = new EBSServiceException_1.EBSServiceException({
|
|
527
|
+
name: parsedBody.code || parsedBody.Code || errorCode,
|
|
703
528
|
$fault: "client",
|
|
704
529
|
$metadata: deserializeMetadata(output),
|
|
705
|
-
};
|
|
530
|
+
});
|
|
531
|
+
throw smithy_client_1.decorateServiceException(response, parsedBody);
|
|
706
532
|
}
|
|
707
|
-
const message = response.message || response.Message || errorCode;
|
|
708
|
-
response.message = message;
|
|
709
|
-
delete response.Message;
|
|
710
|
-
return Promise.reject(Object.assign(new Error(message), response));
|
|
711
533
|
};
|
|
712
534
|
const deserializeAws_restJson1StartSnapshotCommand = async (output, context) => {
|
|
713
535
|
if (output.statusCode !== 201 && output.statusCode >= 300) {
|
|
@@ -771,92 +593,40 @@ const deserializeAws_restJson1StartSnapshotCommandError = async (output, context
|
|
|
771
593
|
switch (errorCode) {
|
|
772
594
|
case "AccessDeniedException":
|
|
773
595
|
case "com.amazonaws.ebs#AccessDeniedException":
|
|
774
|
-
|
|
775
|
-
...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
|
|
776
|
-
name: errorCode,
|
|
777
|
-
$metadata: deserializeMetadata(output),
|
|
778
|
-
};
|
|
779
|
-
break;
|
|
596
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
780
597
|
case "ConcurrentLimitExceededException":
|
|
781
598
|
case "com.amazonaws.ebs#ConcurrentLimitExceededException":
|
|
782
|
-
|
|
783
|
-
...(await deserializeAws_restJson1ConcurrentLimitExceededExceptionResponse(parsedOutput, context)),
|
|
784
|
-
name: errorCode,
|
|
785
|
-
$metadata: deserializeMetadata(output),
|
|
786
|
-
};
|
|
787
|
-
break;
|
|
599
|
+
throw await deserializeAws_restJson1ConcurrentLimitExceededExceptionResponse(parsedOutput, context);
|
|
788
600
|
case "ConflictException":
|
|
789
601
|
case "com.amazonaws.ebs#ConflictException":
|
|
790
|
-
|
|
791
|
-
...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
|
|
792
|
-
name: errorCode,
|
|
793
|
-
$metadata: deserializeMetadata(output),
|
|
794
|
-
};
|
|
795
|
-
break;
|
|
602
|
+
throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
|
|
796
603
|
case "InternalServerException":
|
|
797
604
|
case "com.amazonaws.ebs#InternalServerException":
|
|
798
|
-
|
|
799
|
-
...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
|
|
800
|
-
name: errorCode,
|
|
801
|
-
$metadata: deserializeMetadata(output),
|
|
802
|
-
};
|
|
803
|
-
break;
|
|
605
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
804
606
|
case "RequestThrottledException":
|
|
805
607
|
case "com.amazonaws.ebs#RequestThrottledException":
|
|
806
|
-
|
|
807
|
-
...(await deserializeAws_restJson1RequestThrottledExceptionResponse(parsedOutput, context)),
|
|
808
|
-
name: errorCode,
|
|
809
|
-
$metadata: deserializeMetadata(output),
|
|
810
|
-
};
|
|
811
|
-
break;
|
|
608
|
+
throw await deserializeAws_restJson1RequestThrottledExceptionResponse(parsedOutput, context);
|
|
812
609
|
case "ResourceNotFoundException":
|
|
813
610
|
case "com.amazonaws.ebs#ResourceNotFoundException":
|
|
814
|
-
|
|
815
|
-
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
816
|
-
name: errorCode,
|
|
817
|
-
$metadata: deserializeMetadata(output),
|
|
818
|
-
};
|
|
819
|
-
break;
|
|
611
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
820
612
|
case "ServiceQuotaExceededException":
|
|
821
613
|
case "com.amazonaws.ebs#ServiceQuotaExceededException":
|
|
822
|
-
|
|
823
|
-
...(await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)),
|
|
824
|
-
name: errorCode,
|
|
825
|
-
$metadata: deserializeMetadata(output),
|
|
826
|
-
};
|
|
827
|
-
break;
|
|
614
|
+
throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
|
|
828
615
|
case "ValidationException":
|
|
829
616
|
case "com.amazonaws.ebs#ValidationException":
|
|
830
|
-
|
|
831
|
-
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
832
|
-
name: errorCode,
|
|
833
|
-
$metadata: deserializeMetadata(output),
|
|
834
|
-
};
|
|
835
|
-
break;
|
|
617
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
836
618
|
default:
|
|
837
619
|
const parsedBody = parsedOutput.body;
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
...parsedBody,
|
|
841
|
-
name: `${errorCode}`,
|
|
842
|
-
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
620
|
+
response = new EBSServiceException_1.EBSServiceException({
|
|
621
|
+
name: parsedBody.code || parsedBody.Code || errorCode,
|
|
843
622
|
$fault: "client",
|
|
844
623
|
$metadata: deserializeMetadata(output),
|
|
845
|
-
};
|
|
624
|
+
});
|
|
625
|
+
throw smithy_client_1.decorateServiceException(response, parsedBody);
|
|
846
626
|
}
|
|
847
|
-
const message = response.message || response.Message || errorCode;
|
|
848
|
-
response.message = message;
|
|
849
|
-
delete response.Message;
|
|
850
|
-
return Promise.reject(Object.assign(new Error(message), response));
|
|
851
627
|
};
|
|
852
628
|
const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
|
|
853
|
-
const contents = {
|
|
854
|
-
name: "AccessDeniedException",
|
|
855
|
-
$fault: "client",
|
|
856
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
857
|
-
Message: undefined,
|
|
858
|
-
Reason: undefined,
|
|
859
|
-
};
|
|
629
|
+
const contents = {};
|
|
860
630
|
const data = parsedOutput.body;
|
|
861
631
|
if (data.Message !== undefined && data.Message !== null) {
|
|
862
632
|
contents.Message = smithy_client_1.expectString(data.Message);
|
|
@@ -864,55 +634,50 @@ const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutpu
|
|
|
864
634
|
if (data.Reason !== undefined && data.Reason !== null) {
|
|
865
635
|
contents.Reason = smithy_client_1.expectString(data.Reason);
|
|
866
636
|
}
|
|
867
|
-
|
|
637
|
+
const exception = new models_0_1.AccessDeniedException({
|
|
638
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
639
|
+
...contents,
|
|
640
|
+
});
|
|
641
|
+
return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
|
|
868
642
|
};
|
|
869
643
|
const deserializeAws_restJson1ConcurrentLimitExceededExceptionResponse = async (parsedOutput, context) => {
|
|
870
|
-
const contents = {
|
|
871
|
-
name: "ConcurrentLimitExceededException",
|
|
872
|
-
$fault: "client",
|
|
873
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
874
|
-
Message: undefined,
|
|
875
|
-
};
|
|
644
|
+
const contents = {};
|
|
876
645
|
const data = parsedOutput.body;
|
|
877
646
|
if (data.Message !== undefined && data.Message !== null) {
|
|
878
647
|
contents.Message = smithy_client_1.expectString(data.Message);
|
|
879
648
|
}
|
|
880
|
-
|
|
649
|
+
const exception = new models_0_1.ConcurrentLimitExceededException({
|
|
650
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
651
|
+
...contents,
|
|
652
|
+
});
|
|
653
|
+
return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
|
|
881
654
|
};
|
|
882
655
|
const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, context) => {
|
|
883
|
-
const contents = {
|
|
884
|
-
name: "ConflictException",
|
|
885
|
-
$fault: "server",
|
|
886
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
887
|
-
Message: undefined,
|
|
888
|
-
};
|
|
656
|
+
const contents = {};
|
|
889
657
|
const data = parsedOutput.body;
|
|
890
658
|
if (data.Message !== undefined && data.Message !== null) {
|
|
891
659
|
contents.Message = smithy_client_1.expectString(data.Message);
|
|
892
660
|
}
|
|
893
|
-
|
|
661
|
+
const exception = new models_0_1.ConflictException({
|
|
662
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
663
|
+
...contents,
|
|
664
|
+
});
|
|
665
|
+
return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
|
|
894
666
|
};
|
|
895
667
|
const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOutput, context) => {
|
|
896
|
-
const contents = {
|
|
897
|
-
name: "InternalServerException",
|
|
898
|
-
$fault: "server",
|
|
899
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
900
|
-
Message: undefined,
|
|
901
|
-
};
|
|
668
|
+
const contents = {};
|
|
902
669
|
const data = parsedOutput.body;
|
|
903
670
|
if (data.Message !== undefined && data.Message !== null) {
|
|
904
671
|
contents.Message = smithy_client_1.expectString(data.Message);
|
|
905
672
|
}
|
|
906
|
-
|
|
673
|
+
const exception = new models_0_1.InternalServerException({
|
|
674
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
675
|
+
...contents,
|
|
676
|
+
});
|
|
677
|
+
return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
|
|
907
678
|
};
|
|
908
679
|
const deserializeAws_restJson1RequestThrottledExceptionResponse = async (parsedOutput, context) => {
|
|
909
|
-
const contents = {
|
|
910
|
-
name: "RequestThrottledException",
|
|
911
|
-
$fault: "client",
|
|
912
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
913
|
-
Message: undefined,
|
|
914
|
-
Reason: undefined,
|
|
915
|
-
};
|
|
680
|
+
const contents = {};
|
|
916
681
|
const data = parsedOutput.body;
|
|
917
682
|
if (data.Message !== undefined && data.Message !== null) {
|
|
918
683
|
contents.Message = smithy_client_1.expectString(data.Message);
|
|
@@ -920,16 +685,14 @@ const deserializeAws_restJson1RequestThrottledExceptionResponse = async (parsedO
|
|
|
920
685
|
if (data.Reason !== undefined && data.Reason !== null) {
|
|
921
686
|
contents.Reason = smithy_client_1.expectString(data.Reason);
|
|
922
687
|
}
|
|
923
|
-
|
|
688
|
+
const exception = new models_0_1.RequestThrottledException({
|
|
689
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
690
|
+
...contents,
|
|
691
|
+
});
|
|
692
|
+
return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
|
|
924
693
|
};
|
|
925
694
|
const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
|
|
926
|
-
const contents = {
|
|
927
|
-
name: "ResourceNotFoundException",
|
|
928
|
-
$fault: "client",
|
|
929
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
930
|
-
Message: undefined,
|
|
931
|
-
Reason: undefined,
|
|
932
|
-
};
|
|
695
|
+
const contents = {};
|
|
933
696
|
const data = parsedOutput.body;
|
|
934
697
|
if (data.Message !== undefined && data.Message !== null) {
|
|
935
698
|
contents.Message = smithy_client_1.expectString(data.Message);
|
|
@@ -937,16 +700,14 @@ const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedO
|
|
|
937
700
|
if (data.Reason !== undefined && data.Reason !== null) {
|
|
938
701
|
contents.Reason = smithy_client_1.expectString(data.Reason);
|
|
939
702
|
}
|
|
940
|
-
|
|
703
|
+
const exception = new models_0_1.ResourceNotFoundException({
|
|
704
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
705
|
+
...contents,
|
|
706
|
+
});
|
|
707
|
+
return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
|
|
941
708
|
};
|
|
942
709
|
const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (parsedOutput, context) => {
|
|
943
|
-
const contents = {
|
|
944
|
-
name: "ServiceQuotaExceededException",
|
|
945
|
-
$fault: "client",
|
|
946
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
947
|
-
Message: undefined,
|
|
948
|
-
Reason: undefined,
|
|
949
|
-
};
|
|
710
|
+
const contents = {};
|
|
950
711
|
const data = parsedOutput.body;
|
|
951
712
|
if (data.Message !== undefined && data.Message !== null) {
|
|
952
713
|
contents.Message = smithy_client_1.expectString(data.Message);
|
|
@@ -954,16 +715,14 @@ const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (par
|
|
|
954
715
|
if (data.Reason !== undefined && data.Reason !== null) {
|
|
955
716
|
contents.Reason = smithy_client_1.expectString(data.Reason);
|
|
956
717
|
}
|
|
957
|
-
|
|
718
|
+
const exception = new models_0_1.ServiceQuotaExceededException({
|
|
719
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
720
|
+
...contents,
|
|
721
|
+
});
|
|
722
|
+
return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
|
|
958
723
|
};
|
|
959
724
|
const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput, context) => {
|
|
960
|
-
const contents = {
|
|
961
|
-
name: "ValidationException",
|
|
962
|
-
$fault: "client",
|
|
963
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
964
|
-
Message: undefined,
|
|
965
|
-
Reason: undefined,
|
|
966
|
-
};
|
|
725
|
+
const contents = {};
|
|
967
726
|
const data = parsedOutput.body;
|
|
968
727
|
if (data.Message !== undefined && data.Message !== null) {
|
|
969
728
|
contents.Message = smithy_client_1.expectString(data.Message);
|
|
@@ -971,7 +730,11 @@ const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput,
|
|
|
971
730
|
if (data.Reason !== undefined && data.Reason !== null) {
|
|
972
731
|
contents.Reason = smithy_client_1.expectString(data.Reason);
|
|
973
732
|
}
|
|
974
|
-
|
|
733
|
+
const exception = new models_0_1.ValidationException({
|
|
734
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
735
|
+
...contents,
|
|
736
|
+
});
|
|
737
|
+
return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
|
|
975
738
|
};
|
|
976
739
|
const serializeAws_restJson1Tag = (input, context) => {
|
|
977
740
|
return {
|
|
@@ -996,7 +759,7 @@ const deserializeAws_restJson1Block = (output, context) => {
|
|
|
996
759
|
};
|
|
997
760
|
};
|
|
998
761
|
const deserializeAws_restJson1Blocks = (output, context) => {
|
|
999
|
-
|
|
762
|
+
const retVal = (output || [])
|
|
1000
763
|
.filter((e) => e != null)
|
|
1001
764
|
.map((entry) => {
|
|
1002
765
|
if (entry === null) {
|
|
@@ -1004,6 +767,7 @@ const deserializeAws_restJson1Blocks = (output, context) => {
|
|
|
1004
767
|
}
|
|
1005
768
|
return deserializeAws_restJson1Block(entry, context);
|
|
1006
769
|
});
|
|
770
|
+
return retVal;
|
|
1007
771
|
};
|
|
1008
772
|
const deserializeAws_restJson1ChangedBlock = (output, context) => {
|
|
1009
773
|
return {
|
|
@@ -1013,7 +777,7 @@ const deserializeAws_restJson1ChangedBlock = (output, context) => {
|
|
|
1013
777
|
};
|
|
1014
778
|
};
|
|
1015
779
|
const deserializeAws_restJson1ChangedBlocks = (output, context) => {
|
|
1016
|
-
|
|
780
|
+
const retVal = (output || [])
|
|
1017
781
|
.filter((e) => e != null)
|
|
1018
782
|
.map((entry) => {
|
|
1019
783
|
if (entry === null) {
|
|
@@ -1021,6 +785,7 @@ const deserializeAws_restJson1ChangedBlocks = (output, context) => {
|
|
|
1021
785
|
}
|
|
1022
786
|
return deserializeAws_restJson1ChangedBlock(entry, context);
|
|
1023
787
|
});
|
|
788
|
+
return retVal;
|
|
1024
789
|
};
|
|
1025
790
|
const deserializeAws_restJson1Tag = (output, context) => {
|
|
1026
791
|
return {
|
|
@@ -1029,7 +794,7 @@ const deserializeAws_restJson1Tag = (output, context) => {
|
|
|
1029
794
|
};
|
|
1030
795
|
};
|
|
1031
796
|
const deserializeAws_restJson1Tags = (output, context) => {
|
|
1032
|
-
|
|
797
|
+
const retVal = (output || [])
|
|
1033
798
|
.filter((e) => e != null)
|
|
1034
799
|
.map((entry) => {
|
|
1035
800
|
if (entry === null) {
|
|
@@ -1037,6 +802,7 @@ const deserializeAws_restJson1Tags = (output, context) => {
|
|
|
1037
802
|
}
|
|
1038
803
|
return deserializeAws_restJson1Tag(entry, context);
|
|
1039
804
|
});
|
|
805
|
+
return retVal;
|
|
1040
806
|
};
|
|
1041
807
|
const deserializeMetadata = (output) => {
|
|
1042
808
|
var _a;
|