@aws-sdk/client-mwaa 3.186.0 → 3.188.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,1211 +1,933 @@
1
- import { __assign, __awaiter, __generator, __read } from "tslib";
2
1
  import { HttpRequest as __HttpRequest, isValidHostname as __isValidHostname, } from "@aws-sdk/protocol-http";
3
2
  import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, map as __map, parseEpochTimestamp as __parseEpochTimestamp, resolvedPath as __resolvedPath, serializeFloat as __serializeFloat, throwDefaultError, } from "@aws-sdk/smithy-client";
4
3
  import { AccessDeniedException, InternalServerException, ResourceNotFoundException, ValidationException, } from "../models/models_0";
5
4
  import { MWAAServiceException as __BaseException } from "../models/MWAAServiceException";
6
- export var serializeAws_restJson1CreateCliTokenCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
7
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body, resolvedHostname;
8
- return __generator(this, function (_c) {
9
- switch (_c.label) {
10
- case 0: return [4, context.endpoint()];
11
- case 1:
12
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
13
- headers = {};
14
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/clitoken/{Name}";
15
- resolvedPath = __resolvedPath(resolvedPath, input, "Name", function () { return input.Name; }, "{Name}", false);
16
- return [4, context.endpoint()];
17
- case 2:
18
- resolvedHostname = (_c.sent()).hostname;
19
- if (context.disableHostPrefix !== true) {
20
- resolvedHostname = "env." + resolvedHostname;
21
- if (!__isValidHostname(resolvedHostname)) {
22
- throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
23
- }
24
- }
25
- return [2, new __HttpRequest({
26
- protocol: protocol,
27
- hostname: resolvedHostname,
28
- port: port,
29
- method: "POST",
30
- headers: headers,
31
- path: resolvedPath,
32
- body: body,
33
- })];
34
- }
35
- });
36
- }); };
37
- export var serializeAws_restJson1CreateEnvironmentCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
38
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body, resolvedHostname;
39
- return __generator(this, function (_c) {
40
- switch (_c.label) {
41
- case 0: return [4, context.endpoint()];
42
- case 1:
43
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
44
- headers = {
45
- "content-type": "application/json",
46
- };
47
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/environments/{Name}";
48
- resolvedPath = __resolvedPath(resolvedPath, input, "Name", function () { return input.Name; }, "{Name}", false);
49
- body = JSON.stringify(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.AirflowConfigurationOptions != null && {
50
- AirflowConfigurationOptions: serializeAws_restJson1AirflowConfigurationOptions(input.AirflowConfigurationOptions, context),
51
- })), (input.AirflowVersion != null && { AirflowVersion: input.AirflowVersion })), (input.DagS3Path != null && { DagS3Path: input.DagS3Path })), (input.EnvironmentClass != null && { EnvironmentClass: input.EnvironmentClass })), (input.ExecutionRoleArn != null && { ExecutionRoleArn: input.ExecutionRoleArn })), (input.KmsKey != null && { KmsKey: input.KmsKey })), (input.LoggingConfiguration != null && {
52
- LoggingConfiguration: serializeAws_restJson1LoggingConfigurationInput(input.LoggingConfiguration, context),
53
- })), (input.MaxWorkers != null && { MaxWorkers: input.MaxWorkers })), (input.MinWorkers != null && { MinWorkers: input.MinWorkers })), (input.NetworkConfiguration != null && {
54
- NetworkConfiguration: serializeAws_restJson1NetworkConfiguration(input.NetworkConfiguration, context),
55
- })), (input.PluginsS3ObjectVersion != null && { PluginsS3ObjectVersion: input.PluginsS3ObjectVersion })), (input.PluginsS3Path != null && { PluginsS3Path: input.PluginsS3Path })), (input.RequirementsS3ObjectVersion != null && {
56
- RequirementsS3ObjectVersion: input.RequirementsS3ObjectVersion,
57
- })), (input.RequirementsS3Path != null && { RequirementsS3Path: input.RequirementsS3Path })), (input.Schedulers != null && { Schedulers: input.Schedulers })), (input.SourceBucketArn != null && { SourceBucketArn: input.SourceBucketArn })), (input.Tags != null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) })), (input.WebserverAccessMode != null && { WebserverAccessMode: input.WebserverAccessMode })), (input.WeeklyMaintenanceWindowStart != null && {
58
- WeeklyMaintenanceWindowStart: input.WeeklyMaintenanceWindowStart,
59
- })));
60
- return [4, context.endpoint()];
61
- case 2:
62
- resolvedHostname = (_c.sent()).hostname;
63
- if (context.disableHostPrefix !== true) {
64
- resolvedHostname = "api." + resolvedHostname;
65
- if (!__isValidHostname(resolvedHostname)) {
66
- throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
67
- }
68
- }
69
- return [2, new __HttpRequest({
70
- protocol: protocol,
71
- hostname: resolvedHostname,
72
- port: port,
73
- method: "PUT",
74
- headers: headers,
75
- path: resolvedPath,
76
- body: body,
77
- })];
78
- }
79
- });
80
- }); };
81
- export var serializeAws_restJson1CreateWebLoginTokenCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
82
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body, resolvedHostname;
83
- return __generator(this, function (_c) {
84
- switch (_c.label) {
85
- case 0: return [4, context.endpoint()];
86
- case 1:
87
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
88
- headers = {};
89
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/webtoken/{Name}";
90
- resolvedPath = __resolvedPath(resolvedPath, input, "Name", function () { return input.Name; }, "{Name}", false);
91
- return [4, context.endpoint()];
92
- case 2:
93
- resolvedHostname = (_c.sent()).hostname;
94
- if (context.disableHostPrefix !== true) {
95
- resolvedHostname = "env." + resolvedHostname;
96
- if (!__isValidHostname(resolvedHostname)) {
97
- throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
98
- }
99
- }
100
- return [2, new __HttpRequest({
101
- protocol: protocol,
102
- hostname: resolvedHostname,
103
- port: port,
104
- method: "POST",
105
- headers: headers,
106
- path: resolvedPath,
107
- body: body,
108
- })];
109
- }
110
- });
111
- }); };
112
- export var serializeAws_restJson1DeleteEnvironmentCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
113
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body, resolvedHostname;
114
- return __generator(this, function (_c) {
115
- switch (_c.label) {
116
- case 0: return [4, context.endpoint()];
117
- case 1:
118
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
119
- headers = {};
120
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/environments/{Name}";
121
- resolvedPath = __resolvedPath(resolvedPath, input, "Name", function () { return input.Name; }, "{Name}", false);
122
- return [4, context.endpoint()];
123
- case 2:
124
- resolvedHostname = (_c.sent()).hostname;
125
- if (context.disableHostPrefix !== true) {
126
- resolvedHostname = "api." + resolvedHostname;
127
- if (!__isValidHostname(resolvedHostname)) {
128
- throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
129
- }
130
- }
131
- return [2, new __HttpRequest({
132
- protocol: protocol,
133
- hostname: resolvedHostname,
134
- port: port,
135
- method: "DELETE",
136
- headers: headers,
137
- path: resolvedPath,
138
- body: body,
139
- })];
140
- }
141
- });
142
- }); };
143
- export var serializeAws_restJson1GetEnvironmentCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
144
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body, resolvedHostname;
145
- return __generator(this, function (_c) {
146
- switch (_c.label) {
147
- case 0: return [4, context.endpoint()];
148
- case 1:
149
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
150
- headers = {};
151
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/environments/{Name}";
152
- resolvedPath = __resolvedPath(resolvedPath, input, "Name", function () { return input.Name; }, "{Name}", false);
153
- return [4, context.endpoint()];
154
- case 2:
155
- resolvedHostname = (_c.sent()).hostname;
156
- if (context.disableHostPrefix !== true) {
157
- resolvedHostname = "api." + resolvedHostname;
158
- if (!__isValidHostname(resolvedHostname)) {
159
- throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
160
- }
161
- }
162
- return [2, new __HttpRequest({
163
- protocol: protocol,
164
- hostname: resolvedHostname,
165
- port: port,
166
- method: "GET",
167
- headers: headers,
168
- path: resolvedPath,
169
- body: body,
170
- })];
171
- }
172
- });
173
- }); };
174
- export var serializeAws_restJson1ListEnvironmentsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
175
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body, resolvedHostname;
176
- return __generator(this, function (_c) {
177
- switch (_c.label) {
178
- case 0: return [4, context.endpoint()];
179
- case 1:
180
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
181
- headers = {};
182
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/environments";
183
- query = map({
184
- NextToken: [, input.NextToken],
185
- MaxResults: [function () { return input.MaxResults !== void 0; }, function () { return input.MaxResults.toString(); }],
186
- });
187
- return [4, context.endpoint()];
188
- case 2:
189
- resolvedHostname = (_c.sent()).hostname;
190
- if (context.disableHostPrefix !== true) {
191
- resolvedHostname = "api." + resolvedHostname;
192
- if (!__isValidHostname(resolvedHostname)) {
193
- throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
194
- }
195
- }
196
- return [2, new __HttpRequest({
197
- protocol: protocol,
198
- hostname: resolvedHostname,
199
- port: port,
200
- method: "GET",
201
- headers: headers,
202
- path: resolvedPath,
203
- query: query,
204
- body: body,
205
- })];
5
+ export const serializeAws_restJson1CreateCliTokenCommand = async (input, context) => {
6
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
7
+ const headers = {};
8
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/clitoken/{Name}";
9
+ resolvedPath = __resolvedPath(resolvedPath, input, "Name", () => input.Name, "{Name}", false);
10
+ let body;
11
+ let { hostname: resolvedHostname } = await context.endpoint();
12
+ if (context.disableHostPrefix !== true) {
13
+ resolvedHostname = "env." + resolvedHostname;
14
+ if (!__isValidHostname(resolvedHostname)) {
15
+ throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
206
16
  }
17
+ }
18
+ return new __HttpRequest({
19
+ protocol,
20
+ hostname: resolvedHostname,
21
+ port,
22
+ method: "POST",
23
+ headers,
24
+ path: resolvedPath,
25
+ body,
207
26
  });
208
- }); };
209
- export var serializeAws_restJson1ListTagsForResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
210
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body, resolvedHostname;
211
- return __generator(this, function (_c) {
212
- switch (_c.label) {
213
- case 0: return [4, context.endpoint()];
214
- case 1:
215
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
216
- headers = {};
217
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{ResourceArn}";
218
- resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", function () { return input.ResourceArn; }, "{ResourceArn}", false);
219
- return [4, context.endpoint()];
220
- case 2:
221
- resolvedHostname = (_c.sent()).hostname;
222
- if (context.disableHostPrefix !== true) {
223
- resolvedHostname = "api." + resolvedHostname;
224
- if (!__isValidHostname(resolvedHostname)) {
225
- throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
226
- }
227
- }
228
- return [2, new __HttpRequest({
229
- protocol: protocol,
230
- hostname: resolvedHostname,
231
- port: port,
232
- method: "GET",
233
- headers: headers,
234
- path: resolvedPath,
235
- body: body,
236
- })];
237
- }
27
+ };
28
+ export const serializeAws_restJson1CreateEnvironmentCommand = async (input, context) => {
29
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
30
+ const headers = {
31
+ "content-type": "application/json",
32
+ };
33
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/environments/{Name}";
34
+ resolvedPath = __resolvedPath(resolvedPath, input, "Name", () => input.Name, "{Name}", false);
35
+ let body;
36
+ body = JSON.stringify({
37
+ ...(input.AirflowConfigurationOptions != null && {
38
+ AirflowConfigurationOptions: serializeAws_restJson1AirflowConfigurationOptions(input.AirflowConfigurationOptions, context),
39
+ }),
40
+ ...(input.AirflowVersion != null && { AirflowVersion: input.AirflowVersion }),
41
+ ...(input.DagS3Path != null && { DagS3Path: input.DagS3Path }),
42
+ ...(input.EnvironmentClass != null && { EnvironmentClass: input.EnvironmentClass }),
43
+ ...(input.ExecutionRoleArn != null && { ExecutionRoleArn: input.ExecutionRoleArn }),
44
+ ...(input.KmsKey != null && { KmsKey: input.KmsKey }),
45
+ ...(input.LoggingConfiguration != null && {
46
+ LoggingConfiguration: serializeAws_restJson1LoggingConfigurationInput(input.LoggingConfiguration, context),
47
+ }),
48
+ ...(input.MaxWorkers != null && { MaxWorkers: input.MaxWorkers }),
49
+ ...(input.MinWorkers != null && { MinWorkers: input.MinWorkers }),
50
+ ...(input.NetworkConfiguration != null && {
51
+ NetworkConfiguration: serializeAws_restJson1NetworkConfiguration(input.NetworkConfiguration, context),
52
+ }),
53
+ ...(input.PluginsS3ObjectVersion != null && { PluginsS3ObjectVersion: input.PluginsS3ObjectVersion }),
54
+ ...(input.PluginsS3Path != null && { PluginsS3Path: input.PluginsS3Path }),
55
+ ...(input.RequirementsS3ObjectVersion != null && {
56
+ RequirementsS3ObjectVersion: input.RequirementsS3ObjectVersion,
57
+ }),
58
+ ...(input.RequirementsS3Path != null && { RequirementsS3Path: input.RequirementsS3Path }),
59
+ ...(input.Schedulers != null && { Schedulers: input.Schedulers }),
60
+ ...(input.SourceBucketArn != null && { SourceBucketArn: input.SourceBucketArn }),
61
+ ...(input.Tags != null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }),
62
+ ...(input.WebserverAccessMode != null && { WebserverAccessMode: input.WebserverAccessMode }),
63
+ ...(input.WeeklyMaintenanceWindowStart != null && {
64
+ WeeklyMaintenanceWindowStart: input.WeeklyMaintenanceWindowStart,
65
+ }),
238
66
  });
239
- }); };
240
- export var serializeAws_restJson1PublishMetricsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
241
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body, resolvedHostname;
242
- return __generator(this, function (_c) {
243
- switch (_c.label) {
244
- case 0: return [4, context.endpoint()];
245
- case 1:
246
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
247
- headers = {
248
- "content-type": "application/json",
249
- };
250
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/metrics/environments/{EnvironmentName}";
251
- resolvedPath = __resolvedPath(resolvedPath, input, "EnvironmentName", function () { return input.EnvironmentName; }, "{EnvironmentName}", false);
252
- body = JSON.stringify(__assign({}, (input.MetricData != null && { MetricData: serializeAws_restJson1MetricData(input.MetricData, context) })));
253
- return [4, context.endpoint()];
254
- case 2:
255
- resolvedHostname = (_c.sent()).hostname;
256
- if (context.disableHostPrefix !== true) {
257
- resolvedHostname = "ops." + resolvedHostname;
258
- if (!__isValidHostname(resolvedHostname)) {
259
- throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
260
- }
261
- }
262
- return [2, new __HttpRequest({
263
- protocol: protocol,
264
- hostname: resolvedHostname,
265
- port: port,
266
- method: "POST",
267
- headers: headers,
268
- path: resolvedPath,
269
- body: body,
270
- })];
67
+ let { hostname: resolvedHostname } = await context.endpoint();
68
+ if (context.disableHostPrefix !== true) {
69
+ resolvedHostname = "api." + resolvedHostname;
70
+ if (!__isValidHostname(resolvedHostname)) {
71
+ throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
271
72
  }
73
+ }
74
+ return new __HttpRequest({
75
+ protocol,
76
+ hostname: resolvedHostname,
77
+ port,
78
+ method: "PUT",
79
+ headers,
80
+ path: resolvedPath,
81
+ body,
272
82
  });
273
- }); };
274
- export var serializeAws_restJson1TagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
275
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body, resolvedHostname;
276
- return __generator(this, function (_c) {
277
- switch (_c.label) {
278
- case 0: return [4, context.endpoint()];
279
- case 1:
280
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
281
- headers = {
282
- "content-type": "application/json",
283
- };
284
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{ResourceArn}";
285
- resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", function () { return input.ResourceArn; }, "{ResourceArn}", false);
286
- body = JSON.stringify(__assign({}, (input.Tags != null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) })));
287
- return [4, context.endpoint()];
288
- case 2:
289
- resolvedHostname = (_c.sent()).hostname;
290
- if (context.disableHostPrefix !== true) {
291
- resolvedHostname = "api." + resolvedHostname;
292
- if (!__isValidHostname(resolvedHostname)) {
293
- throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
294
- }
295
- }
296
- return [2, new __HttpRequest({
297
- protocol: protocol,
298
- hostname: resolvedHostname,
299
- port: port,
300
- method: "POST",
301
- headers: headers,
302
- path: resolvedPath,
303
- body: body,
304
- })];
83
+ };
84
+ export const serializeAws_restJson1CreateWebLoginTokenCommand = async (input, context) => {
85
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
86
+ const headers = {};
87
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/webtoken/{Name}";
88
+ resolvedPath = __resolvedPath(resolvedPath, input, "Name", () => input.Name, "{Name}", false);
89
+ let body;
90
+ let { hostname: resolvedHostname } = await context.endpoint();
91
+ if (context.disableHostPrefix !== true) {
92
+ resolvedHostname = "env." + resolvedHostname;
93
+ if (!__isValidHostname(resolvedHostname)) {
94
+ throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
305
95
  }
96
+ }
97
+ return new __HttpRequest({
98
+ protocol,
99
+ hostname: resolvedHostname,
100
+ port,
101
+ method: "POST",
102
+ headers,
103
+ path: resolvedPath,
104
+ body,
306
105
  });
307
- }); };
308
- export var serializeAws_restJson1UntagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
309
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body, resolvedHostname;
310
- return __generator(this, function (_c) {
311
- switch (_c.label) {
312
- case 0: return [4, context.endpoint()];
313
- case 1:
314
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
315
- headers = {};
316
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{ResourceArn}";
317
- resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", function () { return input.ResourceArn; }, "{ResourceArn}", false);
318
- query = map({
319
- tagKeys: [function () { return input.tagKeys !== void 0; }, function () { return (input.tagKeys || []).map(function (_entry) { return _entry; }); }],
320
- });
321
- return [4, context.endpoint()];
322
- case 2:
323
- resolvedHostname = (_c.sent()).hostname;
324
- if (context.disableHostPrefix !== true) {
325
- resolvedHostname = "api." + resolvedHostname;
326
- if (!__isValidHostname(resolvedHostname)) {
327
- throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
328
- }
329
- }
330
- return [2, new __HttpRequest({
331
- protocol: protocol,
332
- hostname: resolvedHostname,
333
- port: port,
334
- method: "DELETE",
335
- headers: headers,
336
- path: resolvedPath,
337
- query: query,
338
- body: body,
339
- })];
106
+ };
107
+ export const serializeAws_restJson1DeleteEnvironmentCommand = async (input, context) => {
108
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
109
+ const headers = {};
110
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/environments/{Name}";
111
+ resolvedPath = __resolvedPath(resolvedPath, input, "Name", () => input.Name, "{Name}", false);
112
+ let body;
113
+ let { hostname: resolvedHostname } = await context.endpoint();
114
+ if (context.disableHostPrefix !== true) {
115
+ resolvedHostname = "api." + resolvedHostname;
116
+ if (!__isValidHostname(resolvedHostname)) {
117
+ throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
340
118
  }
119
+ }
120
+ return new __HttpRequest({
121
+ protocol,
122
+ hostname: resolvedHostname,
123
+ port,
124
+ method: "DELETE",
125
+ headers,
126
+ path: resolvedPath,
127
+ body,
341
128
  });
342
- }); };
343
- export var serializeAws_restJson1UpdateEnvironmentCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
344
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body, resolvedHostname;
345
- return __generator(this, function (_c) {
346
- switch (_c.label) {
347
- case 0: return [4, context.endpoint()];
348
- case 1:
349
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
350
- headers = {
351
- "content-type": "application/json",
352
- };
353
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/environments/{Name}";
354
- resolvedPath = __resolvedPath(resolvedPath, input, "Name", function () { return input.Name; }, "{Name}", false);
355
- body = JSON.stringify(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.AirflowConfigurationOptions != null && {
356
- AirflowConfigurationOptions: serializeAws_restJson1AirflowConfigurationOptions(input.AirflowConfigurationOptions, context),
357
- })), (input.AirflowVersion != null && { AirflowVersion: input.AirflowVersion })), (input.DagS3Path != null && { DagS3Path: input.DagS3Path })), (input.EnvironmentClass != null && { EnvironmentClass: input.EnvironmentClass })), (input.ExecutionRoleArn != null && { ExecutionRoleArn: input.ExecutionRoleArn })), (input.LoggingConfiguration != null && {
358
- LoggingConfiguration: serializeAws_restJson1LoggingConfigurationInput(input.LoggingConfiguration, context),
359
- })), (input.MaxWorkers != null && { MaxWorkers: input.MaxWorkers })), (input.MinWorkers != null && { MinWorkers: input.MinWorkers })), (input.NetworkConfiguration != null && {
360
- NetworkConfiguration: serializeAws_restJson1UpdateNetworkConfigurationInput(input.NetworkConfiguration, context),
361
- })), (input.PluginsS3ObjectVersion != null && { PluginsS3ObjectVersion: input.PluginsS3ObjectVersion })), (input.PluginsS3Path != null && { PluginsS3Path: input.PluginsS3Path })), (input.RequirementsS3ObjectVersion != null && {
362
- RequirementsS3ObjectVersion: input.RequirementsS3ObjectVersion,
363
- })), (input.RequirementsS3Path != null && { RequirementsS3Path: input.RequirementsS3Path })), (input.Schedulers != null && { Schedulers: input.Schedulers })), (input.SourceBucketArn != null && { SourceBucketArn: input.SourceBucketArn })), (input.WebserverAccessMode != null && { WebserverAccessMode: input.WebserverAccessMode })), (input.WeeklyMaintenanceWindowStart != null && {
364
- WeeklyMaintenanceWindowStart: input.WeeklyMaintenanceWindowStart,
365
- })));
366
- return [4, context.endpoint()];
367
- case 2:
368
- resolvedHostname = (_c.sent()).hostname;
369
- if (context.disableHostPrefix !== true) {
370
- resolvedHostname = "api." + resolvedHostname;
371
- if (!__isValidHostname(resolvedHostname)) {
372
- throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
373
- }
374
- }
375
- return [2, new __HttpRequest({
376
- protocol: protocol,
377
- hostname: resolvedHostname,
378
- port: port,
379
- method: "PATCH",
380
- headers: headers,
381
- path: resolvedPath,
382
- body: body,
383
- })];
129
+ };
130
+ export const serializeAws_restJson1GetEnvironmentCommand = async (input, context) => {
131
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
132
+ const headers = {};
133
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/environments/{Name}";
134
+ resolvedPath = __resolvedPath(resolvedPath, input, "Name", () => input.Name, "{Name}", false);
135
+ let body;
136
+ let { hostname: resolvedHostname } = await context.endpoint();
137
+ if (context.disableHostPrefix !== true) {
138
+ resolvedHostname = "api." + resolvedHostname;
139
+ if (!__isValidHostname(resolvedHostname)) {
140
+ throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
384
141
  }
142
+ }
143
+ return new __HttpRequest({
144
+ protocol,
145
+ hostname: resolvedHostname,
146
+ port,
147
+ method: "GET",
148
+ headers,
149
+ path: resolvedPath,
150
+ body,
385
151
  });
386
- }); };
387
- export var deserializeAws_restJson1CreateCliTokenCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
388
- var contents, data, _a, _b;
389
- return __generator(this, function (_c) {
390
- switch (_c.label) {
391
- case 0:
392
- if (output.statusCode !== 200 && output.statusCode >= 300) {
393
- return [2, deserializeAws_restJson1CreateCliTokenCommandError(output, context)];
394
- }
395
- contents = map({
396
- $metadata: deserializeMetadata(output),
397
- });
398
- _a = __expectNonNull;
399
- _b = __expectObject;
400
- return [4, parseBody(output.body, context)];
401
- case 1:
402
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
403
- if (data.CliToken != null) {
404
- contents.CliToken = __expectString(data.CliToken);
405
- }
406
- if (data.WebServerHostname != null) {
407
- contents.WebServerHostname = __expectString(data.WebServerHostname);
408
- }
409
- return [2, contents];
410
- }
152
+ };
153
+ export const serializeAws_restJson1ListEnvironmentsCommand = async (input, context) => {
154
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
155
+ const headers = {};
156
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/environments";
157
+ const query = map({
158
+ NextToken: [, input.NextToken],
159
+ MaxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
411
160
  });
412
- }); };
413
- var deserializeAws_restJson1CreateCliTokenCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
414
- var parsedOutput, _a, errorCode, _b, parsedBody;
415
- var _c;
416
- return __generator(this, function (_d) {
417
- switch (_d.label) {
418
- case 0:
419
- _a = [__assign({}, output)];
420
- _c = {};
421
- return [4, parseErrorBody(output.body, context)];
422
- case 1:
423
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
424
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
425
- _b = errorCode;
426
- switch (_b) {
427
- case "ResourceNotFoundException": return [3, 2];
428
- case "com.amazonaws.mwaa#ResourceNotFoundException": return [3, 2];
429
- }
430
- return [3, 4];
431
- case 2: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
432
- case 3: throw _d.sent();
433
- case 4:
434
- parsedBody = parsedOutput.body;
435
- throwDefaultError({
436
- output: output,
437
- parsedBody: parsedBody,
438
- exceptionCtor: __BaseException,
439
- errorCode: errorCode,
440
- });
441
- _d.label = 5;
442
- case 5: return [2];
161
+ let body;
162
+ let { hostname: resolvedHostname } = await context.endpoint();
163
+ if (context.disableHostPrefix !== true) {
164
+ resolvedHostname = "api." + resolvedHostname;
165
+ if (!__isValidHostname(resolvedHostname)) {
166
+ throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
443
167
  }
168
+ }
169
+ return new __HttpRequest({
170
+ protocol,
171
+ hostname: resolvedHostname,
172
+ port,
173
+ method: "GET",
174
+ headers,
175
+ path: resolvedPath,
176
+ query,
177
+ body,
444
178
  });
445
- }); };
446
- export var deserializeAws_restJson1CreateEnvironmentCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
447
- var contents, data, _a, _b;
448
- return __generator(this, function (_c) {
449
- switch (_c.label) {
450
- case 0:
451
- if (output.statusCode !== 200 && output.statusCode >= 300) {
452
- return [2, deserializeAws_restJson1CreateEnvironmentCommandError(output, context)];
453
- }
454
- contents = map({
455
- $metadata: deserializeMetadata(output),
456
- });
457
- _a = __expectNonNull;
458
- _b = __expectObject;
459
- return [4, parseBody(output.body, context)];
460
- case 1:
461
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
462
- if (data.Arn != null) {
463
- contents.Arn = __expectString(data.Arn);
464
- }
465
- return [2, contents];
179
+ };
180
+ export const serializeAws_restJson1ListTagsForResourceCommand = async (input, context) => {
181
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
182
+ const headers = {};
183
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
184
+ resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
185
+ let body;
186
+ let { hostname: resolvedHostname } = await context.endpoint();
187
+ if (context.disableHostPrefix !== true) {
188
+ resolvedHostname = "api." + resolvedHostname;
189
+ if (!__isValidHostname(resolvedHostname)) {
190
+ throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
466
191
  }
192
+ }
193
+ return new __HttpRequest({
194
+ protocol,
195
+ hostname: resolvedHostname,
196
+ port,
197
+ method: "GET",
198
+ headers,
199
+ path: resolvedPath,
200
+ body,
467
201
  });
468
- }); };
469
- var deserializeAws_restJson1CreateEnvironmentCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
470
- var parsedOutput, _a, errorCode, _b, parsedBody;
471
- var _c;
472
- return __generator(this, function (_d) {
473
- switch (_d.label) {
474
- case 0:
475
- _a = [__assign({}, output)];
476
- _c = {};
477
- return [4, parseErrorBody(output.body, context)];
478
- case 1:
479
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
480
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
481
- _b = errorCode;
482
- switch (_b) {
483
- case "InternalServerException": return [3, 2];
484
- case "com.amazonaws.mwaa#InternalServerException": return [3, 2];
485
- case "ValidationException": return [3, 4];
486
- case "com.amazonaws.mwaa#ValidationException": return [3, 4];
487
- }
488
- return [3, 6];
489
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
490
- case 3: throw _d.sent();
491
- case 4: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
492
- case 5: throw _d.sent();
493
- case 6:
494
- parsedBody = parsedOutput.body;
495
- throwDefaultError({
496
- output: output,
497
- parsedBody: parsedBody,
498
- exceptionCtor: __BaseException,
499
- errorCode: errorCode,
500
- });
501
- _d.label = 7;
502
- case 7: return [2];
503
- }
202
+ };
203
+ export const serializeAws_restJson1PublishMetricsCommand = async (input, context) => {
204
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
205
+ const headers = {
206
+ "content-type": "application/json",
207
+ };
208
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/metrics/environments/{EnvironmentName}";
209
+ resolvedPath = __resolvedPath(resolvedPath, input, "EnvironmentName", () => input.EnvironmentName, "{EnvironmentName}", false);
210
+ let body;
211
+ body = JSON.stringify({
212
+ ...(input.MetricData != null && { MetricData: serializeAws_restJson1MetricData(input.MetricData, context) }),
504
213
  });
505
- }); };
506
- export var deserializeAws_restJson1CreateWebLoginTokenCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
507
- var contents, data, _a, _b;
508
- return __generator(this, function (_c) {
509
- switch (_c.label) {
510
- case 0:
511
- if (output.statusCode !== 200 && output.statusCode >= 300) {
512
- return [2, deserializeAws_restJson1CreateWebLoginTokenCommandError(output, context)];
513
- }
514
- contents = map({
515
- $metadata: deserializeMetadata(output),
516
- });
517
- _a = __expectNonNull;
518
- _b = __expectObject;
519
- return [4, parseBody(output.body, context)];
520
- case 1:
521
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
522
- if (data.WebServerHostname != null) {
523
- contents.WebServerHostname = __expectString(data.WebServerHostname);
524
- }
525
- if (data.WebToken != null) {
526
- contents.WebToken = __expectString(data.WebToken);
527
- }
528
- return [2, contents];
214
+ let { hostname: resolvedHostname } = await context.endpoint();
215
+ if (context.disableHostPrefix !== true) {
216
+ resolvedHostname = "ops." + resolvedHostname;
217
+ if (!__isValidHostname(resolvedHostname)) {
218
+ throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
529
219
  }
220
+ }
221
+ return new __HttpRequest({
222
+ protocol,
223
+ hostname: resolvedHostname,
224
+ port,
225
+ method: "POST",
226
+ headers,
227
+ path: resolvedPath,
228
+ body,
530
229
  });
531
- }); };
532
- var deserializeAws_restJson1CreateWebLoginTokenCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
533
- var parsedOutput, _a, errorCode, _b, parsedBody;
534
- var _c;
535
- return __generator(this, function (_d) {
536
- switch (_d.label) {
537
- case 0:
538
- _a = [__assign({}, output)];
539
- _c = {};
540
- return [4, parseErrorBody(output.body, context)];
541
- case 1:
542
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
543
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
544
- _b = errorCode;
545
- switch (_b) {
546
- case "AccessDeniedException": return [3, 2];
547
- case "com.amazonaws.mwaa#AccessDeniedException": return [3, 2];
548
- case "InternalServerException": return [3, 4];
549
- case "com.amazonaws.mwaa#InternalServerException": return [3, 4];
550
- case "ResourceNotFoundException": return [3, 6];
551
- case "com.amazonaws.mwaa#ResourceNotFoundException": return [3, 6];
552
- case "ValidationException": return [3, 8];
553
- case "com.amazonaws.mwaa#ValidationException": return [3, 8];
554
- }
555
- return [3, 10];
556
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
557
- case 3: throw _d.sent();
558
- case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
559
- case 5: throw _d.sent();
560
- case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
561
- case 7: throw _d.sent();
562
- case 8: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
563
- case 9: throw _d.sent();
564
- case 10:
565
- parsedBody = parsedOutput.body;
566
- throwDefaultError({
567
- output: output,
568
- parsedBody: parsedBody,
569
- exceptionCtor: __BaseException,
570
- errorCode: errorCode,
571
- });
572
- _d.label = 11;
573
- case 11: return [2];
574
- }
230
+ };
231
+ export const serializeAws_restJson1TagResourceCommand = async (input, context) => {
232
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
233
+ const headers = {
234
+ "content-type": "application/json",
235
+ };
236
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
237
+ resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
238
+ let body;
239
+ body = JSON.stringify({
240
+ ...(input.Tags != null && { Tags: serializeAws_restJson1TagMap(input.Tags, context) }),
575
241
  });
576
- }); };
577
- export var deserializeAws_restJson1DeleteEnvironmentCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
578
- var contents;
579
- return __generator(this, function (_a) {
580
- switch (_a.label) {
581
- case 0:
582
- if (output.statusCode !== 200 && output.statusCode >= 300) {
583
- return [2, deserializeAws_restJson1DeleteEnvironmentCommandError(output, context)];
584
- }
585
- contents = map({
586
- $metadata: deserializeMetadata(output),
587
- });
588
- return [4, collectBody(output.body, context)];
589
- case 1:
590
- _a.sent();
591
- return [2, contents];
242
+ let { hostname: resolvedHostname } = await context.endpoint();
243
+ if (context.disableHostPrefix !== true) {
244
+ resolvedHostname = "api." + resolvedHostname;
245
+ if (!__isValidHostname(resolvedHostname)) {
246
+ throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
592
247
  }
248
+ }
249
+ return new __HttpRequest({
250
+ protocol,
251
+ hostname: resolvedHostname,
252
+ port,
253
+ method: "POST",
254
+ headers,
255
+ path: resolvedPath,
256
+ body,
593
257
  });
594
- }); };
595
- var deserializeAws_restJson1DeleteEnvironmentCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
596
- var parsedOutput, _a, errorCode, _b, parsedBody;
597
- var _c;
598
- return __generator(this, function (_d) {
599
- switch (_d.label) {
600
- case 0:
601
- _a = [__assign({}, output)];
602
- _c = {};
603
- return [4, parseErrorBody(output.body, context)];
604
- case 1:
605
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
606
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
607
- _b = errorCode;
608
- switch (_b) {
609
- case "InternalServerException": return [3, 2];
610
- case "com.amazonaws.mwaa#InternalServerException": return [3, 2];
611
- case "ResourceNotFoundException": return [3, 4];
612
- case "com.amazonaws.mwaa#ResourceNotFoundException": return [3, 4];
613
- case "ValidationException": return [3, 6];
614
- case "com.amazonaws.mwaa#ValidationException": return [3, 6];
615
- }
616
- return [3, 8];
617
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
618
- case 3: throw _d.sent();
619
- case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
620
- case 5: throw _d.sent();
621
- case 6: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
622
- case 7: throw _d.sent();
623
- case 8:
624
- parsedBody = parsedOutput.body;
625
- throwDefaultError({
626
- output: output,
627
- parsedBody: parsedBody,
628
- exceptionCtor: __BaseException,
629
- errorCode: errorCode,
630
- });
631
- _d.label = 9;
632
- case 9: return [2];
633
- }
258
+ };
259
+ export const serializeAws_restJson1UntagResourceCommand = async (input, context) => {
260
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
261
+ const headers = {};
262
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
263
+ resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
264
+ const query = map({
265
+ tagKeys: [() => input.tagKeys !== void 0, () => (input.tagKeys || []).map((_entry) => _entry)],
634
266
  });
635
- }); };
636
- export var deserializeAws_restJson1GetEnvironmentCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
637
- var contents, data, _a, _b;
638
- return __generator(this, function (_c) {
639
- switch (_c.label) {
640
- case 0:
641
- if (output.statusCode !== 200 && output.statusCode >= 300) {
642
- return [2, deserializeAws_restJson1GetEnvironmentCommandError(output, context)];
643
- }
644
- contents = map({
645
- $metadata: deserializeMetadata(output),
646
- });
647
- _a = __expectNonNull;
648
- _b = __expectObject;
649
- return [4, parseBody(output.body, context)];
650
- case 1:
651
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
652
- if (data.Environment != null) {
653
- contents.Environment = deserializeAws_restJson1Environment(data.Environment, context);
654
- }
655
- return [2, contents];
267
+ let body;
268
+ let { hostname: resolvedHostname } = await context.endpoint();
269
+ if (context.disableHostPrefix !== true) {
270
+ resolvedHostname = "api." + resolvedHostname;
271
+ if (!__isValidHostname(resolvedHostname)) {
272
+ throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
656
273
  }
274
+ }
275
+ return new __HttpRequest({
276
+ protocol,
277
+ hostname: resolvedHostname,
278
+ port,
279
+ method: "DELETE",
280
+ headers,
281
+ path: resolvedPath,
282
+ query,
283
+ body,
657
284
  });
658
- }); };
659
- var deserializeAws_restJson1GetEnvironmentCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
660
- var parsedOutput, _a, errorCode, _b, parsedBody;
661
- var _c;
662
- return __generator(this, function (_d) {
663
- switch (_d.label) {
664
- case 0:
665
- _a = [__assign({}, output)];
666
- _c = {};
667
- return [4, parseErrorBody(output.body, context)];
668
- case 1:
669
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
670
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
671
- _b = errorCode;
672
- switch (_b) {
673
- case "InternalServerException": return [3, 2];
674
- case "com.amazonaws.mwaa#InternalServerException": return [3, 2];
675
- case "ResourceNotFoundException": return [3, 4];
676
- case "com.amazonaws.mwaa#ResourceNotFoundException": return [3, 4];
677
- case "ValidationException": return [3, 6];
678
- case "com.amazonaws.mwaa#ValidationException": return [3, 6];
679
- }
680
- return [3, 8];
681
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
682
- case 3: throw _d.sent();
683
- case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
684
- case 5: throw _d.sent();
685
- case 6: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
686
- case 7: throw _d.sent();
687
- case 8:
688
- parsedBody = parsedOutput.body;
689
- throwDefaultError({
690
- output: output,
691
- parsedBody: parsedBody,
692
- exceptionCtor: __BaseException,
693
- errorCode: errorCode,
694
- });
695
- _d.label = 9;
696
- case 9: return [2];
697
- }
285
+ };
286
+ export const serializeAws_restJson1UpdateEnvironmentCommand = async (input, context) => {
287
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
288
+ const headers = {
289
+ "content-type": "application/json",
290
+ };
291
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/environments/{Name}";
292
+ resolvedPath = __resolvedPath(resolvedPath, input, "Name", () => input.Name, "{Name}", false);
293
+ let body;
294
+ body = JSON.stringify({
295
+ ...(input.AirflowConfigurationOptions != null && {
296
+ AirflowConfigurationOptions: serializeAws_restJson1AirflowConfigurationOptions(input.AirflowConfigurationOptions, context),
297
+ }),
298
+ ...(input.AirflowVersion != null && { AirflowVersion: input.AirflowVersion }),
299
+ ...(input.DagS3Path != null && { DagS3Path: input.DagS3Path }),
300
+ ...(input.EnvironmentClass != null && { EnvironmentClass: input.EnvironmentClass }),
301
+ ...(input.ExecutionRoleArn != null && { ExecutionRoleArn: input.ExecutionRoleArn }),
302
+ ...(input.LoggingConfiguration != null && {
303
+ LoggingConfiguration: serializeAws_restJson1LoggingConfigurationInput(input.LoggingConfiguration, context),
304
+ }),
305
+ ...(input.MaxWorkers != null && { MaxWorkers: input.MaxWorkers }),
306
+ ...(input.MinWorkers != null && { MinWorkers: input.MinWorkers }),
307
+ ...(input.NetworkConfiguration != null && {
308
+ NetworkConfiguration: serializeAws_restJson1UpdateNetworkConfigurationInput(input.NetworkConfiguration, context),
309
+ }),
310
+ ...(input.PluginsS3ObjectVersion != null && { PluginsS3ObjectVersion: input.PluginsS3ObjectVersion }),
311
+ ...(input.PluginsS3Path != null && { PluginsS3Path: input.PluginsS3Path }),
312
+ ...(input.RequirementsS3ObjectVersion != null && {
313
+ RequirementsS3ObjectVersion: input.RequirementsS3ObjectVersion,
314
+ }),
315
+ ...(input.RequirementsS3Path != null && { RequirementsS3Path: input.RequirementsS3Path }),
316
+ ...(input.Schedulers != null && { Schedulers: input.Schedulers }),
317
+ ...(input.SourceBucketArn != null && { SourceBucketArn: input.SourceBucketArn }),
318
+ ...(input.WebserverAccessMode != null && { WebserverAccessMode: input.WebserverAccessMode }),
319
+ ...(input.WeeklyMaintenanceWindowStart != null && {
320
+ WeeklyMaintenanceWindowStart: input.WeeklyMaintenanceWindowStart,
321
+ }),
698
322
  });
699
- }); };
700
- export var deserializeAws_restJson1ListEnvironmentsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
701
- var contents, data, _a, _b;
702
- return __generator(this, function (_c) {
703
- switch (_c.label) {
704
- case 0:
705
- if (output.statusCode !== 200 && output.statusCode >= 300) {
706
- return [2, deserializeAws_restJson1ListEnvironmentsCommandError(output, context)];
707
- }
708
- contents = map({
709
- $metadata: deserializeMetadata(output),
710
- });
711
- _a = __expectNonNull;
712
- _b = __expectObject;
713
- return [4, parseBody(output.body, context)];
714
- case 1:
715
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
716
- if (data.Environments != null) {
717
- contents.Environments = deserializeAws_restJson1EnvironmentList(data.Environments, context);
718
- }
719
- if (data.NextToken != null) {
720
- contents.NextToken = __expectString(data.NextToken);
721
- }
722
- return [2, contents];
323
+ let { hostname: resolvedHostname } = await context.endpoint();
324
+ if (context.disableHostPrefix !== true) {
325
+ resolvedHostname = "api." + resolvedHostname;
326
+ if (!__isValidHostname(resolvedHostname)) {
327
+ throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
723
328
  }
329
+ }
330
+ return new __HttpRequest({
331
+ protocol,
332
+ hostname: resolvedHostname,
333
+ port,
334
+ method: "PATCH",
335
+ headers,
336
+ path: resolvedPath,
337
+ body,
724
338
  });
725
- }); };
726
- var deserializeAws_restJson1ListEnvironmentsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
727
- var parsedOutput, _a, errorCode, _b, parsedBody;
728
- var _c;
729
- return __generator(this, function (_d) {
730
- switch (_d.label) {
731
- case 0:
732
- _a = [__assign({}, output)];
733
- _c = {};
734
- return [4, parseErrorBody(output.body, context)];
735
- case 1:
736
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
737
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
738
- _b = errorCode;
739
- switch (_b) {
740
- case "InternalServerException": return [3, 2];
741
- case "com.amazonaws.mwaa#InternalServerException": return [3, 2];
742
- case "ValidationException": return [3, 4];
743
- case "com.amazonaws.mwaa#ValidationException": return [3, 4];
744
- }
745
- return [3, 6];
746
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
747
- case 3: throw _d.sent();
748
- case 4: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
749
- case 5: throw _d.sent();
750
- case 6:
751
- parsedBody = parsedOutput.body;
752
- throwDefaultError({
753
- output: output,
754
- parsedBody: parsedBody,
755
- exceptionCtor: __BaseException,
756
- errorCode: errorCode,
757
- });
758
- _d.label = 7;
759
- case 7: return [2];
760
- }
339
+ };
340
+ export const deserializeAws_restJson1CreateCliTokenCommand = async (output, context) => {
341
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
342
+ return deserializeAws_restJson1CreateCliTokenCommandError(output, context);
343
+ }
344
+ const contents = map({
345
+ $metadata: deserializeMetadata(output),
761
346
  });
762
- }); };
763
- export var deserializeAws_restJson1ListTagsForResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
764
- var contents, data, _a, _b;
765
- return __generator(this, function (_c) {
766
- switch (_c.label) {
767
- case 0:
768
- if (output.statusCode !== 200 && output.statusCode >= 300) {
769
- return [2, deserializeAws_restJson1ListTagsForResourceCommandError(output, context)];
770
- }
771
- contents = map({
772
- $metadata: deserializeMetadata(output),
773
- });
774
- _a = __expectNonNull;
775
- _b = __expectObject;
776
- return [4, parseBody(output.body, context)];
777
- case 1:
778
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
779
- if (data.Tags != null) {
780
- contents.Tags = deserializeAws_restJson1TagMap(data.Tags, context);
781
- }
782
- return [2, contents];
783
- }
347
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
348
+ if (data.CliToken != null) {
349
+ contents.CliToken = __expectString(data.CliToken);
350
+ }
351
+ if (data.WebServerHostname != null) {
352
+ contents.WebServerHostname = __expectString(data.WebServerHostname);
353
+ }
354
+ return contents;
355
+ };
356
+ const deserializeAws_restJson1CreateCliTokenCommandError = async (output, context) => {
357
+ const parsedOutput = {
358
+ ...output,
359
+ body: await parseErrorBody(output.body, context),
360
+ };
361
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
362
+ switch (errorCode) {
363
+ case "ResourceNotFoundException":
364
+ case "com.amazonaws.mwaa#ResourceNotFoundException":
365
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
366
+ default:
367
+ const parsedBody = parsedOutput.body;
368
+ throwDefaultError({
369
+ output,
370
+ parsedBody,
371
+ exceptionCtor: __BaseException,
372
+ errorCode,
373
+ });
374
+ }
375
+ };
376
+ export const deserializeAws_restJson1CreateEnvironmentCommand = async (output, context) => {
377
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
378
+ return deserializeAws_restJson1CreateEnvironmentCommandError(output, context);
379
+ }
380
+ const contents = map({
381
+ $metadata: deserializeMetadata(output),
784
382
  });
785
- }); };
786
- var deserializeAws_restJson1ListTagsForResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
787
- var parsedOutput, _a, errorCode, _b, parsedBody;
788
- var _c;
789
- return __generator(this, function (_d) {
790
- switch (_d.label) {
791
- case 0:
792
- _a = [__assign({}, output)];
793
- _c = {};
794
- return [4, parseErrorBody(output.body, context)];
795
- case 1:
796
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
797
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
798
- _b = errorCode;
799
- switch (_b) {
800
- case "InternalServerException": return [3, 2];
801
- case "com.amazonaws.mwaa#InternalServerException": return [3, 2];
802
- case "ResourceNotFoundException": return [3, 4];
803
- case "com.amazonaws.mwaa#ResourceNotFoundException": return [3, 4];
804
- case "ValidationException": return [3, 6];
805
- case "com.amazonaws.mwaa#ValidationException": return [3, 6];
806
- }
807
- return [3, 8];
808
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
809
- case 3: throw _d.sent();
810
- case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
811
- case 5: throw _d.sent();
812
- case 6: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
813
- case 7: throw _d.sent();
814
- case 8:
815
- parsedBody = parsedOutput.body;
816
- throwDefaultError({
817
- output: output,
818
- parsedBody: parsedBody,
819
- exceptionCtor: __BaseException,
820
- errorCode: errorCode,
821
- });
822
- _d.label = 9;
823
- case 9: return [2];
824
- }
383
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
384
+ if (data.Arn != null) {
385
+ contents.Arn = __expectString(data.Arn);
386
+ }
387
+ return contents;
388
+ };
389
+ const deserializeAws_restJson1CreateEnvironmentCommandError = async (output, context) => {
390
+ const parsedOutput = {
391
+ ...output,
392
+ body: await parseErrorBody(output.body, context),
393
+ };
394
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
395
+ switch (errorCode) {
396
+ case "InternalServerException":
397
+ case "com.amazonaws.mwaa#InternalServerException":
398
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
399
+ case "ValidationException":
400
+ case "com.amazonaws.mwaa#ValidationException":
401
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
402
+ default:
403
+ const parsedBody = parsedOutput.body;
404
+ throwDefaultError({
405
+ output,
406
+ parsedBody,
407
+ exceptionCtor: __BaseException,
408
+ errorCode,
409
+ });
410
+ }
411
+ };
412
+ export const deserializeAws_restJson1CreateWebLoginTokenCommand = async (output, context) => {
413
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
414
+ return deserializeAws_restJson1CreateWebLoginTokenCommandError(output, context);
415
+ }
416
+ const contents = map({
417
+ $metadata: deserializeMetadata(output),
825
418
  });
826
- }); };
827
- export var deserializeAws_restJson1PublishMetricsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
828
- var contents;
829
- return __generator(this, function (_a) {
830
- switch (_a.label) {
831
- case 0:
832
- if (output.statusCode !== 200 && output.statusCode >= 300) {
833
- return [2, deserializeAws_restJson1PublishMetricsCommandError(output, context)];
834
- }
835
- contents = map({
836
- $metadata: deserializeMetadata(output),
837
- });
838
- return [4, collectBody(output.body, context)];
839
- case 1:
840
- _a.sent();
841
- return [2, contents];
842
- }
419
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
420
+ if (data.WebServerHostname != null) {
421
+ contents.WebServerHostname = __expectString(data.WebServerHostname);
422
+ }
423
+ if (data.WebToken != null) {
424
+ contents.WebToken = __expectString(data.WebToken);
425
+ }
426
+ return contents;
427
+ };
428
+ const deserializeAws_restJson1CreateWebLoginTokenCommandError = async (output, context) => {
429
+ const parsedOutput = {
430
+ ...output,
431
+ body: await parseErrorBody(output.body, context),
432
+ };
433
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
434
+ switch (errorCode) {
435
+ case "AccessDeniedException":
436
+ case "com.amazonaws.mwaa#AccessDeniedException":
437
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
438
+ case "InternalServerException":
439
+ case "com.amazonaws.mwaa#InternalServerException":
440
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
441
+ case "ResourceNotFoundException":
442
+ case "com.amazonaws.mwaa#ResourceNotFoundException":
443
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
444
+ case "ValidationException":
445
+ case "com.amazonaws.mwaa#ValidationException":
446
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
447
+ default:
448
+ const parsedBody = parsedOutput.body;
449
+ throwDefaultError({
450
+ output,
451
+ parsedBody,
452
+ exceptionCtor: __BaseException,
453
+ errorCode,
454
+ });
455
+ }
456
+ };
457
+ export const deserializeAws_restJson1DeleteEnvironmentCommand = async (output, context) => {
458
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
459
+ return deserializeAws_restJson1DeleteEnvironmentCommandError(output, context);
460
+ }
461
+ const contents = map({
462
+ $metadata: deserializeMetadata(output),
843
463
  });
844
- }); };
845
- var deserializeAws_restJson1PublishMetricsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
846
- var parsedOutput, _a, errorCode, _b, parsedBody;
847
- var _c;
848
- return __generator(this, function (_d) {
849
- switch (_d.label) {
850
- case 0:
851
- _a = [__assign({}, output)];
852
- _c = {};
853
- return [4, parseErrorBody(output.body, context)];
854
- case 1:
855
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
856
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
857
- _b = errorCode;
858
- switch (_b) {
859
- case "InternalServerException": return [3, 2];
860
- case "com.amazonaws.mwaa#InternalServerException": return [3, 2];
861
- case "ValidationException": return [3, 4];
862
- case "com.amazonaws.mwaa#ValidationException": return [3, 4];
863
- }
864
- return [3, 6];
865
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
866
- case 3: throw _d.sent();
867
- case 4: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
868
- case 5: throw _d.sent();
869
- case 6:
870
- parsedBody = parsedOutput.body;
871
- throwDefaultError({
872
- output: output,
873
- parsedBody: parsedBody,
874
- exceptionCtor: __BaseException,
875
- errorCode: errorCode,
876
- });
877
- _d.label = 7;
878
- case 7: return [2];
879
- }
464
+ await collectBody(output.body, context);
465
+ return contents;
466
+ };
467
+ const deserializeAws_restJson1DeleteEnvironmentCommandError = async (output, context) => {
468
+ const parsedOutput = {
469
+ ...output,
470
+ body: await parseErrorBody(output.body, context),
471
+ };
472
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
473
+ switch (errorCode) {
474
+ case "InternalServerException":
475
+ case "com.amazonaws.mwaa#InternalServerException":
476
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
477
+ case "ResourceNotFoundException":
478
+ case "com.amazonaws.mwaa#ResourceNotFoundException":
479
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
480
+ case "ValidationException":
481
+ case "com.amazonaws.mwaa#ValidationException":
482
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
483
+ default:
484
+ const parsedBody = parsedOutput.body;
485
+ throwDefaultError({
486
+ output,
487
+ parsedBody,
488
+ exceptionCtor: __BaseException,
489
+ errorCode,
490
+ });
491
+ }
492
+ };
493
+ export const deserializeAws_restJson1GetEnvironmentCommand = async (output, context) => {
494
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
495
+ return deserializeAws_restJson1GetEnvironmentCommandError(output, context);
496
+ }
497
+ const contents = map({
498
+ $metadata: deserializeMetadata(output),
880
499
  });
881
- }); };
882
- export var deserializeAws_restJson1TagResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
883
- var contents;
884
- return __generator(this, function (_a) {
885
- switch (_a.label) {
886
- case 0:
887
- if (output.statusCode !== 200 && output.statusCode >= 300) {
888
- return [2, deserializeAws_restJson1TagResourceCommandError(output, context)];
889
- }
890
- contents = map({
891
- $metadata: deserializeMetadata(output),
892
- });
893
- return [4, collectBody(output.body, context)];
894
- case 1:
895
- _a.sent();
896
- return [2, contents];
897
- }
500
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
501
+ if (data.Environment != null) {
502
+ contents.Environment = deserializeAws_restJson1Environment(data.Environment, context);
503
+ }
504
+ return contents;
505
+ };
506
+ const deserializeAws_restJson1GetEnvironmentCommandError = async (output, context) => {
507
+ const parsedOutput = {
508
+ ...output,
509
+ body: await parseErrorBody(output.body, context),
510
+ };
511
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
512
+ switch (errorCode) {
513
+ case "InternalServerException":
514
+ case "com.amazonaws.mwaa#InternalServerException":
515
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
516
+ case "ResourceNotFoundException":
517
+ case "com.amazonaws.mwaa#ResourceNotFoundException":
518
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
519
+ case "ValidationException":
520
+ case "com.amazonaws.mwaa#ValidationException":
521
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
522
+ default:
523
+ const parsedBody = parsedOutput.body;
524
+ throwDefaultError({
525
+ output,
526
+ parsedBody,
527
+ exceptionCtor: __BaseException,
528
+ errorCode,
529
+ });
530
+ }
531
+ };
532
+ export const deserializeAws_restJson1ListEnvironmentsCommand = async (output, context) => {
533
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
534
+ return deserializeAws_restJson1ListEnvironmentsCommandError(output, context);
535
+ }
536
+ const contents = map({
537
+ $metadata: deserializeMetadata(output),
898
538
  });
899
- }); };
900
- var deserializeAws_restJson1TagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
901
- var parsedOutput, _a, errorCode, _b, parsedBody;
902
- var _c;
903
- return __generator(this, function (_d) {
904
- switch (_d.label) {
905
- case 0:
906
- _a = [__assign({}, output)];
907
- _c = {};
908
- return [4, parseErrorBody(output.body, context)];
909
- case 1:
910
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
911
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
912
- _b = errorCode;
913
- switch (_b) {
914
- case "InternalServerException": return [3, 2];
915
- case "com.amazonaws.mwaa#InternalServerException": return [3, 2];
916
- case "ResourceNotFoundException": return [3, 4];
917
- case "com.amazonaws.mwaa#ResourceNotFoundException": return [3, 4];
918
- case "ValidationException": return [3, 6];
919
- case "com.amazonaws.mwaa#ValidationException": return [3, 6];
920
- }
921
- return [3, 8];
922
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
923
- case 3: throw _d.sent();
924
- case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
925
- case 5: throw _d.sent();
926
- case 6: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
927
- case 7: throw _d.sent();
928
- case 8:
929
- parsedBody = parsedOutput.body;
930
- throwDefaultError({
931
- output: output,
932
- parsedBody: parsedBody,
933
- exceptionCtor: __BaseException,
934
- errorCode: errorCode,
935
- });
936
- _d.label = 9;
937
- case 9: return [2];
938
- }
539
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
540
+ if (data.Environments != null) {
541
+ contents.Environments = deserializeAws_restJson1EnvironmentList(data.Environments, context);
542
+ }
543
+ if (data.NextToken != null) {
544
+ contents.NextToken = __expectString(data.NextToken);
545
+ }
546
+ return contents;
547
+ };
548
+ const deserializeAws_restJson1ListEnvironmentsCommandError = async (output, context) => {
549
+ const parsedOutput = {
550
+ ...output,
551
+ body: await parseErrorBody(output.body, context),
552
+ };
553
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
554
+ switch (errorCode) {
555
+ case "InternalServerException":
556
+ case "com.amazonaws.mwaa#InternalServerException":
557
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
558
+ case "ValidationException":
559
+ case "com.amazonaws.mwaa#ValidationException":
560
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
561
+ default:
562
+ const parsedBody = parsedOutput.body;
563
+ throwDefaultError({
564
+ output,
565
+ parsedBody,
566
+ exceptionCtor: __BaseException,
567
+ errorCode,
568
+ });
569
+ }
570
+ };
571
+ export const deserializeAws_restJson1ListTagsForResourceCommand = async (output, context) => {
572
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
573
+ return deserializeAws_restJson1ListTagsForResourceCommandError(output, context);
574
+ }
575
+ const contents = map({
576
+ $metadata: deserializeMetadata(output),
939
577
  });
940
- }); };
941
- export var deserializeAws_restJson1UntagResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
942
- var contents;
943
- return __generator(this, function (_a) {
944
- switch (_a.label) {
945
- case 0:
946
- if (output.statusCode !== 200 && output.statusCode >= 300) {
947
- return [2, deserializeAws_restJson1UntagResourceCommandError(output, context)];
948
- }
949
- contents = map({
950
- $metadata: deserializeMetadata(output),
951
- });
952
- return [4, collectBody(output.body, context)];
953
- case 1:
954
- _a.sent();
955
- return [2, contents];
956
- }
578
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
579
+ if (data.Tags != null) {
580
+ contents.Tags = deserializeAws_restJson1TagMap(data.Tags, context);
581
+ }
582
+ return contents;
583
+ };
584
+ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, context) => {
585
+ const parsedOutput = {
586
+ ...output,
587
+ body: await parseErrorBody(output.body, context),
588
+ };
589
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
590
+ switch (errorCode) {
591
+ case "InternalServerException":
592
+ case "com.amazonaws.mwaa#InternalServerException":
593
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
594
+ case "ResourceNotFoundException":
595
+ case "com.amazonaws.mwaa#ResourceNotFoundException":
596
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
597
+ case "ValidationException":
598
+ case "com.amazonaws.mwaa#ValidationException":
599
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
600
+ default:
601
+ const parsedBody = parsedOutput.body;
602
+ throwDefaultError({
603
+ output,
604
+ parsedBody,
605
+ exceptionCtor: __BaseException,
606
+ errorCode,
607
+ });
608
+ }
609
+ };
610
+ export const deserializeAws_restJson1PublishMetricsCommand = async (output, context) => {
611
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
612
+ return deserializeAws_restJson1PublishMetricsCommandError(output, context);
613
+ }
614
+ const contents = map({
615
+ $metadata: deserializeMetadata(output),
957
616
  });
958
- }); };
959
- var deserializeAws_restJson1UntagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
960
- var parsedOutput, _a, errorCode, _b, parsedBody;
961
- var _c;
962
- return __generator(this, function (_d) {
963
- switch (_d.label) {
964
- case 0:
965
- _a = [__assign({}, output)];
966
- _c = {};
967
- return [4, parseErrorBody(output.body, context)];
968
- case 1:
969
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
970
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
971
- _b = errorCode;
972
- switch (_b) {
973
- case "InternalServerException": return [3, 2];
974
- case "com.amazonaws.mwaa#InternalServerException": return [3, 2];
975
- case "ResourceNotFoundException": return [3, 4];
976
- case "com.amazonaws.mwaa#ResourceNotFoundException": return [3, 4];
977
- case "ValidationException": return [3, 6];
978
- case "com.amazonaws.mwaa#ValidationException": return [3, 6];
979
- }
980
- return [3, 8];
981
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
982
- case 3: throw _d.sent();
983
- case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
984
- case 5: throw _d.sent();
985
- case 6: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
986
- case 7: throw _d.sent();
987
- case 8:
988
- parsedBody = parsedOutput.body;
989
- throwDefaultError({
990
- output: output,
991
- parsedBody: parsedBody,
992
- exceptionCtor: __BaseException,
993
- errorCode: errorCode,
994
- });
995
- _d.label = 9;
996
- case 9: return [2];
997
- }
617
+ await collectBody(output.body, context);
618
+ return contents;
619
+ };
620
+ const deserializeAws_restJson1PublishMetricsCommandError = async (output, context) => {
621
+ const parsedOutput = {
622
+ ...output,
623
+ body: await parseErrorBody(output.body, context),
624
+ };
625
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
626
+ switch (errorCode) {
627
+ case "InternalServerException":
628
+ case "com.amazonaws.mwaa#InternalServerException":
629
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
630
+ case "ValidationException":
631
+ case "com.amazonaws.mwaa#ValidationException":
632
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
633
+ default:
634
+ const parsedBody = parsedOutput.body;
635
+ throwDefaultError({
636
+ output,
637
+ parsedBody,
638
+ exceptionCtor: __BaseException,
639
+ errorCode,
640
+ });
641
+ }
642
+ };
643
+ export const deserializeAws_restJson1TagResourceCommand = async (output, context) => {
644
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
645
+ return deserializeAws_restJson1TagResourceCommandError(output, context);
646
+ }
647
+ const contents = map({
648
+ $metadata: deserializeMetadata(output),
998
649
  });
999
- }); };
1000
- export var deserializeAws_restJson1UpdateEnvironmentCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1001
- var contents, data, _a, _b;
1002
- return __generator(this, function (_c) {
1003
- switch (_c.label) {
1004
- case 0:
1005
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1006
- return [2, deserializeAws_restJson1UpdateEnvironmentCommandError(output, context)];
1007
- }
1008
- contents = map({
1009
- $metadata: deserializeMetadata(output),
1010
- });
1011
- _a = __expectNonNull;
1012
- _b = __expectObject;
1013
- return [4, parseBody(output.body, context)];
1014
- case 1:
1015
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1016
- if (data.Arn != null) {
1017
- contents.Arn = __expectString(data.Arn);
1018
- }
1019
- return [2, contents];
1020
- }
650
+ await collectBody(output.body, context);
651
+ return contents;
652
+ };
653
+ const deserializeAws_restJson1TagResourceCommandError = async (output, context) => {
654
+ const parsedOutput = {
655
+ ...output,
656
+ body: await parseErrorBody(output.body, context),
657
+ };
658
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
659
+ switch (errorCode) {
660
+ case "InternalServerException":
661
+ case "com.amazonaws.mwaa#InternalServerException":
662
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
663
+ case "ResourceNotFoundException":
664
+ case "com.amazonaws.mwaa#ResourceNotFoundException":
665
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
666
+ case "ValidationException":
667
+ case "com.amazonaws.mwaa#ValidationException":
668
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
669
+ default:
670
+ const parsedBody = parsedOutput.body;
671
+ throwDefaultError({
672
+ output,
673
+ parsedBody,
674
+ exceptionCtor: __BaseException,
675
+ errorCode,
676
+ });
677
+ }
678
+ };
679
+ export const deserializeAws_restJson1UntagResourceCommand = async (output, context) => {
680
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
681
+ return deserializeAws_restJson1UntagResourceCommandError(output, context);
682
+ }
683
+ const contents = map({
684
+ $metadata: deserializeMetadata(output),
1021
685
  });
1022
- }); };
1023
- var deserializeAws_restJson1UpdateEnvironmentCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1024
- var parsedOutput, _a, errorCode, _b, parsedBody;
1025
- var _c;
1026
- return __generator(this, function (_d) {
1027
- switch (_d.label) {
1028
- case 0:
1029
- _a = [__assign({}, output)];
1030
- _c = {};
1031
- return [4, parseErrorBody(output.body, context)];
1032
- case 1:
1033
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1034
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1035
- _b = errorCode;
1036
- switch (_b) {
1037
- case "InternalServerException": return [3, 2];
1038
- case "com.amazonaws.mwaa#InternalServerException": return [3, 2];
1039
- case "ResourceNotFoundException": return [3, 4];
1040
- case "com.amazonaws.mwaa#ResourceNotFoundException": return [3, 4];
1041
- case "ValidationException": return [3, 6];
1042
- case "com.amazonaws.mwaa#ValidationException": return [3, 6];
1043
- }
1044
- return [3, 8];
1045
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
1046
- case 3: throw _d.sent();
1047
- case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1048
- case 5: throw _d.sent();
1049
- case 6: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1050
- case 7: throw _d.sent();
1051
- case 8:
1052
- parsedBody = parsedOutput.body;
1053
- throwDefaultError({
1054
- output: output,
1055
- parsedBody: parsedBody,
1056
- exceptionCtor: __BaseException,
1057
- errorCode: errorCode,
1058
- });
1059
- _d.label = 9;
1060
- case 9: return [2];
1061
- }
686
+ await collectBody(output.body, context);
687
+ return contents;
688
+ };
689
+ const deserializeAws_restJson1UntagResourceCommandError = async (output, context) => {
690
+ const parsedOutput = {
691
+ ...output,
692
+ body: await parseErrorBody(output.body, context),
693
+ };
694
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
695
+ switch (errorCode) {
696
+ case "InternalServerException":
697
+ case "com.amazonaws.mwaa#InternalServerException":
698
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
699
+ case "ResourceNotFoundException":
700
+ case "com.amazonaws.mwaa#ResourceNotFoundException":
701
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
702
+ case "ValidationException":
703
+ case "com.amazonaws.mwaa#ValidationException":
704
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
705
+ default:
706
+ const parsedBody = parsedOutput.body;
707
+ throwDefaultError({
708
+ output,
709
+ parsedBody,
710
+ exceptionCtor: __BaseException,
711
+ errorCode,
712
+ });
713
+ }
714
+ };
715
+ export const deserializeAws_restJson1UpdateEnvironmentCommand = async (output, context) => {
716
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
717
+ return deserializeAws_restJson1UpdateEnvironmentCommandError(output, context);
718
+ }
719
+ const contents = map({
720
+ $metadata: deserializeMetadata(output),
1062
721
  });
1063
- }); };
1064
- var map = __map;
1065
- var deserializeAws_restJson1AccessDeniedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1066
- var contents, data, exception;
1067
- return __generator(this, function (_a) {
1068
- contents = map({});
1069
- data = parsedOutput.body;
1070
- if (data.Message != null) {
1071
- contents.Message = __expectString(data.Message);
1072
- }
1073
- exception = new AccessDeniedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1074
- return [2, __decorateServiceException(exception, parsedOutput.body)];
722
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
723
+ if (data.Arn != null) {
724
+ contents.Arn = __expectString(data.Arn);
725
+ }
726
+ return contents;
727
+ };
728
+ const deserializeAws_restJson1UpdateEnvironmentCommandError = async (output, context) => {
729
+ const parsedOutput = {
730
+ ...output,
731
+ body: await parseErrorBody(output.body, context),
732
+ };
733
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
734
+ switch (errorCode) {
735
+ case "InternalServerException":
736
+ case "com.amazonaws.mwaa#InternalServerException":
737
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
738
+ case "ResourceNotFoundException":
739
+ case "com.amazonaws.mwaa#ResourceNotFoundException":
740
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
741
+ case "ValidationException":
742
+ case "com.amazonaws.mwaa#ValidationException":
743
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
744
+ default:
745
+ const parsedBody = parsedOutput.body;
746
+ throwDefaultError({
747
+ output,
748
+ parsedBody,
749
+ exceptionCtor: __BaseException,
750
+ errorCode,
751
+ });
752
+ }
753
+ };
754
+ const map = __map;
755
+ const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
756
+ const contents = map({});
757
+ const data = parsedOutput.body;
758
+ if (data.Message != null) {
759
+ contents.Message = __expectString(data.Message);
760
+ }
761
+ const exception = new AccessDeniedException({
762
+ $metadata: deserializeMetadata(parsedOutput),
763
+ ...contents,
1075
764
  });
1076
- }); };
1077
- var deserializeAws_restJson1InternalServerExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1078
- var contents, data, exception;
1079
- return __generator(this, function (_a) {
1080
- contents = map({});
1081
- data = parsedOutput.body;
1082
- if (data.message != null) {
1083
- contents.message = __expectString(data.message);
1084
- }
1085
- exception = new InternalServerException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1086
- return [2, __decorateServiceException(exception, parsedOutput.body)];
765
+ return __decorateServiceException(exception, parsedOutput.body);
766
+ };
767
+ const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOutput, context) => {
768
+ const contents = map({});
769
+ const data = parsedOutput.body;
770
+ if (data.message != null) {
771
+ contents.message = __expectString(data.message);
772
+ }
773
+ const exception = new InternalServerException({
774
+ $metadata: deserializeMetadata(parsedOutput),
775
+ ...contents,
1087
776
  });
1088
- }); };
1089
- var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1090
- var contents, data, exception;
1091
- return __generator(this, function (_a) {
1092
- contents = map({});
1093
- data = parsedOutput.body;
1094
- if (data.message != null) {
1095
- contents.message = __expectString(data.message);
1096
- }
1097
- exception = new ResourceNotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1098
- return [2, __decorateServiceException(exception, parsedOutput.body)];
777
+ return __decorateServiceException(exception, parsedOutput.body);
778
+ };
779
+ const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
780
+ const contents = map({});
781
+ const data = parsedOutput.body;
782
+ if (data.message != null) {
783
+ contents.message = __expectString(data.message);
784
+ }
785
+ const exception = new ResourceNotFoundException({
786
+ $metadata: deserializeMetadata(parsedOutput),
787
+ ...contents,
1099
788
  });
1100
- }); };
1101
- var deserializeAws_restJson1ValidationExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1102
- var contents, data, exception;
1103
- return __generator(this, function (_a) {
1104
- contents = map({});
1105
- data = parsedOutput.body;
1106
- if (data.message != null) {
1107
- contents.message = __expectString(data.message);
1108
- }
1109
- exception = new ValidationException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1110
- return [2, __decorateServiceException(exception, parsedOutput.body)];
789
+ return __decorateServiceException(exception, parsedOutput.body);
790
+ };
791
+ const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput, context) => {
792
+ const contents = map({});
793
+ const data = parsedOutput.body;
794
+ if (data.message != null) {
795
+ contents.message = __expectString(data.message);
796
+ }
797
+ const exception = new ValidationException({
798
+ $metadata: deserializeMetadata(parsedOutput),
799
+ ...contents,
1111
800
  });
1112
- }); };
1113
- var serializeAws_restJson1AirflowConfigurationOptions = function (input, context) {
1114
- return Object.entries(input).reduce(function (acc, _a) {
1115
- var _b;
1116
- var _c = __read(_a, 2), key = _c[0], value = _c[1];
801
+ return __decorateServiceException(exception, parsedOutput.body);
802
+ };
803
+ const serializeAws_restJson1AirflowConfigurationOptions = (input, context) => {
804
+ return Object.entries(input).reduce((acc, [key, value]) => {
1117
805
  if (value === null) {
1118
806
  return acc;
1119
807
  }
1120
- return __assign(__assign({}, acc), (_b = {}, _b[key] = value, _b));
808
+ return {
809
+ ...acc,
810
+ [key]: value,
811
+ };
1121
812
  }, {});
1122
813
  };
1123
- var serializeAws_restJson1Dimension = function (input, context) {
1124
- return __assign(__assign({}, (input.Name != null && { Name: input.Name })), (input.Value != null && { Value: input.Value }));
814
+ const serializeAws_restJson1Dimension = (input, context) => {
815
+ return {
816
+ ...(input.Name != null && { Name: input.Name }),
817
+ ...(input.Value != null && { Value: input.Value }),
818
+ };
1125
819
  };
1126
- var serializeAws_restJson1Dimensions = function (input, context) {
820
+ const serializeAws_restJson1Dimensions = (input, context) => {
1127
821
  return input
1128
- .filter(function (e) { return e != null; })
1129
- .map(function (entry) {
822
+ .filter((e) => e != null)
823
+ .map((entry) => {
1130
824
  return serializeAws_restJson1Dimension(entry, context);
1131
825
  });
1132
826
  };
1133
- var serializeAws_restJson1LoggingConfigurationInput = function (input, context) {
1134
- return __assign(__assign(__assign(__assign(__assign({}, (input.DagProcessingLogs != null && {
1135
- DagProcessingLogs: serializeAws_restJson1ModuleLoggingConfigurationInput(input.DagProcessingLogs, context),
1136
- })), (input.SchedulerLogs != null && {
1137
- SchedulerLogs: serializeAws_restJson1ModuleLoggingConfigurationInput(input.SchedulerLogs, context),
1138
- })), (input.TaskLogs != null && {
1139
- TaskLogs: serializeAws_restJson1ModuleLoggingConfigurationInput(input.TaskLogs, context),
1140
- })), (input.WebserverLogs != null && {
1141
- WebserverLogs: serializeAws_restJson1ModuleLoggingConfigurationInput(input.WebserverLogs, context),
1142
- })), (input.WorkerLogs != null && {
1143
- WorkerLogs: serializeAws_restJson1ModuleLoggingConfigurationInput(input.WorkerLogs, context),
1144
- }));
1145
- };
1146
- var serializeAws_restJson1MetricData = function (input, context) {
827
+ const serializeAws_restJson1LoggingConfigurationInput = (input, context) => {
828
+ return {
829
+ ...(input.DagProcessingLogs != null && {
830
+ DagProcessingLogs: serializeAws_restJson1ModuleLoggingConfigurationInput(input.DagProcessingLogs, context),
831
+ }),
832
+ ...(input.SchedulerLogs != null && {
833
+ SchedulerLogs: serializeAws_restJson1ModuleLoggingConfigurationInput(input.SchedulerLogs, context),
834
+ }),
835
+ ...(input.TaskLogs != null && {
836
+ TaskLogs: serializeAws_restJson1ModuleLoggingConfigurationInput(input.TaskLogs, context),
837
+ }),
838
+ ...(input.WebserverLogs != null && {
839
+ WebserverLogs: serializeAws_restJson1ModuleLoggingConfigurationInput(input.WebserverLogs, context),
840
+ }),
841
+ ...(input.WorkerLogs != null && {
842
+ WorkerLogs: serializeAws_restJson1ModuleLoggingConfigurationInput(input.WorkerLogs, context),
843
+ }),
844
+ };
845
+ };
846
+ const serializeAws_restJson1MetricData = (input, context) => {
1147
847
  return input
1148
- .filter(function (e) { return e != null; })
1149
- .map(function (entry) {
848
+ .filter((e) => e != null)
849
+ .map((entry) => {
1150
850
  return serializeAws_restJson1MetricDatum(entry, context);
1151
851
  });
1152
852
  };
1153
- var serializeAws_restJson1MetricDatum = function (input, context) {
1154
- return __assign(__assign(__assign(__assign(__assign(__assign({}, (input.Dimensions != null && { Dimensions: serializeAws_restJson1Dimensions(input.Dimensions, context) })), (input.MetricName != null && { MetricName: input.MetricName })), (input.StatisticValues != null && {
1155
- StatisticValues: serializeAws_restJson1StatisticSet(input.StatisticValues, context),
1156
- })), (input.Timestamp != null && { Timestamp: Math.round(input.Timestamp.getTime() / 1000) })), (input.Unit != null && { Unit: input.Unit })), (input.Value != null && { Value: __serializeFloat(input.Value) }));
853
+ const serializeAws_restJson1MetricDatum = (input, context) => {
854
+ return {
855
+ ...(input.Dimensions != null && { Dimensions: serializeAws_restJson1Dimensions(input.Dimensions, context) }),
856
+ ...(input.MetricName != null && { MetricName: input.MetricName }),
857
+ ...(input.StatisticValues != null && {
858
+ StatisticValues: serializeAws_restJson1StatisticSet(input.StatisticValues, context),
859
+ }),
860
+ ...(input.Timestamp != null && { Timestamp: Math.round(input.Timestamp.getTime() / 1000) }),
861
+ ...(input.Unit != null && { Unit: input.Unit }),
862
+ ...(input.Value != null && { Value: __serializeFloat(input.Value) }),
863
+ };
1157
864
  };
1158
- var serializeAws_restJson1ModuleLoggingConfigurationInput = function (input, context) {
1159
- return __assign(__assign({}, (input.Enabled != null && { Enabled: input.Enabled })), (input.LogLevel != null && { LogLevel: input.LogLevel }));
865
+ const serializeAws_restJson1ModuleLoggingConfigurationInput = (input, context) => {
866
+ return {
867
+ ...(input.Enabled != null && { Enabled: input.Enabled }),
868
+ ...(input.LogLevel != null && { LogLevel: input.LogLevel }),
869
+ };
1160
870
  };
1161
- var serializeAws_restJson1NetworkConfiguration = function (input, context) {
1162
- return __assign(__assign({}, (input.SecurityGroupIds != null && {
1163
- SecurityGroupIds: serializeAws_restJson1SecurityGroupList(input.SecurityGroupIds, context),
1164
- })), (input.SubnetIds != null && { SubnetIds: serializeAws_restJson1SubnetList(input.SubnetIds, context) }));
871
+ const serializeAws_restJson1NetworkConfiguration = (input, context) => {
872
+ return {
873
+ ...(input.SecurityGroupIds != null && {
874
+ SecurityGroupIds: serializeAws_restJson1SecurityGroupList(input.SecurityGroupIds, context),
875
+ }),
876
+ ...(input.SubnetIds != null && { SubnetIds: serializeAws_restJson1SubnetList(input.SubnetIds, context) }),
877
+ };
1165
878
  };
1166
- var serializeAws_restJson1SecurityGroupList = function (input, context) {
879
+ const serializeAws_restJson1SecurityGroupList = (input, context) => {
1167
880
  return input
1168
- .filter(function (e) { return e != null; })
1169
- .map(function (entry) {
881
+ .filter((e) => e != null)
882
+ .map((entry) => {
1170
883
  return entry;
1171
884
  });
1172
885
  };
1173
- var serializeAws_restJson1StatisticSet = function (input, context) {
1174
- return __assign(__assign(__assign(__assign({}, (input.Maximum != null && { Maximum: __serializeFloat(input.Maximum) })), (input.Minimum != null && { Minimum: __serializeFloat(input.Minimum) })), (input.SampleCount != null && { SampleCount: input.SampleCount })), (input.Sum != null && { Sum: __serializeFloat(input.Sum) }));
886
+ const serializeAws_restJson1StatisticSet = (input, context) => {
887
+ return {
888
+ ...(input.Maximum != null && { Maximum: __serializeFloat(input.Maximum) }),
889
+ ...(input.Minimum != null && { Minimum: __serializeFloat(input.Minimum) }),
890
+ ...(input.SampleCount != null && { SampleCount: input.SampleCount }),
891
+ ...(input.Sum != null && { Sum: __serializeFloat(input.Sum) }),
892
+ };
1175
893
  };
1176
- var serializeAws_restJson1SubnetList = function (input, context) {
894
+ const serializeAws_restJson1SubnetList = (input, context) => {
1177
895
  return input
1178
- .filter(function (e) { return e != null; })
1179
- .map(function (entry) {
896
+ .filter((e) => e != null)
897
+ .map((entry) => {
1180
898
  return entry;
1181
899
  });
1182
900
  };
1183
- var serializeAws_restJson1TagMap = function (input, context) {
1184
- return Object.entries(input).reduce(function (acc, _a) {
1185
- var _b;
1186
- var _c = __read(_a, 2), key = _c[0], value = _c[1];
901
+ const serializeAws_restJson1TagMap = (input, context) => {
902
+ return Object.entries(input).reduce((acc, [key, value]) => {
1187
903
  if (value === null) {
1188
904
  return acc;
1189
905
  }
1190
- return __assign(__assign({}, acc), (_b = {}, _b[key] = value, _b));
906
+ return {
907
+ ...acc,
908
+ [key]: value,
909
+ };
1191
910
  }, {});
1192
911
  };
1193
- var serializeAws_restJson1UpdateNetworkConfigurationInput = function (input, context) {
1194
- return __assign({}, (input.SecurityGroupIds != null && {
1195
- SecurityGroupIds: serializeAws_restJson1SecurityGroupList(input.SecurityGroupIds, context),
1196
- }));
912
+ const serializeAws_restJson1UpdateNetworkConfigurationInput = (input, context) => {
913
+ return {
914
+ ...(input.SecurityGroupIds != null && {
915
+ SecurityGroupIds: serializeAws_restJson1SecurityGroupList(input.SecurityGroupIds, context),
916
+ }),
917
+ };
1197
918
  };
1198
- var deserializeAws_restJson1AirflowConfigurationOptions = function (output, context) {
1199
- return Object.entries(output).reduce(function (acc, _a) {
1200
- var _b;
1201
- var _c = __read(_a, 2), key = _c[0], value = _c[1];
919
+ const deserializeAws_restJson1AirflowConfigurationOptions = (output, context) => {
920
+ return Object.entries(output).reduce((acc, [key, value]) => {
1202
921
  if (value === null) {
1203
922
  return acc;
1204
923
  }
1205
- return __assign(__assign({}, acc), (_b = {}, _b[key] = __expectString(value), _b));
924
+ return {
925
+ ...acc,
926
+ [key]: __expectString(value),
927
+ };
1206
928
  }, {});
1207
929
  };
1208
- var deserializeAws_restJson1Environment = function (output, context) {
930
+ const deserializeAws_restJson1Environment = (output, context) => {
1209
931
  return {
1210
932
  AirflowConfigurationOptions: output.AirflowConfigurationOptions != null
1211
933
  ? deserializeAws_restJson1AirflowConfigurationOptions(output.AirflowConfigurationOptions, context)
@@ -1241,10 +963,10 @@ var deserializeAws_restJson1Environment = function (output, context) {
1241
963
  WeeklyMaintenanceWindowStart: __expectString(output.WeeklyMaintenanceWindowStart),
1242
964
  };
1243
965
  };
1244
- var deserializeAws_restJson1EnvironmentList = function (output, context) {
1245
- var retVal = (output || [])
1246
- .filter(function (e) { return e != null; })
1247
- .map(function (entry) {
966
+ const deserializeAws_restJson1EnvironmentList = (output, context) => {
967
+ const retVal = (output || [])
968
+ .filter((e) => e != null)
969
+ .map((entry) => {
1248
970
  if (entry === null) {
1249
971
  return null;
1250
972
  }
@@ -1252,7 +974,7 @@ var deserializeAws_restJson1EnvironmentList = function (output, context) {
1252
974
  });
1253
975
  return retVal;
1254
976
  };
1255
- var deserializeAws_restJson1LastUpdate = function (output, context) {
977
+ const deserializeAws_restJson1LastUpdate = (output, context) => {
1256
978
  return {
1257
979
  CreatedAt: output.CreatedAt != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreatedAt))) : undefined,
1258
980
  Error: output.Error != null ? deserializeAws_restJson1UpdateError(output.Error, context) : undefined,
@@ -1260,7 +982,7 @@ var deserializeAws_restJson1LastUpdate = function (output, context) {
1260
982
  Status: __expectString(output.Status),
1261
983
  };
1262
984
  };
1263
- var deserializeAws_restJson1LoggingConfiguration = function (output, context) {
985
+ const deserializeAws_restJson1LoggingConfiguration = (output, context) => {
1264
986
  return {
1265
987
  DagProcessingLogs: output.DagProcessingLogs != null
1266
988
  ? deserializeAws_restJson1ModuleLoggingConfiguration(output.DagProcessingLogs, context)
@@ -1279,14 +1001,14 @@ var deserializeAws_restJson1LoggingConfiguration = function (output, context) {
1279
1001
  : undefined,
1280
1002
  };
1281
1003
  };
1282
- var deserializeAws_restJson1ModuleLoggingConfiguration = function (output, context) {
1004
+ const deserializeAws_restJson1ModuleLoggingConfiguration = (output, context) => {
1283
1005
  return {
1284
1006
  CloudWatchLogGroupArn: __expectString(output.CloudWatchLogGroupArn),
1285
1007
  Enabled: __expectBoolean(output.Enabled),
1286
1008
  LogLevel: __expectString(output.LogLevel),
1287
1009
  };
1288
1010
  };
1289
- var deserializeAws_restJson1NetworkConfiguration = function (output, context) {
1011
+ const deserializeAws_restJson1NetworkConfiguration = (output, context) => {
1290
1012
  return {
1291
1013
  SecurityGroupIds: output.SecurityGroupIds != null
1292
1014
  ? deserializeAws_restJson1SecurityGroupList(output.SecurityGroupIds, context)
@@ -1294,10 +1016,10 @@ var deserializeAws_restJson1NetworkConfiguration = function (output, context) {
1294
1016
  SubnetIds: output.SubnetIds != null ? deserializeAws_restJson1SubnetList(output.SubnetIds, context) : undefined,
1295
1017
  };
1296
1018
  };
1297
- var deserializeAws_restJson1SecurityGroupList = function (output, context) {
1298
- var retVal = (output || [])
1299
- .filter(function (e) { return e != null; })
1300
- .map(function (entry) {
1019
+ const deserializeAws_restJson1SecurityGroupList = (output, context) => {
1020
+ const retVal = (output || [])
1021
+ .filter((e) => e != null)
1022
+ .map((entry) => {
1301
1023
  if (entry === null) {
1302
1024
  return null;
1303
1025
  }
@@ -1305,10 +1027,10 @@ var deserializeAws_restJson1SecurityGroupList = function (output, context) {
1305
1027
  });
1306
1028
  return retVal;
1307
1029
  };
1308
- var deserializeAws_restJson1SubnetList = function (output, context) {
1309
- var retVal = (output || [])
1310
- .filter(function (e) { return e != null; })
1311
- .map(function (entry) {
1030
+ const deserializeAws_restJson1SubnetList = (output, context) => {
1031
+ const retVal = (output || [])
1032
+ .filter((e) => e != null)
1033
+ .map((entry) => {
1312
1034
  if (entry === null) {
1313
1035
  return null;
1314
1036
  }
@@ -1316,73 +1038,56 @@ var deserializeAws_restJson1SubnetList = function (output, context) {
1316
1038
  });
1317
1039
  return retVal;
1318
1040
  };
1319
- var deserializeAws_restJson1TagMap = function (output, context) {
1320
- return Object.entries(output).reduce(function (acc, _a) {
1321
- var _b;
1322
- var _c = __read(_a, 2), key = _c[0], value = _c[1];
1041
+ const deserializeAws_restJson1TagMap = (output, context) => {
1042
+ return Object.entries(output).reduce((acc, [key, value]) => {
1323
1043
  if (value === null) {
1324
1044
  return acc;
1325
1045
  }
1326
- return __assign(__assign({}, acc), (_b = {}, _b[key] = __expectString(value), _b));
1046
+ return {
1047
+ ...acc,
1048
+ [key]: __expectString(value),
1049
+ };
1327
1050
  }, {});
1328
1051
  };
1329
- var deserializeAws_restJson1UpdateError = function (output, context) {
1052
+ const deserializeAws_restJson1UpdateError = (output, context) => {
1330
1053
  return {
1331
1054
  ErrorCode: __expectString(output.ErrorCode),
1332
1055
  ErrorMessage: __expectString(output.ErrorMessage),
1333
1056
  };
1334
1057
  };
1335
- var deserializeMetadata = function (output) {
1336
- var _a, _b;
1337
- return ({
1338
- httpStatusCode: output.statusCode,
1339
- requestId: (_b = (_a = output.headers["x-amzn-requestid"]) !== null && _a !== void 0 ? _a : output.headers["x-amzn-request-id"]) !== null && _b !== void 0 ? _b : output.headers["x-amz-request-id"],
1340
- extendedRequestId: output.headers["x-amz-id-2"],
1341
- cfId: output.headers["x-amz-cf-id"],
1342
- });
1343
- };
1344
- var collectBody = function (streamBody, context) {
1345
- if (streamBody === void 0) { streamBody = new Uint8Array(); }
1058
+ const deserializeMetadata = (output) => ({
1059
+ httpStatusCode: output.statusCode,
1060
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
1061
+ extendedRequestId: output.headers["x-amz-id-2"],
1062
+ cfId: output.headers["x-amz-cf-id"],
1063
+ });
1064
+ const collectBody = (streamBody = new Uint8Array(), context) => {
1346
1065
  if (streamBody instanceof Uint8Array) {
1347
1066
  return Promise.resolve(streamBody);
1348
1067
  }
1349
1068
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
1350
1069
  };
1351
- var collectBodyString = function (streamBody, context) {
1352
- return collectBody(streamBody, context).then(function (body) { return context.utf8Encoder(body); });
1353
- };
1354
- var isSerializableHeaderValue = function (value) {
1355
- return value !== undefined &&
1356
- value !== null &&
1357
- value !== "" &&
1358
- (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
1359
- (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
1360
- };
1361
- var parseBody = function (streamBody, context) {
1362
- return collectBodyString(streamBody, context).then(function (encoded) {
1363
- if (encoded.length) {
1364
- return JSON.parse(encoded);
1365
- }
1366
- return {};
1367
- });
1070
+ const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
1071
+ const isSerializableHeaderValue = (value) => value !== undefined &&
1072
+ value !== null &&
1073
+ value !== "" &&
1074
+ (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
1075
+ (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
1076
+ const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1077
+ if (encoded.length) {
1078
+ return JSON.parse(encoded);
1079
+ }
1080
+ return {};
1081
+ });
1082
+ const parseErrorBody = async (errorBody, context) => {
1083
+ const value = await parseBody(errorBody, context);
1084
+ value.message = value.message ?? value.Message;
1085
+ return value;
1368
1086
  };
1369
- var parseErrorBody = function (errorBody, context) { return __awaiter(void 0, void 0, void 0, function () {
1370
- var value;
1371
- var _a;
1372
- return __generator(this, function (_b) {
1373
- switch (_b.label) {
1374
- case 0: return [4, parseBody(errorBody, context)];
1375
- case 1:
1376
- value = _b.sent();
1377
- value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message;
1378
- return [2, value];
1379
- }
1380
- });
1381
- }); };
1382
- var loadRestJsonErrorCode = function (output, data) {
1383
- var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
1384
- var sanitizeErrorCode = function (rawValue) {
1385
- var cleanValue = rawValue;
1087
+ const loadRestJsonErrorCode = (output, data) => {
1088
+ const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
1089
+ const sanitizeErrorCode = (rawValue) => {
1090
+ let cleanValue = rawValue;
1386
1091
  if (typeof cleanValue === "number") {
1387
1092
  cleanValue = cleanValue.toString();
1388
1093
  }
@@ -1397,7 +1102,7 @@ var loadRestJsonErrorCode = function (output, data) {
1397
1102
  }
1398
1103
  return cleanValue;
1399
1104
  };
1400
- var headerKey = findKey(output.headers, "x-amzn-errortype");
1105
+ const headerKey = findKey(output.headers, "x-amzn-errortype");
1401
1106
  if (headerKey !== undefined) {
1402
1107
  return sanitizeErrorCode(output.headers[headerKey]);
1403
1108
  }