@aws-sdk/client-timestream-write 3.52.0 → 3.53.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,6 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.deserializeAws_json1_0WriteRecordsCommand = exports.deserializeAws_json1_0UpdateTableCommand = exports.deserializeAws_json1_0UpdateDatabaseCommand = exports.deserializeAws_json1_0UntagResourceCommand = exports.deserializeAws_json1_0TagResourceCommand = exports.deserializeAws_json1_0ListTagsForResourceCommand = exports.deserializeAws_json1_0ListTablesCommand = exports.deserializeAws_json1_0ListDatabasesCommand = exports.deserializeAws_json1_0DescribeTableCommand = exports.deserializeAws_json1_0DescribeEndpointsCommand = exports.deserializeAws_json1_0DescribeDatabaseCommand = exports.deserializeAws_json1_0DeleteTableCommand = exports.deserializeAws_json1_0DeleteDatabaseCommand = exports.deserializeAws_json1_0CreateTableCommand = exports.deserializeAws_json1_0CreateDatabaseCommand = exports.serializeAws_json1_0WriteRecordsCommand = exports.serializeAws_json1_0UpdateTableCommand = exports.serializeAws_json1_0UpdateDatabaseCommand = exports.serializeAws_json1_0UntagResourceCommand = exports.serializeAws_json1_0TagResourceCommand = exports.serializeAws_json1_0ListTagsForResourceCommand = exports.serializeAws_json1_0ListTablesCommand = exports.serializeAws_json1_0ListDatabasesCommand = exports.serializeAws_json1_0DescribeTableCommand = exports.serializeAws_json1_0DescribeEndpointsCommand = exports.serializeAws_json1_0DescribeDatabaseCommand = exports.serializeAws_json1_0DeleteTableCommand = exports.serializeAws_json1_0DeleteDatabaseCommand = exports.serializeAws_json1_0CreateTableCommand = exports.serializeAws_json1_0CreateDatabaseCommand = void 0;
4
4
  const protocol_http_1 = require("@aws-sdk/protocol-http");
5
5
  const smithy_client_1 = require("@aws-sdk/smithy-client");
6
+ const models_0_1 = require("../models/models_0");
7
+ const TimestreamWriteServiceException_1 = require("../models/TimestreamWriteServiceException");
6
8
  const serializeAws_json1_0CreateDatabaseCommand = async (input, context) => {
7
9
  const headers = {
8
10
  "content-type": "application/x-amz-json-1.0",
@@ -178,75 +180,34 @@ const deserializeAws_json1_0CreateDatabaseCommandError = async (output, context)
178
180
  switch (errorCode) {
179
181
  case "AccessDeniedException":
180
182
  case "com.amazonaws.timestreamwrite#AccessDeniedException":
181
- response = {
182
- ...(await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context)),
183
- name: errorCode,
184
- $metadata: deserializeMetadata(output),
185
- };
186
- break;
183
+ throw await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context);
187
184
  case "ConflictException":
188
185
  case "com.amazonaws.timestreamwrite#ConflictException":
189
- response = {
190
- ...(await deserializeAws_json1_0ConflictExceptionResponse(parsedOutput, context)),
191
- name: errorCode,
192
- $metadata: deserializeMetadata(output),
193
- };
194
- break;
186
+ throw await deserializeAws_json1_0ConflictExceptionResponse(parsedOutput, context);
195
187
  case "InternalServerException":
196
188
  case "com.amazonaws.timestreamwrite#InternalServerException":
197
- response = {
198
- ...(await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context)),
199
- name: errorCode,
200
- $metadata: deserializeMetadata(output),
201
- };
202
- break;
189
+ throw await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context);
203
190
  case "InvalidEndpointException":
204
191
  case "com.amazonaws.timestreamwrite#InvalidEndpointException":
205
- response = {
206
- ...(await deserializeAws_json1_0InvalidEndpointExceptionResponse(parsedOutput, context)),
207
- name: errorCode,
208
- $metadata: deserializeMetadata(output),
209
- };
210
- break;
192
+ throw await deserializeAws_json1_0InvalidEndpointExceptionResponse(parsedOutput, context);
211
193
  case "ServiceQuotaExceededException":
212
194
  case "com.amazonaws.timestreamwrite#ServiceQuotaExceededException":
213
- response = {
214
- ...(await deserializeAws_json1_0ServiceQuotaExceededExceptionResponse(parsedOutput, context)),
215
- name: errorCode,
216
- $metadata: deserializeMetadata(output),
217
- };
218
- break;
195
+ throw await deserializeAws_json1_0ServiceQuotaExceededExceptionResponse(parsedOutput, context);
219
196
  case "ThrottlingException":
220
197
  case "com.amazonaws.timestreamwrite#ThrottlingException":
221
- response = {
222
- ...(await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context)),
223
- name: errorCode,
224
- $metadata: deserializeMetadata(output),
225
- };
226
- break;
198
+ throw await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context);
227
199
  case "ValidationException":
228
200
  case "com.amazonaws.timestreamwrite#ValidationException":
229
- response = {
230
- ...(await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context)),
231
- name: errorCode,
232
- $metadata: deserializeMetadata(output),
233
- };
234
- break;
201
+ throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
235
202
  default:
236
203
  const parsedBody = parsedOutput.body;
237
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
238
- response = {
239
- ...parsedBody,
240
- name: `${errorCode}`,
241
- message: parsedBody.message || parsedBody.Message || errorCode,
204
+ response = new TimestreamWriteServiceException_1.TimestreamWriteServiceException({
205
+ name: parsedBody.code || parsedBody.Code || errorCode,
242
206
  $fault: "client",
243
207
  $metadata: deserializeMetadata(output),
244
- };
208
+ });
209
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
245
210
  }
246
- const message = response.message || response.Message || errorCode;
247
- response.message = message;
248
- delete response.Message;
249
- return Promise.reject(Object.assign(new Error(message), response));
250
211
  };
251
212
  const deserializeAws_json1_0CreateTableCommand = async (output, context) => {
252
213
  if (output.statusCode >= 300) {
@@ -273,83 +234,37 @@ const deserializeAws_json1_0CreateTableCommandError = async (output, context) =>
273
234
  switch (errorCode) {
274
235
  case "AccessDeniedException":
275
236
  case "com.amazonaws.timestreamwrite#AccessDeniedException":
276
- response = {
277
- ...(await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context)),
278
- name: errorCode,
279
- $metadata: deserializeMetadata(output),
280
- };
281
- break;
237
+ throw await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context);
282
238
  case "ConflictException":
283
239
  case "com.amazonaws.timestreamwrite#ConflictException":
284
- response = {
285
- ...(await deserializeAws_json1_0ConflictExceptionResponse(parsedOutput, context)),
286
- name: errorCode,
287
- $metadata: deserializeMetadata(output),
288
- };
289
- break;
240
+ throw await deserializeAws_json1_0ConflictExceptionResponse(parsedOutput, context);
290
241
  case "InternalServerException":
291
242
  case "com.amazonaws.timestreamwrite#InternalServerException":
292
- response = {
293
- ...(await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context)),
294
- name: errorCode,
295
- $metadata: deserializeMetadata(output),
296
- };
297
- break;
243
+ throw await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context);
298
244
  case "InvalidEndpointException":
299
245
  case "com.amazonaws.timestreamwrite#InvalidEndpointException":
300
- response = {
301
- ...(await deserializeAws_json1_0InvalidEndpointExceptionResponse(parsedOutput, context)),
302
- name: errorCode,
303
- $metadata: deserializeMetadata(output),
304
- };
305
- break;
246
+ throw await deserializeAws_json1_0InvalidEndpointExceptionResponse(parsedOutput, context);
306
247
  case "ResourceNotFoundException":
307
248
  case "com.amazonaws.timestreamwrite#ResourceNotFoundException":
308
- response = {
309
- ...(await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context)),
310
- name: errorCode,
311
- $metadata: deserializeMetadata(output),
312
- };
313
- break;
249
+ throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
314
250
  case "ServiceQuotaExceededException":
315
251
  case "com.amazonaws.timestreamwrite#ServiceQuotaExceededException":
316
- response = {
317
- ...(await deserializeAws_json1_0ServiceQuotaExceededExceptionResponse(parsedOutput, context)),
318
- name: errorCode,
319
- $metadata: deserializeMetadata(output),
320
- };
321
- break;
252
+ throw await deserializeAws_json1_0ServiceQuotaExceededExceptionResponse(parsedOutput, context);
322
253
  case "ThrottlingException":
323
254
  case "com.amazonaws.timestreamwrite#ThrottlingException":
324
- response = {
325
- ...(await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context)),
326
- name: errorCode,
327
- $metadata: deserializeMetadata(output),
328
- };
329
- break;
255
+ throw await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context);
330
256
  case "ValidationException":
331
257
  case "com.amazonaws.timestreamwrite#ValidationException":
332
- response = {
333
- ...(await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context)),
334
- name: errorCode,
335
- $metadata: deserializeMetadata(output),
336
- };
337
- break;
258
+ throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
338
259
  default:
339
260
  const parsedBody = parsedOutput.body;
340
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
341
- response = {
342
- ...parsedBody,
343
- name: `${errorCode}`,
344
- message: parsedBody.message || parsedBody.Message || errorCode,
261
+ response = new TimestreamWriteServiceException_1.TimestreamWriteServiceException({
262
+ name: parsedBody.code || parsedBody.Code || errorCode,
345
263
  $fault: "client",
346
264
  $metadata: deserializeMetadata(output),
347
- };
265
+ });
266
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
348
267
  }
349
- const message = response.message || response.Message || errorCode;
350
- response.message = message;
351
- delete response.Message;
352
- return Promise.reject(Object.assign(new Error(message), response));
353
268
  };
354
269
  const deserializeAws_json1_0DeleteDatabaseCommand = async (output, context) => {
355
270
  if (output.statusCode >= 300) {
@@ -373,67 +288,31 @@ const deserializeAws_json1_0DeleteDatabaseCommandError = async (output, context)
373
288
  switch (errorCode) {
374
289
  case "AccessDeniedException":
375
290
  case "com.amazonaws.timestreamwrite#AccessDeniedException":
376
- response = {
377
- ...(await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context)),
378
- name: errorCode,
379
- $metadata: deserializeMetadata(output),
380
- };
381
- break;
291
+ throw await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context);
382
292
  case "InternalServerException":
383
293
  case "com.amazonaws.timestreamwrite#InternalServerException":
384
- response = {
385
- ...(await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context)),
386
- name: errorCode,
387
- $metadata: deserializeMetadata(output),
388
- };
389
- break;
294
+ throw await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context);
390
295
  case "InvalidEndpointException":
391
296
  case "com.amazonaws.timestreamwrite#InvalidEndpointException":
392
- response = {
393
- ...(await deserializeAws_json1_0InvalidEndpointExceptionResponse(parsedOutput, context)),
394
- name: errorCode,
395
- $metadata: deserializeMetadata(output),
396
- };
397
- break;
297
+ throw await deserializeAws_json1_0InvalidEndpointExceptionResponse(parsedOutput, context);
398
298
  case "ResourceNotFoundException":
399
299
  case "com.amazonaws.timestreamwrite#ResourceNotFoundException":
400
- response = {
401
- ...(await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context)),
402
- name: errorCode,
403
- $metadata: deserializeMetadata(output),
404
- };
405
- break;
300
+ throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
406
301
  case "ThrottlingException":
407
302
  case "com.amazonaws.timestreamwrite#ThrottlingException":
408
- response = {
409
- ...(await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context)),
410
- name: errorCode,
411
- $metadata: deserializeMetadata(output),
412
- };
413
- break;
303
+ throw await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context);
414
304
  case "ValidationException":
415
305
  case "com.amazonaws.timestreamwrite#ValidationException":
416
- response = {
417
- ...(await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context)),
418
- name: errorCode,
419
- $metadata: deserializeMetadata(output),
420
- };
421
- break;
306
+ throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
422
307
  default:
423
308
  const parsedBody = parsedOutput.body;
424
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
425
- response = {
426
- ...parsedBody,
427
- name: `${errorCode}`,
428
- message: parsedBody.message || parsedBody.Message || errorCode,
309
+ response = new TimestreamWriteServiceException_1.TimestreamWriteServiceException({
310
+ name: parsedBody.code || parsedBody.Code || errorCode,
429
311
  $fault: "client",
430
312
  $metadata: deserializeMetadata(output),
431
- };
313
+ });
314
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
432
315
  }
433
- const message = response.message || response.Message || errorCode;
434
- response.message = message;
435
- delete response.Message;
436
- return Promise.reject(Object.assign(new Error(message), response));
437
316
  };
438
317
  const deserializeAws_json1_0DeleteTableCommand = async (output, context) => {
439
318
  if (output.statusCode >= 300) {
@@ -457,67 +336,31 @@ const deserializeAws_json1_0DeleteTableCommandError = async (output, context) =>
457
336
  switch (errorCode) {
458
337
  case "AccessDeniedException":
459
338
  case "com.amazonaws.timestreamwrite#AccessDeniedException":
460
- response = {
461
- ...(await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context)),
462
- name: errorCode,
463
- $metadata: deserializeMetadata(output),
464
- };
465
- break;
339
+ throw await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context);
466
340
  case "InternalServerException":
467
341
  case "com.amazonaws.timestreamwrite#InternalServerException":
468
- response = {
469
- ...(await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context)),
470
- name: errorCode,
471
- $metadata: deserializeMetadata(output),
472
- };
473
- break;
342
+ throw await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context);
474
343
  case "InvalidEndpointException":
475
344
  case "com.amazonaws.timestreamwrite#InvalidEndpointException":
476
- response = {
477
- ...(await deserializeAws_json1_0InvalidEndpointExceptionResponse(parsedOutput, context)),
478
- name: errorCode,
479
- $metadata: deserializeMetadata(output),
480
- };
481
- break;
345
+ throw await deserializeAws_json1_0InvalidEndpointExceptionResponse(parsedOutput, context);
482
346
  case "ResourceNotFoundException":
483
347
  case "com.amazonaws.timestreamwrite#ResourceNotFoundException":
484
- response = {
485
- ...(await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context)),
486
- name: errorCode,
487
- $metadata: deserializeMetadata(output),
488
- };
489
- break;
348
+ throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
490
349
  case "ThrottlingException":
491
350
  case "com.amazonaws.timestreamwrite#ThrottlingException":
492
- response = {
493
- ...(await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context)),
494
- name: errorCode,
495
- $metadata: deserializeMetadata(output),
496
- };
497
- break;
351
+ throw await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context);
498
352
  case "ValidationException":
499
353
  case "com.amazonaws.timestreamwrite#ValidationException":
500
- response = {
501
- ...(await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context)),
502
- name: errorCode,
503
- $metadata: deserializeMetadata(output),
504
- };
505
- break;
354
+ throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
506
355
  default:
507
356
  const parsedBody = parsedOutput.body;
508
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
509
- response = {
510
- ...parsedBody,
511
- name: `${errorCode}`,
512
- message: parsedBody.message || parsedBody.Message || errorCode,
357
+ response = new TimestreamWriteServiceException_1.TimestreamWriteServiceException({
358
+ name: parsedBody.code || parsedBody.Code || errorCode,
513
359
  $fault: "client",
514
360
  $metadata: deserializeMetadata(output),
515
- };
361
+ });
362
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
516
363
  }
517
- const message = response.message || response.Message || errorCode;
518
- response.message = message;
519
- delete response.Message;
520
- return Promise.reject(Object.assign(new Error(message), response));
521
364
  };
522
365
  const deserializeAws_json1_0DescribeDatabaseCommand = async (output, context) => {
523
366
  if (output.statusCode >= 300) {
@@ -544,67 +387,31 @@ const deserializeAws_json1_0DescribeDatabaseCommandError = async (output, contex
544
387
  switch (errorCode) {
545
388
  case "AccessDeniedException":
546
389
  case "com.amazonaws.timestreamwrite#AccessDeniedException":
547
- response = {
548
- ...(await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context)),
549
- name: errorCode,
550
- $metadata: deserializeMetadata(output),
551
- };
552
- break;
390
+ throw await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context);
553
391
  case "InternalServerException":
554
392
  case "com.amazonaws.timestreamwrite#InternalServerException":
555
- response = {
556
- ...(await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context)),
557
- name: errorCode,
558
- $metadata: deserializeMetadata(output),
559
- };
560
- break;
393
+ throw await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context);
561
394
  case "InvalidEndpointException":
562
395
  case "com.amazonaws.timestreamwrite#InvalidEndpointException":
563
- response = {
564
- ...(await deserializeAws_json1_0InvalidEndpointExceptionResponse(parsedOutput, context)),
565
- name: errorCode,
566
- $metadata: deserializeMetadata(output),
567
- };
568
- break;
396
+ throw await deserializeAws_json1_0InvalidEndpointExceptionResponse(parsedOutput, context);
569
397
  case "ResourceNotFoundException":
570
398
  case "com.amazonaws.timestreamwrite#ResourceNotFoundException":
571
- response = {
572
- ...(await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context)),
573
- name: errorCode,
574
- $metadata: deserializeMetadata(output),
575
- };
576
- break;
399
+ throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
577
400
  case "ThrottlingException":
578
401
  case "com.amazonaws.timestreamwrite#ThrottlingException":
579
- response = {
580
- ...(await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context)),
581
- name: errorCode,
582
- $metadata: deserializeMetadata(output),
583
- };
584
- break;
402
+ throw await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context);
585
403
  case "ValidationException":
586
404
  case "com.amazonaws.timestreamwrite#ValidationException":
587
- response = {
588
- ...(await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context)),
589
- name: errorCode,
590
- $metadata: deserializeMetadata(output),
591
- };
592
- break;
405
+ throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
593
406
  default:
594
407
  const parsedBody = parsedOutput.body;
595
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
596
- response = {
597
- ...parsedBody,
598
- name: `${errorCode}`,
599
- message: parsedBody.message || parsedBody.Message || errorCode,
408
+ response = new TimestreamWriteServiceException_1.TimestreamWriteServiceException({
409
+ name: parsedBody.code || parsedBody.Code || errorCode,
600
410
  $fault: "client",
601
411
  $metadata: deserializeMetadata(output),
602
- };
412
+ });
413
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
603
414
  }
604
- const message = response.message || response.Message || errorCode;
605
- response.message = message;
606
- delete response.Message;
607
- return Promise.reject(Object.assign(new Error(message), response));
608
415
  };
609
416
  const deserializeAws_json1_0DescribeEndpointsCommand = async (output, context) => {
610
417
  if (output.statusCode >= 300) {
@@ -631,43 +438,22 @@ const deserializeAws_json1_0DescribeEndpointsCommandError = async (output, conte
631
438
  switch (errorCode) {
632
439
  case "InternalServerException":
633
440
  case "com.amazonaws.timestreamwrite#InternalServerException":
634
- response = {
635
- ...(await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context)),
636
- name: errorCode,
637
- $metadata: deserializeMetadata(output),
638
- };
639
- break;
441
+ throw await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context);
640
442
  case "ThrottlingException":
641
443
  case "com.amazonaws.timestreamwrite#ThrottlingException":
642
- response = {
643
- ...(await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context)),
644
- name: errorCode,
645
- $metadata: deserializeMetadata(output),
646
- };
647
- break;
444
+ throw await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context);
648
445
  case "ValidationException":
649
446
  case "com.amazonaws.timestreamwrite#ValidationException":
650
- response = {
651
- ...(await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context)),
652
- name: errorCode,
653
- $metadata: deserializeMetadata(output),
654
- };
655
- break;
447
+ throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
656
448
  default:
657
449
  const parsedBody = parsedOutput.body;
658
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
659
- response = {
660
- ...parsedBody,
661
- name: `${errorCode}`,
662
- message: parsedBody.message || parsedBody.Message || errorCode,
450
+ response = new TimestreamWriteServiceException_1.TimestreamWriteServiceException({
451
+ name: parsedBody.code || parsedBody.Code || errorCode,
663
452
  $fault: "client",
664
453
  $metadata: deserializeMetadata(output),
665
- };
454
+ });
455
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
666
456
  }
667
- const message = response.message || response.Message || errorCode;
668
- response.message = message;
669
- delete response.Message;
670
- return Promise.reject(Object.assign(new Error(message), response));
671
457
  };
672
458
  const deserializeAws_json1_0DescribeTableCommand = async (output, context) => {
673
459
  if (output.statusCode >= 300) {
@@ -694,67 +480,31 @@ const deserializeAws_json1_0DescribeTableCommandError = async (output, context)
694
480
  switch (errorCode) {
695
481
  case "AccessDeniedException":
696
482
  case "com.amazonaws.timestreamwrite#AccessDeniedException":
697
- response = {
698
- ...(await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context)),
699
- name: errorCode,
700
- $metadata: deserializeMetadata(output),
701
- };
702
- break;
483
+ throw await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context);
703
484
  case "InternalServerException":
704
485
  case "com.amazonaws.timestreamwrite#InternalServerException":
705
- response = {
706
- ...(await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context)),
707
- name: errorCode,
708
- $metadata: deserializeMetadata(output),
709
- };
710
- break;
486
+ throw await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context);
711
487
  case "InvalidEndpointException":
712
488
  case "com.amazonaws.timestreamwrite#InvalidEndpointException":
713
- response = {
714
- ...(await deserializeAws_json1_0InvalidEndpointExceptionResponse(parsedOutput, context)),
715
- name: errorCode,
716
- $metadata: deserializeMetadata(output),
717
- };
718
- break;
489
+ throw await deserializeAws_json1_0InvalidEndpointExceptionResponse(parsedOutput, context);
719
490
  case "ResourceNotFoundException":
720
491
  case "com.amazonaws.timestreamwrite#ResourceNotFoundException":
721
- response = {
722
- ...(await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context)),
723
- name: errorCode,
724
- $metadata: deserializeMetadata(output),
725
- };
726
- break;
492
+ throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
727
493
  case "ThrottlingException":
728
494
  case "com.amazonaws.timestreamwrite#ThrottlingException":
729
- response = {
730
- ...(await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context)),
731
- name: errorCode,
732
- $metadata: deserializeMetadata(output),
733
- };
734
- break;
495
+ throw await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context);
735
496
  case "ValidationException":
736
497
  case "com.amazonaws.timestreamwrite#ValidationException":
737
- response = {
738
- ...(await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context)),
739
- name: errorCode,
740
- $metadata: deserializeMetadata(output),
741
- };
742
- break;
498
+ throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
743
499
  default:
744
500
  const parsedBody = parsedOutput.body;
745
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
746
- response = {
747
- ...parsedBody,
748
- name: `${errorCode}`,
749
- message: parsedBody.message || parsedBody.Message || errorCode,
501
+ response = new TimestreamWriteServiceException_1.TimestreamWriteServiceException({
502
+ name: parsedBody.code || parsedBody.Code || errorCode,
750
503
  $fault: "client",
751
504
  $metadata: deserializeMetadata(output),
752
- };
505
+ });
506
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
753
507
  }
754
- const message = response.message || response.Message || errorCode;
755
- response.message = message;
756
- delete response.Message;
757
- return Promise.reject(Object.assign(new Error(message), response));
758
508
  };
759
509
  const deserializeAws_json1_0ListDatabasesCommand = async (output, context) => {
760
510
  if (output.statusCode >= 300) {
@@ -781,59 +531,28 @@ const deserializeAws_json1_0ListDatabasesCommandError = async (output, context)
781
531
  switch (errorCode) {
782
532
  case "AccessDeniedException":
783
533
  case "com.amazonaws.timestreamwrite#AccessDeniedException":
784
- response = {
785
- ...(await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context)),
786
- name: errorCode,
787
- $metadata: deserializeMetadata(output),
788
- };
789
- break;
534
+ throw await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context);
790
535
  case "InternalServerException":
791
536
  case "com.amazonaws.timestreamwrite#InternalServerException":
792
- response = {
793
- ...(await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context)),
794
- name: errorCode,
795
- $metadata: deserializeMetadata(output),
796
- };
797
- break;
537
+ throw await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context);
798
538
  case "InvalidEndpointException":
799
539
  case "com.amazonaws.timestreamwrite#InvalidEndpointException":
800
- response = {
801
- ...(await deserializeAws_json1_0InvalidEndpointExceptionResponse(parsedOutput, context)),
802
- name: errorCode,
803
- $metadata: deserializeMetadata(output),
804
- };
805
- break;
540
+ throw await deserializeAws_json1_0InvalidEndpointExceptionResponse(parsedOutput, context);
806
541
  case "ThrottlingException":
807
542
  case "com.amazonaws.timestreamwrite#ThrottlingException":
808
- response = {
809
- ...(await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context)),
810
- name: errorCode,
811
- $metadata: deserializeMetadata(output),
812
- };
813
- break;
543
+ throw await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context);
814
544
  case "ValidationException":
815
545
  case "com.amazonaws.timestreamwrite#ValidationException":
816
- response = {
817
- ...(await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context)),
818
- name: errorCode,
819
- $metadata: deserializeMetadata(output),
820
- };
821
- break;
546
+ throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
822
547
  default:
823
548
  const parsedBody = parsedOutput.body;
824
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
825
- response = {
826
- ...parsedBody,
827
- name: `${errorCode}`,
828
- message: parsedBody.message || parsedBody.Message || errorCode,
549
+ response = new TimestreamWriteServiceException_1.TimestreamWriteServiceException({
550
+ name: parsedBody.code || parsedBody.Code || errorCode,
829
551
  $fault: "client",
830
552
  $metadata: deserializeMetadata(output),
831
- };
553
+ });
554
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
832
555
  }
833
- const message = response.message || response.Message || errorCode;
834
- response.message = message;
835
- delete response.Message;
836
- return Promise.reject(Object.assign(new Error(message), response));
837
556
  };
838
557
  const deserializeAws_json1_0ListTablesCommand = async (output, context) => {
839
558
  if (output.statusCode >= 300) {
@@ -860,67 +579,31 @@ const deserializeAws_json1_0ListTablesCommandError = async (output, context) =>
860
579
  switch (errorCode) {
861
580
  case "AccessDeniedException":
862
581
  case "com.amazonaws.timestreamwrite#AccessDeniedException":
863
- response = {
864
- ...(await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context)),
865
- name: errorCode,
866
- $metadata: deserializeMetadata(output),
867
- };
868
- break;
582
+ throw await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context);
869
583
  case "InternalServerException":
870
584
  case "com.amazonaws.timestreamwrite#InternalServerException":
871
- response = {
872
- ...(await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context)),
873
- name: errorCode,
874
- $metadata: deserializeMetadata(output),
875
- };
876
- break;
585
+ throw await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context);
877
586
  case "InvalidEndpointException":
878
587
  case "com.amazonaws.timestreamwrite#InvalidEndpointException":
879
- response = {
880
- ...(await deserializeAws_json1_0InvalidEndpointExceptionResponse(parsedOutput, context)),
881
- name: errorCode,
882
- $metadata: deserializeMetadata(output),
883
- };
884
- break;
588
+ throw await deserializeAws_json1_0InvalidEndpointExceptionResponse(parsedOutput, context);
885
589
  case "ResourceNotFoundException":
886
590
  case "com.amazonaws.timestreamwrite#ResourceNotFoundException":
887
- response = {
888
- ...(await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context)),
889
- name: errorCode,
890
- $metadata: deserializeMetadata(output),
891
- };
892
- break;
591
+ throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
893
592
  case "ThrottlingException":
894
593
  case "com.amazonaws.timestreamwrite#ThrottlingException":
895
- response = {
896
- ...(await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context)),
897
- name: errorCode,
898
- $metadata: deserializeMetadata(output),
899
- };
900
- break;
594
+ throw await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context);
901
595
  case "ValidationException":
902
596
  case "com.amazonaws.timestreamwrite#ValidationException":
903
- response = {
904
- ...(await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context)),
905
- name: errorCode,
906
- $metadata: deserializeMetadata(output),
907
- };
908
- break;
597
+ throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
909
598
  default:
910
599
  const parsedBody = parsedOutput.body;
911
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
912
- response = {
913
- ...parsedBody,
914
- name: `${errorCode}`,
915
- message: parsedBody.message || parsedBody.Message || errorCode,
600
+ response = new TimestreamWriteServiceException_1.TimestreamWriteServiceException({
601
+ name: parsedBody.code || parsedBody.Code || errorCode,
916
602
  $fault: "client",
917
603
  $metadata: deserializeMetadata(output),
918
- };
604
+ });
605
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
919
606
  }
920
- const message = response.message || response.Message || errorCode;
921
- response.message = message;
922
- delete response.Message;
923
- return Promise.reject(Object.assign(new Error(message), response));
924
607
  };
925
608
  const deserializeAws_json1_0ListTagsForResourceCommand = async (output, context) => {
926
609
  if (output.statusCode >= 300) {
@@ -947,51 +630,25 @@ const deserializeAws_json1_0ListTagsForResourceCommandError = async (output, con
947
630
  switch (errorCode) {
948
631
  case "InvalidEndpointException":
949
632
  case "com.amazonaws.timestreamwrite#InvalidEndpointException":
950
- response = {
951
- ...(await deserializeAws_json1_0InvalidEndpointExceptionResponse(parsedOutput, context)),
952
- name: errorCode,
953
- $metadata: deserializeMetadata(output),
954
- };
955
- break;
633
+ throw await deserializeAws_json1_0InvalidEndpointExceptionResponse(parsedOutput, context);
956
634
  case "ResourceNotFoundException":
957
635
  case "com.amazonaws.timestreamwrite#ResourceNotFoundException":
958
- response = {
959
- ...(await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context)),
960
- name: errorCode,
961
- $metadata: deserializeMetadata(output),
962
- };
963
- break;
636
+ throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
964
637
  case "ThrottlingException":
965
638
  case "com.amazonaws.timestreamwrite#ThrottlingException":
966
- response = {
967
- ...(await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context)),
968
- name: errorCode,
969
- $metadata: deserializeMetadata(output),
970
- };
971
- break;
639
+ throw await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context);
972
640
  case "ValidationException":
973
641
  case "com.amazonaws.timestreamwrite#ValidationException":
974
- response = {
975
- ...(await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context)),
976
- name: errorCode,
977
- $metadata: deserializeMetadata(output),
978
- };
979
- break;
642
+ throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
980
643
  default:
981
644
  const parsedBody = parsedOutput.body;
982
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
983
- response = {
984
- ...parsedBody,
985
- name: `${errorCode}`,
986
- message: parsedBody.message || parsedBody.Message || errorCode,
645
+ response = new TimestreamWriteServiceException_1.TimestreamWriteServiceException({
646
+ name: parsedBody.code || parsedBody.Code || errorCode,
987
647
  $fault: "client",
988
648
  $metadata: deserializeMetadata(output),
989
- };
649
+ });
650
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
990
651
  }
991
- const message = response.message || response.Message || errorCode;
992
- response.message = message;
993
- delete response.Message;
994
- return Promise.reject(Object.assign(new Error(message), response));
995
652
  };
996
653
  const deserializeAws_json1_0TagResourceCommand = async (output, context) => {
997
654
  if (output.statusCode >= 300) {
@@ -1018,59 +675,28 @@ const deserializeAws_json1_0TagResourceCommandError = async (output, context) =>
1018
675
  switch (errorCode) {
1019
676
  case "InvalidEndpointException":
1020
677
  case "com.amazonaws.timestreamwrite#InvalidEndpointException":
1021
- response = {
1022
- ...(await deserializeAws_json1_0InvalidEndpointExceptionResponse(parsedOutput, context)),
1023
- name: errorCode,
1024
- $metadata: deserializeMetadata(output),
1025
- };
1026
- break;
678
+ throw await deserializeAws_json1_0InvalidEndpointExceptionResponse(parsedOutput, context);
1027
679
  case "ResourceNotFoundException":
1028
680
  case "com.amazonaws.timestreamwrite#ResourceNotFoundException":
1029
- response = {
1030
- ...(await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context)),
1031
- name: errorCode,
1032
- $metadata: deserializeMetadata(output),
1033
- };
1034
- break;
681
+ throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
1035
682
  case "ServiceQuotaExceededException":
1036
683
  case "com.amazonaws.timestreamwrite#ServiceQuotaExceededException":
1037
- response = {
1038
- ...(await deserializeAws_json1_0ServiceQuotaExceededExceptionResponse(parsedOutput, context)),
1039
- name: errorCode,
1040
- $metadata: deserializeMetadata(output),
1041
- };
1042
- break;
684
+ throw await deserializeAws_json1_0ServiceQuotaExceededExceptionResponse(parsedOutput, context);
1043
685
  case "ThrottlingException":
1044
686
  case "com.amazonaws.timestreamwrite#ThrottlingException":
1045
- response = {
1046
- ...(await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context)),
1047
- name: errorCode,
1048
- $metadata: deserializeMetadata(output),
1049
- };
1050
- break;
687
+ throw await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context);
1051
688
  case "ValidationException":
1052
689
  case "com.amazonaws.timestreamwrite#ValidationException":
1053
- response = {
1054
- ...(await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context)),
1055
- name: errorCode,
1056
- $metadata: deserializeMetadata(output),
1057
- };
1058
- break;
690
+ throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
1059
691
  default:
1060
692
  const parsedBody = parsedOutput.body;
1061
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1062
- response = {
1063
- ...parsedBody,
1064
- name: `${errorCode}`,
1065
- message: parsedBody.message || parsedBody.Message || errorCode,
693
+ response = new TimestreamWriteServiceException_1.TimestreamWriteServiceException({
694
+ name: parsedBody.code || parsedBody.Code || errorCode,
1066
695
  $fault: "client",
1067
696
  $metadata: deserializeMetadata(output),
1068
- };
697
+ });
698
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1069
699
  }
1070
- const message = response.message || response.Message || errorCode;
1071
- response.message = message;
1072
- delete response.Message;
1073
- return Promise.reject(Object.assign(new Error(message), response));
1074
700
  };
1075
701
  const deserializeAws_json1_0UntagResourceCommand = async (output, context) => {
1076
702
  if (output.statusCode >= 300) {
@@ -1097,59 +723,28 @@ const deserializeAws_json1_0UntagResourceCommandError = async (output, context)
1097
723
  switch (errorCode) {
1098
724
  case "InvalidEndpointException":
1099
725
  case "com.amazonaws.timestreamwrite#InvalidEndpointException":
1100
- response = {
1101
- ...(await deserializeAws_json1_0InvalidEndpointExceptionResponse(parsedOutput, context)),
1102
- name: errorCode,
1103
- $metadata: deserializeMetadata(output),
1104
- };
1105
- break;
726
+ throw await deserializeAws_json1_0InvalidEndpointExceptionResponse(parsedOutput, context);
1106
727
  case "ResourceNotFoundException":
1107
728
  case "com.amazonaws.timestreamwrite#ResourceNotFoundException":
1108
- response = {
1109
- ...(await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context)),
1110
- name: errorCode,
1111
- $metadata: deserializeMetadata(output),
1112
- };
1113
- break;
729
+ throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
1114
730
  case "ServiceQuotaExceededException":
1115
731
  case "com.amazonaws.timestreamwrite#ServiceQuotaExceededException":
1116
- response = {
1117
- ...(await deserializeAws_json1_0ServiceQuotaExceededExceptionResponse(parsedOutput, context)),
1118
- name: errorCode,
1119
- $metadata: deserializeMetadata(output),
1120
- };
1121
- break;
732
+ throw await deserializeAws_json1_0ServiceQuotaExceededExceptionResponse(parsedOutput, context);
1122
733
  case "ThrottlingException":
1123
734
  case "com.amazonaws.timestreamwrite#ThrottlingException":
1124
- response = {
1125
- ...(await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context)),
1126
- name: errorCode,
1127
- $metadata: deserializeMetadata(output),
1128
- };
1129
- break;
735
+ throw await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context);
1130
736
  case "ValidationException":
1131
737
  case "com.amazonaws.timestreamwrite#ValidationException":
1132
- response = {
1133
- ...(await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context)),
1134
- name: errorCode,
1135
- $metadata: deserializeMetadata(output),
1136
- };
1137
- break;
738
+ throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
1138
739
  default:
1139
740
  const parsedBody = parsedOutput.body;
1140
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1141
- response = {
1142
- ...parsedBody,
1143
- name: `${errorCode}`,
1144
- message: parsedBody.message || parsedBody.Message || errorCode,
741
+ response = new TimestreamWriteServiceException_1.TimestreamWriteServiceException({
742
+ name: parsedBody.code || parsedBody.Code || errorCode,
1145
743
  $fault: "client",
1146
744
  $metadata: deserializeMetadata(output),
1147
- };
745
+ });
746
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1148
747
  }
1149
- const message = response.message || response.Message || errorCode;
1150
- response.message = message;
1151
- delete response.Message;
1152
- return Promise.reject(Object.assign(new Error(message), response));
1153
748
  };
1154
749
  const deserializeAws_json1_0UpdateDatabaseCommand = async (output, context) => {
1155
750
  if (output.statusCode >= 300) {
@@ -1176,75 +771,34 @@ const deserializeAws_json1_0UpdateDatabaseCommandError = async (output, context)
1176
771
  switch (errorCode) {
1177
772
  case "AccessDeniedException":
1178
773
  case "com.amazonaws.timestreamwrite#AccessDeniedException":
1179
- response = {
1180
- ...(await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context)),
1181
- name: errorCode,
1182
- $metadata: deserializeMetadata(output),
1183
- };
1184
- break;
774
+ throw await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context);
1185
775
  case "InternalServerException":
1186
776
  case "com.amazonaws.timestreamwrite#InternalServerException":
1187
- response = {
1188
- ...(await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context)),
1189
- name: errorCode,
1190
- $metadata: deserializeMetadata(output),
1191
- };
1192
- break;
777
+ throw await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context);
1193
778
  case "InvalidEndpointException":
1194
779
  case "com.amazonaws.timestreamwrite#InvalidEndpointException":
1195
- response = {
1196
- ...(await deserializeAws_json1_0InvalidEndpointExceptionResponse(parsedOutput, context)),
1197
- name: errorCode,
1198
- $metadata: deserializeMetadata(output),
1199
- };
1200
- break;
780
+ throw await deserializeAws_json1_0InvalidEndpointExceptionResponse(parsedOutput, context);
1201
781
  case "ResourceNotFoundException":
1202
782
  case "com.amazonaws.timestreamwrite#ResourceNotFoundException":
1203
- response = {
1204
- ...(await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context)),
1205
- name: errorCode,
1206
- $metadata: deserializeMetadata(output),
1207
- };
1208
- break;
783
+ throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
1209
784
  case "ServiceQuotaExceededException":
1210
785
  case "com.amazonaws.timestreamwrite#ServiceQuotaExceededException":
1211
- response = {
1212
- ...(await deserializeAws_json1_0ServiceQuotaExceededExceptionResponse(parsedOutput, context)),
1213
- name: errorCode,
1214
- $metadata: deserializeMetadata(output),
1215
- };
1216
- break;
786
+ throw await deserializeAws_json1_0ServiceQuotaExceededExceptionResponse(parsedOutput, context);
1217
787
  case "ThrottlingException":
1218
788
  case "com.amazonaws.timestreamwrite#ThrottlingException":
1219
- response = {
1220
- ...(await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context)),
1221
- name: errorCode,
1222
- $metadata: deserializeMetadata(output),
1223
- };
1224
- break;
789
+ throw await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context);
1225
790
  case "ValidationException":
1226
791
  case "com.amazonaws.timestreamwrite#ValidationException":
1227
- response = {
1228
- ...(await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context)),
1229
- name: errorCode,
1230
- $metadata: deserializeMetadata(output),
1231
- };
1232
- break;
792
+ throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
1233
793
  default:
1234
794
  const parsedBody = parsedOutput.body;
1235
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1236
- response = {
1237
- ...parsedBody,
1238
- name: `${errorCode}`,
1239
- message: parsedBody.message || parsedBody.Message || errorCode,
795
+ response = new TimestreamWriteServiceException_1.TimestreamWriteServiceException({
796
+ name: parsedBody.code || parsedBody.Code || errorCode,
1240
797
  $fault: "client",
1241
798
  $metadata: deserializeMetadata(output),
1242
- };
799
+ });
800
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1243
801
  }
1244
- const message = response.message || response.Message || errorCode;
1245
- response.message = message;
1246
- delete response.Message;
1247
- return Promise.reject(Object.assign(new Error(message), response));
1248
802
  };
1249
803
  const deserializeAws_json1_0UpdateTableCommand = async (output, context) => {
1250
804
  if (output.statusCode >= 300) {
@@ -1271,67 +825,31 @@ const deserializeAws_json1_0UpdateTableCommandError = async (output, context) =>
1271
825
  switch (errorCode) {
1272
826
  case "AccessDeniedException":
1273
827
  case "com.amazonaws.timestreamwrite#AccessDeniedException":
1274
- response = {
1275
- ...(await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context)),
1276
- name: errorCode,
1277
- $metadata: deserializeMetadata(output),
1278
- };
1279
- break;
828
+ throw await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context);
1280
829
  case "InternalServerException":
1281
830
  case "com.amazonaws.timestreamwrite#InternalServerException":
1282
- response = {
1283
- ...(await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context)),
1284
- name: errorCode,
1285
- $metadata: deserializeMetadata(output),
1286
- };
1287
- break;
831
+ throw await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context);
1288
832
  case "InvalidEndpointException":
1289
833
  case "com.amazonaws.timestreamwrite#InvalidEndpointException":
1290
- response = {
1291
- ...(await deserializeAws_json1_0InvalidEndpointExceptionResponse(parsedOutput, context)),
1292
- name: errorCode,
1293
- $metadata: deserializeMetadata(output),
1294
- };
1295
- break;
834
+ throw await deserializeAws_json1_0InvalidEndpointExceptionResponse(parsedOutput, context);
1296
835
  case "ResourceNotFoundException":
1297
836
  case "com.amazonaws.timestreamwrite#ResourceNotFoundException":
1298
- response = {
1299
- ...(await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context)),
1300
- name: errorCode,
1301
- $metadata: deserializeMetadata(output),
1302
- };
1303
- break;
837
+ throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
1304
838
  case "ThrottlingException":
1305
839
  case "com.amazonaws.timestreamwrite#ThrottlingException":
1306
- response = {
1307
- ...(await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context)),
1308
- name: errorCode,
1309
- $metadata: deserializeMetadata(output),
1310
- };
1311
- break;
840
+ throw await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context);
1312
841
  case "ValidationException":
1313
842
  case "com.amazonaws.timestreamwrite#ValidationException":
1314
- response = {
1315
- ...(await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context)),
1316
- name: errorCode,
1317
- $metadata: deserializeMetadata(output),
1318
- };
1319
- break;
843
+ throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
1320
844
  default:
1321
845
  const parsedBody = parsedOutput.body;
1322
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1323
- response = {
1324
- ...parsedBody,
1325
- name: `${errorCode}`,
1326
- message: parsedBody.message || parsedBody.Message || errorCode,
846
+ response = new TimestreamWriteServiceException_1.TimestreamWriteServiceException({
847
+ name: parsedBody.code || parsedBody.Code || errorCode,
1327
848
  $fault: "client",
1328
849
  $metadata: deserializeMetadata(output),
1329
- };
850
+ });
851
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1330
852
  }
1331
- const message = response.message || response.Message || errorCode;
1332
- response.message = message;
1333
- delete response.Message;
1334
- return Promise.reject(Object.assign(new Error(message), response));
1335
853
  };
1336
854
  const deserializeAws_json1_0WriteRecordsCommand = async (output, context) => {
1337
855
  if (output.statusCode >= 300) {
@@ -1358,174 +876,115 @@ const deserializeAws_json1_0WriteRecordsCommandError = async (output, context) =
1358
876
  switch (errorCode) {
1359
877
  case "AccessDeniedException":
1360
878
  case "com.amazonaws.timestreamwrite#AccessDeniedException":
1361
- response = {
1362
- ...(await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context)),
1363
- name: errorCode,
1364
- $metadata: deserializeMetadata(output),
1365
- };
1366
- break;
879
+ throw await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context);
1367
880
  case "InternalServerException":
1368
881
  case "com.amazonaws.timestreamwrite#InternalServerException":
1369
- response = {
1370
- ...(await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context)),
1371
- name: errorCode,
1372
- $metadata: deserializeMetadata(output),
1373
- };
1374
- break;
882
+ throw await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context);
1375
883
  case "InvalidEndpointException":
1376
884
  case "com.amazonaws.timestreamwrite#InvalidEndpointException":
1377
- response = {
1378
- ...(await deserializeAws_json1_0InvalidEndpointExceptionResponse(parsedOutput, context)),
1379
- name: errorCode,
1380
- $metadata: deserializeMetadata(output),
1381
- };
1382
- break;
885
+ throw await deserializeAws_json1_0InvalidEndpointExceptionResponse(parsedOutput, context);
1383
886
  case "RejectedRecordsException":
1384
887
  case "com.amazonaws.timestreamwrite#RejectedRecordsException":
1385
- response = {
1386
- ...(await deserializeAws_json1_0RejectedRecordsExceptionResponse(parsedOutput, context)),
1387
- name: errorCode,
1388
- $metadata: deserializeMetadata(output),
1389
- };
1390
- break;
888
+ throw await deserializeAws_json1_0RejectedRecordsExceptionResponse(parsedOutput, context);
1391
889
  case "ResourceNotFoundException":
1392
890
  case "com.amazonaws.timestreamwrite#ResourceNotFoundException":
1393
- response = {
1394
- ...(await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context)),
1395
- name: errorCode,
1396
- $metadata: deserializeMetadata(output),
1397
- };
1398
- break;
891
+ throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
1399
892
  case "ThrottlingException":
1400
893
  case "com.amazonaws.timestreamwrite#ThrottlingException":
1401
- response = {
1402
- ...(await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context)),
1403
- name: errorCode,
1404
- $metadata: deserializeMetadata(output),
1405
- };
1406
- break;
894
+ throw await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context);
1407
895
  case "ValidationException":
1408
896
  case "com.amazonaws.timestreamwrite#ValidationException":
1409
- response = {
1410
- ...(await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context)),
1411
- name: errorCode,
1412
- $metadata: deserializeMetadata(output),
1413
- };
1414
- break;
897
+ throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
1415
898
  default:
1416
899
  const parsedBody = parsedOutput.body;
1417
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1418
- response = {
1419
- ...parsedBody,
1420
- name: `${errorCode}`,
1421
- message: parsedBody.message || parsedBody.Message || errorCode,
900
+ response = new TimestreamWriteServiceException_1.TimestreamWriteServiceException({
901
+ name: parsedBody.code || parsedBody.Code || errorCode,
1422
902
  $fault: "client",
1423
903
  $metadata: deserializeMetadata(output),
1424
- };
904
+ });
905
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1425
906
  }
1426
- const message = response.message || response.Message || errorCode;
1427
- response.message = message;
1428
- delete response.Message;
1429
- return Promise.reject(Object.assign(new Error(message), response));
1430
907
  };
1431
908
  const deserializeAws_json1_0AccessDeniedExceptionResponse = async (parsedOutput, context) => {
1432
909
  const body = parsedOutput.body;
1433
910
  const deserialized = deserializeAws_json1_0AccessDeniedException(body, context);
1434
- const contents = {
1435
- name: "AccessDeniedException",
1436
- $fault: "client",
911
+ const exception = new models_0_1.AccessDeniedException({
1437
912
  $metadata: deserializeMetadata(parsedOutput),
1438
913
  ...deserialized,
1439
- };
1440
- return contents;
914
+ });
915
+ return smithy_client_1.decorateServiceException(exception, body);
1441
916
  };
1442
917
  const deserializeAws_json1_0ConflictExceptionResponse = async (parsedOutput, context) => {
1443
918
  const body = parsedOutput.body;
1444
919
  const deserialized = deserializeAws_json1_0ConflictException(body, context);
1445
- const contents = {
1446
- name: "ConflictException",
1447
- $fault: "client",
920
+ const exception = new models_0_1.ConflictException({
1448
921
  $metadata: deserializeMetadata(parsedOutput),
1449
922
  ...deserialized,
1450
- };
1451
- return contents;
923
+ });
924
+ return smithy_client_1.decorateServiceException(exception, body);
1452
925
  };
1453
926
  const deserializeAws_json1_0InternalServerExceptionResponse = async (parsedOutput, context) => {
1454
927
  const body = parsedOutput.body;
1455
928
  const deserialized = deserializeAws_json1_0InternalServerException(body, context);
1456
- const contents = {
1457
- name: "InternalServerException",
1458
- $fault: "server",
929
+ const exception = new models_0_1.InternalServerException({
1459
930
  $metadata: deserializeMetadata(parsedOutput),
1460
931
  ...deserialized,
1461
- };
1462
- return contents;
932
+ });
933
+ return smithy_client_1.decorateServiceException(exception, body);
1463
934
  };
1464
935
  const deserializeAws_json1_0InvalidEndpointExceptionResponse = async (parsedOutput, context) => {
1465
936
  const body = parsedOutput.body;
1466
937
  const deserialized = deserializeAws_json1_0InvalidEndpointException(body, context);
1467
- const contents = {
1468
- name: "InvalidEndpointException",
1469
- $fault: "client",
938
+ const exception = new models_0_1.InvalidEndpointException({
1470
939
  $metadata: deserializeMetadata(parsedOutput),
1471
940
  ...deserialized,
1472
- };
1473
- return contents;
941
+ });
942
+ return smithy_client_1.decorateServiceException(exception, body);
1474
943
  };
1475
944
  const deserializeAws_json1_0RejectedRecordsExceptionResponse = async (parsedOutput, context) => {
1476
945
  const body = parsedOutput.body;
1477
946
  const deserialized = deserializeAws_json1_0RejectedRecordsException(body, context);
1478
- const contents = {
1479
- name: "RejectedRecordsException",
1480
- $fault: "client",
947
+ const exception = new models_0_1.RejectedRecordsException({
1481
948
  $metadata: deserializeMetadata(parsedOutput),
1482
949
  ...deserialized,
1483
- };
1484
- return contents;
950
+ });
951
+ return smithy_client_1.decorateServiceException(exception, body);
1485
952
  };
1486
953
  const deserializeAws_json1_0ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
1487
954
  const body = parsedOutput.body;
1488
955
  const deserialized = deserializeAws_json1_0ResourceNotFoundException(body, context);
1489
- const contents = {
1490
- name: "ResourceNotFoundException",
1491
- $fault: "client",
956
+ const exception = new models_0_1.ResourceNotFoundException({
1492
957
  $metadata: deserializeMetadata(parsedOutput),
1493
958
  ...deserialized,
1494
- };
1495
- return contents;
959
+ });
960
+ return smithy_client_1.decorateServiceException(exception, body);
1496
961
  };
1497
962
  const deserializeAws_json1_0ServiceQuotaExceededExceptionResponse = async (parsedOutput, context) => {
1498
963
  const body = parsedOutput.body;
1499
964
  const deserialized = deserializeAws_json1_0ServiceQuotaExceededException(body, context);
1500
- const contents = {
1501
- name: "ServiceQuotaExceededException",
1502
- $fault: "client",
965
+ const exception = new models_0_1.ServiceQuotaExceededException({
1503
966
  $metadata: deserializeMetadata(parsedOutput),
1504
967
  ...deserialized,
1505
- };
1506
- return contents;
968
+ });
969
+ return smithy_client_1.decorateServiceException(exception, body);
1507
970
  };
1508
971
  const deserializeAws_json1_0ThrottlingExceptionResponse = async (parsedOutput, context) => {
1509
972
  const body = parsedOutput.body;
1510
973
  const deserialized = deserializeAws_json1_0ThrottlingException(body, context);
1511
- const contents = {
1512
- name: "ThrottlingException",
1513
- $fault: "client",
974
+ const exception = new models_0_1.ThrottlingException({
1514
975
  $metadata: deserializeMetadata(parsedOutput),
1515
976
  ...deserialized,
1516
- };
1517
- return contents;
977
+ });
978
+ return smithy_client_1.decorateServiceException(exception, body);
1518
979
  };
1519
980
  const deserializeAws_json1_0ValidationExceptionResponse = async (parsedOutput, context) => {
1520
981
  const body = parsedOutput.body;
1521
982
  const deserialized = deserializeAws_json1_0ValidationException(body, context);
1522
- const contents = {
1523
- name: "ValidationException",
1524
- $fault: "client",
983
+ const exception = new models_0_1.ValidationException({
1525
984
  $metadata: deserializeMetadata(parsedOutput),
1526
985
  ...deserialized,
1527
- };
1528
- return contents;
986
+ });
987
+ return smithy_client_1.decorateServiceException(exception, body);
1529
988
  };
1530
989
  const serializeAws_json1_0CreateDatabaseRequest = (input, context) => {
1531
990
  return {
@@ -1804,7 +1263,7 @@ const deserializeAws_json1_0Database = (output, context) => {
1804
1263
  };
1805
1264
  };
1806
1265
  const deserializeAws_json1_0DatabaseList = (output, context) => {
1807
- return (output || [])
1266
+ const retVal = (output || [])
1808
1267
  .filter((e) => e != null)
1809
1268
  .map((entry) => {
1810
1269
  if (entry === null) {
@@ -1812,6 +1271,7 @@ const deserializeAws_json1_0DatabaseList = (output, context) => {
1812
1271
  }
1813
1272
  return deserializeAws_json1_0Database(entry, context);
1814
1273
  });
1274
+ return retVal;
1815
1275
  };
1816
1276
  const deserializeAws_json1_0DescribeDatabaseResponse = (output, context) => {
1817
1277
  return {
@@ -1841,7 +1301,7 @@ const deserializeAws_json1_0Endpoint = (output, context) => {
1841
1301
  };
1842
1302
  };
1843
1303
  const deserializeAws_json1_0Endpoints = (output, context) => {
1844
- return (output || [])
1304
+ const retVal = (output || [])
1845
1305
  .filter((e) => e != null)
1846
1306
  .map((entry) => {
1847
1307
  if (entry === null) {
@@ -1849,6 +1309,7 @@ const deserializeAws_json1_0Endpoints = (output, context) => {
1849
1309
  }
1850
1310
  return deserializeAws_json1_0Endpoint(entry, context);
1851
1311
  });
1312
+ return retVal;
1852
1313
  };
1853
1314
  const deserializeAws_json1_0InternalServerException = (output, context) => {
1854
1315
  return {
@@ -1913,7 +1374,7 @@ const deserializeAws_json1_0RejectedRecord = (output, context) => {
1913
1374
  };
1914
1375
  };
1915
1376
  const deserializeAws_json1_0RejectedRecords = (output, context) => {
1916
- return (output || [])
1377
+ const retVal = (output || [])
1917
1378
  .filter((e) => e != null)
1918
1379
  .map((entry) => {
1919
1380
  if (entry === null) {
@@ -1921,6 +1382,7 @@ const deserializeAws_json1_0RejectedRecords = (output, context) => {
1921
1382
  }
1922
1383
  return deserializeAws_json1_0RejectedRecord(entry, context);
1923
1384
  });
1385
+ return retVal;
1924
1386
  };
1925
1387
  const deserializeAws_json1_0RejectedRecordsException = (output, context) => {
1926
1388
  return {
@@ -1975,7 +1437,7 @@ const deserializeAws_json1_0Table = (output, context) => {
1975
1437
  };
1976
1438
  };
1977
1439
  const deserializeAws_json1_0TableList = (output, context) => {
1978
- return (output || [])
1440
+ const retVal = (output || [])
1979
1441
  .filter((e) => e != null)
1980
1442
  .map((entry) => {
1981
1443
  if (entry === null) {
@@ -1983,6 +1445,7 @@ const deserializeAws_json1_0TableList = (output, context) => {
1983
1445
  }
1984
1446
  return deserializeAws_json1_0Table(entry, context);
1985
1447
  });
1448
+ return retVal;
1986
1449
  };
1987
1450
  const deserializeAws_json1_0Tag = (output, context) => {
1988
1451
  return {
@@ -1991,7 +1454,7 @@ const deserializeAws_json1_0Tag = (output, context) => {
1991
1454
  };
1992
1455
  };
1993
1456
  const deserializeAws_json1_0TagList = (output, context) => {
1994
- return (output || [])
1457
+ const retVal = (output || [])
1995
1458
  .filter((e) => e != null)
1996
1459
  .map((entry) => {
1997
1460
  if (entry === null) {
@@ -1999,6 +1462,7 @@ const deserializeAws_json1_0TagList = (output, context) => {
1999
1462
  }
2000
1463
  return deserializeAws_json1_0Tag(entry, context);
2001
1464
  });
1465
+ return retVal;
2002
1466
  };
2003
1467
  const deserializeAws_json1_0TagResourceResponse = (output, context) => {
2004
1468
  return {};