@aws-sdk/client-fis 3.180.0 → 3.183.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist-cjs/protocols/Aws_restJson1.js +22 -16
  3. package/dist-es/Fis.js +66 -73
  4. package/dist-es/FisClient.js +22 -28
  5. package/dist-es/commands/CreateExperimentTemplateCommand.js +21 -28
  6. package/dist-es/commands/DeleteExperimentTemplateCommand.js +21 -28
  7. package/dist-es/commands/GetActionCommand.js +21 -28
  8. package/dist-es/commands/GetExperimentCommand.js +21 -28
  9. package/dist-es/commands/GetExperimentTemplateCommand.js +21 -28
  10. package/dist-es/commands/GetTargetResourceTypeCommand.js +21 -28
  11. package/dist-es/commands/ListActionsCommand.js +21 -28
  12. package/dist-es/commands/ListExperimentTemplatesCommand.js +21 -28
  13. package/dist-es/commands/ListExperimentsCommand.js +21 -28
  14. package/dist-es/commands/ListTagsForResourceCommand.js +21 -28
  15. package/dist-es/commands/ListTargetResourceTypesCommand.js +21 -28
  16. package/dist-es/commands/StartExperimentCommand.js +21 -28
  17. package/dist-es/commands/StopExperimentCommand.js +21 -28
  18. package/dist-es/commands/TagResourceCommand.js +21 -28
  19. package/dist-es/commands/UntagResourceCommand.js +21 -28
  20. package/dist-es/commands/UpdateExperimentTemplateCommand.js +21 -28
  21. package/dist-es/endpoints.js +8 -8
  22. package/dist-es/models/FisServiceException.js +5 -10
  23. package/dist-es/models/models_0.js +254 -115
  24. package/dist-es/pagination/ListActionsPaginator.js +25 -68
  25. package/dist-es/pagination/ListExperimentTemplatesPaginator.js +25 -68
  26. package/dist-es/pagination/ListExperimentsPaginator.js +25 -68
  27. package/dist-es/pagination/ListTargetResourceTypesPaginator.js +25 -68
  28. package/dist-es/protocols/Aws_restJson1.js +1275 -1653
  29. package/dist-es/runtimeConfig.browser.js +26 -12
  30. package/dist-es/runtimeConfig.js +30 -12
  31. package/dist-es/runtimeConfig.native.js +8 -5
  32. package/dist-es/runtimeConfig.shared.js +8 -11
  33. package/package.json +33 -33
@@ -1,1572 +1,1185 @@
1
- import { __assign, __awaiter, __generator, __read } from "tslib";
2
1
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
3
2
  import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, 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";
4
3
  import { v4 as generateIdempotencyToken } from "uuid";
5
4
  import { FisServiceException as __BaseException } from "../models/FisServiceException";
6
5
  import { ConflictException, ResourceNotFoundException, ServiceQuotaExceededException, ValidationException, } from "../models/models_0";
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
- }
38
- });
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
- }
60
- });
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
- }
82
- });
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
- }
104
- });
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
- }
126
- });
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
- }
148
- });
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
- }
174
- });
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
- }
200
- });
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
- }
226
- });
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
- }
248
- });
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
- }
274
- });
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
- }
299
- });
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
- }
321
- });
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
- }
346
- });
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
- }
372
- });
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
- }
405
- });
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
- }
428
- });
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, parseBody(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
- }
473
- });
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
- }
496
- });
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, parseBody(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
- }
533
- });
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, parseBody(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, parseBody(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, parseBody(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, parseBody(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
- }
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),
799
336
  });
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, parseBody(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
- }
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),
832
378
  });
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
- }
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),
858
414
  });
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, parseBody(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
- }
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),
891
450
  });
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
- }
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),
917
486
  });
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, parseBody(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
- }
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),
950
522
  });
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
- }
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),
973
558
  });
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, parseBody(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
- }
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),
996
594
  });
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
- }
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),
1022
630
  });
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, parseBody(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
- }
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),
1055
666
  });
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
- }
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),
1078
693
  });
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, parseBody(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
- }
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),
1123
729
  });
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
- }
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),
1146
771
  });
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, parseBody(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
- }
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),
1183
807
  });
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
- }
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),
1201
831
  });
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, parseBody(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
- }
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),
1224
855
  });
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
- }
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,
1242
898
  });
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, parseBody(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
- }
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,
1265
910
  });
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
- }
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,
1288
922
  });
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, parseBody(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
- }
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,
1329
934
  });
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];
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]) => {
1393
954
  if (value === null) {
1394
955
  return acc;
1395
956
  }
1396
- return __assign(__assign({}, acc), (_b = {}, _b[key] = serializeAws_restJson1CreateExperimentTemplateActionInput(value, context), _b));
957
+ return {
958
+ ...acc,
959
+ [key]: serializeAws_restJson1CreateExperimentTemplateActionInput(value, context),
960
+ };
1397
961
  }, {});
1398
962
  };
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
- }));
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
+ };
1405
973
  };
1406
- var serializeAws_restJson1CreateExperimentTemplateStopConditionInput = function (input, context) {
1407
- return __assign(__assign({}, (input.source != null && { source: input.source })), (input.value != null && { value: input.value }));
974
+ const serializeAws_restJson1CreateExperimentTemplateStopConditionInput = (input, context) => {
975
+ return {
976
+ ...(input.source != null && { source: input.source }),
977
+ ...(input.value != null && { value: input.value }),
978
+ };
1408
979
  };
1409
- var serializeAws_restJson1CreateExperimentTemplateStopConditionInputList = function (input, context) {
980
+ const serializeAws_restJson1CreateExperimentTemplateStopConditionInputList = (input, context) => {
1410
981
  return input
1411
- .filter(function (e) { return e != null; })
1412
- .map(function (entry) {
982
+ .filter((e) => e != null)
983
+ .map((entry) => {
1413
984
  return serializeAws_restJson1CreateExperimentTemplateStopConditionInput(entry, context);
1414
985
  });
1415
986
  };
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 }));
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
+ };
1424
1002
  };
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];
1003
+ const serializeAws_restJson1CreateExperimentTemplateTargetInputMap = (input, context) => {
1004
+ return Object.entries(input).reduce((acc, [key, value]) => {
1429
1005
  if (value === null) {
1430
1006
  return acc;
1431
1007
  }
1432
- return __assign(__assign({}, acc), (_b = {}, _b[key] = serializeAws_restJson1CreateExperimentTemplateTargetInput(value, context), _b));
1008
+ return {
1009
+ ...acc,
1010
+ [key]: serializeAws_restJson1CreateExperimentTemplateTargetInput(value, context),
1011
+ };
1433
1012
  }, {});
1434
1013
  };
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];
1014
+ const serializeAws_restJson1ExperimentTemplateActionParameterMap = (input, context) => {
1015
+ return Object.entries(input).reduce((acc, [key, value]) => {
1439
1016
  if (value === null) {
1440
1017
  return acc;
1441
1018
  }
1442
- return __assign(__assign({}, acc), (_b = {}, _b[key] = value, _b));
1019
+ return {
1020
+ ...acc,
1021
+ [key]: value,
1022
+ };
1443
1023
  }, {});
1444
1024
  };
1445
- var serializeAws_restJson1ExperimentTemplateActionStartAfterList = function (input, context) {
1025
+ const serializeAws_restJson1ExperimentTemplateActionStartAfterList = (input, context) => {
1446
1026
  return input
1447
- .filter(function (e) { return e != null; })
1448
- .map(function (entry) {
1027
+ .filter((e) => e != null)
1028
+ .map((entry) => {
1449
1029
  return entry;
1450
1030
  });
1451
1031
  };
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];
1032
+ const serializeAws_restJson1ExperimentTemplateActionTargetMap = (input, context) => {
1033
+ return Object.entries(input).reduce((acc, [key, value]) => {
1456
1034
  if (value === null) {
1457
1035
  return acc;
1458
1036
  }
1459
- return __assign(__assign({}, acc), (_b = {}, _b[key] = value, _b));
1037
+ return {
1038
+ ...acc,
1039
+ [key]: value,
1040
+ };
1460
1041
  }, {});
1461
1042
  };
1462
- var serializeAws_restJson1ExperimentTemplateCloudWatchLogsLogConfigurationInput = function (input, context) {
1463
- return __assign({}, (input.logGroupArn != null && { logGroupArn: input.logGroupArn }));
1043
+ const serializeAws_restJson1ExperimentTemplateCloudWatchLogsLogConfigurationInput = (input, context) => {
1044
+ return {
1045
+ ...(input.logGroupArn != null && { logGroupArn: input.logGroupArn }),
1046
+ };
1464
1047
  };
1465
- var serializeAws_restJson1ExperimentTemplateS3LogConfigurationInput = function (input, context) {
1466
- return __assign(__assign({}, (input.bucketName != null && { bucketName: input.bucketName })), (input.prefix != null && { prefix: input.prefix }));
1048
+ const serializeAws_restJson1ExperimentTemplateS3LogConfigurationInput = (input, context) => {
1049
+ return {
1050
+ ...(input.bucketName != null && { bucketName: input.bucketName }),
1051
+ ...(input.prefix != null && { prefix: input.prefix }),
1052
+ };
1467
1053
  };
1468
- var serializeAws_restJson1ExperimentTemplateTargetFilterInputList = function (input, context) {
1054
+ const serializeAws_restJson1ExperimentTemplateTargetFilterInputList = (input, context) => {
1469
1055
  return input
1470
- .filter(function (e) { return e != null; })
1471
- .map(function (entry) {
1056
+ .filter((e) => e != null)
1057
+ .map((entry) => {
1472
1058
  return serializeAws_restJson1ExperimentTemplateTargetInputFilter(entry, context);
1473
1059
  });
1474
1060
  };
1475
- var serializeAws_restJson1ExperimentTemplateTargetFilterValues = function (input, context) {
1061
+ const serializeAws_restJson1ExperimentTemplateTargetFilterValues = (input, context) => {
1476
1062
  return input
1477
- .filter(function (e) { return e != null; })
1478
- .map(function (entry) {
1063
+ .filter((e) => e != null)
1064
+ .map((entry) => {
1479
1065
  return entry;
1480
1066
  });
1481
1067
  };
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
- }));
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
+ };
1486
1075
  };
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];
1076
+ const serializeAws_restJson1ExperimentTemplateTargetParameterMap = (input, context) => {
1077
+ return Object.entries(input).reduce((acc, [key, value]) => {
1491
1078
  if (value === null) {
1492
1079
  return acc;
1493
1080
  }
1494
- return __assign(__assign({}, acc), (_b = {}, _b[key] = value, _b));
1081
+ return {
1082
+ ...acc,
1083
+ [key]: value,
1084
+ };
1495
1085
  }, {});
1496
1086
  };
1497
- var serializeAws_restJson1ResourceArnList = function (input, context) {
1087
+ const serializeAws_restJson1ResourceArnList = (input, context) => {
1498
1088
  return input
1499
- .filter(function (e) { return e != null; })
1500
- .map(function (entry) {
1089
+ .filter((e) => e != null)
1090
+ .map((entry) => {
1501
1091
  return entry;
1502
1092
  });
1503
1093
  };
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];
1094
+ const serializeAws_restJson1TagMap = (input, context) => {
1095
+ return Object.entries(input).reduce((acc, [key, value]) => {
1508
1096
  if (value === null) {
1509
1097
  return acc;
1510
1098
  }
1511
- return __assign(__assign({}, acc), (_b = {}, _b[key] = value, _b));
1099
+ return {
1100
+ ...acc,
1101
+ [key]: value,
1102
+ };
1512
1103
  }, {});
1513
1104
  };
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];
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]) => {
1527
1122
  if (value === null) {
1528
1123
  return acc;
1529
1124
  }
1530
- return __assign(__assign({}, acc), (_b = {}, _b[key] = serializeAws_restJson1UpdateExperimentTemplateActionInputItem(value, context), _b));
1125
+ return {
1126
+ ...acc,
1127
+ [key]: serializeAws_restJson1UpdateExperimentTemplateActionInputItem(value, context),
1128
+ };
1531
1129
  }, {});
1532
1130
  };
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
- }));
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
+ };
1539
1141
  };
1540
- var serializeAws_restJson1UpdateExperimentTemplateStopConditionInput = function (input, context) {
1541
- return __assign(__assign({}, (input.source != null && { source: input.source })), (input.value != null && { value: input.value }));
1142
+ const serializeAws_restJson1UpdateExperimentTemplateStopConditionInput = (input, context) => {
1143
+ return {
1144
+ ...(input.source != null && { source: input.source }),
1145
+ ...(input.value != null && { value: input.value }),
1146
+ };
1542
1147
  };
1543
- var serializeAws_restJson1UpdateExperimentTemplateStopConditionInputList = function (input, context) {
1148
+ const serializeAws_restJson1UpdateExperimentTemplateStopConditionInputList = (input, context) => {
1544
1149
  return input
1545
- .filter(function (e) { return e != null; })
1546
- .map(function (entry) {
1150
+ .filter((e) => e != null)
1151
+ .map((entry) => {
1547
1152
  return serializeAws_restJson1UpdateExperimentTemplateStopConditionInput(entry, context);
1548
1153
  });
1549
1154
  };
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 }));
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
+ };
1558
1170
  };
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];
1171
+ const serializeAws_restJson1UpdateExperimentTemplateTargetInputMap = (input, context) => {
1172
+ return Object.entries(input).reduce((acc, [key, value]) => {
1563
1173
  if (value === null) {
1564
1174
  return acc;
1565
1175
  }
1566
- return __assign(__assign({}, acc), (_b = {}, _b[key] = serializeAws_restJson1UpdateExperimentTemplateTargetInput(value, context), _b));
1176
+ return {
1177
+ ...acc,
1178
+ [key]: serializeAws_restJson1UpdateExperimentTemplateTargetInput(value, context),
1179
+ };
1567
1180
  }, {});
1568
1181
  };
1569
- var deserializeAws_restJson1Action = function (output, context) {
1182
+ const deserializeAws_restJson1Action = (output, context) => {
1570
1183
  return {
1571
1184
  description: __expectString(output.description),
1572
1185
  id: __expectString(output.id),
@@ -1575,23 +1188,24 @@ var deserializeAws_restJson1Action = function (output, context) {
1575
1188
  targets: output.targets != null ? deserializeAws_restJson1ActionTargetMap(output.targets, context) : undefined,
1576
1189
  };
1577
1190
  };
1578
- var deserializeAws_restJson1ActionParameter = function (output, context) {
1191
+ const deserializeAws_restJson1ActionParameter = (output, context) => {
1579
1192
  return {
1580
1193
  description: __expectString(output.description),
1581
1194
  required: __expectBoolean(output.required),
1582
1195
  };
1583
1196
  };
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];
1197
+ const deserializeAws_restJson1ActionParameterMap = (output, context) => {
1198
+ return Object.entries(output).reduce((acc, [key, value]) => {
1588
1199
  if (value === null) {
1589
1200
  return acc;
1590
1201
  }
1591
- return __assign(__assign({}, acc), (_b = {}, _b[key] = deserializeAws_restJson1ActionParameter(value, context), _b));
1202
+ return {
1203
+ ...acc,
1204
+ [key]: deserializeAws_restJson1ActionParameter(value, context),
1205
+ };
1592
1206
  }, {});
1593
1207
  };
1594
- var deserializeAws_restJson1ActionSummary = function (output, context) {
1208
+ const deserializeAws_restJson1ActionSummary = (output, context) => {
1595
1209
  return {
1596
1210
  description: __expectString(output.description),
1597
1211
  id: __expectString(output.id),
@@ -1599,10 +1213,10 @@ var deserializeAws_restJson1ActionSummary = function (output, context) {
1599
1213
  targets: output.targets != null ? deserializeAws_restJson1ActionTargetMap(output.targets, context) : undefined,
1600
1214
  };
1601
1215
  };
1602
- var deserializeAws_restJson1ActionSummaryList = function (output, context) {
1603
- var retVal = (output || [])
1604
- .filter(function (e) { return e != null; })
1605
- .map(function (entry) {
1216
+ const deserializeAws_restJson1ActionSummaryList = (output, context) => {
1217
+ const retVal = (output || [])
1218
+ .filter((e) => e != null)
1219
+ .map((entry) => {
1606
1220
  if (entry === null) {
1607
1221
  return null;
1608
1222
  }
@@ -1610,22 +1224,23 @@ var deserializeAws_restJson1ActionSummaryList = function (output, context) {
1610
1224
  });
1611
1225
  return retVal;
1612
1226
  };
1613
- var deserializeAws_restJson1ActionTarget = function (output, context) {
1227
+ const deserializeAws_restJson1ActionTarget = (output, context) => {
1614
1228
  return {
1615
1229
  resourceType: __expectString(output.resourceType),
1616
1230
  };
1617
1231
  };
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];
1232
+ const deserializeAws_restJson1ActionTargetMap = (output, context) => {
1233
+ return Object.entries(output).reduce((acc, [key, value]) => {
1622
1234
  if (value === null) {
1623
1235
  return acc;
1624
1236
  }
1625
- return __assign(__assign({}, acc), (_b = {}, _b[key] = deserializeAws_restJson1ActionTarget(value, context), _b));
1237
+ return {
1238
+ ...acc,
1239
+ [key]: deserializeAws_restJson1ActionTarget(value, context),
1240
+ };
1626
1241
  }, {});
1627
1242
  };
1628
- var deserializeAws_restJson1Experiment = function (output, context) {
1243
+ const deserializeAws_restJson1Experiment = (output, context) => {
1629
1244
  return {
1630
1245
  actions: output.actions != null ? deserializeAws_restJson1ExperimentActionMap(output.actions, context) : undefined,
1631
1246
  creationTime: output.creationTime != null
@@ -1647,7 +1262,7 @@ var deserializeAws_restJson1Experiment = function (output, context) {
1647
1262
  targets: output.targets != null ? deserializeAws_restJson1ExperimentTargetMap(output.targets, context) : undefined,
1648
1263
  };
1649
1264
  };
1650
- var deserializeAws_restJson1ExperimentAction = function (output, context) {
1265
+ const deserializeAws_restJson1ExperimentAction = (output, context) => {
1651
1266
  return {
1652
1267
  actionId: __expectString(output.actionId),
1653
1268
  description: __expectString(output.description),
@@ -1663,30 +1278,32 @@ var deserializeAws_restJson1ExperimentAction = function (output, context) {
1663
1278
  targets: output.targets != null ? deserializeAws_restJson1ExperimentActionTargetMap(output.targets, context) : undefined,
1664
1279
  };
1665
1280
  };
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];
1281
+ const deserializeAws_restJson1ExperimentActionMap = (output, context) => {
1282
+ return Object.entries(output).reduce((acc, [key, value]) => {
1670
1283
  if (value === null) {
1671
1284
  return acc;
1672
1285
  }
1673
- return __assign(__assign({}, acc), (_b = {}, _b[key] = deserializeAws_restJson1ExperimentAction(value, context), _b));
1286
+ return {
1287
+ ...acc,
1288
+ [key]: deserializeAws_restJson1ExperimentAction(value, context),
1289
+ };
1674
1290
  }, {});
1675
1291
  };
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];
1292
+ const deserializeAws_restJson1ExperimentActionParameterMap = (output, context) => {
1293
+ return Object.entries(output).reduce((acc, [key, value]) => {
1680
1294
  if (value === null) {
1681
1295
  return acc;
1682
1296
  }
1683
- return __assign(__assign({}, acc), (_b = {}, _b[key] = __expectString(value), _b));
1297
+ return {
1298
+ ...acc,
1299
+ [key]: __expectString(value),
1300
+ };
1684
1301
  }, {});
1685
1302
  };
1686
- var deserializeAws_restJson1ExperimentActionStartAfterList = function (output, context) {
1687
- var retVal = (output || [])
1688
- .filter(function (e) { return e != null; })
1689
- .map(function (entry) {
1303
+ const deserializeAws_restJson1ExperimentActionStartAfterList = (output, context) => {
1304
+ const retVal = (output || [])
1305
+ .filter((e) => e != null)
1306
+ .map((entry) => {
1690
1307
  if (entry === null) {
1691
1308
  return null;
1692
1309
  }
@@ -1694,28 +1311,29 @@ var deserializeAws_restJson1ExperimentActionStartAfterList = function (output, c
1694
1311
  });
1695
1312
  return retVal;
1696
1313
  };
1697
- var deserializeAws_restJson1ExperimentActionState = function (output, context) {
1314
+ const deserializeAws_restJson1ExperimentActionState = (output, context) => {
1698
1315
  return {
1699
1316
  reason: __expectString(output.reason),
1700
1317
  status: __expectString(output.status),
1701
1318
  };
1702
1319
  };
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];
1320
+ const deserializeAws_restJson1ExperimentActionTargetMap = (output, context) => {
1321
+ return Object.entries(output).reduce((acc, [key, value]) => {
1707
1322
  if (value === null) {
1708
1323
  return acc;
1709
1324
  }
1710
- return __assign(__assign({}, acc), (_b = {}, _b[key] = __expectString(value), _b));
1325
+ return {
1326
+ ...acc,
1327
+ [key]: __expectString(value),
1328
+ };
1711
1329
  }, {});
1712
1330
  };
1713
- var deserializeAws_restJson1ExperimentCloudWatchLogsLogConfiguration = function (output, context) {
1331
+ const deserializeAws_restJson1ExperimentCloudWatchLogsLogConfiguration = (output, context) => {
1714
1332
  return {
1715
1333
  logGroupArn: __expectString(output.logGroupArn),
1716
1334
  };
1717
1335
  };
1718
- var deserializeAws_restJson1ExperimentLogConfiguration = function (output, context) {
1336
+ const deserializeAws_restJson1ExperimentLogConfiguration = (output, context) => {
1719
1337
  return {
1720
1338
  cloudWatchLogsConfiguration: output.cloudWatchLogsConfiguration != null
1721
1339
  ? deserializeAws_restJson1ExperimentCloudWatchLogsLogConfiguration(output.cloudWatchLogsConfiguration, context)
@@ -1726,28 +1344,28 @@ var deserializeAws_restJson1ExperimentLogConfiguration = function (output, conte
1726
1344
  : undefined,
1727
1345
  };
1728
1346
  };
1729
- var deserializeAws_restJson1ExperimentS3LogConfiguration = function (output, context) {
1347
+ const deserializeAws_restJson1ExperimentS3LogConfiguration = (output, context) => {
1730
1348
  return {
1731
1349
  bucketName: __expectString(output.bucketName),
1732
1350
  prefix: __expectString(output.prefix),
1733
1351
  };
1734
1352
  };
1735
- var deserializeAws_restJson1ExperimentState = function (output, context) {
1353
+ const deserializeAws_restJson1ExperimentState = (output, context) => {
1736
1354
  return {
1737
1355
  reason: __expectString(output.reason),
1738
1356
  status: __expectString(output.status),
1739
1357
  };
1740
1358
  };
1741
- var deserializeAws_restJson1ExperimentStopCondition = function (output, context) {
1359
+ const deserializeAws_restJson1ExperimentStopCondition = (output, context) => {
1742
1360
  return {
1743
1361
  source: __expectString(output.source),
1744
1362
  value: __expectString(output.value),
1745
1363
  };
1746
1364
  };
1747
- var deserializeAws_restJson1ExperimentStopConditionList = function (output, context) {
1748
- var retVal = (output || [])
1749
- .filter(function (e) { return e != null; })
1750
- .map(function (entry) {
1365
+ const deserializeAws_restJson1ExperimentStopConditionList = (output, context) => {
1366
+ const retVal = (output || [])
1367
+ .filter((e) => e != null)
1368
+ .map((entry) => {
1751
1369
  if (entry === null) {
1752
1370
  return null;
1753
1371
  }
@@ -1755,7 +1373,7 @@ var deserializeAws_restJson1ExperimentStopConditionList = function (output, cont
1755
1373
  });
1756
1374
  return retVal;
1757
1375
  };
1758
- var deserializeAws_restJson1ExperimentSummary = function (output, context) {
1376
+ const deserializeAws_restJson1ExperimentSummary = (output, context) => {
1759
1377
  return {
1760
1378
  creationTime: output.creationTime != null
1761
1379
  ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.creationTime)))
@@ -1766,10 +1384,10 @@ var deserializeAws_restJson1ExperimentSummary = function (output, context) {
1766
1384
  tags: output.tags != null ? deserializeAws_restJson1TagMap(output.tags, context) : undefined,
1767
1385
  };
1768
1386
  };
1769
- var deserializeAws_restJson1ExperimentSummaryList = function (output, context) {
1770
- var retVal = (output || [])
1771
- .filter(function (e) { return e != null; })
1772
- .map(function (entry) {
1387
+ const deserializeAws_restJson1ExperimentSummaryList = (output, context) => {
1388
+ const retVal = (output || [])
1389
+ .filter((e) => e != null)
1390
+ .map((entry) => {
1773
1391
  if (entry === null) {
1774
1392
  return null;
1775
1393
  }
@@ -1777,7 +1395,7 @@ var deserializeAws_restJson1ExperimentSummaryList = function (output, context) {
1777
1395
  });
1778
1396
  return retVal;
1779
1397
  };
1780
- var deserializeAws_restJson1ExperimentTarget = function (output, context) {
1398
+ const deserializeAws_restJson1ExperimentTarget = (output, context) => {
1781
1399
  return {
1782
1400
  filters: output.filters != null ? deserializeAws_restJson1ExperimentTargetFilterList(output.filters, context) : undefined,
1783
1401
  parameters: output.parameters != null
@@ -1789,16 +1407,16 @@ var deserializeAws_restJson1ExperimentTarget = function (output, context) {
1789
1407
  selectionMode: __expectString(output.selectionMode),
1790
1408
  };
1791
1409
  };
1792
- var deserializeAws_restJson1ExperimentTargetFilter = function (output, context) {
1410
+ const deserializeAws_restJson1ExperimentTargetFilter = (output, context) => {
1793
1411
  return {
1794
1412
  path: __expectString(output.path),
1795
1413
  values: output.values != null ? deserializeAws_restJson1ExperimentTargetFilterValues(output.values, context) : undefined,
1796
1414
  };
1797
1415
  };
1798
- var deserializeAws_restJson1ExperimentTargetFilterList = function (output, context) {
1799
- var retVal = (output || [])
1800
- .filter(function (e) { return e != null; })
1801
- .map(function (entry) {
1416
+ const deserializeAws_restJson1ExperimentTargetFilterList = (output, context) => {
1417
+ const retVal = (output || [])
1418
+ .filter((e) => e != null)
1419
+ .map((entry) => {
1802
1420
  if (entry === null) {
1803
1421
  return null;
1804
1422
  }
@@ -1806,10 +1424,10 @@ var deserializeAws_restJson1ExperimentTargetFilterList = function (output, conte
1806
1424
  });
1807
1425
  return retVal;
1808
1426
  };
1809
- var deserializeAws_restJson1ExperimentTargetFilterValues = function (output, context) {
1810
- var retVal = (output || [])
1811
- .filter(function (e) { return e != null; })
1812
- .map(function (entry) {
1427
+ const deserializeAws_restJson1ExperimentTargetFilterValues = (output, context) => {
1428
+ const retVal = (output || [])
1429
+ .filter((e) => e != null)
1430
+ .map((entry) => {
1813
1431
  if (entry === null) {
1814
1432
  return null;
1815
1433
  }
@@ -1817,27 +1435,29 @@ var deserializeAws_restJson1ExperimentTargetFilterValues = function (output, con
1817
1435
  });
1818
1436
  return retVal;
1819
1437
  };
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];
1438
+ const deserializeAws_restJson1ExperimentTargetMap = (output, context) => {
1439
+ return Object.entries(output).reduce((acc, [key, value]) => {
1824
1440
  if (value === null) {
1825
1441
  return acc;
1826
1442
  }
1827
- return __assign(__assign({}, acc), (_b = {}, _b[key] = deserializeAws_restJson1ExperimentTarget(value, context), _b));
1443
+ return {
1444
+ ...acc,
1445
+ [key]: deserializeAws_restJson1ExperimentTarget(value, context),
1446
+ };
1828
1447
  }, {});
1829
1448
  };
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];
1449
+ const deserializeAws_restJson1ExperimentTargetParameterMap = (output, context) => {
1450
+ return Object.entries(output).reduce((acc, [key, value]) => {
1834
1451
  if (value === null) {
1835
1452
  return acc;
1836
1453
  }
1837
- return __assign(__assign({}, acc), (_b = {}, _b[key] = __expectString(value), _b));
1454
+ return {
1455
+ ...acc,
1456
+ [key]: __expectString(value),
1457
+ };
1838
1458
  }, {});
1839
1459
  };
1840
- var deserializeAws_restJson1ExperimentTemplate = function (output, context) {
1460
+ const deserializeAws_restJson1ExperimentTemplate = (output, context) => {
1841
1461
  return {
1842
1462
  actions: output.actions != null ? deserializeAws_restJson1ExperimentTemplateActionMap(output.actions, context) : undefined,
1843
1463
  creationTime: output.creationTime != null
@@ -1859,7 +1479,7 @@ var deserializeAws_restJson1ExperimentTemplate = function (output, context) {
1859
1479
  targets: output.targets != null ? deserializeAws_restJson1ExperimentTemplateTargetMap(output.targets, context) : undefined,
1860
1480
  };
1861
1481
  };
1862
- var deserializeAws_restJson1ExperimentTemplateAction = function (output, context) {
1482
+ const deserializeAws_restJson1ExperimentTemplateAction = (output, context) => {
1863
1483
  return {
1864
1484
  actionId: __expectString(output.actionId),
1865
1485
  description: __expectString(output.description),
@@ -1874,30 +1494,32 @@ var deserializeAws_restJson1ExperimentTemplateAction = function (output, context
1874
1494
  : undefined,
1875
1495
  };
1876
1496
  };
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];
1497
+ const deserializeAws_restJson1ExperimentTemplateActionMap = (output, context) => {
1498
+ return Object.entries(output).reduce((acc, [key, value]) => {
1881
1499
  if (value === null) {
1882
1500
  return acc;
1883
1501
  }
1884
- return __assign(__assign({}, acc), (_b = {}, _b[key] = deserializeAws_restJson1ExperimentTemplateAction(value, context), _b));
1502
+ return {
1503
+ ...acc,
1504
+ [key]: deserializeAws_restJson1ExperimentTemplateAction(value, context),
1505
+ };
1885
1506
  }, {});
1886
1507
  };
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];
1508
+ const deserializeAws_restJson1ExperimentTemplateActionParameterMap = (output, context) => {
1509
+ return Object.entries(output).reduce((acc, [key, value]) => {
1891
1510
  if (value === null) {
1892
1511
  return acc;
1893
1512
  }
1894
- return __assign(__assign({}, acc), (_b = {}, _b[key] = __expectString(value), _b));
1513
+ return {
1514
+ ...acc,
1515
+ [key]: __expectString(value),
1516
+ };
1895
1517
  }, {});
1896
1518
  };
1897
- var deserializeAws_restJson1ExperimentTemplateActionStartAfterList = function (output, context) {
1898
- var retVal = (output || [])
1899
- .filter(function (e) { return e != null; })
1900
- .map(function (entry) {
1519
+ const deserializeAws_restJson1ExperimentTemplateActionStartAfterList = (output, context) => {
1520
+ const retVal = (output || [])
1521
+ .filter((e) => e != null)
1522
+ .map((entry) => {
1901
1523
  if (entry === null) {
1902
1524
  return null;
1903
1525
  }
@@ -1905,22 +1527,23 @@ var deserializeAws_restJson1ExperimentTemplateActionStartAfterList = function (o
1905
1527
  });
1906
1528
  return retVal;
1907
1529
  };
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];
1530
+ const deserializeAws_restJson1ExperimentTemplateActionTargetMap = (output, context) => {
1531
+ return Object.entries(output).reduce((acc, [key, value]) => {
1912
1532
  if (value === null) {
1913
1533
  return acc;
1914
1534
  }
1915
- return __assign(__assign({}, acc), (_b = {}, _b[key] = __expectString(value), _b));
1535
+ return {
1536
+ ...acc,
1537
+ [key]: __expectString(value),
1538
+ };
1916
1539
  }, {});
1917
1540
  };
1918
- var deserializeAws_restJson1ExperimentTemplateCloudWatchLogsLogConfiguration = function (output, context) {
1541
+ const deserializeAws_restJson1ExperimentTemplateCloudWatchLogsLogConfiguration = (output, context) => {
1919
1542
  return {
1920
1543
  logGroupArn: __expectString(output.logGroupArn),
1921
1544
  };
1922
1545
  };
1923
- var deserializeAws_restJson1ExperimentTemplateLogConfiguration = function (output, context) {
1546
+ const deserializeAws_restJson1ExperimentTemplateLogConfiguration = (output, context) => {
1924
1547
  return {
1925
1548
  cloudWatchLogsConfiguration: output.cloudWatchLogsConfiguration != null
1926
1549
  ? deserializeAws_restJson1ExperimentTemplateCloudWatchLogsLogConfiguration(output.cloudWatchLogsConfiguration, context)
@@ -1931,22 +1554,22 @@ var deserializeAws_restJson1ExperimentTemplateLogConfiguration = function (outpu
1931
1554
  : undefined,
1932
1555
  };
1933
1556
  };
1934
- var deserializeAws_restJson1ExperimentTemplateS3LogConfiguration = function (output, context) {
1557
+ const deserializeAws_restJson1ExperimentTemplateS3LogConfiguration = (output, context) => {
1935
1558
  return {
1936
1559
  bucketName: __expectString(output.bucketName),
1937
1560
  prefix: __expectString(output.prefix),
1938
1561
  };
1939
1562
  };
1940
- var deserializeAws_restJson1ExperimentTemplateStopCondition = function (output, context) {
1563
+ const deserializeAws_restJson1ExperimentTemplateStopCondition = (output, context) => {
1941
1564
  return {
1942
1565
  source: __expectString(output.source),
1943
1566
  value: __expectString(output.value),
1944
1567
  };
1945
1568
  };
1946
- var deserializeAws_restJson1ExperimentTemplateStopConditionList = function (output, context) {
1947
- var retVal = (output || [])
1948
- .filter(function (e) { return e != null; })
1949
- .map(function (entry) {
1569
+ const deserializeAws_restJson1ExperimentTemplateStopConditionList = (output, context) => {
1570
+ const retVal = (output || [])
1571
+ .filter((e) => e != null)
1572
+ .map((entry) => {
1950
1573
  if (entry === null) {
1951
1574
  return null;
1952
1575
  }
@@ -1954,7 +1577,7 @@ var deserializeAws_restJson1ExperimentTemplateStopConditionList = function (outp
1954
1577
  });
1955
1578
  return retVal;
1956
1579
  };
1957
- var deserializeAws_restJson1ExperimentTemplateSummary = function (output, context) {
1580
+ const deserializeAws_restJson1ExperimentTemplateSummary = (output, context) => {
1958
1581
  return {
1959
1582
  creationTime: output.creationTime != null
1960
1583
  ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.creationTime)))
@@ -1967,10 +1590,10 @@ var deserializeAws_restJson1ExperimentTemplateSummary = function (output, contex
1967
1590
  tags: output.tags != null ? deserializeAws_restJson1TagMap(output.tags, context) : undefined,
1968
1591
  };
1969
1592
  };
1970
- var deserializeAws_restJson1ExperimentTemplateSummaryList = function (output, context) {
1971
- var retVal = (output || [])
1972
- .filter(function (e) { return e != null; })
1973
- .map(function (entry) {
1593
+ const deserializeAws_restJson1ExperimentTemplateSummaryList = (output, context) => {
1594
+ const retVal = (output || [])
1595
+ .filter((e) => e != null)
1596
+ .map((entry) => {
1974
1597
  if (entry === null) {
1975
1598
  return null;
1976
1599
  }
@@ -1978,7 +1601,7 @@ var deserializeAws_restJson1ExperimentTemplateSummaryList = function (output, co
1978
1601
  });
1979
1602
  return retVal;
1980
1603
  };
1981
- var deserializeAws_restJson1ExperimentTemplateTarget = function (output, context) {
1604
+ const deserializeAws_restJson1ExperimentTemplateTarget = (output, context) => {
1982
1605
  return {
1983
1606
  filters: output.filters != null
1984
1607
  ? deserializeAws_restJson1ExperimentTemplateTargetFilterList(output.filters, context)
@@ -1992,7 +1615,7 @@ var deserializeAws_restJson1ExperimentTemplateTarget = function (output, context
1992
1615
  selectionMode: __expectString(output.selectionMode),
1993
1616
  };
1994
1617
  };
1995
- var deserializeAws_restJson1ExperimentTemplateTargetFilter = function (output, context) {
1618
+ const deserializeAws_restJson1ExperimentTemplateTargetFilter = (output, context) => {
1996
1619
  return {
1997
1620
  path: __expectString(output.path),
1998
1621
  values: output.values != null
@@ -2000,10 +1623,10 @@ var deserializeAws_restJson1ExperimentTemplateTargetFilter = function (output, c
2000
1623
  : undefined,
2001
1624
  };
2002
1625
  };
2003
- var deserializeAws_restJson1ExperimentTemplateTargetFilterList = function (output, context) {
2004
- var retVal = (output || [])
2005
- .filter(function (e) { return e != null; })
2006
- .map(function (entry) {
1626
+ const deserializeAws_restJson1ExperimentTemplateTargetFilterList = (output, context) => {
1627
+ const retVal = (output || [])
1628
+ .filter((e) => e != null)
1629
+ .map((entry) => {
2007
1630
  if (entry === null) {
2008
1631
  return null;
2009
1632
  }
@@ -2011,10 +1634,10 @@ var deserializeAws_restJson1ExperimentTemplateTargetFilterList = function (outpu
2011
1634
  });
2012
1635
  return retVal;
2013
1636
  };
2014
- var deserializeAws_restJson1ExperimentTemplateTargetFilterValues = function (output, context) {
2015
- var retVal = (output || [])
2016
- .filter(function (e) { return e != null; })
2017
- .map(function (entry) {
1637
+ const deserializeAws_restJson1ExperimentTemplateTargetFilterValues = (output, context) => {
1638
+ const retVal = (output || [])
1639
+ .filter((e) => e != null)
1640
+ .map((entry) => {
2018
1641
  if (entry === null) {
2019
1642
  return null;
2020
1643
  }
@@ -2022,30 +1645,32 @@ var deserializeAws_restJson1ExperimentTemplateTargetFilterValues = function (out
2022
1645
  });
2023
1646
  return retVal;
2024
1647
  };
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];
1648
+ const deserializeAws_restJson1ExperimentTemplateTargetMap = (output, context) => {
1649
+ return Object.entries(output).reduce((acc, [key, value]) => {
2029
1650
  if (value === null) {
2030
1651
  return acc;
2031
1652
  }
2032
- return __assign(__assign({}, acc), (_b = {}, _b[key] = deserializeAws_restJson1ExperimentTemplateTarget(value, context), _b));
1653
+ return {
1654
+ ...acc,
1655
+ [key]: deserializeAws_restJson1ExperimentTemplateTarget(value, context),
1656
+ };
2033
1657
  }, {});
2034
1658
  };
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];
1659
+ const deserializeAws_restJson1ExperimentTemplateTargetParameterMap = (output, context) => {
1660
+ return Object.entries(output).reduce((acc, [key, value]) => {
2039
1661
  if (value === null) {
2040
1662
  return acc;
2041
1663
  }
2042
- return __assign(__assign({}, acc), (_b = {}, _b[key] = __expectString(value), _b));
1664
+ return {
1665
+ ...acc,
1666
+ [key]: __expectString(value),
1667
+ };
2043
1668
  }, {});
2044
1669
  };
2045
- var deserializeAws_restJson1ResourceArnList = function (output, context) {
2046
- var retVal = (output || [])
2047
- .filter(function (e) { return e != null; })
2048
- .map(function (entry) {
1670
+ const deserializeAws_restJson1ResourceArnList = (output, context) => {
1671
+ const retVal = (output || [])
1672
+ .filter((e) => e != null)
1673
+ .map((entry) => {
2049
1674
  if (entry === null) {
2050
1675
  return null;
2051
1676
  }
@@ -2053,17 +1678,18 @@ var deserializeAws_restJson1ResourceArnList = function (output, context) {
2053
1678
  });
2054
1679
  return retVal;
2055
1680
  };
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];
1681
+ const deserializeAws_restJson1TagMap = (output, context) => {
1682
+ return Object.entries(output).reduce((acc, [key, value]) => {
2060
1683
  if (value === null) {
2061
1684
  return acc;
2062
1685
  }
2063
- return __assign(__assign({}, acc), (_b = {}, _b[key] = __expectString(value), _b));
1686
+ return {
1687
+ ...acc,
1688
+ [key]: __expectString(value),
1689
+ };
2064
1690
  }, {});
2065
1691
  };
2066
- var deserializeAws_restJson1TargetResourceType = function (output, context) {
1692
+ const deserializeAws_restJson1TargetResourceType = (output, context) => {
2067
1693
  return {
2068
1694
  description: __expectString(output.description),
2069
1695
  parameters: output.parameters != null
@@ -2072,32 +1698,33 @@ var deserializeAws_restJson1TargetResourceType = function (output, context) {
2072
1698
  resourceType: __expectString(output.resourceType),
2073
1699
  };
2074
1700
  };
2075
- var deserializeAws_restJson1TargetResourceTypeParameter = function (output, context) {
1701
+ const deserializeAws_restJson1TargetResourceTypeParameter = (output, context) => {
2076
1702
  return {
2077
1703
  description: __expectString(output.description),
2078
1704
  required: __expectBoolean(output.required),
2079
1705
  };
2080
1706
  };
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];
1707
+ const deserializeAws_restJson1TargetResourceTypeParameterMap = (output, context) => {
1708
+ return Object.entries(output).reduce((acc, [key, value]) => {
2085
1709
  if (value === null) {
2086
1710
  return acc;
2087
1711
  }
2088
- return __assign(__assign({}, acc), (_b = {}, _b[key] = deserializeAws_restJson1TargetResourceTypeParameter(value, context), _b));
1712
+ return {
1713
+ ...acc,
1714
+ [key]: deserializeAws_restJson1TargetResourceTypeParameter(value, context),
1715
+ };
2089
1716
  }, {});
2090
1717
  };
2091
- var deserializeAws_restJson1TargetResourceTypeSummary = function (output, context) {
1718
+ const deserializeAws_restJson1TargetResourceTypeSummary = (output, context) => {
2092
1719
  return {
2093
1720
  description: __expectString(output.description),
2094
1721
  resourceType: __expectString(output.resourceType),
2095
1722
  };
2096
1723
  };
2097
- var deserializeAws_restJson1TargetResourceTypeSummaryList = function (output, context) {
2098
- var retVal = (output || [])
2099
- .filter(function (e) { return e != null; })
2100
- .map(function (entry) {
1724
+ const deserializeAws_restJson1TargetResourceTypeSummaryList = (output, context) => {
1725
+ const retVal = (output || [])
1726
+ .filter((e) => e != null)
1727
+ .map((entry) => {
2101
1728
  if (entry === null) {
2102
1729
  return null;
2103
1730
  }
@@ -2105,44 +1732,39 @@ var deserializeAws_restJson1TargetResourceTypeSummaryList = function (output, co
2105
1732
  });
2106
1733
  return retVal;
2107
1734
  };
2108
- var deserializeMetadata = function (output) {
2109
- var _a;
2110
- return ({
2111
- httpStatusCode: output.statusCode,
2112
- requestId: (_a = output.headers["x-amzn-requestid"]) !== null && _a !== void 0 ? _a : output.headers["x-amzn-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(); }
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) => {
2119
1742
  if (streamBody instanceof Uint8Array) {
2120
1743
  return Promise.resolve(streamBody);
2121
1744
  }
2122
1745
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
2123
1746
  };
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 loadRestJsonErrorCode = function (output, data) {
2143
- var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
2144
- var sanitizeErrorCode = function (rawValue) {
2145
- var cleanValue = rawValue;
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;
2146
1768
  if (typeof cleanValue === "number") {
2147
1769
  cleanValue = cleanValue.toString();
2148
1770
  }
@@ -2157,7 +1779,7 @@ var loadRestJsonErrorCode = function (output, data) {
2157
1779
  }
2158
1780
  return cleanValue;
2159
1781
  };
2160
- var headerKey = findKey(output.headers, "x-amzn-errortype");
1782
+ const headerKey = findKey(output.headers, "x-amzn-errortype");
2161
1783
  if (headerKey !== undefined) {
2162
1784
  return sanitizeErrorCode(output.headers[headerKey]);
2163
1785
  }