@aws-sdk/client-rds-data 3.50.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.
Files changed (32) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist-cjs/index.js +3 -0
  3. package/dist-cjs/models/RDSDataServiceException.js +11 -0
  4. package/dist-cjs/models/models_0.js +81 -1
  5. package/dist-cjs/protocols/Aws_restJson1.js +118 -300
  6. package/dist-es/index.js +1 -0
  7. package/dist-es/models/RDSDataServiceException.js +12 -0
  8. package/dist-es/models/models_0.js +75 -1
  9. package/dist-es/protocols/Aws_restJson1.js +187 -332
  10. package/dist-types/index.d.ts +1 -0
  11. package/dist-types/models/RDSDataServiceException.d.ts +10 -0
  12. package/dist-types/models/models_0.d.ts +38 -29
  13. package/dist-types/ts3.4/RDSData.d.ts +35 -0
  14. package/dist-types/ts3.4/RDSDataClient.d.ts +79 -0
  15. package/dist-types/ts3.4/commands/BatchExecuteStatementCommand.d.ts +17 -0
  16. package/dist-types/ts3.4/commands/BeginTransactionCommand.d.ts +17 -0
  17. package/dist-types/ts3.4/commands/CommitTransactionCommand.d.ts +17 -0
  18. package/dist-types/ts3.4/commands/ExecuteSqlCommand.d.ts +17 -0
  19. package/dist-types/ts3.4/commands/ExecuteStatementCommand.d.ts +17 -0
  20. package/dist-types/ts3.4/commands/RollbackTransactionCommand.d.ts +17 -0
  21. package/dist-types/ts3.4/commands/index.d.ts +6 -0
  22. package/dist-types/ts3.4/endpoints.d.ts +2 -0
  23. package/dist-types/ts3.4/index.d.ts +5 -0
  24. package/dist-types/ts3.4/models/RDSDataServiceException.d.ts +6 -0
  25. package/dist-types/ts3.4/models/index.d.ts +1 -0
  26. package/dist-types/ts3.4/models/models_0.d.ts +695 -0
  27. package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +20 -0
  28. package/dist-types/ts3.4/runtimeConfig.browser.d.ts +38 -0
  29. package/dist-types/ts3.4/runtimeConfig.d.ts +38 -0
  30. package/dist-types/ts3.4/runtimeConfig.native.d.ts +37 -0
  31. package/dist-types/ts3.4/runtimeConfig.shared.d.ts +11 -0
  32. package/package.json +33 -33
@@ -4,6 +4,7 @@ exports.deserializeAws_restJson1RollbackTransactionCommand = exports.deserialize
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 models_0_1 = require("../models/models_0");
7
+ const RDSDataServiceException_1 = require("../models/RDSDataServiceException");
7
8
  const serializeAws_restJson1BatchExecuteStatementCommand = async (input, context) => {
8
9
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
9
10
  const headers = {
@@ -193,59 +194,28 @@ const deserializeAws_restJson1BatchExecuteStatementCommandError = async (output,
193
194
  switch (errorCode) {
194
195
  case "BadRequestException":
195
196
  case "com.amazonaws.rdsdata#BadRequestException":
196
- response = {
197
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
198
- name: errorCode,
199
- $metadata: deserializeMetadata(output),
200
- };
201
- break;
197
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
202
198
  case "ForbiddenException":
203
199
  case "com.amazonaws.rdsdata#ForbiddenException":
204
- response = {
205
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
206
- name: errorCode,
207
- $metadata: deserializeMetadata(output),
208
- };
209
- break;
200
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
210
201
  case "InternalServerErrorException":
211
202
  case "com.amazonaws.rdsdata#InternalServerErrorException":
212
- response = {
213
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
214
- name: errorCode,
215
- $metadata: deserializeMetadata(output),
216
- };
217
- break;
203
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
218
204
  case "ServiceUnavailableError":
219
205
  case "com.amazonaws.rdsdata#ServiceUnavailableError":
220
- response = {
221
- ...(await deserializeAws_restJson1ServiceUnavailableErrorResponse(parsedOutput, context)),
222
- name: errorCode,
223
- $metadata: deserializeMetadata(output),
224
- };
225
- break;
206
+ throw await deserializeAws_restJson1ServiceUnavailableErrorResponse(parsedOutput, context);
226
207
  case "StatementTimeoutException":
227
208
  case "com.amazonaws.rdsdata#StatementTimeoutException":
228
- response = {
229
- ...(await deserializeAws_restJson1StatementTimeoutExceptionResponse(parsedOutput, context)),
230
- name: errorCode,
231
- $metadata: deserializeMetadata(output),
232
- };
233
- break;
209
+ throw await deserializeAws_restJson1StatementTimeoutExceptionResponse(parsedOutput, context);
234
210
  default:
235
211
  const parsedBody = parsedOutput.body;
236
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
237
- response = {
238
- ...parsedBody,
239
- name: `${errorCode}`,
240
- message: parsedBody.message || parsedBody.Message || errorCode,
212
+ response = new RDSDataServiceException_1.RDSDataServiceException({
213
+ name: parsedBody.code || parsedBody.Code || errorCode,
241
214
  $fault: "client",
242
215
  $metadata: deserializeMetadata(output),
243
- };
216
+ });
217
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
244
218
  }
245
- const message = response.message || response.Message || errorCode;
246
- response.message = message;
247
- delete response.Message;
248
- return Promise.reject(Object.assign(new Error(message), response));
249
219
  };
250
220
  const deserializeAws_restJson1BeginTransactionCommand = async (output, context) => {
251
221
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -273,59 +243,28 @@ const deserializeAws_restJson1BeginTransactionCommandError = async (output, cont
273
243
  switch (errorCode) {
274
244
  case "BadRequestException":
275
245
  case "com.amazonaws.rdsdata#BadRequestException":
276
- response = {
277
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
278
- name: errorCode,
279
- $metadata: deserializeMetadata(output),
280
- };
281
- break;
246
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
282
247
  case "ForbiddenException":
283
248
  case "com.amazonaws.rdsdata#ForbiddenException":
284
- response = {
285
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
286
- name: errorCode,
287
- $metadata: deserializeMetadata(output),
288
- };
289
- break;
249
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
290
250
  case "InternalServerErrorException":
291
251
  case "com.amazonaws.rdsdata#InternalServerErrorException":
292
- response = {
293
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
294
- name: errorCode,
295
- $metadata: deserializeMetadata(output),
296
- };
297
- break;
252
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
298
253
  case "ServiceUnavailableError":
299
254
  case "com.amazonaws.rdsdata#ServiceUnavailableError":
300
- response = {
301
- ...(await deserializeAws_restJson1ServiceUnavailableErrorResponse(parsedOutput, context)),
302
- name: errorCode,
303
- $metadata: deserializeMetadata(output),
304
- };
305
- break;
255
+ throw await deserializeAws_restJson1ServiceUnavailableErrorResponse(parsedOutput, context);
306
256
  case "StatementTimeoutException":
307
257
  case "com.amazonaws.rdsdata#StatementTimeoutException":
308
- response = {
309
- ...(await deserializeAws_restJson1StatementTimeoutExceptionResponse(parsedOutput, context)),
310
- name: errorCode,
311
- $metadata: deserializeMetadata(output),
312
- };
313
- break;
258
+ throw await deserializeAws_restJson1StatementTimeoutExceptionResponse(parsedOutput, context);
314
259
  default:
315
260
  const parsedBody = parsedOutput.body;
316
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
317
- response = {
318
- ...parsedBody,
319
- name: `${errorCode}`,
320
- message: parsedBody.message || parsedBody.Message || errorCode,
261
+ response = new RDSDataServiceException_1.RDSDataServiceException({
262
+ name: parsedBody.code || parsedBody.Code || errorCode,
321
263
  $fault: "client",
322
264
  $metadata: deserializeMetadata(output),
323
- };
265
+ });
266
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
324
267
  }
325
- const message = response.message || response.Message || errorCode;
326
- response.message = message;
327
- delete response.Message;
328
- return Promise.reject(Object.assign(new Error(message), response));
329
268
  };
330
269
  const deserializeAws_restJson1CommitTransactionCommand = async (output, context) => {
331
270
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -353,67 +292,31 @@ const deserializeAws_restJson1CommitTransactionCommandError = async (output, con
353
292
  switch (errorCode) {
354
293
  case "BadRequestException":
355
294
  case "com.amazonaws.rdsdata#BadRequestException":
356
- response = {
357
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
358
- name: errorCode,
359
- $metadata: deserializeMetadata(output),
360
- };
361
- break;
295
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
362
296
  case "ForbiddenException":
363
297
  case "com.amazonaws.rdsdata#ForbiddenException":
364
- response = {
365
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
366
- name: errorCode,
367
- $metadata: deserializeMetadata(output),
368
- };
369
- break;
298
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
370
299
  case "InternalServerErrorException":
371
300
  case "com.amazonaws.rdsdata#InternalServerErrorException":
372
- response = {
373
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
374
- name: errorCode,
375
- $metadata: deserializeMetadata(output),
376
- };
377
- break;
301
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
378
302
  case "NotFoundException":
379
303
  case "com.amazonaws.rdsdata#NotFoundException":
380
- response = {
381
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
382
- name: errorCode,
383
- $metadata: deserializeMetadata(output),
384
- };
385
- break;
304
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
386
305
  case "ServiceUnavailableError":
387
306
  case "com.amazonaws.rdsdata#ServiceUnavailableError":
388
- response = {
389
- ...(await deserializeAws_restJson1ServiceUnavailableErrorResponse(parsedOutput, context)),
390
- name: errorCode,
391
- $metadata: deserializeMetadata(output),
392
- };
393
- break;
307
+ throw await deserializeAws_restJson1ServiceUnavailableErrorResponse(parsedOutput, context);
394
308
  case "StatementTimeoutException":
395
309
  case "com.amazonaws.rdsdata#StatementTimeoutException":
396
- response = {
397
- ...(await deserializeAws_restJson1StatementTimeoutExceptionResponse(parsedOutput, context)),
398
- name: errorCode,
399
- $metadata: deserializeMetadata(output),
400
- };
401
- break;
310
+ throw await deserializeAws_restJson1StatementTimeoutExceptionResponse(parsedOutput, context);
402
311
  default:
403
312
  const parsedBody = parsedOutput.body;
404
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
405
- response = {
406
- ...parsedBody,
407
- name: `${errorCode}`,
408
- message: parsedBody.message || parsedBody.Message || errorCode,
313
+ response = new RDSDataServiceException_1.RDSDataServiceException({
314
+ name: parsedBody.code || parsedBody.Code || errorCode,
409
315
  $fault: "client",
410
316
  $metadata: deserializeMetadata(output),
411
- };
317
+ });
318
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
412
319
  }
413
- const message = response.message || response.Message || errorCode;
414
- response.message = message;
415
- delete response.Message;
416
- return Promise.reject(Object.assign(new Error(message), response));
417
320
  };
418
321
  const deserializeAws_restJson1ExecuteSqlCommand = async (output, context) => {
419
322
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -441,51 +344,25 @@ const deserializeAws_restJson1ExecuteSqlCommandError = async (output, context) =
441
344
  switch (errorCode) {
442
345
  case "BadRequestException":
443
346
  case "com.amazonaws.rdsdata#BadRequestException":
444
- response = {
445
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
446
- name: errorCode,
447
- $metadata: deserializeMetadata(output),
448
- };
449
- break;
347
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
450
348
  case "ForbiddenException":
451
349
  case "com.amazonaws.rdsdata#ForbiddenException":
452
- response = {
453
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
454
- name: errorCode,
455
- $metadata: deserializeMetadata(output),
456
- };
457
- break;
350
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
458
351
  case "InternalServerErrorException":
459
352
  case "com.amazonaws.rdsdata#InternalServerErrorException":
460
- response = {
461
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
462
- name: errorCode,
463
- $metadata: deserializeMetadata(output),
464
- };
465
- break;
353
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
466
354
  case "ServiceUnavailableError":
467
355
  case "com.amazonaws.rdsdata#ServiceUnavailableError":
468
- response = {
469
- ...(await deserializeAws_restJson1ServiceUnavailableErrorResponse(parsedOutput, context)),
470
- name: errorCode,
471
- $metadata: deserializeMetadata(output),
472
- };
473
- break;
356
+ throw await deserializeAws_restJson1ServiceUnavailableErrorResponse(parsedOutput, context);
474
357
  default:
475
358
  const parsedBody = parsedOutput.body;
476
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
477
- response = {
478
- ...parsedBody,
479
- name: `${errorCode}`,
480
- message: parsedBody.message || parsedBody.Message || errorCode,
359
+ response = new RDSDataServiceException_1.RDSDataServiceException({
360
+ name: parsedBody.code || parsedBody.Code || errorCode,
481
361
  $fault: "client",
482
362
  $metadata: deserializeMetadata(output),
483
- };
363
+ });
364
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
484
365
  }
485
- const message = response.message || response.Message || errorCode;
486
- response.message = message;
487
- delete response.Message;
488
- return Promise.reject(Object.assign(new Error(message), response));
489
366
  };
490
367
  const deserializeAws_restJson1ExecuteStatementCommand = async (output, context) => {
491
368
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -525,59 +402,28 @@ const deserializeAws_restJson1ExecuteStatementCommandError = async (output, cont
525
402
  switch (errorCode) {
526
403
  case "BadRequestException":
527
404
  case "com.amazonaws.rdsdata#BadRequestException":
528
- response = {
529
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
530
- name: errorCode,
531
- $metadata: deserializeMetadata(output),
532
- };
533
- break;
405
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
534
406
  case "ForbiddenException":
535
407
  case "com.amazonaws.rdsdata#ForbiddenException":
536
- response = {
537
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
538
- name: errorCode,
539
- $metadata: deserializeMetadata(output),
540
- };
541
- break;
408
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
542
409
  case "InternalServerErrorException":
543
410
  case "com.amazonaws.rdsdata#InternalServerErrorException":
544
- response = {
545
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
546
- name: errorCode,
547
- $metadata: deserializeMetadata(output),
548
- };
549
- break;
411
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
550
412
  case "ServiceUnavailableError":
551
413
  case "com.amazonaws.rdsdata#ServiceUnavailableError":
552
- response = {
553
- ...(await deserializeAws_restJson1ServiceUnavailableErrorResponse(parsedOutput, context)),
554
- name: errorCode,
555
- $metadata: deserializeMetadata(output),
556
- };
557
- break;
414
+ throw await deserializeAws_restJson1ServiceUnavailableErrorResponse(parsedOutput, context);
558
415
  case "StatementTimeoutException":
559
416
  case "com.amazonaws.rdsdata#StatementTimeoutException":
560
- response = {
561
- ...(await deserializeAws_restJson1StatementTimeoutExceptionResponse(parsedOutput, context)),
562
- name: errorCode,
563
- $metadata: deserializeMetadata(output),
564
- };
565
- break;
417
+ throw await deserializeAws_restJson1StatementTimeoutExceptionResponse(parsedOutput, context);
566
418
  default:
567
419
  const parsedBody = parsedOutput.body;
568
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
569
- response = {
570
- ...parsedBody,
571
- name: `${errorCode}`,
572
- message: parsedBody.message || parsedBody.Message || errorCode,
420
+ response = new RDSDataServiceException_1.RDSDataServiceException({
421
+ name: parsedBody.code || parsedBody.Code || errorCode,
573
422
  $fault: "client",
574
423
  $metadata: deserializeMetadata(output),
575
- };
424
+ });
425
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
576
426
  }
577
- const message = response.message || response.Message || errorCode;
578
- response.message = message;
579
- delete response.Message;
580
- return Promise.reject(Object.assign(new Error(message), response));
581
427
  };
582
428
  const deserializeAws_restJson1RollbackTransactionCommand = async (output, context) => {
583
429
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -605,133 +451,88 @@ const deserializeAws_restJson1RollbackTransactionCommandError = async (output, c
605
451
  switch (errorCode) {
606
452
  case "BadRequestException":
607
453
  case "com.amazonaws.rdsdata#BadRequestException":
608
- response = {
609
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
610
- name: errorCode,
611
- $metadata: deserializeMetadata(output),
612
- };
613
- break;
454
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
614
455
  case "ForbiddenException":
615
456
  case "com.amazonaws.rdsdata#ForbiddenException":
616
- response = {
617
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
618
- name: errorCode,
619
- $metadata: deserializeMetadata(output),
620
- };
621
- break;
457
+ throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
622
458
  case "InternalServerErrorException":
623
459
  case "com.amazonaws.rdsdata#InternalServerErrorException":
624
- response = {
625
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
626
- name: errorCode,
627
- $metadata: deserializeMetadata(output),
628
- };
629
- break;
460
+ throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
630
461
  case "NotFoundException":
631
462
  case "com.amazonaws.rdsdata#NotFoundException":
632
- response = {
633
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
634
- name: errorCode,
635
- $metadata: deserializeMetadata(output),
636
- };
637
- break;
463
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
638
464
  case "ServiceUnavailableError":
639
465
  case "com.amazonaws.rdsdata#ServiceUnavailableError":
640
- response = {
641
- ...(await deserializeAws_restJson1ServiceUnavailableErrorResponse(parsedOutput, context)),
642
- name: errorCode,
643
- $metadata: deserializeMetadata(output),
644
- };
645
- break;
466
+ throw await deserializeAws_restJson1ServiceUnavailableErrorResponse(parsedOutput, context);
646
467
  case "StatementTimeoutException":
647
468
  case "com.amazonaws.rdsdata#StatementTimeoutException":
648
- response = {
649
- ...(await deserializeAws_restJson1StatementTimeoutExceptionResponse(parsedOutput, context)),
650
- name: errorCode,
651
- $metadata: deserializeMetadata(output),
652
- };
653
- break;
469
+ throw await deserializeAws_restJson1StatementTimeoutExceptionResponse(parsedOutput, context);
654
470
  default:
655
471
  const parsedBody = parsedOutput.body;
656
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
657
- response = {
658
- ...parsedBody,
659
- name: `${errorCode}`,
660
- message: parsedBody.message || parsedBody.Message || errorCode,
472
+ response = new RDSDataServiceException_1.RDSDataServiceException({
473
+ name: parsedBody.code || parsedBody.Code || errorCode,
661
474
  $fault: "client",
662
475
  $metadata: deserializeMetadata(output),
663
- };
476
+ });
477
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
664
478
  }
665
- const message = response.message || response.Message || errorCode;
666
- response.message = message;
667
- delete response.Message;
668
- return Promise.reject(Object.assign(new Error(message), response));
669
479
  };
670
480
  const deserializeAws_restJson1BadRequestExceptionResponse = async (parsedOutput, context) => {
671
- const contents = {
672
- name: "BadRequestException",
673
- $fault: "client",
674
- $metadata: deserializeMetadata(parsedOutput),
675
- message: undefined,
676
- };
481
+ const contents = {};
677
482
  const data = parsedOutput.body;
678
483
  if (data.message !== undefined && data.message !== null) {
679
484
  contents.message = smithy_client_1.expectString(data.message);
680
485
  }
681
- return contents;
486
+ const exception = new models_0_1.BadRequestException({
487
+ $metadata: deserializeMetadata(parsedOutput),
488
+ ...contents,
489
+ });
490
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
682
491
  };
683
492
  const deserializeAws_restJson1ForbiddenExceptionResponse = async (parsedOutput, context) => {
684
- const contents = {
685
- name: "ForbiddenException",
686
- $fault: "client",
687
- $metadata: deserializeMetadata(parsedOutput),
688
- message: undefined,
689
- };
493
+ const contents = {};
690
494
  const data = parsedOutput.body;
691
495
  if (data.message !== undefined && data.message !== null) {
692
496
  contents.message = smithy_client_1.expectString(data.message);
693
497
  }
694
- return contents;
498
+ const exception = new models_0_1.ForbiddenException({
499
+ $metadata: deserializeMetadata(parsedOutput),
500
+ ...contents,
501
+ });
502
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
695
503
  };
696
504
  const deserializeAws_restJson1InternalServerErrorExceptionResponse = async (parsedOutput, context) => {
697
- const contents = {
698
- name: "InternalServerErrorException",
699
- $fault: "server",
700
- $metadata: deserializeMetadata(parsedOutput),
701
- };
505
+ const contents = {};
702
506
  const data = parsedOutput.body;
703
- return contents;
507
+ const exception = new models_0_1.InternalServerErrorException({
508
+ $metadata: deserializeMetadata(parsedOutput),
509
+ ...contents,
510
+ });
511
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
704
512
  };
705
513
  const deserializeAws_restJson1NotFoundExceptionResponse = async (parsedOutput, context) => {
706
- const contents = {
707
- name: "NotFoundException",
708
- $fault: "client",
709
- $metadata: deserializeMetadata(parsedOutput),
710
- message: undefined,
711
- };
514
+ const contents = {};
712
515
  const data = parsedOutput.body;
713
516
  if (data.message !== undefined && data.message !== null) {
714
517
  contents.message = smithy_client_1.expectString(data.message);
715
518
  }
716
- return contents;
519
+ const exception = new models_0_1.NotFoundException({
520
+ $metadata: deserializeMetadata(parsedOutput),
521
+ ...contents,
522
+ });
523
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
717
524
  };
718
525
  const deserializeAws_restJson1ServiceUnavailableErrorResponse = async (parsedOutput, context) => {
719
- const contents = {
720
- name: "ServiceUnavailableError",
721
- $fault: "server",
722
- $metadata: deserializeMetadata(parsedOutput),
723
- };
526
+ const contents = {};
724
527
  const data = parsedOutput.body;
725
- return contents;
528
+ const exception = new models_0_1.ServiceUnavailableError({
529
+ $metadata: deserializeMetadata(parsedOutput),
530
+ ...contents,
531
+ });
532
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
726
533
  };
727
534
  const deserializeAws_restJson1StatementTimeoutExceptionResponse = async (parsedOutput, context) => {
728
- const contents = {
729
- name: "StatementTimeoutException",
730
- $fault: "client",
731
- $metadata: deserializeMetadata(parsedOutput),
732
- dbConnectionId: undefined,
733
- message: undefined,
734
- };
535
+ const contents = {};
735
536
  const data = parsedOutput.body;
736
537
  if (data.dbConnectionId !== undefined && data.dbConnectionId !== null) {
737
538
  contents.dbConnectionId = smithy_client_1.expectLong(data.dbConnectionId);
@@ -739,7 +540,11 @@ const deserializeAws_restJson1StatementTimeoutExceptionResponse = async (parsedO
739
540
  if (data.message !== undefined && data.message !== null) {
740
541
  contents.message = smithy_client_1.expectString(data.message);
741
542
  }
742
- return contents;
543
+ const exception = new models_0_1.StatementTimeoutException({
544
+ $metadata: deserializeMetadata(parsedOutput),
545
+ ...contents,
546
+ });
547
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
743
548
  };
744
549
  const serializeAws_restJson1ArrayOfArray = (input, context) => {
745
550
  return input
@@ -848,7 +653,7 @@ const serializeAws_restJson1StringArray = (input, context) => {
848
653
  });
849
654
  };
850
655
  const deserializeAws_restJson1ArrayOfArray = (output, context) => {
851
- return (output || [])
656
+ const retVal = (output || [])
852
657
  .filter((e) => e != null)
853
658
  .map((entry) => {
854
659
  if (entry === null) {
@@ -856,6 +661,7 @@ const deserializeAws_restJson1ArrayOfArray = (output, context) => {
856
661
  }
857
662
  return deserializeAws_restJson1ArrayValue(smithy_client_1.expectUnion(entry), context);
858
663
  });
664
+ return retVal;
859
665
  };
860
666
  const deserializeAws_restJson1ArrayValue = (output, context) => {
861
667
  if (output.arrayValues !== undefined && output.arrayValues !== null) {
@@ -886,7 +692,7 @@ const deserializeAws_restJson1ArrayValue = (output, context) => {
886
692
  return { $unknown: Object.entries(output)[0] };
887
693
  };
888
694
  const deserializeAws_restJson1ArrayValueList = (output, context) => {
889
- return (output || [])
695
+ const retVal = (output || [])
890
696
  .filter((e) => e != null)
891
697
  .map((entry) => {
892
698
  if (entry === null) {
@@ -894,9 +700,10 @@ const deserializeAws_restJson1ArrayValueList = (output, context) => {
894
700
  }
895
701
  return deserializeAws_restJson1Value(smithy_client_1.expectUnion(entry), context);
896
702
  });
703
+ return retVal;
897
704
  };
898
705
  const deserializeAws_restJson1BooleanArray = (output, context) => {
899
- return (output || [])
706
+ const retVal = (output || [])
900
707
  .filter((e) => e != null)
901
708
  .map((entry) => {
902
709
  if (entry === null) {
@@ -904,6 +711,7 @@ const deserializeAws_restJson1BooleanArray = (output, context) => {
904
711
  }
905
712
  return smithy_client_1.expectBoolean(entry);
906
713
  });
714
+ return retVal;
907
715
  };
908
716
  const deserializeAws_restJson1ColumnMetadata = (output, context) => {
909
717
  return {
@@ -924,7 +732,7 @@ const deserializeAws_restJson1ColumnMetadata = (output, context) => {
924
732
  };
925
733
  };
926
734
  const deserializeAws_restJson1DoubleArray = (output, context) => {
927
- return (output || [])
735
+ const retVal = (output || [])
928
736
  .filter((e) => e != null)
929
737
  .map((entry) => {
930
738
  if (entry === null) {
@@ -932,6 +740,7 @@ const deserializeAws_restJson1DoubleArray = (output, context) => {
932
740
  }
933
741
  return smithy_client_1.limitedParseDouble(entry);
934
742
  });
743
+ return retVal;
935
744
  };
936
745
  const deserializeAws_restJson1Field = (output, context) => {
937
746
  if (output.arrayValue !== undefined && output.arrayValue !== null) {
@@ -962,7 +771,7 @@ const deserializeAws_restJson1Field = (output, context) => {
962
771
  return { $unknown: Object.entries(output)[0] };
963
772
  };
964
773
  const deserializeAws_restJson1FieldList = (output, context) => {
965
- return (output || [])
774
+ const retVal = (output || [])
966
775
  .filter((e) => e != null)
967
776
  .map((entry) => {
968
777
  if (entry === null) {
@@ -970,9 +779,10 @@ const deserializeAws_restJson1FieldList = (output, context) => {
970
779
  }
971
780
  return deserializeAws_restJson1Field(smithy_client_1.expectUnion(entry), context);
972
781
  });
782
+ return retVal;
973
783
  };
974
784
  const deserializeAws_restJson1LongArray = (output, context) => {
975
- return (output || [])
785
+ const retVal = (output || [])
976
786
  .filter((e) => e != null)
977
787
  .map((entry) => {
978
788
  if (entry === null) {
@@ -980,9 +790,10 @@ const deserializeAws_restJson1LongArray = (output, context) => {
980
790
  }
981
791
  return smithy_client_1.expectLong(entry);
982
792
  });
793
+ return retVal;
983
794
  };
984
795
  const deserializeAws_restJson1Metadata = (output, context) => {
985
- return (output || [])
796
+ const retVal = (output || [])
986
797
  .filter((e) => e != null)
987
798
  .map((entry) => {
988
799
  if (entry === null) {
@@ -990,6 +801,7 @@ const deserializeAws_restJson1Metadata = (output, context) => {
990
801
  }
991
802
  return deserializeAws_restJson1ColumnMetadata(entry, context);
992
803
  });
804
+ return retVal;
993
805
  };
994
806
  const deserializeAws_restJson1_Record = (output, context) => {
995
807
  return {
@@ -999,7 +811,7 @@ const deserializeAws_restJson1_Record = (output, context) => {
999
811
  };
1000
812
  };
1001
813
  const deserializeAws_restJson1Records = (output, context) => {
1002
- return (output || [])
814
+ const retVal = (output || [])
1003
815
  .filter((e) => e != null)
1004
816
  .map((entry) => {
1005
817
  if (entry === null) {
@@ -1007,6 +819,7 @@ const deserializeAws_restJson1Records = (output, context) => {
1007
819
  }
1008
820
  return deserializeAws_restJson1_Record(entry, context);
1009
821
  });
822
+ return retVal;
1010
823
  };
1011
824
  const deserializeAws_restJson1ResultFrame = (output, context) => {
1012
825
  return {
@@ -1027,7 +840,7 @@ const deserializeAws_restJson1ResultSetMetadata = (output, context) => {
1027
840
  };
1028
841
  };
1029
842
  const deserializeAws_restJson1Row = (output, context) => {
1030
- return (output || [])
843
+ const retVal = (output || [])
1031
844
  .filter((e) => e != null)
1032
845
  .map((entry) => {
1033
846
  if (entry === null) {
@@ -1035,9 +848,10 @@ const deserializeAws_restJson1Row = (output, context) => {
1035
848
  }
1036
849
  return deserializeAws_restJson1Value(smithy_client_1.expectUnion(entry), context);
1037
850
  });
851
+ return retVal;
1038
852
  };
1039
853
  const deserializeAws_restJson1SqlRecords = (output, context) => {
1040
- return (output || [])
854
+ const retVal = (output || [])
1041
855
  .filter((e) => e != null)
1042
856
  .map((entry) => {
1043
857
  if (entry === null) {
@@ -1045,6 +859,7 @@ const deserializeAws_restJson1SqlRecords = (output, context) => {
1045
859
  }
1046
860
  return deserializeAws_restJson1FieldList(entry, context);
1047
861
  });
862
+ return retVal;
1048
863
  };
1049
864
  const deserializeAws_restJson1SqlStatementResult = (output, context) => {
1050
865
  return {
@@ -1055,7 +870,7 @@ const deserializeAws_restJson1SqlStatementResult = (output, context) => {
1055
870
  };
1056
871
  };
1057
872
  const deserializeAws_restJson1SqlStatementResults = (output, context) => {
1058
- return (output || [])
873
+ const retVal = (output || [])
1059
874
  .filter((e) => e != null)
1060
875
  .map((entry) => {
1061
876
  if (entry === null) {
@@ -1063,9 +878,10 @@ const deserializeAws_restJson1SqlStatementResults = (output, context) => {
1063
878
  }
1064
879
  return deserializeAws_restJson1SqlStatementResult(entry, context);
1065
880
  });
881
+ return retVal;
1066
882
  };
1067
883
  const deserializeAws_restJson1StringArray = (output, context) => {
1068
- return (output || [])
884
+ const retVal = (output || [])
1069
885
  .filter((e) => e != null)
1070
886
  .map((entry) => {
1071
887
  if (entry === null) {
@@ -1073,6 +889,7 @@ const deserializeAws_restJson1StringArray = (output, context) => {
1073
889
  }
1074
890
  return smithy_client_1.expectString(entry);
1075
891
  });
892
+ return retVal;
1076
893
  };
1077
894
  const deserializeAws_restJson1StructValue = (output, context) => {
1078
895
  return {
@@ -1089,7 +906,7 @@ const deserializeAws_restJson1UpdateResult = (output, context) => {
1089
906
  };
1090
907
  };
1091
908
  const deserializeAws_restJson1UpdateResults = (output, context) => {
1092
- return (output || [])
909
+ const retVal = (output || [])
1093
910
  .filter((e) => e != null)
1094
911
  .map((entry) => {
1095
912
  if (entry === null) {
@@ -1097,6 +914,7 @@ const deserializeAws_restJson1UpdateResults = (output, context) => {
1097
914
  }
1098
915
  return deserializeAws_restJson1UpdateResult(entry, context);
1099
916
  });
917
+ return retVal;
1100
918
  };
1101
919
  const deserializeAws_restJson1Value = (output, context) => {
1102
920
  if (output.arrayValues !== undefined && output.arrayValues !== null) {