@aws-sdk/client-fis 3.183.0 → 3.185.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist-cjs/protocols/Aws_restJson1.js +2 -2
  3. package/dist-es/Fis.js +73 -66
  4. package/dist-es/FisClient.js +28 -22
  5. package/dist-es/commands/CreateExperimentTemplateCommand.js +28 -21
  6. package/dist-es/commands/DeleteExperimentTemplateCommand.js +28 -21
  7. package/dist-es/commands/GetActionCommand.js +28 -21
  8. package/dist-es/commands/GetExperimentCommand.js +28 -21
  9. package/dist-es/commands/GetExperimentTemplateCommand.js +28 -21
  10. package/dist-es/commands/GetTargetResourceTypeCommand.js +28 -21
  11. package/dist-es/commands/ListActionsCommand.js +28 -21
  12. package/dist-es/commands/ListExperimentTemplatesCommand.js +28 -21
  13. package/dist-es/commands/ListExperimentsCommand.js +28 -21
  14. package/dist-es/commands/ListTagsForResourceCommand.js +28 -21
  15. package/dist-es/commands/ListTargetResourceTypesCommand.js +28 -21
  16. package/dist-es/commands/StartExperimentCommand.js +28 -21
  17. package/dist-es/commands/StopExperimentCommand.js +28 -21
  18. package/dist-es/commands/TagResourceCommand.js +28 -21
  19. package/dist-es/commands/UntagResourceCommand.js +28 -21
  20. package/dist-es/commands/UpdateExperimentTemplateCommand.js +28 -21
  21. package/dist-es/endpoints.js +8 -8
  22. package/dist-es/models/FisServiceException.js +10 -5
  23. package/dist-es/models/models_0.js +115 -254
  24. package/dist-es/pagination/ListActionsPaginator.js +68 -25
  25. package/dist-es/pagination/ListExperimentTemplatesPaginator.js +68 -25
  26. package/dist-es/pagination/ListExperimentsPaginator.js +68 -25
  27. package/dist-es/pagination/ListTargetResourceTypesPaginator.js +68 -25
  28. package/dist-es/protocols/Aws_restJson1.js +1666 -1275
  29. package/dist-es/runtimeConfig.browser.js +12 -26
  30. package/dist-es/runtimeConfig.js +12 -30
  31. package/dist-es/runtimeConfig.native.js +5 -8
  32. package/dist-es/runtimeConfig.shared.js +11 -8
  33. package/package.json +5 -5
@@ -1,1185 +1,1572 @@
1
+ import { __assign, __awaiter, __generator, __read } from "tslib";
1
2
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
2
3
  import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, map as __map, parseEpochTimestamp as __parseEpochTimestamp, resolvedPath as __resolvedPath, throwDefaultError, } from "@aws-sdk/smithy-client";
3
4
  import { v4 as generateIdempotencyToken } from "uuid";
4
5
  import { FisServiceException as __BaseException } from "../models/FisServiceException";
5
6
  import { ConflictException, ResourceNotFoundException, ServiceQuotaExceededException, ValidationException, } from "../models/models_0";
6
- export const serializeAws_restJson1CreateExperimentTemplateCommand = async (input, context) => {
7
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
8
- const headers = {
9
- "content-type": "application/json",
10
- };
11
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/experimentTemplates";
12
- let body;
13
- body = JSON.stringify({
14
- ...(input.actions != null && {
15
- actions: serializeAws_restJson1CreateExperimentTemplateActionInputMap(input.actions, context),
16
- }),
17
- clientToken: input.clientToken ?? generateIdempotencyToken(),
18
- ...(input.description != null && { description: input.description }),
19
- ...(input.logConfiguration != null && {
20
- logConfiguration: serializeAws_restJson1CreateExperimentTemplateLogConfigurationInput(input.logConfiguration, context),
21
- }),
22
- ...(input.roleArn != null && { roleArn: input.roleArn }),
23
- ...(input.stopConditions != null && {
24
- stopConditions: serializeAws_restJson1CreateExperimentTemplateStopConditionInputList(input.stopConditions, context),
25
- }),
26
- ...(input.tags != null && { tags: serializeAws_restJson1TagMap(input.tags, context) }),
27
- ...(input.targets != null && {
28
- targets: serializeAws_restJson1CreateExperimentTemplateTargetInputMap(input.targets, context),
29
- }),
30
- });
31
- return new __HttpRequest({
32
- protocol,
33
- hostname,
34
- port,
35
- method: "POST",
36
- headers,
37
- path: resolvedPath,
38
- body,
39
- });
40
- };
41
- export const serializeAws_restJson1DeleteExperimentTemplateCommand = async (input, context) => {
42
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
43
- const headers = {};
44
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/experimentTemplates/{id}";
45
- resolvedPath = __resolvedPath(resolvedPath, input, "id", () => input.id, "{id}", false);
46
- let body;
47
- return new __HttpRequest({
48
- protocol,
49
- hostname,
50
- port,
51
- method: "DELETE",
52
- headers,
53
- path: resolvedPath,
54
- body,
55
- });
56
- };
57
- export const serializeAws_restJson1GetActionCommand = async (input, context) => {
58
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
59
- const headers = {};
60
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/actions/{id}";
61
- resolvedPath = __resolvedPath(resolvedPath, input, "id", () => input.id, "{id}", false);
62
- let body;
63
- return new __HttpRequest({
64
- protocol,
65
- hostname,
66
- port,
67
- method: "GET",
68
- headers,
69
- path: resolvedPath,
70
- body,
71
- });
72
- };
73
- export const serializeAws_restJson1GetExperimentCommand = async (input, context) => {
74
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
75
- const headers = {};
76
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/experiments/{id}";
77
- resolvedPath = __resolvedPath(resolvedPath, input, "id", () => input.id, "{id}", false);
78
- let body;
79
- return new __HttpRequest({
80
- protocol,
81
- hostname,
82
- port,
83
- method: "GET",
84
- headers,
85
- path: resolvedPath,
86
- body,
87
- });
88
- };
89
- export const serializeAws_restJson1GetExperimentTemplateCommand = async (input, context) => {
90
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
91
- const headers = {};
92
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/experimentTemplates/{id}";
93
- resolvedPath = __resolvedPath(resolvedPath, input, "id", () => input.id, "{id}", false);
94
- let body;
95
- return new __HttpRequest({
96
- protocol,
97
- hostname,
98
- port,
99
- method: "GET",
100
- headers,
101
- path: resolvedPath,
102
- body,
103
- });
104
- };
105
- export const serializeAws_restJson1GetTargetResourceTypeCommand = async (input, context) => {
106
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
107
- const headers = {};
108
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/targetResourceTypes/{resourceType}";
109
- resolvedPath = __resolvedPath(resolvedPath, input, "resourceType", () => input.resourceType, "{resourceType}", false);
110
- let body;
111
- return new __HttpRequest({
112
- protocol,
113
- hostname,
114
- port,
115
- method: "GET",
116
- headers,
117
- path: resolvedPath,
118
- body,
119
- });
120
- };
121
- export const serializeAws_restJson1ListActionsCommand = async (input, context) => {
122
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
123
- const headers = {};
124
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/actions";
125
- const query = map({
126
- maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
127
- nextToken: [, input.nextToken],
128
- });
129
- let body;
130
- return new __HttpRequest({
131
- protocol,
132
- hostname,
133
- port,
134
- method: "GET",
135
- headers,
136
- path: resolvedPath,
137
- query,
138
- body,
139
- });
140
- };
141
- export const serializeAws_restJson1ListExperimentsCommand = async (input, context) => {
142
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
143
- const headers = {};
144
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/experiments";
145
- const query = map({
146
- maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
147
- nextToken: [, input.nextToken],
148
- });
149
- let body;
150
- return new __HttpRequest({
151
- protocol,
152
- hostname,
153
- port,
154
- method: "GET",
155
- headers,
156
- path: resolvedPath,
157
- query,
158
- body,
159
- });
160
- };
161
- export const serializeAws_restJson1ListExperimentTemplatesCommand = async (input, context) => {
162
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
163
- const headers = {};
164
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/experimentTemplates";
165
- const query = map({
166
- maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
167
- nextToken: [, input.nextToken],
168
- });
169
- let body;
170
- return new __HttpRequest({
171
- protocol,
172
- hostname,
173
- port,
174
- method: "GET",
175
- headers,
176
- path: resolvedPath,
177
- query,
178
- body,
179
- });
180
- };
181
- export const serializeAws_restJson1ListTagsForResourceCommand = async (input, context) => {
182
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
183
- const headers = {};
184
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
185
- resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
186
- let body;
187
- return new __HttpRequest({
188
- protocol,
189
- hostname,
190
- port,
191
- method: "GET",
192
- headers,
193
- path: resolvedPath,
194
- body,
195
- });
196
- };
197
- export const serializeAws_restJson1ListTargetResourceTypesCommand = async (input, context) => {
198
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
199
- const headers = {};
200
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/targetResourceTypes";
201
- const query = map({
202
- maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
203
- nextToken: [, input.nextToken],
204
- });
205
- let body;
206
- return new __HttpRequest({
207
- protocol,
208
- hostname,
209
- port,
210
- method: "GET",
211
- headers,
212
- path: resolvedPath,
213
- query,
214
- body,
215
- });
216
- };
217
- export const serializeAws_restJson1StartExperimentCommand = async (input, context) => {
218
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
219
- const headers = {
220
- "content-type": "application/json",
221
- };
222
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/experiments";
223
- let body;
224
- body = JSON.stringify({
225
- clientToken: input.clientToken ?? generateIdempotencyToken(),
226
- ...(input.experimentTemplateId != null && { experimentTemplateId: input.experimentTemplateId }),
227
- ...(input.tags != null && { tags: serializeAws_restJson1TagMap(input.tags, context) }),
228
- });
229
- return new __HttpRequest({
230
- protocol,
231
- hostname,
232
- port,
233
- method: "POST",
234
- headers,
235
- path: resolvedPath,
236
- body,
237
- });
238
- };
239
- export const serializeAws_restJson1StopExperimentCommand = async (input, context) => {
240
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
241
- const headers = {};
242
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/experiments/{id}";
243
- resolvedPath = __resolvedPath(resolvedPath, input, "id", () => input.id, "{id}", false);
244
- let body;
245
- return new __HttpRequest({
246
- protocol,
247
- hostname,
248
- port,
249
- method: "DELETE",
250
- headers,
251
- path: resolvedPath,
252
- body,
253
- });
254
- };
255
- export const serializeAws_restJson1TagResourceCommand = async (input, context) => {
256
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
257
- const headers = {
258
- "content-type": "application/json",
259
- };
260
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
261
- resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
262
- let body;
263
- body = JSON.stringify({
264
- ...(input.tags != null && { tags: serializeAws_restJson1TagMap(input.tags, context) }),
265
- });
266
- return new __HttpRequest({
267
- protocol,
268
- hostname,
269
- port,
270
- method: "POST",
271
- headers,
272
- path: resolvedPath,
273
- body,
274
- });
275
- };
276
- export const serializeAws_restJson1UntagResourceCommand = async (input, context) => {
277
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
278
- const headers = {};
279
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
280
- resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
281
- const query = map({
282
- tagKeys: [() => input.tagKeys !== void 0, () => (input.tagKeys || []).map((_entry) => _entry)],
283
- });
284
- let body;
285
- return new __HttpRequest({
286
- protocol,
287
- hostname,
288
- port,
289
- method: "DELETE",
290
- headers,
291
- path: resolvedPath,
292
- query,
293
- body,
294
- });
295
- };
296
- export const serializeAws_restJson1UpdateExperimentTemplateCommand = async (input, context) => {
297
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
298
- const headers = {
299
- "content-type": "application/json",
300
- };
301
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/experimentTemplates/{id}";
302
- resolvedPath = __resolvedPath(resolvedPath, input, "id", () => input.id, "{id}", false);
303
- let body;
304
- body = JSON.stringify({
305
- ...(input.actions != null && {
306
- actions: serializeAws_restJson1UpdateExperimentTemplateActionInputMap(input.actions, context),
307
- }),
308
- ...(input.description != null && { description: input.description }),
309
- ...(input.logConfiguration != null && {
310
- logConfiguration: serializeAws_restJson1UpdateExperimentTemplateLogConfigurationInput(input.logConfiguration, context),
311
- }),
312
- ...(input.roleArn != null && { roleArn: input.roleArn }),
313
- ...(input.stopConditions != null && {
314
- stopConditions: serializeAws_restJson1UpdateExperimentTemplateStopConditionInputList(input.stopConditions, context),
315
- }),
316
- ...(input.targets != null && {
317
- targets: serializeAws_restJson1UpdateExperimentTemplateTargetInputMap(input.targets, context),
318
- }),
319
- });
320
- return new __HttpRequest({
321
- protocol,
322
- hostname,
323
- port,
324
- method: "PATCH",
325
- headers,
326
- path: resolvedPath,
327
- body,
328
- });
329
- };
330
- export const deserializeAws_restJson1CreateExperimentTemplateCommand = async (output, context) => {
331
- if (output.statusCode !== 200 && output.statusCode >= 300) {
332
- return deserializeAws_restJson1CreateExperimentTemplateCommandError(output, context);
333
- }
334
- const contents = map({
335
- $metadata: deserializeMetadata(output),
7
+ export var serializeAws_restJson1CreateExperimentTemplateCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
8
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
9
+ var _c;
10
+ return __generator(this, function (_d) {
11
+ switch (_d.label) {
12
+ case 0: return [4, context.endpoint()];
13
+ case 1:
14
+ _a = _d.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
15
+ headers = {
16
+ "content-type": "application/json",
17
+ };
18
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/experimentTemplates";
19
+ body = JSON.stringify(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.actions != null && {
20
+ actions: serializeAws_restJson1CreateExperimentTemplateActionInputMap(input.actions, context),
21
+ })), { clientToken: (_c = input.clientToken) !== null && _c !== void 0 ? _c : generateIdempotencyToken() }), (input.description != null && { description: input.description })), (input.logConfiguration != null && {
22
+ logConfiguration: serializeAws_restJson1CreateExperimentTemplateLogConfigurationInput(input.logConfiguration, context),
23
+ })), (input.roleArn != null && { roleArn: input.roleArn })), (input.stopConditions != null && {
24
+ stopConditions: serializeAws_restJson1CreateExperimentTemplateStopConditionInputList(input.stopConditions, context),
25
+ })), (input.tags != null && { tags: serializeAws_restJson1TagMap(input.tags, context) })), (input.targets != null && {
26
+ targets: serializeAws_restJson1CreateExperimentTemplateTargetInputMap(input.targets, context),
27
+ })));
28
+ return [2, new __HttpRequest({
29
+ protocol: protocol,
30
+ hostname: hostname,
31
+ port: port,
32
+ method: "POST",
33
+ headers: headers,
34
+ path: resolvedPath,
35
+ body: body,
36
+ })];
37
+ }
336
38
  });
337
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
338
- if (data.experimentTemplate != null) {
339
- contents.experimentTemplate = deserializeAws_restJson1ExperimentTemplate(data.experimentTemplate, context);
340
- }
341
- return contents;
342
- };
343
- const deserializeAws_restJson1CreateExperimentTemplateCommandError = async (output, context) => {
344
- const parsedOutput = {
345
- ...output,
346
- body: await parseErrorBody(output.body, context),
347
- };
348
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
349
- switch (errorCode) {
350
- case "ConflictException":
351
- case "com.amazonaws.fis#ConflictException":
352
- throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
353
- case "ResourceNotFoundException":
354
- case "com.amazonaws.fis#ResourceNotFoundException":
355
- throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
356
- case "ServiceQuotaExceededException":
357
- case "com.amazonaws.fis#ServiceQuotaExceededException":
358
- throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
359
- case "ValidationException":
360
- case "com.amazonaws.fis#ValidationException":
361
- throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
362
- default:
363
- const parsedBody = parsedOutput.body;
364
- throwDefaultError({
365
- output,
366
- parsedBody,
367
- exceptionCtor: __BaseException,
368
- errorCode,
369
- });
370
- }
371
- };
372
- export const deserializeAws_restJson1DeleteExperimentTemplateCommand = async (output, context) => {
373
- if (output.statusCode !== 200 && output.statusCode >= 300) {
374
- return deserializeAws_restJson1DeleteExperimentTemplateCommandError(output, context);
375
- }
376
- const contents = map({
377
- $metadata: deserializeMetadata(output),
39
+ }); };
40
+ export var serializeAws_restJson1DeleteExperimentTemplateCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
41
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
42
+ return __generator(this, function (_c) {
43
+ switch (_c.label) {
44
+ case 0: return [4, context.endpoint()];
45
+ case 1:
46
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
47
+ headers = {};
48
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/experimentTemplates/{id}";
49
+ resolvedPath = __resolvedPath(resolvedPath, input, "id", function () { return input.id; }, "{id}", false);
50
+ return [2, new __HttpRequest({
51
+ protocol: protocol,
52
+ hostname: hostname,
53
+ port: port,
54
+ method: "DELETE",
55
+ headers: headers,
56
+ path: resolvedPath,
57
+ body: body,
58
+ })];
59
+ }
378
60
  });
379
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
380
- if (data.experimentTemplate != null) {
381
- contents.experimentTemplate = deserializeAws_restJson1ExperimentTemplate(data.experimentTemplate, context);
382
- }
383
- return contents;
384
- };
385
- const deserializeAws_restJson1DeleteExperimentTemplateCommandError = async (output, context) => {
386
- const parsedOutput = {
387
- ...output,
388
- body: await parseErrorBody(output.body, context),
389
- };
390
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
391
- switch (errorCode) {
392
- case "ResourceNotFoundException":
393
- case "com.amazonaws.fis#ResourceNotFoundException":
394
- throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
395
- case "ValidationException":
396
- case "com.amazonaws.fis#ValidationException":
397
- throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
398
- default:
399
- const parsedBody = parsedOutput.body;
400
- throwDefaultError({
401
- output,
402
- parsedBody,
403
- exceptionCtor: __BaseException,
404
- errorCode,
405
- });
406
- }
407
- };
408
- export const deserializeAws_restJson1GetActionCommand = async (output, context) => {
409
- if (output.statusCode !== 200 && output.statusCode >= 300) {
410
- return deserializeAws_restJson1GetActionCommandError(output, context);
411
- }
412
- const contents = map({
413
- $metadata: deserializeMetadata(output),
61
+ }); };
62
+ export var serializeAws_restJson1GetActionCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
63
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
64
+ return __generator(this, function (_c) {
65
+ switch (_c.label) {
66
+ case 0: return [4, context.endpoint()];
67
+ case 1:
68
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
69
+ headers = {};
70
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/actions/{id}";
71
+ resolvedPath = __resolvedPath(resolvedPath, input, "id", function () { return input.id; }, "{id}", false);
72
+ return [2, new __HttpRequest({
73
+ protocol: protocol,
74
+ hostname: hostname,
75
+ port: port,
76
+ method: "GET",
77
+ headers: headers,
78
+ path: resolvedPath,
79
+ body: body,
80
+ })];
81
+ }
414
82
  });
415
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
416
- if (data.action != null) {
417
- contents.action = deserializeAws_restJson1Action(data.action, context);
418
- }
419
- return contents;
420
- };
421
- const deserializeAws_restJson1GetActionCommandError = async (output, context) => {
422
- const parsedOutput = {
423
- ...output,
424
- body: await parseErrorBody(output.body, context),
425
- };
426
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
427
- switch (errorCode) {
428
- case "ResourceNotFoundException":
429
- case "com.amazonaws.fis#ResourceNotFoundException":
430
- throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
431
- case "ValidationException":
432
- case "com.amazonaws.fis#ValidationException":
433
- throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
434
- default:
435
- const parsedBody = parsedOutput.body;
436
- throwDefaultError({
437
- output,
438
- parsedBody,
439
- exceptionCtor: __BaseException,
440
- errorCode,
441
- });
442
- }
443
- };
444
- export const deserializeAws_restJson1GetExperimentCommand = async (output, context) => {
445
- if (output.statusCode !== 200 && output.statusCode >= 300) {
446
- return deserializeAws_restJson1GetExperimentCommandError(output, context);
447
- }
448
- const contents = map({
449
- $metadata: deserializeMetadata(output),
83
+ }); };
84
+ export var serializeAws_restJson1GetExperimentCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
85
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
86
+ return __generator(this, function (_c) {
87
+ switch (_c.label) {
88
+ case 0: return [4, context.endpoint()];
89
+ case 1:
90
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
91
+ headers = {};
92
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/experiments/{id}";
93
+ resolvedPath = __resolvedPath(resolvedPath, input, "id", function () { return input.id; }, "{id}", false);
94
+ return [2, new __HttpRequest({
95
+ protocol: protocol,
96
+ hostname: hostname,
97
+ port: port,
98
+ method: "GET",
99
+ headers: headers,
100
+ path: resolvedPath,
101
+ body: body,
102
+ })];
103
+ }
450
104
  });
451
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
452
- if (data.experiment != null) {
453
- contents.experiment = deserializeAws_restJson1Experiment(data.experiment, context);
454
- }
455
- return contents;
456
- };
457
- const deserializeAws_restJson1GetExperimentCommandError = async (output, context) => {
458
- const parsedOutput = {
459
- ...output,
460
- body: await parseErrorBody(output.body, context),
461
- };
462
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
463
- switch (errorCode) {
464
- case "ResourceNotFoundException":
465
- case "com.amazonaws.fis#ResourceNotFoundException":
466
- throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
467
- case "ValidationException":
468
- case "com.amazonaws.fis#ValidationException":
469
- throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
470
- default:
471
- const parsedBody = parsedOutput.body;
472
- throwDefaultError({
473
- output,
474
- parsedBody,
475
- exceptionCtor: __BaseException,
476
- errorCode,
477
- });
478
- }
479
- };
480
- export const deserializeAws_restJson1GetExperimentTemplateCommand = async (output, context) => {
481
- if (output.statusCode !== 200 && output.statusCode >= 300) {
482
- return deserializeAws_restJson1GetExperimentTemplateCommandError(output, context);
483
- }
484
- const contents = map({
485
- $metadata: deserializeMetadata(output),
105
+ }); };
106
+ export var serializeAws_restJson1GetExperimentTemplateCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
107
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
108
+ return __generator(this, function (_c) {
109
+ switch (_c.label) {
110
+ case 0: return [4, context.endpoint()];
111
+ case 1:
112
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
113
+ headers = {};
114
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/experimentTemplates/{id}";
115
+ resolvedPath = __resolvedPath(resolvedPath, input, "id", function () { return input.id; }, "{id}", false);
116
+ return [2, new __HttpRequest({
117
+ protocol: protocol,
118
+ hostname: hostname,
119
+ port: port,
120
+ method: "GET",
121
+ headers: headers,
122
+ path: resolvedPath,
123
+ body: body,
124
+ })];
125
+ }
486
126
  });
487
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
488
- if (data.experimentTemplate != null) {
489
- contents.experimentTemplate = deserializeAws_restJson1ExperimentTemplate(data.experimentTemplate, context);
490
- }
491
- return contents;
492
- };
493
- const deserializeAws_restJson1GetExperimentTemplateCommandError = async (output, context) => {
494
- const parsedOutput = {
495
- ...output,
496
- body: await parseErrorBody(output.body, context),
497
- };
498
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
499
- switch (errorCode) {
500
- case "ResourceNotFoundException":
501
- case "com.amazonaws.fis#ResourceNotFoundException":
502
- throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
503
- case "ValidationException":
504
- case "com.amazonaws.fis#ValidationException":
505
- throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
506
- default:
507
- const parsedBody = parsedOutput.body;
508
- throwDefaultError({
509
- output,
510
- parsedBody,
511
- exceptionCtor: __BaseException,
512
- errorCode,
513
- });
514
- }
515
- };
516
- export const deserializeAws_restJson1GetTargetResourceTypeCommand = async (output, context) => {
517
- if (output.statusCode !== 200 && output.statusCode >= 300) {
518
- return deserializeAws_restJson1GetTargetResourceTypeCommandError(output, context);
519
- }
520
- const contents = map({
521
- $metadata: deserializeMetadata(output),
127
+ }); };
128
+ export var serializeAws_restJson1GetTargetResourceTypeCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
129
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
130
+ return __generator(this, function (_c) {
131
+ switch (_c.label) {
132
+ case 0: return [4, context.endpoint()];
133
+ case 1:
134
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
135
+ headers = {};
136
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/targetResourceTypes/{resourceType}";
137
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceType", function () { return input.resourceType; }, "{resourceType}", false);
138
+ return [2, new __HttpRequest({
139
+ protocol: protocol,
140
+ hostname: hostname,
141
+ port: port,
142
+ method: "GET",
143
+ headers: headers,
144
+ path: resolvedPath,
145
+ body: body,
146
+ })];
147
+ }
522
148
  });
523
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
524
- if (data.targetResourceType != null) {
525
- contents.targetResourceType = deserializeAws_restJson1TargetResourceType(data.targetResourceType, context);
526
- }
527
- return contents;
528
- };
529
- const deserializeAws_restJson1GetTargetResourceTypeCommandError = async (output, context) => {
530
- const parsedOutput = {
531
- ...output,
532
- body: await parseErrorBody(output.body, context),
533
- };
534
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
535
- switch (errorCode) {
536
- case "ResourceNotFoundException":
537
- case "com.amazonaws.fis#ResourceNotFoundException":
538
- throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
539
- case "ValidationException":
540
- case "com.amazonaws.fis#ValidationException":
541
- throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
542
- default:
543
- const parsedBody = parsedOutput.body;
544
- throwDefaultError({
545
- output,
546
- parsedBody,
547
- exceptionCtor: __BaseException,
548
- errorCode,
549
- });
550
- }
551
- };
552
- export const deserializeAws_restJson1ListActionsCommand = async (output, context) => {
553
- if (output.statusCode !== 200 && output.statusCode >= 300) {
554
- return deserializeAws_restJson1ListActionsCommandError(output, context);
555
- }
556
- const contents = map({
557
- $metadata: deserializeMetadata(output),
149
+ }); };
150
+ export var serializeAws_restJson1ListActionsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
151
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
152
+ return __generator(this, function (_c) {
153
+ switch (_c.label) {
154
+ case 0: return [4, context.endpoint()];
155
+ case 1:
156
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
157
+ headers = {};
158
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/actions";
159
+ query = map({
160
+ maxResults: [function () { return input.maxResults !== void 0; }, function () { return input.maxResults.toString(); }],
161
+ nextToken: [, input.nextToken],
162
+ });
163
+ return [2, new __HttpRequest({
164
+ protocol: protocol,
165
+ hostname: hostname,
166
+ port: port,
167
+ method: "GET",
168
+ headers: headers,
169
+ path: resolvedPath,
170
+ query: query,
171
+ body: body,
172
+ })];
173
+ }
558
174
  });
559
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
560
- if (data.actions != null) {
561
- contents.actions = deserializeAws_restJson1ActionSummaryList(data.actions, context);
562
- }
563
- if (data.nextToken != null) {
564
- contents.nextToken = __expectString(data.nextToken);
565
- }
566
- return contents;
567
- };
568
- const deserializeAws_restJson1ListActionsCommandError = async (output, context) => {
569
- const parsedOutput = {
570
- ...output,
571
- body: await parseErrorBody(output.body, context),
572
- };
573
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
574
- switch (errorCode) {
575
- case "ValidationException":
576
- case "com.amazonaws.fis#ValidationException":
577
- throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
578
- default:
579
- const parsedBody = parsedOutput.body;
580
- throwDefaultError({
581
- output,
582
- parsedBody,
583
- exceptionCtor: __BaseException,
584
- errorCode,
585
- });
586
- }
587
- };
588
- export const deserializeAws_restJson1ListExperimentsCommand = async (output, context) => {
589
- if (output.statusCode !== 200 && output.statusCode >= 300) {
590
- return deserializeAws_restJson1ListExperimentsCommandError(output, context);
591
- }
592
- const contents = map({
593
- $metadata: deserializeMetadata(output),
175
+ }); };
176
+ export var serializeAws_restJson1ListExperimentsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
177
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
178
+ return __generator(this, function (_c) {
179
+ switch (_c.label) {
180
+ case 0: return [4, context.endpoint()];
181
+ case 1:
182
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
183
+ headers = {};
184
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/experiments";
185
+ query = map({
186
+ maxResults: [function () { return input.maxResults !== void 0; }, function () { return input.maxResults.toString(); }],
187
+ nextToken: [, input.nextToken],
188
+ });
189
+ return [2, new __HttpRequest({
190
+ protocol: protocol,
191
+ hostname: hostname,
192
+ port: port,
193
+ method: "GET",
194
+ headers: headers,
195
+ path: resolvedPath,
196
+ query: query,
197
+ body: body,
198
+ })];
199
+ }
594
200
  });
595
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
596
- if (data.experiments != null) {
597
- contents.experiments = deserializeAws_restJson1ExperimentSummaryList(data.experiments, context);
598
- }
599
- if (data.nextToken != null) {
600
- contents.nextToken = __expectString(data.nextToken);
601
- }
602
- return contents;
603
- };
604
- const deserializeAws_restJson1ListExperimentsCommandError = async (output, context) => {
605
- const parsedOutput = {
606
- ...output,
607
- body: await parseErrorBody(output.body, context),
608
- };
609
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
610
- switch (errorCode) {
611
- case "ValidationException":
612
- case "com.amazonaws.fis#ValidationException":
613
- throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
614
- default:
615
- const parsedBody = parsedOutput.body;
616
- throwDefaultError({
617
- output,
618
- parsedBody,
619
- exceptionCtor: __BaseException,
620
- errorCode,
621
- });
622
- }
623
- };
624
- export const deserializeAws_restJson1ListExperimentTemplatesCommand = async (output, context) => {
625
- if (output.statusCode !== 200 && output.statusCode >= 300) {
626
- return deserializeAws_restJson1ListExperimentTemplatesCommandError(output, context);
627
- }
628
- const contents = map({
629
- $metadata: deserializeMetadata(output),
201
+ }); };
202
+ export var serializeAws_restJson1ListExperimentTemplatesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
203
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
204
+ return __generator(this, function (_c) {
205
+ switch (_c.label) {
206
+ case 0: return [4, context.endpoint()];
207
+ case 1:
208
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
209
+ headers = {};
210
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/experimentTemplates";
211
+ query = map({
212
+ maxResults: [function () { return input.maxResults !== void 0; }, function () { return input.maxResults.toString(); }],
213
+ nextToken: [, input.nextToken],
214
+ });
215
+ return [2, new __HttpRequest({
216
+ protocol: protocol,
217
+ hostname: hostname,
218
+ port: port,
219
+ method: "GET",
220
+ headers: headers,
221
+ path: resolvedPath,
222
+ query: query,
223
+ body: body,
224
+ })];
225
+ }
630
226
  });
631
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
632
- if (data.experimentTemplates != null) {
633
- contents.experimentTemplates = deserializeAws_restJson1ExperimentTemplateSummaryList(data.experimentTemplates, context);
634
- }
635
- if (data.nextToken != null) {
636
- contents.nextToken = __expectString(data.nextToken);
637
- }
638
- return contents;
639
- };
640
- const deserializeAws_restJson1ListExperimentTemplatesCommandError = async (output, context) => {
641
- const parsedOutput = {
642
- ...output,
643
- body: await parseErrorBody(output.body, context),
644
- };
645
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
646
- switch (errorCode) {
647
- case "ValidationException":
648
- case "com.amazonaws.fis#ValidationException":
649
- throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
650
- default:
651
- const parsedBody = parsedOutput.body;
652
- throwDefaultError({
653
- output,
654
- parsedBody,
655
- exceptionCtor: __BaseException,
656
- errorCode,
657
- });
658
- }
659
- };
660
- export const deserializeAws_restJson1ListTagsForResourceCommand = async (output, context) => {
661
- if (output.statusCode !== 200 && output.statusCode >= 300) {
662
- return deserializeAws_restJson1ListTagsForResourceCommandError(output, context);
663
- }
664
- const contents = map({
665
- $metadata: deserializeMetadata(output),
227
+ }); };
228
+ export var serializeAws_restJson1ListTagsForResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
229
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
230
+ return __generator(this, function (_c) {
231
+ switch (_c.label) {
232
+ case 0: return [4, context.endpoint()];
233
+ case 1:
234
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
235
+ headers = {};
236
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{resourceArn}";
237
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", function () { return input.resourceArn; }, "{resourceArn}", false);
238
+ return [2, new __HttpRequest({
239
+ protocol: protocol,
240
+ hostname: hostname,
241
+ port: port,
242
+ method: "GET",
243
+ headers: headers,
244
+ path: resolvedPath,
245
+ body: body,
246
+ })];
247
+ }
666
248
  });
667
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
668
- if (data.tags != null) {
669
- contents.tags = deserializeAws_restJson1TagMap(data.tags, context);
670
- }
671
- return contents;
672
- };
673
- const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, context) => {
674
- const parsedOutput = {
675
- ...output,
676
- body: await parseErrorBody(output.body, context),
677
- };
678
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
679
- const parsedBody = parsedOutput.body;
680
- throwDefaultError({
681
- output,
682
- parsedBody,
683
- exceptionCtor: __BaseException,
684
- errorCode,
685
- });
686
- };
687
- export const deserializeAws_restJson1ListTargetResourceTypesCommand = async (output, context) => {
688
- if (output.statusCode !== 200 && output.statusCode >= 300) {
689
- return deserializeAws_restJson1ListTargetResourceTypesCommandError(output, context);
690
- }
691
- const contents = map({
692
- $metadata: deserializeMetadata(output),
249
+ }); };
250
+ export var serializeAws_restJson1ListTargetResourceTypesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
251
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
252
+ return __generator(this, function (_c) {
253
+ switch (_c.label) {
254
+ case 0: return [4, context.endpoint()];
255
+ case 1:
256
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
257
+ headers = {};
258
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/targetResourceTypes";
259
+ query = map({
260
+ maxResults: [function () { return input.maxResults !== void 0; }, function () { return input.maxResults.toString(); }],
261
+ nextToken: [, input.nextToken],
262
+ });
263
+ return [2, new __HttpRequest({
264
+ protocol: protocol,
265
+ hostname: hostname,
266
+ port: port,
267
+ method: "GET",
268
+ headers: headers,
269
+ path: resolvedPath,
270
+ query: query,
271
+ body: body,
272
+ })];
273
+ }
693
274
  });
694
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
695
- if (data.nextToken != null) {
696
- contents.nextToken = __expectString(data.nextToken);
697
- }
698
- if (data.targetResourceTypes != null) {
699
- contents.targetResourceTypes = deserializeAws_restJson1TargetResourceTypeSummaryList(data.targetResourceTypes, context);
700
- }
701
- return contents;
702
- };
703
- const deserializeAws_restJson1ListTargetResourceTypesCommandError = async (output, context) => {
704
- const parsedOutput = {
705
- ...output,
706
- body: await parseErrorBody(output.body, context),
707
- };
708
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
709
- switch (errorCode) {
710
- case "ValidationException":
711
- case "com.amazonaws.fis#ValidationException":
712
- throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
713
- default:
714
- const parsedBody = parsedOutput.body;
715
- throwDefaultError({
716
- output,
717
- parsedBody,
718
- exceptionCtor: __BaseException,
719
- errorCode,
720
- });
721
- }
722
- };
723
- export const deserializeAws_restJson1StartExperimentCommand = async (output, context) => {
724
- if (output.statusCode !== 200 && output.statusCode >= 300) {
725
- return deserializeAws_restJson1StartExperimentCommandError(output, context);
726
- }
727
- const contents = map({
728
- $metadata: deserializeMetadata(output),
275
+ }); };
276
+ export var serializeAws_restJson1StartExperimentCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
277
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
278
+ var _c;
279
+ return __generator(this, function (_d) {
280
+ switch (_d.label) {
281
+ case 0: return [4, context.endpoint()];
282
+ case 1:
283
+ _a = _d.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
284
+ headers = {
285
+ "content-type": "application/json",
286
+ };
287
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/experiments";
288
+ body = JSON.stringify(__assign(__assign({ clientToken: (_c = input.clientToken) !== null && _c !== void 0 ? _c : generateIdempotencyToken() }, (input.experimentTemplateId != null && { experimentTemplateId: input.experimentTemplateId })), (input.tags != null && { tags: serializeAws_restJson1TagMap(input.tags, context) })));
289
+ return [2, new __HttpRequest({
290
+ protocol: protocol,
291
+ hostname: hostname,
292
+ port: port,
293
+ method: "POST",
294
+ headers: headers,
295
+ path: resolvedPath,
296
+ body: body,
297
+ })];
298
+ }
729
299
  });
730
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
731
- if (data.experiment != null) {
732
- contents.experiment = deserializeAws_restJson1Experiment(data.experiment, context);
733
- }
734
- return contents;
735
- };
736
- const deserializeAws_restJson1StartExperimentCommandError = async (output, context) => {
737
- const parsedOutput = {
738
- ...output,
739
- body: await parseErrorBody(output.body, context),
740
- };
741
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
742
- switch (errorCode) {
743
- case "ConflictException":
744
- case "com.amazonaws.fis#ConflictException":
745
- throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
746
- case "ResourceNotFoundException":
747
- case "com.amazonaws.fis#ResourceNotFoundException":
748
- throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
749
- case "ServiceQuotaExceededException":
750
- case "com.amazonaws.fis#ServiceQuotaExceededException":
751
- throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
752
- case "ValidationException":
753
- case "com.amazonaws.fis#ValidationException":
754
- throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
755
- default:
756
- const parsedBody = parsedOutput.body;
757
- throwDefaultError({
758
- output,
759
- parsedBody,
760
- exceptionCtor: __BaseException,
761
- errorCode,
762
- });
763
- }
764
- };
765
- export const deserializeAws_restJson1StopExperimentCommand = async (output, context) => {
766
- if (output.statusCode !== 200 && output.statusCode >= 300) {
767
- return deserializeAws_restJson1StopExperimentCommandError(output, context);
768
- }
769
- const contents = map({
770
- $metadata: deserializeMetadata(output),
300
+ }); };
301
+ export var serializeAws_restJson1StopExperimentCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
302
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
303
+ return __generator(this, function (_c) {
304
+ switch (_c.label) {
305
+ case 0: return [4, context.endpoint()];
306
+ case 1:
307
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
308
+ headers = {};
309
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/experiments/{id}";
310
+ resolvedPath = __resolvedPath(resolvedPath, input, "id", function () { return input.id; }, "{id}", false);
311
+ return [2, new __HttpRequest({
312
+ protocol: protocol,
313
+ hostname: hostname,
314
+ port: port,
315
+ method: "DELETE",
316
+ headers: headers,
317
+ path: resolvedPath,
318
+ body: body,
319
+ })];
320
+ }
771
321
  });
772
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
773
- if (data.experiment != null) {
774
- contents.experiment = deserializeAws_restJson1Experiment(data.experiment, context);
775
- }
776
- return contents;
777
- };
778
- const deserializeAws_restJson1StopExperimentCommandError = async (output, context) => {
779
- const parsedOutput = {
780
- ...output,
781
- body: await parseErrorBody(output.body, context),
782
- };
783
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
784
- switch (errorCode) {
785
- case "ResourceNotFoundException":
786
- case "com.amazonaws.fis#ResourceNotFoundException":
787
- throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
788
- case "ValidationException":
789
- case "com.amazonaws.fis#ValidationException":
790
- throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
791
- default:
792
- const parsedBody = parsedOutput.body;
793
- throwDefaultError({
794
- output,
795
- parsedBody,
796
- exceptionCtor: __BaseException,
797
- errorCode,
798
- });
799
- }
800
- };
801
- export const deserializeAws_restJson1TagResourceCommand = async (output, context) => {
802
- if (output.statusCode !== 200 && output.statusCode >= 300) {
803
- return deserializeAws_restJson1TagResourceCommandError(output, context);
804
- }
805
- const contents = map({
806
- $metadata: deserializeMetadata(output),
322
+ }); };
323
+ export var serializeAws_restJson1TagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
324
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
325
+ return __generator(this, function (_c) {
326
+ switch (_c.label) {
327
+ case 0: return [4, context.endpoint()];
328
+ case 1:
329
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
330
+ headers = {
331
+ "content-type": "application/json",
332
+ };
333
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{resourceArn}";
334
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", function () { return input.resourceArn; }, "{resourceArn}", false);
335
+ body = JSON.stringify(__assign({}, (input.tags != null && { tags: serializeAws_restJson1TagMap(input.tags, context) })));
336
+ return [2, new __HttpRequest({
337
+ protocol: protocol,
338
+ hostname: hostname,
339
+ port: port,
340
+ method: "POST",
341
+ headers: headers,
342
+ path: resolvedPath,
343
+ body: body,
344
+ })];
345
+ }
807
346
  });
808
- await collectBody(output.body, context);
809
- return contents;
810
- };
811
- const deserializeAws_restJson1TagResourceCommandError = async (output, context) => {
812
- const parsedOutput = {
813
- ...output,
814
- body: await parseErrorBody(output.body, context),
815
- };
816
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
817
- const parsedBody = parsedOutput.body;
818
- throwDefaultError({
819
- output,
820
- parsedBody,
821
- exceptionCtor: __BaseException,
822
- errorCode,
823
- });
824
- };
825
- export const deserializeAws_restJson1UntagResourceCommand = async (output, context) => {
826
- if (output.statusCode !== 200 && output.statusCode >= 300) {
827
- return deserializeAws_restJson1UntagResourceCommandError(output, context);
828
- }
829
- const contents = map({
830
- $metadata: deserializeMetadata(output),
347
+ }); };
348
+ export var serializeAws_restJson1UntagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
349
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
350
+ return __generator(this, function (_c) {
351
+ switch (_c.label) {
352
+ case 0: return [4, context.endpoint()];
353
+ case 1:
354
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
355
+ headers = {};
356
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{resourceArn}";
357
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", function () { return input.resourceArn; }, "{resourceArn}", false);
358
+ query = map({
359
+ tagKeys: [function () { return input.tagKeys !== void 0; }, function () { return (input.tagKeys || []).map(function (_entry) { return _entry; }); }],
360
+ });
361
+ return [2, new __HttpRequest({
362
+ protocol: protocol,
363
+ hostname: hostname,
364
+ port: port,
365
+ method: "DELETE",
366
+ headers: headers,
367
+ path: resolvedPath,
368
+ query: query,
369
+ body: body,
370
+ })];
371
+ }
831
372
  });
832
- await collectBody(output.body, context);
833
- return contents;
834
- };
835
- const deserializeAws_restJson1UntagResourceCommandError = async (output, context) => {
836
- const parsedOutput = {
837
- ...output,
838
- body: await parseErrorBody(output.body, context),
839
- };
840
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
841
- const parsedBody = parsedOutput.body;
842
- throwDefaultError({
843
- output,
844
- parsedBody,
845
- exceptionCtor: __BaseException,
846
- errorCode,
847
- });
848
- };
849
- export const deserializeAws_restJson1UpdateExperimentTemplateCommand = async (output, context) => {
850
- if (output.statusCode !== 200 && output.statusCode >= 300) {
851
- return deserializeAws_restJson1UpdateExperimentTemplateCommandError(output, context);
852
- }
853
- const contents = map({
854
- $metadata: deserializeMetadata(output),
373
+ }); };
374
+ export var serializeAws_restJson1UpdateExperimentTemplateCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
375
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
376
+ return __generator(this, function (_c) {
377
+ switch (_c.label) {
378
+ case 0: return [4, context.endpoint()];
379
+ case 1:
380
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
381
+ headers = {
382
+ "content-type": "application/json",
383
+ };
384
+ resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/experimentTemplates/{id}";
385
+ resolvedPath = __resolvedPath(resolvedPath, input, "id", function () { return input.id; }, "{id}", false);
386
+ body = JSON.stringify(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.actions != null && {
387
+ actions: serializeAws_restJson1UpdateExperimentTemplateActionInputMap(input.actions, context),
388
+ })), (input.description != null && { description: input.description })), (input.logConfiguration != null && {
389
+ logConfiguration: serializeAws_restJson1UpdateExperimentTemplateLogConfigurationInput(input.logConfiguration, context),
390
+ })), (input.roleArn != null && { roleArn: input.roleArn })), (input.stopConditions != null && {
391
+ stopConditions: serializeAws_restJson1UpdateExperimentTemplateStopConditionInputList(input.stopConditions, context),
392
+ })), (input.targets != null && {
393
+ targets: serializeAws_restJson1UpdateExperimentTemplateTargetInputMap(input.targets, context),
394
+ })));
395
+ return [2, new __HttpRequest({
396
+ protocol: protocol,
397
+ hostname: hostname,
398
+ port: port,
399
+ method: "PATCH",
400
+ headers: headers,
401
+ path: resolvedPath,
402
+ body: body,
403
+ })];
404
+ }
855
405
  });
856
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
857
- if (data.experimentTemplate != null) {
858
- contents.experimentTemplate = deserializeAws_restJson1ExperimentTemplate(data.experimentTemplate, context);
859
- }
860
- return contents;
861
- };
862
- const deserializeAws_restJson1UpdateExperimentTemplateCommandError = async (output, context) => {
863
- const parsedOutput = {
864
- ...output,
865
- body: await parseErrorBody(output.body, context),
866
- };
867
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
868
- switch (errorCode) {
869
- case "ResourceNotFoundException":
870
- case "com.amazonaws.fis#ResourceNotFoundException":
871
- throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
872
- case "ServiceQuotaExceededException":
873
- case "com.amazonaws.fis#ServiceQuotaExceededException":
874
- throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
875
- case "ValidationException":
876
- case "com.amazonaws.fis#ValidationException":
877
- throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
878
- default:
879
- const parsedBody = parsedOutput.body;
880
- throwDefaultError({
881
- output,
882
- parsedBody,
883
- exceptionCtor: __BaseException,
884
- errorCode,
885
- });
886
- }
887
- };
888
- const map = __map;
889
- const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, context) => {
890
- const contents = map({});
891
- const data = parsedOutput.body;
892
- if (data.message != null) {
893
- contents.message = __expectString(data.message);
894
- }
895
- const exception = new ConflictException({
896
- $metadata: deserializeMetadata(parsedOutput),
897
- ...contents,
406
+ }); };
407
+ export var deserializeAws_restJson1CreateExperimentTemplateCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
408
+ var contents, data, _a, _b;
409
+ return __generator(this, function (_c) {
410
+ switch (_c.label) {
411
+ case 0:
412
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
413
+ return [2, deserializeAws_restJson1CreateExperimentTemplateCommandError(output, context)];
414
+ }
415
+ contents = map({
416
+ $metadata: deserializeMetadata(output),
417
+ });
418
+ _a = __expectNonNull;
419
+ _b = __expectObject;
420
+ return [4, parseBody(output.body, context)];
421
+ case 1:
422
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
423
+ if (data.experimentTemplate != null) {
424
+ contents.experimentTemplate = deserializeAws_restJson1ExperimentTemplate(data.experimentTemplate, context);
425
+ }
426
+ return [2, contents];
427
+ }
898
428
  });
899
- return __decorateServiceException(exception, parsedOutput.body);
900
- };
901
- const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
902
- const contents = map({});
903
- const data = parsedOutput.body;
904
- if (data.message != null) {
905
- contents.message = __expectString(data.message);
906
- }
907
- const exception = new ResourceNotFoundException({
908
- $metadata: deserializeMetadata(parsedOutput),
909
- ...contents,
429
+ }); };
430
+ var deserializeAws_restJson1CreateExperimentTemplateCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
431
+ var parsedOutput, _a, errorCode, _b, parsedBody;
432
+ var _c;
433
+ return __generator(this, function (_d) {
434
+ switch (_d.label) {
435
+ case 0:
436
+ _a = [__assign({}, output)];
437
+ _c = {};
438
+ return [4, parseErrorBody(output.body, context)];
439
+ case 1:
440
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
441
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
442
+ _b = errorCode;
443
+ switch (_b) {
444
+ case "ConflictException": return [3, 2];
445
+ case "com.amazonaws.fis#ConflictException": return [3, 2];
446
+ case "ResourceNotFoundException": return [3, 4];
447
+ case "com.amazonaws.fis#ResourceNotFoundException": return [3, 4];
448
+ case "ServiceQuotaExceededException": return [3, 6];
449
+ case "com.amazonaws.fis#ServiceQuotaExceededException": return [3, 6];
450
+ case "ValidationException": return [3, 8];
451
+ case "com.amazonaws.fis#ValidationException": return [3, 8];
452
+ }
453
+ return [3, 10];
454
+ case 2: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
455
+ case 3: throw _d.sent();
456
+ case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
457
+ case 5: throw _d.sent();
458
+ case 6: return [4, deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)];
459
+ case 7: throw _d.sent();
460
+ case 8: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
461
+ case 9: throw _d.sent();
462
+ case 10:
463
+ parsedBody = parsedOutput.body;
464
+ throwDefaultError({
465
+ output: output,
466
+ parsedBody: parsedBody,
467
+ exceptionCtor: __BaseException,
468
+ errorCode: errorCode,
469
+ });
470
+ _d.label = 11;
471
+ case 11: return [2];
472
+ }
910
473
  });
911
- return __decorateServiceException(exception, parsedOutput.body);
912
- };
913
- const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (parsedOutput, context) => {
914
- const contents = map({});
915
- const data = parsedOutput.body;
916
- if (data.message != null) {
917
- contents.message = __expectString(data.message);
918
- }
919
- const exception = new ServiceQuotaExceededException({
920
- $metadata: deserializeMetadata(parsedOutput),
921
- ...contents,
474
+ }); };
475
+ export var deserializeAws_restJson1DeleteExperimentTemplateCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
476
+ var contents, data, _a, _b;
477
+ return __generator(this, function (_c) {
478
+ switch (_c.label) {
479
+ case 0:
480
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
481
+ return [2, deserializeAws_restJson1DeleteExperimentTemplateCommandError(output, context)];
482
+ }
483
+ contents = map({
484
+ $metadata: deserializeMetadata(output),
485
+ });
486
+ _a = __expectNonNull;
487
+ _b = __expectObject;
488
+ return [4, parseBody(output.body, context)];
489
+ case 1:
490
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
491
+ if (data.experimentTemplate != null) {
492
+ contents.experimentTemplate = deserializeAws_restJson1ExperimentTemplate(data.experimentTemplate, context);
493
+ }
494
+ return [2, contents];
495
+ }
922
496
  });
923
- return __decorateServiceException(exception, parsedOutput.body);
924
- };
925
- const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput, context) => {
926
- const contents = map({});
927
- const data = parsedOutput.body;
928
- if (data.message != null) {
929
- contents.message = __expectString(data.message);
930
- }
931
- const exception = new ValidationException({
932
- $metadata: deserializeMetadata(parsedOutput),
933
- ...contents,
497
+ }); };
498
+ var deserializeAws_restJson1DeleteExperimentTemplateCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
499
+ var parsedOutput, _a, errorCode, _b, parsedBody;
500
+ var _c;
501
+ return __generator(this, function (_d) {
502
+ switch (_d.label) {
503
+ case 0:
504
+ _a = [__assign({}, output)];
505
+ _c = {};
506
+ return [4, parseErrorBody(output.body, context)];
507
+ case 1:
508
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
509
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
510
+ _b = errorCode;
511
+ switch (_b) {
512
+ case "ResourceNotFoundException": return [3, 2];
513
+ case "com.amazonaws.fis#ResourceNotFoundException": return [3, 2];
514
+ case "ValidationException": return [3, 4];
515
+ case "com.amazonaws.fis#ValidationException": return [3, 4];
516
+ }
517
+ return [3, 6];
518
+ case 2: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
519
+ case 3: throw _d.sent();
520
+ case 4: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
521
+ case 5: throw _d.sent();
522
+ case 6:
523
+ parsedBody = parsedOutput.body;
524
+ throwDefaultError({
525
+ output: output,
526
+ parsedBody: parsedBody,
527
+ exceptionCtor: __BaseException,
528
+ errorCode: errorCode,
529
+ });
530
+ _d.label = 7;
531
+ case 7: return [2];
532
+ }
934
533
  });
935
- return __decorateServiceException(exception, parsedOutput.body);
936
- };
937
- const serializeAws_restJson1CreateExperimentTemplateActionInput = (input, context) => {
938
- return {
939
- ...(input.actionId != null && { actionId: input.actionId }),
940
- ...(input.description != null && { description: input.description }),
941
- ...(input.parameters != null && {
942
- parameters: serializeAws_restJson1ExperimentTemplateActionParameterMap(input.parameters, context),
943
- }),
944
- ...(input.startAfter != null && {
945
- startAfter: serializeAws_restJson1ExperimentTemplateActionStartAfterList(input.startAfter, context),
946
- }),
947
- ...(input.targets != null && {
948
- targets: serializeAws_restJson1ExperimentTemplateActionTargetMap(input.targets, context),
949
- }),
950
- };
951
- };
952
- const serializeAws_restJson1CreateExperimentTemplateActionInputMap = (input, context) => {
953
- return Object.entries(input).reduce((acc, [key, value]) => {
534
+ }); };
535
+ export var deserializeAws_restJson1GetActionCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
536
+ var contents, data, _a, _b;
537
+ return __generator(this, function (_c) {
538
+ switch (_c.label) {
539
+ case 0:
540
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
541
+ return [2, deserializeAws_restJson1GetActionCommandError(output, context)];
542
+ }
543
+ contents = map({
544
+ $metadata: deserializeMetadata(output),
545
+ });
546
+ _a = __expectNonNull;
547
+ _b = __expectObject;
548
+ return [4, parseBody(output.body, context)];
549
+ case 1:
550
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
551
+ if (data.action != null) {
552
+ contents.action = deserializeAws_restJson1Action(data.action, context);
553
+ }
554
+ return [2, contents];
555
+ }
556
+ });
557
+ }); };
558
+ var deserializeAws_restJson1GetActionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
559
+ var parsedOutput, _a, errorCode, _b, parsedBody;
560
+ var _c;
561
+ return __generator(this, function (_d) {
562
+ switch (_d.label) {
563
+ case 0:
564
+ _a = [__assign({}, output)];
565
+ _c = {};
566
+ return [4, parseErrorBody(output.body, context)];
567
+ case 1:
568
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
569
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
570
+ _b = errorCode;
571
+ switch (_b) {
572
+ case "ResourceNotFoundException": return [3, 2];
573
+ case "com.amazonaws.fis#ResourceNotFoundException": return [3, 2];
574
+ case "ValidationException": return [3, 4];
575
+ case "com.amazonaws.fis#ValidationException": return [3, 4];
576
+ }
577
+ return [3, 6];
578
+ case 2: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
579
+ case 3: throw _d.sent();
580
+ case 4: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
581
+ case 5: throw _d.sent();
582
+ case 6:
583
+ parsedBody = parsedOutput.body;
584
+ throwDefaultError({
585
+ output: output,
586
+ parsedBody: parsedBody,
587
+ exceptionCtor: __BaseException,
588
+ errorCode: errorCode,
589
+ });
590
+ _d.label = 7;
591
+ case 7: return [2];
592
+ }
593
+ });
594
+ }); };
595
+ export var deserializeAws_restJson1GetExperimentCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
596
+ var contents, data, _a, _b;
597
+ return __generator(this, function (_c) {
598
+ switch (_c.label) {
599
+ case 0:
600
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
601
+ return [2, deserializeAws_restJson1GetExperimentCommandError(output, context)];
602
+ }
603
+ contents = map({
604
+ $metadata: deserializeMetadata(output),
605
+ });
606
+ _a = __expectNonNull;
607
+ _b = __expectObject;
608
+ return [4, parseBody(output.body, context)];
609
+ case 1:
610
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
611
+ if (data.experiment != null) {
612
+ contents.experiment = deserializeAws_restJson1Experiment(data.experiment, context);
613
+ }
614
+ return [2, contents];
615
+ }
616
+ });
617
+ }); };
618
+ var deserializeAws_restJson1GetExperimentCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
619
+ var parsedOutput, _a, errorCode, _b, parsedBody;
620
+ var _c;
621
+ return __generator(this, function (_d) {
622
+ switch (_d.label) {
623
+ case 0:
624
+ _a = [__assign({}, output)];
625
+ _c = {};
626
+ return [4, parseErrorBody(output.body, context)];
627
+ case 1:
628
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
629
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
630
+ _b = errorCode;
631
+ switch (_b) {
632
+ case "ResourceNotFoundException": return [3, 2];
633
+ case "com.amazonaws.fis#ResourceNotFoundException": return [3, 2];
634
+ case "ValidationException": return [3, 4];
635
+ case "com.amazonaws.fis#ValidationException": return [3, 4];
636
+ }
637
+ return [3, 6];
638
+ case 2: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
639
+ case 3: throw _d.sent();
640
+ case 4: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
641
+ case 5: throw _d.sent();
642
+ case 6:
643
+ parsedBody = parsedOutput.body;
644
+ throwDefaultError({
645
+ output: output,
646
+ parsedBody: parsedBody,
647
+ exceptionCtor: __BaseException,
648
+ errorCode: errorCode,
649
+ });
650
+ _d.label = 7;
651
+ case 7: return [2];
652
+ }
653
+ });
654
+ }); };
655
+ export var deserializeAws_restJson1GetExperimentTemplateCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
656
+ var contents, data, _a, _b;
657
+ return __generator(this, function (_c) {
658
+ switch (_c.label) {
659
+ case 0:
660
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
661
+ return [2, deserializeAws_restJson1GetExperimentTemplateCommandError(output, context)];
662
+ }
663
+ contents = map({
664
+ $metadata: deserializeMetadata(output),
665
+ });
666
+ _a = __expectNonNull;
667
+ _b = __expectObject;
668
+ return [4, parseBody(output.body, context)];
669
+ case 1:
670
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
671
+ if (data.experimentTemplate != null) {
672
+ contents.experimentTemplate = deserializeAws_restJson1ExperimentTemplate(data.experimentTemplate, context);
673
+ }
674
+ return [2, contents];
675
+ }
676
+ });
677
+ }); };
678
+ var deserializeAws_restJson1GetExperimentTemplateCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
679
+ var parsedOutput, _a, errorCode, _b, parsedBody;
680
+ var _c;
681
+ return __generator(this, function (_d) {
682
+ switch (_d.label) {
683
+ case 0:
684
+ _a = [__assign({}, output)];
685
+ _c = {};
686
+ return [4, parseErrorBody(output.body, context)];
687
+ case 1:
688
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
689
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
690
+ _b = errorCode;
691
+ switch (_b) {
692
+ case "ResourceNotFoundException": return [3, 2];
693
+ case "com.amazonaws.fis#ResourceNotFoundException": return [3, 2];
694
+ case "ValidationException": return [3, 4];
695
+ case "com.amazonaws.fis#ValidationException": return [3, 4];
696
+ }
697
+ return [3, 6];
698
+ case 2: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
699
+ case 3: throw _d.sent();
700
+ case 4: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
701
+ case 5: throw _d.sent();
702
+ case 6:
703
+ parsedBody = parsedOutput.body;
704
+ throwDefaultError({
705
+ output: output,
706
+ parsedBody: parsedBody,
707
+ exceptionCtor: __BaseException,
708
+ errorCode: errorCode,
709
+ });
710
+ _d.label = 7;
711
+ case 7: return [2];
712
+ }
713
+ });
714
+ }); };
715
+ export var deserializeAws_restJson1GetTargetResourceTypeCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
716
+ var contents, data, _a, _b;
717
+ return __generator(this, function (_c) {
718
+ switch (_c.label) {
719
+ case 0:
720
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
721
+ return [2, deserializeAws_restJson1GetTargetResourceTypeCommandError(output, context)];
722
+ }
723
+ contents = map({
724
+ $metadata: deserializeMetadata(output),
725
+ });
726
+ _a = __expectNonNull;
727
+ _b = __expectObject;
728
+ return [4, parseBody(output.body, context)];
729
+ case 1:
730
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
731
+ if (data.targetResourceType != null) {
732
+ contents.targetResourceType = deserializeAws_restJson1TargetResourceType(data.targetResourceType, context);
733
+ }
734
+ return [2, contents];
735
+ }
736
+ });
737
+ }); };
738
+ var deserializeAws_restJson1GetTargetResourceTypeCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
739
+ var parsedOutput, _a, errorCode, _b, parsedBody;
740
+ var _c;
741
+ return __generator(this, function (_d) {
742
+ switch (_d.label) {
743
+ case 0:
744
+ _a = [__assign({}, output)];
745
+ _c = {};
746
+ return [4, parseErrorBody(output.body, context)];
747
+ case 1:
748
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
749
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
750
+ _b = errorCode;
751
+ switch (_b) {
752
+ case "ResourceNotFoundException": return [3, 2];
753
+ case "com.amazonaws.fis#ResourceNotFoundException": return [3, 2];
754
+ case "ValidationException": return [3, 4];
755
+ case "com.amazonaws.fis#ValidationException": return [3, 4];
756
+ }
757
+ return [3, 6];
758
+ case 2: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
759
+ case 3: throw _d.sent();
760
+ case 4: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
761
+ case 5: throw _d.sent();
762
+ case 6:
763
+ parsedBody = parsedOutput.body;
764
+ throwDefaultError({
765
+ output: output,
766
+ parsedBody: parsedBody,
767
+ exceptionCtor: __BaseException,
768
+ errorCode: errorCode,
769
+ });
770
+ _d.label = 7;
771
+ case 7: return [2];
772
+ }
773
+ });
774
+ }); };
775
+ export var deserializeAws_restJson1ListActionsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
776
+ var contents, data, _a, _b;
777
+ return __generator(this, function (_c) {
778
+ switch (_c.label) {
779
+ case 0:
780
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
781
+ return [2, deserializeAws_restJson1ListActionsCommandError(output, context)];
782
+ }
783
+ contents = map({
784
+ $metadata: deserializeMetadata(output),
785
+ });
786
+ _a = __expectNonNull;
787
+ _b = __expectObject;
788
+ return [4, parseBody(output.body, context)];
789
+ case 1:
790
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
791
+ if (data.actions != null) {
792
+ contents.actions = deserializeAws_restJson1ActionSummaryList(data.actions, context);
793
+ }
794
+ if (data.nextToken != null) {
795
+ contents.nextToken = __expectString(data.nextToken);
796
+ }
797
+ return [2, contents];
798
+ }
799
+ });
800
+ }); };
801
+ var deserializeAws_restJson1ListActionsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
802
+ var parsedOutput, _a, errorCode, _b, parsedBody;
803
+ var _c;
804
+ return __generator(this, function (_d) {
805
+ switch (_d.label) {
806
+ case 0:
807
+ _a = [__assign({}, output)];
808
+ _c = {};
809
+ return [4, parseErrorBody(output.body, context)];
810
+ case 1:
811
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
812
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
813
+ _b = errorCode;
814
+ switch (_b) {
815
+ case "ValidationException": return [3, 2];
816
+ case "com.amazonaws.fis#ValidationException": return [3, 2];
817
+ }
818
+ return [3, 4];
819
+ case 2: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
820
+ case 3: throw _d.sent();
821
+ case 4:
822
+ parsedBody = parsedOutput.body;
823
+ throwDefaultError({
824
+ output: output,
825
+ parsedBody: parsedBody,
826
+ exceptionCtor: __BaseException,
827
+ errorCode: errorCode,
828
+ });
829
+ _d.label = 5;
830
+ case 5: return [2];
831
+ }
832
+ });
833
+ }); };
834
+ export var deserializeAws_restJson1ListExperimentsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
835
+ var contents, data, _a, _b;
836
+ return __generator(this, function (_c) {
837
+ switch (_c.label) {
838
+ case 0:
839
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
840
+ return [2, deserializeAws_restJson1ListExperimentsCommandError(output, context)];
841
+ }
842
+ contents = map({
843
+ $metadata: deserializeMetadata(output),
844
+ });
845
+ _a = __expectNonNull;
846
+ _b = __expectObject;
847
+ return [4, parseBody(output.body, context)];
848
+ case 1:
849
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
850
+ if (data.experiments != null) {
851
+ contents.experiments = deserializeAws_restJson1ExperimentSummaryList(data.experiments, context);
852
+ }
853
+ if (data.nextToken != null) {
854
+ contents.nextToken = __expectString(data.nextToken);
855
+ }
856
+ return [2, contents];
857
+ }
858
+ });
859
+ }); };
860
+ var deserializeAws_restJson1ListExperimentsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
861
+ var parsedOutput, _a, errorCode, _b, parsedBody;
862
+ var _c;
863
+ return __generator(this, function (_d) {
864
+ switch (_d.label) {
865
+ case 0:
866
+ _a = [__assign({}, output)];
867
+ _c = {};
868
+ return [4, parseErrorBody(output.body, context)];
869
+ case 1:
870
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
871
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
872
+ _b = errorCode;
873
+ switch (_b) {
874
+ case "ValidationException": return [3, 2];
875
+ case "com.amazonaws.fis#ValidationException": return [3, 2];
876
+ }
877
+ return [3, 4];
878
+ case 2: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
879
+ case 3: throw _d.sent();
880
+ case 4:
881
+ parsedBody = parsedOutput.body;
882
+ throwDefaultError({
883
+ output: output,
884
+ parsedBody: parsedBody,
885
+ exceptionCtor: __BaseException,
886
+ errorCode: errorCode,
887
+ });
888
+ _d.label = 5;
889
+ case 5: return [2];
890
+ }
891
+ });
892
+ }); };
893
+ export var deserializeAws_restJson1ListExperimentTemplatesCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
894
+ var contents, data, _a, _b;
895
+ return __generator(this, function (_c) {
896
+ switch (_c.label) {
897
+ case 0:
898
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
899
+ return [2, deserializeAws_restJson1ListExperimentTemplatesCommandError(output, context)];
900
+ }
901
+ contents = map({
902
+ $metadata: deserializeMetadata(output),
903
+ });
904
+ _a = __expectNonNull;
905
+ _b = __expectObject;
906
+ return [4, parseBody(output.body, context)];
907
+ case 1:
908
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
909
+ if (data.experimentTemplates != null) {
910
+ contents.experimentTemplates = deserializeAws_restJson1ExperimentTemplateSummaryList(data.experimentTemplates, context);
911
+ }
912
+ if (data.nextToken != null) {
913
+ contents.nextToken = __expectString(data.nextToken);
914
+ }
915
+ return [2, contents];
916
+ }
917
+ });
918
+ }); };
919
+ var deserializeAws_restJson1ListExperimentTemplatesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
920
+ var parsedOutput, _a, errorCode, _b, parsedBody;
921
+ var _c;
922
+ return __generator(this, function (_d) {
923
+ switch (_d.label) {
924
+ case 0:
925
+ _a = [__assign({}, output)];
926
+ _c = {};
927
+ return [4, parseErrorBody(output.body, context)];
928
+ case 1:
929
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
930
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
931
+ _b = errorCode;
932
+ switch (_b) {
933
+ case "ValidationException": return [3, 2];
934
+ case "com.amazonaws.fis#ValidationException": return [3, 2];
935
+ }
936
+ return [3, 4];
937
+ case 2: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
938
+ case 3: throw _d.sent();
939
+ case 4:
940
+ parsedBody = parsedOutput.body;
941
+ throwDefaultError({
942
+ output: output,
943
+ parsedBody: parsedBody,
944
+ exceptionCtor: __BaseException,
945
+ errorCode: errorCode,
946
+ });
947
+ _d.label = 5;
948
+ case 5: return [2];
949
+ }
950
+ });
951
+ }); };
952
+ export var deserializeAws_restJson1ListTagsForResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
953
+ var contents, data, _a, _b;
954
+ return __generator(this, function (_c) {
955
+ switch (_c.label) {
956
+ case 0:
957
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
958
+ return [2, deserializeAws_restJson1ListTagsForResourceCommandError(output, context)];
959
+ }
960
+ contents = map({
961
+ $metadata: deserializeMetadata(output),
962
+ });
963
+ _a = __expectNonNull;
964
+ _b = __expectObject;
965
+ return [4, parseBody(output.body, context)];
966
+ case 1:
967
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
968
+ if (data.tags != null) {
969
+ contents.tags = deserializeAws_restJson1TagMap(data.tags, context);
970
+ }
971
+ return [2, contents];
972
+ }
973
+ });
974
+ }); };
975
+ var deserializeAws_restJson1ListTagsForResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
976
+ var parsedOutput, _a, errorCode, parsedBody;
977
+ var _b;
978
+ return __generator(this, function (_c) {
979
+ switch (_c.label) {
980
+ case 0:
981
+ _a = [__assign({}, output)];
982
+ _b = {};
983
+ return [4, parseErrorBody(output.body, context)];
984
+ case 1:
985
+ parsedOutput = __assign.apply(void 0, _a.concat([(_b.body = _c.sent(), _b)]));
986
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
987
+ parsedBody = parsedOutput.body;
988
+ throwDefaultError({
989
+ output: output,
990
+ parsedBody: parsedBody,
991
+ exceptionCtor: __BaseException,
992
+ errorCode: errorCode,
993
+ });
994
+ return [2];
995
+ }
996
+ });
997
+ }); };
998
+ export var deserializeAws_restJson1ListTargetResourceTypesCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
999
+ var contents, data, _a, _b;
1000
+ return __generator(this, function (_c) {
1001
+ switch (_c.label) {
1002
+ case 0:
1003
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1004
+ return [2, deserializeAws_restJson1ListTargetResourceTypesCommandError(output, context)];
1005
+ }
1006
+ contents = map({
1007
+ $metadata: deserializeMetadata(output),
1008
+ });
1009
+ _a = __expectNonNull;
1010
+ _b = __expectObject;
1011
+ return [4, parseBody(output.body, context)];
1012
+ case 1:
1013
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1014
+ if (data.nextToken != null) {
1015
+ contents.nextToken = __expectString(data.nextToken);
1016
+ }
1017
+ if (data.targetResourceTypes != null) {
1018
+ contents.targetResourceTypes = deserializeAws_restJson1TargetResourceTypeSummaryList(data.targetResourceTypes, context);
1019
+ }
1020
+ return [2, contents];
1021
+ }
1022
+ });
1023
+ }); };
1024
+ var deserializeAws_restJson1ListTargetResourceTypesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1025
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1026
+ var _c;
1027
+ return __generator(this, function (_d) {
1028
+ switch (_d.label) {
1029
+ case 0:
1030
+ _a = [__assign({}, output)];
1031
+ _c = {};
1032
+ return [4, parseErrorBody(output.body, context)];
1033
+ case 1:
1034
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1035
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1036
+ _b = errorCode;
1037
+ switch (_b) {
1038
+ case "ValidationException": return [3, 2];
1039
+ case "com.amazonaws.fis#ValidationException": return [3, 2];
1040
+ }
1041
+ return [3, 4];
1042
+ case 2: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1043
+ case 3: throw _d.sent();
1044
+ case 4:
1045
+ parsedBody = parsedOutput.body;
1046
+ throwDefaultError({
1047
+ output: output,
1048
+ parsedBody: parsedBody,
1049
+ exceptionCtor: __BaseException,
1050
+ errorCode: errorCode,
1051
+ });
1052
+ _d.label = 5;
1053
+ case 5: return [2];
1054
+ }
1055
+ });
1056
+ }); };
1057
+ export var deserializeAws_restJson1StartExperimentCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1058
+ var contents, data, _a, _b;
1059
+ return __generator(this, function (_c) {
1060
+ switch (_c.label) {
1061
+ case 0:
1062
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1063
+ return [2, deserializeAws_restJson1StartExperimentCommandError(output, context)];
1064
+ }
1065
+ contents = map({
1066
+ $metadata: deserializeMetadata(output),
1067
+ });
1068
+ _a = __expectNonNull;
1069
+ _b = __expectObject;
1070
+ return [4, parseBody(output.body, context)];
1071
+ case 1:
1072
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1073
+ if (data.experiment != null) {
1074
+ contents.experiment = deserializeAws_restJson1Experiment(data.experiment, context);
1075
+ }
1076
+ return [2, contents];
1077
+ }
1078
+ });
1079
+ }); };
1080
+ var deserializeAws_restJson1StartExperimentCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1081
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1082
+ var _c;
1083
+ return __generator(this, function (_d) {
1084
+ switch (_d.label) {
1085
+ case 0:
1086
+ _a = [__assign({}, output)];
1087
+ _c = {};
1088
+ return [4, parseErrorBody(output.body, context)];
1089
+ case 1:
1090
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1091
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1092
+ _b = errorCode;
1093
+ switch (_b) {
1094
+ case "ConflictException": return [3, 2];
1095
+ case "com.amazonaws.fis#ConflictException": return [3, 2];
1096
+ case "ResourceNotFoundException": return [3, 4];
1097
+ case "com.amazonaws.fis#ResourceNotFoundException": return [3, 4];
1098
+ case "ServiceQuotaExceededException": return [3, 6];
1099
+ case "com.amazonaws.fis#ServiceQuotaExceededException": return [3, 6];
1100
+ case "ValidationException": return [3, 8];
1101
+ case "com.amazonaws.fis#ValidationException": return [3, 8];
1102
+ }
1103
+ return [3, 10];
1104
+ case 2: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
1105
+ case 3: throw _d.sent();
1106
+ case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1107
+ case 5: throw _d.sent();
1108
+ case 6: return [4, deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)];
1109
+ case 7: throw _d.sent();
1110
+ case 8: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1111
+ case 9: throw _d.sent();
1112
+ case 10:
1113
+ parsedBody = parsedOutput.body;
1114
+ throwDefaultError({
1115
+ output: output,
1116
+ parsedBody: parsedBody,
1117
+ exceptionCtor: __BaseException,
1118
+ errorCode: errorCode,
1119
+ });
1120
+ _d.label = 11;
1121
+ case 11: return [2];
1122
+ }
1123
+ });
1124
+ }); };
1125
+ export var deserializeAws_restJson1StopExperimentCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1126
+ var contents, data, _a, _b;
1127
+ return __generator(this, function (_c) {
1128
+ switch (_c.label) {
1129
+ case 0:
1130
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1131
+ return [2, deserializeAws_restJson1StopExperimentCommandError(output, context)];
1132
+ }
1133
+ contents = map({
1134
+ $metadata: deserializeMetadata(output),
1135
+ });
1136
+ _a = __expectNonNull;
1137
+ _b = __expectObject;
1138
+ return [4, parseBody(output.body, context)];
1139
+ case 1:
1140
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1141
+ if (data.experiment != null) {
1142
+ contents.experiment = deserializeAws_restJson1Experiment(data.experiment, context);
1143
+ }
1144
+ return [2, contents];
1145
+ }
1146
+ });
1147
+ }); };
1148
+ var deserializeAws_restJson1StopExperimentCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1149
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1150
+ var _c;
1151
+ return __generator(this, function (_d) {
1152
+ switch (_d.label) {
1153
+ case 0:
1154
+ _a = [__assign({}, output)];
1155
+ _c = {};
1156
+ return [4, parseErrorBody(output.body, context)];
1157
+ case 1:
1158
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1159
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1160
+ _b = errorCode;
1161
+ switch (_b) {
1162
+ case "ResourceNotFoundException": return [3, 2];
1163
+ case "com.amazonaws.fis#ResourceNotFoundException": return [3, 2];
1164
+ case "ValidationException": return [3, 4];
1165
+ case "com.amazonaws.fis#ValidationException": return [3, 4];
1166
+ }
1167
+ return [3, 6];
1168
+ case 2: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1169
+ case 3: throw _d.sent();
1170
+ case 4: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1171
+ case 5: throw _d.sent();
1172
+ case 6:
1173
+ parsedBody = parsedOutput.body;
1174
+ throwDefaultError({
1175
+ output: output,
1176
+ parsedBody: parsedBody,
1177
+ exceptionCtor: __BaseException,
1178
+ errorCode: errorCode,
1179
+ });
1180
+ _d.label = 7;
1181
+ case 7: return [2];
1182
+ }
1183
+ });
1184
+ }); };
1185
+ export var deserializeAws_restJson1TagResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1186
+ var contents;
1187
+ return __generator(this, function (_a) {
1188
+ switch (_a.label) {
1189
+ case 0:
1190
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1191
+ return [2, deserializeAws_restJson1TagResourceCommandError(output, context)];
1192
+ }
1193
+ contents = map({
1194
+ $metadata: deserializeMetadata(output),
1195
+ });
1196
+ return [4, collectBody(output.body, context)];
1197
+ case 1:
1198
+ _a.sent();
1199
+ return [2, contents];
1200
+ }
1201
+ });
1202
+ }); };
1203
+ var deserializeAws_restJson1TagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1204
+ var parsedOutput, _a, errorCode, parsedBody;
1205
+ var _b;
1206
+ return __generator(this, function (_c) {
1207
+ switch (_c.label) {
1208
+ case 0:
1209
+ _a = [__assign({}, output)];
1210
+ _b = {};
1211
+ return [4, parseErrorBody(output.body, context)];
1212
+ case 1:
1213
+ parsedOutput = __assign.apply(void 0, _a.concat([(_b.body = _c.sent(), _b)]));
1214
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1215
+ parsedBody = parsedOutput.body;
1216
+ throwDefaultError({
1217
+ output: output,
1218
+ parsedBody: parsedBody,
1219
+ exceptionCtor: __BaseException,
1220
+ errorCode: errorCode,
1221
+ });
1222
+ return [2];
1223
+ }
1224
+ });
1225
+ }); };
1226
+ export var deserializeAws_restJson1UntagResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1227
+ var contents;
1228
+ return __generator(this, function (_a) {
1229
+ switch (_a.label) {
1230
+ case 0:
1231
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1232
+ return [2, deserializeAws_restJson1UntagResourceCommandError(output, context)];
1233
+ }
1234
+ contents = map({
1235
+ $metadata: deserializeMetadata(output),
1236
+ });
1237
+ return [4, collectBody(output.body, context)];
1238
+ case 1:
1239
+ _a.sent();
1240
+ return [2, contents];
1241
+ }
1242
+ });
1243
+ }); };
1244
+ var deserializeAws_restJson1UntagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1245
+ var parsedOutput, _a, errorCode, parsedBody;
1246
+ var _b;
1247
+ return __generator(this, function (_c) {
1248
+ switch (_c.label) {
1249
+ case 0:
1250
+ _a = [__assign({}, output)];
1251
+ _b = {};
1252
+ return [4, parseErrorBody(output.body, context)];
1253
+ case 1:
1254
+ parsedOutput = __assign.apply(void 0, _a.concat([(_b.body = _c.sent(), _b)]));
1255
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1256
+ parsedBody = parsedOutput.body;
1257
+ throwDefaultError({
1258
+ output: output,
1259
+ parsedBody: parsedBody,
1260
+ exceptionCtor: __BaseException,
1261
+ errorCode: errorCode,
1262
+ });
1263
+ return [2];
1264
+ }
1265
+ });
1266
+ }); };
1267
+ export var deserializeAws_restJson1UpdateExperimentTemplateCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1268
+ var contents, data, _a, _b;
1269
+ return __generator(this, function (_c) {
1270
+ switch (_c.label) {
1271
+ case 0:
1272
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1273
+ return [2, deserializeAws_restJson1UpdateExperimentTemplateCommandError(output, context)];
1274
+ }
1275
+ contents = map({
1276
+ $metadata: deserializeMetadata(output),
1277
+ });
1278
+ _a = __expectNonNull;
1279
+ _b = __expectObject;
1280
+ return [4, parseBody(output.body, context)];
1281
+ case 1:
1282
+ data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1283
+ if (data.experimentTemplate != null) {
1284
+ contents.experimentTemplate = deserializeAws_restJson1ExperimentTemplate(data.experimentTemplate, context);
1285
+ }
1286
+ return [2, contents];
1287
+ }
1288
+ });
1289
+ }); };
1290
+ var deserializeAws_restJson1UpdateExperimentTemplateCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1291
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1292
+ var _c;
1293
+ return __generator(this, function (_d) {
1294
+ switch (_d.label) {
1295
+ case 0:
1296
+ _a = [__assign({}, output)];
1297
+ _c = {};
1298
+ return [4, parseErrorBody(output.body, context)];
1299
+ case 1:
1300
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1301
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1302
+ _b = errorCode;
1303
+ switch (_b) {
1304
+ case "ResourceNotFoundException": return [3, 2];
1305
+ case "com.amazonaws.fis#ResourceNotFoundException": return [3, 2];
1306
+ case "ServiceQuotaExceededException": return [3, 4];
1307
+ case "com.amazonaws.fis#ServiceQuotaExceededException": return [3, 4];
1308
+ case "ValidationException": return [3, 6];
1309
+ case "com.amazonaws.fis#ValidationException": return [3, 6];
1310
+ }
1311
+ return [3, 8];
1312
+ case 2: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1313
+ case 3: throw _d.sent();
1314
+ case 4: return [4, deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)];
1315
+ case 5: throw _d.sent();
1316
+ case 6: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1317
+ case 7: throw _d.sent();
1318
+ case 8:
1319
+ parsedBody = parsedOutput.body;
1320
+ throwDefaultError({
1321
+ output: output,
1322
+ parsedBody: parsedBody,
1323
+ exceptionCtor: __BaseException,
1324
+ errorCode: errorCode,
1325
+ });
1326
+ _d.label = 9;
1327
+ case 9: return [2];
1328
+ }
1329
+ });
1330
+ }); };
1331
+ var map = __map;
1332
+ var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1333
+ var contents, data, exception;
1334
+ return __generator(this, function (_a) {
1335
+ contents = map({});
1336
+ data = parsedOutput.body;
1337
+ if (data.message != null) {
1338
+ contents.message = __expectString(data.message);
1339
+ }
1340
+ exception = new ConflictException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1341
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
1342
+ });
1343
+ }); };
1344
+ var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1345
+ var contents, data, exception;
1346
+ return __generator(this, function (_a) {
1347
+ contents = map({});
1348
+ data = parsedOutput.body;
1349
+ if (data.message != null) {
1350
+ contents.message = __expectString(data.message);
1351
+ }
1352
+ exception = new ResourceNotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1353
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
1354
+ });
1355
+ }); };
1356
+ var deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1357
+ var contents, data, exception;
1358
+ return __generator(this, function (_a) {
1359
+ contents = map({});
1360
+ data = parsedOutput.body;
1361
+ if (data.message != null) {
1362
+ contents.message = __expectString(data.message);
1363
+ }
1364
+ exception = new ServiceQuotaExceededException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1365
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
1366
+ });
1367
+ }); };
1368
+ var deserializeAws_restJson1ValidationExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1369
+ var contents, data, exception;
1370
+ return __generator(this, function (_a) {
1371
+ contents = map({});
1372
+ data = parsedOutput.body;
1373
+ if (data.message != null) {
1374
+ contents.message = __expectString(data.message);
1375
+ }
1376
+ exception = new ValidationException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1377
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
1378
+ });
1379
+ }); };
1380
+ var serializeAws_restJson1CreateExperimentTemplateActionInput = function (input, context) {
1381
+ return __assign(__assign(__assign(__assign(__assign({}, (input.actionId != null && { actionId: input.actionId })), (input.description != null && { description: input.description })), (input.parameters != null && {
1382
+ parameters: serializeAws_restJson1ExperimentTemplateActionParameterMap(input.parameters, context),
1383
+ })), (input.startAfter != null && {
1384
+ startAfter: serializeAws_restJson1ExperimentTemplateActionStartAfterList(input.startAfter, context),
1385
+ })), (input.targets != null && {
1386
+ targets: serializeAws_restJson1ExperimentTemplateActionTargetMap(input.targets, context),
1387
+ }));
1388
+ };
1389
+ var serializeAws_restJson1CreateExperimentTemplateActionInputMap = function (input, context) {
1390
+ return Object.entries(input).reduce(function (acc, _a) {
1391
+ var _b;
1392
+ var _c = __read(_a, 2), key = _c[0], value = _c[1];
954
1393
  if (value === null) {
955
1394
  return acc;
956
1395
  }
957
- return {
958
- ...acc,
959
- [key]: serializeAws_restJson1CreateExperimentTemplateActionInput(value, context),
960
- };
1396
+ return __assign(__assign({}, acc), (_b = {}, _b[key] = serializeAws_restJson1CreateExperimentTemplateActionInput(value, context), _b));
961
1397
  }, {});
962
1398
  };
963
- const serializeAws_restJson1CreateExperimentTemplateLogConfigurationInput = (input, context) => {
964
- return {
965
- ...(input.cloudWatchLogsConfiguration != null && {
966
- cloudWatchLogsConfiguration: serializeAws_restJson1ExperimentTemplateCloudWatchLogsLogConfigurationInput(input.cloudWatchLogsConfiguration, context),
967
- }),
968
- ...(input.logSchemaVersion != null && { logSchemaVersion: input.logSchemaVersion }),
969
- ...(input.s3Configuration != null && {
970
- s3Configuration: serializeAws_restJson1ExperimentTemplateS3LogConfigurationInput(input.s3Configuration, context),
971
- }),
972
- };
1399
+ var serializeAws_restJson1CreateExperimentTemplateLogConfigurationInput = function (input, context) {
1400
+ return __assign(__assign(__assign({}, (input.cloudWatchLogsConfiguration != null && {
1401
+ cloudWatchLogsConfiguration: serializeAws_restJson1ExperimentTemplateCloudWatchLogsLogConfigurationInput(input.cloudWatchLogsConfiguration, context),
1402
+ })), (input.logSchemaVersion != null && { logSchemaVersion: input.logSchemaVersion })), (input.s3Configuration != null && {
1403
+ s3Configuration: serializeAws_restJson1ExperimentTemplateS3LogConfigurationInput(input.s3Configuration, context),
1404
+ }));
973
1405
  };
974
- const serializeAws_restJson1CreateExperimentTemplateStopConditionInput = (input, context) => {
975
- return {
976
- ...(input.source != null && { source: input.source }),
977
- ...(input.value != null && { value: input.value }),
978
- };
1406
+ var serializeAws_restJson1CreateExperimentTemplateStopConditionInput = function (input, context) {
1407
+ return __assign(__assign({}, (input.source != null && { source: input.source })), (input.value != null && { value: input.value }));
979
1408
  };
980
- const serializeAws_restJson1CreateExperimentTemplateStopConditionInputList = (input, context) => {
1409
+ var serializeAws_restJson1CreateExperimentTemplateStopConditionInputList = function (input, context) {
981
1410
  return input
982
- .filter((e) => e != null)
983
- .map((entry) => {
1411
+ .filter(function (e) { return e != null; })
1412
+ .map(function (entry) {
984
1413
  return serializeAws_restJson1CreateExperimentTemplateStopConditionInput(entry, context);
985
1414
  });
986
1415
  };
987
- const serializeAws_restJson1CreateExperimentTemplateTargetInput = (input, context) => {
988
- return {
989
- ...(input.filters != null && {
990
- filters: serializeAws_restJson1ExperimentTemplateTargetFilterInputList(input.filters, context),
991
- }),
992
- ...(input.parameters != null && {
993
- parameters: serializeAws_restJson1ExperimentTemplateTargetParameterMap(input.parameters, context),
994
- }),
995
- ...(input.resourceArns != null && {
996
- resourceArns: serializeAws_restJson1ResourceArnList(input.resourceArns, context),
997
- }),
998
- ...(input.resourceTags != null && { resourceTags: serializeAws_restJson1TagMap(input.resourceTags, context) }),
999
- ...(input.resourceType != null && { resourceType: input.resourceType }),
1000
- ...(input.selectionMode != null && { selectionMode: input.selectionMode }),
1001
- };
1416
+ var serializeAws_restJson1CreateExperimentTemplateTargetInput = function (input, context) {
1417
+ return __assign(__assign(__assign(__assign(__assign(__assign({}, (input.filters != null && {
1418
+ filters: serializeAws_restJson1ExperimentTemplateTargetFilterInputList(input.filters, context),
1419
+ })), (input.parameters != null && {
1420
+ parameters: serializeAws_restJson1ExperimentTemplateTargetParameterMap(input.parameters, context),
1421
+ })), (input.resourceArns != null && {
1422
+ resourceArns: serializeAws_restJson1ResourceArnList(input.resourceArns, context),
1423
+ })), (input.resourceTags != null && { resourceTags: serializeAws_restJson1TagMap(input.resourceTags, context) })), (input.resourceType != null && { resourceType: input.resourceType })), (input.selectionMode != null && { selectionMode: input.selectionMode }));
1002
1424
  };
1003
- const serializeAws_restJson1CreateExperimentTemplateTargetInputMap = (input, context) => {
1004
- return Object.entries(input).reduce((acc, [key, value]) => {
1425
+ var serializeAws_restJson1CreateExperimentTemplateTargetInputMap = function (input, context) {
1426
+ return Object.entries(input).reduce(function (acc, _a) {
1427
+ var _b;
1428
+ var _c = __read(_a, 2), key = _c[0], value = _c[1];
1005
1429
  if (value === null) {
1006
1430
  return acc;
1007
1431
  }
1008
- return {
1009
- ...acc,
1010
- [key]: serializeAws_restJson1CreateExperimentTemplateTargetInput(value, context),
1011
- };
1432
+ return __assign(__assign({}, acc), (_b = {}, _b[key] = serializeAws_restJson1CreateExperimentTemplateTargetInput(value, context), _b));
1012
1433
  }, {});
1013
1434
  };
1014
- const serializeAws_restJson1ExperimentTemplateActionParameterMap = (input, context) => {
1015
- return Object.entries(input).reduce((acc, [key, value]) => {
1435
+ var serializeAws_restJson1ExperimentTemplateActionParameterMap = function (input, context) {
1436
+ return Object.entries(input).reduce(function (acc, _a) {
1437
+ var _b;
1438
+ var _c = __read(_a, 2), key = _c[0], value = _c[1];
1016
1439
  if (value === null) {
1017
1440
  return acc;
1018
1441
  }
1019
- return {
1020
- ...acc,
1021
- [key]: value,
1022
- };
1442
+ return __assign(__assign({}, acc), (_b = {}, _b[key] = value, _b));
1023
1443
  }, {});
1024
1444
  };
1025
- const serializeAws_restJson1ExperimentTemplateActionStartAfterList = (input, context) => {
1445
+ var serializeAws_restJson1ExperimentTemplateActionStartAfterList = function (input, context) {
1026
1446
  return input
1027
- .filter((e) => e != null)
1028
- .map((entry) => {
1447
+ .filter(function (e) { return e != null; })
1448
+ .map(function (entry) {
1029
1449
  return entry;
1030
1450
  });
1031
1451
  };
1032
- const serializeAws_restJson1ExperimentTemplateActionTargetMap = (input, context) => {
1033
- return Object.entries(input).reduce((acc, [key, value]) => {
1452
+ var serializeAws_restJson1ExperimentTemplateActionTargetMap = function (input, context) {
1453
+ return Object.entries(input).reduce(function (acc, _a) {
1454
+ var _b;
1455
+ var _c = __read(_a, 2), key = _c[0], value = _c[1];
1034
1456
  if (value === null) {
1035
1457
  return acc;
1036
1458
  }
1037
- return {
1038
- ...acc,
1039
- [key]: value,
1040
- };
1459
+ return __assign(__assign({}, acc), (_b = {}, _b[key] = value, _b));
1041
1460
  }, {});
1042
1461
  };
1043
- const serializeAws_restJson1ExperimentTemplateCloudWatchLogsLogConfigurationInput = (input, context) => {
1044
- return {
1045
- ...(input.logGroupArn != null && { logGroupArn: input.logGroupArn }),
1046
- };
1462
+ var serializeAws_restJson1ExperimentTemplateCloudWatchLogsLogConfigurationInput = function (input, context) {
1463
+ return __assign({}, (input.logGroupArn != null && { logGroupArn: input.logGroupArn }));
1047
1464
  };
1048
- const serializeAws_restJson1ExperimentTemplateS3LogConfigurationInput = (input, context) => {
1049
- return {
1050
- ...(input.bucketName != null && { bucketName: input.bucketName }),
1051
- ...(input.prefix != null && { prefix: input.prefix }),
1052
- };
1465
+ var serializeAws_restJson1ExperimentTemplateS3LogConfigurationInput = function (input, context) {
1466
+ return __assign(__assign({}, (input.bucketName != null && { bucketName: input.bucketName })), (input.prefix != null && { prefix: input.prefix }));
1053
1467
  };
1054
- const serializeAws_restJson1ExperimentTemplateTargetFilterInputList = (input, context) => {
1468
+ var serializeAws_restJson1ExperimentTemplateTargetFilterInputList = function (input, context) {
1055
1469
  return input
1056
- .filter((e) => e != null)
1057
- .map((entry) => {
1470
+ .filter(function (e) { return e != null; })
1471
+ .map(function (entry) {
1058
1472
  return serializeAws_restJson1ExperimentTemplateTargetInputFilter(entry, context);
1059
1473
  });
1060
1474
  };
1061
- const serializeAws_restJson1ExperimentTemplateTargetFilterValues = (input, context) => {
1475
+ var serializeAws_restJson1ExperimentTemplateTargetFilterValues = function (input, context) {
1062
1476
  return input
1063
- .filter((e) => e != null)
1064
- .map((entry) => {
1477
+ .filter(function (e) { return e != null; })
1478
+ .map(function (entry) {
1065
1479
  return entry;
1066
1480
  });
1067
1481
  };
1068
- const serializeAws_restJson1ExperimentTemplateTargetInputFilter = (input, context) => {
1069
- return {
1070
- ...(input.path != null && { path: input.path }),
1071
- ...(input.values != null && {
1072
- values: serializeAws_restJson1ExperimentTemplateTargetFilterValues(input.values, context),
1073
- }),
1074
- };
1482
+ var serializeAws_restJson1ExperimentTemplateTargetInputFilter = function (input, context) {
1483
+ return __assign(__assign({}, (input.path != null && { path: input.path })), (input.values != null && {
1484
+ values: serializeAws_restJson1ExperimentTemplateTargetFilterValues(input.values, context),
1485
+ }));
1075
1486
  };
1076
- const serializeAws_restJson1ExperimentTemplateTargetParameterMap = (input, context) => {
1077
- return Object.entries(input).reduce((acc, [key, value]) => {
1487
+ var serializeAws_restJson1ExperimentTemplateTargetParameterMap = function (input, context) {
1488
+ return Object.entries(input).reduce(function (acc, _a) {
1489
+ var _b;
1490
+ var _c = __read(_a, 2), key = _c[0], value = _c[1];
1078
1491
  if (value === null) {
1079
1492
  return acc;
1080
1493
  }
1081
- return {
1082
- ...acc,
1083
- [key]: value,
1084
- };
1494
+ return __assign(__assign({}, acc), (_b = {}, _b[key] = value, _b));
1085
1495
  }, {});
1086
1496
  };
1087
- const serializeAws_restJson1ResourceArnList = (input, context) => {
1497
+ var serializeAws_restJson1ResourceArnList = function (input, context) {
1088
1498
  return input
1089
- .filter((e) => e != null)
1090
- .map((entry) => {
1499
+ .filter(function (e) { return e != null; })
1500
+ .map(function (entry) {
1091
1501
  return entry;
1092
1502
  });
1093
1503
  };
1094
- const serializeAws_restJson1TagMap = (input, context) => {
1095
- return Object.entries(input).reduce((acc, [key, value]) => {
1504
+ var serializeAws_restJson1TagMap = function (input, context) {
1505
+ return Object.entries(input).reduce(function (acc, _a) {
1506
+ var _b;
1507
+ var _c = __read(_a, 2), key = _c[0], value = _c[1];
1096
1508
  if (value === null) {
1097
1509
  return acc;
1098
1510
  }
1099
- return {
1100
- ...acc,
1101
- [key]: value,
1102
- };
1511
+ return __assign(__assign({}, acc), (_b = {}, _b[key] = value, _b));
1103
1512
  }, {});
1104
1513
  };
1105
- const serializeAws_restJson1UpdateExperimentTemplateActionInputItem = (input, context) => {
1106
- return {
1107
- ...(input.actionId != null && { actionId: input.actionId }),
1108
- ...(input.description != null && { description: input.description }),
1109
- ...(input.parameters != null && {
1110
- parameters: serializeAws_restJson1ExperimentTemplateActionParameterMap(input.parameters, context),
1111
- }),
1112
- ...(input.startAfter != null && {
1113
- startAfter: serializeAws_restJson1ExperimentTemplateActionStartAfterList(input.startAfter, context),
1114
- }),
1115
- ...(input.targets != null && {
1116
- targets: serializeAws_restJson1ExperimentTemplateActionTargetMap(input.targets, context),
1117
- }),
1118
- };
1119
- };
1120
- const serializeAws_restJson1UpdateExperimentTemplateActionInputMap = (input, context) => {
1121
- return Object.entries(input).reduce((acc, [key, value]) => {
1514
+ var serializeAws_restJson1UpdateExperimentTemplateActionInputItem = function (input, context) {
1515
+ return __assign(__assign(__assign(__assign(__assign({}, (input.actionId != null && { actionId: input.actionId })), (input.description != null && { description: input.description })), (input.parameters != null && {
1516
+ parameters: serializeAws_restJson1ExperimentTemplateActionParameterMap(input.parameters, context),
1517
+ })), (input.startAfter != null && {
1518
+ startAfter: serializeAws_restJson1ExperimentTemplateActionStartAfterList(input.startAfter, context),
1519
+ })), (input.targets != null && {
1520
+ targets: serializeAws_restJson1ExperimentTemplateActionTargetMap(input.targets, context),
1521
+ }));
1522
+ };
1523
+ var serializeAws_restJson1UpdateExperimentTemplateActionInputMap = function (input, context) {
1524
+ return Object.entries(input).reduce(function (acc, _a) {
1525
+ var _b;
1526
+ var _c = __read(_a, 2), key = _c[0], value = _c[1];
1122
1527
  if (value === null) {
1123
1528
  return acc;
1124
1529
  }
1125
- return {
1126
- ...acc,
1127
- [key]: serializeAws_restJson1UpdateExperimentTemplateActionInputItem(value, context),
1128
- };
1530
+ return __assign(__assign({}, acc), (_b = {}, _b[key] = serializeAws_restJson1UpdateExperimentTemplateActionInputItem(value, context), _b));
1129
1531
  }, {});
1130
1532
  };
1131
- const serializeAws_restJson1UpdateExperimentTemplateLogConfigurationInput = (input, context) => {
1132
- return {
1133
- ...(input.cloudWatchLogsConfiguration != null && {
1134
- cloudWatchLogsConfiguration: serializeAws_restJson1ExperimentTemplateCloudWatchLogsLogConfigurationInput(input.cloudWatchLogsConfiguration, context),
1135
- }),
1136
- ...(input.logSchemaVersion != null && { logSchemaVersion: input.logSchemaVersion }),
1137
- ...(input.s3Configuration != null && {
1138
- s3Configuration: serializeAws_restJson1ExperimentTemplateS3LogConfigurationInput(input.s3Configuration, context),
1139
- }),
1140
- };
1533
+ var serializeAws_restJson1UpdateExperimentTemplateLogConfigurationInput = function (input, context) {
1534
+ return __assign(__assign(__assign({}, (input.cloudWatchLogsConfiguration != null && {
1535
+ cloudWatchLogsConfiguration: serializeAws_restJson1ExperimentTemplateCloudWatchLogsLogConfigurationInput(input.cloudWatchLogsConfiguration, context),
1536
+ })), (input.logSchemaVersion != null && { logSchemaVersion: input.logSchemaVersion })), (input.s3Configuration != null && {
1537
+ s3Configuration: serializeAws_restJson1ExperimentTemplateS3LogConfigurationInput(input.s3Configuration, context),
1538
+ }));
1141
1539
  };
1142
- const serializeAws_restJson1UpdateExperimentTemplateStopConditionInput = (input, context) => {
1143
- return {
1144
- ...(input.source != null && { source: input.source }),
1145
- ...(input.value != null && { value: input.value }),
1146
- };
1540
+ var serializeAws_restJson1UpdateExperimentTemplateStopConditionInput = function (input, context) {
1541
+ return __assign(__assign({}, (input.source != null && { source: input.source })), (input.value != null && { value: input.value }));
1147
1542
  };
1148
- const serializeAws_restJson1UpdateExperimentTemplateStopConditionInputList = (input, context) => {
1543
+ var serializeAws_restJson1UpdateExperimentTemplateStopConditionInputList = function (input, context) {
1149
1544
  return input
1150
- .filter((e) => e != null)
1151
- .map((entry) => {
1545
+ .filter(function (e) { return e != null; })
1546
+ .map(function (entry) {
1152
1547
  return serializeAws_restJson1UpdateExperimentTemplateStopConditionInput(entry, context);
1153
1548
  });
1154
1549
  };
1155
- const serializeAws_restJson1UpdateExperimentTemplateTargetInput = (input, context) => {
1156
- return {
1157
- ...(input.filters != null && {
1158
- filters: serializeAws_restJson1ExperimentTemplateTargetFilterInputList(input.filters, context),
1159
- }),
1160
- ...(input.parameters != null && {
1161
- parameters: serializeAws_restJson1ExperimentTemplateTargetParameterMap(input.parameters, context),
1162
- }),
1163
- ...(input.resourceArns != null && {
1164
- resourceArns: serializeAws_restJson1ResourceArnList(input.resourceArns, context),
1165
- }),
1166
- ...(input.resourceTags != null && { resourceTags: serializeAws_restJson1TagMap(input.resourceTags, context) }),
1167
- ...(input.resourceType != null && { resourceType: input.resourceType }),
1168
- ...(input.selectionMode != null && { selectionMode: input.selectionMode }),
1169
- };
1550
+ var serializeAws_restJson1UpdateExperimentTemplateTargetInput = function (input, context) {
1551
+ return __assign(__assign(__assign(__assign(__assign(__assign({}, (input.filters != null && {
1552
+ filters: serializeAws_restJson1ExperimentTemplateTargetFilterInputList(input.filters, context),
1553
+ })), (input.parameters != null && {
1554
+ parameters: serializeAws_restJson1ExperimentTemplateTargetParameterMap(input.parameters, context),
1555
+ })), (input.resourceArns != null && {
1556
+ resourceArns: serializeAws_restJson1ResourceArnList(input.resourceArns, context),
1557
+ })), (input.resourceTags != null && { resourceTags: serializeAws_restJson1TagMap(input.resourceTags, context) })), (input.resourceType != null && { resourceType: input.resourceType })), (input.selectionMode != null && { selectionMode: input.selectionMode }));
1170
1558
  };
1171
- const serializeAws_restJson1UpdateExperimentTemplateTargetInputMap = (input, context) => {
1172
- return Object.entries(input).reduce((acc, [key, value]) => {
1559
+ var serializeAws_restJson1UpdateExperimentTemplateTargetInputMap = function (input, context) {
1560
+ return Object.entries(input).reduce(function (acc, _a) {
1561
+ var _b;
1562
+ var _c = __read(_a, 2), key = _c[0], value = _c[1];
1173
1563
  if (value === null) {
1174
1564
  return acc;
1175
1565
  }
1176
- return {
1177
- ...acc,
1178
- [key]: serializeAws_restJson1UpdateExperimentTemplateTargetInput(value, context),
1179
- };
1566
+ return __assign(__assign({}, acc), (_b = {}, _b[key] = serializeAws_restJson1UpdateExperimentTemplateTargetInput(value, context), _b));
1180
1567
  }, {});
1181
1568
  };
1182
- const deserializeAws_restJson1Action = (output, context) => {
1569
+ var deserializeAws_restJson1Action = function (output, context) {
1183
1570
  return {
1184
1571
  description: __expectString(output.description),
1185
1572
  id: __expectString(output.id),
@@ -1188,24 +1575,23 @@ const deserializeAws_restJson1Action = (output, context) => {
1188
1575
  targets: output.targets != null ? deserializeAws_restJson1ActionTargetMap(output.targets, context) : undefined,
1189
1576
  };
1190
1577
  };
1191
- const deserializeAws_restJson1ActionParameter = (output, context) => {
1578
+ var deserializeAws_restJson1ActionParameter = function (output, context) {
1192
1579
  return {
1193
1580
  description: __expectString(output.description),
1194
1581
  required: __expectBoolean(output.required),
1195
1582
  };
1196
1583
  };
1197
- const deserializeAws_restJson1ActionParameterMap = (output, context) => {
1198
- return Object.entries(output).reduce((acc, [key, value]) => {
1584
+ var deserializeAws_restJson1ActionParameterMap = function (output, context) {
1585
+ return Object.entries(output).reduce(function (acc, _a) {
1586
+ var _b;
1587
+ var _c = __read(_a, 2), key = _c[0], value = _c[1];
1199
1588
  if (value === null) {
1200
1589
  return acc;
1201
1590
  }
1202
- return {
1203
- ...acc,
1204
- [key]: deserializeAws_restJson1ActionParameter(value, context),
1205
- };
1591
+ return __assign(__assign({}, acc), (_b = {}, _b[key] = deserializeAws_restJson1ActionParameter(value, context), _b));
1206
1592
  }, {});
1207
1593
  };
1208
- const deserializeAws_restJson1ActionSummary = (output, context) => {
1594
+ var deserializeAws_restJson1ActionSummary = function (output, context) {
1209
1595
  return {
1210
1596
  description: __expectString(output.description),
1211
1597
  id: __expectString(output.id),
@@ -1213,10 +1599,10 @@ const deserializeAws_restJson1ActionSummary = (output, context) => {
1213
1599
  targets: output.targets != null ? deserializeAws_restJson1ActionTargetMap(output.targets, context) : undefined,
1214
1600
  };
1215
1601
  };
1216
- const deserializeAws_restJson1ActionSummaryList = (output, context) => {
1217
- const retVal = (output || [])
1218
- .filter((e) => e != null)
1219
- .map((entry) => {
1602
+ var deserializeAws_restJson1ActionSummaryList = function (output, context) {
1603
+ var retVal = (output || [])
1604
+ .filter(function (e) { return e != null; })
1605
+ .map(function (entry) {
1220
1606
  if (entry === null) {
1221
1607
  return null;
1222
1608
  }
@@ -1224,23 +1610,22 @@ const deserializeAws_restJson1ActionSummaryList = (output, context) => {
1224
1610
  });
1225
1611
  return retVal;
1226
1612
  };
1227
- const deserializeAws_restJson1ActionTarget = (output, context) => {
1613
+ var deserializeAws_restJson1ActionTarget = function (output, context) {
1228
1614
  return {
1229
1615
  resourceType: __expectString(output.resourceType),
1230
1616
  };
1231
1617
  };
1232
- const deserializeAws_restJson1ActionTargetMap = (output, context) => {
1233
- return Object.entries(output).reduce((acc, [key, value]) => {
1618
+ var deserializeAws_restJson1ActionTargetMap = function (output, context) {
1619
+ return Object.entries(output).reduce(function (acc, _a) {
1620
+ var _b;
1621
+ var _c = __read(_a, 2), key = _c[0], value = _c[1];
1234
1622
  if (value === null) {
1235
1623
  return acc;
1236
1624
  }
1237
- return {
1238
- ...acc,
1239
- [key]: deserializeAws_restJson1ActionTarget(value, context),
1240
- };
1625
+ return __assign(__assign({}, acc), (_b = {}, _b[key] = deserializeAws_restJson1ActionTarget(value, context), _b));
1241
1626
  }, {});
1242
1627
  };
1243
- const deserializeAws_restJson1Experiment = (output, context) => {
1628
+ var deserializeAws_restJson1Experiment = function (output, context) {
1244
1629
  return {
1245
1630
  actions: output.actions != null ? deserializeAws_restJson1ExperimentActionMap(output.actions, context) : undefined,
1246
1631
  creationTime: output.creationTime != null
@@ -1262,7 +1647,7 @@ const deserializeAws_restJson1Experiment = (output, context) => {
1262
1647
  targets: output.targets != null ? deserializeAws_restJson1ExperimentTargetMap(output.targets, context) : undefined,
1263
1648
  };
1264
1649
  };
1265
- const deserializeAws_restJson1ExperimentAction = (output, context) => {
1650
+ var deserializeAws_restJson1ExperimentAction = function (output, context) {
1266
1651
  return {
1267
1652
  actionId: __expectString(output.actionId),
1268
1653
  description: __expectString(output.description),
@@ -1278,32 +1663,30 @@ const deserializeAws_restJson1ExperimentAction = (output, context) => {
1278
1663
  targets: output.targets != null ? deserializeAws_restJson1ExperimentActionTargetMap(output.targets, context) : undefined,
1279
1664
  };
1280
1665
  };
1281
- const deserializeAws_restJson1ExperimentActionMap = (output, context) => {
1282
- return Object.entries(output).reduce((acc, [key, value]) => {
1666
+ var deserializeAws_restJson1ExperimentActionMap = function (output, context) {
1667
+ return Object.entries(output).reduce(function (acc, _a) {
1668
+ var _b;
1669
+ var _c = __read(_a, 2), key = _c[0], value = _c[1];
1283
1670
  if (value === null) {
1284
1671
  return acc;
1285
1672
  }
1286
- return {
1287
- ...acc,
1288
- [key]: deserializeAws_restJson1ExperimentAction(value, context),
1289
- };
1673
+ return __assign(__assign({}, acc), (_b = {}, _b[key] = deserializeAws_restJson1ExperimentAction(value, context), _b));
1290
1674
  }, {});
1291
1675
  };
1292
- const deserializeAws_restJson1ExperimentActionParameterMap = (output, context) => {
1293
- return Object.entries(output).reduce((acc, [key, value]) => {
1676
+ var deserializeAws_restJson1ExperimentActionParameterMap = function (output, context) {
1677
+ return Object.entries(output).reduce(function (acc, _a) {
1678
+ var _b;
1679
+ var _c = __read(_a, 2), key = _c[0], value = _c[1];
1294
1680
  if (value === null) {
1295
1681
  return acc;
1296
1682
  }
1297
- return {
1298
- ...acc,
1299
- [key]: __expectString(value),
1300
- };
1683
+ return __assign(__assign({}, acc), (_b = {}, _b[key] = __expectString(value), _b));
1301
1684
  }, {});
1302
1685
  };
1303
- const deserializeAws_restJson1ExperimentActionStartAfterList = (output, context) => {
1304
- const retVal = (output || [])
1305
- .filter((e) => e != null)
1306
- .map((entry) => {
1686
+ var deserializeAws_restJson1ExperimentActionStartAfterList = function (output, context) {
1687
+ var retVal = (output || [])
1688
+ .filter(function (e) { return e != null; })
1689
+ .map(function (entry) {
1307
1690
  if (entry === null) {
1308
1691
  return null;
1309
1692
  }
@@ -1311,29 +1694,28 @@ const deserializeAws_restJson1ExperimentActionStartAfterList = (output, context)
1311
1694
  });
1312
1695
  return retVal;
1313
1696
  };
1314
- const deserializeAws_restJson1ExperimentActionState = (output, context) => {
1697
+ var deserializeAws_restJson1ExperimentActionState = function (output, context) {
1315
1698
  return {
1316
1699
  reason: __expectString(output.reason),
1317
1700
  status: __expectString(output.status),
1318
1701
  };
1319
1702
  };
1320
- const deserializeAws_restJson1ExperimentActionTargetMap = (output, context) => {
1321
- return Object.entries(output).reduce((acc, [key, value]) => {
1703
+ var deserializeAws_restJson1ExperimentActionTargetMap = function (output, context) {
1704
+ return Object.entries(output).reduce(function (acc, _a) {
1705
+ var _b;
1706
+ var _c = __read(_a, 2), key = _c[0], value = _c[1];
1322
1707
  if (value === null) {
1323
1708
  return acc;
1324
1709
  }
1325
- return {
1326
- ...acc,
1327
- [key]: __expectString(value),
1328
- };
1710
+ return __assign(__assign({}, acc), (_b = {}, _b[key] = __expectString(value), _b));
1329
1711
  }, {});
1330
1712
  };
1331
- const deserializeAws_restJson1ExperimentCloudWatchLogsLogConfiguration = (output, context) => {
1713
+ var deserializeAws_restJson1ExperimentCloudWatchLogsLogConfiguration = function (output, context) {
1332
1714
  return {
1333
1715
  logGroupArn: __expectString(output.logGroupArn),
1334
1716
  };
1335
1717
  };
1336
- const deserializeAws_restJson1ExperimentLogConfiguration = (output, context) => {
1718
+ var deserializeAws_restJson1ExperimentLogConfiguration = function (output, context) {
1337
1719
  return {
1338
1720
  cloudWatchLogsConfiguration: output.cloudWatchLogsConfiguration != null
1339
1721
  ? deserializeAws_restJson1ExperimentCloudWatchLogsLogConfiguration(output.cloudWatchLogsConfiguration, context)
@@ -1344,28 +1726,28 @@ const deserializeAws_restJson1ExperimentLogConfiguration = (output, context) =>
1344
1726
  : undefined,
1345
1727
  };
1346
1728
  };
1347
- const deserializeAws_restJson1ExperimentS3LogConfiguration = (output, context) => {
1729
+ var deserializeAws_restJson1ExperimentS3LogConfiguration = function (output, context) {
1348
1730
  return {
1349
1731
  bucketName: __expectString(output.bucketName),
1350
1732
  prefix: __expectString(output.prefix),
1351
1733
  };
1352
1734
  };
1353
- const deserializeAws_restJson1ExperimentState = (output, context) => {
1735
+ var deserializeAws_restJson1ExperimentState = function (output, context) {
1354
1736
  return {
1355
1737
  reason: __expectString(output.reason),
1356
1738
  status: __expectString(output.status),
1357
1739
  };
1358
1740
  };
1359
- const deserializeAws_restJson1ExperimentStopCondition = (output, context) => {
1741
+ var deserializeAws_restJson1ExperimentStopCondition = function (output, context) {
1360
1742
  return {
1361
1743
  source: __expectString(output.source),
1362
1744
  value: __expectString(output.value),
1363
1745
  };
1364
1746
  };
1365
- const deserializeAws_restJson1ExperimentStopConditionList = (output, context) => {
1366
- const retVal = (output || [])
1367
- .filter((e) => e != null)
1368
- .map((entry) => {
1747
+ var deserializeAws_restJson1ExperimentStopConditionList = function (output, context) {
1748
+ var retVal = (output || [])
1749
+ .filter(function (e) { return e != null; })
1750
+ .map(function (entry) {
1369
1751
  if (entry === null) {
1370
1752
  return null;
1371
1753
  }
@@ -1373,7 +1755,7 @@ const deserializeAws_restJson1ExperimentStopConditionList = (output, context) =>
1373
1755
  });
1374
1756
  return retVal;
1375
1757
  };
1376
- const deserializeAws_restJson1ExperimentSummary = (output, context) => {
1758
+ var deserializeAws_restJson1ExperimentSummary = function (output, context) {
1377
1759
  return {
1378
1760
  creationTime: output.creationTime != null
1379
1761
  ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.creationTime)))
@@ -1384,10 +1766,10 @@ const deserializeAws_restJson1ExperimentSummary = (output, context) => {
1384
1766
  tags: output.tags != null ? deserializeAws_restJson1TagMap(output.tags, context) : undefined,
1385
1767
  };
1386
1768
  };
1387
- const deserializeAws_restJson1ExperimentSummaryList = (output, context) => {
1388
- const retVal = (output || [])
1389
- .filter((e) => e != null)
1390
- .map((entry) => {
1769
+ var deserializeAws_restJson1ExperimentSummaryList = function (output, context) {
1770
+ var retVal = (output || [])
1771
+ .filter(function (e) { return e != null; })
1772
+ .map(function (entry) {
1391
1773
  if (entry === null) {
1392
1774
  return null;
1393
1775
  }
@@ -1395,7 +1777,7 @@ const deserializeAws_restJson1ExperimentSummaryList = (output, context) => {
1395
1777
  });
1396
1778
  return retVal;
1397
1779
  };
1398
- const deserializeAws_restJson1ExperimentTarget = (output, context) => {
1780
+ var deserializeAws_restJson1ExperimentTarget = function (output, context) {
1399
1781
  return {
1400
1782
  filters: output.filters != null ? deserializeAws_restJson1ExperimentTargetFilterList(output.filters, context) : undefined,
1401
1783
  parameters: output.parameters != null
@@ -1407,16 +1789,16 @@ const deserializeAws_restJson1ExperimentTarget = (output, context) => {
1407
1789
  selectionMode: __expectString(output.selectionMode),
1408
1790
  };
1409
1791
  };
1410
- const deserializeAws_restJson1ExperimentTargetFilter = (output, context) => {
1792
+ var deserializeAws_restJson1ExperimentTargetFilter = function (output, context) {
1411
1793
  return {
1412
1794
  path: __expectString(output.path),
1413
1795
  values: output.values != null ? deserializeAws_restJson1ExperimentTargetFilterValues(output.values, context) : undefined,
1414
1796
  };
1415
1797
  };
1416
- const deserializeAws_restJson1ExperimentTargetFilterList = (output, context) => {
1417
- const retVal = (output || [])
1418
- .filter((e) => e != null)
1419
- .map((entry) => {
1798
+ var deserializeAws_restJson1ExperimentTargetFilterList = function (output, context) {
1799
+ var retVal = (output || [])
1800
+ .filter(function (e) { return e != null; })
1801
+ .map(function (entry) {
1420
1802
  if (entry === null) {
1421
1803
  return null;
1422
1804
  }
@@ -1424,10 +1806,10 @@ const deserializeAws_restJson1ExperimentTargetFilterList = (output, context) =>
1424
1806
  });
1425
1807
  return retVal;
1426
1808
  };
1427
- const deserializeAws_restJson1ExperimentTargetFilterValues = (output, context) => {
1428
- const retVal = (output || [])
1429
- .filter((e) => e != null)
1430
- .map((entry) => {
1809
+ var deserializeAws_restJson1ExperimentTargetFilterValues = function (output, context) {
1810
+ var retVal = (output || [])
1811
+ .filter(function (e) { return e != null; })
1812
+ .map(function (entry) {
1431
1813
  if (entry === null) {
1432
1814
  return null;
1433
1815
  }
@@ -1435,29 +1817,27 @@ const deserializeAws_restJson1ExperimentTargetFilterValues = (output, context) =
1435
1817
  });
1436
1818
  return retVal;
1437
1819
  };
1438
- const deserializeAws_restJson1ExperimentTargetMap = (output, context) => {
1439
- return Object.entries(output).reduce((acc, [key, value]) => {
1820
+ var deserializeAws_restJson1ExperimentTargetMap = function (output, context) {
1821
+ return Object.entries(output).reduce(function (acc, _a) {
1822
+ var _b;
1823
+ var _c = __read(_a, 2), key = _c[0], value = _c[1];
1440
1824
  if (value === null) {
1441
1825
  return acc;
1442
1826
  }
1443
- return {
1444
- ...acc,
1445
- [key]: deserializeAws_restJson1ExperimentTarget(value, context),
1446
- };
1827
+ return __assign(__assign({}, acc), (_b = {}, _b[key] = deserializeAws_restJson1ExperimentTarget(value, context), _b));
1447
1828
  }, {});
1448
1829
  };
1449
- const deserializeAws_restJson1ExperimentTargetParameterMap = (output, context) => {
1450
- return Object.entries(output).reduce((acc, [key, value]) => {
1830
+ var deserializeAws_restJson1ExperimentTargetParameterMap = function (output, context) {
1831
+ return Object.entries(output).reduce(function (acc, _a) {
1832
+ var _b;
1833
+ var _c = __read(_a, 2), key = _c[0], value = _c[1];
1451
1834
  if (value === null) {
1452
1835
  return acc;
1453
1836
  }
1454
- return {
1455
- ...acc,
1456
- [key]: __expectString(value),
1457
- };
1837
+ return __assign(__assign({}, acc), (_b = {}, _b[key] = __expectString(value), _b));
1458
1838
  }, {});
1459
1839
  };
1460
- const deserializeAws_restJson1ExperimentTemplate = (output, context) => {
1840
+ var deserializeAws_restJson1ExperimentTemplate = function (output, context) {
1461
1841
  return {
1462
1842
  actions: output.actions != null ? deserializeAws_restJson1ExperimentTemplateActionMap(output.actions, context) : undefined,
1463
1843
  creationTime: output.creationTime != null
@@ -1479,7 +1859,7 @@ const deserializeAws_restJson1ExperimentTemplate = (output, context) => {
1479
1859
  targets: output.targets != null ? deserializeAws_restJson1ExperimentTemplateTargetMap(output.targets, context) : undefined,
1480
1860
  };
1481
1861
  };
1482
- const deserializeAws_restJson1ExperimentTemplateAction = (output, context) => {
1862
+ var deserializeAws_restJson1ExperimentTemplateAction = function (output, context) {
1483
1863
  return {
1484
1864
  actionId: __expectString(output.actionId),
1485
1865
  description: __expectString(output.description),
@@ -1494,32 +1874,30 @@ const deserializeAws_restJson1ExperimentTemplateAction = (output, context) => {
1494
1874
  : undefined,
1495
1875
  };
1496
1876
  };
1497
- const deserializeAws_restJson1ExperimentTemplateActionMap = (output, context) => {
1498
- return Object.entries(output).reduce((acc, [key, value]) => {
1877
+ var deserializeAws_restJson1ExperimentTemplateActionMap = function (output, context) {
1878
+ return Object.entries(output).reduce(function (acc, _a) {
1879
+ var _b;
1880
+ var _c = __read(_a, 2), key = _c[0], value = _c[1];
1499
1881
  if (value === null) {
1500
1882
  return acc;
1501
1883
  }
1502
- return {
1503
- ...acc,
1504
- [key]: deserializeAws_restJson1ExperimentTemplateAction(value, context),
1505
- };
1884
+ return __assign(__assign({}, acc), (_b = {}, _b[key] = deserializeAws_restJson1ExperimentTemplateAction(value, context), _b));
1506
1885
  }, {});
1507
1886
  };
1508
- const deserializeAws_restJson1ExperimentTemplateActionParameterMap = (output, context) => {
1509
- return Object.entries(output).reduce((acc, [key, value]) => {
1887
+ var deserializeAws_restJson1ExperimentTemplateActionParameterMap = function (output, context) {
1888
+ return Object.entries(output).reduce(function (acc, _a) {
1889
+ var _b;
1890
+ var _c = __read(_a, 2), key = _c[0], value = _c[1];
1510
1891
  if (value === null) {
1511
1892
  return acc;
1512
1893
  }
1513
- return {
1514
- ...acc,
1515
- [key]: __expectString(value),
1516
- };
1894
+ return __assign(__assign({}, acc), (_b = {}, _b[key] = __expectString(value), _b));
1517
1895
  }, {});
1518
1896
  };
1519
- const deserializeAws_restJson1ExperimentTemplateActionStartAfterList = (output, context) => {
1520
- const retVal = (output || [])
1521
- .filter((e) => e != null)
1522
- .map((entry) => {
1897
+ var deserializeAws_restJson1ExperimentTemplateActionStartAfterList = function (output, context) {
1898
+ var retVal = (output || [])
1899
+ .filter(function (e) { return e != null; })
1900
+ .map(function (entry) {
1523
1901
  if (entry === null) {
1524
1902
  return null;
1525
1903
  }
@@ -1527,23 +1905,22 @@ const deserializeAws_restJson1ExperimentTemplateActionStartAfterList = (output,
1527
1905
  });
1528
1906
  return retVal;
1529
1907
  };
1530
- const deserializeAws_restJson1ExperimentTemplateActionTargetMap = (output, context) => {
1531
- return Object.entries(output).reduce((acc, [key, value]) => {
1908
+ var deserializeAws_restJson1ExperimentTemplateActionTargetMap = function (output, context) {
1909
+ return Object.entries(output).reduce(function (acc, _a) {
1910
+ var _b;
1911
+ var _c = __read(_a, 2), key = _c[0], value = _c[1];
1532
1912
  if (value === null) {
1533
1913
  return acc;
1534
1914
  }
1535
- return {
1536
- ...acc,
1537
- [key]: __expectString(value),
1538
- };
1915
+ return __assign(__assign({}, acc), (_b = {}, _b[key] = __expectString(value), _b));
1539
1916
  }, {});
1540
1917
  };
1541
- const deserializeAws_restJson1ExperimentTemplateCloudWatchLogsLogConfiguration = (output, context) => {
1918
+ var deserializeAws_restJson1ExperimentTemplateCloudWatchLogsLogConfiguration = function (output, context) {
1542
1919
  return {
1543
1920
  logGroupArn: __expectString(output.logGroupArn),
1544
1921
  };
1545
1922
  };
1546
- const deserializeAws_restJson1ExperimentTemplateLogConfiguration = (output, context) => {
1923
+ var deserializeAws_restJson1ExperimentTemplateLogConfiguration = function (output, context) {
1547
1924
  return {
1548
1925
  cloudWatchLogsConfiguration: output.cloudWatchLogsConfiguration != null
1549
1926
  ? deserializeAws_restJson1ExperimentTemplateCloudWatchLogsLogConfiguration(output.cloudWatchLogsConfiguration, context)
@@ -1554,22 +1931,22 @@ const deserializeAws_restJson1ExperimentTemplateLogConfiguration = (output, cont
1554
1931
  : undefined,
1555
1932
  };
1556
1933
  };
1557
- const deserializeAws_restJson1ExperimentTemplateS3LogConfiguration = (output, context) => {
1934
+ var deserializeAws_restJson1ExperimentTemplateS3LogConfiguration = function (output, context) {
1558
1935
  return {
1559
1936
  bucketName: __expectString(output.bucketName),
1560
1937
  prefix: __expectString(output.prefix),
1561
1938
  };
1562
1939
  };
1563
- const deserializeAws_restJson1ExperimentTemplateStopCondition = (output, context) => {
1940
+ var deserializeAws_restJson1ExperimentTemplateStopCondition = function (output, context) {
1564
1941
  return {
1565
1942
  source: __expectString(output.source),
1566
1943
  value: __expectString(output.value),
1567
1944
  };
1568
1945
  };
1569
- const deserializeAws_restJson1ExperimentTemplateStopConditionList = (output, context) => {
1570
- const retVal = (output || [])
1571
- .filter((e) => e != null)
1572
- .map((entry) => {
1946
+ var deserializeAws_restJson1ExperimentTemplateStopConditionList = function (output, context) {
1947
+ var retVal = (output || [])
1948
+ .filter(function (e) { return e != null; })
1949
+ .map(function (entry) {
1573
1950
  if (entry === null) {
1574
1951
  return null;
1575
1952
  }
@@ -1577,7 +1954,7 @@ const deserializeAws_restJson1ExperimentTemplateStopConditionList = (output, con
1577
1954
  });
1578
1955
  return retVal;
1579
1956
  };
1580
- const deserializeAws_restJson1ExperimentTemplateSummary = (output, context) => {
1957
+ var deserializeAws_restJson1ExperimentTemplateSummary = function (output, context) {
1581
1958
  return {
1582
1959
  creationTime: output.creationTime != null
1583
1960
  ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.creationTime)))
@@ -1590,10 +1967,10 @@ const deserializeAws_restJson1ExperimentTemplateSummary = (output, context) => {
1590
1967
  tags: output.tags != null ? deserializeAws_restJson1TagMap(output.tags, context) : undefined,
1591
1968
  };
1592
1969
  };
1593
- const deserializeAws_restJson1ExperimentTemplateSummaryList = (output, context) => {
1594
- const retVal = (output || [])
1595
- .filter((e) => e != null)
1596
- .map((entry) => {
1970
+ var deserializeAws_restJson1ExperimentTemplateSummaryList = function (output, context) {
1971
+ var retVal = (output || [])
1972
+ .filter(function (e) { return e != null; })
1973
+ .map(function (entry) {
1597
1974
  if (entry === null) {
1598
1975
  return null;
1599
1976
  }
@@ -1601,7 +1978,7 @@ const deserializeAws_restJson1ExperimentTemplateSummaryList = (output, context)
1601
1978
  });
1602
1979
  return retVal;
1603
1980
  };
1604
- const deserializeAws_restJson1ExperimentTemplateTarget = (output, context) => {
1981
+ var deserializeAws_restJson1ExperimentTemplateTarget = function (output, context) {
1605
1982
  return {
1606
1983
  filters: output.filters != null
1607
1984
  ? deserializeAws_restJson1ExperimentTemplateTargetFilterList(output.filters, context)
@@ -1615,7 +1992,7 @@ const deserializeAws_restJson1ExperimentTemplateTarget = (output, context) => {
1615
1992
  selectionMode: __expectString(output.selectionMode),
1616
1993
  };
1617
1994
  };
1618
- const deserializeAws_restJson1ExperimentTemplateTargetFilter = (output, context) => {
1995
+ var deserializeAws_restJson1ExperimentTemplateTargetFilter = function (output, context) {
1619
1996
  return {
1620
1997
  path: __expectString(output.path),
1621
1998
  values: output.values != null
@@ -1623,10 +2000,10 @@ const deserializeAws_restJson1ExperimentTemplateTargetFilter = (output, context)
1623
2000
  : undefined,
1624
2001
  };
1625
2002
  };
1626
- const deserializeAws_restJson1ExperimentTemplateTargetFilterList = (output, context) => {
1627
- const retVal = (output || [])
1628
- .filter((e) => e != null)
1629
- .map((entry) => {
2003
+ var deserializeAws_restJson1ExperimentTemplateTargetFilterList = function (output, context) {
2004
+ var retVal = (output || [])
2005
+ .filter(function (e) { return e != null; })
2006
+ .map(function (entry) {
1630
2007
  if (entry === null) {
1631
2008
  return null;
1632
2009
  }
@@ -1634,10 +2011,10 @@ const deserializeAws_restJson1ExperimentTemplateTargetFilterList = (output, cont
1634
2011
  });
1635
2012
  return retVal;
1636
2013
  };
1637
- const deserializeAws_restJson1ExperimentTemplateTargetFilterValues = (output, context) => {
1638
- const retVal = (output || [])
1639
- .filter((e) => e != null)
1640
- .map((entry) => {
2014
+ var deserializeAws_restJson1ExperimentTemplateTargetFilterValues = function (output, context) {
2015
+ var retVal = (output || [])
2016
+ .filter(function (e) { return e != null; })
2017
+ .map(function (entry) {
1641
2018
  if (entry === null) {
1642
2019
  return null;
1643
2020
  }
@@ -1645,32 +2022,30 @@ const deserializeAws_restJson1ExperimentTemplateTargetFilterValues = (output, co
1645
2022
  });
1646
2023
  return retVal;
1647
2024
  };
1648
- const deserializeAws_restJson1ExperimentTemplateTargetMap = (output, context) => {
1649
- return Object.entries(output).reduce((acc, [key, value]) => {
2025
+ var deserializeAws_restJson1ExperimentTemplateTargetMap = function (output, context) {
2026
+ return Object.entries(output).reduce(function (acc, _a) {
2027
+ var _b;
2028
+ var _c = __read(_a, 2), key = _c[0], value = _c[1];
1650
2029
  if (value === null) {
1651
2030
  return acc;
1652
2031
  }
1653
- return {
1654
- ...acc,
1655
- [key]: deserializeAws_restJson1ExperimentTemplateTarget(value, context),
1656
- };
2032
+ return __assign(__assign({}, acc), (_b = {}, _b[key] = deserializeAws_restJson1ExperimentTemplateTarget(value, context), _b));
1657
2033
  }, {});
1658
2034
  };
1659
- const deserializeAws_restJson1ExperimentTemplateTargetParameterMap = (output, context) => {
1660
- return Object.entries(output).reduce((acc, [key, value]) => {
2035
+ var deserializeAws_restJson1ExperimentTemplateTargetParameterMap = function (output, context) {
2036
+ return Object.entries(output).reduce(function (acc, _a) {
2037
+ var _b;
2038
+ var _c = __read(_a, 2), key = _c[0], value = _c[1];
1661
2039
  if (value === null) {
1662
2040
  return acc;
1663
2041
  }
1664
- return {
1665
- ...acc,
1666
- [key]: __expectString(value),
1667
- };
2042
+ return __assign(__assign({}, acc), (_b = {}, _b[key] = __expectString(value), _b));
1668
2043
  }, {});
1669
2044
  };
1670
- const deserializeAws_restJson1ResourceArnList = (output, context) => {
1671
- const retVal = (output || [])
1672
- .filter((e) => e != null)
1673
- .map((entry) => {
2045
+ var deserializeAws_restJson1ResourceArnList = function (output, context) {
2046
+ var retVal = (output || [])
2047
+ .filter(function (e) { return e != null; })
2048
+ .map(function (entry) {
1674
2049
  if (entry === null) {
1675
2050
  return null;
1676
2051
  }
@@ -1678,18 +2053,17 @@ const deserializeAws_restJson1ResourceArnList = (output, context) => {
1678
2053
  });
1679
2054
  return retVal;
1680
2055
  };
1681
- const deserializeAws_restJson1TagMap = (output, context) => {
1682
- return Object.entries(output).reduce((acc, [key, value]) => {
2056
+ var deserializeAws_restJson1TagMap = function (output, context) {
2057
+ return Object.entries(output).reduce(function (acc, _a) {
2058
+ var _b;
2059
+ var _c = __read(_a, 2), key = _c[0], value = _c[1];
1683
2060
  if (value === null) {
1684
2061
  return acc;
1685
2062
  }
1686
- return {
1687
- ...acc,
1688
- [key]: __expectString(value),
1689
- };
2063
+ return __assign(__assign({}, acc), (_b = {}, _b[key] = __expectString(value), _b));
1690
2064
  }, {});
1691
2065
  };
1692
- const deserializeAws_restJson1TargetResourceType = (output, context) => {
2066
+ var deserializeAws_restJson1TargetResourceType = function (output, context) {
1693
2067
  return {
1694
2068
  description: __expectString(output.description),
1695
2069
  parameters: output.parameters != null
@@ -1698,33 +2072,32 @@ const deserializeAws_restJson1TargetResourceType = (output, context) => {
1698
2072
  resourceType: __expectString(output.resourceType),
1699
2073
  };
1700
2074
  };
1701
- const deserializeAws_restJson1TargetResourceTypeParameter = (output, context) => {
2075
+ var deserializeAws_restJson1TargetResourceTypeParameter = function (output, context) {
1702
2076
  return {
1703
2077
  description: __expectString(output.description),
1704
2078
  required: __expectBoolean(output.required),
1705
2079
  };
1706
2080
  };
1707
- const deserializeAws_restJson1TargetResourceTypeParameterMap = (output, context) => {
1708
- return Object.entries(output).reduce((acc, [key, value]) => {
2081
+ var deserializeAws_restJson1TargetResourceTypeParameterMap = function (output, context) {
2082
+ return Object.entries(output).reduce(function (acc, _a) {
2083
+ var _b;
2084
+ var _c = __read(_a, 2), key = _c[0], value = _c[1];
1709
2085
  if (value === null) {
1710
2086
  return acc;
1711
2087
  }
1712
- return {
1713
- ...acc,
1714
- [key]: deserializeAws_restJson1TargetResourceTypeParameter(value, context),
1715
- };
2088
+ return __assign(__assign({}, acc), (_b = {}, _b[key] = deserializeAws_restJson1TargetResourceTypeParameter(value, context), _b));
1716
2089
  }, {});
1717
2090
  };
1718
- const deserializeAws_restJson1TargetResourceTypeSummary = (output, context) => {
2091
+ var deserializeAws_restJson1TargetResourceTypeSummary = function (output, context) {
1719
2092
  return {
1720
2093
  description: __expectString(output.description),
1721
2094
  resourceType: __expectString(output.resourceType),
1722
2095
  };
1723
2096
  };
1724
- const deserializeAws_restJson1TargetResourceTypeSummaryList = (output, context) => {
1725
- const retVal = (output || [])
1726
- .filter((e) => e != null)
1727
- .map((entry) => {
2097
+ var deserializeAws_restJson1TargetResourceTypeSummaryList = function (output, context) {
2098
+ var retVal = (output || [])
2099
+ .filter(function (e) { return e != null; })
2100
+ .map(function (entry) {
1728
2101
  if (entry === null) {
1729
2102
  return null;
1730
2103
  }
@@ -1732,39 +2105,57 @@ const deserializeAws_restJson1TargetResourceTypeSummaryList = (output, context)
1732
2105
  });
1733
2106
  return retVal;
1734
2107
  };
1735
- const deserializeMetadata = (output) => ({
1736
- httpStatusCode: output.statusCode,
1737
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"],
1738
- extendedRequestId: output.headers["x-amz-id-2"],
1739
- cfId: output.headers["x-amz-cf-id"],
1740
- });
1741
- const collectBody = (streamBody = new Uint8Array(), context) => {
2108
+ var deserializeMetadata = function (output) {
2109
+ var _a, _b;
2110
+ return ({
2111
+ httpStatusCode: output.statusCode,
2112
+ 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"],
2113
+ extendedRequestId: output.headers["x-amz-id-2"],
2114
+ cfId: output.headers["x-amz-cf-id"],
2115
+ });
2116
+ };
2117
+ var collectBody = function (streamBody, context) {
2118
+ if (streamBody === void 0) { streamBody = new Uint8Array(); }
1742
2119
  if (streamBody instanceof Uint8Array) {
1743
2120
  return Promise.resolve(streamBody);
1744
2121
  }
1745
2122
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
1746
2123
  };
1747
- const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
1748
- const isSerializableHeaderValue = (value) => value !== undefined &&
1749
- value !== null &&
1750
- value !== "" &&
1751
- (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
1752
- (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
1753
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1754
- if (encoded.length) {
1755
- return JSON.parse(encoded);
1756
- }
1757
- return {};
1758
- });
1759
- const parseErrorBody = async (errorBody, context) => {
1760
- const value = await parseBody(errorBody, context);
1761
- value.message = value.message ?? value.Message;
1762
- return value;
1763
- };
1764
- const loadRestJsonErrorCode = (output, data) => {
1765
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
1766
- const sanitizeErrorCode = (rawValue) => {
1767
- let cleanValue = rawValue;
2124
+ var collectBodyString = function (streamBody, context) {
2125
+ return collectBody(streamBody, context).then(function (body) { return context.utf8Encoder(body); });
2126
+ };
2127
+ var isSerializableHeaderValue = function (value) {
2128
+ return value !== undefined &&
2129
+ value !== null &&
2130
+ value !== "" &&
2131
+ (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
2132
+ (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
2133
+ };
2134
+ var parseBody = function (streamBody, context) {
2135
+ return collectBodyString(streamBody, context).then(function (encoded) {
2136
+ if (encoded.length) {
2137
+ return JSON.parse(encoded);
2138
+ }
2139
+ return {};
2140
+ });
2141
+ };
2142
+ var parseErrorBody = function (errorBody, context) { return __awaiter(void 0, void 0, void 0, function () {
2143
+ var value;
2144
+ var _a;
2145
+ return __generator(this, function (_b) {
2146
+ switch (_b.label) {
2147
+ case 0: return [4, parseBody(errorBody, context)];
2148
+ case 1:
2149
+ value = _b.sent();
2150
+ value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message;
2151
+ return [2, value];
2152
+ }
2153
+ });
2154
+ }); };
2155
+ var loadRestJsonErrorCode = function (output, data) {
2156
+ var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
2157
+ var sanitizeErrorCode = function (rawValue) {
2158
+ var cleanValue = rawValue;
1768
2159
  if (typeof cleanValue === "number") {
1769
2160
  cleanValue = cleanValue.toString();
1770
2161
  }
@@ -1779,7 +2170,7 @@ const loadRestJsonErrorCode = (output, data) => {
1779
2170
  }
1780
2171
  return cleanValue;
1781
2172
  };
1782
- const headerKey = findKey(output.headers, "x-amzn-errortype");
2173
+ var headerKey = findKey(output.headers, "x-amzn-errortype");
1783
2174
  if (headerKey !== undefined) {
1784
2175
  return sanitizeErrorCode(output.headers[headerKey]);
1785
2176
  }