@aws-sdk/client-emr-containers 3.181.0 → 3.183.0

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