@aws-sdk/client-redshift-data 3.312.0 → 3.316.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.
@@ -1,5 +1,5 @@
1
1
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
2
- import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectLong as __expectLong, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectString as __expectString, expectUnion as __expectUnion, limitedParseDouble as __limitedParseDouble, parseEpochTimestamp as __parseEpochTimestamp, throwDefaultError, } from "@aws-sdk/smithy-client";
2
+ import { _json, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectLong as __expectLong, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectString as __expectString, expectUnion as __expectUnion, limitedParseDouble as __limitedParseDouble, parseEpochTimestamp as __parseEpochTimestamp, take, withBaseException, } from "@aws-sdk/smithy-client";
3
3
  import { v4 as generateIdempotencyToken } from "uuid";
4
4
  import { ActiveStatementsExceededException, BatchExecuteStatementException, DatabaseConnectionException, ExecuteStatementException, InternalServerException, ResourceNotFoundException, ValidationException, } from "../models/models_0";
5
5
  import { RedshiftDataServiceException as __BaseException } from "../models/RedshiftDataServiceException";
@@ -12,19 +12,19 @@ export const se_BatchExecuteStatementCommand = async (input, context) => {
12
12
  export const se_CancelStatementCommand = async (input, context) => {
13
13
  const headers = sharedHeaders("CancelStatement");
14
14
  let body;
15
- body = JSON.stringify(se_CancelStatementRequest(input, context));
15
+ body = JSON.stringify(_json(input));
16
16
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
17
17
  };
18
18
  export const se_DescribeStatementCommand = async (input, context) => {
19
19
  const headers = sharedHeaders("DescribeStatement");
20
20
  let body;
21
- body = JSON.stringify(se_DescribeStatementRequest(input, context));
21
+ body = JSON.stringify(_json(input));
22
22
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
23
23
  };
24
24
  export const se_DescribeTableCommand = async (input, context) => {
25
25
  const headers = sharedHeaders("DescribeTable");
26
26
  let body;
27
- body = JSON.stringify(se_DescribeTableRequest(input, context));
27
+ body = JSON.stringify(_json(input));
28
28
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
29
29
  };
30
30
  export const se_ExecuteStatementCommand = async (input, context) => {
@@ -36,31 +36,31 @@ export const se_ExecuteStatementCommand = async (input, context) => {
36
36
  export const se_GetStatementResultCommand = async (input, context) => {
37
37
  const headers = sharedHeaders("GetStatementResult");
38
38
  let body;
39
- body = JSON.stringify(se_GetStatementResultRequest(input, context));
39
+ body = JSON.stringify(_json(input));
40
40
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
41
41
  };
42
42
  export const se_ListDatabasesCommand = async (input, context) => {
43
43
  const headers = sharedHeaders("ListDatabases");
44
44
  let body;
45
- body = JSON.stringify(se_ListDatabasesRequest(input, context));
45
+ body = JSON.stringify(_json(input));
46
46
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
47
47
  };
48
48
  export const se_ListSchemasCommand = async (input, context) => {
49
49
  const headers = sharedHeaders("ListSchemas");
50
50
  let body;
51
- body = JSON.stringify(se_ListSchemasRequest(input, context));
51
+ body = JSON.stringify(_json(input));
52
52
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
53
53
  };
54
54
  export const se_ListStatementsCommand = async (input, context) => {
55
55
  const headers = sharedHeaders("ListStatements");
56
56
  let body;
57
- body = JSON.stringify(se_ListStatementsRequest(input, context));
57
+ body = JSON.stringify(_json(input));
58
58
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
59
59
  };
60
60
  export const se_ListTablesCommand = async (input, context) => {
61
61
  const headers = sharedHeaders("ListTables");
62
62
  let body;
63
- body = JSON.stringify(se_ListTablesRequest(input, context));
63
+ body = JSON.stringify(_json(input));
64
64
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
65
65
  };
66
66
  export const de_BatchExecuteStatementCommand = async (output, context) => {
@@ -74,7 +74,7 @@ export const de_BatchExecuteStatementCommand = async (output, context) => {
74
74
  $metadata: deserializeMetadata(output),
75
75
  ...contents,
76
76
  };
77
- return Promise.resolve(response);
77
+ return response;
78
78
  };
79
79
  const de_BatchExecuteStatementCommandError = async (output, context) => {
80
80
  const parsedOutput = {
@@ -94,10 +94,9 @@ const de_BatchExecuteStatementCommandError = async (output, context) => {
94
94
  throw await de_ValidationExceptionRes(parsedOutput, context);
95
95
  default:
96
96
  const parsedBody = parsedOutput.body;
97
- throwDefaultError({
97
+ return throwDefaultError({
98
98
  output,
99
99
  parsedBody,
100
- exceptionCtor: __BaseException,
101
100
  errorCode,
102
101
  });
103
102
  }
@@ -108,12 +107,12 @@ export const de_CancelStatementCommand = async (output, context) => {
108
107
  }
109
108
  const data = await parseBody(output.body, context);
110
109
  let contents = {};
111
- contents = de_CancelStatementResponse(data, context);
110
+ contents = _json(data);
112
111
  const response = {
113
112
  $metadata: deserializeMetadata(output),
114
113
  ...contents,
115
114
  };
116
- return Promise.resolve(response);
115
+ return response;
117
116
  };
118
117
  const de_CancelStatementCommandError = async (output, context) => {
119
118
  const parsedOutput = {
@@ -136,10 +135,9 @@ const de_CancelStatementCommandError = async (output, context) => {
136
135
  throw await de_ValidationExceptionRes(parsedOutput, context);
137
136
  default:
138
137
  const parsedBody = parsedOutput.body;
139
- throwDefaultError({
138
+ return throwDefaultError({
140
139
  output,
141
140
  parsedBody,
142
- exceptionCtor: __BaseException,
143
141
  errorCode,
144
142
  });
145
143
  }
@@ -155,7 +153,7 @@ export const de_DescribeStatementCommand = async (output, context) => {
155
153
  $metadata: deserializeMetadata(output),
156
154
  ...contents,
157
155
  };
158
- return Promise.resolve(response);
156
+ return response;
159
157
  };
160
158
  const de_DescribeStatementCommandError = async (output, context) => {
161
159
  const parsedOutput = {
@@ -175,10 +173,9 @@ const de_DescribeStatementCommandError = async (output, context) => {
175
173
  throw await de_ValidationExceptionRes(parsedOutput, context);
176
174
  default:
177
175
  const parsedBody = parsedOutput.body;
178
- throwDefaultError({
176
+ return throwDefaultError({
179
177
  output,
180
178
  parsedBody,
181
- exceptionCtor: __BaseException,
182
179
  errorCode,
183
180
  });
184
181
  }
@@ -189,12 +186,12 @@ export const de_DescribeTableCommand = async (output, context) => {
189
186
  }
190
187
  const data = await parseBody(output.body, context);
191
188
  let contents = {};
192
- contents = de_DescribeTableResponse(data, context);
189
+ contents = _json(data);
193
190
  const response = {
194
191
  $metadata: deserializeMetadata(output),
195
192
  ...contents,
196
193
  };
197
- return Promise.resolve(response);
194
+ return response;
198
195
  };
199
196
  const de_DescribeTableCommandError = async (output, context) => {
200
197
  const parsedOutput = {
@@ -214,10 +211,9 @@ const de_DescribeTableCommandError = async (output, context) => {
214
211
  throw await de_ValidationExceptionRes(parsedOutput, context);
215
212
  default:
216
213
  const parsedBody = parsedOutput.body;
217
- throwDefaultError({
214
+ return throwDefaultError({
218
215
  output,
219
216
  parsedBody,
220
- exceptionCtor: __BaseException,
221
217
  errorCode,
222
218
  });
223
219
  }
@@ -233,7 +229,7 @@ export const de_ExecuteStatementCommand = async (output, context) => {
233
229
  $metadata: deserializeMetadata(output),
234
230
  ...contents,
235
231
  };
236
- return Promise.resolve(response);
232
+ return response;
237
233
  };
238
234
  const de_ExecuteStatementCommandError = async (output, context) => {
239
235
  const parsedOutput = {
@@ -253,10 +249,9 @@ const de_ExecuteStatementCommandError = async (output, context) => {
253
249
  throw await de_ValidationExceptionRes(parsedOutput, context);
254
250
  default:
255
251
  const parsedBody = parsedOutput.body;
256
- throwDefaultError({
252
+ return throwDefaultError({
257
253
  output,
258
254
  parsedBody,
259
- exceptionCtor: __BaseException,
260
255
  errorCode,
261
256
  });
262
257
  }
@@ -272,7 +267,7 @@ export const de_GetStatementResultCommand = async (output, context) => {
272
267
  $metadata: deserializeMetadata(output),
273
268
  ...contents,
274
269
  };
275
- return Promise.resolve(response);
270
+ return response;
276
271
  };
277
272
  const de_GetStatementResultCommandError = async (output, context) => {
278
273
  const parsedOutput = {
@@ -292,10 +287,9 @@ const de_GetStatementResultCommandError = async (output, context) => {
292
287
  throw await de_ValidationExceptionRes(parsedOutput, context);
293
288
  default:
294
289
  const parsedBody = parsedOutput.body;
295
- throwDefaultError({
290
+ return throwDefaultError({
296
291
  output,
297
292
  parsedBody,
298
- exceptionCtor: __BaseException,
299
293
  errorCode,
300
294
  });
301
295
  }
@@ -306,12 +300,12 @@ export const de_ListDatabasesCommand = async (output, context) => {
306
300
  }
307
301
  const data = await parseBody(output.body, context);
308
302
  let contents = {};
309
- contents = de_ListDatabasesResponse(data, context);
303
+ contents = _json(data);
310
304
  const response = {
311
305
  $metadata: deserializeMetadata(output),
312
306
  ...contents,
313
307
  };
314
- return Promise.resolve(response);
308
+ return response;
315
309
  };
316
310
  const de_ListDatabasesCommandError = async (output, context) => {
317
311
  const parsedOutput = {
@@ -331,10 +325,9 @@ const de_ListDatabasesCommandError = async (output, context) => {
331
325
  throw await de_ValidationExceptionRes(parsedOutput, context);
332
326
  default:
333
327
  const parsedBody = parsedOutput.body;
334
- throwDefaultError({
328
+ return throwDefaultError({
335
329
  output,
336
330
  parsedBody,
337
- exceptionCtor: __BaseException,
338
331
  errorCode,
339
332
  });
340
333
  }
@@ -345,12 +338,12 @@ export const de_ListSchemasCommand = async (output, context) => {
345
338
  }
346
339
  const data = await parseBody(output.body, context);
347
340
  let contents = {};
348
- contents = de_ListSchemasResponse(data, context);
341
+ contents = _json(data);
349
342
  const response = {
350
343
  $metadata: deserializeMetadata(output),
351
344
  ...contents,
352
345
  };
353
- return Promise.resolve(response);
346
+ return response;
354
347
  };
355
348
  const de_ListSchemasCommandError = async (output, context) => {
356
349
  const parsedOutput = {
@@ -370,10 +363,9 @@ const de_ListSchemasCommandError = async (output, context) => {
370
363
  throw await de_ValidationExceptionRes(parsedOutput, context);
371
364
  default:
372
365
  const parsedBody = parsedOutput.body;
373
- throwDefaultError({
366
+ return throwDefaultError({
374
367
  output,
375
368
  parsedBody,
376
- exceptionCtor: __BaseException,
377
369
  errorCode,
378
370
  });
379
371
  }
@@ -389,7 +381,7 @@ export const de_ListStatementsCommand = async (output, context) => {
389
381
  $metadata: deserializeMetadata(output),
390
382
  ...contents,
391
383
  };
392
- return Promise.resolve(response);
384
+ return response;
393
385
  };
394
386
  const de_ListStatementsCommandError = async (output, context) => {
395
387
  const parsedOutput = {
@@ -406,10 +398,9 @@ const de_ListStatementsCommandError = async (output, context) => {
406
398
  throw await de_ValidationExceptionRes(parsedOutput, context);
407
399
  default:
408
400
  const parsedBody = parsedOutput.body;
409
- throwDefaultError({
401
+ return throwDefaultError({
410
402
  output,
411
403
  parsedBody,
412
- exceptionCtor: __BaseException,
413
404
  errorCode,
414
405
  });
415
406
  }
@@ -420,12 +411,12 @@ export const de_ListTablesCommand = async (output, context) => {
420
411
  }
421
412
  const data = await parseBody(output.body, context);
422
413
  let contents = {};
423
- contents = de_ListTablesResponse(data, context);
414
+ contents = _json(data);
424
415
  const response = {
425
416
  $metadata: deserializeMetadata(output),
426
417
  ...contents,
427
418
  };
428
- return Promise.resolve(response);
419
+ return response;
429
420
  };
430
421
  const de_ListTablesCommandError = async (output, context) => {
431
422
  const parsedOutput = {
@@ -445,17 +436,16 @@ const de_ListTablesCommandError = async (output, context) => {
445
436
  throw await de_ValidationExceptionRes(parsedOutput, context);
446
437
  default:
447
438
  const parsedBody = parsedOutput.body;
448
- throwDefaultError({
439
+ return throwDefaultError({
449
440
  output,
450
441
  parsedBody,
451
- exceptionCtor: __BaseException,
452
442
  errorCode,
453
443
  });
454
444
  }
455
445
  };
456
446
  const de_ActiveStatementsExceededExceptionRes = async (parsedOutput, context) => {
457
447
  const body = parsedOutput.body;
458
- const deserialized = de_ActiveStatementsExceededException(body, context);
448
+ const deserialized = _json(body);
459
449
  const exception = new ActiveStatementsExceededException({
460
450
  $metadata: deserializeMetadata(parsedOutput),
461
451
  ...deserialized,
@@ -464,7 +454,7 @@ const de_ActiveStatementsExceededExceptionRes = async (parsedOutput, context) =>
464
454
  };
465
455
  const de_BatchExecuteStatementExceptionRes = async (parsedOutput, context) => {
466
456
  const body = parsedOutput.body;
467
- const deserialized = de_BatchExecuteStatementException(body, context);
457
+ const deserialized = _json(body);
468
458
  const exception = new BatchExecuteStatementException({
469
459
  $metadata: deserializeMetadata(parsedOutput),
470
460
  ...deserialized,
@@ -473,7 +463,7 @@ const de_BatchExecuteStatementExceptionRes = async (parsedOutput, context) => {
473
463
  };
474
464
  const de_DatabaseConnectionExceptionRes = async (parsedOutput, context) => {
475
465
  const body = parsedOutput.body;
476
- const deserialized = de_DatabaseConnectionException(body, context);
466
+ const deserialized = _json(body);
477
467
  const exception = new DatabaseConnectionException({
478
468
  $metadata: deserializeMetadata(parsedOutput),
479
469
  ...deserialized,
@@ -482,7 +472,7 @@ const de_DatabaseConnectionExceptionRes = async (parsedOutput, context) => {
482
472
  };
483
473
  const de_ExecuteStatementExceptionRes = async (parsedOutput, context) => {
484
474
  const body = parsedOutput.body;
485
- const deserialized = de_ExecuteStatementException(body, context);
475
+ const deserialized = _json(body);
486
476
  const exception = new ExecuteStatementException({
487
477
  $metadata: deserializeMetadata(parsedOutput),
488
478
  ...deserialized,
@@ -491,7 +481,7 @@ const de_ExecuteStatementExceptionRes = async (parsedOutput, context) => {
491
481
  };
492
482
  const de_InternalServerExceptionRes = async (parsedOutput, context) => {
493
483
  const body = parsedOutput.body;
494
- const deserialized = de_InternalServerException(body, context);
484
+ const deserialized = _json(body);
495
485
  const exception = new InternalServerException({
496
486
  $metadata: deserializeMetadata(parsedOutput),
497
487
  ...deserialized,
@@ -500,7 +490,7 @@ const de_InternalServerExceptionRes = async (parsedOutput, context) => {
500
490
  };
501
491
  const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
502
492
  const body = parsedOutput.body;
503
- const deserialized = de_ResourceNotFoundException(body, context);
493
+ const deserialized = _json(body);
504
494
  const exception = new ResourceNotFoundException({
505
495
  $metadata: deserializeMetadata(parsedOutput),
506
496
  ...deserialized,
@@ -509,7 +499,7 @@ const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
509
499
  };
510
500
  const de_ValidationExceptionRes = async (parsedOutput, context) => {
511
501
  const body = parsedOutput.body;
512
- const deserialized = de_ValidationException(body, context);
502
+ const deserialized = _json(body);
513
503
  const exception = new ValidationException({
514
504
  $metadata: deserializeMetadata(parsedOutput),
515
505
  ...deserialized,
@@ -517,257 +507,76 @@ const de_ValidationExceptionRes = async (parsedOutput, context) => {
517
507
  return __decorateServiceException(exception, body);
518
508
  };
519
509
  const se_BatchExecuteStatementInput = (input, context) => {
520
- return {
521
- ClientToken: input.ClientToken ?? generateIdempotencyToken(),
522
- ...(input.ClusterIdentifier != null && { ClusterIdentifier: input.ClusterIdentifier }),
523
- ...(input.Database != null && { Database: input.Database }),
524
- ...(input.DbUser != null && { DbUser: input.DbUser }),
525
- ...(input.SecretArn != null && { SecretArn: input.SecretArn }),
526
- ...(input.Sqls != null && { Sqls: se_SqlList(input.Sqls, context) }),
527
- ...(input.StatementName != null && { StatementName: input.StatementName }),
528
- ...(input.WithEvent != null && { WithEvent: input.WithEvent }),
529
- ...(input.WorkgroupName != null && { WorkgroupName: input.WorkgroupName }),
530
- };
531
- };
532
- const se_CancelStatementRequest = (input, context) => {
533
- return {
534
- ...(input.Id != null && { Id: input.Id }),
535
- };
536
- };
537
- const se_DescribeStatementRequest = (input, context) => {
538
- return {
539
- ...(input.Id != null && { Id: input.Id }),
540
- };
541
- };
542
- const se_DescribeTableRequest = (input, context) => {
543
- return {
544
- ...(input.ClusterIdentifier != null && { ClusterIdentifier: input.ClusterIdentifier }),
545
- ...(input.ConnectedDatabase != null && { ConnectedDatabase: input.ConnectedDatabase }),
546
- ...(input.Database != null && { Database: input.Database }),
547
- ...(input.DbUser != null && { DbUser: input.DbUser }),
548
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
549
- ...(input.NextToken != null && { NextToken: input.NextToken }),
550
- ...(input.Schema != null && { Schema: input.Schema }),
551
- ...(input.SecretArn != null && { SecretArn: input.SecretArn }),
552
- ...(input.Table != null && { Table: input.Table }),
553
- ...(input.WorkgroupName != null && { WorkgroupName: input.WorkgroupName }),
554
- };
555
- };
556
- const se_ExecuteStatementInput = (input, context) => {
557
- return {
558
- ClientToken: input.ClientToken ?? generateIdempotencyToken(),
559
- ...(input.ClusterIdentifier != null && { ClusterIdentifier: input.ClusterIdentifier }),
560
- ...(input.Database != null && { Database: input.Database }),
561
- ...(input.DbUser != null && { DbUser: input.DbUser }),
562
- ...(input.Parameters != null && { Parameters: se_SqlParametersList(input.Parameters, context) }),
563
- ...(input.SecretArn != null && { SecretArn: input.SecretArn }),
564
- ...(input.Sql != null && { Sql: input.Sql }),
565
- ...(input.StatementName != null && { StatementName: input.StatementName }),
566
- ...(input.WithEvent != null && { WithEvent: input.WithEvent }),
567
- ...(input.WorkgroupName != null && { WorkgroupName: input.WorkgroupName }),
568
- };
569
- };
570
- const se_GetStatementResultRequest = (input, context) => {
571
- return {
572
- ...(input.Id != null && { Id: input.Id }),
573
- ...(input.NextToken != null && { NextToken: input.NextToken }),
574
- };
575
- };
576
- const se_ListDatabasesRequest = (input, context) => {
577
- return {
578
- ...(input.ClusterIdentifier != null && { ClusterIdentifier: input.ClusterIdentifier }),
579
- ...(input.Database != null && { Database: input.Database }),
580
- ...(input.DbUser != null && { DbUser: input.DbUser }),
581
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
582
- ...(input.NextToken != null && { NextToken: input.NextToken }),
583
- ...(input.SecretArn != null && { SecretArn: input.SecretArn }),
584
- ...(input.WorkgroupName != null && { WorkgroupName: input.WorkgroupName }),
585
- };
586
- };
587
- const se_ListSchemasRequest = (input, context) => {
588
- return {
589
- ...(input.ClusterIdentifier != null && { ClusterIdentifier: input.ClusterIdentifier }),
590
- ...(input.ConnectedDatabase != null && { ConnectedDatabase: input.ConnectedDatabase }),
591
- ...(input.Database != null && { Database: input.Database }),
592
- ...(input.DbUser != null && { DbUser: input.DbUser }),
593
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
594
- ...(input.NextToken != null && { NextToken: input.NextToken }),
595
- ...(input.SchemaPattern != null && { SchemaPattern: input.SchemaPattern }),
596
- ...(input.SecretArn != null && { SecretArn: input.SecretArn }),
597
- ...(input.WorkgroupName != null && { WorkgroupName: input.WorkgroupName }),
598
- };
599
- };
600
- const se_ListStatementsRequest = (input, context) => {
601
- return {
602
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
603
- ...(input.NextToken != null && { NextToken: input.NextToken }),
604
- ...(input.RoleLevel != null && { RoleLevel: input.RoleLevel }),
605
- ...(input.StatementName != null && { StatementName: input.StatementName }),
606
- ...(input.Status != null && { Status: input.Status }),
607
- };
608
- };
609
- const se_ListTablesRequest = (input, context) => {
610
- return {
611
- ...(input.ClusterIdentifier != null && { ClusterIdentifier: input.ClusterIdentifier }),
612
- ...(input.ConnectedDatabase != null && { ConnectedDatabase: input.ConnectedDatabase }),
613
- ...(input.Database != null && { Database: input.Database }),
614
- ...(input.DbUser != null && { DbUser: input.DbUser }),
615
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
616
- ...(input.NextToken != null && { NextToken: input.NextToken }),
617
- ...(input.SchemaPattern != null && { SchemaPattern: input.SchemaPattern }),
618
- ...(input.SecretArn != null && { SecretArn: input.SecretArn }),
619
- ...(input.TablePattern != null && { TablePattern: input.TablePattern }),
620
- ...(input.WorkgroupName != null && { WorkgroupName: input.WorkgroupName }),
621
- };
622
- };
623
- const se_SqlList = (input, context) => {
624
- return input
625
- .filter((e) => e != null)
626
- .map((entry) => {
627
- return entry;
510
+ return take(input, {
511
+ ClientToken: [true, (_) => _ ?? generateIdempotencyToken()],
512
+ ClusterIdentifier: [],
513
+ Database: [],
514
+ DbUser: [],
515
+ SecretArn: [],
516
+ Sqls: _json,
517
+ StatementName: [],
518
+ WithEvent: [],
519
+ WorkgroupName: [],
628
520
  });
629
521
  };
630
- const se_SqlParameter = (input, context) => {
631
- return {
632
- ...(input.name != null && { name: input.name }),
633
- ...(input.value != null && { value: input.value }),
634
- };
635
- };
636
- const se_SqlParametersList = (input, context) => {
637
- return input
638
- .filter((e) => e != null)
639
- .map((entry) => {
640
- return se_SqlParameter(entry, context);
522
+ const se_ExecuteStatementInput = (input, context) => {
523
+ return take(input, {
524
+ ClientToken: [true, (_) => _ ?? generateIdempotencyToken()],
525
+ ClusterIdentifier: [],
526
+ Database: [],
527
+ DbUser: [],
528
+ Parameters: _json,
529
+ SecretArn: [],
530
+ Sql: [],
531
+ StatementName: [],
532
+ WithEvent: [],
533
+ WorkgroupName: [],
641
534
  });
642
535
  };
643
- const de_ActiveStatementsExceededException = (output, context) => {
644
- return {
645
- Message: __expectString(output.Message),
646
- };
647
- };
648
- const de_BatchExecuteStatementException = (output, context) => {
649
- return {
650
- Message: __expectString(output.Message),
651
- StatementId: __expectString(output.StatementId),
652
- };
653
- };
654
536
  const de_BatchExecuteStatementOutput = (output, context) => {
655
- return {
656
- ClusterIdentifier: __expectString(output.ClusterIdentifier),
657
- CreatedAt: output.CreatedAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreatedAt))) : undefined,
658
- Database: __expectString(output.Database),
659
- DbUser: __expectString(output.DbUser),
660
- Id: __expectString(output.Id),
661
- SecretArn: __expectString(output.SecretArn),
662
- WorkgroupName: __expectString(output.WorkgroupName),
663
- };
664
- };
665
- const de_CancelStatementResponse = (output, context) => {
666
- return {
667
- Status: __expectBoolean(output.Status),
668
- };
669
- };
670
- const de_ColumnList = (output, context) => {
671
- const retVal = (output || [])
672
- .filter((e) => e != null)
673
- .map((entry) => {
674
- if (entry === null) {
675
- return null;
676
- }
677
- return de_ColumnMetadata(entry, context);
678
- });
679
- return retVal;
680
- };
681
- const de_ColumnMetadata = (output, context) => {
682
- return {
683
- columnDefault: __expectString(output.columnDefault),
684
- isCaseSensitive: __expectBoolean(output.isCaseSensitive),
685
- isCurrency: __expectBoolean(output.isCurrency),
686
- isSigned: __expectBoolean(output.isSigned),
687
- label: __expectString(output.label),
688
- length: __expectInt32(output.length),
689
- name: __expectString(output.name),
690
- nullable: __expectInt32(output.nullable),
691
- precision: __expectInt32(output.precision),
692
- scale: __expectInt32(output.scale),
693
- schemaName: __expectString(output.schemaName),
694
- tableName: __expectString(output.tableName),
695
- typeName: __expectString(output.typeName),
696
- };
697
- };
698
- const de_ColumnMetadataList = (output, context) => {
699
- const retVal = (output || [])
700
- .filter((e) => e != null)
701
- .map((entry) => {
702
- if (entry === null) {
703
- return null;
704
- }
705
- return de_ColumnMetadata(entry, context);
537
+ return take(output, {
538
+ ClusterIdentifier: __expectString,
539
+ CreatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
540
+ Database: __expectString,
541
+ DbUser: __expectString,
542
+ Id: __expectString,
543
+ SecretArn: __expectString,
544
+ WorkgroupName: __expectString,
706
545
  });
707
- return retVal;
708
- };
709
- const de_DatabaseConnectionException = (output, context) => {
710
- return {
711
- Message: __expectString(output.Message),
712
- };
713
- };
714
- const de_DatabaseList = (output, context) => {
715
- const retVal = (output || [])
716
- .filter((e) => e != null)
717
- .map((entry) => {
718
- if (entry === null) {
719
- return null;
720
- }
721
- return __expectString(entry);
722
- });
723
- return retVal;
724
546
  };
725
547
  const de_DescribeStatementResponse = (output, context) => {
726
- return {
727
- ClusterIdentifier: __expectString(output.ClusterIdentifier),
728
- CreatedAt: output.CreatedAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreatedAt))) : undefined,
729
- Database: __expectString(output.Database),
730
- DbUser: __expectString(output.DbUser),
731
- Duration: __expectLong(output.Duration),
732
- Error: __expectString(output.Error),
733
- HasResultSet: __expectBoolean(output.HasResultSet),
734
- Id: __expectString(output.Id),
735
- QueryParameters: output.QueryParameters != null ? de_SqlParametersList(output.QueryParameters, context) : undefined,
736
- QueryString: __expectString(output.QueryString),
737
- RedshiftPid: __expectLong(output.RedshiftPid),
738
- RedshiftQueryId: __expectLong(output.RedshiftQueryId),
739
- ResultRows: __expectLong(output.ResultRows),
740
- ResultSize: __expectLong(output.ResultSize),
741
- SecretArn: __expectString(output.SecretArn),
742
- Status: __expectString(output.Status),
743
- SubStatements: output.SubStatements != null ? de_SubStatementList(output.SubStatements, context) : undefined,
744
- UpdatedAt: output.UpdatedAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.UpdatedAt))) : undefined,
745
- WorkgroupName: __expectString(output.WorkgroupName),
746
- };
747
- };
748
- const de_DescribeTableResponse = (output, context) => {
749
- return {
750
- ColumnList: output.ColumnList != null ? de_ColumnList(output.ColumnList, context) : undefined,
751
- NextToken: __expectString(output.NextToken),
752
- TableName: __expectString(output.TableName),
753
- };
754
- };
755
- const de_ExecuteStatementException = (output, context) => {
756
- return {
757
- Message: __expectString(output.Message),
758
- StatementId: __expectString(output.StatementId),
759
- };
548
+ return take(output, {
549
+ ClusterIdentifier: __expectString,
550
+ CreatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
551
+ Database: __expectString,
552
+ DbUser: __expectString,
553
+ Duration: __expectLong,
554
+ Error: __expectString,
555
+ HasResultSet: __expectBoolean,
556
+ Id: __expectString,
557
+ QueryParameters: _json,
558
+ QueryString: __expectString,
559
+ RedshiftPid: __expectLong,
560
+ RedshiftQueryId: __expectLong,
561
+ ResultRows: __expectLong,
562
+ ResultSize: __expectLong,
563
+ SecretArn: __expectString,
564
+ Status: __expectString,
565
+ SubStatements: (_) => de_SubStatementList(_, context),
566
+ UpdatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
567
+ WorkgroupName: __expectString,
568
+ });
760
569
  };
761
570
  const de_ExecuteStatementOutput = (output, context) => {
762
- return {
763
- ClusterIdentifier: __expectString(output.ClusterIdentifier),
764
- CreatedAt: output.CreatedAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreatedAt))) : undefined,
765
- Database: __expectString(output.Database),
766
- DbUser: __expectString(output.DbUser),
767
- Id: __expectString(output.Id),
768
- SecretArn: __expectString(output.SecretArn),
769
- WorkgroupName: __expectString(output.WorkgroupName),
770
- };
571
+ return take(output, {
572
+ ClusterIdentifier: __expectString,
573
+ CreatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
574
+ Database: __expectString,
575
+ DbUser: __expectString,
576
+ Id: __expectString,
577
+ SecretArn: __expectString,
578
+ WorkgroupName: __expectString,
579
+ });
771
580
  };
772
581
  const de_Field = (output, context) => {
773
582
  if (output.blobValue != null) {
@@ -796,180 +605,77 @@ const de_FieldList = (output, context) => {
796
605
  const retVal = (output || [])
797
606
  .filter((e) => e != null)
798
607
  .map((entry) => {
799
- if (entry === null) {
800
- return null;
801
- }
802
608
  return de_Field(__expectUnion(entry), context);
803
609
  });
804
610
  return retVal;
805
611
  };
806
612
  const de_GetStatementResultResponse = (output, context) => {
807
- return {
808
- ColumnMetadata: output.ColumnMetadata != null ? de_ColumnMetadataList(output.ColumnMetadata, context) : undefined,
809
- NextToken: __expectString(output.NextToken),
810
- Records: output.Records != null ? de_SqlRecords(output.Records, context) : undefined,
811
- TotalNumRows: __expectLong(output.TotalNumRows),
812
- };
813
- };
814
- const de_InternalServerException = (output, context) => {
815
- return {
816
- Message: __expectString(output.Message),
817
- };
818
- };
819
- const de_ListDatabasesResponse = (output, context) => {
820
- return {
821
- Databases: output.Databases != null ? de_DatabaseList(output.Databases, context) : undefined,
822
- NextToken: __expectString(output.NextToken),
823
- };
824
- };
825
- const de_ListSchemasResponse = (output, context) => {
826
- return {
827
- NextToken: __expectString(output.NextToken),
828
- Schemas: output.Schemas != null ? de_SchemaList(output.Schemas, context) : undefined,
829
- };
830
- };
831
- const de_ListStatementsResponse = (output, context) => {
832
- return {
833
- NextToken: __expectString(output.NextToken),
834
- Statements: output.Statements != null ? de_StatementList(output.Statements, context) : undefined,
835
- };
836
- };
837
- const de_ListTablesResponse = (output, context) => {
838
- return {
839
- NextToken: __expectString(output.NextToken),
840
- Tables: output.Tables != null ? de_TableList(output.Tables, context) : undefined,
841
- };
842
- };
843
- const de_ResourceNotFoundException = (output, context) => {
844
- return {
845
- Message: __expectString(output.Message),
846
- ResourceId: __expectString(output.ResourceId),
847
- };
848
- };
849
- const de_SchemaList = (output, context) => {
850
- const retVal = (output || [])
851
- .filter((e) => e != null)
852
- .map((entry) => {
853
- if (entry === null) {
854
- return null;
855
- }
856
- return __expectString(entry);
613
+ return take(output, {
614
+ ColumnMetadata: _json,
615
+ NextToken: __expectString,
616
+ Records: (_) => de_SqlRecords(_, context),
617
+ TotalNumRows: __expectLong,
857
618
  });
858
- return retVal;
859
619
  };
860
- const de_SqlParameter = (output, context) => {
861
- return {
862
- name: __expectString(output.name),
863
- value: __expectString(output.value),
864
- };
865
- };
866
- const de_SqlParametersList = (output, context) => {
867
- const retVal = (output || [])
868
- .filter((e) => e != null)
869
- .map((entry) => {
870
- if (entry === null) {
871
- return null;
872
- }
873
- return de_SqlParameter(entry, context);
620
+ const de_ListStatementsResponse = (output, context) => {
621
+ return take(output, {
622
+ NextToken: __expectString,
623
+ Statements: (_) => de_StatementList(_, context),
874
624
  });
875
- return retVal;
876
625
  };
877
626
  const de_SqlRecords = (output, context) => {
878
627
  const retVal = (output || [])
879
628
  .filter((e) => e != null)
880
629
  .map((entry) => {
881
- if (entry === null) {
882
- return null;
883
- }
884
630
  return de_FieldList(entry, context);
885
631
  });
886
632
  return retVal;
887
633
  };
888
634
  const de_StatementData = (output, context) => {
889
- return {
890
- CreatedAt: output.CreatedAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreatedAt))) : undefined,
891
- Id: __expectString(output.Id),
892
- IsBatchStatement: __expectBoolean(output.IsBatchStatement),
893
- QueryParameters: output.QueryParameters != null ? de_SqlParametersList(output.QueryParameters, context) : undefined,
894
- QueryString: __expectString(output.QueryString),
895
- QueryStrings: output.QueryStrings != null ? de_StatementStringList(output.QueryStrings, context) : undefined,
896
- SecretArn: __expectString(output.SecretArn),
897
- StatementName: __expectString(output.StatementName),
898
- Status: __expectString(output.Status),
899
- UpdatedAt: output.UpdatedAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.UpdatedAt))) : undefined,
900
- };
635
+ return take(output, {
636
+ CreatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
637
+ Id: __expectString,
638
+ IsBatchStatement: __expectBoolean,
639
+ QueryParameters: _json,
640
+ QueryString: __expectString,
641
+ QueryStrings: _json,
642
+ SecretArn: __expectString,
643
+ StatementName: __expectString,
644
+ Status: __expectString,
645
+ UpdatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
646
+ });
901
647
  };
902
648
  const de_StatementList = (output, context) => {
903
649
  const retVal = (output || [])
904
650
  .filter((e) => e != null)
905
651
  .map((entry) => {
906
- if (entry === null) {
907
- return null;
908
- }
909
652
  return de_StatementData(entry, context);
910
653
  });
911
654
  return retVal;
912
655
  };
913
- const de_StatementStringList = (output, context) => {
914
- const retVal = (output || [])
915
- .filter((e) => e != null)
916
- .map((entry) => {
917
- if (entry === null) {
918
- return null;
919
- }
920
- return __expectString(entry);
921
- });
922
- return retVal;
923
- };
924
656
  const de_SubStatementData = (output, context) => {
925
- return {
926
- CreatedAt: output.CreatedAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreatedAt))) : undefined,
927
- Duration: __expectLong(output.Duration),
928
- Error: __expectString(output.Error),
929
- HasResultSet: __expectBoolean(output.HasResultSet),
930
- Id: __expectString(output.Id),
931
- QueryString: __expectString(output.QueryString),
932
- RedshiftQueryId: __expectLong(output.RedshiftQueryId),
933
- ResultRows: __expectLong(output.ResultRows),
934
- ResultSize: __expectLong(output.ResultSize),
935
- Status: __expectString(output.Status),
936
- UpdatedAt: output.UpdatedAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.UpdatedAt))) : undefined,
937
- };
657
+ return take(output, {
658
+ CreatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
659
+ Duration: __expectLong,
660
+ Error: __expectString,
661
+ HasResultSet: __expectBoolean,
662
+ Id: __expectString,
663
+ QueryString: __expectString,
664
+ RedshiftQueryId: __expectLong,
665
+ ResultRows: __expectLong,
666
+ ResultSize: __expectLong,
667
+ Status: __expectString,
668
+ UpdatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
669
+ });
938
670
  };
939
671
  const de_SubStatementList = (output, context) => {
940
672
  const retVal = (output || [])
941
673
  .filter((e) => e != null)
942
674
  .map((entry) => {
943
- if (entry === null) {
944
- return null;
945
- }
946
675
  return de_SubStatementData(entry, context);
947
676
  });
948
677
  return retVal;
949
678
  };
950
- const de_TableList = (output, context) => {
951
- const retVal = (output || [])
952
- .filter((e) => e != null)
953
- .map((entry) => {
954
- if (entry === null) {
955
- return null;
956
- }
957
- return de_TableMember(entry, context);
958
- });
959
- return retVal;
960
- };
961
- const de_TableMember = (output, context) => {
962
- return {
963
- name: __expectString(output.name),
964
- schema: __expectString(output.schema),
965
- type: __expectString(output.type),
966
- };
967
- };
968
- const de_ValidationException = (output, context) => {
969
- return {
970
- Message: __expectString(output.Message),
971
- };
972
- };
973
679
  const deserializeMetadata = (output) => ({
974
680
  httpStatusCode: output.statusCode,
975
681
  requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
@@ -983,6 +689,7 @@ const collectBody = (streamBody = new Uint8Array(), context) => {
983
689
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
984
690
  };
985
691
  const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
692
+ const throwDefaultError = withBaseException(__BaseException);
986
693
  const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
987
694
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
988
695
  const contents = {