@aws-sdk/client-emr-serverless 3.180.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 (47) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/dist-cjs/EMRServerless.js +15 -0
  3. package/dist-cjs/commands/GetDashboardForJobRunCommand.js +36 -0
  4. package/dist-cjs/commands/index.js +1 -0
  5. package/dist-cjs/models/models_0.js +10 -2
  6. package/dist-cjs/protocols/Aws_restJson1.js +82 -23
  7. package/dist-es/EMRServerless.js +72 -64
  8. package/dist-es/EMRServerlessClient.js +22 -28
  9. package/dist-es/commands/CancelJobRunCommand.js +21 -28
  10. package/dist-es/commands/CreateApplicationCommand.js +21 -28
  11. package/dist-es/commands/DeleteApplicationCommand.js +21 -28
  12. package/dist-es/commands/GetApplicationCommand.js +21 -28
  13. package/dist-es/commands/GetDashboardForJobRunCommand.js +32 -0
  14. package/dist-es/commands/GetJobRunCommand.js +21 -28
  15. package/dist-es/commands/ListApplicationsCommand.js +21 -28
  16. package/dist-es/commands/ListJobRunsCommand.js +21 -28
  17. package/dist-es/commands/ListTagsForResourceCommand.js +21 -28
  18. package/dist-es/commands/StartApplicationCommand.js +21 -28
  19. package/dist-es/commands/StartJobRunCommand.js +21 -28
  20. package/dist-es/commands/StopApplicationCommand.js +21 -28
  21. package/dist-es/commands/TagResourceCommand.js +21 -28
  22. package/dist-es/commands/UntagResourceCommand.js +21 -28
  23. package/dist-es/commands/UpdateApplicationCommand.js +21 -28
  24. package/dist-es/commands/index.js +1 -0
  25. package/dist-es/endpoints.js +8 -8
  26. package/dist-es/models/EMRServerlessServiceException.js +5 -10
  27. package/dist-es/models/models_0.js +224 -114
  28. package/dist-es/pagination/ListApplicationsPaginator.js +25 -68
  29. package/dist-es/pagination/ListJobRunsPaginator.js +25 -68
  30. package/dist-es/protocols/Aws_restJson1.js +1150 -1455
  31. package/dist-es/runtimeConfig.browser.js +26 -12
  32. package/dist-es/runtimeConfig.js +30 -12
  33. package/dist-es/runtimeConfig.native.js +8 -5
  34. package/dist-es/runtimeConfig.shared.js +8 -11
  35. package/dist-types/EMRServerless.d.ts +7 -0
  36. package/dist-types/EMRServerlessClient.d.ts +3 -2
  37. package/dist-types/commands/GetDashboardForJobRunCommand.d.ts +35 -0
  38. package/dist-types/commands/index.d.ts +1 -0
  39. package/dist-types/models/models_0.d.ts +68 -22
  40. package/dist-types/protocols/Aws_restJson1.d.ts +3 -0
  41. package/dist-types/ts3.4/EMRServerless.d.ts +17 -0
  42. package/dist-types/ts3.4/EMRServerlessClient.d.ts +6 -0
  43. package/dist-types/ts3.4/commands/GetDashboardForJobRunCommand.d.ts +39 -0
  44. package/dist-types/ts3.4/commands/index.d.ts +1 -0
  45. package/dist-types/ts3.4/models/models_0.d.ts +13 -0
  46. package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +12 -0
  47. package/package.json +33 -33
@@ -1,1462 +1,1159 @@
1
- import { __assign, __awaiter, __generator, __read } 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, expectObject as __expectObject, expectString as __expectString, expectUnion as __expectUnion, limitedParseDouble as __limitedParseDouble, map as __map, parseEpochTimestamp as __parseEpochTimestamp, resolvedPath as __resolvedPath, throwDefaultError, } from "@aws-sdk/smithy-client";
4
3
  import { v4 as generateIdempotencyToken } from "uuid";
5
4
  import { EMRServerlessServiceException as __BaseException } from "../models/EMRServerlessServiceException";
6
5
  import { ConflictException, InternalServerException, JobDriver, ResourceNotFoundException, ServiceQuotaExceededException, ValidationException, } from "../models/models_0";
7
- export var serializeAws_restJson1CancelJobRunCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
8
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
9
- return __generator(this, function (_c) {
10
- switch (_c.label) {
11
- case 0: return [4, context.endpoint()];
12
- case 1:
13
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
14
- headers = {};
15
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
16
- "/applications/{applicationId}/jobruns/{jobRunId}";
17
- resolvedPath = __resolvedPath(resolvedPath, input, "applicationId", function () { return input.applicationId; }, "{applicationId}", false);
18
- resolvedPath = __resolvedPath(resolvedPath, input, "jobRunId", function () { return input.jobRunId; }, "{jobRunId}", false);
19
- return [2, new __HttpRequest({
20
- protocol: protocol,
21
- hostname: hostname,
22
- port: port,
23
- method: "DELETE",
24
- headers: headers,
25
- path: resolvedPath,
26
- body: body,
27
- })];
28
- }
29
- });
30
- }); };
31
- export var serializeAws_restJson1CreateApplicationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
32
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
33
- var _c;
34
- return __generator(this, function (_d) {
35
- switch (_d.label) {
36
- case 0: return [4, context.endpoint()];
37
- case 1:
38
- _a = _d.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 || "") + "/applications";
43
- body = JSON.stringify(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.autoStartConfiguration != null && {
44
- autoStartConfiguration: serializeAws_restJson1AutoStartConfig(input.autoStartConfiguration, context),
45
- })), (input.autoStopConfiguration != null && {
46
- autoStopConfiguration: serializeAws_restJson1AutoStopConfig(input.autoStopConfiguration, context),
47
- })), { clientToken: (_c = input.clientToken) !== null && _c !== void 0 ? _c : generateIdempotencyToken() }), (input.initialCapacity != null && {
48
- initialCapacity: serializeAws_restJson1InitialCapacityConfigMap(input.initialCapacity, context),
49
- })), (input.maximumCapacity != null && {
50
- maximumCapacity: serializeAws_restJson1MaximumAllowedResources(input.maximumCapacity, context),
51
- })), (input.name != null && { name: input.name })), (input.networkConfiguration != null && {
52
- networkConfiguration: serializeAws_restJson1NetworkConfiguration(input.networkConfiguration, context),
53
- })), (input.releaseLabel != null && { releaseLabel: input.releaseLabel })), (input.tags != null && { tags: serializeAws_restJson1TagMap(input.tags, context) })), (input.type != null && { type: input.type })));
54
- return [2, new __HttpRequest({
55
- protocol: protocol,
56
- hostname: hostname,
57
- port: port,
58
- method: "POST",
59
- headers: headers,
60
- path: resolvedPath,
61
- body: body,
62
- })];
63
- }
64
- });
65
- }); };
66
- export var serializeAws_restJson1DeleteApplicationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
67
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
68
- return __generator(this, function (_c) {
69
- switch (_c.label) {
70
- case 0: return [4, context.endpoint()];
71
- case 1:
72
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
73
- headers = {};
74
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/applications/{applicationId}";
75
- resolvedPath = __resolvedPath(resolvedPath, input, "applicationId", function () { return input.applicationId; }, "{applicationId}", false);
76
- return [2, new __HttpRequest({
77
- protocol: protocol,
78
- hostname: hostname,
79
- port: port,
80
- method: "DELETE",
81
- headers: headers,
82
- path: resolvedPath,
83
- body: body,
84
- })];
85
- }
86
- });
87
- }); };
88
- export var serializeAws_restJson1GetApplicationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
89
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
90
- return __generator(this, function (_c) {
91
- switch (_c.label) {
92
- case 0: return [4, context.endpoint()];
93
- case 1:
94
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
95
- headers = {};
96
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/applications/{applicationId}";
97
- resolvedPath = __resolvedPath(resolvedPath, input, "applicationId", function () { return input.applicationId; }, "{applicationId}", false);
98
- return [2, new __HttpRequest({
99
- protocol: protocol,
100
- hostname: hostname,
101
- port: port,
102
- method: "GET",
103
- headers: headers,
104
- path: resolvedPath,
105
- body: body,
106
- })];
107
- }
6
+ export const serializeAws_restJson1CancelJobRunCommand = async (input, context) => {
7
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
8
+ const headers = {};
9
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
10
+ "/applications/{applicationId}/jobruns/{jobRunId}";
11
+ resolvedPath = __resolvedPath(resolvedPath, input, "applicationId", () => input.applicationId, "{applicationId}", false);
12
+ resolvedPath = __resolvedPath(resolvedPath, input, "jobRunId", () => input.jobRunId, "{jobRunId}", false);
13
+ let body;
14
+ return new __HttpRequest({
15
+ protocol,
16
+ hostname,
17
+ port,
18
+ method: "DELETE",
19
+ headers,
20
+ path: resolvedPath,
21
+ body,
108
22
  });
109
- }); };
110
- export var serializeAws_restJson1GetJobRunCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
111
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
112
- return __generator(this, function (_c) {
113
- switch (_c.label) {
114
- case 0: return [4, context.endpoint()];
115
- case 1:
116
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
117
- headers = {};
118
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
119
- "/applications/{applicationId}/jobruns/{jobRunId}";
120
- resolvedPath = __resolvedPath(resolvedPath, input, "applicationId", function () { return input.applicationId; }, "{applicationId}", false);
121
- resolvedPath = __resolvedPath(resolvedPath, input, "jobRunId", function () { return input.jobRunId; }, "{jobRunId}", false);
122
- return [2, new __HttpRequest({
123
- protocol: protocol,
124
- hostname: hostname,
125
- port: port,
126
- method: "GET",
127
- headers: headers,
128
- path: resolvedPath,
129
- body: body,
130
- })];
131
- }
132
- });
133
- }); };
134
- export var serializeAws_restJson1ListApplicationsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
135
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
136
- return __generator(this, function (_c) {
137
- switch (_c.label) {
138
- case 0: return [4, context.endpoint()];
139
- case 1:
140
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
141
- headers = {};
142
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/applications";
143
- query = map({
144
- nextToken: [, input.nextToken],
145
- maxResults: [function () { return input.maxResults !== void 0; }, function () { return input.maxResults.toString(); }],
146
- states: [
147
- function () { return input.states !== void 0; },
148
- function () { return (Array.from(input.states.values()) || []).map(function (_entry) { return _entry; }); },
149
- ],
150
- });
151
- return [2, new __HttpRequest({
152
- protocol: protocol,
153
- hostname: hostname,
154
- port: port,
155
- method: "GET",
156
- headers: headers,
157
- path: resolvedPath,
158
- query: query,
159
- body: body,
160
- })];
161
- }
23
+ };
24
+ export const serializeAws_restJson1CreateApplicationCommand = async (input, context) => {
25
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
26
+ const headers = {
27
+ "content-type": "application/json",
28
+ };
29
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/applications";
30
+ let body;
31
+ body = JSON.stringify({
32
+ ...(input.autoStartConfiguration != null && {
33
+ autoStartConfiguration: serializeAws_restJson1AutoStartConfig(input.autoStartConfiguration, context),
34
+ }),
35
+ ...(input.autoStopConfiguration != null && {
36
+ autoStopConfiguration: serializeAws_restJson1AutoStopConfig(input.autoStopConfiguration, context),
37
+ }),
38
+ clientToken: input.clientToken ?? generateIdempotencyToken(),
39
+ ...(input.initialCapacity != null && {
40
+ initialCapacity: serializeAws_restJson1InitialCapacityConfigMap(input.initialCapacity, context),
41
+ }),
42
+ ...(input.maximumCapacity != null && {
43
+ maximumCapacity: serializeAws_restJson1MaximumAllowedResources(input.maximumCapacity, context),
44
+ }),
45
+ ...(input.name != null && { name: input.name }),
46
+ ...(input.networkConfiguration != null && {
47
+ networkConfiguration: serializeAws_restJson1NetworkConfiguration(input.networkConfiguration, context),
48
+ }),
49
+ ...(input.releaseLabel != null && { releaseLabel: input.releaseLabel }),
50
+ ...(input.tags != null && { tags: serializeAws_restJson1TagMap(input.tags, context) }),
51
+ ...(input.type != null && { type: input.type }),
162
52
  });
163
- }); };
164
- export var serializeAws_restJson1ListJobRunsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
165
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
166
- return __generator(this, function (_c) {
167
- switch (_c.label) {
168
- case 0: return [4, context.endpoint()];
169
- case 1:
170
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
171
- headers = {};
172
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/applications/{applicationId}/jobruns";
173
- resolvedPath = __resolvedPath(resolvedPath, input, "applicationId", function () { return input.applicationId; }, "{applicationId}", false);
174
- query = map({
175
- nextToken: [, input.nextToken],
176
- maxResults: [function () { return input.maxResults !== void 0; }, function () { return input.maxResults.toString(); }],
177
- createdAtAfter: [
178
- function () { return input.createdAtAfter !== void 0; },
179
- function () { return (input.createdAtAfter.toISOString().split(".")[0] + "Z").toString(); },
180
- ],
181
- createdAtBefore: [
182
- function () { return input.createdAtBefore !== void 0; },
183
- function () { return (input.createdAtBefore.toISOString().split(".")[0] + "Z").toString(); },
184
- ],
185
- states: [
186
- function () { return input.states !== void 0; },
187
- function () { return (Array.from(input.states.values()) || []).map(function (_entry) { return _entry; }); },
188
- ],
189
- });
190
- return [2, new __HttpRequest({
191
- protocol: protocol,
192
- hostname: hostname,
193
- port: port,
194
- method: "GET",
195
- headers: headers,
196
- path: resolvedPath,
197
- query: query,
198
- body: body,
199
- })];
200
- }
53
+ return new __HttpRequest({
54
+ protocol,
55
+ hostname,
56
+ port,
57
+ method: "POST",
58
+ headers,
59
+ path: resolvedPath,
60
+ body,
201
61
  });
202
- }); };
203
- export var serializeAws_restJson1ListTagsForResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
204
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
205
- return __generator(this, function (_c) {
206
- switch (_c.label) {
207
- case 0: return [4, context.endpoint()];
208
- case 1:
209
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
210
- headers = {};
211
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{resourceArn}";
212
- resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", function () { return input.resourceArn; }, "{resourceArn}", false);
213
- return [2, new __HttpRequest({
214
- protocol: protocol,
215
- hostname: hostname,
216
- port: port,
217
- method: "GET",
218
- headers: headers,
219
- path: resolvedPath,
220
- body: body,
221
- })];
222
- }
62
+ };
63
+ export const serializeAws_restJson1DeleteApplicationCommand = async (input, context) => {
64
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
65
+ const headers = {};
66
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/applications/{applicationId}";
67
+ resolvedPath = __resolvedPath(resolvedPath, input, "applicationId", () => input.applicationId, "{applicationId}", false);
68
+ let body;
69
+ return new __HttpRequest({
70
+ protocol,
71
+ hostname,
72
+ port,
73
+ method: "DELETE",
74
+ headers,
75
+ path: resolvedPath,
76
+ body,
223
77
  });
224
- }); };
225
- export var serializeAws_restJson1StartApplicationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
226
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
227
- return __generator(this, function (_c) {
228
- switch (_c.label) {
229
- case 0: return [4, context.endpoint()];
230
- case 1:
231
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
232
- headers = {};
233
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/applications/{applicationId}/start";
234
- resolvedPath = __resolvedPath(resolvedPath, input, "applicationId", function () { return input.applicationId; }, "{applicationId}", false);
235
- return [2, new __HttpRequest({
236
- protocol: protocol,
237
- hostname: hostname,
238
- port: port,
239
- method: "POST",
240
- headers: headers,
241
- path: resolvedPath,
242
- body: body,
243
- })];
244
- }
78
+ };
79
+ export const serializeAws_restJson1GetApplicationCommand = async (input, context) => {
80
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
81
+ const headers = {};
82
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/applications/{applicationId}";
83
+ resolvedPath = __resolvedPath(resolvedPath, input, "applicationId", () => input.applicationId, "{applicationId}", false);
84
+ let body;
85
+ return new __HttpRequest({
86
+ protocol,
87
+ hostname,
88
+ port,
89
+ method: "GET",
90
+ headers,
91
+ path: resolvedPath,
92
+ body,
245
93
  });
246
- }); };
247
- export var serializeAws_restJson1StartJobRunCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
248
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
249
- var _c;
250
- return __generator(this, function (_d) {
251
- switch (_d.label) {
252
- case 0: return [4, context.endpoint()];
253
- case 1:
254
- _a = _d.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
255
- headers = {
256
- "content-type": "application/json",
257
- };
258
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/applications/{applicationId}/jobruns";
259
- resolvedPath = __resolvedPath(resolvedPath, input, "applicationId", function () { return input.applicationId; }, "{applicationId}", false);
260
- body = JSON.stringify(__assign(__assign(__assign(__assign(__assign(__assign({ clientToken: (_c = input.clientToken) !== null && _c !== void 0 ? _c : generateIdempotencyToken() }, (input.configurationOverrides != null && {
261
- configurationOverrides: serializeAws_restJson1ConfigurationOverrides(input.configurationOverrides, context),
262
- })), (input.executionRoleArn != null && { executionRoleArn: input.executionRoleArn })), (input.executionTimeoutMinutes != null && { executionTimeoutMinutes: input.executionTimeoutMinutes })), (input.jobDriver != null && { jobDriver: serializeAws_restJson1JobDriver(input.jobDriver, context) })), (input.name != null && { name: input.name })), (input.tags != null && { tags: serializeAws_restJson1TagMap(input.tags, context) })));
263
- return [2, new __HttpRequest({
264
- protocol: protocol,
265
- hostname: hostname,
266
- port: port,
267
- method: "POST",
268
- headers: headers,
269
- path: resolvedPath,
270
- body: body,
271
- })];
272
- }
94
+ };
95
+ export const serializeAws_restJson1GetDashboardForJobRunCommand = async (input, context) => {
96
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
97
+ const headers = {};
98
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
99
+ "/applications/{applicationId}/jobruns/{jobRunId}/dashboard";
100
+ resolvedPath = __resolvedPath(resolvedPath, input, "applicationId", () => input.applicationId, "{applicationId}", false);
101
+ resolvedPath = __resolvedPath(resolvedPath, input, "jobRunId", () => input.jobRunId, "{jobRunId}", false);
102
+ let body;
103
+ return new __HttpRequest({
104
+ protocol,
105
+ hostname,
106
+ port,
107
+ method: "GET",
108
+ headers,
109
+ path: resolvedPath,
110
+ body,
273
111
  });
274
- }); };
275
- export var serializeAws_restJson1StopApplicationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
276
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
277
- return __generator(this, function (_c) {
278
- switch (_c.label) {
279
- case 0: return [4, context.endpoint()];
280
- case 1:
281
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
282
- headers = {};
283
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/applications/{applicationId}/stop";
284
- resolvedPath = __resolvedPath(resolvedPath, input, "applicationId", function () { return input.applicationId; }, "{applicationId}", false);
285
- return [2, new __HttpRequest({
286
- protocol: protocol,
287
- hostname: hostname,
288
- port: port,
289
- method: "POST",
290
- headers: headers,
291
- path: resolvedPath,
292
- body: body,
293
- })];
294
- }
112
+ };
113
+ export const serializeAws_restJson1GetJobRunCommand = async (input, context) => {
114
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
115
+ const headers = {};
116
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
117
+ "/applications/{applicationId}/jobruns/{jobRunId}";
118
+ resolvedPath = __resolvedPath(resolvedPath, input, "applicationId", () => input.applicationId, "{applicationId}", false);
119
+ resolvedPath = __resolvedPath(resolvedPath, input, "jobRunId", () => input.jobRunId, "{jobRunId}", false);
120
+ let body;
121
+ return new __HttpRequest({
122
+ protocol,
123
+ hostname,
124
+ port,
125
+ method: "GET",
126
+ headers,
127
+ path: resolvedPath,
128
+ body,
295
129
  });
296
- }); };
297
- export var serializeAws_restJson1TagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
298
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
299
- return __generator(this, function (_c) {
300
- switch (_c.label) {
301
- case 0: return [4, context.endpoint()];
302
- case 1:
303
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
304
- headers = {
305
- "content-type": "application/json",
306
- };
307
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{resourceArn}";
308
- resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", function () { return input.resourceArn; }, "{resourceArn}", false);
309
- body = JSON.stringify(__assign({}, (input.tags != null && { tags: serializeAws_restJson1TagMap(input.tags, context) })));
310
- return [2, new __HttpRequest({
311
- protocol: protocol,
312
- hostname: hostname,
313
- port: port,
314
- method: "POST",
315
- headers: headers,
316
- path: resolvedPath,
317
- body: body,
318
- })];
319
- }
130
+ };
131
+ export const serializeAws_restJson1ListApplicationsCommand = async (input, context) => {
132
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
133
+ const headers = {};
134
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/applications";
135
+ const query = map({
136
+ nextToken: [, input.nextToken],
137
+ maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
138
+ states: [() => input.states !== void 0, () => (input.states || []).map((_entry) => _entry)],
320
139
  });
321
- }); };
322
- export var serializeAws_restJson1UntagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
323
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
324
- return __generator(this, function (_c) {
325
- switch (_c.label) {
326
- case 0: return [4, context.endpoint()];
327
- case 1:
328
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
329
- headers = {};
330
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{resourceArn}";
331
- resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", function () { return input.resourceArn; }, "{resourceArn}", false);
332
- query = map({
333
- tagKeys: [function () { return input.tagKeys !== void 0; }, function () { return (input.tagKeys || []).map(function (_entry) { return _entry; }); }],
334
- });
335
- return [2, new __HttpRequest({
336
- protocol: protocol,
337
- hostname: hostname,
338
- port: port,
339
- method: "DELETE",
340
- headers: headers,
341
- path: resolvedPath,
342
- query: query,
343
- body: body,
344
- })];
345
- }
140
+ let body;
141
+ return new __HttpRequest({
142
+ protocol,
143
+ hostname,
144
+ port,
145
+ method: "GET",
146
+ headers,
147
+ path: resolvedPath,
148
+ query,
149
+ body,
346
150
  });
347
- }); };
348
- export var serializeAws_restJson1UpdateApplicationCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
349
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
350
- var _c;
351
- return __generator(this, function (_d) {
352
- switch (_d.label) {
353
- case 0: return [4, context.endpoint()];
354
- case 1:
355
- _a = _d.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
356
- headers = {
357
- "content-type": "application/json",
358
- };
359
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/applications/{applicationId}";
360
- resolvedPath = __resolvedPath(resolvedPath, input, "applicationId", function () { return input.applicationId; }, "{applicationId}", false);
361
- body = JSON.stringify(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.autoStartConfiguration != null && {
362
- autoStartConfiguration: serializeAws_restJson1AutoStartConfig(input.autoStartConfiguration, context),
363
- })), (input.autoStopConfiguration != null && {
364
- autoStopConfiguration: serializeAws_restJson1AutoStopConfig(input.autoStopConfiguration, context),
365
- })), { clientToken: (_c = input.clientToken) !== null && _c !== void 0 ? _c : generateIdempotencyToken() }), (input.initialCapacity != null && {
366
- initialCapacity: serializeAws_restJson1InitialCapacityConfigMap(input.initialCapacity, context),
367
- })), (input.maximumCapacity != null && {
368
- maximumCapacity: serializeAws_restJson1MaximumAllowedResources(input.maximumCapacity, context),
369
- })), (input.networkConfiguration != null && {
370
- networkConfiguration: serializeAws_restJson1NetworkConfiguration(input.networkConfiguration, context),
371
- })));
372
- return [2, new __HttpRequest({
373
- protocol: protocol,
374
- hostname: hostname,
375
- port: port,
376
- method: "PATCH",
377
- headers: headers,
378
- path: resolvedPath,
379
- body: body,
380
- })];
381
- }
151
+ };
152
+ export const serializeAws_restJson1ListJobRunsCommand = async (input, context) => {
153
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
154
+ const headers = {};
155
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/applications/{applicationId}/jobruns";
156
+ resolvedPath = __resolvedPath(resolvedPath, input, "applicationId", () => input.applicationId, "{applicationId}", false);
157
+ const query = map({
158
+ nextToken: [, input.nextToken],
159
+ maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
160
+ createdAtAfter: [
161
+ () => input.createdAtAfter !== void 0,
162
+ () => (input.createdAtAfter.toISOString().split(".")[0] + "Z").toString(),
163
+ ],
164
+ createdAtBefore: [
165
+ () => input.createdAtBefore !== void 0,
166
+ () => (input.createdAtBefore.toISOString().split(".")[0] + "Z").toString(),
167
+ ],
168
+ states: [() => input.states !== void 0, () => (input.states || []).map((_entry) => _entry)],
382
169
  });
383
- }); };
384
- export var deserializeAws_restJson1CancelJobRunCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
385
- var contents, data, _a, _b;
386
- return __generator(this, function (_c) {
387
- switch (_c.label) {
388
- case 0:
389
- if (output.statusCode !== 200 && output.statusCode >= 300) {
390
- return [2, deserializeAws_restJson1CancelJobRunCommandError(output, context)];
391
- }
392
- contents = map({
393
- $metadata: deserializeMetadata(output),
394
- });
395
- _a = __expectNonNull;
396
- _b = __expectObject;
397
- return [4, parseBody(output.body, context)];
398
- case 1:
399
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
400
- if (data.applicationId != null) {
401
- contents.applicationId = __expectString(data.applicationId);
402
- }
403
- if (data.jobRunId != null) {
404
- contents.jobRunId = __expectString(data.jobRunId);
405
- }
406
- return [2, contents];
407
- }
170
+ let body;
171
+ return new __HttpRequest({
172
+ protocol,
173
+ hostname,
174
+ port,
175
+ method: "GET",
176
+ headers,
177
+ path: resolvedPath,
178
+ query,
179
+ body,
408
180
  });
409
- }); };
410
- var deserializeAws_restJson1CancelJobRunCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
411
- var parsedOutput, _a, errorCode, _b, parsedBody;
412
- var _c;
413
- return __generator(this, function (_d) {
414
- switch (_d.label) {
415
- case 0:
416
- _a = [__assign({}, output)];
417
- _c = {};
418
- return [4, parseBody(output.body, context)];
419
- case 1:
420
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
421
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
422
- _b = errorCode;
423
- switch (_b) {
424
- case "InternalServerException": return [3, 2];
425
- case "com.amazonaws.emrserverless#InternalServerException": return [3, 2];
426
- case "ResourceNotFoundException": return [3, 4];
427
- case "com.amazonaws.emrserverless#ResourceNotFoundException": return [3, 4];
428
- case "ValidationException": return [3, 6];
429
- case "com.amazonaws.emrserverless#ValidationException": return [3, 6];
430
- }
431
- return [3, 8];
432
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
433
- case 3: throw _d.sent();
434
- case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
435
- case 5: throw _d.sent();
436
- case 6: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
437
- case 7: throw _d.sent();
438
- case 8:
439
- parsedBody = parsedOutput.body;
440
- throwDefaultError({
441
- output: output,
442
- parsedBody: parsedBody,
443
- exceptionCtor: __BaseException,
444
- errorCode: errorCode,
445
- });
446
- _d.label = 9;
447
- case 9: return [2];
448
- }
181
+ };
182
+ export const serializeAws_restJson1ListTagsForResourceCommand = async (input, context) => {
183
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
184
+ const headers = {};
185
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
186
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
187
+ let body;
188
+ return new __HttpRequest({
189
+ protocol,
190
+ hostname,
191
+ port,
192
+ method: "GET",
193
+ headers,
194
+ path: resolvedPath,
195
+ body,
449
196
  });
450
- }); };
451
- export var deserializeAws_restJson1CreateApplicationCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
452
- var contents, data, _a, _b;
453
- return __generator(this, function (_c) {
454
- switch (_c.label) {
455
- case 0:
456
- if (output.statusCode !== 200 && output.statusCode >= 300) {
457
- return [2, deserializeAws_restJson1CreateApplicationCommandError(output, context)];
458
- }
459
- contents = map({
460
- $metadata: deserializeMetadata(output),
461
- });
462
- _a = __expectNonNull;
463
- _b = __expectObject;
464
- return [4, parseBody(output.body, context)];
465
- case 1:
466
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
467
- if (data.applicationId != null) {
468
- contents.applicationId = __expectString(data.applicationId);
469
- }
470
- if (data.arn != null) {
471
- contents.arn = __expectString(data.arn);
472
- }
473
- if (data.name != null) {
474
- contents.name = __expectString(data.name);
475
- }
476
- return [2, contents];
477
- }
197
+ };
198
+ export const serializeAws_restJson1StartApplicationCommand = async (input, context) => {
199
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
200
+ const headers = {};
201
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/applications/{applicationId}/start";
202
+ resolvedPath = __resolvedPath(resolvedPath, input, "applicationId", () => input.applicationId, "{applicationId}", false);
203
+ let body;
204
+ return new __HttpRequest({
205
+ protocol,
206
+ hostname,
207
+ port,
208
+ method: "POST",
209
+ headers,
210
+ path: resolvedPath,
211
+ body,
478
212
  });
479
- }); };
480
- var deserializeAws_restJson1CreateApplicationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
481
- var parsedOutput, _a, errorCode, _b, parsedBody;
482
- var _c;
483
- return __generator(this, function (_d) {
484
- switch (_d.label) {
485
- case 0:
486
- _a = [__assign({}, output)];
487
- _c = {};
488
- return [4, parseBody(output.body, context)];
489
- case 1:
490
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
491
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
492
- _b = errorCode;
493
- switch (_b) {
494
- case "ConflictException": return [3, 2];
495
- case "com.amazonaws.emrserverless#ConflictException": return [3, 2];
496
- case "InternalServerException": return [3, 4];
497
- case "com.amazonaws.emrserverless#InternalServerException": return [3, 4];
498
- case "ValidationException": return [3, 6];
499
- case "com.amazonaws.emrserverless#ValidationException": return [3, 6];
500
- }
501
- return [3, 8];
502
- case 2: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
503
- case 3: throw _d.sent();
504
- case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
505
- case 5: throw _d.sent();
506
- case 6: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
507
- case 7: throw _d.sent();
508
- case 8:
509
- parsedBody = parsedOutput.body;
510
- throwDefaultError({
511
- output: output,
512
- parsedBody: parsedBody,
513
- exceptionCtor: __BaseException,
514
- errorCode: errorCode,
515
- });
516
- _d.label = 9;
517
- case 9: return [2];
518
- }
213
+ };
214
+ export const serializeAws_restJson1StartJobRunCommand = async (input, context) => {
215
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
216
+ const headers = {
217
+ "content-type": "application/json",
218
+ };
219
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/applications/{applicationId}/jobruns";
220
+ resolvedPath = __resolvedPath(resolvedPath, input, "applicationId", () => input.applicationId, "{applicationId}", false);
221
+ let body;
222
+ body = JSON.stringify({
223
+ clientToken: input.clientToken ?? generateIdempotencyToken(),
224
+ ...(input.configurationOverrides != null && {
225
+ configurationOverrides: serializeAws_restJson1ConfigurationOverrides(input.configurationOverrides, context),
226
+ }),
227
+ ...(input.executionRoleArn != null && { executionRoleArn: input.executionRoleArn }),
228
+ ...(input.executionTimeoutMinutes != null && { executionTimeoutMinutes: input.executionTimeoutMinutes }),
229
+ ...(input.jobDriver != null && { jobDriver: serializeAws_restJson1JobDriver(input.jobDriver, context) }),
230
+ ...(input.name != null && { name: input.name }),
231
+ ...(input.tags != null && { tags: serializeAws_restJson1TagMap(input.tags, context) }),
519
232
  });
520
- }); };
521
- export var deserializeAws_restJson1DeleteApplicationCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
522
- var contents;
523
- return __generator(this, function (_a) {
524
- switch (_a.label) {
525
- case 0:
526
- if (output.statusCode !== 200 && output.statusCode >= 300) {
527
- return [2, deserializeAws_restJson1DeleteApplicationCommandError(output, context)];
528
- }
529
- contents = map({
530
- $metadata: deserializeMetadata(output),
531
- });
532
- return [4, collectBody(output.body, context)];
533
- case 1:
534
- _a.sent();
535
- return [2, contents];
536
- }
233
+ return new __HttpRequest({
234
+ protocol,
235
+ hostname,
236
+ port,
237
+ method: "POST",
238
+ headers,
239
+ path: resolvedPath,
240
+ body,
537
241
  });
538
- }); };
539
- var deserializeAws_restJson1DeleteApplicationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
540
- var parsedOutput, _a, errorCode, _b, parsedBody;
541
- var _c;
542
- return __generator(this, function (_d) {
543
- switch (_d.label) {
544
- case 0:
545
- _a = [__assign({}, output)];
546
- _c = {};
547
- return [4, parseBody(output.body, context)];
548
- case 1:
549
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
550
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
551
- _b = errorCode;
552
- switch (_b) {
553
- case "InternalServerException": return [3, 2];
554
- case "com.amazonaws.emrserverless#InternalServerException": return [3, 2];
555
- case "ResourceNotFoundException": return [3, 4];
556
- case "com.amazonaws.emrserverless#ResourceNotFoundException": return [3, 4];
557
- case "ValidationException": return [3, 6];
558
- case "com.amazonaws.emrserverless#ValidationException": return [3, 6];
559
- }
560
- return [3, 8];
561
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
562
- case 3: throw _d.sent();
563
- case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
564
- case 5: throw _d.sent();
565
- case 6: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
566
- case 7: throw _d.sent();
567
- case 8:
568
- parsedBody = parsedOutput.body;
569
- throwDefaultError({
570
- output: output,
571
- parsedBody: parsedBody,
572
- exceptionCtor: __BaseException,
573
- errorCode: errorCode,
574
- });
575
- _d.label = 9;
576
- case 9: return [2];
577
- }
242
+ };
243
+ export const serializeAws_restJson1StopApplicationCommand = async (input, context) => {
244
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
245
+ const headers = {};
246
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/applications/{applicationId}/stop";
247
+ resolvedPath = __resolvedPath(resolvedPath, input, "applicationId", () => input.applicationId, "{applicationId}", false);
248
+ let body;
249
+ return new __HttpRequest({
250
+ protocol,
251
+ hostname,
252
+ port,
253
+ method: "POST",
254
+ headers,
255
+ path: resolvedPath,
256
+ body,
578
257
  });
579
- }); };
580
- export var deserializeAws_restJson1GetApplicationCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
581
- var contents, data, _a, _b;
582
- return __generator(this, function (_c) {
583
- switch (_c.label) {
584
- case 0:
585
- if (output.statusCode !== 200 && output.statusCode >= 300) {
586
- return [2, deserializeAws_restJson1GetApplicationCommandError(output, context)];
587
- }
588
- contents = map({
589
- $metadata: deserializeMetadata(output),
590
- });
591
- _a = __expectNonNull;
592
- _b = __expectObject;
593
- return [4, parseBody(output.body, context)];
594
- case 1:
595
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
596
- if (data.application != null) {
597
- contents.application = deserializeAws_restJson1Application(data.application, context);
598
- }
599
- return [2, contents];
600
- }
258
+ };
259
+ export const serializeAws_restJson1TagResourceCommand = async (input, context) => {
260
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
261
+ const headers = {
262
+ "content-type": "application/json",
263
+ };
264
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
265
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
266
+ let body;
267
+ body = JSON.stringify({
268
+ ...(input.tags != null && { tags: serializeAws_restJson1TagMap(input.tags, context) }),
601
269
  });
602
- }); };
603
- var deserializeAws_restJson1GetApplicationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
604
- var parsedOutput, _a, errorCode, _b, parsedBody;
605
- var _c;
606
- return __generator(this, function (_d) {
607
- switch (_d.label) {
608
- case 0:
609
- _a = [__assign({}, output)];
610
- _c = {};
611
- return [4, parseBody(output.body, context)];
612
- case 1:
613
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
614
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
615
- _b = errorCode;
616
- switch (_b) {
617
- case "InternalServerException": return [3, 2];
618
- case "com.amazonaws.emrserverless#InternalServerException": return [3, 2];
619
- case "ResourceNotFoundException": return [3, 4];
620
- case "com.amazonaws.emrserverless#ResourceNotFoundException": return [3, 4];
621
- case "ValidationException": return [3, 6];
622
- case "com.amazonaws.emrserverless#ValidationException": return [3, 6];
623
- }
624
- return [3, 8];
625
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
626
- case 3: throw _d.sent();
627
- case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
628
- case 5: throw _d.sent();
629
- case 6: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
630
- case 7: throw _d.sent();
631
- case 8:
632
- parsedBody = parsedOutput.body;
633
- throwDefaultError({
634
- output: output,
635
- parsedBody: parsedBody,
636
- exceptionCtor: __BaseException,
637
- errorCode: errorCode,
638
- });
639
- _d.label = 9;
640
- case 9: return [2];
641
- }
270
+ return new __HttpRequest({
271
+ protocol,
272
+ hostname,
273
+ port,
274
+ method: "POST",
275
+ headers,
276
+ path: resolvedPath,
277
+ body,
642
278
  });
643
- }); };
644
- export var deserializeAws_restJson1GetJobRunCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
645
- var contents, data, _a, _b;
646
- return __generator(this, function (_c) {
647
- switch (_c.label) {
648
- case 0:
649
- if (output.statusCode !== 200 && output.statusCode >= 300) {
650
- return [2, deserializeAws_restJson1GetJobRunCommandError(output, context)];
651
- }
652
- contents = map({
653
- $metadata: deserializeMetadata(output),
654
- });
655
- _a = __expectNonNull;
656
- _b = __expectObject;
657
- return [4, parseBody(output.body, context)];
658
- case 1:
659
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
660
- if (data.jobRun != null) {
661
- contents.jobRun = deserializeAws_restJson1JobRun(data.jobRun, context);
662
- }
663
- return [2, contents];
664
- }
279
+ };
280
+ export const serializeAws_restJson1UntagResourceCommand = async (input, context) => {
281
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
282
+ const headers = {};
283
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
284
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
285
+ const query = map({
286
+ tagKeys: [() => input.tagKeys !== void 0, () => (input.tagKeys || []).map((_entry) => _entry)],
665
287
  });
666
- }); };
667
- var deserializeAws_restJson1GetJobRunCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
668
- var parsedOutput, _a, errorCode, _b, parsedBody;
669
- var _c;
670
- return __generator(this, function (_d) {
671
- switch (_d.label) {
672
- case 0:
673
- _a = [__assign({}, output)];
674
- _c = {};
675
- return [4, parseBody(output.body, context)];
676
- case 1:
677
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
678
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
679
- _b = errorCode;
680
- switch (_b) {
681
- case "InternalServerException": return [3, 2];
682
- case "com.amazonaws.emrserverless#InternalServerException": return [3, 2];
683
- case "ResourceNotFoundException": return [3, 4];
684
- case "com.amazonaws.emrserverless#ResourceNotFoundException": return [3, 4];
685
- case "ValidationException": return [3, 6];
686
- case "com.amazonaws.emrserverless#ValidationException": return [3, 6];
687
- }
688
- return [3, 8];
689
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
690
- case 3: throw _d.sent();
691
- case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
692
- case 5: throw _d.sent();
693
- case 6: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
694
- case 7: throw _d.sent();
695
- case 8:
696
- parsedBody = parsedOutput.body;
697
- throwDefaultError({
698
- output: output,
699
- parsedBody: parsedBody,
700
- exceptionCtor: __BaseException,
701
- errorCode: errorCode,
702
- });
703
- _d.label = 9;
704
- case 9: return [2];
705
- }
288
+ let body;
289
+ return new __HttpRequest({
290
+ protocol,
291
+ hostname,
292
+ port,
293
+ method: "DELETE",
294
+ headers,
295
+ path: resolvedPath,
296
+ query,
297
+ body,
706
298
  });
707
- }); };
708
- export var deserializeAws_restJson1ListApplicationsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
709
- var contents, data, _a, _b;
710
- return __generator(this, function (_c) {
711
- switch (_c.label) {
712
- case 0:
713
- if (output.statusCode !== 200 && output.statusCode >= 300) {
714
- return [2, deserializeAws_restJson1ListApplicationsCommandError(output, context)];
715
- }
716
- contents = map({
717
- $metadata: deserializeMetadata(output),
718
- });
719
- _a = __expectNonNull;
720
- _b = __expectObject;
721
- return [4, parseBody(output.body, context)];
722
- case 1:
723
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
724
- if (data.applications != null) {
725
- contents.applications = deserializeAws_restJson1ApplicationList(data.applications, context);
726
- }
727
- if (data.nextToken != null) {
728
- contents.nextToken = __expectString(data.nextToken);
729
- }
730
- return [2, contents];
731
- }
299
+ };
300
+ export const serializeAws_restJson1UpdateApplicationCommand = async (input, context) => {
301
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
302
+ const headers = {
303
+ "content-type": "application/json",
304
+ };
305
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/applications/{applicationId}";
306
+ resolvedPath = __resolvedPath(resolvedPath, input, "applicationId", () => input.applicationId, "{applicationId}", false);
307
+ let body;
308
+ body = JSON.stringify({
309
+ ...(input.autoStartConfiguration != null && {
310
+ autoStartConfiguration: serializeAws_restJson1AutoStartConfig(input.autoStartConfiguration, context),
311
+ }),
312
+ ...(input.autoStopConfiguration != null && {
313
+ autoStopConfiguration: serializeAws_restJson1AutoStopConfig(input.autoStopConfiguration, context),
314
+ }),
315
+ clientToken: input.clientToken ?? generateIdempotencyToken(),
316
+ ...(input.initialCapacity != null && {
317
+ initialCapacity: serializeAws_restJson1InitialCapacityConfigMap(input.initialCapacity, context),
318
+ }),
319
+ ...(input.maximumCapacity != null && {
320
+ maximumCapacity: serializeAws_restJson1MaximumAllowedResources(input.maximumCapacity, context),
321
+ }),
322
+ ...(input.networkConfiguration != null && {
323
+ networkConfiguration: serializeAws_restJson1NetworkConfiguration(input.networkConfiguration, context),
324
+ }),
732
325
  });
733
- }); };
734
- var deserializeAws_restJson1ListApplicationsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
735
- var parsedOutput, _a, errorCode, _b, parsedBody;
736
- var _c;
737
- return __generator(this, function (_d) {
738
- switch (_d.label) {
739
- case 0:
740
- _a = [__assign({}, output)];
741
- _c = {};
742
- return [4, parseBody(output.body, context)];
743
- case 1:
744
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
745
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
746
- _b = errorCode;
747
- switch (_b) {
748
- case "InternalServerException": return [3, 2];
749
- case "com.amazonaws.emrserverless#InternalServerException": return [3, 2];
750
- case "ValidationException": return [3, 4];
751
- case "com.amazonaws.emrserverless#ValidationException": return [3, 4];
752
- }
753
- return [3, 6];
754
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
755
- case 3: throw _d.sent();
756
- case 4: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
757
- case 5: throw _d.sent();
758
- case 6:
759
- parsedBody = parsedOutput.body;
760
- throwDefaultError({
761
- output: output,
762
- parsedBody: parsedBody,
763
- exceptionCtor: __BaseException,
764
- errorCode: errorCode,
765
- });
766
- _d.label = 7;
767
- case 7: return [2];
768
- }
326
+ return new __HttpRequest({
327
+ protocol,
328
+ hostname,
329
+ port,
330
+ method: "PATCH",
331
+ headers,
332
+ path: resolvedPath,
333
+ body,
769
334
  });
770
- }); };
771
- export var deserializeAws_restJson1ListJobRunsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
772
- var contents, data, _a, _b;
773
- return __generator(this, function (_c) {
774
- switch (_c.label) {
775
- case 0:
776
- if (output.statusCode !== 200 && output.statusCode >= 300) {
777
- return [2, deserializeAws_restJson1ListJobRunsCommandError(output, context)];
778
- }
779
- contents = map({
780
- $metadata: deserializeMetadata(output),
781
- });
782
- _a = __expectNonNull;
783
- _b = __expectObject;
784
- return [4, parseBody(output.body, context)];
785
- case 1:
786
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
787
- if (data.jobRuns != null) {
788
- contents.jobRuns = deserializeAws_restJson1JobRuns(data.jobRuns, context);
789
- }
790
- if (data.nextToken != null) {
791
- contents.nextToken = __expectString(data.nextToken);
792
- }
793
- return [2, contents];
794
- }
795
- });
796
- }); };
797
- var deserializeAws_restJson1ListJobRunsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
798
- var parsedOutput, _a, errorCode, _b, parsedBody;
799
- var _c;
800
- return __generator(this, function (_d) {
801
- switch (_d.label) {
802
- case 0:
803
- _a = [__assign({}, output)];
804
- _c = {};
805
- return [4, parseBody(output.body, context)];
806
- case 1:
807
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
808
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
809
- _b = errorCode;
810
- switch (_b) {
811
- case "InternalServerException": return [3, 2];
812
- case "com.amazonaws.emrserverless#InternalServerException": return [3, 2];
813
- case "ValidationException": return [3, 4];
814
- case "com.amazonaws.emrserverless#ValidationException": return [3, 4];
815
- }
816
- return [3, 6];
817
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
818
- case 3: throw _d.sent();
819
- case 4: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
820
- case 5: throw _d.sent();
821
- case 6:
822
- parsedBody = parsedOutput.body;
823
- throwDefaultError({
824
- output: output,
825
- parsedBody: parsedBody,
826
- exceptionCtor: __BaseException,
827
- errorCode: errorCode,
828
- });
829
- _d.label = 7;
830
- case 7: return [2];
831
- }
335
+ };
336
+ export const deserializeAws_restJson1CancelJobRunCommand = async (output, context) => {
337
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
338
+ return deserializeAws_restJson1CancelJobRunCommandError(output, context);
339
+ }
340
+ const contents = map({
341
+ $metadata: deserializeMetadata(output),
832
342
  });
833
- }); };
834
- export var deserializeAws_restJson1ListTagsForResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
835
- var contents, data, _a, _b;
836
- return __generator(this, function (_c) {
837
- switch (_c.label) {
838
- case 0:
839
- if (output.statusCode !== 200 && output.statusCode >= 300) {
840
- return [2, deserializeAws_restJson1ListTagsForResourceCommandError(output, context)];
841
- }
842
- contents = map({
843
- $metadata: deserializeMetadata(output),
844
- });
845
- _a = __expectNonNull;
846
- _b = __expectObject;
847
- return [4, parseBody(output.body, context)];
848
- case 1:
849
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
850
- if (data.tags != null) {
851
- contents.tags = deserializeAws_restJson1TagMap(data.tags, context);
852
- }
853
- return [2, contents];
854
- }
343
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
344
+ if (data.applicationId != null) {
345
+ contents.applicationId = __expectString(data.applicationId);
346
+ }
347
+ if (data.jobRunId != null) {
348
+ contents.jobRunId = __expectString(data.jobRunId);
349
+ }
350
+ return contents;
351
+ };
352
+ const deserializeAws_restJson1CancelJobRunCommandError = async (output, context) => {
353
+ const parsedOutput = {
354
+ ...output,
355
+ body: await parseErrorBody(output.body, context),
356
+ };
357
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
358
+ switch (errorCode) {
359
+ case "InternalServerException":
360
+ case "com.amazonaws.emrserverless#InternalServerException":
361
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
362
+ case "ResourceNotFoundException":
363
+ case "com.amazonaws.emrserverless#ResourceNotFoundException":
364
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
365
+ case "ValidationException":
366
+ case "com.amazonaws.emrserverless#ValidationException":
367
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
368
+ default:
369
+ const parsedBody = parsedOutput.body;
370
+ throwDefaultError({
371
+ output,
372
+ parsedBody,
373
+ exceptionCtor: __BaseException,
374
+ errorCode,
375
+ });
376
+ }
377
+ };
378
+ export const deserializeAws_restJson1CreateApplicationCommand = async (output, context) => {
379
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
380
+ return deserializeAws_restJson1CreateApplicationCommandError(output, context);
381
+ }
382
+ const contents = map({
383
+ $metadata: deserializeMetadata(output),
855
384
  });
856
- }); };
857
- var deserializeAws_restJson1ListTagsForResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
858
- var parsedOutput, _a, errorCode, _b, parsedBody;
859
- var _c;
860
- return __generator(this, function (_d) {
861
- switch (_d.label) {
862
- case 0:
863
- _a = [__assign({}, output)];
864
- _c = {};
865
- return [4, parseBody(output.body, context)];
866
- case 1:
867
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
868
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
869
- _b = errorCode;
870
- switch (_b) {
871
- case "InternalServerException": return [3, 2];
872
- case "com.amazonaws.emrserverless#InternalServerException": return [3, 2];
873
- case "ResourceNotFoundException": return [3, 4];
874
- case "com.amazonaws.emrserverless#ResourceNotFoundException": return [3, 4];
875
- case "ValidationException": return [3, 6];
876
- case "com.amazonaws.emrserverless#ValidationException": return [3, 6];
877
- }
878
- return [3, 8];
879
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
880
- case 3: throw _d.sent();
881
- case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
882
- case 5: throw _d.sent();
883
- case 6: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
884
- case 7: throw _d.sent();
885
- case 8:
886
- parsedBody = parsedOutput.body;
887
- throwDefaultError({
888
- output: output,
889
- parsedBody: parsedBody,
890
- exceptionCtor: __BaseException,
891
- errorCode: errorCode,
892
- });
893
- _d.label = 9;
894
- case 9: return [2];
895
- }
385
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
386
+ if (data.applicationId != null) {
387
+ contents.applicationId = __expectString(data.applicationId);
388
+ }
389
+ if (data.arn != null) {
390
+ contents.arn = __expectString(data.arn);
391
+ }
392
+ if (data.name != null) {
393
+ contents.name = __expectString(data.name);
394
+ }
395
+ return contents;
396
+ };
397
+ const deserializeAws_restJson1CreateApplicationCommandError = async (output, context) => {
398
+ const parsedOutput = {
399
+ ...output,
400
+ body: await parseErrorBody(output.body, context),
401
+ };
402
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
403
+ switch (errorCode) {
404
+ case "ConflictException":
405
+ case "com.amazonaws.emrserverless#ConflictException":
406
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
407
+ case "InternalServerException":
408
+ case "com.amazonaws.emrserverless#InternalServerException":
409
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
410
+ case "ValidationException":
411
+ case "com.amazonaws.emrserverless#ValidationException":
412
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
413
+ default:
414
+ const parsedBody = parsedOutput.body;
415
+ throwDefaultError({
416
+ output,
417
+ parsedBody,
418
+ exceptionCtor: __BaseException,
419
+ errorCode,
420
+ });
421
+ }
422
+ };
423
+ export const deserializeAws_restJson1DeleteApplicationCommand = async (output, context) => {
424
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
425
+ return deserializeAws_restJson1DeleteApplicationCommandError(output, context);
426
+ }
427
+ const contents = map({
428
+ $metadata: deserializeMetadata(output),
896
429
  });
897
- }); };
898
- export var deserializeAws_restJson1StartApplicationCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
899
- var contents;
900
- return __generator(this, function (_a) {
901
- switch (_a.label) {
902
- case 0:
903
- if (output.statusCode !== 200 && output.statusCode >= 300) {
904
- return [2, deserializeAws_restJson1StartApplicationCommandError(output, context)];
905
- }
906
- contents = map({
907
- $metadata: deserializeMetadata(output),
908
- });
909
- return [4, collectBody(output.body, context)];
910
- case 1:
911
- _a.sent();
912
- return [2, contents];
913
- }
430
+ await collectBody(output.body, context);
431
+ return contents;
432
+ };
433
+ const deserializeAws_restJson1DeleteApplicationCommandError = async (output, context) => {
434
+ const parsedOutput = {
435
+ ...output,
436
+ body: await parseErrorBody(output.body, context),
437
+ };
438
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
439
+ switch (errorCode) {
440
+ case "InternalServerException":
441
+ case "com.amazonaws.emrserverless#InternalServerException":
442
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
443
+ case "ResourceNotFoundException":
444
+ case "com.amazonaws.emrserverless#ResourceNotFoundException":
445
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
446
+ case "ValidationException":
447
+ case "com.amazonaws.emrserverless#ValidationException":
448
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
449
+ default:
450
+ const parsedBody = parsedOutput.body;
451
+ throwDefaultError({
452
+ output,
453
+ parsedBody,
454
+ exceptionCtor: __BaseException,
455
+ errorCode,
456
+ });
457
+ }
458
+ };
459
+ export const deserializeAws_restJson1GetApplicationCommand = async (output, context) => {
460
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
461
+ return deserializeAws_restJson1GetApplicationCommandError(output, context);
462
+ }
463
+ const contents = map({
464
+ $metadata: deserializeMetadata(output),
914
465
  });
915
- }); };
916
- var deserializeAws_restJson1StartApplicationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
917
- var parsedOutput, _a, errorCode, _b, parsedBody;
918
- var _c;
919
- return __generator(this, function (_d) {
920
- switch (_d.label) {
921
- case 0:
922
- _a = [__assign({}, output)];
923
- _c = {};
924
- return [4, parseBody(output.body, context)];
925
- case 1:
926
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
927
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
928
- _b = errorCode;
929
- switch (_b) {
930
- case "InternalServerException": return [3, 2];
931
- case "com.amazonaws.emrserverless#InternalServerException": return [3, 2];
932
- case "ResourceNotFoundException": return [3, 4];
933
- case "com.amazonaws.emrserverless#ResourceNotFoundException": return [3, 4];
934
- case "ServiceQuotaExceededException": return [3, 6];
935
- case "com.amazonaws.emrserverless#ServiceQuotaExceededException": return [3, 6];
936
- case "ValidationException": return [3, 8];
937
- case "com.amazonaws.emrserverless#ValidationException": return [3, 8];
938
- }
939
- return [3, 10];
940
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
941
- case 3: throw _d.sent();
942
- case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
943
- case 5: throw _d.sent();
944
- case 6: return [4, deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)];
945
- case 7: throw _d.sent();
946
- case 8: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
947
- case 9: throw _d.sent();
948
- case 10:
949
- parsedBody = parsedOutput.body;
950
- throwDefaultError({
951
- output: output,
952
- parsedBody: parsedBody,
953
- exceptionCtor: __BaseException,
954
- errorCode: errorCode,
955
- });
956
- _d.label = 11;
957
- case 11: return [2];
958
- }
466
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
467
+ if (data.application != null) {
468
+ contents.application = deserializeAws_restJson1Application(data.application, context);
469
+ }
470
+ return contents;
471
+ };
472
+ const deserializeAws_restJson1GetApplicationCommandError = async (output, context) => {
473
+ const parsedOutput = {
474
+ ...output,
475
+ body: await parseErrorBody(output.body, context),
476
+ };
477
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
478
+ switch (errorCode) {
479
+ case "InternalServerException":
480
+ case "com.amazonaws.emrserverless#InternalServerException":
481
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
482
+ case "ResourceNotFoundException":
483
+ case "com.amazonaws.emrserverless#ResourceNotFoundException":
484
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
485
+ case "ValidationException":
486
+ case "com.amazonaws.emrserverless#ValidationException":
487
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
488
+ default:
489
+ const parsedBody = parsedOutput.body;
490
+ throwDefaultError({
491
+ output,
492
+ parsedBody,
493
+ exceptionCtor: __BaseException,
494
+ errorCode,
495
+ });
496
+ }
497
+ };
498
+ export const deserializeAws_restJson1GetDashboardForJobRunCommand = async (output, context) => {
499
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
500
+ return deserializeAws_restJson1GetDashboardForJobRunCommandError(output, context);
501
+ }
502
+ const contents = map({
503
+ $metadata: deserializeMetadata(output),
959
504
  });
960
- }); };
961
- export var deserializeAws_restJson1StartJobRunCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
962
- var contents, data, _a, _b;
963
- return __generator(this, function (_c) {
964
- switch (_c.label) {
965
- case 0:
966
- if (output.statusCode !== 200 && output.statusCode >= 300) {
967
- return [2, deserializeAws_restJson1StartJobRunCommandError(output, context)];
968
- }
969
- contents = map({
970
- $metadata: deserializeMetadata(output),
971
- });
972
- _a = __expectNonNull;
973
- _b = __expectObject;
974
- return [4, parseBody(output.body, context)];
975
- case 1:
976
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
977
- if (data.applicationId != null) {
978
- contents.applicationId = __expectString(data.applicationId);
979
- }
980
- if (data.arn != null) {
981
- contents.arn = __expectString(data.arn);
982
- }
983
- if (data.jobRunId != null) {
984
- contents.jobRunId = __expectString(data.jobRunId);
985
- }
986
- return [2, contents];
987
- }
505
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
506
+ if (data.url != null) {
507
+ contents.url = __expectString(data.url);
508
+ }
509
+ return contents;
510
+ };
511
+ const deserializeAws_restJson1GetDashboardForJobRunCommandError = async (output, context) => {
512
+ const parsedOutput = {
513
+ ...output,
514
+ body: await parseErrorBody(output.body, context),
515
+ };
516
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
517
+ switch (errorCode) {
518
+ case "InternalServerException":
519
+ case "com.amazonaws.emrserverless#InternalServerException":
520
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
521
+ case "ResourceNotFoundException":
522
+ case "com.amazonaws.emrserverless#ResourceNotFoundException":
523
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
524
+ case "ValidationException":
525
+ case "com.amazonaws.emrserverless#ValidationException":
526
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
527
+ default:
528
+ const parsedBody = parsedOutput.body;
529
+ throwDefaultError({
530
+ output,
531
+ parsedBody,
532
+ exceptionCtor: __BaseException,
533
+ errorCode,
534
+ });
535
+ }
536
+ };
537
+ export const deserializeAws_restJson1GetJobRunCommand = async (output, context) => {
538
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
539
+ return deserializeAws_restJson1GetJobRunCommandError(output, context);
540
+ }
541
+ const contents = map({
542
+ $metadata: deserializeMetadata(output),
988
543
  });
989
- }); };
990
- var deserializeAws_restJson1StartJobRunCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
991
- var parsedOutput, _a, errorCode, _b, parsedBody;
992
- var _c;
993
- return __generator(this, function (_d) {
994
- switch (_d.label) {
995
- case 0:
996
- _a = [__assign({}, output)];
997
- _c = {};
998
- return [4, parseBody(output.body, context)];
999
- case 1:
1000
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1001
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1002
- _b = errorCode;
1003
- switch (_b) {
1004
- case "ConflictException": return [3, 2];
1005
- case "com.amazonaws.emrserverless#ConflictException": return [3, 2];
1006
- case "InternalServerException": return [3, 4];
1007
- case "com.amazonaws.emrserverless#InternalServerException": return [3, 4];
1008
- case "ResourceNotFoundException": return [3, 6];
1009
- case "com.amazonaws.emrserverless#ResourceNotFoundException": return [3, 6];
1010
- case "ValidationException": return [3, 8];
1011
- case "com.amazonaws.emrserverless#ValidationException": return [3, 8];
1012
- }
1013
- return [3, 10];
1014
- case 2: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
1015
- case 3: throw _d.sent();
1016
- case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1017
- case 5: throw _d.sent();
1018
- case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1019
- case 7: throw _d.sent();
1020
- case 8: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1021
- case 9: throw _d.sent();
1022
- case 10:
1023
- parsedBody = parsedOutput.body;
1024
- throwDefaultError({
1025
- output: output,
1026
- parsedBody: parsedBody,
1027
- exceptionCtor: __BaseException,
1028
- errorCode: errorCode,
1029
- });
1030
- _d.label = 11;
1031
- case 11: return [2];
1032
- }
544
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
545
+ if (data.jobRun != null) {
546
+ contents.jobRun = deserializeAws_restJson1JobRun(data.jobRun, context);
547
+ }
548
+ return contents;
549
+ };
550
+ const deserializeAws_restJson1GetJobRunCommandError = async (output, context) => {
551
+ const parsedOutput = {
552
+ ...output,
553
+ body: await parseErrorBody(output.body, context),
554
+ };
555
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
556
+ switch (errorCode) {
557
+ case "InternalServerException":
558
+ case "com.amazonaws.emrserverless#InternalServerException":
559
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
560
+ case "ResourceNotFoundException":
561
+ case "com.amazonaws.emrserverless#ResourceNotFoundException":
562
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
563
+ case "ValidationException":
564
+ case "com.amazonaws.emrserverless#ValidationException":
565
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
566
+ default:
567
+ const parsedBody = parsedOutput.body;
568
+ throwDefaultError({
569
+ output,
570
+ parsedBody,
571
+ exceptionCtor: __BaseException,
572
+ errorCode,
573
+ });
574
+ }
575
+ };
576
+ export const deserializeAws_restJson1ListApplicationsCommand = async (output, context) => {
577
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
578
+ return deserializeAws_restJson1ListApplicationsCommandError(output, context);
579
+ }
580
+ const contents = map({
581
+ $metadata: deserializeMetadata(output),
1033
582
  });
1034
- }); };
1035
- export var deserializeAws_restJson1StopApplicationCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1036
- var contents;
1037
- return __generator(this, function (_a) {
1038
- switch (_a.label) {
1039
- case 0:
1040
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1041
- return [2, deserializeAws_restJson1StopApplicationCommandError(output, context)];
1042
- }
1043
- contents = map({
1044
- $metadata: deserializeMetadata(output),
1045
- });
1046
- return [4, collectBody(output.body, context)];
1047
- case 1:
1048
- _a.sent();
1049
- return [2, contents];
1050
- }
583
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
584
+ if (data.applications != null) {
585
+ contents.applications = deserializeAws_restJson1ApplicationList(data.applications, context);
586
+ }
587
+ if (data.nextToken != null) {
588
+ contents.nextToken = __expectString(data.nextToken);
589
+ }
590
+ return contents;
591
+ };
592
+ const deserializeAws_restJson1ListApplicationsCommandError = async (output, context) => {
593
+ const parsedOutput = {
594
+ ...output,
595
+ body: await parseErrorBody(output.body, context),
596
+ };
597
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
598
+ switch (errorCode) {
599
+ case "InternalServerException":
600
+ case "com.amazonaws.emrserverless#InternalServerException":
601
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
602
+ case "ValidationException":
603
+ case "com.amazonaws.emrserverless#ValidationException":
604
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
605
+ default:
606
+ const parsedBody = parsedOutput.body;
607
+ throwDefaultError({
608
+ output,
609
+ parsedBody,
610
+ exceptionCtor: __BaseException,
611
+ errorCode,
612
+ });
613
+ }
614
+ };
615
+ export const deserializeAws_restJson1ListJobRunsCommand = async (output, context) => {
616
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
617
+ return deserializeAws_restJson1ListJobRunsCommandError(output, context);
618
+ }
619
+ const contents = map({
620
+ $metadata: deserializeMetadata(output),
1051
621
  });
1052
- }); };
1053
- var deserializeAws_restJson1StopApplicationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1054
- var parsedOutput, _a, errorCode, _b, parsedBody;
1055
- var _c;
1056
- return __generator(this, function (_d) {
1057
- switch (_d.label) {
1058
- case 0:
1059
- _a = [__assign({}, output)];
1060
- _c = {};
1061
- return [4, parseBody(output.body, context)];
1062
- case 1:
1063
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1064
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1065
- _b = errorCode;
1066
- switch (_b) {
1067
- case "InternalServerException": return [3, 2];
1068
- case "com.amazonaws.emrserverless#InternalServerException": return [3, 2];
1069
- case "ResourceNotFoundException": return [3, 4];
1070
- case "com.amazonaws.emrserverless#ResourceNotFoundException": return [3, 4];
1071
- case "ValidationException": return [3, 6];
1072
- case "com.amazonaws.emrserverless#ValidationException": return [3, 6];
1073
- }
1074
- return [3, 8];
1075
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1076
- case 3: throw _d.sent();
1077
- case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1078
- case 5: throw _d.sent();
1079
- case 6: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1080
- case 7: throw _d.sent();
1081
- case 8:
1082
- parsedBody = parsedOutput.body;
1083
- throwDefaultError({
1084
- output: output,
1085
- parsedBody: parsedBody,
1086
- exceptionCtor: __BaseException,
1087
- errorCode: errorCode,
1088
- });
1089
- _d.label = 9;
1090
- case 9: return [2];
1091
- }
622
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
623
+ if (data.jobRuns != null) {
624
+ contents.jobRuns = deserializeAws_restJson1JobRuns(data.jobRuns, context);
625
+ }
626
+ if (data.nextToken != null) {
627
+ contents.nextToken = __expectString(data.nextToken);
628
+ }
629
+ return contents;
630
+ };
631
+ const deserializeAws_restJson1ListJobRunsCommandError = async (output, context) => {
632
+ const parsedOutput = {
633
+ ...output,
634
+ body: await parseErrorBody(output.body, context),
635
+ };
636
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
637
+ switch (errorCode) {
638
+ case "InternalServerException":
639
+ case "com.amazonaws.emrserverless#InternalServerException":
640
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
641
+ case "ValidationException":
642
+ case "com.amazonaws.emrserverless#ValidationException":
643
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
644
+ default:
645
+ const parsedBody = parsedOutput.body;
646
+ throwDefaultError({
647
+ output,
648
+ parsedBody,
649
+ exceptionCtor: __BaseException,
650
+ errorCode,
651
+ });
652
+ }
653
+ };
654
+ export const deserializeAws_restJson1ListTagsForResourceCommand = async (output, context) => {
655
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
656
+ return deserializeAws_restJson1ListTagsForResourceCommandError(output, context);
657
+ }
658
+ const contents = map({
659
+ $metadata: deserializeMetadata(output),
1092
660
  });
1093
- }); };
1094
- export var deserializeAws_restJson1TagResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1095
- var contents;
1096
- return __generator(this, function (_a) {
1097
- switch (_a.label) {
1098
- case 0:
1099
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1100
- return [2, deserializeAws_restJson1TagResourceCommandError(output, context)];
1101
- }
1102
- contents = map({
1103
- $metadata: deserializeMetadata(output),
1104
- });
1105
- return [4, collectBody(output.body, context)];
1106
- case 1:
1107
- _a.sent();
1108
- return [2, contents];
1109
- }
661
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
662
+ if (data.tags != null) {
663
+ contents.tags = deserializeAws_restJson1TagMap(data.tags, context);
664
+ }
665
+ return contents;
666
+ };
667
+ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, context) => {
668
+ const parsedOutput = {
669
+ ...output,
670
+ body: await parseErrorBody(output.body, context),
671
+ };
672
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
673
+ switch (errorCode) {
674
+ case "InternalServerException":
675
+ case "com.amazonaws.emrserverless#InternalServerException":
676
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
677
+ case "ResourceNotFoundException":
678
+ case "com.amazonaws.emrserverless#ResourceNotFoundException":
679
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
680
+ case "ValidationException":
681
+ case "com.amazonaws.emrserverless#ValidationException":
682
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
683
+ default:
684
+ const parsedBody = parsedOutput.body;
685
+ throwDefaultError({
686
+ output,
687
+ parsedBody,
688
+ exceptionCtor: __BaseException,
689
+ errorCode,
690
+ });
691
+ }
692
+ };
693
+ export const deserializeAws_restJson1StartApplicationCommand = async (output, context) => {
694
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
695
+ return deserializeAws_restJson1StartApplicationCommandError(output, context);
696
+ }
697
+ const contents = map({
698
+ $metadata: deserializeMetadata(output),
1110
699
  });
1111
- }); };
1112
- var deserializeAws_restJson1TagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1113
- var parsedOutput, _a, errorCode, _b, parsedBody;
1114
- var _c;
1115
- return __generator(this, function (_d) {
1116
- switch (_d.label) {
1117
- case 0:
1118
- _a = [__assign({}, output)];
1119
- _c = {};
1120
- return [4, parseBody(output.body, context)];
1121
- case 1:
1122
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1123
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1124
- _b = errorCode;
1125
- switch (_b) {
1126
- case "InternalServerException": return [3, 2];
1127
- case "com.amazonaws.emrserverless#InternalServerException": return [3, 2];
1128
- case "ResourceNotFoundException": return [3, 4];
1129
- case "com.amazonaws.emrserverless#ResourceNotFoundException": return [3, 4];
1130
- case "ValidationException": return [3, 6];
1131
- case "com.amazonaws.emrserverless#ValidationException": return [3, 6];
1132
- }
1133
- return [3, 8];
1134
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1135
- case 3: throw _d.sent();
1136
- case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1137
- case 5: throw _d.sent();
1138
- case 6: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1139
- case 7: throw _d.sent();
1140
- case 8:
1141
- parsedBody = parsedOutput.body;
1142
- throwDefaultError({
1143
- output: output,
1144
- parsedBody: parsedBody,
1145
- exceptionCtor: __BaseException,
1146
- errorCode: errorCode,
1147
- });
1148
- _d.label = 9;
1149
- case 9: return [2];
1150
- }
700
+ await collectBody(output.body, context);
701
+ return contents;
702
+ };
703
+ const deserializeAws_restJson1StartApplicationCommandError = async (output, context) => {
704
+ const parsedOutput = {
705
+ ...output,
706
+ body: await parseErrorBody(output.body, context),
707
+ };
708
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
709
+ switch (errorCode) {
710
+ case "InternalServerException":
711
+ case "com.amazonaws.emrserverless#InternalServerException":
712
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
713
+ case "ResourceNotFoundException":
714
+ case "com.amazonaws.emrserverless#ResourceNotFoundException":
715
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
716
+ case "ServiceQuotaExceededException":
717
+ case "com.amazonaws.emrserverless#ServiceQuotaExceededException":
718
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
719
+ case "ValidationException":
720
+ case "com.amazonaws.emrserverless#ValidationException":
721
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
722
+ default:
723
+ const parsedBody = parsedOutput.body;
724
+ throwDefaultError({
725
+ output,
726
+ parsedBody,
727
+ exceptionCtor: __BaseException,
728
+ errorCode,
729
+ });
730
+ }
731
+ };
732
+ export const deserializeAws_restJson1StartJobRunCommand = async (output, context) => {
733
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
734
+ return deserializeAws_restJson1StartJobRunCommandError(output, context);
735
+ }
736
+ const contents = map({
737
+ $metadata: deserializeMetadata(output),
1151
738
  });
1152
- }); };
1153
- export var deserializeAws_restJson1UntagResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1154
- var contents;
1155
- return __generator(this, function (_a) {
1156
- switch (_a.label) {
1157
- case 0:
1158
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1159
- return [2, deserializeAws_restJson1UntagResourceCommandError(output, context)];
1160
- }
1161
- contents = map({
1162
- $metadata: deserializeMetadata(output),
1163
- });
1164
- return [4, collectBody(output.body, context)];
1165
- case 1:
1166
- _a.sent();
1167
- return [2, contents];
1168
- }
739
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
740
+ if (data.applicationId != null) {
741
+ contents.applicationId = __expectString(data.applicationId);
742
+ }
743
+ if (data.arn != null) {
744
+ contents.arn = __expectString(data.arn);
745
+ }
746
+ if (data.jobRunId != null) {
747
+ contents.jobRunId = __expectString(data.jobRunId);
748
+ }
749
+ return contents;
750
+ };
751
+ const deserializeAws_restJson1StartJobRunCommandError = async (output, context) => {
752
+ const parsedOutput = {
753
+ ...output,
754
+ body: await parseErrorBody(output.body, context),
755
+ };
756
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
757
+ switch (errorCode) {
758
+ case "ConflictException":
759
+ case "com.amazonaws.emrserverless#ConflictException":
760
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
761
+ case "InternalServerException":
762
+ case "com.amazonaws.emrserverless#InternalServerException":
763
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
764
+ case "ResourceNotFoundException":
765
+ case "com.amazonaws.emrserverless#ResourceNotFoundException":
766
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
767
+ case "ValidationException":
768
+ case "com.amazonaws.emrserverless#ValidationException":
769
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
770
+ default:
771
+ const parsedBody = parsedOutput.body;
772
+ throwDefaultError({
773
+ output,
774
+ parsedBody,
775
+ exceptionCtor: __BaseException,
776
+ errorCode,
777
+ });
778
+ }
779
+ };
780
+ export const deserializeAws_restJson1StopApplicationCommand = async (output, context) => {
781
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
782
+ return deserializeAws_restJson1StopApplicationCommandError(output, context);
783
+ }
784
+ const contents = map({
785
+ $metadata: deserializeMetadata(output),
1169
786
  });
1170
- }); };
1171
- var deserializeAws_restJson1UntagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1172
- var parsedOutput, _a, errorCode, _b, parsedBody;
1173
- var _c;
1174
- return __generator(this, function (_d) {
1175
- switch (_d.label) {
1176
- case 0:
1177
- _a = [__assign({}, output)];
1178
- _c = {};
1179
- return [4, parseBody(output.body, context)];
1180
- case 1:
1181
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1182
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1183
- _b = errorCode;
1184
- switch (_b) {
1185
- case "InternalServerException": return [3, 2];
1186
- case "com.amazonaws.emrserverless#InternalServerException": return [3, 2];
1187
- case "ResourceNotFoundException": return [3, 4];
1188
- case "com.amazonaws.emrserverless#ResourceNotFoundException": return [3, 4];
1189
- case "ValidationException": return [3, 6];
1190
- case "com.amazonaws.emrserverless#ValidationException": return [3, 6];
1191
- }
1192
- return [3, 8];
1193
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1194
- case 3: throw _d.sent();
1195
- case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1196
- case 5: throw _d.sent();
1197
- case 6: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1198
- case 7: throw _d.sent();
1199
- case 8:
1200
- parsedBody = parsedOutput.body;
1201
- throwDefaultError({
1202
- output: output,
1203
- parsedBody: parsedBody,
1204
- exceptionCtor: __BaseException,
1205
- errorCode: errorCode,
1206
- });
1207
- _d.label = 9;
1208
- case 9: return [2];
1209
- }
787
+ await collectBody(output.body, context);
788
+ return contents;
789
+ };
790
+ const deserializeAws_restJson1StopApplicationCommandError = async (output, context) => {
791
+ const parsedOutput = {
792
+ ...output,
793
+ body: await parseErrorBody(output.body, context),
794
+ };
795
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
796
+ switch (errorCode) {
797
+ case "InternalServerException":
798
+ case "com.amazonaws.emrserverless#InternalServerException":
799
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
800
+ case "ResourceNotFoundException":
801
+ case "com.amazonaws.emrserverless#ResourceNotFoundException":
802
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
803
+ case "ValidationException":
804
+ case "com.amazonaws.emrserverless#ValidationException":
805
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
806
+ default:
807
+ const parsedBody = parsedOutput.body;
808
+ throwDefaultError({
809
+ output,
810
+ parsedBody,
811
+ exceptionCtor: __BaseException,
812
+ errorCode,
813
+ });
814
+ }
815
+ };
816
+ export const deserializeAws_restJson1TagResourceCommand = async (output, context) => {
817
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
818
+ return deserializeAws_restJson1TagResourceCommandError(output, context);
819
+ }
820
+ const contents = map({
821
+ $metadata: deserializeMetadata(output),
1210
822
  });
1211
- }); };
1212
- export var deserializeAws_restJson1UpdateApplicationCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1213
- var contents, data, _a, _b;
1214
- return __generator(this, function (_c) {
1215
- switch (_c.label) {
1216
- case 0:
1217
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1218
- return [2, deserializeAws_restJson1UpdateApplicationCommandError(output, context)];
1219
- }
1220
- contents = map({
1221
- $metadata: deserializeMetadata(output),
1222
- });
1223
- _a = __expectNonNull;
1224
- _b = __expectObject;
1225
- return [4, parseBody(output.body, context)];
1226
- case 1:
1227
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1228
- if (data.application != null) {
1229
- contents.application = deserializeAws_restJson1Application(data.application, context);
1230
- }
1231
- return [2, contents];
1232
- }
823
+ await collectBody(output.body, context);
824
+ return contents;
825
+ };
826
+ const deserializeAws_restJson1TagResourceCommandError = async (output, context) => {
827
+ const parsedOutput = {
828
+ ...output,
829
+ body: await parseErrorBody(output.body, context),
830
+ };
831
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
832
+ switch (errorCode) {
833
+ case "InternalServerException":
834
+ case "com.amazonaws.emrserverless#InternalServerException":
835
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
836
+ case "ResourceNotFoundException":
837
+ case "com.amazonaws.emrserverless#ResourceNotFoundException":
838
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
839
+ case "ValidationException":
840
+ case "com.amazonaws.emrserverless#ValidationException":
841
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
842
+ default:
843
+ const parsedBody = parsedOutput.body;
844
+ throwDefaultError({
845
+ output,
846
+ parsedBody,
847
+ exceptionCtor: __BaseException,
848
+ errorCode,
849
+ });
850
+ }
851
+ };
852
+ export const deserializeAws_restJson1UntagResourceCommand = async (output, context) => {
853
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
854
+ return deserializeAws_restJson1UntagResourceCommandError(output, context);
855
+ }
856
+ const contents = map({
857
+ $metadata: deserializeMetadata(output),
1233
858
  });
1234
- }); };
1235
- var deserializeAws_restJson1UpdateApplicationCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1236
- var parsedOutput, _a, errorCode, _b, parsedBody;
1237
- var _c;
1238
- return __generator(this, function (_d) {
1239
- switch (_d.label) {
1240
- case 0:
1241
- _a = [__assign({}, output)];
1242
- _c = {};
1243
- return [4, parseBody(output.body, context)];
1244
- case 1:
1245
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1246
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1247
- _b = errorCode;
1248
- switch (_b) {
1249
- case "InternalServerException": return [3, 2];
1250
- case "com.amazonaws.emrserverless#InternalServerException": return [3, 2];
1251
- case "ResourceNotFoundException": return [3, 4];
1252
- case "com.amazonaws.emrserverless#ResourceNotFoundException": return [3, 4];
1253
- case "ValidationException": return [3, 6];
1254
- case "com.amazonaws.emrserverless#ValidationException": return [3, 6];
1255
- }
1256
- return [3, 8];
1257
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1258
- case 3: throw _d.sent();
1259
- case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1260
- case 5: throw _d.sent();
1261
- case 6: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1262
- case 7: throw _d.sent();
1263
- case 8:
1264
- parsedBody = parsedOutput.body;
1265
- throwDefaultError({
1266
- output: output,
1267
- parsedBody: parsedBody,
1268
- exceptionCtor: __BaseException,
1269
- errorCode: errorCode,
1270
- });
1271
- _d.label = 9;
1272
- case 9: return [2];
1273
- }
859
+ await collectBody(output.body, context);
860
+ return contents;
861
+ };
862
+ const deserializeAws_restJson1UntagResourceCommandError = async (output, context) => {
863
+ const parsedOutput = {
864
+ ...output,
865
+ body: await parseErrorBody(output.body, context),
866
+ };
867
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
868
+ switch (errorCode) {
869
+ case "InternalServerException":
870
+ case "com.amazonaws.emrserverless#InternalServerException":
871
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
872
+ case "ResourceNotFoundException":
873
+ case "com.amazonaws.emrserverless#ResourceNotFoundException":
874
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
875
+ case "ValidationException":
876
+ case "com.amazonaws.emrserverless#ValidationException":
877
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
878
+ default:
879
+ const parsedBody = parsedOutput.body;
880
+ throwDefaultError({
881
+ output,
882
+ parsedBody,
883
+ exceptionCtor: __BaseException,
884
+ errorCode,
885
+ });
886
+ }
887
+ };
888
+ export const deserializeAws_restJson1UpdateApplicationCommand = async (output, context) => {
889
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
890
+ return deserializeAws_restJson1UpdateApplicationCommandError(output, context);
891
+ }
892
+ const contents = map({
893
+ $metadata: deserializeMetadata(output),
1274
894
  });
1275
- }); };
1276
- var map = __map;
1277
- var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1278
- var contents, data, exception;
1279
- return __generator(this, function (_a) {
1280
- contents = map({});
1281
- data = parsedOutput.body;
1282
- if (data.message != null) {
1283
- contents.message = __expectString(data.message);
1284
- }
1285
- exception = new ConflictException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1286
- return [2, __decorateServiceException(exception, parsedOutput.body)];
895
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
896
+ if (data.application != null) {
897
+ contents.application = deserializeAws_restJson1Application(data.application, context);
898
+ }
899
+ return contents;
900
+ };
901
+ const deserializeAws_restJson1UpdateApplicationCommandError = async (output, context) => {
902
+ const parsedOutput = {
903
+ ...output,
904
+ body: await parseErrorBody(output.body, context),
905
+ };
906
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
907
+ switch (errorCode) {
908
+ case "InternalServerException":
909
+ case "com.amazonaws.emrserverless#InternalServerException":
910
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
911
+ case "ResourceNotFoundException":
912
+ case "com.amazonaws.emrserverless#ResourceNotFoundException":
913
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
914
+ case "ValidationException":
915
+ case "com.amazonaws.emrserverless#ValidationException":
916
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
917
+ default:
918
+ const parsedBody = parsedOutput.body;
919
+ throwDefaultError({
920
+ output,
921
+ parsedBody,
922
+ exceptionCtor: __BaseException,
923
+ errorCode,
924
+ });
925
+ }
926
+ };
927
+ const map = __map;
928
+ const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, context) => {
929
+ const contents = map({});
930
+ const data = parsedOutput.body;
931
+ if (data.message != null) {
932
+ contents.message = __expectString(data.message);
933
+ }
934
+ const exception = new ConflictException({
935
+ $metadata: deserializeMetadata(parsedOutput),
936
+ ...contents,
1287
937
  });
1288
- }); };
1289
- var deserializeAws_restJson1InternalServerExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1290
- var contents, data, exception;
1291
- return __generator(this, function (_a) {
1292
- contents = map({});
1293
- data = parsedOutput.body;
1294
- if (data.message != null) {
1295
- contents.message = __expectString(data.message);
1296
- }
1297
- exception = new InternalServerException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1298
- return [2, __decorateServiceException(exception, parsedOutput.body)];
938
+ return __decorateServiceException(exception, parsedOutput.body);
939
+ };
940
+ const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOutput, context) => {
941
+ const contents = map({});
942
+ const data = parsedOutput.body;
943
+ if (data.message != null) {
944
+ contents.message = __expectString(data.message);
945
+ }
946
+ const exception = new InternalServerException({
947
+ $metadata: deserializeMetadata(parsedOutput),
948
+ ...contents,
1299
949
  });
1300
- }); };
1301
- var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1302
- var contents, data, exception;
1303
- return __generator(this, function (_a) {
1304
- contents = map({});
1305
- data = parsedOutput.body;
1306
- if (data.message != null) {
1307
- contents.message = __expectString(data.message);
1308
- }
1309
- exception = new ResourceNotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1310
- return [2, __decorateServiceException(exception, parsedOutput.body)];
950
+ return __decorateServiceException(exception, parsedOutput.body);
951
+ };
952
+ const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
953
+ const contents = map({});
954
+ const data = parsedOutput.body;
955
+ if (data.message != null) {
956
+ contents.message = __expectString(data.message);
957
+ }
958
+ const exception = new ResourceNotFoundException({
959
+ $metadata: deserializeMetadata(parsedOutput),
960
+ ...contents,
1311
961
  });
1312
- }); };
1313
- var deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1314
- var contents, data, exception;
1315
- return __generator(this, function (_a) {
1316
- contents = map({});
1317
- data = parsedOutput.body;
1318
- if (data.message != null) {
1319
- contents.message = __expectString(data.message);
1320
- }
1321
- exception = new ServiceQuotaExceededException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1322
- return [2, __decorateServiceException(exception, parsedOutput.body)];
962
+ return __decorateServiceException(exception, parsedOutput.body);
963
+ };
964
+ const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (parsedOutput, context) => {
965
+ const contents = map({});
966
+ const data = parsedOutput.body;
967
+ if (data.message != null) {
968
+ contents.message = __expectString(data.message);
969
+ }
970
+ const exception = new ServiceQuotaExceededException({
971
+ $metadata: deserializeMetadata(parsedOutput),
972
+ ...contents,
1323
973
  });
1324
- }); };
1325
- var deserializeAws_restJson1ValidationExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1326
- var contents, data, exception;
1327
- return __generator(this, function (_a) {
1328
- contents = map({});
1329
- data = parsedOutput.body;
1330
- if (data.message != null) {
1331
- contents.message = __expectString(data.message);
1332
- }
1333
- exception = new ValidationException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1334
- return [2, __decorateServiceException(exception, parsedOutput.body)];
974
+ return __decorateServiceException(exception, parsedOutput.body);
975
+ };
976
+ const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput, context) => {
977
+ const contents = map({});
978
+ const data = parsedOutput.body;
979
+ if (data.message != null) {
980
+ contents.message = __expectString(data.message);
981
+ }
982
+ const exception = new ValidationException({
983
+ $metadata: deserializeMetadata(parsedOutput),
984
+ ...contents,
1335
985
  });
1336
- }); };
1337
- var serializeAws_restJson1AutoStartConfig = function (input, context) {
1338
- return __assign({}, (input.enabled != null && { enabled: input.enabled }));
986
+ return __decorateServiceException(exception, parsedOutput.body);
1339
987
  };
1340
- var serializeAws_restJson1AutoStopConfig = function (input, context) {
1341
- return __assign(__assign({}, (input.enabled != null && { enabled: input.enabled })), (input.idleTimeoutMinutes != null && { idleTimeoutMinutes: input.idleTimeoutMinutes }));
988
+ const serializeAws_restJson1AutoStartConfig = (input, context) => {
989
+ return {
990
+ ...(input.enabled != null && { enabled: input.enabled }),
991
+ };
1342
992
  };
1343
- var serializeAws_restJson1Configuration = function (input, context) {
1344
- return __assign(__assign(__assign({}, (input.classification != null && { classification: input.classification })), (input.configurations != null && {
1345
- configurations: serializeAws_restJson1ConfigurationList(input.configurations, context),
1346
- })), (input.properties != null && {
1347
- properties: serializeAws_restJson1SensitivePropertiesMap(input.properties, context),
1348
- }));
993
+ const serializeAws_restJson1AutoStopConfig = (input, context) => {
994
+ return {
995
+ ...(input.enabled != null && { enabled: input.enabled }),
996
+ ...(input.idleTimeoutMinutes != null && { idleTimeoutMinutes: input.idleTimeoutMinutes }),
997
+ };
1349
998
  };
1350
- var serializeAws_restJson1ConfigurationList = function (input, context) {
999
+ const serializeAws_restJson1Configuration = (input, context) => {
1000
+ return {
1001
+ ...(input.classification != null && { classification: input.classification }),
1002
+ ...(input.configurations != null && {
1003
+ configurations: serializeAws_restJson1ConfigurationList(input.configurations, context),
1004
+ }),
1005
+ ...(input.properties != null && {
1006
+ properties: serializeAws_restJson1SensitivePropertiesMap(input.properties, context),
1007
+ }),
1008
+ };
1009
+ };
1010
+ const serializeAws_restJson1ConfigurationList = (input, context) => {
1351
1011
  return input
1352
- .filter(function (e) { return e != null; })
1353
- .map(function (entry) {
1012
+ .filter((e) => e != null)
1013
+ .map((entry) => {
1354
1014
  return serializeAws_restJson1Configuration(entry, context);
1355
1015
  });
1356
1016
  };
1357
- var serializeAws_restJson1ConfigurationOverrides = function (input, context) {
1358
- return __assign(__assign({}, (input.applicationConfiguration != null && {
1359
- applicationConfiguration: serializeAws_restJson1ConfigurationList(input.applicationConfiguration, context),
1360
- })), (input.monitoringConfiguration != null && {
1361
- monitoringConfiguration: serializeAws_restJson1MonitoringConfiguration(input.monitoringConfiguration, context),
1362
- }));
1017
+ const serializeAws_restJson1ConfigurationOverrides = (input, context) => {
1018
+ return {
1019
+ ...(input.applicationConfiguration != null && {
1020
+ applicationConfiguration: serializeAws_restJson1ConfigurationList(input.applicationConfiguration, context),
1021
+ }),
1022
+ ...(input.monitoringConfiguration != null && {
1023
+ monitoringConfiguration: serializeAws_restJson1MonitoringConfiguration(input.monitoringConfiguration, context),
1024
+ }),
1025
+ };
1363
1026
  };
1364
- var serializeAws_restJson1EntryPointArguments = function (input, context) {
1027
+ const serializeAws_restJson1EntryPointArguments = (input, context) => {
1365
1028
  return input
1366
- .filter(function (e) { return e != null; })
1367
- .map(function (entry) {
1029
+ .filter((e) => e != null)
1030
+ .map((entry) => {
1368
1031
  return entry;
1369
1032
  });
1370
1033
  };
1371
- var serializeAws_restJson1Hive = function (input, context) {
1372
- return __assign(__assign(__assign({}, (input.initQueryFile != null && { initQueryFile: input.initQueryFile })), (input.parameters != null && { parameters: input.parameters })), (input.query != null && { query: input.query }));
1034
+ const serializeAws_restJson1Hive = (input, context) => {
1035
+ return {
1036
+ ...(input.initQueryFile != null && { initQueryFile: input.initQueryFile }),
1037
+ ...(input.parameters != null && { parameters: input.parameters }),
1038
+ ...(input.query != null && { query: input.query }),
1039
+ };
1373
1040
  };
1374
- var serializeAws_restJson1InitialCapacityConfig = function (input, context) {
1375
- return __assign(__assign({}, (input.workerConfiguration != null && {
1376
- workerConfiguration: serializeAws_restJson1WorkerResourceConfig(input.workerConfiguration, context),
1377
- })), (input.workerCount != null && { workerCount: input.workerCount }));
1041
+ const serializeAws_restJson1InitialCapacityConfig = (input, context) => {
1042
+ return {
1043
+ ...(input.workerConfiguration != null && {
1044
+ workerConfiguration: serializeAws_restJson1WorkerResourceConfig(input.workerConfiguration, context),
1045
+ }),
1046
+ ...(input.workerCount != null && { workerCount: input.workerCount }),
1047
+ };
1378
1048
  };
1379
- var serializeAws_restJson1InitialCapacityConfigMap = function (input, context) {
1380
- return Object.entries(input).reduce(function (acc, _a) {
1381
- var _b;
1382
- var _c = __read(_a, 2), key = _c[0], value = _c[1];
1049
+ const serializeAws_restJson1InitialCapacityConfigMap = (input, context) => {
1050
+ return Object.entries(input).reduce((acc, [key, value]) => {
1383
1051
  if (value === null) {
1384
1052
  return acc;
1385
1053
  }
1386
- return __assign(__assign({}, acc), (_b = {}, _b[key] = serializeAws_restJson1InitialCapacityConfig(value, context), _b));
1054
+ return {
1055
+ ...acc,
1056
+ [key]: serializeAws_restJson1InitialCapacityConfig(value, context),
1057
+ };
1387
1058
  }, {});
1388
1059
  };
1389
- var serializeAws_restJson1JobDriver = function (input, context) {
1060
+ const serializeAws_restJson1JobDriver = (input, context) => {
1390
1061
  return JobDriver.visit(input, {
1391
- hive: function (value) { return ({ hive: serializeAws_restJson1Hive(value, context) }); },
1392
- sparkSubmit: function (value) { return ({ sparkSubmit: serializeAws_restJson1SparkSubmit(value, context) }); },
1393
- _: function (name, value) { return ({ name: value }); },
1062
+ hive: (value) => ({ hive: serializeAws_restJson1Hive(value, context) }),
1063
+ sparkSubmit: (value) => ({ sparkSubmit: serializeAws_restJson1SparkSubmit(value, context) }),
1064
+ _: (name, value) => ({ name: value }),
1394
1065
  });
1395
1066
  };
1396
- var serializeAws_restJson1ManagedPersistenceMonitoringConfiguration = function (input, context) {
1397
- return __assign(__assign({}, (input.enabled != null && { enabled: input.enabled })), (input.encryptionKeyArn != null && { encryptionKeyArn: input.encryptionKeyArn }));
1067
+ const serializeAws_restJson1ManagedPersistenceMonitoringConfiguration = (input, context) => {
1068
+ return {
1069
+ ...(input.enabled != null && { enabled: input.enabled }),
1070
+ ...(input.encryptionKeyArn != null && { encryptionKeyArn: input.encryptionKeyArn }),
1071
+ };
1398
1072
  };
1399
- var serializeAws_restJson1MaximumAllowedResources = function (input, context) {
1400
- return __assign(__assign(__assign({}, (input.cpu != null && { cpu: input.cpu })), (input.disk != null && { disk: input.disk })), (input.memory != null && { memory: input.memory }));
1073
+ const serializeAws_restJson1MaximumAllowedResources = (input, context) => {
1074
+ return {
1075
+ ...(input.cpu != null && { cpu: input.cpu }),
1076
+ ...(input.disk != null && { disk: input.disk }),
1077
+ ...(input.memory != null && { memory: input.memory }),
1078
+ };
1401
1079
  };
1402
- var serializeAws_restJson1MonitoringConfiguration = function (input, context) {
1403
- return __assign(__assign({}, (input.managedPersistenceMonitoringConfiguration != null && {
1404
- managedPersistenceMonitoringConfiguration: serializeAws_restJson1ManagedPersistenceMonitoringConfiguration(input.managedPersistenceMonitoringConfiguration, context),
1405
- })), (input.s3MonitoringConfiguration != null && {
1406
- s3MonitoringConfiguration: serializeAws_restJson1S3MonitoringConfiguration(input.s3MonitoringConfiguration, context),
1407
- }));
1080
+ const serializeAws_restJson1MonitoringConfiguration = (input, context) => {
1081
+ return {
1082
+ ...(input.managedPersistenceMonitoringConfiguration != null && {
1083
+ managedPersistenceMonitoringConfiguration: serializeAws_restJson1ManagedPersistenceMonitoringConfiguration(input.managedPersistenceMonitoringConfiguration, context),
1084
+ }),
1085
+ ...(input.s3MonitoringConfiguration != null && {
1086
+ s3MonitoringConfiguration: serializeAws_restJson1S3MonitoringConfiguration(input.s3MonitoringConfiguration, context),
1087
+ }),
1088
+ };
1408
1089
  };
1409
- var serializeAws_restJson1NetworkConfiguration = function (input, context) {
1410
- return __assign(__assign({}, (input.securityGroupIds != null && {
1411
- securityGroupIds: serializeAws_restJson1SecurityGroupIds(input.securityGroupIds, context),
1412
- })), (input.subnetIds != null && { subnetIds: serializeAws_restJson1SubnetIds(input.subnetIds, context) }));
1090
+ const serializeAws_restJson1NetworkConfiguration = (input, context) => {
1091
+ return {
1092
+ ...(input.securityGroupIds != null && {
1093
+ securityGroupIds: serializeAws_restJson1SecurityGroupIds(input.securityGroupIds, context),
1094
+ }),
1095
+ ...(input.subnetIds != null && { subnetIds: serializeAws_restJson1SubnetIds(input.subnetIds, context) }),
1096
+ };
1413
1097
  };
1414
- var serializeAws_restJson1S3MonitoringConfiguration = function (input, context) {
1415
- return __assign(__assign({}, (input.encryptionKeyArn != null && { encryptionKeyArn: input.encryptionKeyArn })), (input.logUri != null && { logUri: input.logUri }));
1098
+ const serializeAws_restJson1S3MonitoringConfiguration = (input, context) => {
1099
+ return {
1100
+ ...(input.encryptionKeyArn != null && { encryptionKeyArn: input.encryptionKeyArn }),
1101
+ ...(input.logUri != null && { logUri: input.logUri }),
1102
+ };
1416
1103
  };
1417
- var serializeAws_restJson1SecurityGroupIds = function (input, context) {
1104
+ const serializeAws_restJson1SecurityGroupIds = (input, context) => {
1418
1105
  return input
1419
- .filter(function (e) { return e != null; })
1420
- .map(function (entry) {
1106
+ .filter((e) => e != null)
1107
+ .map((entry) => {
1421
1108
  return entry;
1422
1109
  });
1423
1110
  };
1424
- var serializeAws_restJson1SensitivePropertiesMap = function (input, context) {
1425
- return Object.entries(input).reduce(function (acc, _a) {
1426
- var _b;
1427
- var _c = __read(_a, 2), key = _c[0], value = _c[1];
1111
+ const serializeAws_restJson1SensitivePropertiesMap = (input, context) => {
1112
+ return Object.entries(input).reduce((acc, [key, value]) => {
1428
1113
  if (value === null) {
1429
1114
  return acc;
1430
1115
  }
1431
- return __assign(__assign({}, acc), (_b = {}, _b[key] = value, _b));
1116
+ return {
1117
+ ...acc,
1118
+ [key]: value,
1119
+ };
1432
1120
  }, {});
1433
1121
  };
1434
- var serializeAws_restJson1SparkSubmit = function (input, context) {
1435
- return __assign(__assign(__assign({}, (input.entryPoint != null && { entryPoint: input.entryPoint })), (input.entryPointArguments != null && {
1436
- entryPointArguments: serializeAws_restJson1EntryPointArguments(input.entryPointArguments, context),
1437
- })), (input.sparkSubmitParameters != null && { sparkSubmitParameters: input.sparkSubmitParameters }));
1122
+ const serializeAws_restJson1SparkSubmit = (input, context) => {
1123
+ return {
1124
+ ...(input.entryPoint != null && { entryPoint: input.entryPoint }),
1125
+ ...(input.entryPointArguments != null && {
1126
+ entryPointArguments: serializeAws_restJson1EntryPointArguments(input.entryPointArguments, context),
1127
+ }),
1128
+ ...(input.sparkSubmitParameters != null && { sparkSubmitParameters: input.sparkSubmitParameters }),
1129
+ };
1438
1130
  };
1439
- var serializeAws_restJson1SubnetIds = function (input, context) {
1131
+ const serializeAws_restJson1SubnetIds = (input, context) => {
1440
1132
  return input
1441
- .filter(function (e) { return e != null; })
1442
- .map(function (entry) {
1133
+ .filter((e) => e != null)
1134
+ .map((entry) => {
1443
1135
  return entry;
1444
1136
  });
1445
1137
  };
1446
- var serializeAws_restJson1TagMap = function (input, context) {
1447
- return Object.entries(input).reduce(function (acc, _a) {
1448
- var _b;
1449
- var _c = __read(_a, 2), key = _c[0], value = _c[1];
1138
+ const serializeAws_restJson1TagMap = (input, context) => {
1139
+ return Object.entries(input).reduce((acc, [key, value]) => {
1450
1140
  if (value === null) {
1451
1141
  return acc;
1452
1142
  }
1453
- return __assign(__assign({}, acc), (_b = {}, _b[key] = value, _b));
1143
+ return {
1144
+ ...acc,
1145
+ [key]: value,
1146
+ };
1454
1147
  }, {});
1455
1148
  };
1456
- var serializeAws_restJson1WorkerResourceConfig = function (input, context) {
1457
- return __assign(__assign(__assign({}, (input.cpu != null && { cpu: input.cpu })), (input.disk != null && { disk: input.disk })), (input.memory != null && { memory: input.memory }));
1149
+ const serializeAws_restJson1WorkerResourceConfig = (input, context) => {
1150
+ return {
1151
+ ...(input.cpu != null && { cpu: input.cpu }),
1152
+ ...(input.disk != null && { disk: input.disk }),
1153
+ ...(input.memory != null && { memory: input.memory }),
1154
+ };
1458
1155
  };
1459
- var deserializeAws_restJson1Application = function (output, context) {
1156
+ const deserializeAws_restJson1Application = (output, context) => {
1460
1157
  return {
1461
1158
  applicationId: __expectString(output.applicationId),
1462
1159
  arn: __expectString(output.arn),
@@ -1485,10 +1182,10 @@ var deserializeAws_restJson1Application = function (output, context) {
1485
1182
  updatedAt: output.updatedAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.updatedAt))) : undefined,
1486
1183
  };
1487
1184
  };
1488
- var deserializeAws_restJson1ApplicationList = function (output, context) {
1489
- var retVal = (output || [])
1490
- .filter(function (e) { return e != null; })
1491
- .map(function (entry) {
1185
+ const deserializeAws_restJson1ApplicationList = (output, context) => {
1186
+ const retVal = (output || [])
1187
+ .filter((e) => e != null)
1188
+ .map((entry) => {
1492
1189
  if (entry === null) {
1493
1190
  return null;
1494
1191
  }
@@ -1496,7 +1193,7 @@ var deserializeAws_restJson1ApplicationList = function (output, context) {
1496
1193
  });
1497
1194
  return retVal;
1498
1195
  };
1499
- var deserializeAws_restJson1ApplicationSummary = function (output, context) {
1196
+ const deserializeAws_restJson1ApplicationSummary = (output, context) => {
1500
1197
  return {
1501
1198
  arn: __expectString(output.arn),
1502
1199
  createdAt: output.createdAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.createdAt))) : undefined,
@@ -1509,18 +1206,18 @@ var deserializeAws_restJson1ApplicationSummary = function (output, context) {
1509
1206
  updatedAt: output.updatedAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.updatedAt))) : undefined,
1510
1207
  };
1511
1208
  };
1512
- var deserializeAws_restJson1AutoStartConfig = function (output, context) {
1209
+ const deserializeAws_restJson1AutoStartConfig = (output, context) => {
1513
1210
  return {
1514
1211
  enabled: __expectBoolean(output.enabled),
1515
1212
  };
1516
1213
  };
1517
- var deserializeAws_restJson1AutoStopConfig = function (output, context) {
1214
+ const deserializeAws_restJson1AutoStopConfig = (output, context) => {
1518
1215
  return {
1519
1216
  enabled: __expectBoolean(output.enabled),
1520
1217
  idleTimeoutMinutes: __expectInt32(output.idleTimeoutMinutes),
1521
1218
  };
1522
1219
  };
1523
- var deserializeAws_restJson1Configuration = function (output, context) {
1220
+ const deserializeAws_restJson1Configuration = (output, context) => {
1524
1221
  return {
1525
1222
  classification: __expectString(output.classification),
1526
1223
  configurations: output.configurations != null
@@ -1531,10 +1228,10 @@ var deserializeAws_restJson1Configuration = function (output, context) {
1531
1228
  : undefined,
1532
1229
  };
1533
1230
  };
1534
- var deserializeAws_restJson1ConfigurationList = function (output, context) {
1535
- var retVal = (output || [])
1536
- .filter(function (e) { return e != null; })
1537
- .map(function (entry) {
1231
+ const deserializeAws_restJson1ConfigurationList = (output, context) => {
1232
+ const retVal = (output || [])
1233
+ .filter((e) => e != null)
1234
+ .map((entry) => {
1538
1235
  if (entry === null) {
1539
1236
  return null;
1540
1237
  }
@@ -1542,7 +1239,7 @@ var deserializeAws_restJson1ConfigurationList = function (output, context) {
1542
1239
  });
1543
1240
  return retVal;
1544
1241
  };
1545
- var deserializeAws_restJson1ConfigurationOverrides = function (output, context) {
1242
+ const deserializeAws_restJson1ConfigurationOverrides = (output, context) => {
1546
1243
  return {
1547
1244
  applicationConfiguration: output.applicationConfiguration != null
1548
1245
  ? deserializeAws_restJson1ConfigurationList(output.applicationConfiguration, context)
@@ -1552,10 +1249,10 @@ var deserializeAws_restJson1ConfigurationOverrides = function (output, context)
1552
1249
  : undefined,
1553
1250
  };
1554
1251
  };
1555
- var deserializeAws_restJson1EntryPointArguments = function (output, context) {
1556
- var retVal = (output || [])
1557
- .filter(function (e) { return e != null; })
1558
- .map(function (entry) {
1252
+ const deserializeAws_restJson1EntryPointArguments = (output, context) => {
1253
+ const retVal = (output || [])
1254
+ .filter((e) => e != null)
1255
+ .map((entry) => {
1559
1256
  if (entry === null) {
1560
1257
  return null;
1561
1258
  }
@@ -1563,14 +1260,14 @@ var deserializeAws_restJson1EntryPointArguments = function (output, context) {
1563
1260
  });
1564
1261
  return retVal;
1565
1262
  };
1566
- var deserializeAws_restJson1Hive = function (output, context) {
1263
+ const deserializeAws_restJson1Hive = (output, context) => {
1567
1264
  return {
1568
1265
  initQueryFile: __expectString(output.initQueryFile),
1569
1266
  parameters: __expectString(output.parameters),
1570
1267
  query: __expectString(output.query),
1571
1268
  };
1572
1269
  };
1573
- var deserializeAws_restJson1InitialCapacityConfig = function (output, context) {
1270
+ const deserializeAws_restJson1InitialCapacityConfig = (output, context) => {
1574
1271
  return {
1575
1272
  workerConfiguration: output.workerConfiguration != null
1576
1273
  ? deserializeAws_restJson1WorkerResourceConfig(output.workerConfiguration, context)
@@ -1578,17 +1275,18 @@ var deserializeAws_restJson1InitialCapacityConfig = function (output, context) {
1578
1275
  workerCount: __expectLong(output.workerCount),
1579
1276
  };
1580
1277
  };
1581
- var deserializeAws_restJson1InitialCapacityConfigMap = function (output, context) {
1582
- return Object.entries(output).reduce(function (acc, _a) {
1583
- var _b;
1584
- var _c = __read(_a, 2), key = _c[0], value = _c[1];
1278
+ const deserializeAws_restJson1InitialCapacityConfigMap = (output, context) => {
1279
+ return Object.entries(output).reduce((acc, [key, value]) => {
1585
1280
  if (value === null) {
1586
1281
  return acc;
1587
1282
  }
1588
- return __assign(__assign({}, acc), (_b = {}, _b[key] = deserializeAws_restJson1InitialCapacityConfig(value, context), _b));
1283
+ return {
1284
+ ...acc,
1285
+ [key]: deserializeAws_restJson1InitialCapacityConfig(value, context),
1286
+ };
1589
1287
  }, {});
1590
1288
  };
1591
- var deserializeAws_restJson1JobDriver = function (output, context) {
1289
+ const deserializeAws_restJson1JobDriver = (output, context) => {
1592
1290
  if (output.hive != null) {
1593
1291
  return {
1594
1292
  hive: deserializeAws_restJson1Hive(output.hive, context),
@@ -1601,7 +1299,7 @@ var deserializeAws_restJson1JobDriver = function (output, context) {
1601
1299
  }
1602
1300
  return { $unknown: Object.entries(output)[0] };
1603
1301
  };
1604
- var deserializeAws_restJson1JobRun = function (output, context) {
1302
+ const deserializeAws_restJson1JobRun = (output, context) => {
1605
1303
  return {
1606
1304
  applicationId: __expectString(output.applicationId),
1607
1305
  arn: __expectString(output.arn),
@@ -1630,10 +1328,10 @@ var deserializeAws_restJson1JobRun = function (output, context) {
1630
1328
  updatedAt: output.updatedAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.updatedAt))) : undefined,
1631
1329
  };
1632
1330
  };
1633
- var deserializeAws_restJson1JobRuns = function (output, context) {
1634
- var retVal = (output || [])
1635
- .filter(function (e) { return e != null; })
1636
- .map(function (entry) {
1331
+ const deserializeAws_restJson1JobRuns = (output, context) => {
1332
+ const retVal = (output || [])
1333
+ .filter((e) => e != null)
1334
+ .map((entry) => {
1637
1335
  if (entry === null) {
1638
1336
  return null;
1639
1337
  }
@@ -1641,7 +1339,7 @@ var deserializeAws_restJson1JobRuns = function (output, context) {
1641
1339
  });
1642
1340
  return retVal;
1643
1341
  };
1644
- var deserializeAws_restJson1JobRunSummary = function (output, context) {
1342
+ const deserializeAws_restJson1JobRunSummary = (output, context) => {
1645
1343
  return {
1646
1344
  applicationId: __expectString(output.applicationId),
1647
1345
  arn: __expectString(output.arn),
@@ -1657,20 +1355,20 @@ var deserializeAws_restJson1JobRunSummary = function (output, context) {
1657
1355
  updatedAt: output.updatedAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.updatedAt))) : undefined,
1658
1356
  };
1659
1357
  };
1660
- var deserializeAws_restJson1ManagedPersistenceMonitoringConfiguration = function (output, context) {
1358
+ const deserializeAws_restJson1ManagedPersistenceMonitoringConfiguration = (output, context) => {
1661
1359
  return {
1662
1360
  enabled: __expectBoolean(output.enabled),
1663
1361
  encryptionKeyArn: __expectString(output.encryptionKeyArn),
1664
1362
  };
1665
1363
  };
1666
- var deserializeAws_restJson1MaximumAllowedResources = function (output, context) {
1364
+ const deserializeAws_restJson1MaximumAllowedResources = (output, context) => {
1667
1365
  return {
1668
1366
  cpu: __expectString(output.cpu),
1669
1367
  disk: __expectString(output.disk),
1670
1368
  memory: __expectString(output.memory),
1671
1369
  };
1672
1370
  };
1673
- var deserializeAws_restJson1MonitoringConfiguration = function (output, context) {
1371
+ const deserializeAws_restJson1MonitoringConfiguration = (output, context) => {
1674
1372
  return {
1675
1373
  managedPersistenceMonitoringConfiguration: output.managedPersistenceMonitoringConfiguration != null
1676
1374
  ? deserializeAws_restJson1ManagedPersistenceMonitoringConfiguration(output.managedPersistenceMonitoringConfiguration, context)
@@ -1680,7 +1378,7 @@ var deserializeAws_restJson1MonitoringConfiguration = function (output, context)
1680
1378
  : undefined,
1681
1379
  };
1682
1380
  };
1683
- var deserializeAws_restJson1NetworkConfiguration = function (output, context) {
1381
+ const deserializeAws_restJson1NetworkConfiguration = (output, context) => {
1684
1382
  return {
1685
1383
  securityGroupIds: output.securityGroupIds != null
1686
1384
  ? deserializeAws_restJson1SecurityGroupIds(output.securityGroupIds, context)
@@ -1688,16 +1386,16 @@ var deserializeAws_restJson1NetworkConfiguration = function (output, context) {
1688
1386
  subnetIds: output.subnetIds != null ? deserializeAws_restJson1SubnetIds(output.subnetIds, context) : undefined,
1689
1387
  };
1690
1388
  };
1691
- var deserializeAws_restJson1S3MonitoringConfiguration = function (output, context) {
1389
+ const deserializeAws_restJson1S3MonitoringConfiguration = (output, context) => {
1692
1390
  return {
1693
1391
  encryptionKeyArn: __expectString(output.encryptionKeyArn),
1694
1392
  logUri: __expectString(output.logUri),
1695
1393
  };
1696
1394
  };
1697
- var deserializeAws_restJson1SecurityGroupIds = function (output, context) {
1698
- var retVal = (output || [])
1699
- .filter(function (e) { return e != null; })
1700
- .map(function (entry) {
1395
+ const deserializeAws_restJson1SecurityGroupIds = (output, context) => {
1396
+ const retVal = (output || [])
1397
+ .filter((e) => e != null)
1398
+ .map((entry) => {
1701
1399
  if (entry === null) {
1702
1400
  return null;
1703
1401
  }
@@ -1705,17 +1403,18 @@ var deserializeAws_restJson1SecurityGroupIds = function (output, context) {
1705
1403
  });
1706
1404
  return retVal;
1707
1405
  };
1708
- var deserializeAws_restJson1SensitivePropertiesMap = function (output, context) {
1709
- return Object.entries(output).reduce(function (acc, _a) {
1710
- var _b;
1711
- var _c = __read(_a, 2), key = _c[0], value = _c[1];
1406
+ const deserializeAws_restJson1SensitivePropertiesMap = (output, context) => {
1407
+ return Object.entries(output).reduce((acc, [key, value]) => {
1712
1408
  if (value === null) {
1713
1409
  return acc;
1714
1410
  }
1715
- return __assign(__assign({}, acc), (_b = {}, _b[key] = __expectString(value), _b));
1411
+ return {
1412
+ ...acc,
1413
+ [key]: __expectString(value),
1414
+ };
1716
1415
  }, {});
1717
1416
  };
1718
- var deserializeAws_restJson1SparkSubmit = function (output, context) {
1417
+ const deserializeAws_restJson1SparkSubmit = (output, context) => {
1719
1418
  return {
1720
1419
  entryPoint: __expectString(output.entryPoint),
1721
1420
  entryPointArguments: output.entryPointArguments != null
@@ -1724,10 +1423,10 @@ var deserializeAws_restJson1SparkSubmit = function (output, context) {
1724
1423
  sparkSubmitParameters: __expectString(output.sparkSubmitParameters),
1725
1424
  };
1726
1425
  };
1727
- var deserializeAws_restJson1SubnetIds = function (output, context) {
1728
- var retVal = (output || [])
1729
- .filter(function (e) { return e != null; })
1730
- .map(function (entry) {
1426
+ const deserializeAws_restJson1SubnetIds = (output, context) => {
1427
+ const retVal = (output || [])
1428
+ .filter((e) => e != null)
1429
+ .map((entry) => {
1731
1430
  if (entry === null) {
1732
1431
  return null;
1733
1432
  }
@@ -1735,68 +1434,64 @@ var deserializeAws_restJson1SubnetIds = function (output, context) {
1735
1434
  });
1736
1435
  return retVal;
1737
1436
  };
1738
- var deserializeAws_restJson1TagMap = function (output, context) {
1739
- return Object.entries(output).reduce(function (acc, _a) {
1740
- var _b;
1741
- var _c = __read(_a, 2), key = _c[0], value = _c[1];
1437
+ const deserializeAws_restJson1TagMap = (output, context) => {
1438
+ return Object.entries(output).reduce((acc, [key, value]) => {
1742
1439
  if (value === null) {
1743
1440
  return acc;
1744
1441
  }
1745
- return __assign(__assign({}, acc), (_b = {}, _b[key] = __expectString(value), _b));
1442
+ return {
1443
+ ...acc,
1444
+ [key]: __expectString(value),
1445
+ };
1746
1446
  }, {});
1747
1447
  };
1748
- var deserializeAws_restJson1TotalResourceUtilization = function (output, context) {
1448
+ const deserializeAws_restJson1TotalResourceUtilization = (output, context) => {
1749
1449
  return {
1750
1450
  memoryGBHour: __limitedParseDouble(output.memoryGBHour),
1751
1451
  storageGBHour: __limitedParseDouble(output.storageGBHour),
1752
1452
  vCPUHour: __limitedParseDouble(output.vCPUHour),
1753
1453
  };
1754
1454
  };
1755
- var deserializeAws_restJson1WorkerResourceConfig = function (output, context) {
1455
+ const deserializeAws_restJson1WorkerResourceConfig = (output, context) => {
1756
1456
  return {
1757
1457
  cpu: __expectString(output.cpu),
1758
1458
  disk: __expectString(output.disk),
1759
1459
  memory: __expectString(output.memory),
1760
1460
  };
1761
1461
  };
1762
- var deserializeMetadata = function (output) {
1763
- var _a;
1764
- return ({
1765
- httpStatusCode: output.statusCode,
1766
- requestId: (_a = output.headers["x-amzn-requestid"]) !== null && _a !== void 0 ? _a : output.headers["x-amzn-request-id"],
1767
- extendedRequestId: output.headers["x-amz-id-2"],
1768
- cfId: output.headers["x-amz-cf-id"],
1769
- });
1770
- };
1771
- var collectBody = function (streamBody, context) {
1772
- if (streamBody === void 0) { streamBody = new Uint8Array(); }
1462
+ const deserializeMetadata = (output) => ({
1463
+ httpStatusCode: output.statusCode,
1464
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"],
1465
+ extendedRequestId: output.headers["x-amz-id-2"],
1466
+ cfId: output.headers["x-amz-cf-id"],
1467
+ });
1468
+ const collectBody = (streamBody = new Uint8Array(), context) => {
1773
1469
  if (streamBody instanceof Uint8Array) {
1774
1470
  return Promise.resolve(streamBody);
1775
1471
  }
1776
1472
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
1777
1473
  };
1778
- var collectBodyString = function (streamBody, context) {
1779
- return collectBody(streamBody, context).then(function (body) { return context.utf8Encoder(body); });
1780
- };
1781
- var isSerializableHeaderValue = function (value) {
1782
- return value !== undefined &&
1783
- value !== null &&
1784
- value !== "" &&
1785
- (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
1786
- (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
1787
- };
1788
- var parseBody = function (streamBody, context) {
1789
- return collectBodyString(streamBody, context).then(function (encoded) {
1790
- if (encoded.length) {
1791
- return JSON.parse(encoded);
1792
- }
1793
- return {};
1794
- });
1474
+ const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
1475
+ const isSerializableHeaderValue = (value) => value !== undefined &&
1476
+ value !== null &&
1477
+ value !== "" &&
1478
+ (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
1479
+ (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
1480
+ const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1481
+ if (encoded.length) {
1482
+ return JSON.parse(encoded);
1483
+ }
1484
+ return {};
1485
+ });
1486
+ const parseErrorBody = async (errorBody, context) => {
1487
+ const value = await parseBody(errorBody, context);
1488
+ value.message = value.message ?? value.Message;
1489
+ return value;
1795
1490
  };
1796
- var loadRestJsonErrorCode = function (output, data) {
1797
- var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
1798
- var sanitizeErrorCode = function (rawValue) {
1799
- var cleanValue = rawValue;
1491
+ const loadRestJsonErrorCode = (output, data) => {
1492
+ const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
1493
+ const sanitizeErrorCode = (rawValue) => {
1494
+ let cleanValue = rawValue;
1800
1495
  if (typeof cleanValue === "number") {
1801
1496
  cleanValue = cleanValue.toString();
1802
1497
  }
@@ -1811,7 +1506,7 @@ var loadRestJsonErrorCode = function (output, data) {
1811
1506
  }
1812
1507
  return cleanValue;
1813
1508
  };
1814
- var headerKey = findKey(output.headers, "x-amzn-errortype");
1509
+ const headerKey = findKey(output.headers, "x-amzn-errortype");
1815
1510
  if (headerKey !== undefined) {
1816
1511
  return sanitizeErrorCode(output.headers[headerKey]);
1817
1512
  }