@aws-sdk/client-rds-data 3.183.0 → 3.186.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,631 +1,791 @@
1
+ import { __assign, __awaiter, __generator } from "tslib";
1
2
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
2
3
  import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectLong as __expectLong, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, expectUnion as __expectUnion, limitedParseDouble as __limitedParseDouble, limitedParseFloat32 as __limitedParseFloat32, map as __map, serializeFloat as __serializeFloat, throwDefaultError, } from "@aws-sdk/smithy-client";
3
4
  import { AccessDeniedException, ArrayValue, BadRequestException, Field, ForbiddenException, InternalServerErrorException, NotFoundException, ServiceUnavailableError, StatementTimeoutException, } from "../models/models_0";
4
5
  import { RDSDataServiceException as __BaseException } from "../models/RDSDataServiceException";
5
- export const serializeAws_restJson1BatchExecuteStatementCommand = async (input, context) => {
6
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
7
- const headers = {
8
- "content-type": "application/json",
9
- };
10
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/BatchExecute";
11
- let body;
12
- body = JSON.stringify({
13
- ...(input.database != null && { database: input.database }),
14
- ...(input.parameterSets != null && {
15
- parameterSets: serializeAws_restJson1SqlParameterSets(input.parameterSets, context),
16
- }),
17
- ...(input.resourceArn != null && { resourceArn: input.resourceArn }),
18
- ...(input.schema != null && { schema: input.schema }),
19
- ...(input.secretArn != null && { secretArn: input.secretArn }),
20
- ...(input.sql != null && { sql: input.sql }),
21
- ...(input.transactionId != null && { transactionId: input.transactionId }),
22
- });
23
- return new __HttpRequest({
24
- protocol,
25
- hostname,
26
- port,
27
- method: "POST",
28
- headers,
29
- path: resolvedPath,
30
- body,
31
- });
32
- };
33
- export const serializeAws_restJson1BeginTransactionCommand = async (input, context) => {
34
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
35
- const headers = {
36
- "content-type": "application/json",
37
- };
38
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/BeginTransaction";
39
- let body;
40
- body = JSON.stringify({
41
- ...(input.database != null && { database: input.database }),
42
- ...(input.resourceArn != null && { resourceArn: input.resourceArn }),
43
- ...(input.schema != null && { schema: input.schema }),
44
- ...(input.secretArn != null && { secretArn: input.secretArn }),
45
- });
46
- return new __HttpRequest({
47
- protocol,
48
- hostname,
49
- port,
50
- method: "POST",
51
- headers,
52
- path: resolvedPath,
53
- body,
54
- });
55
- };
56
- export const serializeAws_restJson1CommitTransactionCommand = async (input, context) => {
57
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
58
- const headers = {
59
- "content-type": "application/json",
60
- };
61
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/CommitTransaction";
62
- let body;
63
- body = JSON.stringify({
64
- ...(input.resourceArn != null && { resourceArn: input.resourceArn }),
65
- ...(input.secretArn != null && { secretArn: input.secretArn }),
66
- ...(input.transactionId != null && { transactionId: input.transactionId }),
67
- });
68
- return new __HttpRequest({
69
- protocol,
70
- hostname,
71
- port,
72
- method: "POST",
73
- headers,
74
- path: resolvedPath,
75
- body,
76
- });
77
- };
78
- export const serializeAws_restJson1ExecuteSqlCommand = async (input, context) => {
79
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
80
- const headers = {
81
- "content-type": "application/json",
82
- };
83
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/ExecuteSql";
84
- let body;
85
- body = JSON.stringify({
86
- ...(input.awsSecretStoreArn != null && { awsSecretStoreArn: input.awsSecretStoreArn }),
87
- ...(input.database != null && { database: input.database }),
88
- ...(input.dbClusterOrInstanceArn != null && { dbClusterOrInstanceArn: input.dbClusterOrInstanceArn }),
89
- ...(input.schema != null && { schema: input.schema }),
90
- ...(input.sqlStatements != null && { sqlStatements: input.sqlStatements }),
91
- });
92
- return new __HttpRequest({
93
- protocol,
94
- hostname,
95
- port,
96
- method: "POST",
97
- headers,
98
- path: resolvedPath,
99
- body,
100
- });
101
- };
102
- export const serializeAws_restJson1ExecuteStatementCommand = async (input, context) => {
103
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
104
- const headers = {
105
- "content-type": "application/json",
106
- };
107
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/Execute";
108
- let body;
109
- body = JSON.stringify({
110
- ...(input.continueAfterTimeout != null && { continueAfterTimeout: input.continueAfterTimeout }),
111
- ...(input.database != null && { database: input.database }),
112
- ...(input.formatRecordsAs != null && { formatRecordsAs: input.formatRecordsAs }),
113
- ...(input.includeResultMetadata != null && { includeResultMetadata: input.includeResultMetadata }),
114
- ...(input.parameters != null && { parameters: serializeAws_restJson1SqlParametersList(input.parameters, context) }),
115
- ...(input.resourceArn != null && { resourceArn: input.resourceArn }),
116
- ...(input.resultSetOptions != null && {
117
- resultSetOptions: serializeAws_restJson1ResultSetOptions(input.resultSetOptions, context),
118
- }),
119
- ...(input.schema != null && { schema: input.schema }),
120
- ...(input.secretArn != null && { secretArn: input.secretArn }),
121
- ...(input.sql != null && { sql: input.sql }),
122
- ...(input.transactionId != null && { transactionId: input.transactionId }),
123
- });
124
- return new __HttpRequest({
125
- protocol,
126
- hostname,
127
- port,
128
- method: "POST",
129
- headers,
130
- path: resolvedPath,
131
- body,
132
- });
133
- };
134
- export const serializeAws_restJson1RollbackTransactionCommand = async (input, context) => {
135
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
136
- const headers = {
137
- "content-type": "application/json",
138
- };
139
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/RollbackTransaction";
140
- let body;
141
- body = JSON.stringify({
142
- ...(input.resourceArn != null && { resourceArn: input.resourceArn }),
143
- ...(input.secretArn != null && { secretArn: input.secretArn }),
144
- ...(input.transactionId != null && { transactionId: input.transactionId }),
145
- });
146
- return new __HttpRequest({
147
- protocol,
148
- hostname,
149
- port,
150
- method: "POST",
151
- headers,
152
- path: resolvedPath,
153
- body,
154
- });
155
- };
156
- export const deserializeAws_restJson1BatchExecuteStatementCommand = async (output, context) => {
157
- if (output.statusCode !== 200 && output.statusCode >= 300) {
158
- return deserializeAws_restJson1BatchExecuteStatementCommandError(output, context);
159
- }
160
- const contents = map({
161
- $metadata: deserializeMetadata(output),
6
+ export var serializeAws_restJson1BatchExecuteStatementCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
7
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
8
+ return __generator(this, function (_c) {
9
+ switch (_c.label) {
10
+ case 0: return [4, context.endpoint()];
11
+ case 1:
12
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
13
+ headers = {
14
+ "content-type": "application/json",
15
+ };
16
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/BatchExecute";
17
+ body = JSON.stringify(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.database != null && { database: input.database })), (input.parameterSets != null && {
18
+ parameterSets: serializeAws_restJson1SqlParameterSets(input.parameterSets, context),
19
+ })), (input.resourceArn != null && { resourceArn: input.resourceArn })), (input.schema != null && { schema: input.schema })), (input.secretArn != null && { secretArn: input.secretArn })), (input.sql != null && { sql: input.sql })), (input.transactionId != null && { transactionId: input.transactionId })));
20
+ return [2, new __HttpRequest({
21
+ protocol: protocol,
22
+ hostname: hostname,
23
+ port: port,
24
+ method: "POST",
25
+ headers: headers,
26
+ path: resolvedPath,
27
+ body: body,
28
+ })];
29
+ }
162
30
  });
163
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
164
- if (data.updateResults != null) {
165
- contents.updateResults = deserializeAws_restJson1UpdateResults(data.updateResults, context);
166
- }
167
- return contents;
168
- };
169
- const deserializeAws_restJson1BatchExecuteStatementCommandError = async (output, context) => {
170
- const parsedOutput = {
171
- ...output,
172
- body: await parseErrorBody(output.body, context),
173
- };
174
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
175
- switch (errorCode) {
176
- case "AccessDeniedException":
177
- case "com.amazonaws.rdsdata#AccessDeniedException":
178
- throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
179
- case "BadRequestException":
180
- case "com.amazonaws.rdsdata#BadRequestException":
181
- throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
182
- case "ForbiddenException":
183
- case "com.amazonaws.rdsdata#ForbiddenException":
184
- throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
185
- case "InternalServerErrorException":
186
- case "com.amazonaws.rdsdata#InternalServerErrorException":
187
- throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
188
- case "ServiceUnavailableError":
189
- case "com.amazonaws.rdsdata#ServiceUnavailableError":
190
- throw await deserializeAws_restJson1ServiceUnavailableErrorResponse(parsedOutput, context);
191
- case "StatementTimeoutException":
192
- case "com.amazonaws.rdsdata#StatementTimeoutException":
193
- throw await deserializeAws_restJson1StatementTimeoutExceptionResponse(parsedOutput, context);
194
- default:
195
- const parsedBody = parsedOutput.body;
196
- throwDefaultError({
197
- output,
198
- parsedBody,
199
- exceptionCtor: __BaseException,
200
- errorCode,
201
- });
202
- }
203
- };
204
- export const deserializeAws_restJson1BeginTransactionCommand = async (output, context) => {
205
- if (output.statusCode !== 200 && output.statusCode >= 300) {
206
- return deserializeAws_restJson1BeginTransactionCommandError(output, context);
207
- }
208
- const contents = map({
209
- $metadata: deserializeMetadata(output),
31
+ }); };
32
+ export var serializeAws_restJson1BeginTransactionCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
33
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
34
+ return __generator(this, function (_c) {
35
+ switch (_c.label) {
36
+ case 0: return [4, context.endpoint()];
37
+ case 1:
38
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
39
+ headers = {
40
+ "content-type": "application/json",
41
+ };
42
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/BeginTransaction";
43
+ body = JSON.stringify(__assign(__assign(__assign(__assign({}, (input.database != null && { database: input.database })), (input.resourceArn != null && { resourceArn: input.resourceArn })), (input.schema != null && { schema: input.schema })), (input.secretArn != null && { secretArn: input.secretArn })));
44
+ return [2, new __HttpRequest({
45
+ protocol: protocol,
46
+ hostname: hostname,
47
+ port: port,
48
+ method: "POST",
49
+ headers: headers,
50
+ path: resolvedPath,
51
+ body: body,
52
+ })];
53
+ }
210
54
  });
211
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
212
- if (data.transactionId != null) {
213
- contents.transactionId = __expectString(data.transactionId);
214
- }
215
- return contents;
216
- };
217
- const deserializeAws_restJson1BeginTransactionCommandError = async (output, context) => {
218
- const parsedOutput = {
219
- ...output,
220
- body: await parseErrorBody(output.body, context),
221
- };
222
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
223
- switch (errorCode) {
224
- case "AccessDeniedException":
225
- case "com.amazonaws.rdsdata#AccessDeniedException":
226
- throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
227
- case "BadRequestException":
228
- case "com.amazonaws.rdsdata#BadRequestException":
229
- throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
230
- case "ForbiddenException":
231
- case "com.amazonaws.rdsdata#ForbiddenException":
232
- throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
233
- case "InternalServerErrorException":
234
- case "com.amazonaws.rdsdata#InternalServerErrorException":
235
- throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
236
- case "ServiceUnavailableError":
237
- case "com.amazonaws.rdsdata#ServiceUnavailableError":
238
- throw await deserializeAws_restJson1ServiceUnavailableErrorResponse(parsedOutput, context);
239
- case "StatementTimeoutException":
240
- case "com.amazonaws.rdsdata#StatementTimeoutException":
241
- throw await deserializeAws_restJson1StatementTimeoutExceptionResponse(parsedOutput, context);
242
- default:
243
- const parsedBody = parsedOutput.body;
244
- throwDefaultError({
245
- output,
246
- parsedBody,
247
- exceptionCtor: __BaseException,
248
- errorCode,
249
- });
250
- }
251
- };
252
- export const deserializeAws_restJson1CommitTransactionCommand = async (output, context) => {
253
- if (output.statusCode !== 200 && output.statusCode >= 300) {
254
- return deserializeAws_restJson1CommitTransactionCommandError(output, context);
255
- }
256
- const contents = map({
257
- $metadata: deserializeMetadata(output),
55
+ }); };
56
+ export var serializeAws_restJson1CommitTransactionCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
57
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
58
+ return __generator(this, function (_c) {
59
+ switch (_c.label) {
60
+ case 0: return [4, context.endpoint()];
61
+ case 1:
62
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
63
+ headers = {
64
+ "content-type": "application/json",
65
+ };
66
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/CommitTransaction";
67
+ body = JSON.stringify(__assign(__assign(__assign({}, (input.resourceArn != null && { resourceArn: input.resourceArn })), (input.secretArn != null && { secretArn: input.secretArn })), (input.transactionId != null && { transactionId: input.transactionId })));
68
+ return [2, new __HttpRequest({
69
+ protocol: protocol,
70
+ hostname: hostname,
71
+ port: port,
72
+ method: "POST",
73
+ headers: headers,
74
+ path: resolvedPath,
75
+ body: body,
76
+ })];
77
+ }
258
78
  });
259
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
260
- if (data.transactionStatus != null) {
261
- contents.transactionStatus = __expectString(data.transactionStatus);
262
- }
263
- return contents;
264
- };
265
- const deserializeAws_restJson1CommitTransactionCommandError = async (output, context) => {
266
- const parsedOutput = {
267
- ...output,
268
- body: await parseErrorBody(output.body, context),
269
- };
270
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
271
- switch (errorCode) {
272
- case "AccessDeniedException":
273
- case "com.amazonaws.rdsdata#AccessDeniedException":
274
- throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
275
- case "BadRequestException":
276
- case "com.amazonaws.rdsdata#BadRequestException":
277
- throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
278
- case "ForbiddenException":
279
- case "com.amazonaws.rdsdata#ForbiddenException":
280
- throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
281
- case "InternalServerErrorException":
282
- case "com.amazonaws.rdsdata#InternalServerErrorException":
283
- throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
284
- case "NotFoundException":
285
- case "com.amazonaws.rdsdata#NotFoundException":
286
- throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
287
- case "ServiceUnavailableError":
288
- case "com.amazonaws.rdsdata#ServiceUnavailableError":
289
- throw await deserializeAws_restJson1ServiceUnavailableErrorResponse(parsedOutput, context);
290
- case "StatementTimeoutException":
291
- case "com.amazonaws.rdsdata#StatementTimeoutException":
292
- throw await deserializeAws_restJson1StatementTimeoutExceptionResponse(parsedOutput, context);
293
- default:
294
- const parsedBody = parsedOutput.body;
295
- throwDefaultError({
296
- output,
297
- parsedBody,
298
- exceptionCtor: __BaseException,
299
- errorCode,
300
- });
301
- }
302
- };
303
- export const deserializeAws_restJson1ExecuteSqlCommand = async (output, context) => {
304
- if (output.statusCode !== 200 && output.statusCode >= 300) {
305
- return deserializeAws_restJson1ExecuteSqlCommandError(output, context);
306
- }
307
- const contents = map({
308
- $metadata: deserializeMetadata(output),
79
+ }); };
80
+ export var serializeAws_restJson1ExecuteSqlCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
81
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
82
+ return __generator(this, function (_c) {
83
+ switch (_c.label) {
84
+ case 0: return [4, context.endpoint()];
85
+ case 1:
86
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
87
+ headers = {
88
+ "content-type": "application/json",
89
+ };
90
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/ExecuteSql";
91
+ body = JSON.stringify(__assign(__assign(__assign(__assign(__assign({}, (input.awsSecretStoreArn != null && { awsSecretStoreArn: input.awsSecretStoreArn })), (input.database != null && { database: input.database })), (input.dbClusterOrInstanceArn != null && { dbClusterOrInstanceArn: input.dbClusterOrInstanceArn })), (input.schema != null && { schema: input.schema })), (input.sqlStatements != null && { sqlStatements: input.sqlStatements })));
92
+ return [2, new __HttpRequest({
93
+ protocol: protocol,
94
+ hostname: hostname,
95
+ port: port,
96
+ method: "POST",
97
+ headers: headers,
98
+ path: resolvedPath,
99
+ body: body,
100
+ })];
101
+ }
309
102
  });
310
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
311
- if (data.sqlStatementResults != null) {
312
- contents.sqlStatementResults = deserializeAws_restJson1SqlStatementResults(data.sqlStatementResults, context);
313
- }
314
- return contents;
315
- };
316
- const deserializeAws_restJson1ExecuteSqlCommandError = async (output, context) => {
317
- const parsedOutput = {
318
- ...output,
319
- body: await parseErrorBody(output.body, context),
320
- };
321
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
322
- switch (errorCode) {
323
- case "AccessDeniedException":
324
- case "com.amazonaws.rdsdata#AccessDeniedException":
325
- throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
326
- case "BadRequestException":
327
- case "com.amazonaws.rdsdata#BadRequestException":
328
- throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
329
- case "ForbiddenException":
330
- case "com.amazonaws.rdsdata#ForbiddenException":
331
- throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
332
- case "InternalServerErrorException":
333
- case "com.amazonaws.rdsdata#InternalServerErrorException":
334
- throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
335
- case "ServiceUnavailableError":
336
- case "com.amazonaws.rdsdata#ServiceUnavailableError":
337
- throw await deserializeAws_restJson1ServiceUnavailableErrorResponse(parsedOutput, context);
338
- default:
339
- const parsedBody = parsedOutput.body;
340
- throwDefaultError({
341
- output,
342
- parsedBody,
343
- exceptionCtor: __BaseException,
344
- errorCode,
345
- });
346
- }
347
- };
348
- export const deserializeAws_restJson1ExecuteStatementCommand = async (output, context) => {
349
- if (output.statusCode !== 200 && output.statusCode >= 300) {
350
- return deserializeAws_restJson1ExecuteStatementCommandError(output, context);
351
- }
352
- const contents = map({
353
- $metadata: deserializeMetadata(output),
103
+ }); };
104
+ export var serializeAws_restJson1ExecuteStatementCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
105
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
106
+ return __generator(this, function (_c) {
107
+ switch (_c.label) {
108
+ case 0: return [4, context.endpoint()];
109
+ case 1:
110
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
111
+ headers = {
112
+ "content-type": "application/json",
113
+ };
114
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/Execute";
115
+ body = JSON.stringify(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.continueAfterTimeout != null && { continueAfterTimeout: input.continueAfterTimeout })), (input.database != null && { database: input.database })), (input.formatRecordsAs != null && { formatRecordsAs: input.formatRecordsAs })), (input.includeResultMetadata != null && { includeResultMetadata: input.includeResultMetadata })), (input.parameters != null && { parameters: serializeAws_restJson1SqlParametersList(input.parameters, context) })), (input.resourceArn != null && { resourceArn: input.resourceArn })), (input.resultSetOptions != null && {
116
+ resultSetOptions: serializeAws_restJson1ResultSetOptions(input.resultSetOptions, context),
117
+ })), (input.schema != null && { schema: input.schema })), (input.secretArn != null && { secretArn: input.secretArn })), (input.sql != null && { sql: input.sql })), (input.transactionId != null && { transactionId: input.transactionId })));
118
+ return [2, new __HttpRequest({
119
+ protocol: protocol,
120
+ hostname: hostname,
121
+ port: port,
122
+ method: "POST",
123
+ headers: headers,
124
+ path: resolvedPath,
125
+ body: body,
126
+ })];
127
+ }
354
128
  });
355
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
356
- if (data.columnMetadata != null) {
357
- contents.columnMetadata = deserializeAws_restJson1Metadata(data.columnMetadata, context);
358
- }
359
- if (data.formattedRecords != null) {
360
- contents.formattedRecords = __expectString(data.formattedRecords);
361
- }
362
- if (data.generatedFields != null) {
363
- contents.generatedFields = deserializeAws_restJson1FieldList(data.generatedFields, context);
364
- }
365
- if (data.numberOfRecordsUpdated != null) {
366
- contents.numberOfRecordsUpdated = __expectLong(data.numberOfRecordsUpdated);
367
- }
368
- if (data.records != null) {
369
- contents.records = deserializeAws_restJson1SqlRecords(data.records, context);
370
- }
371
- return contents;
372
- };
373
- const deserializeAws_restJson1ExecuteStatementCommandError = async (output, context) => {
374
- const parsedOutput = {
375
- ...output,
376
- body: await parseErrorBody(output.body, context),
377
- };
378
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
379
- switch (errorCode) {
380
- case "AccessDeniedException":
381
- case "com.amazonaws.rdsdata#AccessDeniedException":
382
- throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
383
- case "BadRequestException":
384
- case "com.amazonaws.rdsdata#BadRequestException":
385
- throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
386
- case "ForbiddenException":
387
- case "com.amazonaws.rdsdata#ForbiddenException":
388
- throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
389
- case "InternalServerErrorException":
390
- case "com.amazonaws.rdsdata#InternalServerErrorException":
391
- throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
392
- case "ServiceUnavailableError":
393
- case "com.amazonaws.rdsdata#ServiceUnavailableError":
394
- throw await deserializeAws_restJson1ServiceUnavailableErrorResponse(parsedOutput, context);
395
- case "StatementTimeoutException":
396
- case "com.amazonaws.rdsdata#StatementTimeoutException":
397
- throw await deserializeAws_restJson1StatementTimeoutExceptionResponse(parsedOutput, context);
398
- default:
399
- const parsedBody = parsedOutput.body;
400
- throwDefaultError({
401
- output,
402
- parsedBody,
403
- exceptionCtor: __BaseException,
404
- errorCode,
405
- });
406
- }
407
- };
408
- export const deserializeAws_restJson1RollbackTransactionCommand = async (output, context) => {
409
- if (output.statusCode !== 200 && output.statusCode >= 300) {
410
- return deserializeAws_restJson1RollbackTransactionCommandError(output, context);
411
- }
412
- const contents = map({
413
- $metadata: deserializeMetadata(output),
129
+ }); };
130
+ export var serializeAws_restJson1RollbackTransactionCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
131
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
132
+ return __generator(this, function (_c) {
133
+ switch (_c.label) {
134
+ case 0: return [4, context.endpoint()];
135
+ case 1:
136
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
137
+ headers = {
138
+ "content-type": "application/json",
139
+ };
140
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/RollbackTransaction";
141
+ body = JSON.stringify(__assign(__assign(__assign({}, (input.resourceArn != null && { resourceArn: input.resourceArn })), (input.secretArn != null && { secretArn: input.secretArn })), (input.transactionId != null && { transactionId: input.transactionId })));
142
+ return [2, new __HttpRequest({
143
+ protocol: protocol,
144
+ hostname: hostname,
145
+ port: port,
146
+ method: "POST",
147
+ headers: headers,
148
+ path: resolvedPath,
149
+ body: body,
150
+ })];
151
+ }
414
152
  });
415
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
416
- if (data.transactionStatus != null) {
417
- contents.transactionStatus = __expectString(data.transactionStatus);
418
- }
419
- return contents;
420
- };
421
- const deserializeAws_restJson1RollbackTransactionCommandError = async (output, context) => {
422
- const parsedOutput = {
423
- ...output,
424
- body: await parseErrorBody(output.body, context),
425
- };
426
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
427
- switch (errorCode) {
428
- case "AccessDeniedException":
429
- case "com.amazonaws.rdsdata#AccessDeniedException":
430
- throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
431
- case "BadRequestException":
432
- case "com.amazonaws.rdsdata#BadRequestException":
433
- throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
434
- case "ForbiddenException":
435
- case "com.amazonaws.rdsdata#ForbiddenException":
436
- throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
437
- case "InternalServerErrorException":
438
- case "com.amazonaws.rdsdata#InternalServerErrorException":
439
- throw await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context);
440
- case "NotFoundException":
441
- case "com.amazonaws.rdsdata#NotFoundException":
442
- throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
443
- case "ServiceUnavailableError":
444
- case "com.amazonaws.rdsdata#ServiceUnavailableError":
445
- throw await deserializeAws_restJson1ServiceUnavailableErrorResponse(parsedOutput, context);
446
- case "StatementTimeoutException":
447
- case "com.amazonaws.rdsdata#StatementTimeoutException":
448
- throw await deserializeAws_restJson1StatementTimeoutExceptionResponse(parsedOutput, context);
449
- default:
450
- const parsedBody = parsedOutput.body;
451
- throwDefaultError({
452
- output,
453
- parsedBody,
454
- exceptionCtor: __BaseException,
455
- errorCode,
456
- });
457
- }
458
- };
459
- const map = __map;
460
- const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
461
- const contents = map({});
462
- const data = parsedOutput.body;
463
- if (data.message != null) {
464
- contents.message = __expectString(data.message);
465
- }
466
- const exception = new AccessDeniedException({
467
- $metadata: deserializeMetadata(parsedOutput),
468
- ...contents,
153
+ }); };
154
+ export var deserializeAws_restJson1BatchExecuteStatementCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
155
+ var contents, data, _a, _b;
156
+ return __generator(this, function (_c) {
157
+ switch (_c.label) {
158
+ case 0:
159
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
160
+ return [2, deserializeAws_restJson1BatchExecuteStatementCommandError(output, context)];
161
+ }
162
+ contents = map({
163
+ $metadata: deserializeMetadata(output),
164
+ });
165
+ _a = __expectNonNull;
166
+ _b = __expectObject;
167
+ return [4, parseBody(output.body, context)];
168
+ case 1:
169
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
170
+ if (data.updateResults != null) {
171
+ contents.updateResults = deserializeAws_restJson1UpdateResults(data.updateResults, context);
172
+ }
173
+ return [2, contents];
174
+ }
469
175
  });
470
- return __decorateServiceException(exception, parsedOutput.body);
471
- };
472
- const deserializeAws_restJson1BadRequestExceptionResponse = async (parsedOutput, context) => {
473
- const contents = map({});
474
- const data = parsedOutput.body;
475
- if (data.message != null) {
476
- contents.message = __expectString(data.message);
477
- }
478
- const exception = new BadRequestException({
479
- $metadata: deserializeMetadata(parsedOutput),
480
- ...contents,
176
+ }); };
177
+ var deserializeAws_restJson1BatchExecuteStatementCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
178
+ var parsedOutput, _a, errorCode, _b, parsedBody;
179
+ var _c;
180
+ return __generator(this, function (_d) {
181
+ switch (_d.label) {
182
+ case 0:
183
+ _a = [__assign({}, output)];
184
+ _c = {};
185
+ return [4, parseErrorBody(output.body, context)];
186
+ case 1:
187
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
188
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
189
+ _b = errorCode;
190
+ switch (_b) {
191
+ case "AccessDeniedException": return [3, 2];
192
+ case "com.amazonaws.rdsdata#AccessDeniedException": return [3, 2];
193
+ case "BadRequestException": return [3, 4];
194
+ case "com.amazonaws.rdsdata#BadRequestException": return [3, 4];
195
+ case "ForbiddenException": return [3, 6];
196
+ case "com.amazonaws.rdsdata#ForbiddenException": return [3, 6];
197
+ case "InternalServerErrorException": return [3, 8];
198
+ case "com.amazonaws.rdsdata#InternalServerErrorException": return [3, 8];
199
+ case "ServiceUnavailableError": return [3, 10];
200
+ case "com.amazonaws.rdsdata#ServiceUnavailableError": return [3, 10];
201
+ case "StatementTimeoutException": return [3, 12];
202
+ case "com.amazonaws.rdsdata#StatementTimeoutException": return [3, 12];
203
+ }
204
+ return [3, 14];
205
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
206
+ case 3: throw _d.sent();
207
+ case 4: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
208
+ case 5: throw _d.sent();
209
+ case 6: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
210
+ case 7: throw _d.sent();
211
+ case 8: return [4, deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)];
212
+ case 9: throw _d.sent();
213
+ case 10: return [4, deserializeAws_restJson1ServiceUnavailableErrorResponse(parsedOutput, context)];
214
+ case 11: throw _d.sent();
215
+ case 12: return [4, deserializeAws_restJson1StatementTimeoutExceptionResponse(parsedOutput, context)];
216
+ case 13: throw _d.sent();
217
+ case 14:
218
+ parsedBody = parsedOutput.body;
219
+ throwDefaultError({
220
+ output: output,
221
+ parsedBody: parsedBody,
222
+ exceptionCtor: __BaseException,
223
+ errorCode: errorCode,
224
+ });
225
+ _d.label = 15;
226
+ case 15: return [2];
227
+ }
481
228
  });
482
- return __decorateServiceException(exception, parsedOutput.body);
483
- };
484
- const deserializeAws_restJson1ForbiddenExceptionResponse = async (parsedOutput, context) => {
485
- const contents = map({});
486
- const data = parsedOutput.body;
487
- if (data.message != null) {
488
- contents.message = __expectString(data.message);
489
- }
490
- const exception = new ForbiddenException({
491
- $metadata: deserializeMetadata(parsedOutput),
492
- ...contents,
493
- });
494
- return __decorateServiceException(exception, parsedOutput.body);
495
- };
496
- const deserializeAws_restJson1InternalServerErrorExceptionResponse = async (parsedOutput, context) => {
497
- const contents = map({});
498
- const data = parsedOutput.body;
499
- const exception = new InternalServerErrorException({
500
- $metadata: deserializeMetadata(parsedOutput),
501
- ...contents,
502
- });
503
- return __decorateServiceException(exception, parsedOutput.body);
504
- };
505
- const deserializeAws_restJson1NotFoundExceptionResponse = async (parsedOutput, context) => {
506
- const contents = map({});
507
- const data = parsedOutput.body;
508
- if (data.message != null) {
509
- contents.message = __expectString(data.message);
510
- }
511
- const exception = new NotFoundException({
512
- $metadata: deserializeMetadata(parsedOutput),
513
- ...contents,
514
- });
515
- return __decorateServiceException(exception, parsedOutput.body);
516
- };
517
- const deserializeAws_restJson1ServiceUnavailableErrorResponse = async (parsedOutput, context) => {
518
- const contents = map({});
519
- const data = parsedOutput.body;
520
- const exception = new ServiceUnavailableError({
521
- $metadata: deserializeMetadata(parsedOutput),
522
- ...contents,
523
- });
524
- return __decorateServiceException(exception, parsedOutput.body);
525
- };
526
- const deserializeAws_restJson1StatementTimeoutExceptionResponse = async (parsedOutput, context) => {
527
- const contents = map({});
528
- const data = parsedOutput.body;
529
- if (data.dbConnectionId != null) {
530
- contents.dbConnectionId = __expectLong(data.dbConnectionId);
531
- }
532
- if (data.message != null) {
533
- contents.message = __expectString(data.message);
534
- }
535
- const exception = new StatementTimeoutException({
536
- $metadata: deserializeMetadata(parsedOutput),
537
- ...contents,
229
+ }); };
230
+ export var deserializeAws_restJson1BeginTransactionCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
231
+ var contents, data, _a, _b;
232
+ return __generator(this, function (_c) {
233
+ switch (_c.label) {
234
+ case 0:
235
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
236
+ return [2, deserializeAws_restJson1BeginTransactionCommandError(output, context)];
237
+ }
238
+ contents = map({
239
+ $metadata: deserializeMetadata(output),
240
+ });
241
+ _a = __expectNonNull;
242
+ _b = __expectObject;
243
+ return [4, parseBody(output.body, context)];
244
+ case 1:
245
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
246
+ if (data.transactionId != null) {
247
+ contents.transactionId = __expectString(data.transactionId);
248
+ }
249
+ return [2, contents];
250
+ }
538
251
  });
539
- return __decorateServiceException(exception, parsedOutput.body);
540
- };
541
- const serializeAws_restJson1ArrayOfArray = (input, context) => {
252
+ }); };
253
+ var deserializeAws_restJson1BeginTransactionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
254
+ var parsedOutput, _a, errorCode, _b, parsedBody;
255
+ var _c;
256
+ return __generator(this, function (_d) {
257
+ switch (_d.label) {
258
+ case 0:
259
+ _a = [__assign({}, output)];
260
+ _c = {};
261
+ return [4, parseErrorBody(output.body, context)];
262
+ case 1:
263
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
264
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
265
+ _b = errorCode;
266
+ switch (_b) {
267
+ case "AccessDeniedException": return [3, 2];
268
+ case "com.amazonaws.rdsdata#AccessDeniedException": return [3, 2];
269
+ case "BadRequestException": return [3, 4];
270
+ case "com.amazonaws.rdsdata#BadRequestException": return [3, 4];
271
+ case "ForbiddenException": return [3, 6];
272
+ case "com.amazonaws.rdsdata#ForbiddenException": return [3, 6];
273
+ case "InternalServerErrorException": return [3, 8];
274
+ case "com.amazonaws.rdsdata#InternalServerErrorException": return [3, 8];
275
+ case "ServiceUnavailableError": return [3, 10];
276
+ case "com.amazonaws.rdsdata#ServiceUnavailableError": return [3, 10];
277
+ case "StatementTimeoutException": return [3, 12];
278
+ case "com.amazonaws.rdsdata#StatementTimeoutException": return [3, 12];
279
+ }
280
+ return [3, 14];
281
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
282
+ case 3: throw _d.sent();
283
+ case 4: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
284
+ case 5: throw _d.sent();
285
+ case 6: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
286
+ case 7: throw _d.sent();
287
+ case 8: return [4, deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)];
288
+ case 9: throw _d.sent();
289
+ case 10: return [4, deserializeAws_restJson1ServiceUnavailableErrorResponse(parsedOutput, context)];
290
+ case 11: throw _d.sent();
291
+ case 12: return [4, deserializeAws_restJson1StatementTimeoutExceptionResponse(parsedOutput, context)];
292
+ case 13: throw _d.sent();
293
+ case 14:
294
+ parsedBody = parsedOutput.body;
295
+ throwDefaultError({
296
+ output: output,
297
+ parsedBody: parsedBody,
298
+ exceptionCtor: __BaseException,
299
+ errorCode: errorCode,
300
+ });
301
+ _d.label = 15;
302
+ case 15: return [2];
303
+ }
304
+ });
305
+ }); };
306
+ export var deserializeAws_restJson1CommitTransactionCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
307
+ var contents, data, _a, _b;
308
+ return __generator(this, function (_c) {
309
+ switch (_c.label) {
310
+ case 0:
311
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
312
+ return [2, deserializeAws_restJson1CommitTransactionCommandError(output, context)];
313
+ }
314
+ contents = map({
315
+ $metadata: deserializeMetadata(output),
316
+ });
317
+ _a = __expectNonNull;
318
+ _b = __expectObject;
319
+ return [4, parseBody(output.body, context)];
320
+ case 1:
321
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
322
+ if (data.transactionStatus != null) {
323
+ contents.transactionStatus = __expectString(data.transactionStatus);
324
+ }
325
+ return [2, contents];
326
+ }
327
+ });
328
+ }); };
329
+ var deserializeAws_restJson1CommitTransactionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
330
+ var parsedOutput, _a, errorCode, _b, parsedBody;
331
+ var _c;
332
+ return __generator(this, function (_d) {
333
+ switch (_d.label) {
334
+ case 0:
335
+ _a = [__assign({}, output)];
336
+ _c = {};
337
+ return [4, parseErrorBody(output.body, context)];
338
+ case 1:
339
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
340
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
341
+ _b = errorCode;
342
+ switch (_b) {
343
+ case "AccessDeniedException": return [3, 2];
344
+ case "com.amazonaws.rdsdata#AccessDeniedException": return [3, 2];
345
+ case "BadRequestException": return [3, 4];
346
+ case "com.amazonaws.rdsdata#BadRequestException": return [3, 4];
347
+ case "ForbiddenException": return [3, 6];
348
+ case "com.amazonaws.rdsdata#ForbiddenException": return [3, 6];
349
+ case "InternalServerErrorException": return [3, 8];
350
+ case "com.amazonaws.rdsdata#InternalServerErrorException": return [3, 8];
351
+ case "NotFoundException": return [3, 10];
352
+ case "com.amazonaws.rdsdata#NotFoundException": return [3, 10];
353
+ case "ServiceUnavailableError": return [3, 12];
354
+ case "com.amazonaws.rdsdata#ServiceUnavailableError": return [3, 12];
355
+ case "StatementTimeoutException": return [3, 14];
356
+ case "com.amazonaws.rdsdata#StatementTimeoutException": return [3, 14];
357
+ }
358
+ return [3, 16];
359
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
360
+ case 3: throw _d.sent();
361
+ case 4: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
362
+ case 5: throw _d.sent();
363
+ case 6: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
364
+ case 7: throw _d.sent();
365
+ case 8: return [4, deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)];
366
+ case 9: throw _d.sent();
367
+ case 10: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
368
+ case 11: throw _d.sent();
369
+ case 12: return [4, deserializeAws_restJson1ServiceUnavailableErrorResponse(parsedOutput, context)];
370
+ case 13: throw _d.sent();
371
+ case 14: return [4, deserializeAws_restJson1StatementTimeoutExceptionResponse(parsedOutput, context)];
372
+ case 15: throw _d.sent();
373
+ case 16:
374
+ parsedBody = parsedOutput.body;
375
+ throwDefaultError({
376
+ output: output,
377
+ parsedBody: parsedBody,
378
+ exceptionCtor: __BaseException,
379
+ errorCode: errorCode,
380
+ });
381
+ _d.label = 17;
382
+ case 17: return [2];
383
+ }
384
+ });
385
+ }); };
386
+ export var deserializeAws_restJson1ExecuteSqlCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
387
+ var contents, data, _a, _b;
388
+ return __generator(this, function (_c) {
389
+ switch (_c.label) {
390
+ case 0:
391
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
392
+ return [2, deserializeAws_restJson1ExecuteSqlCommandError(output, context)];
393
+ }
394
+ contents = map({
395
+ $metadata: deserializeMetadata(output),
396
+ });
397
+ _a = __expectNonNull;
398
+ _b = __expectObject;
399
+ return [4, parseBody(output.body, context)];
400
+ case 1:
401
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
402
+ if (data.sqlStatementResults != null) {
403
+ contents.sqlStatementResults = deserializeAws_restJson1SqlStatementResults(data.sqlStatementResults, context);
404
+ }
405
+ return [2, contents];
406
+ }
407
+ });
408
+ }); };
409
+ var deserializeAws_restJson1ExecuteSqlCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
410
+ var parsedOutput, _a, errorCode, _b, parsedBody;
411
+ var _c;
412
+ return __generator(this, function (_d) {
413
+ switch (_d.label) {
414
+ case 0:
415
+ _a = [__assign({}, output)];
416
+ _c = {};
417
+ return [4, parseErrorBody(output.body, context)];
418
+ case 1:
419
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
420
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
421
+ _b = errorCode;
422
+ switch (_b) {
423
+ case "AccessDeniedException": return [3, 2];
424
+ case "com.amazonaws.rdsdata#AccessDeniedException": return [3, 2];
425
+ case "BadRequestException": return [3, 4];
426
+ case "com.amazonaws.rdsdata#BadRequestException": return [3, 4];
427
+ case "ForbiddenException": return [3, 6];
428
+ case "com.amazonaws.rdsdata#ForbiddenException": return [3, 6];
429
+ case "InternalServerErrorException": return [3, 8];
430
+ case "com.amazonaws.rdsdata#InternalServerErrorException": return [3, 8];
431
+ case "ServiceUnavailableError": return [3, 10];
432
+ case "com.amazonaws.rdsdata#ServiceUnavailableError": return [3, 10];
433
+ }
434
+ return [3, 12];
435
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
436
+ case 3: throw _d.sent();
437
+ case 4: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
438
+ case 5: throw _d.sent();
439
+ case 6: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
440
+ case 7: throw _d.sent();
441
+ case 8: return [4, deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)];
442
+ case 9: throw _d.sent();
443
+ case 10: return [4, deserializeAws_restJson1ServiceUnavailableErrorResponse(parsedOutput, context)];
444
+ case 11: throw _d.sent();
445
+ case 12:
446
+ parsedBody = parsedOutput.body;
447
+ throwDefaultError({
448
+ output: output,
449
+ parsedBody: parsedBody,
450
+ exceptionCtor: __BaseException,
451
+ errorCode: errorCode,
452
+ });
453
+ _d.label = 13;
454
+ case 13: return [2];
455
+ }
456
+ });
457
+ }); };
458
+ export var deserializeAws_restJson1ExecuteStatementCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
459
+ var contents, data, _a, _b;
460
+ return __generator(this, function (_c) {
461
+ switch (_c.label) {
462
+ case 0:
463
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
464
+ return [2, deserializeAws_restJson1ExecuteStatementCommandError(output, context)];
465
+ }
466
+ contents = map({
467
+ $metadata: deserializeMetadata(output),
468
+ });
469
+ _a = __expectNonNull;
470
+ _b = __expectObject;
471
+ return [4, parseBody(output.body, context)];
472
+ case 1:
473
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
474
+ if (data.columnMetadata != null) {
475
+ contents.columnMetadata = deserializeAws_restJson1Metadata(data.columnMetadata, context);
476
+ }
477
+ if (data.formattedRecords != null) {
478
+ contents.formattedRecords = __expectString(data.formattedRecords);
479
+ }
480
+ if (data.generatedFields != null) {
481
+ contents.generatedFields = deserializeAws_restJson1FieldList(data.generatedFields, context);
482
+ }
483
+ if (data.numberOfRecordsUpdated != null) {
484
+ contents.numberOfRecordsUpdated = __expectLong(data.numberOfRecordsUpdated);
485
+ }
486
+ if (data.records != null) {
487
+ contents.records = deserializeAws_restJson1SqlRecords(data.records, context);
488
+ }
489
+ return [2, contents];
490
+ }
491
+ });
492
+ }); };
493
+ var deserializeAws_restJson1ExecuteStatementCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
494
+ var parsedOutput, _a, errorCode, _b, parsedBody;
495
+ var _c;
496
+ return __generator(this, function (_d) {
497
+ switch (_d.label) {
498
+ case 0:
499
+ _a = [__assign({}, output)];
500
+ _c = {};
501
+ return [4, parseErrorBody(output.body, context)];
502
+ case 1:
503
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
504
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
505
+ _b = errorCode;
506
+ switch (_b) {
507
+ case "AccessDeniedException": return [3, 2];
508
+ case "com.amazonaws.rdsdata#AccessDeniedException": return [3, 2];
509
+ case "BadRequestException": return [3, 4];
510
+ case "com.amazonaws.rdsdata#BadRequestException": return [3, 4];
511
+ case "ForbiddenException": return [3, 6];
512
+ case "com.amazonaws.rdsdata#ForbiddenException": return [3, 6];
513
+ case "InternalServerErrorException": return [3, 8];
514
+ case "com.amazonaws.rdsdata#InternalServerErrorException": return [3, 8];
515
+ case "ServiceUnavailableError": return [3, 10];
516
+ case "com.amazonaws.rdsdata#ServiceUnavailableError": return [3, 10];
517
+ case "StatementTimeoutException": return [3, 12];
518
+ case "com.amazonaws.rdsdata#StatementTimeoutException": return [3, 12];
519
+ }
520
+ return [3, 14];
521
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
522
+ case 3: throw _d.sent();
523
+ case 4: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
524
+ case 5: throw _d.sent();
525
+ case 6: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
526
+ case 7: throw _d.sent();
527
+ case 8: return [4, deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)];
528
+ case 9: throw _d.sent();
529
+ case 10: return [4, deserializeAws_restJson1ServiceUnavailableErrorResponse(parsedOutput, context)];
530
+ case 11: throw _d.sent();
531
+ case 12: return [4, deserializeAws_restJson1StatementTimeoutExceptionResponse(parsedOutput, context)];
532
+ case 13: throw _d.sent();
533
+ case 14:
534
+ parsedBody = parsedOutput.body;
535
+ throwDefaultError({
536
+ output: output,
537
+ parsedBody: parsedBody,
538
+ exceptionCtor: __BaseException,
539
+ errorCode: errorCode,
540
+ });
541
+ _d.label = 15;
542
+ case 15: return [2];
543
+ }
544
+ });
545
+ }); };
546
+ export var deserializeAws_restJson1RollbackTransactionCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
547
+ var contents, data, _a, _b;
548
+ return __generator(this, function (_c) {
549
+ switch (_c.label) {
550
+ case 0:
551
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
552
+ return [2, deserializeAws_restJson1RollbackTransactionCommandError(output, context)];
553
+ }
554
+ contents = map({
555
+ $metadata: deserializeMetadata(output),
556
+ });
557
+ _a = __expectNonNull;
558
+ _b = __expectObject;
559
+ return [4, parseBody(output.body, context)];
560
+ case 1:
561
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
562
+ if (data.transactionStatus != null) {
563
+ contents.transactionStatus = __expectString(data.transactionStatus);
564
+ }
565
+ return [2, contents];
566
+ }
567
+ });
568
+ }); };
569
+ var deserializeAws_restJson1RollbackTransactionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
570
+ var parsedOutput, _a, errorCode, _b, parsedBody;
571
+ var _c;
572
+ return __generator(this, function (_d) {
573
+ switch (_d.label) {
574
+ case 0:
575
+ _a = [__assign({}, output)];
576
+ _c = {};
577
+ return [4, parseErrorBody(output.body, context)];
578
+ case 1:
579
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
580
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
581
+ _b = errorCode;
582
+ switch (_b) {
583
+ case "AccessDeniedException": return [3, 2];
584
+ case "com.amazonaws.rdsdata#AccessDeniedException": return [3, 2];
585
+ case "BadRequestException": return [3, 4];
586
+ case "com.amazonaws.rdsdata#BadRequestException": return [3, 4];
587
+ case "ForbiddenException": return [3, 6];
588
+ case "com.amazonaws.rdsdata#ForbiddenException": return [3, 6];
589
+ case "InternalServerErrorException": return [3, 8];
590
+ case "com.amazonaws.rdsdata#InternalServerErrorException": return [3, 8];
591
+ case "NotFoundException": return [3, 10];
592
+ case "com.amazonaws.rdsdata#NotFoundException": return [3, 10];
593
+ case "ServiceUnavailableError": return [3, 12];
594
+ case "com.amazonaws.rdsdata#ServiceUnavailableError": return [3, 12];
595
+ case "StatementTimeoutException": return [3, 14];
596
+ case "com.amazonaws.rdsdata#StatementTimeoutException": return [3, 14];
597
+ }
598
+ return [3, 16];
599
+ case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
600
+ case 3: throw _d.sent();
601
+ case 4: return [4, deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)];
602
+ case 5: throw _d.sent();
603
+ case 6: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
604
+ case 7: throw _d.sent();
605
+ case 8: return [4, deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)];
606
+ case 9: throw _d.sent();
607
+ case 10: return [4, deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)];
608
+ case 11: throw _d.sent();
609
+ case 12: return [4, deserializeAws_restJson1ServiceUnavailableErrorResponse(parsedOutput, context)];
610
+ case 13: throw _d.sent();
611
+ case 14: return [4, deserializeAws_restJson1StatementTimeoutExceptionResponse(parsedOutput, context)];
612
+ case 15: throw _d.sent();
613
+ case 16:
614
+ parsedBody = parsedOutput.body;
615
+ throwDefaultError({
616
+ output: output,
617
+ parsedBody: parsedBody,
618
+ exceptionCtor: __BaseException,
619
+ errorCode: errorCode,
620
+ });
621
+ _d.label = 17;
622
+ case 17: return [2];
623
+ }
624
+ });
625
+ }); };
626
+ var map = __map;
627
+ var deserializeAws_restJson1AccessDeniedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
628
+ var contents, data, exception;
629
+ return __generator(this, function (_a) {
630
+ contents = map({});
631
+ data = parsedOutput.body;
632
+ if (data.message != null) {
633
+ contents.message = __expectString(data.message);
634
+ }
635
+ exception = new AccessDeniedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
636
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
637
+ });
638
+ }); };
639
+ var deserializeAws_restJson1BadRequestExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
640
+ var contents, data, exception;
641
+ return __generator(this, function (_a) {
642
+ contents = map({});
643
+ data = parsedOutput.body;
644
+ if (data.message != null) {
645
+ contents.message = __expectString(data.message);
646
+ }
647
+ exception = new BadRequestException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
648
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
649
+ });
650
+ }); };
651
+ var deserializeAws_restJson1ForbiddenExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
652
+ var contents, data, exception;
653
+ return __generator(this, function (_a) {
654
+ contents = map({});
655
+ data = parsedOutput.body;
656
+ if (data.message != null) {
657
+ contents.message = __expectString(data.message);
658
+ }
659
+ exception = new ForbiddenException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
660
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
661
+ });
662
+ }); };
663
+ var deserializeAws_restJson1InternalServerErrorExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
664
+ var contents, data, exception;
665
+ return __generator(this, function (_a) {
666
+ contents = map({});
667
+ data = parsedOutput.body;
668
+ exception = new InternalServerErrorException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
669
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
670
+ });
671
+ }); };
672
+ var deserializeAws_restJson1NotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
673
+ var contents, data, exception;
674
+ return __generator(this, function (_a) {
675
+ contents = map({});
676
+ data = parsedOutput.body;
677
+ if (data.message != null) {
678
+ contents.message = __expectString(data.message);
679
+ }
680
+ exception = new NotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
681
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
682
+ });
683
+ }); };
684
+ var deserializeAws_restJson1ServiceUnavailableErrorResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
685
+ var contents, data, exception;
686
+ return __generator(this, function (_a) {
687
+ contents = map({});
688
+ data = parsedOutput.body;
689
+ exception = new ServiceUnavailableError(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
690
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
691
+ });
692
+ }); };
693
+ var deserializeAws_restJson1StatementTimeoutExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
694
+ var contents, data, exception;
695
+ return __generator(this, function (_a) {
696
+ contents = map({});
697
+ data = parsedOutput.body;
698
+ if (data.dbConnectionId != null) {
699
+ contents.dbConnectionId = __expectLong(data.dbConnectionId);
700
+ }
701
+ if (data.message != null) {
702
+ contents.message = __expectString(data.message);
703
+ }
704
+ exception = new StatementTimeoutException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
705
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
706
+ });
707
+ }); };
708
+ var serializeAws_restJson1ArrayOfArray = function (input, context) {
542
709
  return input
543
- .filter((e) => e != null)
544
- .map((entry) => {
710
+ .filter(function (e) { return e != null; })
711
+ .map(function (entry) {
545
712
  return serializeAws_restJson1ArrayValue(entry, context);
546
713
  });
547
714
  };
548
- const serializeAws_restJson1ArrayValue = (input, context) => {
715
+ var serializeAws_restJson1ArrayValue = function (input, context) {
549
716
  return ArrayValue.visit(input, {
550
- arrayValues: (value) => ({ arrayValues: serializeAws_restJson1ArrayOfArray(value, context) }),
551
- booleanValues: (value) => ({ booleanValues: serializeAws_restJson1BooleanArray(value, context) }),
552
- doubleValues: (value) => ({ doubleValues: serializeAws_restJson1DoubleArray(value, context) }),
553
- longValues: (value) => ({ longValues: serializeAws_restJson1LongArray(value, context) }),
554
- stringValues: (value) => ({ stringValues: serializeAws_restJson1StringArray(value, context) }),
555
- _: (name, value) => ({ name: value }),
717
+ arrayValues: function (value) { return ({ arrayValues: serializeAws_restJson1ArrayOfArray(value, context) }); },
718
+ booleanValues: function (value) { return ({ booleanValues: serializeAws_restJson1BooleanArray(value, context) }); },
719
+ doubleValues: function (value) { return ({ doubleValues: serializeAws_restJson1DoubleArray(value, context) }); },
720
+ longValues: function (value) { return ({ longValues: serializeAws_restJson1LongArray(value, context) }); },
721
+ stringValues: function (value) { return ({ stringValues: serializeAws_restJson1StringArray(value, context) }); },
722
+ _: function (name, value) { return ({ name: value }); },
556
723
  });
557
724
  };
558
- const serializeAws_restJson1BooleanArray = (input, context) => {
725
+ var serializeAws_restJson1BooleanArray = function (input, context) {
559
726
  return input
560
- .filter((e) => e != null)
561
- .map((entry) => {
727
+ .filter(function (e) { return e != null; })
728
+ .map(function (entry) {
562
729
  return entry;
563
730
  });
564
731
  };
565
- const serializeAws_restJson1DoubleArray = (input, context) => {
732
+ var serializeAws_restJson1DoubleArray = function (input, context) {
566
733
  return input
567
- .filter((e) => e != null)
568
- .map((entry) => {
734
+ .filter(function (e) { return e != null; })
735
+ .map(function (entry) {
569
736
  return __serializeFloat(entry);
570
737
  });
571
738
  };
572
- const serializeAws_restJson1Field = (input, context) => {
739
+ var serializeAws_restJson1Field = function (input, context) {
573
740
  return Field.visit(input, {
574
- arrayValue: (value) => ({ arrayValue: serializeAws_restJson1ArrayValue(value, context) }),
575
- blobValue: (value) => ({ blobValue: context.base64Encoder(value) }),
576
- booleanValue: (value) => ({ booleanValue: value }),
577
- doubleValue: (value) => ({ doubleValue: __serializeFloat(value) }),
578
- isNull: (value) => ({ isNull: value }),
579
- longValue: (value) => ({ longValue: value }),
580
- stringValue: (value) => ({ stringValue: value }),
581
- _: (name, value) => ({ name: value }),
741
+ arrayValue: function (value) { return ({ arrayValue: serializeAws_restJson1ArrayValue(value, context) }); },
742
+ blobValue: function (value) { return ({ blobValue: context.base64Encoder(value) }); },
743
+ booleanValue: function (value) { return ({ booleanValue: value }); },
744
+ doubleValue: function (value) { return ({ doubleValue: __serializeFloat(value) }); },
745
+ isNull: function (value) { return ({ isNull: value }); },
746
+ longValue: function (value) { return ({ longValue: value }); },
747
+ stringValue: function (value) { return ({ stringValue: value }); },
748
+ _: function (name, value) { return ({ name: value }); },
582
749
  });
583
750
  };
584
- const serializeAws_restJson1LongArray = (input, context) => {
751
+ var serializeAws_restJson1LongArray = function (input, context) {
585
752
  return input
586
- .filter((e) => e != null)
587
- .map((entry) => {
753
+ .filter(function (e) { return e != null; })
754
+ .map(function (entry) {
588
755
  return entry;
589
756
  });
590
757
  };
591
- const serializeAws_restJson1ResultSetOptions = (input, context) => {
592
- return {
593
- ...(input.decimalReturnType != null && { decimalReturnType: input.decimalReturnType }),
594
- ...(input.longReturnType != null && { longReturnType: input.longReturnType }),
595
- };
758
+ var serializeAws_restJson1ResultSetOptions = function (input, context) {
759
+ return __assign(__assign({}, (input.decimalReturnType != null && { decimalReturnType: input.decimalReturnType })), (input.longReturnType != null && { longReturnType: input.longReturnType }));
596
760
  };
597
- const serializeAws_restJson1SqlParameter = (input, context) => {
598
- return {
599
- ...(input.name != null && { name: input.name }),
600
- ...(input.typeHint != null && { typeHint: input.typeHint }),
601
- ...(input.value != null && { value: serializeAws_restJson1Field(input.value, context) }),
602
- };
761
+ var serializeAws_restJson1SqlParameter = function (input, context) {
762
+ return __assign(__assign(__assign({}, (input.name != null && { name: input.name })), (input.typeHint != null && { typeHint: input.typeHint })), (input.value != null && { value: serializeAws_restJson1Field(input.value, context) }));
603
763
  };
604
- const serializeAws_restJson1SqlParameterSets = (input, context) => {
764
+ var serializeAws_restJson1SqlParameterSets = function (input, context) {
605
765
  return input
606
- .filter((e) => e != null)
607
- .map((entry) => {
766
+ .filter(function (e) { return e != null; })
767
+ .map(function (entry) {
608
768
  return serializeAws_restJson1SqlParametersList(entry, context);
609
769
  });
610
770
  };
611
- const serializeAws_restJson1SqlParametersList = (input, context) => {
771
+ var serializeAws_restJson1SqlParametersList = function (input, context) {
612
772
  return input
613
- .filter((e) => e != null)
614
- .map((entry) => {
773
+ .filter(function (e) { return e != null; })
774
+ .map(function (entry) {
615
775
  return serializeAws_restJson1SqlParameter(entry, context);
616
776
  });
617
777
  };
618
- const serializeAws_restJson1StringArray = (input, context) => {
778
+ var serializeAws_restJson1StringArray = function (input, context) {
619
779
  return input
620
- .filter((e) => e != null)
621
- .map((entry) => {
780
+ .filter(function (e) { return e != null; })
781
+ .map(function (entry) {
622
782
  return entry;
623
783
  });
624
784
  };
625
- const deserializeAws_restJson1ArrayOfArray = (output, context) => {
626
- const retVal = (output || [])
627
- .filter((e) => e != null)
628
- .map((entry) => {
785
+ var deserializeAws_restJson1ArrayOfArray = function (output, context) {
786
+ var retVal = (output || [])
787
+ .filter(function (e) { return e != null; })
788
+ .map(function (entry) {
629
789
  if (entry === null) {
630
790
  return null;
631
791
  }
@@ -633,7 +793,7 @@ const deserializeAws_restJson1ArrayOfArray = (output, context) => {
633
793
  });
634
794
  return retVal;
635
795
  };
636
- const deserializeAws_restJson1ArrayValue = (output, context) => {
796
+ var deserializeAws_restJson1ArrayValue = function (output, context) {
637
797
  if (output.arrayValues != null) {
638
798
  return {
639
799
  arrayValues: deserializeAws_restJson1ArrayOfArray(output.arrayValues, context),
@@ -661,10 +821,10 @@ const deserializeAws_restJson1ArrayValue = (output, context) => {
661
821
  }
662
822
  return { $unknown: Object.entries(output)[0] };
663
823
  };
664
- const deserializeAws_restJson1ArrayValueList = (output, context) => {
665
- const retVal = (output || [])
666
- .filter((e) => e != null)
667
- .map((entry) => {
824
+ var deserializeAws_restJson1ArrayValueList = function (output, context) {
825
+ var retVal = (output || [])
826
+ .filter(function (e) { return e != null; })
827
+ .map(function (entry) {
668
828
  if (entry === null) {
669
829
  return null;
670
830
  }
@@ -672,10 +832,10 @@ const deserializeAws_restJson1ArrayValueList = (output, context) => {
672
832
  });
673
833
  return retVal;
674
834
  };
675
- const deserializeAws_restJson1BooleanArray = (output, context) => {
676
- const retVal = (output || [])
677
- .filter((e) => e != null)
678
- .map((entry) => {
835
+ var deserializeAws_restJson1BooleanArray = function (output, context) {
836
+ var retVal = (output || [])
837
+ .filter(function (e) { return e != null; })
838
+ .map(function (entry) {
679
839
  if (entry === null) {
680
840
  return null;
681
841
  }
@@ -683,7 +843,7 @@ const deserializeAws_restJson1BooleanArray = (output, context) => {
683
843
  });
684
844
  return retVal;
685
845
  };
686
- const deserializeAws_restJson1ColumnMetadata = (output, context) => {
846
+ var deserializeAws_restJson1ColumnMetadata = function (output, context) {
687
847
  return {
688
848
  arrayBaseColumnType: __expectInt32(output.arrayBaseColumnType),
689
849
  isAutoIncrement: __expectBoolean(output.isAutoIncrement),
@@ -701,10 +861,10 @@ const deserializeAws_restJson1ColumnMetadata = (output, context) => {
701
861
  typeName: __expectString(output.typeName),
702
862
  };
703
863
  };
704
- const deserializeAws_restJson1DoubleArray = (output, context) => {
705
- const retVal = (output || [])
706
- .filter((e) => e != null)
707
- .map((entry) => {
864
+ var deserializeAws_restJson1DoubleArray = function (output, context) {
865
+ var retVal = (output || [])
866
+ .filter(function (e) { return e != null; })
867
+ .map(function (entry) {
708
868
  if (entry === null) {
709
869
  return null;
710
870
  }
@@ -712,7 +872,7 @@ const deserializeAws_restJson1DoubleArray = (output, context) => {
712
872
  });
713
873
  return retVal;
714
874
  };
715
- const deserializeAws_restJson1Field = (output, context) => {
875
+ var deserializeAws_restJson1Field = function (output, context) {
716
876
  if (output.arrayValue != null) {
717
877
  return {
718
878
  arrayValue: deserializeAws_restJson1ArrayValue(__expectUnion(output.arrayValue), context),
@@ -740,10 +900,10 @@ const deserializeAws_restJson1Field = (output, context) => {
740
900
  }
741
901
  return { $unknown: Object.entries(output)[0] };
742
902
  };
743
- const deserializeAws_restJson1FieldList = (output, context) => {
744
- const retVal = (output || [])
745
- .filter((e) => e != null)
746
- .map((entry) => {
903
+ var deserializeAws_restJson1FieldList = function (output, context) {
904
+ var retVal = (output || [])
905
+ .filter(function (e) { return e != null; })
906
+ .map(function (entry) {
747
907
  if (entry === null) {
748
908
  return null;
749
909
  }
@@ -751,10 +911,10 @@ const deserializeAws_restJson1FieldList = (output, context) => {
751
911
  });
752
912
  return retVal;
753
913
  };
754
- const deserializeAws_restJson1LongArray = (output, context) => {
755
- const retVal = (output || [])
756
- .filter((e) => e != null)
757
- .map((entry) => {
914
+ var deserializeAws_restJson1LongArray = function (output, context) {
915
+ var retVal = (output || [])
916
+ .filter(function (e) { return e != null; })
917
+ .map(function (entry) {
758
918
  if (entry === null) {
759
919
  return null;
760
920
  }
@@ -762,10 +922,10 @@ const deserializeAws_restJson1LongArray = (output, context) => {
762
922
  });
763
923
  return retVal;
764
924
  };
765
- const deserializeAws_restJson1Metadata = (output, context) => {
766
- const retVal = (output || [])
767
- .filter((e) => e != null)
768
- .map((entry) => {
925
+ var deserializeAws_restJson1Metadata = function (output, context) {
926
+ var retVal = (output || [])
927
+ .filter(function (e) { return e != null; })
928
+ .map(function (entry) {
769
929
  if (entry === null) {
770
930
  return null;
771
931
  }
@@ -773,15 +933,15 @@ const deserializeAws_restJson1Metadata = (output, context) => {
773
933
  });
774
934
  return retVal;
775
935
  };
776
- const deserializeAws_restJson1_Record = (output, context) => {
936
+ var deserializeAws_restJson1_Record = function (output, context) {
777
937
  return {
778
938
  values: output.values != null ? deserializeAws_restJson1Row(output.values, context) : undefined,
779
939
  };
780
940
  };
781
- const deserializeAws_restJson1Records = (output, context) => {
782
- const retVal = (output || [])
783
- .filter((e) => e != null)
784
- .map((entry) => {
941
+ var deserializeAws_restJson1Records = function (output, context) {
942
+ var retVal = (output || [])
943
+ .filter(function (e) { return e != null; })
944
+ .map(function (entry) {
785
945
  if (entry === null) {
786
946
  return null;
787
947
  }
@@ -789,7 +949,7 @@ const deserializeAws_restJson1Records = (output, context) => {
789
949
  });
790
950
  return retVal;
791
951
  };
792
- const deserializeAws_restJson1ResultFrame = (output, context) => {
952
+ var deserializeAws_restJson1ResultFrame = function (output, context) {
793
953
  return {
794
954
  records: output.records != null ? deserializeAws_restJson1Records(output.records, context) : undefined,
795
955
  resultSetMetadata: output.resultSetMetadata != null
@@ -797,16 +957,16 @@ const deserializeAws_restJson1ResultFrame = (output, context) => {
797
957
  : undefined,
798
958
  };
799
959
  };
800
- const deserializeAws_restJson1ResultSetMetadata = (output, context) => {
960
+ var deserializeAws_restJson1ResultSetMetadata = function (output, context) {
801
961
  return {
802
962
  columnCount: __expectLong(output.columnCount),
803
963
  columnMetadata: output.columnMetadata != null ? deserializeAws_restJson1Metadata(output.columnMetadata, context) : undefined,
804
964
  };
805
965
  };
806
- const deserializeAws_restJson1Row = (output, context) => {
807
- const retVal = (output || [])
808
- .filter((e) => e != null)
809
- .map((entry) => {
966
+ var deserializeAws_restJson1Row = function (output, context) {
967
+ var retVal = (output || [])
968
+ .filter(function (e) { return e != null; })
969
+ .map(function (entry) {
810
970
  if (entry === null) {
811
971
  return null;
812
972
  }
@@ -814,10 +974,10 @@ const deserializeAws_restJson1Row = (output, context) => {
814
974
  });
815
975
  return retVal;
816
976
  };
817
- const deserializeAws_restJson1SqlRecords = (output, context) => {
818
- const retVal = (output || [])
819
- .filter((e) => e != null)
820
- .map((entry) => {
977
+ var deserializeAws_restJson1SqlRecords = function (output, context) {
978
+ var retVal = (output || [])
979
+ .filter(function (e) { return e != null; })
980
+ .map(function (entry) {
821
981
  if (entry === null) {
822
982
  return null;
823
983
  }
@@ -825,16 +985,16 @@ const deserializeAws_restJson1SqlRecords = (output, context) => {
825
985
  });
826
986
  return retVal;
827
987
  };
828
- const deserializeAws_restJson1SqlStatementResult = (output, context) => {
988
+ var deserializeAws_restJson1SqlStatementResult = function (output, context) {
829
989
  return {
830
990
  numberOfRecordsUpdated: __expectLong(output.numberOfRecordsUpdated),
831
991
  resultFrame: output.resultFrame != null ? deserializeAws_restJson1ResultFrame(output.resultFrame, context) : undefined,
832
992
  };
833
993
  };
834
- const deserializeAws_restJson1SqlStatementResults = (output, context) => {
835
- const retVal = (output || [])
836
- .filter((e) => e != null)
837
- .map((entry) => {
994
+ var deserializeAws_restJson1SqlStatementResults = function (output, context) {
995
+ var retVal = (output || [])
996
+ .filter(function (e) { return e != null; })
997
+ .map(function (entry) {
838
998
  if (entry === null) {
839
999
  return null;
840
1000
  }
@@ -842,10 +1002,10 @@ const deserializeAws_restJson1SqlStatementResults = (output, context) => {
842
1002
  });
843
1003
  return retVal;
844
1004
  };
845
- const deserializeAws_restJson1StringArray = (output, context) => {
846
- const retVal = (output || [])
847
- .filter((e) => e != null)
848
- .map((entry) => {
1005
+ var deserializeAws_restJson1StringArray = function (output, context) {
1006
+ var retVal = (output || [])
1007
+ .filter(function (e) { return e != null; })
1008
+ .map(function (entry) {
849
1009
  if (entry === null) {
850
1010
  return null;
851
1011
  }
@@ -853,20 +1013,20 @@ const deserializeAws_restJson1StringArray = (output, context) => {
853
1013
  });
854
1014
  return retVal;
855
1015
  };
856
- const deserializeAws_restJson1StructValue = (output, context) => {
1016
+ var deserializeAws_restJson1StructValue = function (output, context) {
857
1017
  return {
858
1018
  attributes: output.attributes != null ? deserializeAws_restJson1ArrayValueList(output.attributes, context) : undefined,
859
1019
  };
860
1020
  };
861
- const deserializeAws_restJson1UpdateResult = (output, context) => {
1021
+ var deserializeAws_restJson1UpdateResult = function (output, context) {
862
1022
  return {
863
1023
  generatedFields: output.generatedFields != null ? deserializeAws_restJson1FieldList(output.generatedFields, context) : undefined,
864
1024
  };
865
1025
  };
866
- const deserializeAws_restJson1UpdateResults = (output, context) => {
867
- const retVal = (output || [])
868
- .filter((e) => e != null)
869
- .map((entry) => {
1026
+ var deserializeAws_restJson1UpdateResults = function (output, context) {
1027
+ var retVal = (output || [])
1028
+ .filter(function (e) { return e != null; })
1029
+ .map(function (entry) {
870
1030
  if (entry === null) {
871
1031
  return null;
872
1032
  }
@@ -874,7 +1034,7 @@ const deserializeAws_restJson1UpdateResults = (output, context) => {
874
1034
  });
875
1035
  return retVal;
876
1036
  };
877
- const deserializeAws_restJson1Value = (output, context) => {
1037
+ var deserializeAws_restJson1Value = function (output, context) {
878
1038
  if (output.arrayValues != null) {
879
1039
  return {
880
1040
  arrayValues: deserializeAws_restJson1ArrayValueList(output.arrayValues, context),
@@ -913,39 +1073,57 @@ const deserializeAws_restJson1Value = (output, context) => {
913
1073
  }
914
1074
  return { $unknown: Object.entries(output)[0] };
915
1075
  };
916
- const deserializeMetadata = (output) => ({
917
- httpStatusCode: output.statusCode,
918
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"],
919
- extendedRequestId: output.headers["x-amz-id-2"],
920
- cfId: output.headers["x-amz-cf-id"],
921
- });
922
- const collectBody = (streamBody = new Uint8Array(), context) => {
1076
+ var deserializeMetadata = function (output) {
1077
+ var _a, _b;
1078
+ return ({
1079
+ httpStatusCode: output.statusCode,
1080
+ requestId: (_b = (_a = output.headers["x-amzn-requestid"]) !== null && _a !== void 0 ? _a : output.headers["x-amzn-request-id"]) !== null && _b !== void 0 ? _b : output.headers["x-amz-request-id"],
1081
+ extendedRequestId: output.headers["x-amz-id-2"],
1082
+ cfId: output.headers["x-amz-cf-id"],
1083
+ });
1084
+ };
1085
+ var collectBody = function (streamBody, context) {
1086
+ if (streamBody === void 0) { streamBody = new Uint8Array(); }
923
1087
  if (streamBody instanceof Uint8Array) {
924
1088
  return Promise.resolve(streamBody);
925
1089
  }
926
1090
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
927
1091
  };
928
- const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
929
- const isSerializableHeaderValue = (value) => value !== undefined &&
930
- value !== null &&
931
- value !== "" &&
932
- (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
933
- (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
934
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
935
- if (encoded.length) {
936
- return JSON.parse(encoded);
937
- }
938
- return {};
939
- });
940
- const parseErrorBody = async (errorBody, context) => {
941
- const value = await parseBody(errorBody, context);
942
- value.message = value.message ?? value.Message;
943
- return value;
944
- };
945
- const loadRestJsonErrorCode = (output, data) => {
946
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
947
- const sanitizeErrorCode = (rawValue) => {
948
- let cleanValue = rawValue;
1092
+ var collectBodyString = function (streamBody, context) {
1093
+ return collectBody(streamBody, context).then(function (body) { return context.utf8Encoder(body); });
1094
+ };
1095
+ var isSerializableHeaderValue = function (value) {
1096
+ return value !== undefined &&
1097
+ value !== null &&
1098
+ value !== "" &&
1099
+ (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
1100
+ (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
1101
+ };
1102
+ var parseBody = function (streamBody, context) {
1103
+ return collectBodyString(streamBody, context).then(function (encoded) {
1104
+ if (encoded.length) {
1105
+ return JSON.parse(encoded);
1106
+ }
1107
+ return {};
1108
+ });
1109
+ };
1110
+ var parseErrorBody = function (errorBody, context) { return __awaiter(void 0, void 0, void 0, function () {
1111
+ var value;
1112
+ var _a;
1113
+ return __generator(this, function (_b) {
1114
+ switch (_b.label) {
1115
+ case 0: return [4, parseBody(errorBody, context)];
1116
+ case 1:
1117
+ value = _b.sent();
1118
+ value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message;
1119
+ return [2, value];
1120
+ }
1121
+ });
1122
+ }); };
1123
+ var loadRestJsonErrorCode = function (output, data) {
1124
+ var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
1125
+ var sanitizeErrorCode = function (rawValue) {
1126
+ var cleanValue = rawValue;
949
1127
  if (typeof cleanValue === "number") {
950
1128
  cleanValue = cleanValue.toString();
951
1129
  }
@@ -960,7 +1138,7 @@ const loadRestJsonErrorCode = (output, data) => {
960
1138
  }
961
1139
  return cleanValue;
962
1140
  };
963
- const headerKey = findKey(output.headers, "x-amzn-errortype");
1141
+ var headerKey = findKey(output.headers, "x-amzn-errortype");
964
1142
  if (headerKey !== undefined) {
965
1143
  return sanitizeErrorCode(output.headers[headerKey]);
966
1144
  }