@aws-sdk/client-redshift-data 3.310.0 → 3.315.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,96 +1,66 @@
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";
6
6
  export const se_BatchExecuteStatementCommand = async (input, context) => {
7
- const headers = {
8
- "content-type": "application/x-amz-json-1.1",
9
- "x-amz-target": "RedshiftData.BatchExecuteStatement",
10
- };
7
+ const headers = sharedHeaders("BatchExecuteStatement");
11
8
  let body;
12
9
  body = JSON.stringify(se_BatchExecuteStatementInput(input, context));
13
10
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
14
11
  };
15
12
  export const se_CancelStatementCommand = async (input, context) => {
16
- const headers = {
17
- "content-type": "application/x-amz-json-1.1",
18
- "x-amz-target": "RedshiftData.CancelStatement",
19
- };
13
+ const headers = sharedHeaders("CancelStatement");
20
14
  let body;
21
- body = JSON.stringify(se_CancelStatementRequest(input, context));
15
+ body = JSON.stringify(_json(input));
22
16
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
23
17
  };
24
18
  export const se_DescribeStatementCommand = async (input, context) => {
25
- const headers = {
26
- "content-type": "application/x-amz-json-1.1",
27
- "x-amz-target": "RedshiftData.DescribeStatement",
28
- };
19
+ const headers = sharedHeaders("DescribeStatement");
29
20
  let body;
30
- body = JSON.stringify(se_DescribeStatementRequest(input, context));
21
+ body = JSON.stringify(_json(input));
31
22
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
32
23
  };
33
24
  export const se_DescribeTableCommand = async (input, context) => {
34
- const headers = {
35
- "content-type": "application/x-amz-json-1.1",
36
- "x-amz-target": "RedshiftData.DescribeTable",
37
- };
25
+ const headers = sharedHeaders("DescribeTable");
38
26
  let body;
39
- body = JSON.stringify(se_DescribeTableRequest(input, context));
27
+ body = JSON.stringify(_json(input));
40
28
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
41
29
  };
42
30
  export const se_ExecuteStatementCommand = async (input, context) => {
43
- const headers = {
44
- "content-type": "application/x-amz-json-1.1",
45
- "x-amz-target": "RedshiftData.ExecuteStatement",
46
- };
31
+ const headers = sharedHeaders("ExecuteStatement");
47
32
  let body;
48
33
  body = JSON.stringify(se_ExecuteStatementInput(input, context));
49
34
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
50
35
  };
51
36
  export const se_GetStatementResultCommand = async (input, context) => {
52
- const headers = {
53
- "content-type": "application/x-amz-json-1.1",
54
- "x-amz-target": "RedshiftData.GetStatementResult",
55
- };
37
+ const headers = sharedHeaders("GetStatementResult");
56
38
  let body;
57
- body = JSON.stringify(se_GetStatementResultRequest(input, context));
39
+ body = JSON.stringify(_json(input));
58
40
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
59
41
  };
60
42
  export const se_ListDatabasesCommand = async (input, context) => {
61
- const headers = {
62
- "content-type": "application/x-amz-json-1.1",
63
- "x-amz-target": "RedshiftData.ListDatabases",
64
- };
43
+ const headers = sharedHeaders("ListDatabases");
65
44
  let body;
66
- body = JSON.stringify(se_ListDatabasesRequest(input, context));
45
+ body = JSON.stringify(_json(input));
67
46
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
68
47
  };
69
48
  export const se_ListSchemasCommand = async (input, context) => {
70
- const headers = {
71
- "content-type": "application/x-amz-json-1.1",
72
- "x-amz-target": "RedshiftData.ListSchemas",
73
- };
49
+ const headers = sharedHeaders("ListSchemas");
74
50
  let body;
75
- body = JSON.stringify(se_ListSchemasRequest(input, context));
51
+ body = JSON.stringify(_json(input));
76
52
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
77
53
  };
78
54
  export const se_ListStatementsCommand = async (input, context) => {
79
- const headers = {
80
- "content-type": "application/x-amz-json-1.1",
81
- "x-amz-target": "RedshiftData.ListStatements",
82
- };
55
+ const headers = sharedHeaders("ListStatements");
83
56
  let body;
84
- body = JSON.stringify(se_ListStatementsRequest(input, context));
57
+ body = JSON.stringify(_json(input));
85
58
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
86
59
  };
87
60
  export const se_ListTablesCommand = async (input, context) => {
88
- const headers = {
89
- "content-type": "application/x-amz-json-1.1",
90
- "x-amz-target": "RedshiftData.ListTables",
91
- };
61
+ const headers = sharedHeaders("ListTables");
92
62
  let body;
93
- body = JSON.stringify(se_ListTablesRequest(input, context));
63
+ body = JSON.stringify(_json(input));
94
64
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
95
65
  };
96
66
  export const de_BatchExecuteStatementCommand = async (output, context) => {
@@ -104,7 +74,7 @@ export const de_BatchExecuteStatementCommand = async (output, context) => {
104
74
  $metadata: deserializeMetadata(output),
105
75
  ...contents,
106
76
  };
107
- return Promise.resolve(response);
77
+ return response;
108
78
  };
109
79
  const de_BatchExecuteStatementCommandError = async (output, context) => {
110
80
  const parsedOutput = {
@@ -124,10 +94,9 @@ const de_BatchExecuteStatementCommandError = async (output, context) => {
124
94
  throw await de_ValidationExceptionRes(parsedOutput, context);
125
95
  default:
126
96
  const parsedBody = parsedOutput.body;
127
- throwDefaultError({
97
+ return throwDefaultError({
128
98
  output,
129
99
  parsedBody,
130
- exceptionCtor: __BaseException,
131
100
  errorCode,
132
101
  });
133
102
  }
@@ -138,12 +107,12 @@ export const de_CancelStatementCommand = async (output, context) => {
138
107
  }
139
108
  const data = await parseBody(output.body, context);
140
109
  let contents = {};
141
- contents = de_CancelStatementResponse(data, context);
110
+ contents = _json(data);
142
111
  const response = {
143
112
  $metadata: deserializeMetadata(output),
144
113
  ...contents,
145
114
  };
146
- return Promise.resolve(response);
115
+ return response;
147
116
  };
148
117
  const de_CancelStatementCommandError = async (output, context) => {
149
118
  const parsedOutput = {
@@ -166,10 +135,9 @@ const de_CancelStatementCommandError = async (output, context) => {
166
135
  throw await de_ValidationExceptionRes(parsedOutput, context);
167
136
  default:
168
137
  const parsedBody = parsedOutput.body;
169
- throwDefaultError({
138
+ return throwDefaultError({
170
139
  output,
171
140
  parsedBody,
172
- exceptionCtor: __BaseException,
173
141
  errorCode,
174
142
  });
175
143
  }
@@ -185,7 +153,7 @@ export const de_DescribeStatementCommand = async (output, context) => {
185
153
  $metadata: deserializeMetadata(output),
186
154
  ...contents,
187
155
  };
188
- return Promise.resolve(response);
156
+ return response;
189
157
  };
190
158
  const de_DescribeStatementCommandError = async (output, context) => {
191
159
  const parsedOutput = {
@@ -205,10 +173,9 @@ const de_DescribeStatementCommandError = async (output, context) => {
205
173
  throw await de_ValidationExceptionRes(parsedOutput, context);
206
174
  default:
207
175
  const parsedBody = parsedOutput.body;
208
- throwDefaultError({
176
+ return throwDefaultError({
209
177
  output,
210
178
  parsedBody,
211
- exceptionCtor: __BaseException,
212
179
  errorCode,
213
180
  });
214
181
  }
@@ -219,12 +186,12 @@ export const de_DescribeTableCommand = async (output, context) => {
219
186
  }
220
187
  const data = await parseBody(output.body, context);
221
188
  let contents = {};
222
- contents = de_DescribeTableResponse(data, context);
189
+ contents = _json(data);
223
190
  const response = {
224
191
  $metadata: deserializeMetadata(output),
225
192
  ...contents,
226
193
  };
227
- return Promise.resolve(response);
194
+ return response;
228
195
  };
229
196
  const de_DescribeTableCommandError = async (output, context) => {
230
197
  const parsedOutput = {
@@ -244,10 +211,9 @@ const de_DescribeTableCommandError = async (output, context) => {
244
211
  throw await de_ValidationExceptionRes(parsedOutput, context);
245
212
  default:
246
213
  const parsedBody = parsedOutput.body;
247
- throwDefaultError({
214
+ return throwDefaultError({
248
215
  output,
249
216
  parsedBody,
250
- exceptionCtor: __BaseException,
251
217
  errorCode,
252
218
  });
253
219
  }
@@ -263,7 +229,7 @@ export const de_ExecuteStatementCommand = async (output, context) => {
263
229
  $metadata: deserializeMetadata(output),
264
230
  ...contents,
265
231
  };
266
- return Promise.resolve(response);
232
+ return response;
267
233
  };
268
234
  const de_ExecuteStatementCommandError = async (output, context) => {
269
235
  const parsedOutput = {
@@ -283,10 +249,9 @@ const de_ExecuteStatementCommandError = async (output, context) => {
283
249
  throw await de_ValidationExceptionRes(parsedOutput, context);
284
250
  default:
285
251
  const parsedBody = parsedOutput.body;
286
- throwDefaultError({
252
+ return throwDefaultError({
287
253
  output,
288
254
  parsedBody,
289
- exceptionCtor: __BaseException,
290
255
  errorCode,
291
256
  });
292
257
  }
@@ -302,7 +267,7 @@ export const de_GetStatementResultCommand = async (output, context) => {
302
267
  $metadata: deserializeMetadata(output),
303
268
  ...contents,
304
269
  };
305
- return Promise.resolve(response);
270
+ return response;
306
271
  };
307
272
  const de_GetStatementResultCommandError = async (output, context) => {
308
273
  const parsedOutput = {
@@ -322,10 +287,9 @@ const de_GetStatementResultCommandError = async (output, context) => {
322
287
  throw await de_ValidationExceptionRes(parsedOutput, context);
323
288
  default:
324
289
  const parsedBody = parsedOutput.body;
325
- throwDefaultError({
290
+ return throwDefaultError({
326
291
  output,
327
292
  parsedBody,
328
- exceptionCtor: __BaseException,
329
293
  errorCode,
330
294
  });
331
295
  }
@@ -336,12 +300,12 @@ export const de_ListDatabasesCommand = async (output, context) => {
336
300
  }
337
301
  const data = await parseBody(output.body, context);
338
302
  let contents = {};
339
- contents = de_ListDatabasesResponse(data, context);
303
+ contents = _json(data);
340
304
  const response = {
341
305
  $metadata: deserializeMetadata(output),
342
306
  ...contents,
343
307
  };
344
- return Promise.resolve(response);
308
+ return response;
345
309
  };
346
310
  const de_ListDatabasesCommandError = async (output, context) => {
347
311
  const parsedOutput = {
@@ -361,10 +325,9 @@ const de_ListDatabasesCommandError = async (output, context) => {
361
325
  throw await de_ValidationExceptionRes(parsedOutput, context);
362
326
  default:
363
327
  const parsedBody = parsedOutput.body;
364
- throwDefaultError({
328
+ return throwDefaultError({
365
329
  output,
366
330
  parsedBody,
367
- exceptionCtor: __BaseException,
368
331
  errorCode,
369
332
  });
370
333
  }
@@ -375,12 +338,12 @@ export const de_ListSchemasCommand = async (output, context) => {
375
338
  }
376
339
  const data = await parseBody(output.body, context);
377
340
  let contents = {};
378
- contents = de_ListSchemasResponse(data, context);
341
+ contents = _json(data);
379
342
  const response = {
380
343
  $metadata: deserializeMetadata(output),
381
344
  ...contents,
382
345
  };
383
- return Promise.resolve(response);
346
+ return response;
384
347
  };
385
348
  const de_ListSchemasCommandError = async (output, context) => {
386
349
  const parsedOutput = {
@@ -400,10 +363,9 @@ const de_ListSchemasCommandError = async (output, context) => {
400
363
  throw await de_ValidationExceptionRes(parsedOutput, context);
401
364
  default:
402
365
  const parsedBody = parsedOutput.body;
403
- throwDefaultError({
366
+ return throwDefaultError({
404
367
  output,
405
368
  parsedBody,
406
- exceptionCtor: __BaseException,
407
369
  errorCode,
408
370
  });
409
371
  }
@@ -419,7 +381,7 @@ export const de_ListStatementsCommand = async (output, context) => {
419
381
  $metadata: deserializeMetadata(output),
420
382
  ...contents,
421
383
  };
422
- return Promise.resolve(response);
384
+ return response;
423
385
  };
424
386
  const de_ListStatementsCommandError = async (output, context) => {
425
387
  const parsedOutput = {
@@ -436,10 +398,9 @@ const de_ListStatementsCommandError = async (output, context) => {
436
398
  throw await de_ValidationExceptionRes(parsedOutput, context);
437
399
  default:
438
400
  const parsedBody = parsedOutput.body;
439
- throwDefaultError({
401
+ return throwDefaultError({
440
402
  output,
441
403
  parsedBody,
442
- exceptionCtor: __BaseException,
443
404
  errorCode,
444
405
  });
445
406
  }
@@ -450,12 +411,12 @@ export const de_ListTablesCommand = async (output, context) => {
450
411
  }
451
412
  const data = await parseBody(output.body, context);
452
413
  let contents = {};
453
- contents = de_ListTablesResponse(data, context);
414
+ contents = _json(data);
454
415
  const response = {
455
416
  $metadata: deserializeMetadata(output),
456
417
  ...contents,
457
418
  };
458
- return Promise.resolve(response);
419
+ return response;
459
420
  };
460
421
  const de_ListTablesCommandError = async (output, context) => {
461
422
  const parsedOutput = {
@@ -475,17 +436,16 @@ const de_ListTablesCommandError = async (output, context) => {
475
436
  throw await de_ValidationExceptionRes(parsedOutput, context);
476
437
  default:
477
438
  const parsedBody = parsedOutput.body;
478
- throwDefaultError({
439
+ return throwDefaultError({
479
440
  output,
480
441
  parsedBody,
481
- exceptionCtor: __BaseException,
482
442
  errorCode,
483
443
  });
484
444
  }
485
445
  };
486
446
  const de_ActiveStatementsExceededExceptionRes = async (parsedOutput, context) => {
487
447
  const body = parsedOutput.body;
488
- const deserialized = de_ActiveStatementsExceededException(body, context);
448
+ const deserialized = _json(body);
489
449
  const exception = new ActiveStatementsExceededException({
490
450
  $metadata: deserializeMetadata(parsedOutput),
491
451
  ...deserialized,
@@ -494,7 +454,7 @@ const de_ActiveStatementsExceededExceptionRes = async (parsedOutput, context) =>
494
454
  };
495
455
  const de_BatchExecuteStatementExceptionRes = async (parsedOutput, context) => {
496
456
  const body = parsedOutput.body;
497
- const deserialized = de_BatchExecuteStatementException(body, context);
457
+ const deserialized = _json(body);
498
458
  const exception = new BatchExecuteStatementException({
499
459
  $metadata: deserializeMetadata(parsedOutput),
500
460
  ...deserialized,
@@ -503,7 +463,7 @@ const de_BatchExecuteStatementExceptionRes = async (parsedOutput, context) => {
503
463
  };
504
464
  const de_DatabaseConnectionExceptionRes = async (parsedOutput, context) => {
505
465
  const body = parsedOutput.body;
506
- const deserialized = de_DatabaseConnectionException(body, context);
466
+ const deserialized = _json(body);
507
467
  const exception = new DatabaseConnectionException({
508
468
  $metadata: deserializeMetadata(parsedOutput),
509
469
  ...deserialized,
@@ -512,7 +472,7 @@ const de_DatabaseConnectionExceptionRes = async (parsedOutput, context) => {
512
472
  };
513
473
  const de_ExecuteStatementExceptionRes = async (parsedOutput, context) => {
514
474
  const body = parsedOutput.body;
515
- const deserialized = de_ExecuteStatementException(body, context);
475
+ const deserialized = _json(body);
516
476
  const exception = new ExecuteStatementException({
517
477
  $metadata: deserializeMetadata(parsedOutput),
518
478
  ...deserialized,
@@ -521,7 +481,7 @@ const de_ExecuteStatementExceptionRes = async (parsedOutput, context) => {
521
481
  };
522
482
  const de_InternalServerExceptionRes = async (parsedOutput, context) => {
523
483
  const body = parsedOutput.body;
524
- const deserialized = de_InternalServerException(body, context);
484
+ const deserialized = _json(body);
525
485
  const exception = new InternalServerException({
526
486
  $metadata: deserializeMetadata(parsedOutput),
527
487
  ...deserialized,
@@ -530,7 +490,7 @@ const de_InternalServerExceptionRes = async (parsedOutput, context) => {
530
490
  };
531
491
  const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
532
492
  const body = parsedOutput.body;
533
- const deserialized = de_ResourceNotFoundException(body, context);
493
+ const deserialized = _json(body);
534
494
  const exception = new ResourceNotFoundException({
535
495
  $metadata: deserializeMetadata(parsedOutput),
536
496
  ...deserialized,
@@ -539,7 +499,7 @@ const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
539
499
  };
540
500
  const de_ValidationExceptionRes = async (parsedOutput, context) => {
541
501
  const body = parsedOutput.body;
542
- const deserialized = de_ValidationException(body, context);
502
+ const deserialized = _json(body);
543
503
  const exception = new ValidationException({
544
504
  $metadata: deserializeMetadata(parsedOutput),
545
505
  ...deserialized,
@@ -547,257 +507,76 @@ const de_ValidationExceptionRes = async (parsedOutput, context) => {
547
507
  return __decorateServiceException(exception, body);
548
508
  };
549
509
  const se_BatchExecuteStatementInput = (input, context) => {
550
- return {
551
- ClientToken: input.ClientToken ?? generateIdempotencyToken(),
552
- ...(input.ClusterIdentifier != null && { ClusterIdentifier: input.ClusterIdentifier }),
553
- ...(input.Database != null && { Database: input.Database }),
554
- ...(input.DbUser != null && { DbUser: input.DbUser }),
555
- ...(input.SecretArn != null && { SecretArn: input.SecretArn }),
556
- ...(input.Sqls != null && { Sqls: se_SqlList(input.Sqls, context) }),
557
- ...(input.StatementName != null && { StatementName: input.StatementName }),
558
- ...(input.WithEvent != null && { WithEvent: input.WithEvent }),
559
- ...(input.WorkgroupName != null && { WorkgroupName: input.WorkgroupName }),
560
- };
561
- };
562
- const se_CancelStatementRequest = (input, context) => {
563
- return {
564
- ...(input.Id != null && { Id: input.Id }),
565
- };
566
- };
567
- const se_DescribeStatementRequest = (input, context) => {
568
- return {
569
- ...(input.Id != null && { Id: input.Id }),
570
- };
571
- };
572
- const se_DescribeTableRequest = (input, context) => {
573
- return {
574
- ...(input.ClusterIdentifier != null && { ClusterIdentifier: input.ClusterIdentifier }),
575
- ...(input.ConnectedDatabase != null && { ConnectedDatabase: input.ConnectedDatabase }),
576
- ...(input.Database != null && { Database: input.Database }),
577
- ...(input.DbUser != null && { DbUser: input.DbUser }),
578
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
579
- ...(input.NextToken != null && { NextToken: input.NextToken }),
580
- ...(input.Schema != null && { Schema: input.Schema }),
581
- ...(input.SecretArn != null && { SecretArn: input.SecretArn }),
582
- ...(input.Table != null && { Table: input.Table }),
583
- ...(input.WorkgroupName != null && { WorkgroupName: input.WorkgroupName }),
584
- };
585
- };
586
- const se_ExecuteStatementInput = (input, context) => {
587
- return {
588
- ClientToken: input.ClientToken ?? generateIdempotencyToken(),
589
- ...(input.ClusterIdentifier != null && { ClusterIdentifier: input.ClusterIdentifier }),
590
- ...(input.Database != null && { Database: input.Database }),
591
- ...(input.DbUser != null && { DbUser: input.DbUser }),
592
- ...(input.Parameters != null && { Parameters: se_SqlParametersList(input.Parameters, context) }),
593
- ...(input.SecretArn != null && { SecretArn: input.SecretArn }),
594
- ...(input.Sql != null && { Sql: input.Sql }),
595
- ...(input.StatementName != null && { StatementName: input.StatementName }),
596
- ...(input.WithEvent != null && { WithEvent: input.WithEvent }),
597
- ...(input.WorkgroupName != null && { WorkgroupName: input.WorkgroupName }),
598
- };
599
- };
600
- const se_GetStatementResultRequest = (input, context) => {
601
- return {
602
- ...(input.Id != null && { Id: input.Id }),
603
- ...(input.NextToken != null && { NextToken: input.NextToken }),
604
- };
605
- };
606
- const se_ListDatabasesRequest = (input, context) => {
607
- return {
608
- ...(input.ClusterIdentifier != null && { ClusterIdentifier: input.ClusterIdentifier }),
609
- ...(input.Database != null && { Database: input.Database }),
610
- ...(input.DbUser != null && { DbUser: input.DbUser }),
611
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
612
- ...(input.NextToken != null && { NextToken: input.NextToken }),
613
- ...(input.SecretArn != null && { SecretArn: input.SecretArn }),
614
- ...(input.WorkgroupName != null && { WorkgroupName: input.WorkgroupName }),
615
- };
616
- };
617
- const se_ListSchemasRequest = (input, context) => {
618
- return {
619
- ...(input.ClusterIdentifier != null && { ClusterIdentifier: input.ClusterIdentifier }),
620
- ...(input.ConnectedDatabase != null && { ConnectedDatabase: input.ConnectedDatabase }),
621
- ...(input.Database != null && { Database: input.Database }),
622
- ...(input.DbUser != null && { DbUser: input.DbUser }),
623
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
624
- ...(input.NextToken != null && { NextToken: input.NextToken }),
625
- ...(input.SchemaPattern != null && { SchemaPattern: input.SchemaPattern }),
626
- ...(input.SecretArn != null && { SecretArn: input.SecretArn }),
627
- ...(input.WorkgroupName != null && { WorkgroupName: input.WorkgroupName }),
628
- };
629
- };
630
- const se_ListStatementsRequest = (input, context) => {
631
- return {
632
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
633
- ...(input.NextToken != null && { NextToken: input.NextToken }),
634
- ...(input.RoleLevel != null && { RoleLevel: input.RoleLevel }),
635
- ...(input.StatementName != null && { StatementName: input.StatementName }),
636
- ...(input.Status != null && { Status: input.Status }),
637
- };
638
- };
639
- const se_ListTablesRequest = (input, context) => {
640
- return {
641
- ...(input.ClusterIdentifier != null && { ClusterIdentifier: input.ClusterIdentifier }),
642
- ...(input.ConnectedDatabase != null && { ConnectedDatabase: input.ConnectedDatabase }),
643
- ...(input.Database != null && { Database: input.Database }),
644
- ...(input.DbUser != null && { DbUser: input.DbUser }),
645
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
646
- ...(input.NextToken != null && { NextToken: input.NextToken }),
647
- ...(input.SchemaPattern != null && { SchemaPattern: input.SchemaPattern }),
648
- ...(input.SecretArn != null && { SecretArn: input.SecretArn }),
649
- ...(input.TablePattern != null && { TablePattern: input.TablePattern }),
650
- ...(input.WorkgroupName != null && { WorkgroupName: input.WorkgroupName }),
651
- };
652
- };
653
- const se_SqlList = (input, context) => {
654
- return input
655
- .filter((e) => e != null)
656
- .map((entry) => {
657
- return entry;
510
+ return take(input, {
511
+ ClientToken: (_) => _ ?? generateIdempotencyToken(),
512
+ ClusterIdentifier: [],
513
+ Database: [],
514
+ DbUser: [],
515
+ SecretArn: [],
516
+ Sqls: _json,
517
+ StatementName: [],
518
+ WithEvent: [],
519
+ WorkgroupName: [],
658
520
  });
659
521
  };
660
- const se_SqlParameter = (input, context) => {
661
- return {
662
- ...(input.name != null && { name: input.name }),
663
- ...(input.value != null && { value: input.value }),
664
- };
665
- };
666
- const se_SqlParametersList = (input, context) => {
667
- return input
668
- .filter((e) => e != null)
669
- .map((entry) => {
670
- return se_SqlParameter(entry, context);
522
+ const se_ExecuteStatementInput = (input, context) => {
523
+ return take(input, {
524
+ ClientToken: (_) => _ ?? generateIdempotencyToken(),
525
+ ClusterIdentifier: [],
526
+ Database: [],
527
+ DbUser: [],
528
+ Parameters: _json,
529
+ SecretArn: [],
530
+ Sql: [],
531
+ StatementName: [],
532
+ WithEvent: [],
533
+ WorkgroupName: [],
671
534
  });
672
535
  };
673
- const de_ActiveStatementsExceededException = (output, context) => {
674
- return {
675
- Message: __expectString(output.Message),
676
- };
677
- };
678
- const de_BatchExecuteStatementException = (output, context) => {
679
- return {
680
- Message: __expectString(output.Message),
681
- StatementId: __expectString(output.StatementId),
682
- };
683
- };
684
536
  const de_BatchExecuteStatementOutput = (output, context) => {
685
- return {
686
- ClusterIdentifier: __expectString(output.ClusterIdentifier),
687
- CreatedAt: output.CreatedAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreatedAt))) : undefined,
688
- Database: __expectString(output.Database),
689
- DbUser: __expectString(output.DbUser),
690
- Id: __expectString(output.Id),
691
- SecretArn: __expectString(output.SecretArn),
692
- WorkgroupName: __expectString(output.WorkgroupName),
693
- };
694
- };
695
- const de_CancelStatementResponse = (output, context) => {
696
- return {
697
- Status: __expectBoolean(output.Status),
698
- };
699
- };
700
- const de_ColumnList = (output, context) => {
701
- const retVal = (output || [])
702
- .filter((e) => e != null)
703
- .map((entry) => {
704
- if (entry === null) {
705
- return null;
706
- }
707
- return de_ColumnMetadata(entry, context);
708
- });
709
- return retVal;
710
- };
711
- const de_ColumnMetadata = (output, context) => {
712
- return {
713
- columnDefault: __expectString(output.columnDefault),
714
- isCaseSensitive: __expectBoolean(output.isCaseSensitive),
715
- isCurrency: __expectBoolean(output.isCurrency),
716
- isSigned: __expectBoolean(output.isSigned),
717
- label: __expectString(output.label),
718
- length: __expectInt32(output.length),
719
- name: __expectString(output.name),
720
- nullable: __expectInt32(output.nullable),
721
- precision: __expectInt32(output.precision),
722
- scale: __expectInt32(output.scale),
723
- schemaName: __expectString(output.schemaName),
724
- tableName: __expectString(output.tableName),
725
- typeName: __expectString(output.typeName),
726
- };
727
- };
728
- const de_ColumnMetadataList = (output, context) => {
729
- const retVal = (output || [])
730
- .filter((e) => e != null)
731
- .map((entry) => {
732
- if (entry === null) {
733
- return null;
734
- }
735
- 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,
736
545
  });
737
- return retVal;
738
- };
739
- const de_DatabaseConnectionException = (output, context) => {
740
- return {
741
- Message: __expectString(output.Message),
742
- };
743
- };
744
- const de_DatabaseList = (output, context) => {
745
- const retVal = (output || [])
746
- .filter((e) => e != null)
747
- .map((entry) => {
748
- if (entry === null) {
749
- return null;
750
- }
751
- return __expectString(entry);
752
- });
753
- return retVal;
754
546
  };
755
547
  const de_DescribeStatementResponse = (output, context) => {
756
- return {
757
- ClusterIdentifier: __expectString(output.ClusterIdentifier),
758
- CreatedAt: output.CreatedAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreatedAt))) : undefined,
759
- Database: __expectString(output.Database),
760
- DbUser: __expectString(output.DbUser),
761
- Duration: __expectLong(output.Duration),
762
- Error: __expectString(output.Error),
763
- HasResultSet: __expectBoolean(output.HasResultSet),
764
- Id: __expectString(output.Id),
765
- QueryParameters: output.QueryParameters != null ? de_SqlParametersList(output.QueryParameters, context) : undefined,
766
- QueryString: __expectString(output.QueryString),
767
- RedshiftPid: __expectLong(output.RedshiftPid),
768
- RedshiftQueryId: __expectLong(output.RedshiftQueryId),
769
- ResultRows: __expectLong(output.ResultRows),
770
- ResultSize: __expectLong(output.ResultSize),
771
- SecretArn: __expectString(output.SecretArn),
772
- Status: __expectString(output.Status),
773
- SubStatements: output.SubStatements != null ? de_SubStatementList(output.SubStatements, context) : undefined,
774
- UpdatedAt: output.UpdatedAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.UpdatedAt))) : undefined,
775
- WorkgroupName: __expectString(output.WorkgroupName),
776
- };
777
- };
778
- const de_DescribeTableResponse = (output, context) => {
779
- return {
780
- ColumnList: output.ColumnList != null ? de_ColumnList(output.ColumnList, context) : undefined,
781
- NextToken: __expectString(output.NextToken),
782
- TableName: __expectString(output.TableName),
783
- };
784
- };
785
- const de_ExecuteStatementException = (output, context) => {
786
- return {
787
- Message: __expectString(output.Message),
788
- StatementId: __expectString(output.StatementId),
789
- };
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
+ });
790
569
  };
791
570
  const de_ExecuteStatementOutput = (output, context) => {
792
- return {
793
- ClusterIdentifier: __expectString(output.ClusterIdentifier),
794
- CreatedAt: output.CreatedAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreatedAt))) : undefined,
795
- Database: __expectString(output.Database),
796
- DbUser: __expectString(output.DbUser),
797
- Id: __expectString(output.Id),
798
- SecretArn: __expectString(output.SecretArn),
799
- WorkgroupName: __expectString(output.WorkgroupName),
800
- };
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
+ });
801
580
  };
802
581
  const de_Field = (output, context) => {
803
582
  if (output.blobValue != null) {
@@ -826,180 +605,77 @@ const de_FieldList = (output, context) => {
826
605
  const retVal = (output || [])
827
606
  .filter((e) => e != null)
828
607
  .map((entry) => {
829
- if (entry === null) {
830
- return null;
831
- }
832
608
  return de_Field(__expectUnion(entry), context);
833
609
  });
834
610
  return retVal;
835
611
  };
836
612
  const de_GetStatementResultResponse = (output, context) => {
837
- return {
838
- ColumnMetadata: output.ColumnMetadata != null ? de_ColumnMetadataList(output.ColumnMetadata, context) : undefined,
839
- NextToken: __expectString(output.NextToken),
840
- Records: output.Records != null ? de_SqlRecords(output.Records, context) : undefined,
841
- TotalNumRows: __expectLong(output.TotalNumRows),
842
- };
843
- };
844
- const de_InternalServerException = (output, context) => {
845
- return {
846
- Message: __expectString(output.Message),
847
- };
848
- };
849
- const de_ListDatabasesResponse = (output, context) => {
850
- return {
851
- Databases: output.Databases != null ? de_DatabaseList(output.Databases, context) : undefined,
852
- NextToken: __expectString(output.NextToken),
853
- };
854
- };
855
- const de_ListSchemasResponse = (output, context) => {
856
- return {
857
- NextToken: __expectString(output.NextToken),
858
- Schemas: output.Schemas != null ? de_SchemaList(output.Schemas, context) : undefined,
859
- };
860
- };
861
- const de_ListStatementsResponse = (output, context) => {
862
- return {
863
- NextToken: __expectString(output.NextToken),
864
- Statements: output.Statements != null ? de_StatementList(output.Statements, context) : undefined,
865
- };
866
- };
867
- const de_ListTablesResponse = (output, context) => {
868
- return {
869
- NextToken: __expectString(output.NextToken),
870
- Tables: output.Tables != null ? de_TableList(output.Tables, context) : undefined,
871
- };
872
- };
873
- const de_ResourceNotFoundException = (output, context) => {
874
- return {
875
- Message: __expectString(output.Message),
876
- ResourceId: __expectString(output.ResourceId),
877
- };
878
- };
879
- const de_SchemaList = (output, context) => {
880
- const retVal = (output || [])
881
- .filter((e) => e != null)
882
- .map((entry) => {
883
- if (entry === null) {
884
- return null;
885
- }
886
- return __expectString(entry);
613
+ return take(output, {
614
+ ColumnMetadata: _json,
615
+ NextToken: __expectString,
616
+ Records: (_) => de_SqlRecords(_, context),
617
+ TotalNumRows: __expectLong,
887
618
  });
888
- return retVal;
889
- };
890
- const de_SqlParameter = (output, context) => {
891
- return {
892
- name: __expectString(output.name),
893
- value: __expectString(output.value),
894
- };
895
619
  };
896
- const de_SqlParametersList = (output, context) => {
897
- const retVal = (output || [])
898
- .filter((e) => e != null)
899
- .map((entry) => {
900
- if (entry === null) {
901
- return null;
902
- }
903
- return de_SqlParameter(entry, context);
620
+ const de_ListStatementsResponse = (output, context) => {
621
+ return take(output, {
622
+ NextToken: __expectString,
623
+ Statements: (_) => de_StatementList(_, context),
904
624
  });
905
- return retVal;
906
625
  };
907
626
  const de_SqlRecords = (output, context) => {
908
627
  const retVal = (output || [])
909
628
  .filter((e) => e != null)
910
629
  .map((entry) => {
911
- if (entry === null) {
912
- return null;
913
- }
914
630
  return de_FieldList(entry, context);
915
631
  });
916
632
  return retVal;
917
633
  };
918
634
  const de_StatementData = (output, context) => {
919
- return {
920
- CreatedAt: output.CreatedAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreatedAt))) : undefined,
921
- Id: __expectString(output.Id),
922
- IsBatchStatement: __expectBoolean(output.IsBatchStatement),
923
- QueryParameters: output.QueryParameters != null ? de_SqlParametersList(output.QueryParameters, context) : undefined,
924
- QueryString: __expectString(output.QueryString),
925
- QueryStrings: output.QueryStrings != null ? de_StatementStringList(output.QueryStrings, context) : undefined,
926
- SecretArn: __expectString(output.SecretArn),
927
- StatementName: __expectString(output.StatementName),
928
- Status: __expectString(output.Status),
929
- UpdatedAt: output.UpdatedAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.UpdatedAt))) : undefined,
930
- };
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
+ });
931
647
  };
932
648
  const de_StatementList = (output, context) => {
933
649
  const retVal = (output || [])
934
650
  .filter((e) => e != null)
935
651
  .map((entry) => {
936
- if (entry === null) {
937
- return null;
938
- }
939
652
  return de_StatementData(entry, context);
940
653
  });
941
654
  return retVal;
942
655
  };
943
- const de_StatementStringList = (output, context) => {
944
- const retVal = (output || [])
945
- .filter((e) => e != null)
946
- .map((entry) => {
947
- if (entry === null) {
948
- return null;
949
- }
950
- return __expectString(entry);
951
- });
952
- return retVal;
953
- };
954
656
  const de_SubStatementData = (output, context) => {
955
- return {
956
- CreatedAt: output.CreatedAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreatedAt))) : undefined,
957
- Duration: __expectLong(output.Duration),
958
- Error: __expectString(output.Error),
959
- HasResultSet: __expectBoolean(output.HasResultSet),
960
- Id: __expectString(output.Id),
961
- QueryString: __expectString(output.QueryString),
962
- RedshiftQueryId: __expectLong(output.RedshiftQueryId),
963
- ResultRows: __expectLong(output.ResultRows),
964
- ResultSize: __expectLong(output.ResultSize),
965
- Status: __expectString(output.Status),
966
- UpdatedAt: output.UpdatedAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.UpdatedAt))) : undefined,
967
- };
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
+ });
968
670
  };
969
671
  const de_SubStatementList = (output, context) => {
970
672
  const retVal = (output || [])
971
673
  .filter((e) => e != null)
972
674
  .map((entry) => {
973
- if (entry === null) {
974
- return null;
975
- }
976
675
  return de_SubStatementData(entry, context);
977
676
  });
978
677
  return retVal;
979
678
  };
980
- const de_TableList = (output, context) => {
981
- const retVal = (output || [])
982
- .filter((e) => e != null)
983
- .map((entry) => {
984
- if (entry === null) {
985
- return null;
986
- }
987
- return de_TableMember(entry, context);
988
- });
989
- return retVal;
990
- };
991
- const de_TableMember = (output, context) => {
992
- return {
993
- name: __expectString(output.name),
994
- schema: __expectString(output.schema),
995
- type: __expectString(output.type),
996
- };
997
- };
998
- const de_ValidationException = (output, context) => {
999
- return {
1000
- Message: __expectString(output.Message),
1001
- };
1002
- };
1003
679
  const deserializeMetadata = (output) => ({
1004
680
  httpStatusCode: output.statusCode,
1005
681
  requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
@@ -1013,6 +689,7 @@ const collectBody = (streamBody = new Uint8Array(), context) => {
1013
689
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
1014
690
  };
1015
691
  const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
692
+ const throwDefaultError = withBaseException(__BaseException);
1016
693
  const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
1017
694
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
1018
695
  const contents = {
@@ -1031,6 +708,12 @@ const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, bod
1031
708
  }
1032
709
  return new __HttpRequest(contents);
1033
710
  };
711
+ function sharedHeaders(operation) {
712
+ return {
713
+ "content-type": "application/x-amz-json-1.1",
714
+ "x-amz-target": `RedshiftData.${operation}`,
715
+ };
716
+ }
1034
717
  const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1035
718
  if (encoded.length) {
1036
719
  return JSON.parse(encoded);