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