@aws-sdk/client-fis 3.928.0 → 3.930.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 (47) hide show
  1. package/dist-cjs/index.js +1541 -1069
  2. package/dist-cjs/runtimeConfig.shared.js +2 -0
  3. package/dist-es/FisClient.js +2 -0
  4. package/dist-es/commands/CreateExperimentTemplateCommand.js +3 -9
  5. package/dist-es/commands/CreateTargetAccountConfigurationCommand.js +3 -9
  6. package/dist-es/commands/DeleteExperimentTemplateCommand.js +3 -9
  7. package/dist-es/commands/DeleteTargetAccountConfigurationCommand.js +3 -9
  8. package/dist-es/commands/GetActionCommand.js +3 -9
  9. package/dist-es/commands/GetExperimentCommand.js +3 -9
  10. package/dist-es/commands/GetExperimentTargetAccountConfigurationCommand.js +3 -9
  11. package/dist-es/commands/GetExperimentTemplateCommand.js +3 -9
  12. package/dist-es/commands/GetSafetyLeverCommand.js +3 -9
  13. package/dist-es/commands/GetTargetAccountConfigurationCommand.js +3 -9
  14. package/dist-es/commands/GetTargetResourceTypeCommand.js +3 -9
  15. package/dist-es/commands/ListActionsCommand.js +3 -9
  16. package/dist-es/commands/ListExperimentResolvedTargetsCommand.js +3 -9
  17. package/dist-es/commands/ListExperimentTargetAccountConfigurationsCommand.js +3 -9
  18. package/dist-es/commands/ListExperimentTemplatesCommand.js +3 -9
  19. package/dist-es/commands/ListExperimentsCommand.js +3 -9
  20. package/dist-es/commands/ListTagsForResourceCommand.js +3 -9
  21. package/dist-es/commands/ListTargetAccountConfigurationsCommand.js +3 -9
  22. package/dist-es/commands/ListTargetResourceTypesCommand.js +3 -9
  23. package/dist-es/commands/StartExperimentCommand.js +3 -9
  24. package/dist-es/commands/StopExperimentCommand.js +3 -9
  25. package/dist-es/commands/TagResourceCommand.js +3 -9
  26. package/dist-es/commands/UntagResourceCommand.js +3 -9
  27. package/dist-es/commands/UpdateExperimentTemplateCommand.js +3 -9
  28. package/dist-es/commands/UpdateSafetyLeverStateCommand.js +3 -9
  29. package/dist-es/commands/UpdateTargetAccountConfigurationCommand.js +3 -9
  30. package/dist-es/runtimeConfig.shared.js +2 -0
  31. package/dist-es/schemas/schemas_0.js +1495 -0
  32. package/dist-types/FisClient.d.ts +10 -1
  33. package/dist-types/runtimeConfig.browser.d.ts +1 -0
  34. package/dist-types/runtimeConfig.d.ts +1 -0
  35. package/dist-types/runtimeConfig.native.d.ts +1 -0
  36. package/dist-types/runtimeConfig.shared.d.ts +1 -0
  37. package/dist-types/schemas/schemas_0.d.ts +200 -0
  38. package/dist-types/ts3.4/FisClient.d.ts +4 -0
  39. package/dist-types/ts3.4/runtimeConfig.browser.d.ts +4 -0
  40. package/dist-types/ts3.4/runtimeConfig.d.ts +4 -0
  41. package/dist-types/ts3.4/runtimeConfig.native.d.ts +4 -0
  42. package/dist-types/ts3.4/runtimeConfig.shared.d.ts +4 -0
  43. package/dist-types/ts3.4/schemas/schemas_0.d.ts +206 -0
  44. package/package.json +33 -34
  45. package/dist-es/protocols/Aws_restJson1.js +0 -881
  46. package/dist-types/protocols/Aws_restJson1.d.ts +0 -236
  47. package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +0 -317
@@ -1,881 +0,0 @@
1
- import { loadRestJsonErrorCode, parseJsonBody as parseBody, parseJsonErrorBody as parseErrorBody } from "@aws-sdk/core";
2
- import { requestBuilder as rb } from "@smithy/core";
3
- import { _json, collectBody, decorateServiceException as __decorateServiceException, expectLong as __expectLong, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, map, parseEpochTimestamp as __parseEpochTimestamp, take, withBaseException, } from "@smithy/smithy-client";
4
- import { v4 as generateIdempotencyToken } from "@smithy/uuid";
5
- import { FisServiceException as __BaseException } from "../models/FisServiceException";
6
- import { ConflictException, ResourceNotFoundException, ServiceQuotaExceededException, ValidationException, } from "../models/models_0";
7
- export const se_CreateExperimentTemplateCommand = async (input, context) => {
8
- const b = rb(input, context);
9
- const headers = {
10
- "content-type": "application/json",
11
- };
12
- b.bp("/experimentTemplates");
13
- let body;
14
- body = JSON.stringify(take(input, {
15
- actions: (_) => _json(_),
16
- clientToken: [true, (_) => _ ?? generateIdempotencyToken()],
17
- description: [],
18
- experimentOptions: (_) => _json(_),
19
- experimentReportConfiguration: (_) => _json(_),
20
- logConfiguration: (_) => _json(_),
21
- roleArn: [],
22
- stopConditions: (_) => _json(_),
23
- tags: (_) => _json(_),
24
- targets: (_) => _json(_),
25
- }));
26
- b.m("POST").h(headers).b(body);
27
- return b.build();
28
- };
29
- export const se_CreateTargetAccountConfigurationCommand = async (input, context) => {
30
- const b = rb(input, context);
31
- const headers = {
32
- "content-type": "application/json",
33
- };
34
- b.bp("/experimentTemplates/{experimentTemplateId}/targetAccountConfigurations/{accountId}");
35
- b.p("experimentTemplateId", () => input.experimentTemplateId, "{experimentTemplateId}", false);
36
- b.p("accountId", () => input.accountId, "{accountId}", false);
37
- let body;
38
- body = JSON.stringify(take(input, {
39
- clientToken: [true, (_) => _ ?? generateIdempotencyToken()],
40
- description: [],
41
- roleArn: [],
42
- }));
43
- b.m("POST").h(headers).b(body);
44
- return b.build();
45
- };
46
- export const se_DeleteExperimentTemplateCommand = async (input, context) => {
47
- const b = rb(input, context);
48
- const headers = {};
49
- b.bp("/experimentTemplates/{id}");
50
- b.p("id", () => input.id, "{id}", false);
51
- let body;
52
- b.m("DELETE").h(headers).b(body);
53
- return b.build();
54
- };
55
- export const se_DeleteTargetAccountConfigurationCommand = async (input, context) => {
56
- const b = rb(input, context);
57
- const headers = {};
58
- b.bp("/experimentTemplates/{experimentTemplateId}/targetAccountConfigurations/{accountId}");
59
- b.p("experimentTemplateId", () => input.experimentTemplateId, "{experimentTemplateId}", false);
60
- b.p("accountId", () => input.accountId, "{accountId}", false);
61
- let body;
62
- b.m("DELETE").h(headers).b(body);
63
- return b.build();
64
- };
65
- export const se_GetActionCommand = async (input, context) => {
66
- const b = rb(input, context);
67
- const headers = {};
68
- b.bp("/actions/{id}");
69
- b.p("id", () => input.id, "{id}", false);
70
- let body;
71
- b.m("GET").h(headers).b(body);
72
- return b.build();
73
- };
74
- export const se_GetExperimentCommand = async (input, context) => {
75
- const b = rb(input, context);
76
- const headers = {};
77
- b.bp("/experiments/{id}");
78
- b.p("id", () => input.id, "{id}", false);
79
- let body;
80
- b.m("GET").h(headers).b(body);
81
- return b.build();
82
- };
83
- export const se_GetExperimentTargetAccountConfigurationCommand = async (input, context) => {
84
- const b = rb(input, context);
85
- const headers = {};
86
- b.bp("/experiments/{experimentId}/targetAccountConfigurations/{accountId}");
87
- b.p("experimentId", () => input.experimentId, "{experimentId}", false);
88
- b.p("accountId", () => input.accountId, "{accountId}", false);
89
- let body;
90
- b.m("GET").h(headers).b(body);
91
- return b.build();
92
- };
93
- export const se_GetExperimentTemplateCommand = async (input, context) => {
94
- const b = rb(input, context);
95
- const headers = {};
96
- b.bp("/experimentTemplates/{id}");
97
- b.p("id", () => input.id, "{id}", false);
98
- let body;
99
- b.m("GET").h(headers).b(body);
100
- return b.build();
101
- };
102
- export const se_GetSafetyLeverCommand = async (input, context) => {
103
- const b = rb(input, context);
104
- const headers = {};
105
- b.bp("/safetyLevers/{id}");
106
- b.p("id", () => input.id, "{id}", false);
107
- let body;
108
- b.m("GET").h(headers).b(body);
109
- return b.build();
110
- };
111
- export const se_GetTargetAccountConfigurationCommand = async (input, context) => {
112
- const b = rb(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
- export const se_GetTargetResourceTypeCommand = async (input, context) => {
122
- const b = rb(input, context);
123
- const headers = {};
124
- b.bp("/targetResourceTypes/{resourceType}");
125
- b.p("resourceType", () => input.resourceType, "{resourceType}", false);
126
- let body;
127
- b.m("GET").h(headers).b(body);
128
- return b.build();
129
- };
130
- export const se_ListActionsCommand = async (input, context) => {
131
- const b = rb(input, context);
132
- const headers = {};
133
- b.bp("/actions");
134
- const query = map({
135
- [_mR]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
136
- [_nT]: [, input[_nT]],
137
- });
138
- let body;
139
- b.m("GET").h(headers).q(query).b(body);
140
- return b.build();
141
- };
142
- export const se_ListExperimentResolvedTargetsCommand = async (input, context) => {
143
- const b = rb(input, context);
144
- const headers = {};
145
- b.bp("/experiments/{experimentId}/resolvedTargets");
146
- b.p("experimentId", () => input.experimentId, "{experimentId}", false);
147
- const query = map({
148
- [_mR]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
149
- [_nT]: [, input[_nT]],
150
- [_tN]: [, input[_tN]],
151
- });
152
- let body;
153
- b.m("GET").h(headers).q(query).b(body);
154
- return b.build();
155
- };
156
- export const se_ListExperimentsCommand = async (input, context) => {
157
- const b = rb(input, context);
158
- const headers = {};
159
- b.bp("/experiments");
160
- const query = map({
161
- [_mR]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
162
- [_nT]: [, input[_nT]],
163
- [_eTI]: [, input[_eTI]],
164
- });
165
- let body;
166
- b.m("GET").h(headers).q(query).b(body);
167
- return b.build();
168
- };
169
- export const se_ListExperimentTargetAccountConfigurationsCommand = async (input, context) => {
170
- const b = rb(input, context);
171
- const headers = {};
172
- b.bp("/experiments/{experimentId}/targetAccountConfigurations");
173
- b.p("experimentId", () => input.experimentId, "{experimentId}", false);
174
- const query = map({
175
- [_nT]: [, input[_nT]],
176
- });
177
- let body;
178
- b.m("GET").h(headers).q(query).b(body);
179
- return b.build();
180
- };
181
- export const se_ListExperimentTemplatesCommand = async (input, context) => {
182
- const b = rb(input, context);
183
- const headers = {};
184
- b.bp("/experimentTemplates");
185
- const query = map({
186
- [_mR]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
187
- [_nT]: [, input[_nT]],
188
- });
189
- let body;
190
- b.m("GET").h(headers).q(query).b(body);
191
- return b.build();
192
- };
193
- export const se_ListTagsForResourceCommand = async (input, context) => {
194
- const b = rb(input, context);
195
- const headers = {};
196
- b.bp("/tags/{resourceArn}");
197
- b.p("resourceArn", () => input.resourceArn, "{resourceArn}", false);
198
- let body;
199
- b.m("GET").h(headers).b(body);
200
- return b.build();
201
- };
202
- export const se_ListTargetAccountConfigurationsCommand = async (input, context) => {
203
- const b = rb(input, context);
204
- const headers = {};
205
- b.bp("/experimentTemplates/{experimentTemplateId}/targetAccountConfigurations");
206
- b.p("experimentTemplateId", () => input.experimentTemplateId, "{experimentTemplateId}", false);
207
- const query = map({
208
- [_mR]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
209
- [_nT]: [, input[_nT]],
210
- });
211
- let body;
212
- b.m("GET").h(headers).q(query).b(body);
213
- return b.build();
214
- };
215
- export const se_ListTargetResourceTypesCommand = async (input, context) => {
216
- const b = rb(input, context);
217
- const headers = {};
218
- b.bp("/targetResourceTypes");
219
- const query = map({
220
- [_mR]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
221
- [_nT]: [, input[_nT]],
222
- });
223
- let body;
224
- b.m("GET").h(headers).q(query).b(body);
225
- return b.build();
226
- };
227
- export const se_StartExperimentCommand = async (input, context) => {
228
- const b = rb(input, context);
229
- const headers = {
230
- "content-type": "application/json",
231
- };
232
- b.bp("/experiments");
233
- let body;
234
- body = JSON.stringify(take(input, {
235
- clientToken: [true, (_) => _ ?? generateIdempotencyToken()],
236
- experimentOptions: (_) => _json(_),
237
- experimentTemplateId: [],
238
- tags: (_) => _json(_),
239
- }));
240
- b.m("POST").h(headers).b(body);
241
- return b.build();
242
- };
243
- export const se_StopExperimentCommand = async (input, context) => {
244
- const b = rb(input, context);
245
- const headers = {};
246
- b.bp("/experiments/{id}");
247
- b.p("id", () => input.id, "{id}", false);
248
- let body;
249
- b.m("DELETE").h(headers).b(body);
250
- return b.build();
251
- };
252
- export const se_TagResourceCommand = async (input, context) => {
253
- const b = rb(input, context);
254
- const headers = {
255
- "content-type": "application/json",
256
- };
257
- b.bp("/tags/{resourceArn}");
258
- b.p("resourceArn", () => input.resourceArn, "{resourceArn}", false);
259
- let body;
260
- body = JSON.stringify(take(input, {
261
- tags: (_) => _json(_),
262
- }));
263
- b.m("POST").h(headers).b(body);
264
- return b.build();
265
- };
266
- export const se_UntagResourceCommand = async (input, context) => {
267
- const b = rb(input, context);
268
- const headers = {};
269
- b.bp("/tags/{resourceArn}");
270
- b.p("resourceArn", () => input.resourceArn, "{resourceArn}", false);
271
- const query = map({
272
- [_tK]: [() => input.tagKeys !== void 0, () => input[_tK] || []],
273
- });
274
- let body;
275
- b.m("DELETE").h(headers).q(query).b(body);
276
- return b.build();
277
- };
278
- export const se_UpdateExperimentTemplateCommand = async (input, context) => {
279
- const b = rb(input, context);
280
- const headers = {
281
- "content-type": "application/json",
282
- };
283
- b.bp("/experimentTemplates/{id}");
284
- b.p("id", () => input.id, "{id}", false);
285
- let body;
286
- body = JSON.stringify(take(input, {
287
- actions: (_) => _json(_),
288
- description: [],
289
- experimentOptions: (_) => _json(_),
290
- experimentReportConfiguration: (_) => _json(_),
291
- logConfiguration: (_) => _json(_),
292
- roleArn: [],
293
- stopConditions: (_) => _json(_),
294
- targets: (_) => _json(_),
295
- }));
296
- b.m("PATCH").h(headers).b(body);
297
- return b.build();
298
- };
299
- export const se_UpdateSafetyLeverStateCommand = async (input, context) => {
300
- const b = rb(input, context);
301
- const headers = {
302
- "content-type": "application/json",
303
- };
304
- b.bp("/safetyLevers/{id}/state");
305
- b.p("id", () => input.id, "{id}", false);
306
- let body;
307
- body = JSON.stringify(take(input, {
308
- state: (_) => _json(_),
309
- }));
310
- b.m("PATCH").h(headers).b(body);
311
- return b.build();
312
- };
313
- export const se_UpdateTargetAccountConfigurationCommand = async (input, context) => {
314
- const b = rb(input, context);
315
- const headers = {
316
- "content-type": "application/json",
317
- };
318
- b.bp("/experimentTemplates/{experimentTemplateId}/targetAccountConfigurations/{accountId}");
319
- b.p("experimentTemplateId", () => input.experimentTemplateId, "{experimentTemplateId}", false);
320
- b.p("accountId", () => input.accountId, "{accountId}", false);
321
- let body;
322
- body = JSON.stringify(take(input, {
323
- description: [],
324
- roleArn: [],
325
- }));
326
- b.m("PATCH").h(headers).b(body);
327
- return b.build();
328
- };
329
- export const de_CreateExperimentTemplateCommand = async (output, context) => {
330
- if (output.statusCode !== 200 && output.statusCode >= 300) {
331
- return de_CommandError(output, context);
332
- }
333
- const contents = map({
334
- $metadata: deserializeMetadata(output),
335
- });
336
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
337
- const doc = take(data, {
338
- experimentTemplate: (_) => de_ExperimentTemplate(_, context),
339
- });
340
- Object.assign(contents, doc);
341
- return contents;
342
- };
343
- export const de_CreateTargetAccountConfigurationCommand = async (output, context) => {
344
- if (output.statusCode !== 200 && output.statusCode >= 300) {
345
- return de_CommandError(output, context);
346
- }
347
- const contents = map({
348
- $metadata: deserializeMetadata(output),
349
- });
350
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
351
- const doc = take(data, {
352
- targetAccountConfiguration: _json,
353
- });
354
- Object.assign(contents, doc);
355
- return contents;
356
- };
357
- export const de_DeleteExperimentTemplateCommand = async (output, context) => {
358
- if (output.statusCode !== 200 && output.statusCode >= 300) {
359
- return de_CommandError(output, context);
360
- }
361
- const contents = map({
362
- $metadata: deserializeMetadata(output),
363
- });
364
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
365
- const doc = take(data, {
366
- experimentTemplate: (_) => de_ExperimentTemplate(_, context),
367
- });
368
- Object.assign(contents, doc);
369
- return contents;
370
- };
371
- export const de_DeleteTargetAccountConfigurationCommand = async (output, context) => {
372
- if (output.statusCode !== 200 && output.statusCode >= 300) {
373
- return de_CommandError(output, context);
374
- }
375
- const contents = map({
376
- $metadata: deserializeMetadata(output),
377
- });
378
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
379
- const doc = take(data, {
380
- targetAccountConfiguration: _json,
381
- });
382
- Object.assign(contents, doc);
383
- return contents;
384
- };
385
- export const de_GetActionCommand = async (output, context) => {
386
- if (output.statusCode !== 200 && output.statusCode >= 300) {
387
- return de_CommandError(output, context);
388
- }
389
- const contents = map({
390
- $metadata: deserializeMetadata(output),
391
- });
392
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
393
- const doc = take(data, {
394
- action: _json,
395
- });
396
- Object.assign(contents, doc);
397
- return contents;
398
- };
399
- export const de_GetExperimentCommand = async (output, context) => {
400
- if (output.statusCode !== 200 && output.statusCode >= 300) {
401
- return de_CommandError(output, context);
402
- }
403
- const contents = map({
404
- $metadata: deserializeMetadata(output),
405
- });
406
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
407
- const doc = take(data, {
408
- experiment: (_) => de_Experiment(_, context),
409
- });
410
- Object.assign(contents, doc);
411
- return contents;
412
- };
413
- export const de_GetExperimentTargetAccountConfigurationCommand = async (output, context) => {
414
- if (output.statusCode !== 200 && output.statusCode >= 300) {
415
- return de_CommandError(output, context);
416
- }
417
- const contents = map({
418
- $metadata: deserializeMetadata(output),
419
- });
420
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
421
- const doc = take(data, {
422
- targetAccountConfiguration: _json,
423
- });
424
- Object.assign(contents, doc);
425
- return contents;
426
- };
427
- export const de_GetExperimentTemplateCommand = async (output, context) => {
428
- if (output.statusCode !== 200 && output.statusCode >= 300) {
429
- return de_CommandError(output, context);
430
- }
431
- const contents = map({
432
- $metadata: deserializeMetadata(output),
433
- });
434
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
435
- const doc = take(data, {
436
- experimentTemplate: (_) => de_ExperimentTemplate(_, context),
437
- });
438
- Object.assign(contents, doc);
439
- return contents;
440
- };
441
- export const de_GetSafetyLeverCommand = async (output, context) => {
442
- if (output.statusCode !== 200 && output.statusCode >= 300) {
443
- return de_CommandError(output, context);
444
- }
445
- const contents = map({
446
- $metadata: deserializeMetadata(output),
447
- });
448
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
449
- const doc = take(data, {
450
- safetyLever: _json,
451
- });
452
- Object.assign(contents, doc);
453
- return contents;
454
- };
455
- export const de_GetTargetAccountConfigurationCommand = async (output, context) => {
456
- if (output.statusCode !== 200 && output.statusCode >= 300) {
457
- return de_CommandError(output, context);
458
- }
459
- const contents = map({
460
- $metadata: deserializeMetadata(output),
461
- });
462
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
463
- const doc = take(data, {
464
- targetAccountConfiguration: _json,
465
- });
466
- Object.assign(contents, doc);
467
- return contents;
468
- };
469
- export const de_GetTargetResourceTypeCommand = async (output, context) => {
470
- if (output.statusCode !== 200 && output.statusCode >= 300) {
471
- return de_CommandError(output, context);
472
- }
473
- const contents = map({
474
- $metadata: deserializeMetadata(output),
475
- });
476
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
477
- const doc = take(data, {
478
- targetResourceType: _json,
479
- });
480
- Object.assign(contents, doc);
481
- return contents;
482
- };
483
- export const de_ListActionsCommand = async (output, context) => {
484
- if (output.statusCode !== 200 && output.statusCode >= 300) {
485
- return de_CommandError(output, context);
486
- }
487
- const contents = map({
488
- $metadata: deserializeMetadata(output),
489
- });
490
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
491
- const doc = take(data, {
492
- actions: _json,
493
- nextToken: __expectString,
494
- });
495
- Object.assign(contents, doc);
496
- return contents;
497
- };
498
- export const de_ListExperimentResolvedTargetsCommand = async (output, context) => {
499
- if (output.statusCode !== 200 && output.statusCode >= 300) {
500
- return de_CommandError(output, context);
501
- }
502
- const contents = map({
503
- $metadata: deserializeMetadata(output),
504
- });
505
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
506
- const doc = take(data, {
507
- nextToken: __expectString,
508
- resolvedTargets: _json,
509
- });
510
- Object.assign(contents, doc);
511
- return contents;
512
- };
513
- export const de_ListExperimentsCommand = async (output, context) => {
514
- if (output.statusCode !== 200 && output.statusCode >= 300) {
515
- return de_CommandError(output, context);
516
- }
517
- const contents = map({
518
- $metadata: deserializeMetadata(output),
519
- });
520
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
521
- const doc = take(data, {
522
- experiments: (_) => de_ExperimentSummaryList(_, context),
523
- nextToken: __expectString,
524
- });
525
- Object.assign(contents, doc);
526
- return contents;
527
- };
528
- export const de_ListExperimentTargetAccountConfigurationsCommand = async (output, context) => {
529
- if (output.statusCode !== 200 && output.statusCode >= 300) {
530
- return de_CommandError(output, context);
531
- }
532
- const contents = map({
533
- $metadata: deserializeMetadata(output),
534
- });
535
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
536
- const doc = take(data, {
537
- nextToken: __expectString,
538
- targetAccountConfigurations: _json,
539
- });
540
- Object.assign(contents, doc);
541
- return contents;
542
- };
543
- export const de_ListExperimentTemplatesCommand = async (output, context) => {
544
- if (output.statusCode !== 200 && output.statusCode >= 300) {
545
- return de_CommandError(output, context);
546
- }
547
- const contents = map({
548
- $metadata: deserializeMetadata(output),
549
- });
550
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
551
- const doc = take(data, {
552
- experimentTemplates: (_) => de_ExperimentTemplateSummaryList(_, context),
553
- nextToken: __expectString,
554
- });
555
- Object.assign(contents, doc);
556
- return contents;
557
- };
558
- export const de_ListTagsForResourceCommand = async (output, context) => {
559
- if (output.statusCode !== 200 && output.statusCode >= 300) {
560
- return de_CommandError(output, context);
561
- }
562
- const contents = map({
563
- $metadata: deserializeMetadata(output),
564
- });
565
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
566
- const doc = take(data, {
567
- tags: _json,
568
- });
569
- Object.assign(contents, doc);
570
- return contents;
571
- };
572
- export const de_ListTargetAccountConfigurationsCommand = async (output, context) => {
573
- if (output.statusCode !== 200 && output.statusCode >= 300) {
574
- return de_CommandError(output, context);
575
- }
576
- const contents = map({
577
- $metadata: deserializeMetadata(output),
578
- });
579
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
580
- const doc = take(data, {
581
- nextToken: __expectString,
582
- targetAccountConfigurations: _json,
583
- });
584
- Object.assign(contents, doc);
585
- return contents;
586
- };
587
- export const de_ListTargetResourceTypesCommand = async (output, context) => {
588
- if (output.statusCode !== 200 && output.statusCode >= 300) {
589
- return de_CommandError(output, context);
590
- }
591
- const contents = map({
592
- $metadata: deserializeMetadata(output),
593
- });
594
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
595
- const doc = take(data, {
596
- nextToken: __expectString,
597
- targetResourceTypes: _json,
598
- });
599
- Object.assign(contents, doc);
600
- return contents;
601
- };
602
- export const de_StartExperimentCommand = async (output, context) => {
603
- if (output.statusCode !== 200 && output.statusCode >= 300) {
604
- return de_CommandError(output, context);
605
- }
606
- const contents = map({
607
- $metadata: deserializeMetadata(output),
608
- });
609
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
610
- const doc = take(data, {
611
- experiment: (_) => de_Experiment(_, context),
612
- });
613
- Object.assign(contents, doc);
614
- return contents;
615
- };
616
- export const de_StopExperimentCommand = async (output, context) => {
617
- if (output.statusCode !== 200 && output.statusCode >= 300) {
618
- return de_CommandError(output, context);
619
- }
620
- const contents = map({
621
- $metadata: deserializeMetadata(output),
622
- });
623
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
624
- const doc = take(data, {
625
- experiment: (_) => de_Experiment(_, context),
626
- });
627
- Object.assign(contents, doc);
628
- return contents;
629
- };
630
- export const de_TagResourceCommand = async (output, context) => {
631
- if (output.statusCode !== 200 && output.statusCode >= 300) {
632
- return de_CommandError(output, context);
633
- }
634
- const contents = map({
635
- $metadata: deserializeMetadata(output),
636
- });
637
- await collectBody(output.body, context);
638
- return contents;
639
- };
640
- export const de_UntagResourceCommand = async (output, context) => {
641
- if (output.statusCode !== 200 && output.statusCode >= 300) {
642
- return de_CommandError(output, context);
643
- }
644
- const contents = map({
645
- $metadata: deserializeMetadata(output),
646
- });
647
- await collectBody(output.body, context);
648
- return contents;
649
- };
650
- export const de_UpdateExperimentTemplateCommand = async (output, context) => {
651
- if (output.statusCode !== 200 && output.statusCode >= 300) {
652
- return de_CommandError(output, context);
653
- }
654
- const contents = map({
655
- $metadata: deserializeMetadata(output),
656
- });
657
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
658
- const doc = take(data, {
659
- experimentTemplate: (_) => de_ExperimentTemplate(_, context),
660
- });
661
- Object.assign(contents, doc);
662
- return contents;
663
- };
664
- export const de_UpdateSafetyLeverStateCommand = async (output, context) => {
665
- if (output.statusCode !== 200 && output.statusCode >= 300) {
666
- return de_CommandError(output, context);
667
- }
668
- const contents = map({
669
- $metadata: deserializeMetadata(output),
670
- });
671
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
672
- const doc = take(data, {
673
- safetyLever: _json,
674
- });
675
- Object.assign(contents, doc);
676
- return contents;
677
- };
678
- export const de_UpdateTargetAccountConfigurationCommand = async (output, context) => {
679
- if (output.statusCode !== 200 && output.statusCode >= 300) {
680
- return de_CommandError(output, context);
681
- }
682
- const contents = map({
683
- $metadata: deserializeMetadata(output),
684
- });
685
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
686
- const doc = take(data, {
687
- targetAccountConfiguration: _json,
688
- });
689
- Object.assign(contents, doc);
690
- return contents;
691
- };
692
- const de_CommandError = async (output, context) => {
693
- const parsedOutput = {
694
- ...output,
695
- body: await parseErrorBody(output.body, context),
696
- };
697
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
698
- switch (errorCode) {
699
- case "ConflictException":
700
- case "com.amazonaws.fis#ConflictException":
701
- throw await de_ConflictExceptionRes(parsedOutput, context);
702
- case "ResourceNotFoundException":
703
- case "com.amazonaws.fis#ResourceNotFoundException":
704
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
705
- case "ServiceQuotaExceededException":
706
- case "com.amazonaws.fis#ServiceQuotaExceededException":
707
- throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
708
- case "ValidationException":
709
- case "com.amazonaws.fis#ValidationException":
710
- throw await de_ValidationExceptionRes(parsedOutput, context);
711
- default:
712
- const parsedBody = parsedOutput.body;
713
- return throwDefaultError({
714
- output,
715
- parsedBody,
716
- errorCode,
717
- });
718
- }
719
- };
720
- const throwDefaultError = withBaseException(__BaseException);
721
- const de_ConflictExceptionRes = async (parsedOutput, context) => {
722
- const contents = map({});
723
- const data = parsedOutput.body;
724
- const doc = take(data, {
725
- message: __expectString,
726
- });
727
- Object.assign(contents, doc);
728
- const exception = new ConflictException({
729
- $metadata: deserializeMetadata(parsedOutput),
730
- ...contents,
731
- });
732
- return __decorateServiceException(exception, parsedOutput.body);
733
- };
734
- const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
735
- const contents = map({});
736
- const data = parsedOutput.body;
737
- const doc = take(data, {
738
- message: __expectString,
739
- });
740
- Object.assign(contents, doc);
741
- const exception = new ResourceNotFoundException({
742
- $metadata: deserializeMetadata(parsedOutput),
743
- ...contents,
744
- });
745
- return __decorateServiceException(exception, parsedOutput.body);
746
- };
747
- const de_ServiceQuotaExceededExceptionRes = async (parsedOutput, context) => {
748
- const contents = map({});
749
- const data = parsedOutput.body;
750
- const doc = take(data, {
751
- message: __expectString,
752
- });
753
- Object.assign(contents, doc);
754
- const exception = new ServiceQuotaExceededException({
755
- $metadata: deserializeMetadata(parsedOutput),
756
- ...contents,
757
- });
758
- return __decorateServiceException(exception, parsedOutput.body);
759
- };
760
- const de_ValidationExceptionRes = async (parsedOutput, context) => {
761
- const contents = map({});
762
- const data = parsedOutput.body;
763
- const doc = take(data, {
764
- message: __expectString,
765
- });
766
- Object.assign(contents, doc);
767
- const exception = new ValidationException({
768
- $metadata: deserializeMetadata(parsedOutput),
769
- ...contents,
770
- });
771
- return __decorateServiceException(exception, parsedOutput.body);
772
- };
773
- const de_Experiment = (output, context) => {
774
- return take(output, {
775
- actions: (_) => de_ExperimentActionMap(_, context),
776
- arn: __expectString,
777
- creationTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
778
- endTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
779
- experimentOptions: _json,
780
- experimentReport: _json,
781
- experimentReportConfiguration: _json,
782
- experimentTemplateId: __expectString,
783
- id: __expectString,
784
- logConfiguration: _json,
785
- roleArn: __expectString,
786
- startTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
787
- state: _json,
788
- stopConditions: _json,
789
- tags: _json,
790
- targetAccountConfigurationsCount: __expectLong,
791
- targets: _json,
792
- });
793
- };
794
- const de_ExperimentAction = (output, context) => {
795
- return take(output, {
796
- actionId: __expectString,
797
- description: __expectString,
798
- endTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
799
- parameters: _json,
800
- startAfter: _json,
801
- startTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
802
- state: _json,
803
- targets: _json,
804
- });
805
- };
806
- const de_ExperimentActionMap = (output, context) => {
807
- return Object.entries(output).reduce((acc, [key, value]) => {
808
- if (value === null) {
809
- return acc;
810
- }
811
- acc[key] = de_ExperimentAction(value, context);
812
- return acc;
813
- }, {});
814
- };
815
- const de_ExperimentSummary = (output, context) => {
816
- return take(output, {
817
- arn: __expectString,
818
- creationTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
819
- experimentOptions: _json,
820
- experimentTemplateId: __expectString,
821
- id: __expectString,
822
- state: _json,
823
- tags: _json,
824
- });
825
- };
826
- const de_ExperimentSummaryList = (output, context) => {
827
- const retVal = (output || [])
828
- .filter((e) => e != null)
829
- .map((entry) => {
830
- return de_ExperimentSummary(entry, context);
831
- });
832
- return retVal;
833
- };
834
- const de_ExperimentTemplate = (output, context) => {
835
- return take(output, {
836
- actions: _json,
837
- arn: __expectString,
838
- creationTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
839
- description: __expectString,
840
- experimentOptions: _json,
841
- experimentReportConfiguration: _json,
842
- id: __expectString,
843
- lastUpdateTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
844
- logConfiguration: _json,
845
- roleArn: __expectString,
846
- stopConditions: _json,
847
- tags: _json,
848
- targetAccountConfigurationsCount: __expectLong,
849
- targets: _json,
850
- });
851
- };
852
- const de_ExperimentTemplateSummary = (output, context) => {
853
- return take(output, {
854
- arn: __expectString,
855
- creationTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
856
- description: __expectString,
857
- id: __expectString,
858
- lastUpdateTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
859
- tags: _json,
860
- });
861
- };
862
- const de_ExperimentTemplateSummaryList = (output, context) => {
863
- const retVal = (output || [])
864
- .filter((e) => e != null)
865
- .map((entry) => {
866
- return de_ExperimentTemplateSummary(entry, context);
867
- });
868
- return retVal;
869
- };
870
- const deserializeMetadata = (output) => ({
871
- httpStatusCode: output.statusCode,
872
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
873
- extendedRequestId: output.headers["x-amz-id-2"],
874
- cfId: output.headers["x-amz-cf-id"],
875
- });
876
- const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
877
- const _eTI = "experimentTemplateId";
878
- const _mR = "maxResults";
879
- const _nT = "nextToken";
880
- const _tK = "tagKeys";
881
- const _tN = "targetName";