@aws-sdk/client-rds-data 3.928.0 → 3.929.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,740 +0,0 @@
1
- import { awsExpectUnion as __expectUnion, loadRestJsonErrorCode, parseJsonBody as parseBody, parseJsonErrorBody as parseErrorBody, } from "@aws-sdk/core";
2
- import { requestBuilder as rb } from "@smithy/core";
3
- import { _json, collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectLong as __expectLong, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, limitedParseDouble as __limitedParseDouble, limitedParseFloat32 as __limitedParseFloat32, map, serializeFloat as __serializeFloat, take, withBaseException, } from "@smithy/smithy-client";
4
- import { AccessDeniedException, ArrayValue, BadRequestException, DatabaseErrorException, DatabaseNotFoundException, DatabaseResumingException, DatabaseUnavailableException, Field, ForbiddenException, HttpEndpointNotEnabledException, InternalServerErrorException, InvalidResourceStateException, InvalidSecretException, NotFoundException, SecretsErrorException, ServiceUnavailableError, StatementTimeoutException, TransactionNotFoundException, UnsupportedResultException, } from "../models/models_0";
5
- import { RDSDataServiceException as __BaseException } from "../models/RDSDataServiceException";
6
- export const se_BatchExecuteStatementCommand = async (input, context) => {
7
- const b = rb(input, context);
8
- const headers = {
9
- "content-type": "application/json",
10
- };
11
- b.bp("/BatchExecute");
12
- let body;
13
- body = JSON.stringify(take(input, {
14
- database: [],
15
- parameterSets: (_) => se_SqlParameterSets(_, context),
16
- resourceArn: [],
17
- schema: [],
18
- secretArn: [],
19
- sql: [],
20
- transactionId: [],
21
- }));
22
- b.m("POST").h(headers).b(body);
23
- return b.build();
24
- };
25
- export const se_BeginTransactionCommand = async (input, context) => {
26
- const b = rb(input, context);
27
- const headers = {
28
- "content-type": "application/json",
29
- };
30
- b.bp("/BeginTransaction");
31
- let body;
32
- body = JSON.stringify(take(input, {
33
- database: [],
34
- resourceArn: [],
35
- schema: [],
36
- secretArn: [],
37
- }));
38
- b.m("POST").h(headers).b(body);
39
- return b.build();
40
- };
41
- export const se_CommitTransactionCommand = async (input, context) => {
42
- const b = rb(input, context);
43
- const headers = {
44
- "content-type": "application/json",
45
- };
46
- b.bp("/CommitTransaction");
47
- let body;
48
- body = JSON.stringify(take(input, {
49
- resourceArn: [],
50
- secretArn: [],
51
- transactionId: [],
52
- }));
53
- b.m("POST").h(headers).b(body);
54
- return b.build();
55
- };
56
- export const se_ExecuteSqlCommand = async (input, context) => {
57
- const b = rb(input, context);
58
- const headers = {
59
- "content-type": "application/json",
60
- };
61
- b.bp("/ExecuteSql");
62
- let body;
63
- body = JSON.stringify(take(input, {
64
- awsSecretStoreArn: [],
65
- database: [],
66
- dbClusterOrInstanceArn: [],
67
- schema: [],
68
- sqlStatements: [],
69
- }));
70
- b.m("POST").h(headers).b(body);
71
- return b.build();
72
- };
73
- export const se_ExecuteStatementCommand = async (input, context) => {
74
- const b = rb(input, context);
75
- const headers = {
76
- "content-type": "application/json",
77
- };
78
- b.bp("/Execute");
79
- let body;
80
- body = JSON.stringify(take(input, {
81
- continueAfterTimeout: [],
82
- database: [],
83
- formatRecordsAs: [],
84
- includeResultMetadata: [],
85
- parameters: (_) => se_SqlParametersList(_, context),
86
- resourceArn: [],
87
- resultSetOptions: (_) => _json(_),
88
- schema: [],
89
- secretArn: [],
90
- sql: [],
91
- transactionId: [],
92
- }));
93
- b.m("POST").h(headers).b(body);
94
- return b.build();
95
- };
96
- export const se_RollbackTransactionCommand = async (input, context) => {
97
- const b = rb(input, context);
98
- const headers = {
99
- "content-type": "application/json",
100
- };
101
- b.bp("/RollbackTransaction");
102
- let body;
103
- body = JSON.stringify(take(input, {
104
- resourceArn: [],
105
- secretArn: [],
106
- transactionId: [],
107
- }));
108
- b.m("POST").h(headers).b(body);
109
- return b.build();
110
- };
111
- export const de_BatchExecuteStatementCommand = async (output, context) => {
112
- if (output.statusCode !== 200 && output.statusCode >= 300) {
113
- return de_CommandError(output, context);
114
- }
115
- const contents = map({
116
- $metadata: deserializeMetadata(output),
117
- });
118
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
119
- const doc = take(data, {
120
- updateResults: (_) => de_UpdateResults(_, context),
121
- });
122
- Object.assign(contents, doc);
123
- return contents;
124
- };
125
- export const de_BeginTransactionCommand = async (output, context) => {
126
- if (output.statusCode !== 200 && output.statusCode >= 300) {
127
- return de_CommandError(output, context);
128
- }
129
- const contents = map({
130
- $metadata: deserializeMetadata(output),
131
- });
132
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
133
- const doc = take(data, {
134
- transactionId: __expectString,
135
- });
136
- Object.assign(contents, doc);
137
- return contents;
138
- };
139
- export const de_CommitTransactionCommand = async (output, context) => {
140
- if (output.statusCode !== 200 && output.statusCode >= 300) {
141
- return de_CommandError(output, context);
142
- }
143
- const contents = map({
144
- $metadata: deserializeMetadata(output),
145
- });
146
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
147
- const doc = take(data, {
148
- transactionStatus: __expectString,
149
- });
150
- Object.assign(contents, doc);
151
- return contents;
152
- };
153
- export const de_ExecuteSqlCommand = async (output, context) => {
154
- if (output.statusCode !== 200 && output.statusCode >= 300) {
155
- return de_CommandError(output, context);
156
- }
157
- const contents = map({
158
- $metadata: deserializeMetadata(output),
159
- });
160
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
161
- const doc = take(data, {
162
- sqlStatementResults: (_) => de_SqlStatementResults(_, context),
163
- });
164
- Object.assign(contents, doc);
165
- return contents;
166
- };
167
- export const de_ExecuteStatementCommand = async (output, context) => {
168
- if (output.statusCode !== 200 && output.statusCode >= 300) {
169
- return de_CommandError(output, context);
170
- }
171
- const contents = map({
172
- $metadata: deserializeMetadata(output),
173
- });
174
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
175
- const doc = take(data, {
176
- columnMetadata: _json,
177
- formattedRecords: __expectString,
178
- generatedFields: (_) => de_FieldList(_, context),
179
- numberOfRecordsUpdated: __expectLong,
180
- records: (_) => de_SqlRecords(_, context),
181
- });
182
- Object.assign(contents, doc);
183
- return contents;
184
- };
185
- export const de_RollbackTransactionCommand = async (output, context) => {
186
- if (output.statusCode !== 200 && output.statusCode >= 300) {
187
- return de_CommandError(output, context);
188
- }
189
- const contents = map({
190
- $metadata: deserializeMetadata(output),
191
- });
192
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
193
- const doc = take(data, {
194
- transactionStatus: __expectString,
195
- });
196
- Object.assign(contents, doc);
197
- return contents;
198
- };
199
- const de_CommandError = async (output, context) => {
200
- const parsedOutput = {
201
- ...output,
202
- body: await parseErrorBody(output.body, context),
203
- };
204
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
205
- switch (errorCode) {
206
- case "AccessDeniedException":
207
- case "com.amazonaws.rdsdata#AccessDeniedException":
208
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
209
- case "BadRequestException":
210
- case "com.amazonaws.rdsdata#BadRequestException":
211
- throw await de_BadRequestExceptionRes(parsedOutput, context);
212
- case "DatabaseErrorException":
213
- case "com.amazonaws.rdsdata#DatabaseErrorException":
214
- throw await de_DatabaseErrorExceptionRes(parsedOutput, context);
215
- case "DatabaseNotFoundException":
216
- case "com.amazonaws.rdsdata#DatabaseNotFoundException":
217
- throw await de_DatabaseNotFoundExceptionRes(parsedOutput, context);
218
- case "DatabaseResumingException":
219
- case "com.amazonaws.rdsdata#DatabaseResumingException":
220
- throw await de_DatabaseResumingExceptionRes(parsedOutput, context);
221
- case "DatabaseUnavailableException":
222
- case "com.amazonaws.rdsdata#DatabaseUnavailableException":
223
- throw await de_DatabaseUnavailableExceptionRes(parsedOutput, context);
224
- case "ForbiddenException":
225
- case "com.amazonaws.rdsdata#ForbiddenException":
226
- throw await de_ForbiddenExceptionRes(parsedOutput, context);
227
- case "HttpEndpointNotEnabledException":
228
- case "com.amazonaws.rdsdata#HttpEndpointNotEnabledException":
229
- throw await de_HttpEndpointNotEnabledExceptionRes(parsedOutput, context);
230
- case "InternalServerErrorException":
231
- case "com.amazonaws.rdsdata#InternalServerErrorException":
232
- throw await de_InternalServerErrorExceptionRes(parsedOutput, context);
233
- case "InvalidResourceStateException":
234
- case "com.amazonaws.rdsdata#InvalidResourceStateException":
235
- throw await de_InvalidResourceStateExceptionRes(parsedOutput, context);
236
- case "InvalidSecretException":
237
- case "com.amazonaws.rdsdata#InvalidSecretException":
238
- throw await de_InvalidSecretExceptionRes(parsedOutput, context);
239
- case "SecretsErrorException":
240
- case "com.amazonaws.rdsdata#SecretsErrorException":
241
- throw await de_SecretsErrorExceptionRes(parsedOutput, context);
242
- case "ServiceUnavailableError":
243
- case "com.amazonaws.rdsdata#ServiceUnavailableError":
244
- throw await de_ServiceUnavailableErrorRes(parsedOutput, context);
245
- case "StatementTimeoutException":
246
- case "com.amazonaws.rdsdata#StatementTimeoutException":
247
- throw await de_StatementTimeoutExceptionRes(parsedOutput, context);
248
- case "TransactionNotFoundException":
249
- case "com.amazonaws.rdsdata#TransactionNotFoundException":
250
- throw await de_TransactionNotFoundExceptionRes(parsedOutput, context);
251
- case "NotFoundException":
252
- case "com.amazonaws.rdsdata#NotFoundException":
253
- throw await de_NotFoundExceptionRes(parsedOutput, context);
254
- case "UnsupportedResultException":
255
- case "com.amazonaws.rdsdata#UnsupportedResultException":
256
- throw await de_UnsupportedResultExceptionRes(parsedOutput, context);
257
- default:
258
- const parsedBody = parsedOutput.body;
259
- return throwDefaultError({
260
- output,
261
- parsedBody,
262
- errorCode,
263
- });
264
- }
265
- };
266
- const throwDefaultError = withBaseException(__BaseException);
267
- const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
268
- const contents = map({});
269
- const data = parsedOutput.body;
270
- const doc = take(data, {
271
- message: __expectString,
272
- });
273
- Object.assign(contents, doc);
274
- const exception = new AccessDeniedException({
275
- $metadata: deserializeMetadata(parsedOutput),
276
- ...contents,
277
- });
278
- return __decorateServiceException(exception, parsedOutput.body);
279
- };
280
- const de_BadRequestExceptionRes = async (parsedOutput, context) => {
281
- const contents = map({});
282
- const data = parsedOutput.body;
283
- const doc = take(data, {
284
- message: __expectString,
285
- });
286
- Object.assign(contents, doc);
287
- const exception = new BadRequestException({
288
- $metadata: deserializeMetadata(parsedOutput),
289
- ...contents,
290
- });
291
- return __decorateServiceException(exception, parsedOutput.body);
292
- };
293
- const de_DatabaseErrorExceptionRes = async (parsedOutput, context) => {
294
- const contents = map({});
295
- const data = parsedOutput.body;
296
- const doc = take(data, {
297
- message: __expectString,
298
- });
299
- Object.assign(contents, doc);
300
- const exception = new DatabaseErrorException({
301
- $metadata: deserializeMetadata(parsedOutput),
302
- ...contents,
303
- });
304
- return __decorateServiceException(exception, parsedOutput.body);
305
- };
306
- const de_DatabaseNotFoundExceptionRes = async (parsedOutput, context) => {
307
- const contents = map({});
308
- const data = parsedOutput.body;
309
- const doc = take(data, {
310
- message: __expectString,
311
- });
312
- Object.assign(contents, doc);
313
- const exception = new DatabaseNotFoundException({
314
- $metadata: deserializeMetadata(parsedOutput),
315
- ...contents,
316
- });
317
- return __decorateServiceException(exception, parsedOutput.body);
318
- };
319
- const de_DatabaseResumingExceptionRes = async (parsedOutput, context) => {
320
- const contents = map({});
321
- const data = parsedOutput.body;
322
- const doc = take(data, {
323
- message: __expectString,
324
- });
325
- Object.assign(contents, doc);
326
- const exception = new DatabaseResumingException({
327
- $metadata: deserializeMetadata(parsedOutput),
328
- ...contents,
329
- });
330
- return __decorateServiceException(exception, parsedOutput.body);
331
- };
332
- const de_DatabaseUnavailableExceptionRes = async (parsedOutput, context) => {
333
- const contents = map({});
334
- const data = parsedOutput.body;
335
- const doc = take(data, {});
336
- Object.assign(contents, doc);
337
- const exception = new DatabaseUnavailableException({
338
- $metadata: deserializeMetadata(parsedOutput),
339
- ...contents,
340
- });
341
- return __decorateServiceException(exception, parsedOutput.body);
342
- };
343
- const de_ForbiddenExceptionRes = async (parsedOutput, context) => {
344
- const contents = map({});
345
- const data = parsedOutput.body;
346
- const doc = take(data, {
347
- message: __expectString,
348
- });
349
- Object.assign(contents, doc);
350
- const exception = new ForbiddenException({
351
- $metadata: deserializeMetadata(parsedOutput),
352
- ...contents,
353
- });
354
- return __decorateServiceException(exception, parsedOutput.body);
355
- };
356
- const de_HttpEndpointNotEnabledExceptionRes = async (parsedOutput, context) => {
357
- const contents = map({});
358
- const data = parsedOutput.body;
359
- const doc = take(data, {
360
- message: __expectString,
361
- });
362
- Object.assign(contents, doc);
363
- const exception = new HttpEndpointNotEnabledException({
364
- $metadata: deserializeMetadata(parsedOutput),
365
- ...contents,
366
- });
367
- return __decorateServiceException(exception, parsedOutput.body);
368
- };
369
- const de_InternalServerErrorExceptionRes = async (parsedOutput, context) => {
370
- const contents = map({});
371
- const data = parsedOutput.body;
372
- const doc = take(data, {});
373
- Object.assign(contents, doc);
374
- const exception = new InternalServerErrorException({
375
- $metadata: deserializeMetadata(parsedOutput),
376
- ...contents,
377
- });
378
- return __decorateServiceException(exception, parsedOutput.body);
379
- };
380
- const de_InvalidResourceStateExceptionRes = async (parsedOutput, context) => {
381
- const contents = map({});
382
- const data = parsedOutput.body;
383
- const doc = take(data, {
384
- message: __expectString,
385
- });
386
- Object.assign(contents, doc);
387
- const exception = new InvalidResourceStateException({
388
- $metadata: deserializeMetadata(parsedOutput),
389
- ...contents,
390
- });
391
- return __decorateServiceException(exception, parsedOutput.body);
392
- };
393
- const de_InvalidSecretExceptionRes = async (parsedOutput, context) => {
394
- const contents = map({});
395
- const data = parsedOutput.body;
396
- const doc = take(data, {
397
- message: __expectString,
398
- });
399
- Object.assign(contents, doc);
400
- const exception = new InvalidSecretException({
401
- $metadata: deserializeMetadata(parsedOutput),
402
- ...contents,
403
- });
404
- return __decorateServiceException(exception, parsedOutput.body);
405
- };
406
- const de_NotFoundExceptionRes = async (parsedOutput, context) => {
407
- const contents = map({});
408
- const data = parsedOutput.body;
409
- const doc = take(data, {
410
- message: __expectString,
411
- });
412
- Object.assign(contents, doc);
413
- const exception = new NotFoundException({
414
- $metadata: deserializeMetadata(parsedOutput),
415
- ...contents,
416
- });
417
- return __decorateServiceException(exception, parsedOutput.body);
418
- };
419
- const de_SecretsErrorExceptionRes = async (parsedOutput, context) => {
420
- const contents = map({});
421
- const data = parsedOutput.body;
422
- const doc = take(data, {
423
- message: __expectString,
424
- });
425
- Object.assign(contents, doc);
426
- const exception = new SecretsErrorException({
427
- $metadata: deserializeMetadata(parsedOutput),
428
- ...contents,
429
- });
430
- return __decorateServiceException(exception, parsedOutput.body);
431
- };
432
- const de_ServiceUnavailableErrorRes = async (parsedOutput, context) => {
433
- const contents = map({});
434
- const data = parsedOutput.body;
435
- const doc = take(data, {});
436
- Object.assign(contents, doc);
437
- const exception = new ServiceUnavailableError({
438
- $metadata: deserializeMetadata(parsedOutput),
439
- ...contents,
440
- });
441
- return __decorateServiceException(exception, parsedOutput.body);
442
- };
443
- const de_StatementTimeoutExceptionRes = async (parsedOutput, context) => {
444
- const contents = map({});
445
- const data = parsedOutput.body;
446
- const doc = take(data, {
447
- dbConnectionId: __expectLong,
448
- message: __expectString,
449
- });
450
- Object.assign(contents, doc);
451
- const exception = new StatementTimeoutException({
452
- $metadata: deserializeMetadata(parsedOutput),
453
- ...contents,
454
- });
455
- return __decorateServiceException(exception, parsedOutput.body);
456
- };
457
- const de_TransactionNotFoundExceptionRes = async (parsedOutput, context) => {
458
- const contents = map({});
459
- const data = parsedOutput.body;
460
- const doc = take(data, {
461
- message: __expectString,
462
- });
463
- Object.assign(contents, doc);
464
- const exception = new TransactionNotFoundException({
465
- $metadata: deserializeMetadata(parsedOutput),
466
- ...contents,
467
- });
468
- return __decorateServiceException(exception, parsedOutput.body);
469
- };
470
- const de_UnsupportedResultExceptionRes = async (parsedOutput, context) => {
471
- const contents = map({});
472
- const data = parsedOutput.body;
473
- const doc = take(data, {
474
- message: __expectString,
475
- });
476
- Object.assign(contents, doc);
477
- const exception = new UnsupportedResultException({
478
- $metadata: deserializeMetadata(parsedOutput),
479
- ...contents,
480
- });
481
- return __decorateServiceException(exception, parsedOutput.body);
482
- };
483
- const se_ArrayOfArray = (input, context) => {
484
- return input
485
- .filter((e) => e != null)
486
- .map((entry) => {
487
- return se_ArrayValue(entry, context);
488
- });
489
- };
490
- const se_ArrayValue = (input, context) => {
491
- return ArrayValue.visit(input, {
492
- arrayValues: (value) => ({ arrayValues: se_ArrayOfArray(value, context) }),
493
- booleanValues: (value) => ({ booleanValues: _json(value) }),
494
- doubleValues: (value) => ({ doubleValues: se_DoubleArray(value, context) }),
495
- longValues: (value) => ({ longValues: _json(value) }),
496
- stringValues: (value) => ({ stringValues: _json(value) }),
497
- _: (name, value) => ({ [name]: value }),
498
- });
499
- };
500
- const se_DoubleArray = (input, context) => {
501
- return input
502
- .filter((e) => e != null)
503
- .map((entry) => {
504
- return __serializeFloat(entry);
505
- });
506
- };
507
- const se_Field = (input, context) => {
508
- return Field.visit(input, {
509
- arrayValue: (value) => ({ arrayValue: se_ArrayValue(value, context) }),
510
- blobValue: (value) => ({ blobValue: context.base64Encoder(value) }),
511
- booleanValue: (value) => ({ booleanValue: value }),
512
- doubleValue: (value) => ({ doubleValue: __serializeFloat(value) }),
513
- isNull: (value) => ({ isNull: value }),
514
- longValue: (value) => ({ longValue: value }),
515
- stringValue: (value) => ({ stringValue: value }),
516
- _: (name, value) => ({ [name]: value }),
517
- });
518
- };
519
- const se_SqlParameter = (input, context) => {
520
- return take(input, {
521
- name: [],
522
- typeHint: [],
523
- value: (_) => se_Field(_, context),
524
- });
525
- };
526
- const se_SqlParameterSets = (input, context) => {
527
- return input
528
- .filter((e) => e != null)
529
- .map((entry) => {
530
- return se_SqlParametersList(entry, context);
531
- });
532
- };
533
- const se_SqlParametersList = (input, context) => {
534
- return input
535
- .filter((e) => e != null)
536
- .map((entry) => {
537
- return se_SqlParameter(entry, context);
538
- });
539
- };
540
- const de_ArrayOfArray = (output, context) => {
541
- const retVal = (output || [])
542
- .filter((e) => e != null)
543
- .map((entry) => {
544
- return de_ArrayValue(__expectUnion(entry), context);
545
- });
546
- return retVal;
547
- };
548
- const de_ArrayValue = (output, context) => {
549
- if (output.arrayValues != null) {
550
- return {
551
- arrayValues: de_ArrayOfArray(output.arrayValues, context),
552
- };
553
- }
554
- if (output.booleanValues != null) {
555
- return {
556
- booleanValues: _json(output.booleanValues),
557
- };
558
- }
559
- if (output.doubleValues != null) {
560
- return {
561
- doubleValues: de_DoubleArray(output.doubleValues, context),
562
- };
563
- }
564
- if (output.longValues != null) {
565
- return {
566
- longValues: _json(output.longValues),
567
- };
568
- }
569
- if (output.stringValues != null) {
570
- return {
571
- stringValues: _json(output.stringValues),
572
- };
573
- }
574
- return { $unknown: Object.entries(output)[0] };
575
- };
576
- const de_ArrayValueList = (output, context) => {
577
- const retVal = (output || [])
578
- .filter((e) => e != null)
579
- .map((entry) => {
580
- return de_Value(__expectUnion(entry), context);
581
- });
582
- return retVal;
583
- };
584
- const de_DoubleArray = (output, context) => {
585
- const retVal = (output || [])
586
- .filter((e) => e != null)
587
- .map((entry) => {
588
- return __limitedParseDouble(entry);
589
- });
590
- return retVal;
591
- };
592
- const de_Field = (output, context) => {
593
- if (output.arrayValue != null) {
594
- return {
595
- arrayValue: de_ArrayValue(__expectUnion(output.arrayValue), context),
596
- };
597
- }
598
- if (output.blobValue != null) {
599
- return {
600
- blobValue: context.base64Decoder(output.blobValue),
601
- };
602
- }
603
- if (__expectBoolean(output.booleanValue) !== undefined) {
604
- return { booleanValue: __expectBoolean(output.booleanValue) };
605
- }
606
- if (__limitedParseDouble(output.doubleValue) !== undefined) {
607
- return { doubleValue: __limitedParseDouble(output.doubleValue) };
608
- }
609
- if (__expectBoolean(output.isNull) !== undefined) {
610
- return { isNull: __expectBoolean(output.isNull) };
611
- }
612
- if (__expectLong(output.longValue) !== undefined) {
613
- return { longValue: __expectLong(output.longValue) };
614
- }
615
- if (__expectString(output.stringValue) !== undefined) {
616
- return { stringValue: __expectString(output.stringValue) };
617
- }
618
- return { $unknown: Object.entries(output)[0] };
619
- };
620
- const de_FieldList = (output, context) => {
621
- const retVal = (output || [])
622
- .filter((e) => e != null)
623
- .map((entry) => {
624
- return de_Field(__expectUnion(entry), context);
625
- });
626
- return retVal;
627
- };
628
- const de__Record = (output, context) => {
629
- return take(output, {
630
- values: (_) => de_Row(_, context),
631
- });
632
- };
633
- const de_Records = (output, context) => {
634
- const retVal = (output || [])
635
- .filter((e) => e != null)
636
- .map((entry) => {
637
- return de__Record(entry, context);
638
- });
639
- return retVal;
640
- };
641
- const de_ResultFrame = (output, context) => {
642
- return take(output, {
643
- records: (_) => de_Records(_, context),
644
- resultSetMetadata: _json,
645
- });
646
- };
647
- const de_Row = (output, context) => {
648
- const retVal = (output || [])
649
- .filter((e) => e != null)
650
- .map((entry) => {
651
- return de_Value(__expectUnion(entry), context);
652
- });
653
- return retVal;
654
- };
655
- const de_SqlRecords = (output, context) => {
656
- const retVal = (output || [])
657
- .filter((e) => e != null)
658
- .map((entry) => {
659
- return de_FieldList(entry, context);
660
- });
661
- return retVal;
662
- };
663
- const de_SqlStatementResult = (output, context) => {
664
- return take(output, {
665
- numberOfRecordsUpdated: __expectLong,
666
- resultFrame: (_) => de_ResultFrame(_, context),
667
- });
668
- };
669
- const de_SqlStatementResults = (output, context) => {
670
- const retVal = (output || [])
671
- .filter((e) => e != null)
672
- .map((entry) => {
673
- return de_SqlStatementResult(entry, context);
674
- });
675
- return retVal;
676
- };
677
- const de_StructValue = (output, context) => {
678
- return take(output, {
679
- attributes: (_) => de_ArrayValueList(_, context),
680
- });
681
- };
682
- const de_UpdateResult = (output, context) => {
683
- return take(output, {
684
- generatedFields: (_) => de_FieldList(_, context),
685
- });
686
- };
687
- const de_UpdateResults = (output, context) => {
688
- const retVal = (output || [])
689
- .filter((e) => e != null)
690
- .map((entry) => {
691
- return de_UpdateResult(entry, context);
692
- });
693
- return retVal;
694
- };
695
- const de_Value = (output, context) => {
696
- if (output.arrayValues != null) {
697
- return {
698
- arrayValues: de_ArrayValueList(output.arrayValues, context),
699
- };
700
- }
701
- if (__expectLong(output.bigIntValue) !== undefined) {
702
- return { bigIntValue: __expectLong(output.bigIntValue) };
703
- }
704
- if (__expectBoolean(output.bitValue) !== undefined) {
705
- return { bitValue: __expectBoolean(output.bitValue) };
706
- }
707
- if (output.blobValue != null) {
708
- return {
709
- blobValue: context.base64Decoder(output.blobValue),
710
- };
711
- }
712
- if (__limitedParseDouble(output.doubleValue) !== undefined) {
713
- return { doubleValue: __limitedParseDouble(output.doubleValue) };
714
- }
715
- if (__expectInt32(output.intValue) !== undefined) {
716
- return { intValue: __expectInt32(output.intValue) };
717
- }
718
- if (__expectBoolean(output.isNull) !== undefined) {
719
- return { isNull: __expectBoolean(output.isNull) };
720
- }
721
- if (__limitedParseFloat32(output.realValue) !== undefined) {
722
- return { realValue: __limitedParseFloat32(output.realValue) };
723
- }
724
- if (__expectString(output.stringValue) !== undefined) {
725
- return { stringValue: __expectString(output.stringValue) };
726
- }
727
- if (output.structValue != null) {
728
- return {
729
- structValue: de_StructValue(output.structValue, context),
730
- };
731
- }
732
- return { $unknown: Object.entries(output)[0] };
733
- };
734
- const deserializeMetadata = (output) => ({
735
- httpStatusCode: output.statusCode,
736
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
737
- extendedRequestId: output.headers["x-amz-id-2"],
738
- cfId: output.headers["x-amz-cf-id"],
739
- });
740
- const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));