@aws-sdk/client-redshift-data 3.181.0 → 3.183.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist-es/RedshiftData.js +42 -49
  3. package/dist-es/RedshiftDataClient.js +22 -28
  4. package/dist-es/commands/BatchExecuteStatementCommand.js +21 -28
  5. package/dist-es/commands/CancelStatementCommand.js +21 -28
  6. package/dist-es/commands/DescribeStatementCommand.js +21 -28
  7. package/dist-es/commands/DescribeTableCommand.js +21 -28
  8. package/dist-es/commands/ExecuteStatementCommand.js +21 -28
  9. package/dist-es/commands/GetStatementResultCommand.js +21 -28
  10. package/dist-es/commands/ListDatabasesCommand.js +21 -28
  11. package/dist-es/commands/ListSchemasCommand.js +21 -28
  12. package/dist-es/commands/ListStatementsCommand.js +21 -28
  13. package/dist-es/commands/ListTablesCommand.js +21 -28
  14. package/dist-es/endpoints.js +8 -8
  15. package/dist-es/models/RedshiftDataServiceException.js +5 -10
  16. package/dist-es/models/models_0.js +166 -117
  17. package/dist-es/pagination/DescribeTablePaginator.js +25 -68
  18. package/dist-es/pagination/GetStatementResultPaginator.js +24 -67
  19. package/dist-es/pagination/ListDatabasesPaginator.js +25 -68
  20. package/dist-es/pagination/ListSchemasPaginator.js +25 -68
  21. package/dist-es/pagination/ListStatementsPaginator.js +25 -68
  22. package/dist-es/pagination/ListTablesPaginator.js +25 -68
  23. package/dist-es/protocols/Aws_json1_1.js +747 -916
  24. package/dist-es/runtimeConfig.browser.js +26 -12
  25. package/dist-es/runtimeConfig.js +30 -12
  26. package/dist-es/runtimeConfig.native.js +8 -5
  27. package/dist-es/runtimeConfig.shared.js +8 -11
  28. package/package.json +33 -33
@@ -1,830 +1,684 @@
1
- import { __assign, __awaiter, __generator } from "tslib";
2
1
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
3
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";
4
3
  import { ActiveStatementsExceededException, BatchExecuteStatementException, DatabaseConnectionException, ExecuteStatementException, InternalServerException, ResourceNotFoundException, ValidationException, } from "../models/models_0";
5
4
  import { RedshiftDataServiceException as __BaseException } from "../models/RedshiftDataServiceException";
6
- export var serializeAws_json1_1BatchExecuteStatementCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
7
- var headers, body;
8
- return __generator(this, function (_a) {
9
- headers = {
10
- "content-type": "application/x-amz-json-1.1",
11
- "x-amz-target": "RedshiftData.BatchExecuteStatement",
12
- };
13
- body = JSON.stringify(serializeAws_json1_1BatchExecuteStatementInput(input, context));
14
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
15
- });
16
- }); };
17
- export var serializeAws_json1_1CancelStatementCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
18
- var headers, body;
19
- return __generator(this, function (_a) {
20
- headers = {
21
- "content-type": "application/x-amz-json-1.1",
22
- "x-amz-target": "RedshiftData.CancelStatement",
23
- };
24
- body = JSON.stringify(serializeAws_json1_1CancelStatementRequest(input, context));
25
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
26
- });
27
- }); };
28
- export var serializeAws_json1_1DescribeStatementCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
29
- var headers, body;
30
- return __generator(this, function (_a) {
31
- headers = {
32
- "content-type": "application/x-amz-json-1.1",
33
- "x-amz-target": "RedshiftData.DescribeStatement",
34
- };
35
- body = JSON.stringify(serializeAws_json1_1DescribeStatementRequest(input, context));
36
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
37
- });
38
- }); };
39
- export var serializeAws_json1_1DescribeTableCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
40
- var headers, body;
41
- return __generator(this, function (_a) {
42
- headers = {
43
- "content-type": "application/x-amz-json-1.1",
44
- "x-amz-target": "RedshiftData.DescribeTable",
45
- };
46
- body = JSON.stringify(serializeAws_json1_1DescribeTableRequest(input, context));
47
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
48
- });
49
- }); };
50
- export var serializeAws_json1_1ExecuteStatementCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
51
- var headers, body;
52
- return __generator(this, function (_a) {
53
- headers = {
54
- "content-type": "application/x-amz-json-1.1",
55
- "x-amz-target": "RedshiftData.ExecuteStatement",
56
- };
57
- body = JSON.stringify(serializeAws_json1_1ExecuteStatementInput(input, context));
58
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
59
- });
60
- }); };
61
- export var serializeAws_json1_1GetStatementResultCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
62
- var headers, body;
63
- return __generator(this, function (_a) {
64
- headers = {
65
- "content-type": "application/x-amz-json-1.1",
66
- "x-amz-target": "RedshiftData.GetStatementResult",
67
- };
68
- body = JSON.stringify(serializeAws_json1_1GetStatementResultRequest(input, context));
69
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
70
- });
71
- }); };
72
- export var serializeAws_json1_1ListDatabasesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
73
- var headers, body;
74
- return __generator(this, function (_a) {
75
- headers = {
76
- "content-type": "application/x-amz-json-1.1",
77
- "x-amz-target": "RedshiftData.ListDatabases",
78
- };
79
- body = JSON.stringify(serializeAws_json1_1ListDatabasesRequest(input, context));
80
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
81
- });
82
- }); };
83
- export var serializeAws_json1_1ListSchemasCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
84
- var headers, body;
85
- return __generator(this, function (_a) {
86
- headers = {
87
- "content-type": "application/x-amz-json-1.1",
88
- "x-amz-target": "RedshiftData.ListSchemas",
89
- };
90
- body = JSON.stringify(serializeAws_json1_1ListSchemasRequest(input, context));
91
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
92
- });
93
- }); };
94
- export var serializeAws_json1_1ListStatementsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
95
- var headers, body;
96
- return __generator(this, function (_a) {
97
- headers = {
98
- "content-type": "application/x-amz-json-1.1",
99
- "x-amz-target": "RedshiftData.ListStatements",
100
- };
101
- body = JSON.stringify(serializeAws_json1_1ListStatementsRequest(input, context));
102
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
103
- });
104
- }); };
105
- export var serializeAws_json1_1ListTablesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
106
- var headers, body;
107
- return __generator(this, function (_a) {
108
- headers = {
109
- "content-type": "application/x-amz-json-1.1",
110
- "x-amz-target": "RedshiftData.ListTables",
111
- };
112
- body = JSON.stringify(serializeAws_json1_1ListTablesRequest(input, context));
113
- return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
114
- });
115
- }); };
116
- export var deserializeAws_json1_1BatchExecuteStatementCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
117
- var data, contents, response;
118
- return __generator(this, function (_a) {
119
- switch (_a.label) {
120
- case 0:
121
- if (output.statusCode >= 300) {
122
- return [2, deserializeAws_json1_1BatchExecuteStatementCommandError(output, context)];
123
- }
124
- return [4, parseBody(output.body, context)];
125
- case 1:
126
- data = _a.sent();
127
- contents = {};
128
- contents = deserializeAws_json1_1BatchExecuteStatementOutput(data, context);
129
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
130
- return [2, Promise.resolve(response)];
131
- }
132
- });
133
- }); };
134
- var deserializeAws_json1_1BatchExecuteStatementCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
135
- var parsedOutput, _a, errorCode, _b, parsedBody;
136
- var _c;
137
- return __generator(this, function (_d) {
138
- switch (_d.label) {
139
- case 0:
140
- _a = [__assign({}, output)];
141
- _c = {};
142
- return [4, parseErrorBody(output.body, context)];
143
- case 1:
144
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
145
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
146
- _b = errorCode;
147
- switch (_b) {
148
- case "ActiveStatementsExceededException": return [3, 2];
149
- case "com.amazonaws.redshiftdata#ActiveStatementsExceededException": return [3, 2];
150
- case "BatchExecuteStatementException": return [3, 4];
151
- case "com.amazonaws.redshiftdata#BatchExecuteStatementException": return [3, 4];
152
- case "ValidationException": return [3, 6];
153
- case "com.amazonaws.redshiftdata#ValidationException": return [3, 6];
154
- }
155
- return [3, 8];
156
- case 2: return [4, deserializeAws_json1_1ActiveStatementsExceededExceptionResponse(parsedOutput, context)];
157
- case 3: throw _d.sent();
158
- case 4: return [4, deserializeAws_json1_1BatchExecuteStatementExceptionResponse(parsedOutput, context)];
159
- case 5: throw _d.sent();
160
- case 6: return [4, deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context)];
161
- case 7: throw _d.sent();
162
- case 8:
163
- parsedBody = parsedOutput.body;
164
- throwDefaultError({
165
- output: output,
166
- parsedBody: parsedBody,
167
- exceptionCtor: __BaseException,
168
- errorCode: errorCode,
169
- });
170
- _d.label = 9;
171
- case 9: return [2];
172
- }
173
- });
174
- }); };
175
- export var deserializeAws_json1_1CancelStatementCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
176
- var data, contents, response;
177
- return __generator(this, function (_a) {
178
- switch (_a.label) {
179
- case 0:
180
- if (output.statusCode >= 300) {
181
- return [2, deserializeAws_json1_1CancelStatementCommandError(output, context)];
182
- }
183
- return [4, parseBody(output.body, context)];
184
- case 1:
185
- data = _a.sent();
186
- contents = {};
187
- contents = deserializeAws_json1_1CancelStatementResponse(data, context);
188
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
189
- return [2, Promise.resolve(response)];
190
- }
191
- });
192
- }); };
193
- var deserializeAws_json1_1CancelStatementCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
194
- var parsedOutput, _a, errorCode, _b, parsedBody;
195
- var _c;
196
- return __generator(this, function (_d) {
197
- switch (_d.label) {
198
- case 0:
199
- _a = [__assign({}, output)];
200
- _c = {};
201
- return [4, parseErrorBody(output.body, context)];
202
- case 1:
203
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
204
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
205
- _b = errorCode;
206
- switch (_b) {
207
- case "DatabaseConnectionException": return [3, 2];
208
- case "com.amazonaws.redshiftdata#DatabaseConnectionException": return [3, 2];
209
- case "InternalServerException": return [3, 4];
210
- case "com.amazonaws.redshiftdata#InternalServerException": return [3, 4];
211
- case "ResourceNotFoundException": return [3, 6];
212
- case "com.amazonaws.redshiftdata#ResourceNotFoundException": return [3, 6];
213
- case "ValidationException": return [3, 8];
214
- case "com.amazonaws.redshiftdata#ValidationException": return [3, 8];
215
- }
216
- return [3, 10];
217
- case 2: return [4, deserializeAws_json1_1DatabaseConnectionExceptionResponse(parsedOutput, context)];
218
- case 3: throw _d.sent();
219
- case 4: return [4, deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context)];
220
- case 5: throw _d.sent();
221
- case 6: return [4, deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)];
222
- case 7: throw _d.sent();
223
- case 8: return [4, deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context)];
224
- case 9: throw _d.sent();
225
- case 10:
226
- parsedBody = parsedOutput.body;
227
- throwDefaultError({
228
- output: output,
229
- parsedBody: parsedBody,
230
- exceptionCtor: __BaseException,
231
- errorCode: errorCode,
232
- });
233
- _d.label = 11;
234
- case 11: return [2];
235
- }
236
- });
237
- }); };
238
- export var deserializeAws_json1_1DescribeStatementCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
239
- var data, contents, response;
240
- return __generator(this, function (_a) {
241
- switch (_a.label) {
242
- case 0:
243
- if (output.statusCode >= 300) {
244
- return [2, deserializeAws_json1_1DescribeStatementCommandError(output, context)];
245
- }
246
- return [4, parseBody(output.body, context)];
247
- case 1:
248
- data = _a.sent();
249
- contents = {};
250
- contents = deserializeAws_json1_1DescribeStatementResponse(data, context);
251
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
252
- return [2, Promise.resolve(response)];
253
- }
254
- });
255
- }); };
256
- var deserializeAws_json1_1DescribeStatementCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
257
- var parsedOutput, _a, errorCode, _b, parsedBody;
258
- var _c;
259
- return __generator(this, function (_d) {
260
- switch (_d.label) {
261
- case 0:
262
- _a = [__assign({}, output)];
263
- _c = {};
264
- return [4, parseErrorBody(output.body, context)];
265
- case 1:
266
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
267
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
268
- _b = errorCode;
269
- switch (_b) {
270
- case "InternalServerException": return [3, 2];
271
- case "com.amazonaws.redshiftdata#InternalServerException": return [3, 2];
272
- case "ResourceNotFoundException": return [3, 4];
273
- case "com.amazonaws.redshiftdata#ResourceNotFoundException": return [3, 4];
274
- case "ValidationException": return [3, 6];
275
- case "com.amazonaws.redshiftdata#ValidationException": return [3, 6];
276
- }
277
- return [3, 8];
278
- case 2: return [4, deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context)];
279
- case 3: throw _d.sent();
280
- case 4: return [4, deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)];
281
- case 5: throw _d.sent();
282
- case 6: return [4, deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context)];
283
- case 7: throw _d.sent();
284
- case 8:
285
- parsedBody = parsedOutput.body;
286
- throwDefaultError({
287
- output: output,
288
- parsedBody: parsedBody,
289
- exceptionCtor: __BaseException,
290
- errorCode: errorCode,
291
- });
292
- _d.label = 9;
293
- case 9: return [2];
294
- }
295
- });
296
- }); };
297
- export var deserializeAws_json1_1DescribeTableCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
298
- var data, contents, response;
299
- return __generator(this, function (_a) {
300
- switch (_a.label) {
301
- case 0:
302
- if (output.statusCode >= 300) {
303
- return [2, deserializeAws_json1_1DescribeTableCommandError(output, context)];
304
- }
305
- return [4, parseBody(output.body, context)];
306
- case 1:
307
- data = _a.sent();
308
- contents = {};
309
- contents = deserializeAws_json1_1DescribeTableResponse(data, context);
310
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
311
- return [2, Promise.resolve(response)];
312
- }
313
- });
314
- }); };
315
- var deserializeAws_json1_1DescribeTableCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
316
- var parsedOutput, _a, errorCode, _b, parsedBody;
317
- var _c;
318
- return __generator(this, function (_d) {
319
- switch (_d.label) {
320
- case 0:
321
- _a = [__assign({}, output)];
322
- _c = {};
323
- return [4, parseErrorBody(output.body, context)];
324
- case 1:
325
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
326
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
327
- _b = errorCode;
328
- switch (_b) {
329
- case "DatabaseConnectionException": return [3, 2];
330
- case "com.amazonaws.redshiftdata#DatabaseConnectionException": return [3, 2];
331
- case "InternalServerException": return [3, 4];
332
- case "com.amazonaws.redshiftdata#InternalServerException": return [3, 4];
333
- case "ValidationException": return [3, 6];
334
- case "com.amazonaws.redshiftdata#ValidationException": return [3, 6];
335
- }
336
- return [3, 8];
337
- case 2: return [4, deserializeAws_json1_1DatabaseConnectionExceptionResponse(parsedOutput, context)];
338
- case 3: throw _d.sent();
339
- case 4: return [4, deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context)];
340
- case 5: throw _d.sent();
341
- case 6: return [4, deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context)];
342
- case 7: throw _d.sent();
343
- case 8:
344
- parsedBody = parsedOutput.body;
345
- throwDefaultError({
346
- output: output,
347
- parsedBody: parsedBody,
348
- exceptionCtor: __BaseException,
349
- errorCode: errorCode,
350
- });
351
- _d.label = 9;
352
- case 9: return [2];
353
- }
354
- });
355
- }); };
356
- export var deserializeAws_json1_1ExecuteStatementCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
357
- var data, contents, response;
358
- return __generator(this, function (_a) {
359
- switch (_a.label) {
360
- case 0:
361
- if (output.statusCode >= 300) {
362
- return [2, deserializeAws_json1_1ExecuteStatementCommandError(output, context)];
363
- }
364
- return [4, parseBody(output.body, context)];
365
- case 1:
366
- data = _a.sent();
367
- contents = {};
368
- contents = deserializeAws_json1_1ExecuteStatementOutput(data, context);
369
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
370
- return [2, Promise.resolve(response)];
371
- }
372
- });
373
- }); };
374
- var deserializeAws_json1_1ExecuteStatementCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
375
- var parsedOutput, _a, errorCode, _b, parsedBody;
376
- var _c;
377
- return __generator(this, function (_d) {
378
- switch (_d.label) {
379
- case 0:
380
- _a = [__assign({}, output)];
381
- _c = {};
382
- return [4, parseErrorBody(output.body, context)];
383
- case 1:
384
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
385
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
386
- _b = errorCode;
387
- switch (_b) {
388
- case "ActiveStatementsExceededException": return [3, 2];
389
- case "com.amazonaws.redshiftdata#ActiveStatementsExceededException": return [3, 2];
390
- case "ExecuteStatementException": return [3, 4];
391
- case "com.amazonaws.redshiftdata#ExecuteStatementException": return [3, 4];
392
- case "ValidationException": return [3, 6];
393
- case "com.amazonaws.redshiftdata#ValidationException": return [3, 6];
394
- }
395
- return [3, 8];
396
- case 2: return [4, deserializeAws_json1_1ActiveStatementsExceededExceptionResponse(parsedOutput, context)];
397
- case 3: throw _d.sent();
398
- case 4: return [4, deserializeAws_json1_1ExecuteStatementExceptionResponse(parsedOutput, context)];
399
- case 5: throw _d.sent();
400
- case 6: return [4, deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context)];
401
- case 7: throw _d.sent();
402
- case 8:
403
- parsedBody = parsedOutput.body;
404
- throwDefaultError({
405
- output: output,
406
- parsedBody: parsedBody,
407
- exceptionCtor: __BaseException,
408
- errorCode: errorCode,
409
- });
410
- _d.label = 9;
411
- case 9: return [2];
412
- }
413
- });
414
- }); };
415
- export var deserializeAws_json1_1GetStatementResultCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
416
- var data, contents, response;
417
- return __generator(this, function (_a) {
418
- switch (_a.label) {
419
- case 0:
420
- if (output.statusCode >= 300) {
421
- return [2, deserializeAws_json1_1GetStatementResultCommandError(output, context)];
422
- }
423
- return [4, parseBody(output.body, context)];
424
- case 1:
425
- data = _a.sent();
426
- contents = {};
427
- contents = deserializeAws_json1_1GetStatementResultResponse(data, context);
428
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
429
- return [2, Promise.resolve(response)];
430
- }
431
- });
432
- }); };
433
- var deserializeAws_json1_1GetStatementResultCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
434
- var parsedOutput, _a, errorCode, _b, parsedBody;
435
- var _c;
436
- return __generator(this, function (_d) {
437
- switch (_d.label) {
438
- case 0:
439
- _a = [__assign({}, output)];
440
- _c = {};
441
- return [4, parseErrorBody(output.body, context)];
442
- case 1:
443
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
444
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
445
- _b = errorCode;
446
- switch (_b) {
447
- case "InternalServerException": return [3, 2];
448
- case "com.amazonaws.redshiftdata#InternalServerException": return [3, 2];
449
- case "ResourceNotFoundException": return [3, 4];
450
- case "com.amazonaws.redshiftdata#ResourceNotFoundException": return [3, 4];
451
- case "ValidationException": return [3, 6];
452
- case "com.amazonaws.redshiftdata#ValidationException": return [3, 6];
453
- }
454
- return [3, 8];
455
- case 2: return [4, deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context)];
456
- case 3: throw _d.sent();
457
- case 4: return [4, deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)];
458
- case 5: throw _d.sent();
459
- case 6: return [4, deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context)];
460
- case 7: throw _d.sent();
461
- case 8:
462
- parsedBody = parsedOutput.body;
463
- throwDefaultError({
464
- output: output,
465
- parsedBody: parsedBody,
466
- exceptionCtor: __BaseException,
467
- errorCode: errorCode,
468
- });
469
- _d.label = 9;
470
- case 9: return [2];
471
- }
472
- });
473
- }); };
474
- export var deserializeAws_json1_1ListDatabasesCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
475
- var data, contents, response;
476
- return __generator(this, function (_a) {
477
- switch (_a.label) {
478
- case 0:
479
- if (output.statusCode >= 300) {
480
- return [2, deserializeAws_json1_1ListDatabasesCommandError(output, context)];
481
- }
482
- return [4, parseBody(output.body, context)];
483
- case 1:
484
- data = _a.sent();
485
- contents = {};
486
- contents = deserializeAws_json1_1ListDatabasesResponse(data, context);
487
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
488
- return [2, Promise.resolve(response)];
489
- }
490
- });
491
- }); };
492
- var deserializeAws_json1_1ListDatabasesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
493
- var parsedOutput, _a, errorCode, _b, parsedBody;
494
- var _c;
495
- return __generator(this, function (_d) {
496
- switch (_d.label) {
497
- case 0:
498
- _a = [__assign({}, output)];
499
- _c = {};
500
- return [4, parseErrorBody(output.body, context)];
501
- case 1:
502
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
503
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
504
- _b = errorCode;
505
- switch (_b) {
506
- case "DatabaseConnectionException": return [3, 2];
507
- case "com.amazonaws.redshiftdata#DatabaseConnectionException": return [3, 2];
508
- case "InternalServerException": return [3, 4];
509
- case "com.amazonaws.redshiftdata#InternalServerException": return [3, 4];
510
- case "ValidationException": return [3, 6];
511
- case "com.amazonaws.redshiftdata#ValidationException": return [3, 6];
512
- }
513
- return [3, 8];
514
- case 2: return [4, deserializeAws_json1_1DatabaseConnectionExceptionResponse(parsedOutput, context)];
515
- case 3: throw _d.sent();
516
- case 4: return [4, deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context)];
517
- case 5: throw _d.sent();
518
- case 6: return [4, deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context)];
519
- case 7: throw _d.sent();
520
- case 8:
521
- parsedBody = parsedOutput.body;
522
- throwDefaultError({
523
- output: output,
524
- parsedBody: parsedBody,
525
- exceptionCtor: __BaseException,
526
- errorCode: errorCode,
527
- });
528
- _d.label = 9;
529
- case 9: return [2];
530
- }
531
- });
532
- }); };
533
- export var deserializeAws_json1_1ListSchemasCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
534
- var data, contents, response;
535
- return __generator(this, function (_a) {
536
- switch (_a.label) {
537
- case 0:
538
- if (output.statusCode >= 300) {
539
- return [2, deserializeAws_json1_1ListSchemasCommandError(output, context)];
540
- }
541
- return [4, parseBody(output.body, context)];
542
- case 1:
543
- data = _a.sent();
544
- contents = {};
545
- contents = deserializeAws_json1_1ListSchemasResponse(data, context);
546
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
547
- return [2, Promise.resolve(response)];
548
- }
549
- });
550
- }); };
551
- var deserializeAws_json1_1ListSchemasCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
552
- var parsedOutput, _a, errorCode, _b, parsedBody;
553
- var _c;
554
- return __generator(this, function (_d) {
555
- switch (_d.label) {
556
- case 0:
557
- _a = [__assign({}, output)];
558
- _c = {};
559
- return [4, parseErrorBody(output.body, context)];
560
- case 1:
561
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
562
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
563
- _b = errorCode;
564
- switch (_b) {
565
- case "DatabaseConnectionException": return [3, 2];
566
- case "com.amazonaws.redshiftdata#DatabaseConnectionException": return [3, 2];
567
- case "InternalServerException": return [3, 4];
568
- case "com.amazonaws.redshiftdata#InternalServerException": return [3, 4];
569
- case "ValidationException": return [3, 6];
570
- case "com.amazonaws.redshiftdata#ValidationException": return [3, 6];
571
- }
572
- return [3, 8];
573
- case 2: return [4, deserializeAws_json1_1DatabaseConnectionExceptionResponse(parsedOutput, context)];
574
- case 3: throw _d.sent();
575
- case 4: return [4, deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context)];
576
- case 5: throw _d.sent();
577
- case 6: return [4, deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context)];
578
- case 7: throw _d.sent();
579
- case 8:
580
- parsedBody = parsedOutput.body;
581
- throwDefaultError({
582
- output: output,
583
- parsedBody: parsedBody,
584
- exceptionCtor: __BaseException,
585
- errorCode: errorCode,
586
- });
587
- _d.label = 9;
588
- case 9: return [2];
589
- }
590
- });
591
- }); };
592
- export var deserializeAws_json1_1ListStatementsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
593
- var data, contents, response;
594
- return __generator(this, function (_a) {
595
- switch (_a.label) {
596
- case 0:
597
- if (output.statusCode >= 300) {
598
- return [2, deserializeAws_json1_1ListStatementsCommandError(output, context)];
599
- }
600
- return [4, parseBody(output.body, context)];
601
- case 1:
602
- data = _a.sent();
603
- contents = {};
604
- contents = deserializeAws_json1_1ListStatementsResponse(data, context);
605
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
606
- return [2, Promise.resolve(response)];
607
- }
608
- });
609
- }); };
610
- var deserializeAws_json1_1ListStatementsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
611
- var parsedOutput, _a, errorCode, _b, parsedBody;
612
- var _c;
613
- return __generator(this, function (_d) {
614
- switch (_d.label) {
615
- case 0:
616
- _a = [__assign({}, output)];
617
- _c = {};
618
- return [4, parseErrorBody(output.body, context)];
619
- case 1:
620
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
621
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
622
- _b = errorCode;
623
- switch (_b) {
624
- case "InternalServerException": return [3, 2];
625
- case "com.amazonaws.redshiftdata#InternalServerException": return [3, 2];
626
- case "ValidationException": return [3, 4];
627
- case "com.amazonaws.redshiftdata#ValidationException": return [3, 4];
628
- }
629
- return [3, 6];
630
- case 2: return [4, deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context)];
631
- case 3: throw _d.sent();
632
- case 4: return [4, deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context)];
633
- case 5: throw _d.sent();
634
- case 6:
635
- parsedBody = parsedOutput.body;
636
- throwDefaultError({
637
- output: output,
638
- parsedBody: parsedBody,
639
- exceptionCtor: __BaseException,
640
- errorCode: errorCode,
641
- });
642
- _d.label = 7;
643
- case 7: return [2];
644
- }
645
- });
646
- }); };
647
- export var deserializeAws_json1_1ListTablesCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
648
- var data, contents, response;
649
- return __generator(this, function (_a) {
650
- switch (_a.label) {
651
- case 0:
652
- if (output.statusCode >= 300) {
653
- return [2, deserializeAws_json1_1ListTablesCommandError(output, context)];
654
- }
655
- return [4, parseBody(output.body, context)];
656
- case 1:
657
- data = _a.sent();
658
- contents = {};
659
- contents = deserializeAws_json1_1ListTablesResponse(data, context);
660
- response = __assign({ $metadata: deserializeMetadata(output) }, contents);
661
- return [2, Promise.resolve(response)];
662
- }
663
- });
664
- }); };
665
- var deserializeAws_json1_1ListTablesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
666
- var parsedOutput, _a, errorCode, _b, parsedBody;
667
- var _c;
668
- return __generator(this, function (_d) {
669
- switch (_d.label) {
670
- case 0:
671
- _a = [__assign({}, output)];
672
- _c = {};
673
- return [4, parseErrorBody(output.body, context)];
674
- case 1:
675
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
676
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
677
- _b = errorCode;
678
- switch (_b) {
679
- case "DatabaseConnectionException": return [3, 2];
680
- case "com.amazonaws.redshiftdata#DatabaseConnectionException": return [3, 2];
681
- case "InternalServerException": return [3, 4];
682
- case "com.amazonaws.redshiftdata#InternalServerException": return [3, 4];
683
- case "ValidationException": return [3, 6];
684
- case "com.amazonaws.redshiftdata#ValidationException": return [3, 6];
685
- }
686
- return [3, 8];
687
- case 2: return [4, deserializeAws_json1_1DatabaseConnectionExceptionResponse(parsedOutput, context)];
688
- case 3: throw _d.sent();
689
- case 4: return [4, deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context)];
690
- case 5: throw _d.sent();
691
- case 6: return [4, deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context)];
692
- case 7: throw _d.sent();
693
- case 8:
694
- parsedBody = parsedOutput.body;
695
- throwDefaultError({
696
- output: output,
697
- parsedBody: parsedBody,
698
- exceptionCtor: __BaseException,
699
- errorCode: errorCode,
700
- });
701
- _d.label = 9;
702
- case 9: return [2];
703
- }
704
- });
705
- }); };
706
- var deserializeAws_json1_1ActiveStatementsExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
707
- var body, deserialized, exception;
708
- return __generator(this, function (_a) {
709
- body = parsedOutput.body;
710
- deserialized = deserializeAws_json1_1ActiveStatementsExceededException(body, context);
711
- exception = new ActiveStatementsExceededException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
712
- return [2, __decorateServiceException(exception, body)];
5
+ export const serializeAws_json1_1BatchExecuteStatementCommand = async (input, context) => {
6
+ const headers = {
7
+ "content-type": "application/x-amz-json-1.1",
8
+ "x-amz-target": "RedshiftData.BatchExecuteStatement",
9
+ };
10
+ let body;
11
+ body = JSON.stringify(serializeAws_json1_1BatchExecuteStatementInput(input, context));
12
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
13
+ };
14
+ export const serializeAws_json1_1CancelStatementCommand = async (input, context) => {
15
+ const headers = {
16
+ "content-type": "application/x-amz-json-1.1",
17
+ "x-amz-target": "RedshiftData.CancelStatement",
18
+ };
19
+ let body;
20
+ body = JSON.stringify(serializeAws_json1_1CancelStatementRequest(input, context));
21
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
22
+ };
23
+ export const serializeAws_json1_1DescribeStatementCommand = async (input, context) => {
24
+ const headers = {
25
+ "content-type": "application/x-amz-json-1.1",
26
+ "x-amz-target": "RedshiftData.DescribeStatement",
27
+ };
28
+ let body;
29
+ body = JSON.stringify(serializeAws_json1_1DescribeStatementRequest(input, context));
30
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
31
+ };
32
+ export const serializeAws_json1_1DescribeTableCommand = async (input, context) => {
33
+ const headers = {
34
+ "content-type": "application/x-amz-json-1.1",
35
+ "x-amz-target": "RedshiftData.DescribeTable",
36
+ };
37
+ let body;
38
+ body = JSON.stringify(serializeAws_json1_1DescribeTableRequest(input, context));
39
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
40
+ };
41
+ export const serializeAws_json1_1ExecuteStatementCommand = async (input, context) => {
42
+ const headers = {
43
+ "content-type": "application/x-amz-json-1.1",
44
+ "x-amz-target": "RedshiftData.ExecuteStatement",
45
+ };
46
+ let body;
47
+ body = JSON.stringify(serializeAws_json1_1ExecuteStatementInput(input, context));
48
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
49
+ };
50
+ export const serializeAws_json1_1GetStatementResultCommand = async (input, context) => {
51
+ const headers = {
52
+ "content-type": "application/x-amz-json-1.1",
53
+ "x-amz-target": "RedshiftData.GetStatementResult",
54
+ };
55
+ let body;
56
+ body = JSON.stringify(serializeAws_json1_1GetStatementResultRequest(input, context));
57
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
58
+ };
59
+ export const serializeAws_json1_1ListDatabasesCommand = async (input, context) => {
60
+ const headers = {
61
+ "content-type": "application/x-amz-json-1.1",
62
+ "x-amz-target": "RedshiftData.ListDatabases",
63
+ };
64
+ let body;
65
+ body = JSON.stringify(serializeAws_json1_1ListDatabasesRequest(input, context));
66
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
67
+ };
68
+ export const serializeAws_json1_1ListSchemasCommand = async (input, context) => {
69
+ const headers = {
70
+ "content-type": "application/x-amz-json-1.1",
71
+ "x-amz-target": "RedshiftData.ListSchemas",
72
+ };
73
+ let body;
74
+ body = JSON.stringify(serializeAws_json1_1ListSchemasRequest(input, context));
75
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
76
+ };
77
+ export const serializeAws_json1_1ListStatementsCommand = async (input, context) => {
78
+ const headers = {
79
+ "content-type": "application/x-amz-json-1.1",
80
+ "x-amz-target": "RedshiftData.ListStatements",
81
+ };
82
+ let body;
83
+ body = JSON.stringify(serializeAws_json1_1ListStatementsRequest(input, context));
84
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
85
+ };
86
+ export const serializeAws_json1_1ListTablesCommand = async (input, context) => {
87
+ const headers = {
88
+ "content-type": "application/x-amz-json-1.1",
89
+ "x-amz-target": "RedshiftData.ListTables",
90
+ };
91
+ let body;
92
+ body = JSON.stringify(serializeAws_json1_1ListTablesRequest(input, context));
93
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
94
+ };
95
+ export const deserializeAws_json1_1BatchExecuteStatementCommand = async (output, context) => {
96
+ if (output.statusCode >= 300) {
97
+ return deserializeAws_json1_1BatchExecuteStatementCommandError(output, context);
98
+ }
99
+ const data = await parseBody(output.body, context);
100
+ let contents = {};
101
+ contents = deserializeAws_json1_1BatchExecuteStatementOutput(data, context);
102
+ const response = {
103
+ $metadata: deserializeMetadata(output),
104
+ ...contents,
105
+ };
106
+ return Promise.resolve(response);
107
+ };
108
+ const deserializeAws_json1_1BatchExecuteStatementCommandError = async (output, context) => {
109
+ const parsedOutput = {
110
+ ...output,
111
+ body: await parseErrorBody(output.body, context),
112
+ };
113
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
114
+ switch (errorCode) {
115
+ case "ActiveStatementsExceededException":
116
+ case "com.amazonaws.redshiftdata#ActiveStatementsExceededException":
117
+ throw await deserializeAws_json1_1ActiveStatementsExceededExceptionResponse(parsedOutput, context);
118
+ case "BatchExecuteStatementException":
119
+ case "com.amazonaws.redshiftdata#BatchExecuteStatementException":
120
+ throw await deserializeAws_json1_1BatchExecuteStatementExceptionResponse(parsedOutput, context);
121
+ case "ValidationException":
122
+ case "com.amazonaws.redshiftdata#ValidationException":
123
+ throw await deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context);
124
+ default:
125
+ const parsedBody = parsedOutput.body;
126
+ throwDefaultError({
127
+ output,
128
+ parsedBody,
129
+ exceptionCtor: __BaseException,
130
+ errorCode,
131
+ });
132
+ }
133
+ };
134
+ export const deserializeAws_json1_1CancelStatementCommand = async (output, context) => {
135
+ if (output.statusCode >= 300) {
136
+ return deserializeAws_json1_1CancelStatementCommandError(output, context);
137
+ }
138
+ const data = await parseBody(output.body, context);
139
+ let contents = {};
140
+ contents = deserializeAws_json1_1CancelStatementResponse(data, context);
141
+ const response = {
142
+ $metadata: deserializeMetadata(output),
143
+ ...contents,
144
+ };
145
+ return Promise.resolve(response);
146
+ };
147
+ const deserializeAws_json1_1CancelStatementCommandError = async (output, context) => {
148
+ const parsedOutput = {
149
+ ...output,
150
+ body: await parseErrorBody(output.body, context),
151
+ };
152
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
153
+ switch (errorCode) {
154
+ case "DatabaseConnectionException":
155
+ case "com.amazonaws.redshiftdata#DatabaseConnectionException":
156
+ throw await deserializeAws_json1_1DatabaseConnectionExceptionResponse(parsedOutput, context);
157
+ case "InternalServerException":
158
+ case "com.amazonaws.redshiftdata#InternalServerException":
159
+ throw await deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context);
160
+ case "ResourceNotFoundException":
161
+ case "com.amazonaws.redshiftdata#ResourceNotFoundException":
162
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
163
+ case "ValidationException":
164
+ case "com.amazonaws.redshiftdata#ValidationException":
165
+ throw await deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context);
166
+ default:
167
+ const parsedBody = parsedOutput.body;
168
+ throwDefaultError({
169
+ output,
170
+ parsedBody,
171
+ exceptionCtor: __BaseException,
172
+ errorCode,
173
+ });
174
+ }
175
+ };
176
+ export const deserializeAws_json1_1DescribeStatementCommand = async (output, context) => {
177
+ if (output.statusCode >= 300) {
178
+ return deserializeAws_json1_1DescribeStatementCommandError(output, context);
179
+ }
180
+ const data = await parseBody(output.body, context);
181
+ let contents = {};
182
+ contents = deserializeAws_json1_1DescribeStatementResponse(data, context);
183
+ const response = {
184
+ $metadata: deserializeMetadata(output),
185
+ ...contents,
186
+ };
187
+ return Promise.resolve(response);
188
+ };
189
+ const deserializeAws_json1_1DescribeStatementCommandError = async (output, context) => {
190
+ const parsedOutput = {
191
+ ...output,
192
+ body: await parseErrorBody(output.body, context),
193
+ };
194
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
195
+ switch (errorCode) {
196
+ case "InternalServerException":
197
+ case "com.amazonaws.redshiftdata#InternalServerException":
198
+ throw await deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context);
199
+ case "ResourceNotFoundException":
200
+ case "com.amazonaws.redshiftdata#ResourceNotFoundException":
201
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
202
+ case "ValidationException":
203
+ case "com.amazonaws.redshiftdata#ValidationException":
204
+ throw await deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context);
205
+ default:
206
+ const parsedBody = parsedOutput.body;
207
+ throwDefaultError({
208
+ output,
209
+ parsedBody,
210
+ exceptionCtor: __BaseException,
211
+ errorCode,
212
+ });
213
+ }
214
+ };
215
+ export const deserializeAws_json1_1DescribeTableCommand = async (output, context) => {
216
+ if (output.statusCode >= 300) {
217
+ return deserializeAws_json1_1DescribeTableCommandError(output, context);
218
+ }
219
+ const data = await parseBody(output.body, context);
220
+ let contents = {};
221
+ contents = deserializeAws_json1_1DescribeTableResponse(data, context);
222
+ const response = {
223
+ $metadata: deserializeMetadata(output),
224
+ ...contents,
225
+ };
226
+ return Promise.resolve(response);
227
+ };
228
+ const deserializeAws_json1_1DescribeTableCommandError = async (output, context) => {
229
+ const parsedOutput = {
230
+ ...output,
231
+ body: await parseErrorBody(output.body, context),
232
+ };
233
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
234
+ switch (errorCode) {
235
+ case "DatabaseConnectionException":
236
+ case "com.amazonaws.redshiftdata#DatabaseConnectionException":
237
+ throw await deserializeAws_json1_1DatabaseConnectionExceptionResponse(parsedOutput, context);
238
+ case "InternalServerException":
239
+ case "com.amazonaws.redshiftdata#InternalServerException":
240
+ throw await deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context);
241
+ case "ValidationException":
242
+ case "com.amazonaws.redshiftdata#ValidationException":
243
+ throw await deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context);
244
+ default:
245
+ const parsedBody = parsedOutput.body;
246
+ throwDefaultError({
247
+ output,
248
+ parsedBody,
249
+ exceptionCtor: __BaseException,
250
+ errorCode,
251
+ });
252
+ }
253
+ };
254
+ export const deserializeAws_json1_1ExecuteStatementCommand = async (output, context) => {
255
+ if (output.statusCode >= 300) {
256
+ return deserializeAws_json1_1ExecuteStatementCommandError(output, context);
257
+ }
258
+ const data = await parseBody(output.body, context);
259
+ let contents = {};
260
+ contents = deserializeAws_json1_1ExecuteStatementOutput(data, context);
261
+ const response = {
262
+ $metadata: deserializeMetadata(output),
263
+ ...contents,
264
+ };
265
+ return Promise.resolve(response);
266
+ };
267
+ const deserializeAws_json1_1ExecuteStatementCommandError = async (output, context) => {
268
+ const parsedOutput = {
269
+ ...output,
270
+ body: await parseErrorBody(output.body, context),
271
+ };
272
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
273
+ switch (errorCode) {
274
+ case "ActiveStatementsExceededException":
275
+ case "com.amazonaws.redshiftdata#ActiveStatementsExceededException":
276
+ throw await deserializeAws_json1_1ActiveStatementsExceededExceptionResponse(parsedOutput, context);
277
+ case "ExecuteStatementException":
278
+ case "com.amazonaws.redshiftdata#ExecuteStatementException":
279
+ throw await deserializeAws_json1_1ExecuteStatementExceptionResponse(parsedOutput, context);
280
+ case "ValidationException":
281
+ case "com.amazonaws.redshiftdata#ValidationException":
282
+ throw await deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context);
283
+ default:
284
+ const parsedBody = parsedOutput.body;
285
+ throwDefaultError({
286
+ output,
287
+ parsedBody,
288
+ exceptionCtor: __BaseException,
289
+ errorCode,
290
+ });
291
+ }
292
+ };
293
+ export const deserializeAws_json1_1GetStatementResultCommand = async (output, context) => {
294
+ if (output.statusCode >= 300) {
295
+ return deserializeAws_json1_1GetStatementResultCommandError(output, context);
296
+ }
297
+ const data = await parseBody(output.body, context);
298
+ let contents = {};
299
+ contents = deserializeAws_json1_1GetStatementResultResponse(data, context);
300
+ const response = {
301
+ $metadata: deserializeMetadata(output),
302
+ ...contents,
303
+ };
304
+ return Promise.resolve(response);
305
+ };
306
+ const deserializeAws_json1_1GetStatementResultCommandError = async (output, context) => {
307
+ const parsedOutput = {
308
+ ...output,
309
+ body: await parseErrorBody(output.body, context),
310
+ };
311
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
312
+ switch (errorCode) {
313
+ case "InternalServerException":
314
+ case "com.amazonaws.redshiftdata#InternalServerException":
315
+ throw await deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context);
316
+ case "ResourceNotFoundException":
317
+ case "com.amazonaws.redshiftdata#ResourceNotFoundException":
318
+ throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context);
319
+ case "ValidationException":
320
+ case "com.amazonaws.redshiftdata#ValidationException":
321
+ throw await deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context);
322
+ default:
323
+ const parsedBody = parsedOutput.body;
324
+ throwDefaultError({
325
+ output,
326
+ parsedBody,
327
+ exceptionCtor: __BaseException,
328
+ errorCode,
329
+ });
330
+ }
331
+ };
332
+ export const deserializeAws_json1_1ListDatabasesCommand = async (output, context) => {
333
+ if (output.statusCode >= 300) {
334
+ return deserializeAws_json1_1ListDatabasesCommandError(output, context);
335
+ }
336
+ const data = await parseBody(output.body, context);
337
+ let contents = {};
338
+ contents = deserializeAws_json1_1ListDatabasesResponse(data, context);
339
+ const response = {
340
+ $metadata: deserializeMetadata(output),
341
+ ...contents,
342
+ };
343
+ return Promise.resolve(response);
344
+ };
345
+ const deserializeAws_json1_1ListDatabasesCommandError = async (output, context) => {
346
+ const parsedOutput = {
347
+ ...output,
348
+ body: await parseErrorBody(output.body, context),
349
+ };
350
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
351
+ switch (errorCode) {
352
+ case "DatabaseConnectionException":
353
+ case "com.amazonaws.redshiftdata#DatabaseConnectionException":
354
+ throw await deserializeAws_json1_1DatabaseConnectionExceptionResponse(parsedOutput, context);
355
+ case "InternalServerException":
356
+ case "com.amazonaws.redshiftdata#InternalServerException":
357
+ throw await deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context);
358
+ case "ValidationException":
359
+ case "com.amazonaws.redshiftdata#ValidationException":
360
+ throw await deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context);
361
+ default:
362
+ const parsedBody = parsedOutput.body;
363
+ throwDefaultError({
364
+ output,
365
+ parsedBody,
366
+ exceptionCtor: __BaseException,
367
+ errorCode,
368
+ });
369
+ }
370
+ };
371
+ export const deserializeAws_json1_1ListSchemasCommand = async (output, context) => {
372
+ if (output.statusCode >= 300) {
373
+ return deserializeAws_json1_1ListSchemasCommandError(output, context);
374
+ }
375
+ const data = await parseBody(output.body, context);
376
+ let contents = {};
377
+ contents = deserializeAws_json1_1ListSchemasResponse(data, context);
378
+ const response = {
379
+ $metadata: deserializeMetadata(output),
380
+ ...contents,
381
+ };
382
+ return Promise.resolve(response);
383
+ };
384
+ const deserializeAws_json1_1ListSchemasCommandError = async (output, context) => {
385
+ const parsedOutput = {
386
+ ...output,
387
+ body: await parseErrorBody(output.body, context),
388
+ };
389
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
390
+ switch (errorCode) {
391
+ case "DatabaseConnectionException":
392
+ case "com.amazonaws.redshiftdata#DatabaseConnectionException":
393
+ throw await deserializeAws_json1_1DatabaseConnectionExceptionResponse(parsedOutput, context);
394
+ case "InternalServerException":
395
+ case "com.amazonaws.redshiftdata#InternalServerException":
396
+ throw await deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context);
397
+ case "ValidationException":
398
+ case "com.amazonaws.redshiftdata#ValidationException":
399
+ throw await deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context);
400
+ default:
401
+ const parsedBody = parsedOutput.body;
402
+ throwDefaultError({
403
+ output,
404
+ parsedBody,
405
+ exceptionCtor: __BaseException,
406
+ errorCode,
407
+ });
408
+ }
409
+ };
410
+ export const deserializeAws_json1_1ListStatementsCommand = async (output, context) => {
411
+ if (output.statusCode >= 300) {
412
+ return deserializeAws_json1_1ListStatementsCommandError(output, context);
413
+ }
414
+ const data = await parseBody(output.body, context);
415
+ let contents = {};
416
+ contents = deserializeAws_json1_1ListStatementsResponse(data, context);
417
+ const response = {
418
+ $metadata: deserializeMetadata(output),
419
+ ...contents,
420
+ };
421
+ return Promise.resolve(response);
422
+ };
423
+ const deserializeAws_json1_1ListStatementsCommandError = async (output, context) => {
424
+ const parsedOutput = {
425
+ ...output,
426
+ body: await parseErrorBody(output.body, context),
427
+ };
428
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
429
+ switch (errorCode) {
430
+ case "InternalServerException":
431
+ case "com.amazonaws.redshiftdata#InternalServerException":
432
+ throw await deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context);
433
+ case "ValidationException":
434
+ case "com.amazonaws.redshiftdata#ValidationException":
435
+ throw await deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context);
436
+ default:
437
+ const parsedBody = parsedOutput.body;
438
+ throwDefaultError({
439
+ output,
440
+ parsedBody,
441
+ exceptionCtor: __BaseException,
442
+ errorCode,
443
+ });
444
+ }
445
+ };
446
+ export const deserializeAws_json1_1ListTablesCommand = async (output, context) => {
447
+ if (output.statusCode >= 300) {
448
+ return deserializeAws_json1_1ListTablesCommandError(output, context);
449
+ }
450
+ const data = await parseBody(output.body, context);
451
+ let contents = {};
452
+ contents = deserializeAws_json1_1ListTablesResponse(data, context);
453
+ const response = {
454
+ $metadata: deserializeMetadata(output),
455
+ ...contents,
456
+ };
457
+ return Promise.resolve(response);
458
+ };
459
+ const deserializeAws_json1_1ListTablesCommandError = async (output, context) => {
460
+ const parsedOutput = {
461
+ ...output,
462
+ body: await parseErrorBody(output.body, context),
463
+ };
464
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
465
+ switch (errorCode) {
466
+ case "DatabaseConnectionException":
467
+ case "com.amazonaws.redshiftdata#DatabaseConnectionException":
468
+ throw await deserializeAws_json1_1DatabaseConnectionExceptionResponse(parsedOutput, context);
469
+ case "InternalServerException":
470
+ case "com.amazonaws.redshiftdata#InternalServerException":
471
+ throw await deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context);
472
+ case "ValidationException":
473
+ case "com.amazonaws.redshiftdata#ValidationException":
474
+ throw await deserializeAws_json1_1ValidationExceptionResponse(parsedOutput, context);
475
+ default:
476
+ const parsedBody = parsedOutput.body;
477
+ throwDefaultError({
478
+ output,
479
+ parsedBody,
480
+ exceptionCtor: __BaseException,
481
+ errorCode,
482
+ });
483
+ }
484
+ };
485
+ const deserializeAws_json1_1ActiveStatementsExceededExceptionResponse = async (parsedOutput, context) => {
486
+ const body = parsedOutput.body;
487
+ const deserialized = deserializeAws_json1_1ActiveStatementsExceededException(body, context);
488
+ const exception = new ActiveStatementsExceededException({
489
+ $metadata: deserializeMetadata(parsedOutput),
490
+ ...deserialized,
713
491
  });
714
- }); };
715
- var deserializeAws_json1_1BatchExecuteStatementExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
716
- var body, deserialized, exception;
717
- return __generator(this, function (_a) {
718
- body = parsedOutput.body;
719
- deserialized = deserializeAws_json1_1BatchExecuteStatementException(body, context);
720
- exception = new BatchExecuteStatementException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
721
- return [2, __decorateServiceException(exception, body)];
492
+ return __decorateServiceException(exception, body);
493
+ };
494
+ const deserializeAws_json1_1BatchExecuteStatementExceptionResponse = async (parsedOutput, context) => {
495
+ const body = parsedOutput.body;
496
+ const deserialized = deserializeAws_json1_1BatchExecuteStatementException(body, context);
497
+ const exception = new BatchExecuteStatementException({
498
+ $metadata: deserializeMetadata(parsedOutput),
499
+ ...deserialized,
722
500
  });
723
- }); };
724
- var deserializeAws_json1_1DatabaseConnectionExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
725
- var body, deserialized, exception;
726
- return __generator(this, function (_a) {
727
- body = parsedOutput.body;
728
- deserialized = deserializeAws_json1_1DatabaseConnectionException(body, context);
729
- exception = new DatabaseConnectionException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
730
- return [2, __decorateServiceException(exception, body)];
501
+ return __decorateServiceException(exception, body);
502
+ };
503
+ const deserializeAws_json1_1DatabaseConnectionExceptionResponse = async (parsedOutput, context) => {
504
+ const body = parsedOutput.body;
505
+ const deserialized = deserializeAws_json1_1DatabaseConnectionException(body, context);
506
+ const exception = new DatabaseConnectionException({
507
+ $metadata: deserializeMetadata(parsedOutput),
508
+ ...deserialized,
731
509
  });
732
- }); };
733
- var deserializeAws_json1_1ExecuteStatementExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
734
- var body, deserialized, exception;
735
- return __generator(this, function (_a) {
736
- body = parsedOutput.body;
737
- deserialized = deserializeAws_json1_1ExecuteStatementException(body, context);
738
- exception = new ExecuteStatementException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
739
- return [2, __decorateServiceException(exception, body)];
510
+ return __decorateServiceException(exception, body);
511
+ };
512
+ const deserializeAws_json1_1ExecuteStatementExceptionResponse = async (parsedOutput, context) => {
513
+ const body = parsedOutput.body;
514
+ const deserialized = deserializeAws_json1_1ExecuteStatementException(body, context);
515
+ const exception = new ExecuteStatementException({
516
+ $metadata: deserializeMetadata(parsedOutput),
517
+ ...deserialized,
740
518
  });
741
- }); };
742
- var deserializeAws_json1_1InternalServerExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
743
- var body, deserialized, exception;
744
- return __generator(this, function (_a) {
745
- body = parsedOutput.body;
746
- deserialized = deserializeAws_json1_1InternalServerException(body, context);
747
- exception = new InternalServerException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
748
- return [2, __decorateServiceException(exception, body)];
519
+ return __decorateServiceException(exception, body);
520
+ };
521
+ const deserializeAws_json1_1InternalServerExceptionResponse = async (parsedOutput, context) => {
522
+ const body = parsedOutput.body;
523
+ const deserialized = deserializeAws_json1_1InternalServerException(body, context);
524
+ const exception = new InternalServerException({
525
+ $metadata: deserializeMetadata(parsedOutput),
526
+ ...deserialized,
749
527
  });
750
- }); };
751
- var deserializeAws_json1_1ResourceNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
752
- var body, deserialized, exception;
753
- return __generator(this, function (_a) {
754
- body = parsedOutput.body;
755
- deserialized = deserializeAws_json1_1ResourceNotFoundException(body, context);
756
- exception = new ResourceNotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
757
- return [2, __decorateServiceException(exception, body)];
528
+ return __decorateServiceException(exception, body);
529
+ };
530
+ const deserializeAws_json1_1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
531
+ const body = parsedOutput.body;
532
+ const deserialized = deserializeAws_json1_1ResourceNotFoundException(body, context);
533
+ const exception = new ResourceNotFoundException({
534
+ $metadata: deserializeMetadata(parsedOutput),
535
+ ...deserialized,
758
536
  });
759
- }); };
760
- var deserializeAws_json1_1ValidationExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
761
- var body, deserialized, exception;
762
- return __generator(this, function (_a) {
763
- body = parsedOutput.body;
764
- deserialized = deserializeAws_json1_1ValidationException(body, context);
765
- exception = new ValidationException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
766
- return [2, __decorateServiceException(exception, body)];
537
+ return __decorateServiceException(exception, body);
538
+ };
539
+ const deserializeAws_json1_1ValidationExceptionResponse = async (parsedOutput, context) => {
540
+ const body = parsedOutput.body;
541
+ const deserialized = deserializeAws_json1_1ValidationException(body, context);
542
+ const exception = new ValidationException({
543
+ $metadata: deserializeMetadata(parsedOutput),
544
+ ...deserialized,
767
545
  });
768
- }); };
769
- var serializeAws_json1_1BatchExecuteStatementInput = function (input, context) {
770
- return __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.ClusterIdentifier != null && { ClusterIdentifier: input.ClusterIdentifier })), (input.Database != null && { Database: input.Database })), (input.DbUser != null && { DbUser: input.DbUser })), (input.SecretArn != null && { SecretArn: input.SecretArn })), (input.Sqls != null && { Sqls: serializeAws_json1_1SqlList(input.Sqls, context) })), (input.StatementName != null && { StatementName: input.StatementName })), (input.WithEvent != null && { WithEvent: input.WithEvent })), (input.WorkgroupName != null && { WorkgroupName: input.WorkgroupName }));
546
+ return __decorateServiceException(exception, body);
771
547
  };
772
- var serializeAws_json1_1CancelStatementRequest = function (input, context) {
773
- return __assign({}, (input.Id != null && { Id: input.Id }));
548
+ const serializeAws_json1_1BatchExecuteStatementInput = (input, context) => {
549
+ return {
550
+ ...(input.ClusterIdentifier != null && { ClusterIdentifier: input.ClusterIdentifier }),
551
+ ...(input.Database != null && { Database: input.Database }),
552
+ ...(input.DbUser != null && { DbUser: input.DbUser }),
553
+ ...(input.SecretArn != null && { SecretArn: input.SecretArn }),
554
+ ...(input.Sqls != null && { Sqls: serializeAws_json1_1SqlList(input.Sqls, context) }),
555
+ ...(input.StatementName != null && { StatementName: input.StatementName }),
556
+ ...(input.WithEvent != null && { WithEvent: input.WithEvent }),
557
+ ...(input.WorkgroupName != null && { WorkgroupName: input.WorkgroupName }),
558
+ };
774
559
  };
775
- var serializeAws_json1_1DescribeStatementRequest = function (input, context) {
776
- return __assign({}, (input.Id != null && { Id: input.Id }));
560
+ const serializeAws_json1_1CancelStatementRequest = (input, context) => {
561
+ return {
562
+ ...(input.Id != null && { Id: input.Id }),
563
+ };
777
564
  };
778
- var serializeAws_json1_1DescribeTableRequest = function (input, context) {
779
- return __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.ClusterIdentifier != null && { ClusterIdentifier: input.ClusterIdentifier })), (input.ConnectedDatabase != null && { ConnectedDatabase: input.ConnectedDatabase })), (input.Database != null && { Database: input.Database })), (input.DbUser != null && { DbUser: input.DbUser })), (input.MaxResults != null && { MaxResults: input.MaxResults })), (input.NextToken != null && { NextToken: input.NextToken })), (input.Schema != null && { Schema: input.Schema })), (input.SecretArn != null && { SecretArn: input.SecretArn })), (input.Table != null && { Table: input.Table })), (input.WorkgroupName != null && { WorkgroupName: input.WorkgroupName }));
565
+ const serializeAws_json1_1DescribeStatementRequest = (input, context) => {
566
+ return {
567
+ ...(input.Id != null && { Id: input.Id }),
568
+ };
780
569
  };
781
- var serializeAws_json1_1ExecuteStatementInput = function (input, context) {
782
- return __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.ClusterIdentifier != null && { ClusterIdentifier: input.ClusterIdentifier })), (input.Database != null && { Database: input.Database })), (input.DbUser != null && { DbUser: input.DbUser })), (input.Parameters != null && { Parameters: serializeAws_json1_1SqlParametersList(input.Parameters, context) })), (input.SecretArn != null && { SecretArn: input.SecretArn })), (input.Sql != null && { Sql: input.Sql })), (input.StatementName != null && { StatementName: input.StatementName })), (input.WithEvent != null && { WithEvent: input.WithEvent })), (input.WorkgroupName != null && { WorkgroupName: input.WorkgroupName }));
570
+ const serializeAws_json1_1DescribeTableRequest = (input, context) => {
571
+ return {
572
+ ...(input.ClusterIdentifier != null && { ClusterIdentifier: input.ClusterIdentifier }),
573
+ ...(input.ConnectedDatabase != null && { ConnectedDatabase: input.ConnectedDatabase }),
574
+ ...(input.Database != null && { Database: input.Database }),
575
+ ...(input.DbUser != null && { DbUser: input.DbUser }),
576
+ ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
577
+ ...(input.NextToken != null && { NextToken: input.NextToken }),
578
+ ...(input.Schema != null && { Schema: input.Schema }),
579
+ ...(input.SecretArn != null && { SecretArn: input.SecretArn }),
580
+ ...(input.Table != null && { Table: input.Table }),
581
+ ...(input.WorkgroupName != null && { WorkgroupName: input.WorkgroupName }),
582
+ };
783
583
  };
784
- var serializeAws_json1_1GetStatementResultRequest = function (input, context) {
785
- return __assign(__assign({}, (input.Id != null && { Id: input.Id })), (input.NextToken != null && { NextToken: input.NextToken }));
584
+ const serializeAws_json1_1ExecuteStatementInput = (input, context) => {
585
+ return {
586
+ ...(input.ClusterIdentifier != null && { ClusterIdentifier: input.ClusterIdentifier }),
587
+ ...(input.Database != null && { Database: input.Database }),
588
+ ...(input.DbUser != null && { DbUser: input.DbUser }),
589
+ ...(input.Parameters != null && { Parameters: serializeAws_json1_1SqlParametersList(input.Parameters, context) }),
590
+ ...(input.SecretArn != null && { SecretArn: input.SecretArn }),
591
+ ...(input.Sql != null && { Sql: input.Sql }),
592
+ ...(input.StatementName != null && { StatementName: input.StatementName }),
593
+ ...(input.WithEvent != null && { WithEvent: input.WithEvent }),
594
+ ...(input.WorkgroupName != null && { WorkgroupName: input.WorkgroupName }),
595
+ };
786
596
  };
787
- var serializeAws_json1_1ListDatabasesRequest = function (input, context) {
788
- return __assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.ClusterIdentifier != null && { ClusterIdentifier: input.ClusterIdentifier })), (input.Database != null && { Database: input.Database })), (input.DbUser != null && { DbUser: input.DbUser })), (input.MaxResults != null && { MaxResults: input.MaxResults })), (input.NextToken != null && { NextToken: input.NextToken })), (input.SecretArn != null && { SecretArn: input.SecretArn })), (input.WorkgroupName != null && { WorkgroupName: input.WorkgroupName }));
597
+ const serializeAws_json1_1GetStatementResultRequest = (input, context) => {
598
+ return {
599
+ ...(input.Id != null && { Id: input.Id }),
600
+ ...(input.NextToken != null && { NextToken: input.NextToken }),
601
+ };
789
602
  };
790
- var serializeAws_json1_1ListSchemasRequest = function (input, context) {
791
- return __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.ClusterIdentifier != null && { ClusterIdentifier: input.ClusterIdentifier })), (input.ConnectedDatabase != null && { ConnectedDatabase: input.ConnectedDatabase })), (input.Database != null && { Database: input.Database })), (input.DbUser != null && { DbUser: input.DbUser })), (input.MaxResults != null && { MaxResults: input.MaxResults })), (input.NextToken != null && { NextToken: input.NextToken })), (input.SchemaPattern != null && { SchemaPattern: input.SchemaPattern })), (input.SecretArn != null && { SecretArn: input.SecretArn })), (input.WorkgroupName != null && { WorkgroupName: input.WorkgroupName }));
603
+ const serializeAws_json1_1ListDatabasesRequest = (input, context) => {
604
+ return {
605
+ ...(input.ClusterIdentifier != null && { ClusterIdentifier: input.ClusterIdentifier }),
606
+ ...(input.Database != null && { Database: input.Database }),
607
+ ...(input.DbUser != null && { DbUser: input.DbUser }),
608
+ ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
609
+ ...(input.NextToken != null && { NextToken: input.NextToken }),
610
+ ...(input.SecretArn != null && { SecretArn: input.SecretArn }),
611
+ ...(input.WorkgroupName != null && { WorkgroupName: input.WorkgroupName }),
612
+ };
792
613
  };
793
- var serializeAws_json1_1ListStatementsRequest = function (input, context) {
794
- return __assign(__assign(__assign(__assign(__assign({}, (input.MaxResults != null && { MaxResults: input.MaxResults })), (input.NextToken != null && { NextToken: input.NextToken })), (input.RoleLevel != null && { RoleLevel: input.RoleLevel })), (input.StatementName != null && { StatementName: input.StatementName })), (input.Status != null && { Status: input.Status }));
614
+ const serializeAws_json1_1ListSchemasRequest = (input, context) => {
615
+ return {
616
+ ...(input.ClusterIdentifier != null && { ClusterIdentifier: input.ClusterIdentifier }),
617
+ ...(input.ConnectedDatabase != null && { ConnectedDatabase: input.ConnectedDatabase }),
618
+ ...(input.Database != null && { Database: input.Database }),
619
+ ...(input.DbUser != null && { DbUser: input.DbUser }),
620
+ ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
621
+ ...(input.NextToken != null && { NextToken: input.NextToken }),
622
+ ...(input.SchemaPattern != null && { SchemaPattern: input.SchemaPattern }),
623
+ ...(input.SecretArn != null && { SecretArn: input.SecretArn }),
624
+ ...(input.WorkgroupName != null && { WorkgroupName: input.WorkgroupName }),
625
+ };
795
626
  };
796
- var serializeAws_json1_1ListTablesRequest = function (input, context) {
797
- return __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.ClusterIdentifier != null && { ClusterIdentifier: input.ClusterIdentifier })), (input.ConnectedDatabase != null && { ConnectedDatabase: input.ConnectedDatabase })), (input.Database != null && { Database: input.Database })), (input.DbUser != null && { DbUser: input.DbUser })), (input.MaxResults != null && { MaxResults: input.MaxResults })), (input.NextToken != null && { NextToken: input.NextToken })), (input.SchemaPattern != null && { SchemaPattern: input.SchemaPattern })), (input.SecretArn != null && { SecretArn: input.SecretArn })), (input.TablePattern != null && { TablePattern: input.TablePattern })), (input.WorkgroupName != null && { WorkgroupName: input.WorkgroupName }));
627
+ const serializeAws_json1_1ListStatementsRequest = (input, context) => {
628
+ return {
629
+ ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
630
+ ...(input.NextToken != null && { NextToken: input.NextToken }),
631
+ ...(input.RoleLevel != null && { RoleLevel: input.RoleLevel }),
632
+ ...(input.StatementName != null && { StatementName: input.StatementName }),
633
+ ...(input.Status != null && { Status: input.Status }),
634
+ };
798
635
  };
799
- var serializeAws_json1_1SqlList = function (input, context) {
636
+ const serializeAws_json1_1ListTablesRequest = (input, context) => {
637
+ return {
638
+ ...(input.ClusterIdentifier != null && { ClusterIdentifier: input.ClusterIdentifier }),
639
+ ...(input.ConnectedDatabase != null && { ConnectedDatabase: input.ConnectedDatabase }),
640
+ ...(input.Database != null && { Database: input.Database }),
641
+ ...(input.DbUser != null && { DbUser: input.DbUser }),
642
+ ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
643
+ ...(input.NextToken != null && { NextToken: input.NextToken }),
644
+ ...(input.SchemaPattern != null && { SchemaPattern: input.SchemaPattern }),
645
+ ...(input.SecretArn != null && { SecretArn: input.SecretArn }),
646
+ ...(input.TablePattern != null && { TablePattern: input.TablePattern }),
647
+ ...(input.WorkgroupName != null && { WorkgroupName: input.WorkgroupName }),
648
+ };
649
+ };
650
+ const serializeAws_json1_1SqlList = (input, context) => {
800
651
  return input
801
- .filter(function (e) { return e != null; })
802
- .map(function (entry) {
652
+ .filter((e) => e != null)
653
+ .map((entry) => {
803
654
  return entry;
804
655
  });
805
656
  };
806
- var serializeAws_json1_1SqlParameter = function (input, context) {
807
- return __assign(__assign({}, (input.name != null && { name: input.name })), (input.value != null && { value: input.value }));
657
+ const serializeAws_json1_1SqlParameter = (input, context) => {
658
+ return {
659
+ ...(input.name != null && { name: input.name }),
660
+ ...(input.value != null && { value: input.value }),
661
+ };
808
662
  };
809
- var serializeAws_json1_1SqlParametersList = function (input, context) {
663
+ const serializeAws_json1_1SqlParametersList = (input, context) => {
810
664
  return input
811
- .filter(function (e) { return e != null; })
812
- .map(function (entry) {
665
+ .filter((e) => e != null)
666
+ .map((entry) => {
813
667
  return serializeAws_json1_1SqlParameter(entry, context);
814
668
  });
815
669
  };
816
- var deserializeAws_json1_1ActiveStatementsExceededException = function (output, context) {
670
+ const deserializeAws_json1_1ActiveStatementsExceededException = (output, context) => {
817
671
  return {
818
672
  Message: __expectString(output.Message),
819
673
  };
820
674
  };
821
- var deserializeAws_json1_1BatchExecuteStatementException = function (output, context) {
675
+ const deserializeAws_json1_1BatchExecuteStatementException = (output, context) => {
822
676
  return {
823
677
  Message: __expectString(output.Message),
824
678
  StatementId: __expectString(output.StatementId),
825
679
  };
826
680
  };
827
- var deserializeAws_json1_1BatchExecuteStatementOutput = function (output, context) {
681
+ const deserializeAws_json1_1BatchExecuteStatementOutput = (output, context) => {
828
682
  return {
829
683
  ClusterIdentifier: __expectString(output.ClusterIdentifier),
830
684
  CreatedAt: output.CreatedAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreatedAt))) : undefined,
@@ -835,15 +689,15 @@ var deserializeAws_json1_1BatchExecuteStatementOutput = function (output, contex
835
689
  WorkgroupName: __expectString(output.WorkgroupName),
836
690
  };
837
691
  };
838
- var deserializeAws_json1_1CancelStatementResponse = function (output, context) {
692
+ const deserializeAws_json1_1CancelStatementResponse = (output, context) => {
839
693
  return {
840
694
  Status: __expectBoolean(output.Status),
841
695
  };
842
696
  };
843
- var deserializeAws_json1_1ColumnList = function (output, context) {
844
- var retVal = (output || [])
845
- .filter(function (e) { return e != null; })
846
- .map(function (entry) {
697
+ const deserializeAws_json1_1ColumnList = (output, context) => {
698
+ const retVal = (output || [])
699
+ .filter((e) => e != null)
700
+ .map((entry) => {
847
701
  if (entry === null) {
848
702
  return null;
849
703
  }
@@ -851,7 +705,7 @@ var deserializeAws_json1_1ColumnList = function (output, context) {
851
705
  });
852
706
  return retVal;
853
707
  };
854
- var deserializeAws_json1_1ColumnMetadata = function (output, context) {
708
+ const deserializeAws_json1_1ColumnMetadata = (output, context) => {
855
709
  return {
856
710
  columnDefault: __expectString(output.columnDefault),
857
711
  isCaseSensitive: __expectBoolean(output.isCaseSensitive),
@@ -868,10 +722,10 @@ var deserializeAws_json1_1ColumnMetadata = function (output, context) {
868
722
  typeName: __expectString(output.typeName),
869
723
  };
870
724
  };
871
- var deserializeAws_json1_1ColumnMetadataList = function (output, context) {
872
- var retVal = (output || [])
873
- .filter(function (e) { return e != null; })
874
- .map(function (entry) {
725
+ const deserializeAws_json1_1ColumnMetadataList = (output, context) => {
726
+ const retVal = (output || [])
727
+ .filter((e) => e != null)
728
+ .map((entry) => {
875
729
  if (entry === null) {
876
730
  return null;
877
731
  }
@@ -879,15 +733,15 @@ var deserializeAws_json1_1ColumnMetadataList = function (output, context) {
879
733
  });
880
734
  return retVal;
881
735
  };
882
- var deserializeAws_json1_1DatabaseConnectionException = function (output, context) {
736
+ const deserializeAws_json1_1DatabaseConnectionException = (output, context) => {
883
737
  return {
884
738
  Message: __expectString(output.Message),
885
739
  };
886
740
  };
887
- var deserializeAws_json1_1DatabaseList = function (output, context) {
888
- var retVal = (output || [])
889
- .filter(function (e) { return e != null; })
890
- .map(function (entry) {
741
+ const deserializeAws_json1_1DatabaseList = (output, context) => {
742
+ const retVal = (output || [])
743
+ .filter((e) => e != null)
744
+ .map((entry) => {
891
745
  if (entry === null) {
892
746
  return null;
893
747
  }
@@ -895,7 +749,7 @@ var deserializeAws_json1_1DatabaseList = function (output, context) {
895
749
  });
896
750
  return retVal;
897
751
  };
898
- var deserializeAws_json1_1DescribeStatementResponse = function (output, context) {
752
+ const deserializeAws_json1_1DescribeStatementResponse = (output, context) => {
899
753
  return {
900
754
  ClusterIdentifier: __expectString(output.ClusterIdentifier),
901
755
  CreatedAt: output.CreatedAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreatedAt))) : undefined,
@@ -920,20 +774,20 @@ var deserializeAws_json1_1DescribeStatementResponse = function (output, context)
920
774
  WorkgroupName: __expectString(output.WorkgroupName),
921
775
  };
922
776
  };
923
- var deserializeAws_json1_1DescribeTableResponse = function (output, context) {
777
+ const deserializeAws_json1_1DescribeTableResponse = (output, context) => {
924
778
  return {
925
779
  ColumnList: output.ColumnList != null ? deserializeAws_json1_1ColumnList(output.ColumnList, context) : undefined,
926
780
  NextToken: __expectString(output.NextToken),
927
781
  TableName: __expectString(output.TableName),
928
782
  };
929
783
  };
930
- var deserializeAws_json1_1ExecuteStatementException = function (output, context) {
784
+ const deserializeAws_json1_1ExecuteStatementException = (output, context) => {
931
785
  return {
932
786
  Message: __expectString(output.Message),
933
787
  StatementId: __expectString(output.StatementId),
934
788
  };
935
789
  };
936
- var deserializeAws_json1_1ExecuteStatementOutput = function (output, context) {
790
+ const deserializeAws_json1_1ExecuteStatementOutput = (output, context) => {
937
791
  return {
938
792
  ClusterIdentifier: __expectString(output.ClusterIdentifier),
939
793
  CreatedAt: output.CreatedAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreatedAt))) : undefined,
@@ -944,7 +798,7 @@ var deserializeAws_json1_1ExecuteStatementOutput = function (output, context) {
944
798
  WorkgroupName: __expectString(output.WorkgroupName),
945
799
  };
946
800
  };
947
- var deserializeAws_json1_1Field = function (output, context) {
801
+ const deserializeAws_json1_1Field = (output, context) => {
948
802
  if (output.blobValue != null) {
949
803
  return {
950
804
  blobValue: context.base64Decoder(output.blobValue),
@@ -967,10 +821,10 @@ var deserializeAws_json1_1Field = function (output, context) {
967
821
  }
968
822
  return { $unknown: Object.entries(output)[0] };
969
823
  };
970
- var deserializeAws_json1_1FieldList = function (output, context) {
971
- var retVal = (output || [])
972
- .filter(function (e) { return e != null; })
973
- .map(function (entry) {
824
+ const deserializeAws_json1_1FieldList = (output, context) => {
825
+ const retVal = (output || [])
826
+ .filter((e) => e != null)
827
+ .map((entry) => {
974
828
  if (entry === null) {
975
829
  return null;
976
830
  }
@@ -978,7 +832,7 @@ var deserializeAws_json1_1FieldList = function (output, context) {
978
832
  });
979
833
  return retVal;
980
834
  };
981
- var deserializeAws_json1_1GetStatementResultResponse = function (output, context) {
835
+ const deserializeAws_json1_1GetStatementResultResponse = (output, context) => {
982
836
  return {
983
837
  ColumnMetadata: output.ColumnMetadata != null
984
838
  ? deserializeAws_json1_1ColumnMetadataList(output.ColumnMetadata, context)
@@ -988,45 +842,45 @@ var deserializeAws_json1_1GetStatementResultResponse = function (output, context
988
842
  TotalNumRows: __expectLong(output.TotalNumRows),
989
843
  };
990
844
  };
991
- var deserializeAws_json1_1InternalServerException = function (output, context) {
845
+ const deserializeAws_json1_1InternalServerException = (output, context) => {
992
846
  return {
993
847
  Message: __expectString(output.Message),
994
848
  };
995
849
  };
996
- var deserializeAws_json1_1ListDatabasesResponse = function (output, context) {
850
+ const deserializeAws_json1_1ListDatabasesResponse = (output, context) => {
997
851
  return {
998
852
  Databases: output.Databases != null ? deserializeAws_json1_1DatabaseList(output.Databases, context) : undefined,
999
853
  NextToken: __expectString(output.NextToken),
1000
854
  };
1001
855
  };
1002
- var deserializeAws_json1_1ListSchemasResponse = function (output, context) {
856
+ const deserializeAws_json1_1ListSchemasResponse = (output, context) => {
1003
857
  return {
1004
858
  NextToken: __expectString(output.NextToken),
1005
859
  Schemas: output.Schemas != null ? deserializeAws_json1_1SchemaList(output.Schemas, context) : undefined,
1006
860
  };
1007
861
  };
1008
- var deserializeAws_json1_1ListStatementsResponse = function (output, context) {
862
+ const deserializeAws_json1_1ListStatementsResponse = (output, context) => {
1009
863
  return {
1010
864
  NextToken: __expectString(output.NextToken),
1011
865
  Statements: output.Statements != null ? deserializeAws_json1_1StatementList(output.Statements, context) : undefined,
1012
866
  };
1013
867
  };
1014
- var deserializeAws_json1_1ListTablesResponse = function (output, context) {
868
+ const deserializeAws_json1_1ListTablesResponse = (output, context) => {
1015
869
  return {
1016
870
  NextToken: __expectString(output.NextToken),
1017
871
  Tables: output.Tables != null ? deserializeAws_json1_1TableList(output.Tables, context) : undefined,
1018
872
  };
1019
873
  };
1020
- var deserializeAws_json1_1ResourceNotFoundException = function (output, context) {
874
+ const deserializeAws_json1_1ResourceNotFoundException = (output, context) => {
1021
875
  return {
1022
876
  Message: __expectString(output.Message),
1023
877
  ResourceId: __expectString(output.ResourceId),
1024
878
  };
1025
879
  };
1026
- var deserializeAws_json1_1SchemaList = function (output, context) {
1027
- var retVal = (output || [])
1028
- .filter(function (e) { return e != null; })
1029
- .map(function (entry) {
880
+ const deserializeAws_json1_1SchemaList = (output, context) => {
881
+ const retVal = (output || [])
882
+ .filter((e) => e != null)
883
+ .map((entry) => {
1030
884
  if (entry === null) {
1031
885
  return null;
1032
886
  }
@@ -1034,16 +888,16 @@ var deserializeAws_json1_1SchemaList = function (output, context) {
1034
888
  });
1035
889
  return retVal;
1036
890
  };
1037
- var deserializeAws_json1_1SqlParameter = function (output, context) {
891
+ const deserializeAws_json1_1SqlParameter = (output, context) => {
1038
892
  return {
1039
893
  name: __expectString(output.name),
1040
894
  value: __expectString(output.value),
1041
895
  };
1042
896
  };
1043
- var deserializeAws_json1_1SqlParametersList = function (output, context) {
1044
- var retVal = (output || [])
1045
- .filter(function (e) { return e != null; })
1046
- .map(function (entry) {
897
+ const deserializeAws_json1_1SqlParametersList = (output, context) => {
898
+ const retVal = (output || [])
899
+ .filter((e) => e != null)
900
+ .map((entry) => {
1047
901
  if (entry === null) {
1048
902
  return null;
1049
903
  }
@@ -1051,10 +905,10 @@ var deserializeAws_json1_1SqlParametersList = function (output, context) {
1051
905
  });
1052
906
  return retVal;
1053
907
  };
1054
- var deserializeAws_json1_1SqlRecords = function (output, context) {
1055
- var retVal = (output || [])
1056
- .filter(function (e) { return e != null; })
1057
- .map(function (entry) {
908
+ const deserializeAws_json1_1SqlRecords = (output, context) => {
909
+ const retVal = (output || [])
910
+ .filter((e) => e != null)
911
+ .map((entry) => {
1058
912
  if (entry === null) {
1059
913
  return null;
1060
914
  }
@@ -1062,7 +916,7 @@ var deserializeAws_json1_1SqlRecords = function (output, context) {
1062
916
  });
1063
917
  return retVal;
1064
918
  };
1065
- var deserializeAws_json1_1StatementData = function (output, context) {
919
+ const deserializeAws_json1_1StatementData = (output, context) => {
1066
920
  return {
1067
921
  CreatedAt: output.CreatedAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreatedAt))) : undefined,
1068
922
  Id: __expectString(output.Id),
@@ -1078,10 +932,10 @@ var deserializeAws_json1_1StatementData = function (output, context) {
1078
932
  UpdatedAt: output.UpdatedAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.UpdatedAt))) : undefined,
1079
933
  };
1080
934
  };
1081
- var deserializeAws_json1_1StatementList = function (output, context) {
1082
- var retVal = (output || [])
1083
- .filter(function (e) { return e != null; })
1084
- .map(function (entry) {
935
+ const deserializeAws_json1_1StatementList = (output, context) => {
936
+ const retVal = (output || [])
937
+ .filter((e) => e != null)
938
+ .map((entry) => {
1085
939
  if (entry === null) {
1086
940
  return null;
1087
941
  }
@@ -1089,10 +943,10 @@ var deserializeAws_json1_1StatementList = function (output, context) {
1089
943
  });
1090
944
  return retVal;
1091
945
  };
1092
- var deserializeAws_json1_1StatementStringList = function (output, context) {
1093
- var retVal = (output || [])
1094
- .filter(function (e) { return e != null; })
1095
- .map(function (entry) {
946
+ const deserializeAws_json1_1StatementStringList = (output, context) => {
947
+ const retVal = (output || [])
948
+ .filter((e) => e != null)
949
+ .map((entry) => {
1096
950
  if (entry === null) {
1097
951
  return null;
1098
952
  }
@@ -1100,7 +954,7 @@ var deserializeAws_json1_1StatementStringList = function (output, context) {
1100
954
  });
1101
955
  return retVal;
1102
956
  };
1103
- var deserializeAws_json1_1SubStatementData = function (output, context) {
957
+ const deserializeAws_json1_1SubStatementData = (output, context) => {
1104
958
  return {
1105
959
  CreatedAt: output.CreatedAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreatedAt))) : undefined,
1106
960
  Duration: __expectLong(output.Duration),
@@ -1115,10 +969,10 @@ var deserializeAws_json1_1SubStatementData = function (output, context) {
1115
969
  UpdatedAt: output.UpdatedAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.UpdatedAt))) : undefined,
1116
970
  };
1117
971
  };
1118
- var deserializeAws_json1_1SubStatementList = function (output, context) {
1119
- var retVal = (output || [])
1120
- .filter(function (e) { return e != null; })
1121
- .map(function (entry) {
972
+ const deserializeAws_json1_1SubStatementList = (output, context) => {
973
+ const retVal = (output || [])
974
+ .filter((e) => e != null)
975
+ .map((entry) => {
1122
976
  if (entry === null) {
1123
977
  return null;
1124
978
  }
@@ -1126,10 +980,10 @@ var deserializeAws_json1_1SubStatementList = function (output, context) {
1126
980
  });
1127
981
  return retVal;
1128
982
  };
1129
- var deserializeAws_json1_1TableList = function (output, context) {
1130
- var retVal = (output || [])
1131
- .filter(function (e) { return e != null; })
1132
- .map(function (entry) {
983
+ const deserializeAws_json1_1TableList = (output, context) => {
984
+ const retVal = (output || [])
985
+ .filter((e) => e != null)
986
+ .map((entry) => {
1133
987
  if (entry === null) {
1134
988
  return null;
1135
989
  }
@@ -1137,87 +991,64 @@ var deserializeAws_json1_1TableList = function (output, context) {
1137
991
  });
1138
992
  return retVal;
1139
993
  };
1140
- var deserializeAws_json1_1TableMember = function (output, context) {
994
+ const deserializeAws_json1_1TableMember = (output, context) => {
1141
995
  return {
1142
996
  name: __expectString(output.name),
1143
997
  schema: __expectString(output.schema),
1144
998
  type: __expectString(output.type),
1145
999
  };
1146
1000
  };
1147
- var deserializeAws_json1_1ValidationException = function (output, context) {
1001
+ const deserializeAws_json1_1ValidationException = (output, context) => {
1148
1002
  return {
1149
1003
  Message: __expectString(output.Message),
1150
1004
  };
1151
1005
  };
1152
- var deserializeMetadata = function (output) {
1153
- var _a;
1154
- return ({
1155
- httpStatusCode: output.statusCode,
1156
- requestId: (_a = output.headers["x-amzn-requestid"]) !== null && _a !== void 0 ? _a : output.headers["x-amzn-request-id"],
1157
- extendedRequestId: output.headers["x-amz-id-2"],
1158
- cfId: output.headers["x-amz-cf-id"],
1159
- });
1160
- };
1161
- var collectBody = function (streamBody, context) {
1162
- if (streamBody === void 0) { streamBody = new Uint8Array(); }
1006
+ const deserializeMetadata = (output) => ({
1007
+ httpStatusCode: output.statusCode,
1008
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"],
1009
+ extendedRequestId: output.headers["x-amz-id-2"],
1010
+ cfId: output.headers["x-amz-cf-id"],
1011
+ });
1012
+ const collectBody = (streamBody = new Uint8Array(), context) => {
1163
1013
  if (streamBody instanceof Uint8Array) {
1164
1014
  return Promise.resolve(streamBody);
1165
1015
  }
1166
1016
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
1167
1017
  };
1168
- var collectBodyString = function (streamBody, context) {
1169
- return collectBody(streamBody, context).then(function (body) { return context.utf8Encoder(body); });
1170
- };
1171
- var buildHttpRpcRequest = function (context, headers, path, resolvedHostname, body) { return __awaiter(void 0, void 0, void 0, function () {
1172
- var _a, hostname, _b, protocol, port, basePath, contents;
1173
- return __generator(this, function (_c) {
1174
- switch (_c.label) {
1175
- case 0: return [4, context.endpoint()];
1176
- case 1:
1177
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
1178
- contents = {
1179
- protocol: protocol,
1180
- hostname: hostname,
1181
- port: port,
1182
- method: "POST",
1183
- path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
1184
- headers: headers,
1185
- };
1186
- if (resolvedHostname !== undefined) {
1187
- contents.hostname = resolvedHostname;
1188
- }
1189
- if (body !== undefined) {
1190
- contents.body = body;
1191
- }
1192
- return [2, new __HttpRequest(contents)];
1193
- }
1194
- });
1195
- }); };
1196
- var parseBody = function (streamBody, context) {
1197
- return collectBodyString(streamBody, context).then(function (encoded) {
1198
- if (encoded.length) {
1199
- return JSON.parse(encoded);
1200
- }
1201
- return {};
1202
- });
1018
+ const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
1019
+ const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
1020
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
1021
+ const contents = {
1022
+ protocol,
1023
+ hostname,
1024
+ port,
1025
+ method: "POST",
1026
+ path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
1027
+ headers,
1028
+ };
1029
+ if (resolvedHostname !== undefined) {
1030
+ contents.hostname = resolvedHostname;
1031
+ }
1032
+ if (body !== undefined) {
1033
+ contents.body = body;
1034
+ }
1035
+ return new __HttpRequest(contents);
1203
1036
  };
1204
- var parseErrorBody = function (errorBody, context) { return __awaiter(void 0, void 0, void 0, function () {
1205
- var value;
1206
- var _a;
1207
- return __generator(this, function (_b) {
1208
- switch (_b.label) {
1209
- case 0: return [4, parseBody(errorBody, context)];
1210
- case 1:
1211
- value = _b.sent();
1212
- value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message;
1213
- return [2, value];
1214
- }
1215
- });
1216
- }); };
1217
- var loadRestJsonErrorCode = function (output, data) {
1218
- var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
1219
- var sanitizeErrorCode = function (rawValue) {
1220
- var cleanValue = rawValue;
1037
+ const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1038
+ if (encoded.length) {
1039
+ return JSON.parse(encoded);
1040
+ }
1041
+ return {};
1042
+ });
1043
+ const parseErrorBody = async (errorBody, context) => {
1044
+ const value = await parseBody(errorBody, context);
1045
+ value.message = value.message ?? value.Message;
1046
+ return value;
1047
+ };
1048
+ const loadRestJsonErrorCode = (output, data) => {
1049
+ const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
1050
+ const sanitizeErrorCode = (rawValue) => {
1051
+ let cleanValue = rawValue;
1221
1052
  if (typeof cleanValue === "number") {
1222
1053
  cleanValue = cleanValue.toString();
1223
1054
  }
@@ -1232,7 +1063,7 @@ var loadRestJsonErrorCode = function (output, data) {
1232
1063
  }
1233
1064
  return cleanValue;
1234
1065
  };
1235
- var headerKey = findKey(output.headers, "x-amzn-errortype");
1066
+ const headerKey = findKey(output.headers, "x-amzn-errortype");
1236
1067
  if (headerKey !== undefined) {
1237
1068
  return sanitizeErrorCode(output.headers[headerKey]);
1238
1069
  }