@aws-sdk/client-fis 3.489.0 → 3.495.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 (44) hide show
  1. package/dist-cjs/Fis.js +1 -59
  2. package/dist-cjs/FisClient.js +1 -43
  3. package/dist-cjs/commands/CreateExperimentTemplateCommand.js +1 -28
  4. package/dist-cjs/commands/CreateTargetAccountConfigurationCommand.js +1 -28
  5. package/dist-cjs/commands/DeleteExperimentTemplateCommand.js +1 -28
  6. package/dist-cjs/commands/DeleteTargetAccountConfigurationCommand.js +1 -28
  7. package/dist-cjs/commands/GetActionCommand.js +1 -28
  8. package/dist-cjs/commands/GetExperimentCommand.js +1 -28
  9. package/dist-cjs/commands/GetExperimentTargetAccountConfigurationCommand.js +1 -28
  10. package/dist-cjs/commands/GetExperimentTemplateCommand.js +1 -28
  11. package/dist-cjs/commands/GetTargetAccountConfigurationCommand.js +1 -28
  12. package/dist-cjs/commands/GetTargetResourceTypeCommand.js +1 -28
  13. package/dist-cjs/commands/ListActionsCommand.js +1 -28
  14. package/dist-cjs/commands/ListExperimentResolvedTargetsCommand.js +1 -28
  15. package/dist-cjs/commands/ListExperimentTargetAccountConfigurationsCommand.js +1 -28
  16. package/dist-cjs/commands/ListExperimentTemplatesCommand.js +1 -28
  17. package/dist-cjs/commands/ListExperimentsCommand.js +1 -28
  18. package/dist-cjs/commands/ListTagsForResourceCommand.js +1 -28
  19. package/dist-cjs/commands/ListTargetAccountConfigurationsCommand.js +1 -28
  20. package/dist-cjs/commands/ListTargetResourceTypesCommand.js +1 -28
  21. package/dist-cjs/commands/StartExperimentCommand.js +1 -28
  22. package/dist-cjs/commands/StopExperimentCommand.js +1 -28
  23. package/dist-cjs/commands/TagResourceCommand.js +1 -28
  24. package/dist-cjs/commands/UntagResourceCommand.js +1 -28
  25. package/dist-cjs/commands/UpdateExperimentTemplateCommand.js +1 -28
  26. package/dist-cjs/commands/UpdateTargetAccountConfigurationCommand.js +1 -28
  27. package/dist-cjs/commands/index.js +1 -27
  28. package/dist-cjs/endpoint/EndpointParameters.js +1 -18
  29. package/dist-cjs/extensionConfiguration.js +1 -2
  30. package/dist-cjs/index.js +2129 -11
  31. package/dist-cjs/models/FisServiceException.js +1 -12
  32. package/dist-cjs/models/index.js +1 -4
  33. package/dist-cjs/models/models_0.js +1 -84
  34. package/dist-cjs/pagination/Interfaces.js +1 -2
  35. package/dist-cjs/pagination/ListActionsPaginator.js +1 -7
  36. package/dist-cjs/pagination/ListExperimentResolvedTargetsPaginator.js +1 -7
  37. package/dist-cjs/pagination/ListExperimentTemplatesPaginator.js +1 -7
  38. package/dist-cjs/pagination/ListExperimentsPaginator.js +1 -7
  39. package/dist-cjs/pagination/ListTargetAccountConfigurationsPaginator.js +1 -7
  40. package/dist-cjs/pagination/ListTargetResourceTypesPaginator.js +1 -7
  41. package/dist-cjs/pagination/index.js +1 -10
  42. package/dist-cjs/protocols/Aws_restJson1.js +1 -1394
  43. package/dist-cjs/runtimeExtensions.js +1 -22
  44. package/package.json +40 -40
@@ -1,1394 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.de_UpdateTargetAccountConfigurationCommand = exports.de_UpdateExperimentTemplateCommand = exports.de_UntagResourceCommand = exports.de_TagResourceCommand = exports.de_StopExperimentCommand = exports.de_StartExperimentCommand = exports.de_ListTargetResourceTypesCommand = exports.de_ListTargetAccountConfigurationsCommand = exports.de_ListTagsForResourceCommand = exports.de_ListExperimentTemplatesCommand = exports.de_ListExperimentTargetAccountConfigurationsCommand = exports.de_ListExperimentsCommand = exports.de_ListExperimentResolvedTargetsCommand = exports.de_ListActionsCommand = exports.de_GetTargetResourceTypeCommand = exports.de_GetTargetAccountConfigurationCommand = exports.de_GetExperimentTemplateCommand = exports.de_GetExperimentTargetAccountConfigurationCommand = exports.de_GetExperimentCommand = exports.de_GetActionCommand = exports.de_DeleteTargetAccountConfigurationCommand = exports.de_DeleteExperimentTemplateCommand = exports.de_CreateTargetAccountConfigurationCommand = exports.de_CreateExperimentTemplateCommand = exports.se_UpdateTargetAccountConfigurationCommand = exports.se_UpdateExperimentTemplateCommand = exports.se_UntagResourceCommand = exports.se_TagResourceCommand = exports.se_StopExperimentCommand = exports.se_StartExperimentCommand = exports.se_ListTargetResourceTypesCommand = exports.se_ListTargetAccountConfigurationsCommand = exports.se_ListTagsForResourceCommand = exports.se_ListExperimentTemplatesCommand = exports.se_ListExperimentTargetAccountConfigurationsCommand = exports.se_ListExperimentsCommand = exports.se_ListExperimentResolvedTargetsCommand = exports.se_ListActionsCommand = exports.se_GetTargetResourceTypeCommand = exports.se_GetTargetAccountConfigurationCommand = exports.se_GetExperimentTemplateCommand = exports.se_GetExperimentTargetAccountConfigurationCommand = exports.se_GetExperimentCommand = exports.se_GetActionCommand = exports.se_DeleteTargetAccountConfigurationCommand = exports.se_DeleteExperimentTemplateCommand = exports.se_CreateTargetAccountConfigurationCommand = exports.se_CreateExperimentTemplateCommand = void 0;
4
- const core_1 = require("@smithy/core");
5
- const smithy_client_1 = require("@smithy/smithy-client");
6
- const uuid_1 = require("uuid");
7
- const FisServiceException_1 = require("../models/FisServiceException");
8
- const models_0_1 = require("../models/models_0");
9
- const se_CreateExperimentTemplateCommand = async (input, context) => {
10
- const b = (0, core_1.requestBuilder)(input, context);
11
- const headers = {
12
- "content-type": "application/json",
13
- };
14
- b.bp("/experimentTemplates");
15
- let body;
16
- body = JSON.stringify((0, smithy_client_1.take)(input, {
17
- actions: (_) => (0, smithy_client_1._json)(_),
18
- clientToken: [true, (_) => _ ?? (0, uuid_1.v4)()],
19
- description: [],
20
- experimentOptions: (_) => (0, smithy_client_1._json)(_),
21
- logConfiguration: (_) => (0, smithy_client_1._json)(_),
22
- roleArn: [],
23
- stopConditions: (_) => (0, smithy_client_1._json)(_),
24
- tags: (_) => (0, smithy_client_1._json)(_),
25
- targets: (_) => (0, smithy_client_1._json)(_),
26
- }));
27
- b.m("POST").h(headers).b(body);
28
- return b.build();
29
- };
30
- exports.se_CreateExperimentTemplateCommand = se_CreateExperimentTemplateCommand;
31
- const se_CreateTargetAccountConfigurationCommand = async (input, context) => {
32
- const b = (0, core_1.requestBuilder)(input, context);
33
- const headers = {
34
- "content-type": "application/json",
35
- };
36
- b.bp("/experimentTemplates/{experimentTemplateId}/targetAccountConfigurations/{accountId}");
37
- b.p("experimentTemplateId", () => input.experimentTemplateId, "{experimentTemplateId}", false);
38
- b.p("accountId", () => input.accountId, "{accountId}", false);
39
- let body;
40
- body = JSON.stringify((0, smithy_client_1.take)(input, {
41
- clientToken: [true, (_) => _ ?? (0, uuid_1.v4)()],
42
- description: [],
43
- roleArn: [],
44
- }));
45
- b.m("POST").h(headers).b(body);
46
- return b.build();
47
- };
48
- exports.se_CreateTargetAccountConfigurationCommand = se_CreateTargetAccountConfigurationCommand;
49
- const se_DeleteExperimentTemplateCommand = async (input, context) => {
50
- const b = (0, core_1.requestBuilder)(input, context);
51
- const headers = {};
52
- b.bp("/experimentTemplates/{id}");
53
- b.p("id", () => input.id, "{id}", false);
54
- let body;
55
- b.m("DELETE").h(headers).b(body);
56
- return b.build();
57
- };
58
- exports.se_DeleteExperimentTemplateCommand = se_DeleteExperimentTemplateCommand;
59
- const se_DeleteTargetAccountConfigurationCommand = async (input, context) => {
60
- const b = (0, core_1.requestBuilder)(input, context);
61
- const headers = {};
62
- b.bp("/experimentTemplates/{experimentTemplateId}/targetAccountConfigurations/{accountId}");
63
- b.p("experimentTemplateId", () => input.experimentTemplateId, "{experimentTemplateId}", false);
64
- b.p("accountId", () => input.accountId, "{accountId}", false);
65
- let body;
66
- b.m("DELETE").h(headers).b(body);
67
- return b.build();
68
- };
69
- exports.se_DeleteTargetAccountConfigurationCommand = se_DeleteTargetAccountConfigurationCommand;
70
- const se_GetActionCommand = async (input, context) => {
71
- const b = (0, core_1.requestBuilder)(input, context);
72
- const headers = {};
73
- b.bp("/actions/{id}");
74
- b.p("id", () => input.id, "{id}", false);
75
- let body;
76
- b.m("GET").h(headers).b(body);
77
- return b.build();
78
- };
79
- exports.se_GetActionCommand = se_GetActionCommand;
80
- const se_GetExperimentCommand = async (input, context) => {
81
- const b = (0, core_1.requestBuilder)(input, context);
82
- const headers = {};
83
- b.bp("/experiments/{id}");
84
- b.p("id", () => input.id, "{id}", false);
85
- let body;
86
- b.m("GET").h(headers).b(body);
87
- return b.build();
88
- };
89
- exports.se_GetExperimentCommand = se_GetExperimentCommand;
90
- const se_GetExperimentTargetAccountConfigurationCommand = async (input, context) => {
91
- const b = (0, core_1.requestBuilder)(input, context);
92
- const headers = {};
93
- b.bp("/experiments/{experimentId}/targetAccountConfigurations/{accountId}");
94
- b.p("experimentId", () => input.experimentId, "{experimentId}", false);
95
- b.p("accountId", () => input.accountId, "{accountId}", false);
96
- let body;
97
- b.m("GET").h(headers).b(body);
98
- return b.build();
99
- };
100
- exports.se_GetExperimentTargetAccountConfigurationCommand = se_GetExperimentTargetAccountConfigurationCommand;
101
- const se_GetExperimentTemplateCommand = async (input, context) => {
102
- const b = (0, core_1.requestBuilder)(input, context);
103
- const headers = {};
104
- b.bp("/experimentTemplates/{id}");
105
- b.p("id", () => input.id, "{id}", false);
106
- let body;
107
- b.m("GET").h(headers).b(body);
108
- return b.build();
109
- };
110
- exports.se_GetExperimentTemplateCommand = se_GetExperimentTemplateCommand;
111
- const se_GetTargetAccountConfigurationCommand = async (input, context) => {
112
- const b = (0, core_1.requestBuilder)(input, context);
113
- const headers = {};
114
- b.bp("/experimentTemplates/{experimentTemplateId}/targetAccountConfigurations/{accountId}");
115
- b.p("experimentTemplateId", () => input.experimentTemplateId, "{experimentTemplateId}", false);
116
- b.p("accountId", () => input.accountId, "{accountId}", false);
117
- let body;
118
- b.m("GET").h(headers).b(body);
119
- return b.build();
120
- };
121
- exports.se_GetTargetAccountConfigurationCommand = se_GetTargetAccountConfigurationCommand;
122
- const se_GetTargetResourceTypeCommand = async (input, context) => {
123
- const b = (0, core_1.requestBuilder)(input, context);
124
- const headers = {};
125
- b.bp("/targetResourceTypes/{resourceType}");
126
- b.p("resourceType", () => input.resourceType, "{resourceType}", false);
127
- let body;
128
- b.m("GET").h(headers).b(body);
129
- return b.build();
130
- };
131
- exports.se_GetTargetResourceTypeCommand = se_GetTargetResourceTypeCommand;
132
- const se_ListActionsCommand = async (input, context) => {
133
- const b = (0, core_1.requestBuilder)(input, context);
134
- const headers = {};
135
- b.bp("/actions");
136
- const query = (0, smithy_client_1.map)({
137
- [_mR]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
138
- [_nT]: [, input[_nT]],
139
- });
140
- let body;
141
- b.m("GET").h(headers).q(query).b(body);
142
- return b.build();
143
- };
144
- exports.se_ListActionsCommand = se_ListActionsCommand;
145
- const se_ListExperimentResolvedTargetsCommand = async (input, context) => {
146
- const b = (0, core_1.requestBuilder)(input, context);
147
- const headers = {};
148
- b.bp("/experiments/{experimentId}/resolvedTargets");
149
- b.p("experimentId", () => input.experimentId, "{experimentId}", false);
150
- const query = (0, smithy_client_1.map)({
151
- [_mR]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
152
- [_nT]: [, input[_nT]],
153
- [_tN]: [, input[_tN]],
154
- });
155
- let body;
156
- b.m("GET").h(headers).q(query).b(body);
157
- return b.build();
158
- };
159
- exports.se_ListExperimentResolvedTargetsCommand = se_ListExperimentResolvedTargetsCommand;
160
- const se_ListExperimentsCommand = async (input, context) => {
161
- const b = (0, core_1.requestBuilder)(input, context);
162
- const headers = {};
163
- b.bp("/experiments");
164
- const query = (0, smithy_client_1.map)({
165
- [_mR]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
166
- [_nT]: [, input[_nT]],
167
- });
168
- let body;
169
- b.m("GET").h(headers).q(query).b(body);
170
- return b.build();
171
- };
172
- exports.se_ListExperimentsCommand = se_ListExperimentsCommand;
173
- const se_ListExperimentTargetAccountConfigurationsCommand = async (input, context) => {
174
- const b = (0, core_1.requestBuilder)(input, context);
175
- const headers = {};
176
- b.bp("/experiments/{experimentId}/targetAccountConfigurations");
177
- b.p("experimentId", () => input.experimentId, "{experimentId}", false);
178
- const query = (0, smithy_client_1.map)({
179
- [_nT]: [, input[_nT]],
180
- });
181
- let body;
182
- b.m("GET").h(headers).q(query).b(body);
183
- return b.build();
184
- };
185
- exports.se_ListExperimentTargetAccountConfigurationsCommand = se_ListExperimentTargetAccountConfigurationsCommand;
186
- const se_ListExperimentTemplatesCommand = async (input, context) => {
187
- const b = (0, core_1.requestBuilder)(input, context);
188
- const headers = {};
189
- b.bp("/experimentTemplates");
190
- const query = (0, smithy_client_1.map)({
191
- [_mR]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
192
- [_nT]: [, input[_nT]],
193
- });
194
- let body;
195
- b.m("GET").h(headers).q(query).b(body);
196
- return b.build();
197
- };
198
- exports.se_ListExperimentTemplatesCommand = se_ListExperimentTemplatesCommand;
199
- const se_ListTagsForResourceCommand = async (input, context) => {
200
- const b = (0, core_1.requestBuilder)(input, context);
201
- const headers = {};
202
- b.bp("/tags/{resourceArn}");
203
- b.p("resourceArn", () => input.resourceArn, "{resourceArn}", false);
204
- let body;
205
- b.m("GET").h(headers).b(body);
206
- return b.build();
207
- };
208
- exports.se_ListTagsForResourceCommand = se_ListTagsForResourceCommand;
209
- const se_ListTargetAccountConfigurationsCommand = async (input, context) => {
210
- const b = (0, core_1.requestBuilder)(input, context);
211
- const headers = {};
212
- b.bp("/experimentTemplates/{experimentTemplateId}/targetAccountConfigurations");
213
- b.p("experimentTemplateId", () => input.experimentTemplateId, "{experimentTemplateId}", false);
214
- const query = (0, smithy_client_1.map)({
215
- [_mR]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
216
- [_nT]: [, input[_nT]],
217
- });
218
- let body;
219
- b.m("GET").h(headers).q(query).b(body);
220
- return b.build();
221
- };
222
- exports.se_ListTargetAccountConfigurationsCommand = se_ListTargetAccountConfigurationsCommand;
223
- const se_ListTargetResourceTypesCommand = async (input, context) => {
224
- const b = (0, core_1.requestBuilder)(input, context);
225
- const headers = {};
226
- b.bp("/targetResourceTypes");
227
- const query = (0, smithy_client_1.map)({
228
- [_mR]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
229
- [_nT]: [, input[_nT]],
230
- });
231
- let body;
232
- b.m("GET").h(headers).q(query).b(body);
233
- return b.build();
234
- };
235
- exports.se_ListTargetResourceTypesCommand = se_ListTargetResourceTypesCommand;
236
- const se_StartExperimentCommand = async (input, context) => {
237
- const b = (0, core_1.requestBuilder)(input, context);
238
- const headers = {
239
- "content-type": "application/json",
240
- };
241
- b.bp("/experiments");
242
- let body;
243
- body = JSON.stringify((0, smithy_client_1.take)(input, {
244
- clientToken: [true, (_) => _ ?? (0, uuid_1.v4)()],
245
- experimentTemplateId: [],
246
- tags: (_) => (0, smithy_client_1._json)(_),
247
- }));
248
- b.m("POST").h(headers).b(body);
249
- return b.build();
250
- };
251
- exports.se_StartExperimentCommand = se_StartExperimentCommand;
252
- const se_StopExperimentCommand = async (input, context) => {
253
- const b = (0, core_1.requestBuilder)(input, context);
254
- const headers = {};
255
- b.bp("/experiments/{id}");
256
- b.p("id", () => input.id, "{id}", false);
257
- let body;
258
- b.m("DELETE").h(headers).b(body);
259
- return b.build();
260
- };
261
- exports.se_StopExperimentCommand = se_StopExperimentCommand;
262
- const se_TagResourceCommand = async (input, context) => {
263
- const b = (0, core_1.requestBuilder)(input, context);
264
- const headers = {
265
- "content-type": "application/json",
266
- };
267
- b.bp("/tags/{resourceArn}");
268
- b.p("resourceArn", () => input.resourceArn, "{resourceArn}", false);
269
- let body;
270
- body = JSON.stringify((0, smithy_client_1.take)(input, {
271
- tags: (_) => (0, smithy_client_1._json)(_),
272
- }));
273
- b.m("POST").h(headers).b(body);
274
- return b.build();
275
- };
276
- exports.se_TagResourceCommand = se_TagResourceCommand;
277
- const se_UntagResourceCommand = async (input, context) => {
278
- const b = (0, core_1.requestBuilder)(input, context);
279
- const headers = {};
280
- b.bp("/tags/{resourceArn}");
281
- b.p("resourceArn", () => input.resourceArn, "{resourceArn}", false);
282
- const query = (0, smithy_client_1.map)({
283
- [_tK]: [() => input.tagKeys !== void 0, () => (input[_tK] || []).map((_entry) => _entry)],
284
- });
285
- let body;
286
- b.m("DELETE").h(headers).q(query).b(body);
287
- return b.build();
288
- };
289
- exports.se_UntagResourceCommand = se_UntagResourceCommand;
290
- const se_UpdateExperimentTemplateCommand = async (input, context) => {
291
- const b = (0, core_1.requestBuilder)(input, context);
292
- const headers = {
293
- "content-type": "application/json",
294
- };
295
- b.bp("/experimentTemplates/{id}");
296
- b.p("id", () => input.id, "{id}", false);
297
- let body;
298
- body = JSON.stringify((0, smithy_client_1.take)(input, {
299
- actions: (_) => (0, smithy_client_1._json)(_),
300
- description: [],
301
- experimentOptions: (_) => (0, smithy_client_1._json)(_),
302
- logConfiguration: (_) => (0, smithy_client_1._json)(_),
303
- roleArn: [],
304
- stopConditions: (_) => (0, smithy_client_1._json)(_),
305
- targets: (_) => (0, smithy_client_1._json)(_),
306
- }));
307
- b.m("PATCH").h(headers).b(body);
308
- return b.build();
309
- };
310
- exports.se_UpdateExperimentTemplateCommand = se_UpdateExperimentTemplateCommand;
311
- const se_UpdateTargetAccountConfigurationCommand = async (input, context) => {
312
- const b = (0, core_1.requestBuilder)(input, context);
313
- const headers = {
314
- "content-type": "application/json",
315
- };
316
- b.bp("/experimentTemplates/{experimentTemplateId}/targetAccountConfigurations/{accountId}");
317
- b.p("experimentTemplateId", () => input.experimentTemplateId, "{experimentTemplateId}", false);
318
- b.p("accountId", () => input.accountId, "{accountId}", false);
319
- let body;
320
- body = JSON.stringify((0, smithy_client_1.take)(input, {
321
- description: [],
322
- roleArn: [],
323
- }));
324
- b.m("PATCH").h(headers).b(body);
325
- return b.build();
326
- };
327
- exports.se_UpdateTargetAccountConfigurationCommand = se_UpdateTargetAccountConfigurationCommand;
328
- const de_CreateExperimentTemplateCommand = async (output, context) => {
329
- if (output.statusCode !== 200 && output.statusCode >= 300) {
330
- return de_CreateExperimentTemplateCommandError(output, context);
331
- }
332
- const contents = (0, smithy_client_1.map)({
333
- $metadata: deserializeMetadata(output),
334
- });
335
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
336
- const doc = (0, smithy_client_1.take)(data, {
337
- experimentTemplate: (_) => de_ExperimentTemplate(_, context),
338
- });
339
- Object.assign(contents, doc);
340
- return contents;
341
- };
342
- exports.de_CreateExperimentTemplateCommand = de_CreateExperimentTemplateCommand;
343
- const de_CreateExperimentTemplateCommandError = 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 de_ConflictExceptionRes(parsedOutput, context);
353
- case "ResourceNotFoundException":
354
- case "com.amazonaws.fis#ResourceNotFoundException":
355
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
356
- case "ServiceQuotaExceededException":
357
- case "com.amazonaws.fis#ServiceQuotaExceededException":
358
- throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
359
- case "ValidationException":
360
- case "com.amazonaws.fis#ValidationException":
361
- throw await de_ValidationExceptionRes(parsedOutput, context);
362
- default:
363
- const parsedBody = parsedOutput.body;
364
- return throwDefaultError({
365
- output,
366
- parsedBody,
367
- errorCode,
368
- });
369
- }
370
- };
371
- const de_CreateTargetAccountConfigurationCommand = async (output, context) => {
372
- if (output.statusCode !== 200 && output.statusCode >= 300) {
373
- return de_CreateTargetAccountConfigurationCommandError(output, context);
374
- }
375
- const contents = (0, smithy_client_1.map)({
376
- $metadata: deserializeMetadata(output),
377
- });
378
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
379
- const doc = (0, smithy_client_1.take)(data, {
380
- targetAccountConfiguration: smithy_client_1._json,
381
- });
382
- Object.assign(contents, doc);
383
- return contents;
384
- };
385
- exports.de_CreateTargetAccountConfigurationCommand = de_CreateTargetAccountConfigurationCommand;
386
- const de_CreateTargetAccountConfigurationCommandError = async (output, context) => {
387
- const parsedOutput = {
388
- ...output,
389
- body: await parseErrorBody(output.body, context),
390
- };
391
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
392
- switch (errorCode) {
393
- case "ConflictException":
394
- case "com.amazonaws.fis#ConflictException":
395
- throw await de_ConflictExceptionRes(parsedOutput, context);
396
- case "ResourceNotFoundException":
397
- case "com.amazonaws.fis#ResourceNotFoundException":
398
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
399
- case "ServiceQuotaExceededException":
400
- case "com.amazonaws.fis#ServiceQuotaExceededException":
401
- throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
402
- case "ValidationException":
403
- case "com.amazonaws.fis#ValidationException":
404
- throw await de_ValidationExceptionRes(parsedOutput, context);
405
- default:
406
- const parsedBody = parsedOutput.body;
407
- return throwDefaultError({
408
- output,
409
- parsedBody,
410
- errorCode,
411
- });
412
- }
413
- };
414
- const de_DeleteExperimentTemplateCommand = async (output, context) => {
415
- if (output.statusCode !== 200 && output.statusCode >= 300) {
416
- return de_DeleteExperimentTemplateCommandError(output, context);
417
- }
418
- const contents = (0, smithy_client_1.map)({
419
- $metadata: deserializeMetadata(output),
420
- });
421
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
422
- const doc = (0, smithy_client_1.take)(data, {
423
- experimentTemplate: (_) => de_ExperimentTemplate(_, context),
424
- });
425
- Object.assign(contents, doc);
426
- return contents;
427
- };
428
- exports.de_DeleteExperimentTemplateCommand = de_DeleteExperimentTemplateCommand;
429
- const de_DeleteExperimentTemplateCommandError = async (output, context) => {
430
- const parsedOutput = {
431
- ...output,
432
- body: await parseErrorBody(output.body, context),
433
- };
434
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
435
- switch (errorCode) {
436
- case "ResourceNotFoundException":
437
- case "com.amazonaws.fis#ResourceNotFoundException":
438
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
439
- case "ValidationException":
440
- case "com.amazonaws.fis#ValidationException":
441
- throw await de_ValidationExceptionRes(parsedOutput, context);
442
- default:
443
- const parsedBody = parsedOutput.body;
444
- return throwDefaultError({
445
- output,
446
- parsedBody,
447
- errorCode,
448
- });
449
- }
450
- };
451
- const de_DeleteTargetAccountConfigurationCommand = async (output, context) => {
452
- if (output.statusCode !== 200 && output.statusCode >= 300) {
453
- return de_DeleteTargetAccountConfigurationCommandError(output, context);
454
- }
455
- const contents = (0, smithy_client_1.map)({
456
- $metadata: deserializeMetadata(output),
457
- });
458
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
459
- const doc = (0, smithy_client_1.take)(data, {
460
- targetAccountConfiguration: smithy_client_1._json,
461
- });
462
- Object.assign(contents, doc);
463
- return contents;
464
- };
465
- exports.de_DeleteTargetAccountConfigurationCommand = de_DeleteTargetAccountConfigurationCommand;
466
- const de_DeleteTargetAccountConfigurationCommandError = async (output, context) => {
467
- const parsedOutput = {
468
- ...output,
469
- body: await parseErrorBody(output.body, context),
470
- };
471
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
472
- switch (errorCode) {
473
- case "ResourceNotFoundException":
474
- case "com.amazonaws.fis#ResourceNotFoundException":
475
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
476
- case "ValidationException":
477
- case "com.amazonaws.fis#ValidationException":
478
- throw await de_ValidationExceptionRes(parsedOutput, context);
479
- default:
480
- const parsedBody = parsedOutput.body;
481
- return throwDefaultError({
482
- output,
483
- parsedBody,
484
- errorCode,
485
- });
486
- }
487
- };
488
- const de_GetActionCommand = async (output, context) => {
489
- if (output.statusCode !== 200 && output.statusCode >= 300) {
490
- return de_GetActionCommandError(output, context);
491
- }
492
- const contents = (0, smithy_client_1.map)({
493
- $metadata: deserializeMetadata(output),
494
- });
495
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
496
- const doc = (0, smithy_client_1.take)(data, {
497
- action: smithy_client_1._json,
498
- });
499
- Object.assign(contents, doc);
500
- return contents;
501
- };
502
- exports.de_GetActionCommand = de_GetActionCommand;
503
- const de_GetActionCommandError = async (output, context) => {
504
- const parsedOutput = {
505
- ...output,
506
- body: await parseErrorBody(output.body, context),
507
- };
508
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
509
- switch (errorCode) {
510
- case "ResourceNotFoundException":
511
- case "com.amazonaws.fis#ResourceNotFoundException":
512
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
513
- case "ValidationException":
514
- case "com.amazonaws.fis#ValidationException":
515
- throw await de_ValidationExceptionRes(parsedOutput, context);
516
- default:
517
- const parsedBody = parsedOutput.body;
518
- return throwDefaultError({
519
- output,
520
- parsedBody,
521
- errorCode,
522
- });
523
- }
524
- };
525
- const de_GetExperimentCommand = async (output, context) => {
526
- if (output.statusCode !== 200 && output.statusCode >= 300) {
527
- return de_GetExperimentCommandError(output, context);
528
- }
529
- const contents = (0, smithy_client_1.map)({
530
- $metadata: deserializeMetadata(output),
531
- });
532
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
533
- const doc = (0, smithy_client_1.take)(data, {
534
- experiment: (_) => de_Experiment(_, context),
535
- });
536
- Object.assign(contents, doc);
537
- return contents;
538
- };
539
- exports.de_GetExperimentCommand = de_GetExperimentCommand;
540
- const de_GetExperimentCommandError = async (output, context) => {
541
- const parsedOutput = {
542
- ...output,
543
- body: await parseErrorBody(output.body, context),
544
- };
545
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
546
- switch (errorCode) {
547
- case "ResourceNotFoundException":
548
- case "com.amazonaws.fis#ResourceNotFoundException":
549
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
550
- case "ValidationException":
551
- case "com.amazonaws.fis#ValidationException":
552
- throw await de_ValidationExceptionRes(parsedOutput, context);
553
- default:
554
- const parsedBody = parsedOutput.body;
555
- return throwDefaultError({
556
- output,
557
- parsedBody,
558
- errorCode,
559
- });
560
- }
561
- };
562
- const de_GetExperimentTargetAccountConfigurationCommand = async (output, context) => {
563
- if (output.statusCode !== 200 && output.statusCode >= 300) {
564
- return de_GetExperimentTargetAccountConfigurationCommandError(output, context);
565
- }
566
- const contents = (0, smithy_client_1.map)({
567
- $metadata: deserializeMetadata(output),
568
- });
569
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
570
- const doc = (0, smithy_client_1.take)(data, {
571
- targetAccountConfiguration: smithy_client_1._json,
572
- });
573
- Object.assign(contents, doc);
574
- return contents;
575
- };
576
- exports.de_GetExperimentTargetAccountConfigurationCommand = de_GetExperimentTargetAccountConfigurationCommand;
577
- const de_GetExperimentTargetAccountConfigurationCommandError = async (output, context) => {
578
- const parsedOutput = {
579
- ...output,
580
- body: await parseErrorBody(output.body, context),
581
- };
582
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
583
- switch (errorCode) {
584
- case "ResourceNotFoundException":
585
- case "com.amazonaws.fis#ResourceNotFoundException":
586
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
587
- case "ValidationException":
588
- case "com.amazonaws.fis#ValidationException":
589
- throw await de_ValidationExceptionRes(parsedOutput, context);
590
- default:
591
- const parsedBody = parsedOutput.body;
592
- return throwDefaultError({
593
- output,
594
- parsedBody,
595
- errorCode,
596
- });
597
- }
598
- };
599
- const de_GetExperimentTemplateCommand = async (output, context) => {
600
- if (output.statusCode !== 200 && output.statusCode >= 300) {
601
- return de_GetExperimentTemplateCommandError(output, context);
602
- }
603
- const contents = (0, smithy_client_1.map)({
604
- $metadata: deserializeMetadata(output),
605
- });
606
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
607
- const doc = (0, smithy_client_1.take)(data, {
608
- experimentTemplate: (_) => de_ExperimentTemplate(_, context),
609
- });
610
- Object.assign(contents, doc);
611
- return contents;
612
- };
613
- exports.de_GetExperimentTemplateCommand = de_GetExperimentTemplateCommand;
614
- const de_GetExperimentTemplateCommandError = async (output, context) => {
615
- const parsedOutput = {
616
- ...output,
617
- body: await parseErrorBody(output.body, context),
618
- };
619
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
620
- switch (errorCode) {
621
- case "ResourceNotFoundException":
622
- case "com.amazonaws.fis#ResourceNotFoundException":
623
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
624
- case "ValidationException":
625
- case "com.amazonaws.fis#ValidationException":
626
- throw await de_ValidationExceptionRes(parsedOutput, context);
627
- default:
628
- const parsedBody = parsedOutput.body;
629
- return throwDefaultError({
630
- output,
631
- parsedBody,
632
- errorCode,
633
- });
634
- }
635
- };
636
- const de_GetTargetAccountConfigurationCommand = async (output, context) => {
637
- if (output.statusCode !== 200 && output.statusCode >= 300) {
638
- return de_GetTargetAccountConfigurationCommandError(output, context);
639
- }
640
- const contents = (0, smithy_client_1.map)({
641
- $metadata: deserializeMetadata(output),
642
- });
643
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
644
- const doc = (0, smithy_client_1.take)(data, {
645
- targetAccountConfiguration: smithy_client_1._json,
646
- });
647
- Object.assign(contents, doc);
648
- return contents;
649
- };
650
- exports.de_GetTargetAccountConfigurationCommand = de_GetTargetAccountConfigurationCommand;
651
- const de_GetTargetAccountConfigurationCommandError = async (output, context) => {
652
- const parsedOutput = {
653
- ...output,
654
- body: await parseErrorBody(output.body, context),
655
- };
656
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
657
- switch (errorCode) {
658
- case "ResourceNotFoundException":
659
- case "com.amazonaws.fis#ResourceNotFoundException":
660
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
661
- case "ValidationException":
662
- case "com.amazonaws.fis#ValidationException":
663
- throw await de_ValidationExceptionRes(parsedOutput, context);
664
- default:
665
- const parsedBody = parsedOutput.body;
666
- return throwDefaultError({
667
- output,
668
- parsedBody,
669
- errorCode,
670
- });
671
- }
672
- };
673
- const de_GetTargetResourceTypeCommand = async (output, context) => {
674
- if (output.statusCode !== 200 && output.statusCode >= 300) {
675
- return de_GetTargetResourceTypeCommandError(output, context);
676
- }
677
- const contents = (0, smithy_client_1.map)({
678
- $metadata: deserializeMetadata(output),
679
- });
680
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
681
- const doc = (0, smithy_client_1.take)(data, {
682
- targetResourceType: smithy_client_1._json,
683
- });
684
- Object.assign(contents, doc);
685
- return contents;
686
- };
687
- exports.de_GetTargetResourceTypeCommand = de_GetTargetResourceTypeCommand;
688
- const de_GetTargetResourceTypeCommandError = async (output, context) => {
689
- const parsedOutput = {
690
- ...output,
691
- body: await parseErrorBody(output.body, context),
692
- };
693
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
694
- switch (errorCode) {
695
- case "ResourceNotFoundException":
696
- case "com.amazonaws.fis#ResourceNotFoundException":
697
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
698
- case "ValidationException":
699
- case "com.amazonaws.fis#ValidationException":
700
- throw await de_ValidationExceptionRes(parsedOutput, context);
701
- default:
702
- const parsedBody = parsedOutput.body;
703
- return throwDefaultError({
704
- output,
705
- parsedBody,
706
- errorCode,
707
- });
708
- }
709
- };
710
- const de_ListActionsCommand = async (output, context) => {
711
- if (output.statusCode !== 200 && output.statusCode >= 300) {
712
- return de_ListActionsCommandError(output, context);
713
- }
714
- const contents = (0, smithy_client_1.map)({
715
- $metadata: deserializeMetadata(output),
716
- });
717
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
718
- const doc = (0, smithy_client_1.take)(data, {
719
- actions: smithy_client_1._json,
720
- nextToken: smithy_client_1.expectString,
721
- });
722
- Object.assign(contents, doc);
723
- return contents;
724
- };
725
- exports.de_ListActionsCommand = de_ListActionsCommand;
726
- const de_ListActionsCommandError = async (output, context) => {
727
- const parsedOutput = {
728
- ...output,
729
- body: await parseErrorBody(output.body, context),
730
- };
731
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
732
- switch (errorCode) {
733
- case "ValidationException":
734
- case "com.amazonaws.fis#ValidationException":
735
- throw await de_ValidationExceptionRes(parsedOutput, context);
736
- default:
737
- const parsedBody = parsedOutput.body;
738
- return throwDefaultError({
739
- output,
740
- parsedBody,
741
- errorCode,
742
- });
743
- }
744
- };
745
- const de_ListExperimentResolvedTargetsCommand = async (output, context) => {
746
- if (output.statusCode !== 200 && output.statusCode >= 300) {
747
- return de_ListExperimentResolvedTargetsCommandError(output, context);
748
- }
749
- const contents = (0, smithy_client_1.map)({
750
- $metadata: deserializeMetadata(output),
751
- });
752
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
753
- const doc = (0, smithy_client_1.take)(data, {
754
- nextToken: smithy_client_1.expectString,
755
- resolvedTargets: smithy_client_1._json,
756
- });
757
- Object.assign(contents, doc);
758
- return contents;
759
- };
760
- exports.de_ListExperimentResolvedTargetsCommand = de_ListExperimentResolvedTargetsCommand;
761
- const de_ListExperimentResolvedTargetsCommandError = async (output, context) => {
762
- const parsedOutput = {
763
- ...output,
764
- body: await parseErrorBody(output.body, context),
765
- };
766
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
767
- switch (errorCode) {
768
- case "ResourceNotFoundException":
769
- case "com.amazonaws.fis#ResourceNotFoundException":
770
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
771
- case "ValidationException":
772
- case "com.amazonaws.fis#ValidationException":
773
- throw await de_ValidationExceptionRes(parsedOutput, context);
774
- default:
775
- const parsedBody = parsedOutput.body;
776
- return throwDefaultError({
777
- output,
778
- parsedBody,
779
- errorCode,
780
- });
781
- }
782
- };
783
- const de_ListExperimentsCommand = async (output, context) => {
784
- if (output.statusCode !== 200 && output.statusCode >= 300) {
785
- return de_ListExperimentsCommandError(output, context);
786
- }
787
- const contents = (0, smithy_client_1.map)({
788
- $metadata: deserializeMetadata(output),
789
- });
790
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
791
- const doc = (0, smithy_client_1.take)(data, {
792
- experiments: (_) => de_ExperimentSummaryList(_, context),
793
- nextToken: smithy_client_1.expectString,
794
- });
795
- Object.assign(contents, doc);
796
- return contents;
797
- };
798
- exports.de_ListExperimentsCommand = de_ListExperimentsCommand;
799
- const de_ListExperimentsCommandError = async (output, context) => {
800
- const parsedOutput = {
801
- ...output,
802
- body: await parseErrorBody(output.body, context),
803
- };
804
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
805
- switch (errorCode) {
806
- case "ValidationException":
807
- case "com.amazonaws.fis#ValidationException":
808
- throw await de_ValidationExceptionRes(parsedOutput, context);
809
- default:
810
- const parsedBody = parsedOutput.body;
811
- return throwDefaultError({
812
- output,
813
- parsedBody,
814
- errorCode,
815
- });
816
- }
817
- };
818
- const de_ListExperimentTargetAccountConfigurationsCommand = async (output, context) => {
819
- if (output.statusCode !== 200 && output.statusCode >= 300) {
820
- return de_ListExperimentTargetAccountConfigurationsCommandError(output, context);
821
- }
822
- const contents = (0, smithy_client_1.map)({
823
- $metadata: deserializeMetadata(output),
824
- });
825
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
826
- const doc = (0, smithy_client_1.take)(data, {
827
- nextToken: smithy_client_1.expectString,
828
- targetAccountConfigurations: smithy_client_1._json,
829
- });
830
- Object.assign(contents, doc);
831
- return contents;
832
- };
833
- exports.de_ListExperimentTargetAccountConfigurationsCommand = de_ListExperimentTargetAccountConfigurationsCommand;
834
- const de_ListExperimentTargetAccountConfigurationsCommandError = async (output, context) => {
835
- const parsedOutput = {
836
- ...output,
837
- body: await parseErrorBody(output.body, context),
838
- };
839
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
840
- switch (errorCode) {
841
- case "ResourceNotFoundException":
842
- case "com.amazonaws.fis#ResourceNotFoundException":
843
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
844
- case "ValidationException":
845
- case "com.amazonaws.fis#ValidationException":
846
- throw await de_ValidationExceptionRes(parsedOutput, context);
847
- default:
848
- const parsedBody = parsedOutput.body;
849
- return throwDefaultError({
850
- output,
851
- parsedBody,
852
- errorCode,
853
- });
854
- }
855
- };
856
- const de_ListExperimentTemplatesCommand = async (output, context) => {
857
- if (output.statusCode !== 200 && output.statusCode >= 300) {
858
- return de_ListExperimentTemplatesCommandError(output, context);
859
- }
860
- const contents = (0, smithy_client_1.map)({
861
- $metadata: deserializeMetadata(output),
862
- });
863
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
864
- const doc = (0, smithy_client_1.take)(data, {
865
- experimentTemplates: (_) => de_ExperimentTemplateSummaryList(_, context),
866
- nextToken: smithy_client_1.expectString,
867
- });
868
- Object.assign(contents, doc);
869
- return contents;
870
- };
871
- exports.de_ListExperimentTemplatesCommand = de_ListExperimentTemplatesCommand;
872
- const de_ListExperimentTemplatesCommandError = async (output, context) => {
873
- const parsedOutput = {
874
- ...output,
875
- body: await parseErrorBody(output.body, context),
876
- };
877
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
878
- switch (errorCode) {
879
- case "ValidationException":
880
- case "com.amazonaws.fis#ValidationException":
881
- throw await de_ValidationExceptionRes(parsedOutput, context);
882
- default:
883
- const parsedBody = parsedOutput.body;
884
- return throwDefaultError({
885
- output,
886
- parsedBody,
887
- errorCode,
888
- });
889
- }
890
- };
891
- const de_ListTagsForResourceCommand = async (output, context) => {
892
- if (output.statusCode !== 200 && output.statusCode >= 300) {
893
- return de_ListTagsForResourceCommandError(output, context);
894
- }
895
- const contents = (0, smithy_client_1.map)({
896
- $metadata: deserializeMetadata(output),
897
- });
898
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
899
- const doc = (0, smithy_client_1.take)(data, {
900
- tags: smithy_client_1._json,
901
- });
902
- Object.assign(contents, doc);
903
- return contents;
904
- };
905
- exports.de_ListTagsForResourceCommand = de_ListTagsForResourceCommand;
906
- const de_ListTagsForResourceCommandError = async (output, context) => {
907
- const parsedOutput = {
908
- ...output,
909
- body: await parseErrorBody(output.body, context),
910
- };
911
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
912
- const parsedBody = parsedOutput.body;
913
- return throwDefaultError({
914
- output,
915
- parsedBody,
916
- errorCode,
917
- });
918
- };
919
- const de_ListTargetAccountConfigurationsCommand = async (output, context) => {
920
- if (output.statusCode !== 200 && output.statusCode >= 300) {
921
- return de_ListTargetAccountConfigurationsCommandError(output, context);
922
- }
923
- const contents = (0, smithy_client_1.map)({
924
- $metadata: deserializeMetadata(output),
925
- });
926
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
927
- const doc = (0, smithy_client_1.take)(data, {
928
- nextToken: smithy_client_1.expectString,
929
- targetAccountConfigurations: smithy_client_1._json,
930
- });
931
- Object.assign(contents, doc);
932
- return contents;
933
- };
934
- exports.de_ListTargetAccountConfigurationsCommand = de_ListTargetAccountConfigurationsCommand;
935
- const de_ListTargetAccountConfigurationsCommandError = async (output, context) => {
936
- const parsedOutput = {
937
- ...output,
938
- body: await parseErrorBody(output.body, context),
939
- };
940
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
941
- switch (errorCode) {
942
- case "ResourceNotFoundException":
943
- case "com.amazonaws.fis#ResourceNotFoundException":
944
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
945
- case "ValidationException":
946
- case "com.amazonaws.fis#ValidationException":
947
- throw await de_ValidationExceptionRes(parsedOutput, context);
948
- default:
949
- const parsedBody = parsedOutput.body;
950
- return throwDefaultError({
951
- output,
952
- parsedBody,
953
- errorCode,
954
- });
955
- }
956
- };
957
- const de_ListTargetResourceTypesCommand = async (output, context) => {
958
- if (output.statusCode !== 200 && output.statusCode >= 300) {
959
- return de_ListTargetResourceTypesCommandError(output, context);
960
- }
961
- const contents = (0, smithy_client_1.map)({
962
- $metadata: deserializeMetadata(output),
963
- });
964
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
965
- const doc = (0, smithy_client_1.take)(data, {
966
- nextToken: smithy_client_1.expectString,
967
- targetResourceTypes: smithy_client_1._json,
968
- });
969
- Object.assign(contents, doc);
970
- return contents;
971
- };
972
- exports.de_ListTargetResourceTypesCommand = de_ListTargetResourceTypesCommand;
973
- const de_ListTargetResourceTypesCommandError = async (output, context) => {
974
- const parsedOutput = {
975
- ...output,
976
- body: await parseErrorBody(output.body, context),
977
- };
978
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
979
- switch (errorCode) {
980
- case "ValidationException":
981
- case "com.amazonaws.fis#ValidationException":
982
- throw await de_ValidationExceptionRes(parsedOutput, context);
983
- default:
984
- const parsedBody = parsedOutput.body;
985
- return throwDefaultError({
986
- output,
987
- parsedBody,
988
- errorCode,
989
- });
990
- }
991
- };
992
- const de_StartExperimentCommand = async (output, context) => {
993
- if (output.statusCode !== 200 && output.statusCode >= 300) {
994
- return de_StartExperimentCommandError(output, context);
995
- }
996
- const contents = (0, smithy_client_1.map)({
997
- $metadata: deserializeMetadata(output),
998
- });
999
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1000
- const doc = (0, smithy_client_1.take)(data, {
1001
- experiment: (_) => de_Experiment(_, context),
1002
- });
1003
- Object.assign(contents, doc);
1004
- return contents;
1005
- };
1006
- exports.de_StartExperimentCommand = de_StartExperimentCommand;
1007
- const de_StartExperimentCommandError = async (output, context) => {
1008
- const parsedOutput = {
1009
- ...output,
1010
- body: await parseErrorBody(output.body, context),
1011
- };
1012
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1013
- switch (errorCode) {
1014
- case "ConflictException":
1015
- case "com.amazonaws.fis#ConflictException":
1016
- throw await de_ConflictExceptionRes(parsedOutput, context);
1017
- case "ResourceNotFoundException":
1018
- case "com.amazonaws.fis#ResourceNotFoundException":
1019
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1020
- case "ServiceQuotaExceededException":
1021
- case "com.amazonaws.fis#ServiceQuotaExceededException":
1022
- throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
1023
- case "ValidationException":
1024
- case "com.amazonaws.fis#ValidationException":
1025
- throw await de_ValidationExceptionRes(parsedOutput, context);
1026
- default:
1027
- const parsedBody = parsedOutput.body;
1028
- return throwDefaultError({
1029
- output,
1030
- parsedBody,
1031
- errorCode,
1032
- });
1033
- }
1034
- };
1035
- const de_StopExperimentCommand = async (output, context) => {
1036
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1037
- return de_StopExperimentCommandError(output, context);
1038
- }
1039
- const contents = (0, smithy_client_1.map)({
1040
- $metadata: deserializeMetadata(output),
1041
- });
1042
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1043
- const doc = (0, smithy_client_1.take)(data, {
1044
- experiment: (_) => de_Experiment(_, context),
1045
- });
1046
- Object.assign(contents, doc);
1047
- return contents;
1048
- };
1049
- exports.de_StopExperimentCommand = de_StopExperimentCommand;
1050
- const de_StopExperimentCommandError = async (output, context) => {
1051
- const parsedOutput = {
1052
- ...output,
1053
- body: await parseErrorBody(output.body, context),
1054
- };
1055
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1056
- switch (errorCode) {
1057
- case "ResourceNotFoundException":
1058
- case "com.amazonaws.fis#ResourceNotFoundException":
1059
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1060
- case "ValidationException":
1061
- case "com.amazonaws.fis#ValidationException":
1062
- throw await de_ValidationExceptionRes(parsedOutput, context);
1063
- default:
1064
- const parsedBody = parsedOutput.body;
1065
- return throwDefaultError({
1066
- output,
1067
- parsedBody,
1068
- errorCode,
1069
- });
1070
- }
1071
- };
1072
- const de_TagResourceCommand = async (output, context) => {
1073
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1074
- return de_TagResourceCommandError(output, context);
1075
- }
1076
- const contents = (0, smithy_client_1.map)({
1077
- $metadata: deserializeMetadata(output),
1078
- });
1079
- await (0, smithy_client_1.collectBody)(output.body, context);
1080
- return contents;
1081
- };
1082
- exports.de_TagResourceCommand = de_TagResourceCommand;
1083
- const de_TagResourceCommandError = async (output, context) => {
1084
- const parsedOutput = {
1085
- ...output,
1086
- body: await parseErrorBody(output.body, context),
1087
- };
1088
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1089
- const parsedBody = parsedOutput.body;
1090
- return throwDefaultError({
1091
- output,
1092
- parsedBody,
1093
- errorCode,
1094
- });
1095
- };
1096
- const de_UntagResourceCommand = async (output, context) => {
1097
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1098
- return de_UntagResourceCommandError(output, context);
1099
- }
1100
- const contents = (0, smithy_client_1.map)({
1101
- $metadata: deserializeMetadata(output),
1102
- });
1103
- await (0, smithy_client_1.collectBody)(output.body, context);
1104
- return contents;
1105
- };
1106
- exports.de_UntagResourceCommand = de_UntagResourceCommand;
1107
- const de_UntagResourceCommandError = async (output, context) => {
1108
- const parsedOutput = {
1109
- ...output,
1110
- body: await parseErrorBody(output.body, context),
1111
- };
1112
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1113
- const parsedBody = parsedOutput.body;
1114
- return throwDefaultError({
1115
- output,
1116
- parsedBody,
1117
- errorCode,
1118
- });
1119
- };
1120
- const de_UpdateExperimentTemplateCommand = async (output, context) => {
1121
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1122
- return de_UpdateExperimentTemplateCommandError(output, context);
1123
- }
1124
- const contents = (0, smithy_client_1.map)({
1125
- $metadata: deserializeMetadata(output),
1126
- });
1127
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1128
- const doc = (0, smithy_client_1.take)(data, {
1129
- experimentTemplate: (_) => de_ExperimentTemplate(_, context),
1130
- });
1131
- Object.assign(contents, doc);
1132
- return contents;
1133
- };
1134
- exports.de_UpdateExperimentTemplateCommand = de_UpdateExperimentTemplateCommand;
1135
- const de_UpdateExperimentTemplateCommandError = async (output, context) => {
1136
- const parsedOutput = {
1137
- ...output,
1138
- body: await parseErrorBody(output.body, context),
1139
- };
1140
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1141
- switch (errorCode) {
1142
- case "ResourceNotFoundException":
1143
- case "com.amazonaws.fis#ResourceNotFoundException":
1144
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1145
- case "ServiceQuotaExceededException":
1146
- case "com.amazonaws.fis#ServiceQuotaExceededException":
1147
- throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
1148
- case "ValidationException":
1149
- case "com.amazonaws.fis#ValidationException":
1150
- throw await de_ValidationExceptionRes(parsedOutput, context);
1151
- default:
1152
- const parsedBody = parsedOutput.body;
1153
- return throwDefaultError({
1154
- output,
1155
- parsedBody,
1156
- errorCode,
1157
- });
1158
- }
1159
- };
1160
- const de_UpdateTargetAccountConfigurationCommand = async (output, context) => {
1161
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1162
- return de_UpdateTargetAccountConfigurationCommandError(output, context);
1163
- }
1164
- const contents = (0, smithy_client_1.map)({
1165
- $metadata: deserializeMetadata(output),
1166
- });
1167
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1168
- const doc = (0, smithy_client_1.take)(data, {
1169
- targetAccountConfiguration: smithy_client_1._json,
1170
- });
1171
- Object.assign(contents, doc);
1172
- return contents;
1173
- };
1174
- exports.de_UpdateTargetAccountConfigurationCommand = de_UpdateTargetAccountConfigurationCommand;
1175
- const de_UpdateTargetAccountConfigurationCommandError = async (output, context) => {
1176
- const parsedOutput = {
1177
- ...output,
1178
- body: await parseErrorBody(output.body, context),
1179
- };
1180
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1181
- switch (errorCode) {
1182
- case "ResourceNotFoundException":
1183
- case "com.amazonaws.fis#ResourceNotFoundException":
1184
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1185
- case "ValidationException":
1186
- case "com.amazonaws.fis#ValidationException":
1187
- throw await de_ValidationExceptionRes(parsedOutput, context);
1188
- default:
1189
- const parsedBody = parsedOutput.body;
1190
- return throwDefaultError({
1191
- output,
1192
- parsedBody,
1193
- errorCode,
1194
- });
1195
- }
1196
- };
1197
- const throwDefaultError = (0, smithy_client_1.withBaseException)(FisServiceException_1.FisServiceException);
1198
- const de_ConflictExceptionRes = async (parsedOutput, context) => {
1199
- const contents = (0, smithy_client_1.map)({});
1200
- const data = parsedOutput.body;
1201
- const doc = (0, smithy_client_1.take)(data, {
1202
- message: smithy_client_1.expectString,
1203
- });
1204
- Object.assign(contents, doc);
1205
- const exception = new models_0_1.ConflictException({
1206
- $metadata: deserializeMetadata(parsedOutput),
1207
- ...contents,
1208
- });
1209
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1210
- };
1211
- const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
1212
- const contents = (0, smithy_client_1.map)({});
1213
- const data = parsedOutput.body;
1214
- const doc = (0, smithy_client_1.take)(data, {
1215
- message: smithy_client_1.expectString,
1216
- });
1217
- Object.assign(contents, doc);
1218
- const exception = new models_0_1.ResourceNotFoundException({
1219
- $metadata: deserializeMetadata(parsedOutput),
1220
- ...contents,
1221
- });
1222
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1223
- };
1224
- const de_ServiceQuotaExceededExceptionRes = async (parsedOutput, context) => {
1225
- const contents = (0, smithy_client_1.map)({});
1226
- const data = parsedOutput.body;
1227
- const doc = (0, smithy_client_1.take)(data, {
1228
- message: smithy_client_1.expectString,
1229
- });
1230
- Object.assign(contents, doc);
1231
- const exception = new models_0_1.ServiceQuotaExceededException({
1232
- $metadata: deserializeMetadata(parsedOutput),
1233
- ...contents,
1234
- });
1235
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1236
- };
1237
- const de_ValidationExceptionRes = async (parsedOutput, context) => {
1238
- const contents = (0, smithy_client_1.map)({});
1239
- const data = parsedOutput.body;
1240
- const doc = (0, smithy_client_1.take)(data, {
1241
- message: smithy_client_1.expectString,
1242
- });
1243
- Object.assign(contents, doc);
1244
- const exception = new models_0_1.ValidationException({
1245
- $metadata: deserializeMetadata(parsedOutput),
1246
- ...contents,
1247
- });
1248
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1249
- };
1250
- const de_Experiment = (output, context) => {
1251
- return (0, smithy_client_1.take)(output, {
1252
- actions: (_) => de_ExperimentActionMap(_, context),
1253
- creationTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1254
- endTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1255
- experimentOptions: smithy_client_1._json,
1256
- experimentTemplateId: smithy_client_1.expectString,
1257
- id: smithy_client_1.expectString,
1258
- logConfiguration: smithy_client_1._json,
1259
- roleArn: smithy_client_1.expectString,
1260
- startTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1261
- state: smithy_client_1._json,
1262
- stopConditions: smithy_client_1._json,
1263
- tags: smithy_client_1._json,
1264
- targetAccountConfigurationsCount: smithy_client_1.expectLong,
1265
- targets: smithy_client_1._json,
1266
- });
1267
- };
1268
- const de_ExperimentAction = (output, context) => {
1269
- return (0, smithy_client_1.take)(output, {
1270
- actionId: smithy_client_1.expectString,
1271
- description: smithy_client_1.expectString,
1272
- endTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1273
- parameters: smithy_client_1._json,
1274
- startAfter: smithy_client_1._json,
1275
- startTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1276
- state: smithy_client_1._json,
1277
- targets: smithy_client_1._json,
1278
- });
1279
- };
1280
- const de_ExperimentActionMap = (output, context) => {
1281
- return Object.entries(output).reduce((acc, [key, value]) => {
1282
- if (value === null) {
1283
- return acc;
1284
- }
1285
- acc[key] = de_ExperimentAction(value, context);
1286
- return acc;
1287
- }, {});
1288
- };
1289
- const de_ExperimentSummary = (output, context) => {
1290
- return (0, smithy_client_1.take)(output, {
1291
- creationTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1292
- experimentTemplateId: smithy_client_1.expectString,
1293
- id: smithy_client_1.expectString,
1294
- state: smithy_client_1._json,
1295
- tags: smithy_client_1._json,
1296
- });
1297
- };
1298
- const de_ExperimentSummaryList = (output, context) => {
1299
- const retVal = (output || [])
1300
- .filter((e) => e != null)
1301
- .map((entry) => {
1302
- return de_ExperimentSummary(entry, context);
1303
- });
1304
- return retVal;
1305
- };
1306
- const de_ExperimentTemplate = (output, context) => {
1307
- return (0, smithy_client_1.take)(output, {
1308
- actions: smithy_client_1._json,
1309
- creationTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1310
- description: smithy_client_1.expectString,
1311
- experimentOptions: smithy_client_1._json,
1312
- id: smithy_client_1.expectString,
1313
- lastUpdateTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1314
- logConfiguration: smithy_client_1._json,
1315
- roleArn: smithy_client_1.expectString,
1316
- stopConditions: smithy_client_1._json,
1317
- tags: smithy_client_1._json,
1318
- targetAccountConfigurationsCount: smithy_client_1.expectLong,
1319
- targets: smithy_client_1._json,
1320
- });
1321
- };
1322
- const de_ExperimentTemplateSummary = (output, context) => {
1323
- return (0, smithy_client_1.take)(output, {
1324
- creationTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1325
- description: smithy_client_1.expectString,
1326
- id: smithy_client_1.expectString,
1327
- lastUpdateTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1328
- tags: smithy_client_1._json,
1329
- });
1330
- };
1331
- const de_ExperimentTemplateSummaryList = (output, context) => {
1332
- const retVal = (output || [])
1333
- .filter((e) => e != null)
1334
- .map((entry) => {
1335
- return de_ExperimentTemplateSummary(entry, context);
1336
- });
1337
- return retVal;
1338
- };
1339
- const deserializeMetadata = (output) => ({
1340
- httpStatusCode: output.statusCode,
1341
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
1342
- extendedRequestId: output.headers["x-amz-id-2"],
1343
- cfId: output.headers["x-amz-cf-id"],
1344
- });
1345
- const collectBodyString = (streamBody, context) => (0, smithy_client_1.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body));
1346
- const isSerializableHeaderValue = (value) => value !== undefined &&
1347
- value !== null &&
1348
- value !== "" &&
1349
- (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
1350
- (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
1351
- const _mR = "maxResults";
1352
- const _nT = "nextToken";
1353
- const _tK = "tagKeys";
1354
- const _tN = "targetName";
1355
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1356
- if (encoded.length) {
1357
- return JSON.parse(encoded);
1358
- }
1359
- return {};
1360
- });
1361
- const parseErrorBody = async (errorBody, context) => {
1362
- const value = await parseBody(errorBody, context);
1363
- value.message = value.message ?? value.Message;
1364
- return value;
1365
- };
1366
- const loadRestJsonErrorCode = (output, data) => {
1367
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
1368
- const sanitizeErrorCode = (rawValue) => {
1369
- let cleanValue = rawValue;
1370
- if (typeof cleanValue === "number") {
1371
- cleanValue = cleanValue.toString();
1372
- }
1373
- if (cleanValue.indexOf(",") >= 0) {
1374
- cleanValue = cleanValue.split(",")[0];
1375
- }
1376
- if (cleanValue.indexOf(":") >= 0) {
1377
- cleanValue = cleanValue.split(":")[0];
1378
- }
1379
- if (cleanValue.indexOf("#") >= 0) {
1380
- cleanValue = cleanValue.split("#")[1];
1381
- }
1382
- return cleanValue;
1383
- };
1384
- const headerKey = findKey(output.headers, "x-amzn-errortype");
1385
- if (headerKey !== undefined) {
1386
- return sanitizeErrorCode(output.headers[headerKey]);
1387
- }
1388
- if (data.code !== undefined) {
1389
- return sanitizeErrorCode(data.code);
1390
- }
1391
- if (data["__type"] !== undefined) {
1392
- return sanitizeErrorCode(data["__type"]);
1393
- }
1394
- };
1
+ module.exports = require("../index.js");