@aws-sdk/client-fis 3.310.0 → 3.315.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.
@@ -13,20 +13,16 @@ const se_CreateExperimentTemplateCommand = async (input, context) => {
13
13
  };
14
14
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/experimentTemplates";
15
15
  let body;
16
- body = JSON.stringify({
17
- ...(input.actions != null && { actions: se_CreateExperimentTemplateActionInputMap(input.actions, context) }),
18
- clientToken: input.clientToken ?? (0, uuid_1.v4)(),
19
- ...(input.description != null && { description: input.description }),
20
- ...(input.logConfiguration != null && {
21
- logConfiguration: se_CreateExperimentTemplateLogConfigurationInput(input.logConfiguration, context),
22
- }),
23
- ...(input.roleArn != null && { roleArn: input.roleArn }),
24
- ...(input.stopConditions != null && {
25
- stopConditions: se_CreateExperimentTemplateStopConditionInputList(input.stopConditions, context),
26
- }),
27
- ...(input.tags != null && { tags: se_TagMap(input.tags, context) }),
28
- ...(input.targets != null && { targets: se_CreateExperimentTemplateTargetInputMap(input.targets, context) }),
29
- });
16
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
17
+ actions: (_) => (0, smithy_client_1._json)(_),
18
+ clientToken: (_) => _ ?? (0, uuid_1.v4)(),
19
+ description: [],
20
+ logConfiguration: (_) => (0, smithy_client_1._json)(_),
21
+ roleArn: [],
22
+ stopConditions: (_) => (0, smithy_client_1._json)(_),
23
+ tags: (_) => (0, smithy_client_1._json)(_),
24
+ targets: (_) => (0, smithy_client_1._json)(_),
25
+ }));
30
26
  return new protocol_http_1.HttpRequest({
31
27
  protocol,
32
28
  hostname,
@@ -127,7 +123,7 @@ const se_ListActionsCommand = async (input, context) => {
127
123
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
128
124
  const headers = {};
129
125
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/actions";
130
- const query = map({
126
+ const query = (0, smithy_client_1.map)({
131
127
  maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
132
128
  nextToken: [, input.nextToken],
133
129
  });
@@ -148,7 +144,7 @@ const se_ListExperimentsCommand = async (input, context) => {
148
144
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
149
145
  const headers = {};
150
146
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/experiments";
151
- const query = map({
147
+ const query = (0, smithy_client_1.map)({
152
148
  maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
153
149
  nextToken: [, input.nextToken],
154
150
  });
@@ -169,7 +165,7 @@ const se_ListExperimentTemplatesCommand = async (input, context) => {
169
165
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
170
166
  const headers = {};
171
167
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/experimentTemplates";
172
- const query = map({
168
+ const query = (0, smithy_client_1.map)({
173
169
  maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
174
170
  nextToken: [, input.nextToken],
175
171
  });
@@ -207,7 +203,7 @@ const se_ListTargetResourceTypesCommand = async (input, context) => {
207
203
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
208
204
  const headers = {};
209
205
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/targetResourceTypes";
210
- const query = map({
206
+ const query = (0, smithy_client_1.map)({
211
207
  maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
212
208
  nextToken: [, input.nextToken],
213
209
  });
@@ -231,11 +227,11 @@ const se_StartExperimentCommand = async (input, context) => {
231
227
  };
232
228
  const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/experiments";
233
229
  let body;
234
- body = JSON.stringify({
235
- clientToken: input.clientToken ?? (0, uuid_1.v4)(),
236
- ...(input.experimentTemplateId != null && { experimentTemplateId: input.experimentTemplateId }),
237
- ...(input.tags != null && { tags: se_TagMap(input.tags, context) }),
238
- });
230
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
231
+ clientToken: (_) => _ ?? (0, uuid_1.v4)(),
232
+ experimentTemplateId: [],
233
+ tags: (_) => (0, smithy_client_1._json)(_),
234
+ }));
239
235
  return new protocol_http_1.HttpRequest({
240
236
  protocol,
241
237
  hostname,
@@ -272,9 +268,9 @@ const se_TagResourceCommand = async (input, context) => {
272
268
  let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
273
269
  resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
274
270
  let body;
275
- body = JSON.stringify({
276
- ...(input.tags != null && { tags: se_TagMap(input.tags, context) }),
277
- });
271
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
272
+ tags: (_) => (0, smithy_client_1._json)(_),
273
+ }));
278
274
  return new protocol_http_1.HttpRequest({
279
275
  protocol,
280
276
  hostname,
@@ -291,7 +287,7 @@ const se_UntagResourceCommand = async (input, context) => {
291
287
  const headers = {};
292
288
  let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
293
289
  resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
294
- const query = map({
290
+ const query = (0, smithy_client_1.map)({
295
291
  tagKeys: [() => input.tagKeys !== void 0, () => (input.tagKeys || []).map((_entry) => _entry)],
296
292
  });
297
293
  let body;
@@ -315,18 +311,14 @@ const se_UpdateExperimentTemplateCommand = async (input, context) => {
315
311
  let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/experimentTemplates/{id}";
316
312
  resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "id", () => input.id, "{id}", false);
317
313
  let body;
318
- body = JSON.stringify({
319
- ...(input.actions != null && { actions: se_UpdateExperimentTemplateActionInputMap(input.actions, context) }),
320
- ...(input.description != null && { description: input.description }),
321
- ...(input.logConfiguration != null && {
322
- logConfiguration: se_UpdateExperimentTemplateLogConfigurationInput(input.logConfiguration, context),
323
- }),
324
- ...(input.roleArn != null && { roleArn: input.roleArn }),
325
- ...(input.stopConditions != null && {
326
- stopConditions: se_UpdateExperimentTemplateStopConditionInputList(input.stopConditions, context),
327
- }),
328
- ...(input.targets != null && { targets: se_UpdateExperimentTemplateTargetInputMap(input.targets, context) }),
329
- });
314
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
315
+ actions: (_) => (0, smithy_client_1._json)(_),
316
+ description: [],
317
+ logConfiguration: (_) => (0, smithy_client_1._json)(_),
318
+ roleArn: [],
319
+ stopConditions: (_) => (0, smithy_client_1._json)(_),
320
+ targets: (_) => (0, smithy_client_1._json)(_),
321
+ }));
330
322
  return new protocol_http_1.HttpRequest({
331
323
  protocol,
332
324
  hostname,
@@ -342,13 +334,14 @@ const de_CreateExperimentTemplateCommand = async (output, context) => {
342
334
  if (output.statusCode !== 200 && output.statusCode >= 300) {
343
335
  return de_CreateExperimentTemplateCommandError(output, context);
344
336
  }
345
- const contents = map({
337
+ const contents = (0, smithy_client_1.map)({
346
338
  $metadata: deserializeMetadata(output),
347
339
  });
348
340
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
349
- if (data.experimentTemplate != null) {
350
- contents.experimentTemplate = de_ExperimentTemplate(data.experimentTemplate, context);
351
- }
341
+ const doc = (0, smithy_client_1.take)(data, {
342
+ experimentTemplate: (_) => de_ExperimentTemplate(_, context),
343
+ });
344
+ Object.assign(contents, doc);
352
345
  return contents;
353
346
  };
354
347
  exports.de_CreateExperimentTemplateCommand = de_CreateExperimentTemplateCommand;
@@ -373,10 +366,9 @@ const de_CreateExperimentTemplateCommandError = async (output, context) => {
373
366
  throw await de_ValidationExceptionRes(parsedOutput, context);
374
367
  default:
375
368
  const parsedBody = parsedOutput.body;
376
- (0, smithy_client_1.throwDefaultError)({
369
+ return throwDefaultError({
377
370
  output,
378
371
  parsedBody,
379
- exceptionCtor: FisServiceException_1.FisServiceException,
380
372
  errorCode,
381
373
  });
382
374
  }
@@ -385,13 +377,14 @@ const de_DeleteExperimentTemplateCommand = async (output, context) => {
385
377
  if (output.statusCode !== 200 && output.statusCode >= 300) {
386
378
  return de_DeleteExperimentTemplateCommandError(output, context);
387
379
  }
388
- const contents = map({
380
+ const contents = (0, smithy_client_1.map)({
389
381
  $metadata: deserializeMetadata(output),
390
382
  });
391
383
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
392
- if (data.experimentTemplate != null) {
393
- contents.experimentTemplate = de_ExperimentTemplate(data.experimentTemplate, context);
394
- }
384
+ const doc = (0, smithy_client_1.take)(data, {
385
+ experimentTemplate: (_) => de_ExperimentTemplate(_, context),
386
+ });
387
+ Object.assign(contents, doc);
395
388
  return contents;
396
389
  };
397
390
  exports.de_DeleteExperimentTemplateCommand = de_DeleteExperimentTemplateCommand;
@@ -410,10 +403,9 @@ const de_DeleteExperimentTemplateCommandError = async (output, context) => {
410
403
  throw await de_ValidationExceptionRes(parsedOutput, context);
411
404
  default:
412
405
  const parsedBody = parsedOutput.body;
413
- (0, smithy_client_1.throwDefaultError)({
406
+ return throwDefaultError({
414
407
  output,
415
408
  parsedBody,
416
- exceptionCtor: FisServiceException_1.FisServiceException,
417
409
  errorCode,
418
410
  });
419
411
  }
@@ -422,13 +414,14 @@ const de_GetActionCommand = async (output, context) => {
422
414
  if (output.statusCode !== 200 && output.statusCode >= 300) {
423
415
  return de_GetActionCommandError(output, context);
424
416
  }
425
- const contents = map({
417
+ const contents = (0, smithy_client_1.map)({
426
418
  $metadata: deserializeMetadata(output),
427
419
  });
428
420
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
429
- if (data.action != null) {
430
- contents.action = de_Action(data.action, context);
431
- }
421
+ const doc = (0, smithy_client_1.take)(data, {
422
+ action: smithy_client_1._json,
423
+ });
424
+ Object.assign(contents, doc);
432
425
  return contents;
433
426
  };
434
427
  exports.de_GetActionCommand = de_GetActionCommand;
@@ -447,10 +440,9 @@ const de_GetActionCommandError = async (output, context) => {
447
440
  throw await de_ValidationExceptionRes(parsedOutput, context);
448
441
  default:
449
442
  const parsedBody = parsedOutput.body;
450
- (0, smithy_client_1.throwDefaultError)({
443
+ return throwDefaultError({
451
444
  output,
452
445
  parsedBody,
453
- exceptionCtor: FisServiceException_1.FisServiceException,
454
446
  errorCode,
455
447
  });
456
448
  }
@@ -459,13 +451,14 @@ const de_GetExperimentCommand = async (output, context) => {
459
451
  if (output.statusCode !== 200 && output.statusCode >= 300) {
460
452
  return de_GetExperimentCommandError(output, context);
461
453
  }
462
- const contents = map({
454
+ const contents = (0, smithy_client_1.map)({
463
455
  $metadata: deserializeMetadata(output),
464
456
  });
465
457
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
466
- if (data.experiment != null) {
467
- contents.experiment = de_Experiment(data.experiment, context);
468
- }
458
+ const doc = (0, smithy_client_1.take)(data, {
459
+ experiment: (_) => de_Experiment(_, context),
460
+ });
461
+ Object.assign(contents, doc);
469
462
  return contents;
470
463
  };
471
464
  exports.de_GetExperimentCommand = de_GetExperimentCommand;
@@ -484,10 +477,9 @@ const de_GetExperimentCommandError = async (output, context) => {
484
477
  throw await de_ValidationExceptionRes(parsedOutput, context);
485
478
  default:
486
479
  const parsedBody = parsedOutput.body;
487
- (0, smithy_client_1.throwDefaultError)({
480
+ return throwDefaultError({
488
481
  output,
489
482
  parsedBody,
490
- exceptionCtor: FisServiceException_1.FisServiceException,
491
483
  errorCode,
492
484
  });
493
485
  }
@@ -496,13 +488,14 @@ const de_GetExperimentTemplateCommand = async (output, context) => {
496
488
  if (output.statusCode !== 200 && output.statusCode >= 300) {
497
489
  return de_GetExperimentTemplateCommandError(output, context);
498
490
  }
499
- const contents = map({
491
+ const contents = (0, smithy_client_1.map)({
500
492
  $metadata: deserializeMetadata(output),
501
493
  });
502
494
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
503
- if (data.experimentTemplate != null) {
504
- contents.experimentTemplate = de_ExperimentTemplate(data.experimentTemplate, context);
505
- }
495
+ const doc = (0, smithy_client_1.take)(data, {
496
+ experimentTemplate: (_) => de_ExperimentTemplate(_, context),
497
+ });
498
+ Object.assign(contents, doc);
506
499
  return contents;
507
500
  };
508
501
  exports.de_GetExperimentTemplateCommand = de_GetExperimentTemplateCommand;
@@ -521,10 +514,9 @@ const de_GetExperimentTemplateCommandError = async (output, context) => {
521
514
  throw await de_ValidationExceptionRes(parsedOutput, context);
522
515
  default:
523
516
  const parsedBody = parsedOutput.body;
524
- (0, smithy_client_1.throwDefaultError)({
517
+ return throwDefaultError({
525
518
  output,
526
519
  parsedBody,
527
- exceptionCtor: FisServiceException_1.FisServiceException,
528
520
  errorCode,
529
521
  });
530
522
  }
@@ -533,13 +525,14 @@ const de_GetTargetResourceTypeCommand = async (output, context) => {
533
525
  if (output.statusCode !== 200 && output.statusCode >= 300) {
534
526
  return de_GetTargetResourceTypeCommandError(output, context);
535
527
  }
536
- const contents = map({
528
+ const contents = (0, smithy_client_1.map)({
537
529
  $metadata: deserializeMetadata(output),
538
530
  });
539
531
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
540
- if (data.targetResourceType != null) {
541
- contents.targetResourceType = de_TargetResourceType(data.targetResourceType, context);
542
- }
532
+ const doc = (0, smithy_client_1.take)(data, {
533
+ targetResourceType: smithy_client_1._json,
534
+ });
535
+ Object.assign(contents, doc);
543
536
  return contents;
544
537
  };
545
538
  exports.de_GetTargetResourceTypeCommand = de_GetTargetResourceTypeCommand;
@@ -558,10 +551,9 @@ const de_GetTargetResourceTypeCommandError = async (output, context) => {
558
551
  throw await de_ValidationExceptionRes(parsedOutput, context);
559
552
  default:
560
553
  const parsedBody = parsedOutput.body;
561
- (0, smithy_client_1.throwDefaultError)({
554
+ return throwDefaultError({
562
555
  output,
563
556
  parsedBody,
564
- exceptionCtor: FisServiceException_1.FisServiceException,
565
557
  errorCode,
566
558
  });
567
559
  }
@@ -570,16 +562,15 @@ const de_ListActionsCommand = async (output, context) => {
570
562
  if (output.statusCode !== 200 && output.statusCode >= 300) {
571
563
  return de_ListActionsCommandError(output, context);
572
564
  }
573
- const contents = map({
565
+ const contents = (0, smithy_client_1.map)({
574
566
  $metadata: deserializeMetadata(output),
575
567
  });
576
568
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
577
- if (data.actions != null) {
578
- contents.actions = de_ActionSummaryList(data.actions, context);
579
- }
580
- if (data.nextToken != null) {
581
- contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
582
- }
569
+ const doc = (0, smithy_client_1.take)(data, {
570
+ actions: smithy_client_1._json,
571
+ nextToken: smithy_client_1.expectString,
572
+ });
573
+ Object.assign(contents, doc);
583
574
  return contents;
584
575
  };
585
576
  exports.de_ListActionsCommand = de_ListActionsCommand;
@@ -595,10 +586,9 @@ const de_ListActionsCommandError = async (output, context) => {
595
586
  throw await de_ValidationExceptionRes(parsedOutput, context);
596
587
  default:
597
588
  const parsedBody = parsedOutput.body;
598
- (0, smithy_client_1.throwDefaultError)({
589
+ return throwDefaultError({
599
590
  output,
600
591
  parsedBody,
601
- exceptionCtor: FisServiceException_1.FisServiceException,
602
592
  errorCode,
603
593
  });
604
594
  }
@@ -607,16 +597,15 @@ const de_ListExperimentsCommand = async (output, context) => {
607
597
  if (output.statusCode !== 200 && output.statusCode >= 300) {
608
598
  return de_ListExperimentsCommandError(output, context);
609
599
  }
610
- const contents = map({
600
+ const contents = (0, smithy_client_1.map)({
611
601
  $metadata: deserializeMetadata(output),
612
602
  });
613
603
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
614
- if (data.experiments != null) {
615
- contents.experiments = de_ExperimentSummaryList(data.experiments, context);
616
- }
617
- if (data.nextToken != null) {
618
- contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
619
- }
604
+ const doc = (0, smithy_client_1.take)(data, {
605
+ experiments: (_) => de_ExperimentSummaryList(_, context),
606
+ nextToken: smithy_client_1.expectString,
607
+ });
608
+ Object.assign(contents, doc);
620
609
  return contents;
621
610
  };
622
611
  exports.de_ListExperimentsCommand = de_ListExperimentsCommand;
@@ -632,10 +621,9 @@ const de_ListExperimentsCommandError = async (output, context) => {
632
621
  throw await de_ValidationExceptionRes(parsedOutput, context);
633
622
  default:
634
623
  const parsedBody = parsedOutput.body;
635
- (0, smithy_client_1.throwDefaultError)({
624
+ return throwDefaultError({
636
625
  output,
637
626
  parsedBody,
638
- exceptionCtor: FisServiceException_1.FisServiceException,
639
627
  errorCode,
640
628
  });
641
629
  }
@@ -644,16 +632,15 @@ const de_ListExperimentTemplatesCommand = async (output, context) => {
644
632
  if (output.statusCode !== 200 && output.statusCode >= 300) {
645
633
  return de_ListExperimentTemplatesCommandError(output, context);
646
634
  }
647
- const contents = map({
635
+ const contents = (0, smithy_client_1.map)({
648
636
  $metadata: deserializeMetadata(output),
649
637
  });
650
638
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
651
- if (data.experimentTemplates != null) {
652
- contents.experimentTemplates = de_ExperimentTemplateSummaryList(data.experimentTemplates, context);
653
- }
654
- if (data.nextToken != null) {
655
- contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
656
- }
639
+ const doc = (0, smithy_client_1.take)(data, {
640
+ experimentTemplates: (_) => de_ExperimentTemplateSummaryList(_, context),
641
+ nextToken: smithy_client_1.expectString,
642
+ });
643
+ Object.assign(contents, doc);
657
644
  return contents;
658
645
  };
659
646
  exports.de_ListExperimentTemplatesCommand = de_ListExperimentTemplatesCommand;
@@ -669,10 +656,9 @@ const de_ListExperimentTemplatesCommandError = async (output, context) => {
669
656
  throw await de_ValidationExceptionRes(parsedOutput, context);
670
657
  default:
671
658
  const parsedBody = parsedOutput.body;
672
- (0, smithy_client_1.throwDefaultError)({
659
+ return throwDefaultError({
673
660
  output,
674
661
  parsedBody,
675
- exceptionCtor: FisServiceException_1.FisServiceException,
676
662
  errorCode,
677
663
  });
678
664
  }
@@ -681,13 +667,14 @@ const de_ListTagsForResourceCommand = async (output, context) => {
681
667
  if (output.statusCode !== 200 && output.statusCode >= 300) {
682
668
  return de_ListTagsForResourceCommandError(output, context);
683
669
  }
684
- const contents = map({
670
+ const contents = (0, smithy_client_1.map)({
685
671
  $metadata: deserializeMetadata(output),
686
672
  });
687
673
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
688
- if (data.tags != null) {
689
- contents.tags = de_TagMap(data.tags, context);
690
- }
674
+ const doc = (0, smithy_client_1.take)(data, {
675
+ tags: smithy_client_1._json,
676
+ });
677
+ Object.assign(contents, doc);
691
678
  return contents;
692
679
  };
693
680
  exports.de_ListTagsForResourceCommand = de_ListTagsForResourceCommand;
@@ -698,10 +685,9 @@ const de_ListTagsForResourceCommandError = async (output, context) => {
698
685
  };
699
686
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
700
687
  const parsedBody = parsedOutput.body;
701
- (0, smithy_client_1.throwDefaultError)({
688
+ return throwDefaultError({
702
689
  output,
703
690
  parsedBody,
704
- exceptionCtor: FisServiceException_1.FisServiceException,
705
691
  errorCode,
706
692
  });
707
693
  };
@@ -709,16 +695,15 @@ const de_ListTargetResourceTypesCommand = async (output, context) => {
709
695
  if (output.statusCode !== 200 && output.statusCode >= 300) {
710
696
  return de_ListTargetResourceTypesCommandError(output, context);
711
697
  }
712
- const contents = map({
698
+ const contents = (0, smithy_client_1.map)({
713
699
  $metadata: deserializeMetadata(output),
714
700
  });
715
701
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
716
- if (data.nextToken != null) {
717
- contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
718
- }
719
- if (data.targetResourceTypes != null) {
720
- contents.targetResourceTypes = de_TargetResourceTypeSummaryList(data.targetResourceTypes, context);
721
- }
702
+ const doc = (0, smithy_client_1.take)(data, {
703
+ nextToken: smithy_client_1.expectString,
704
+ targetResourceTypes: smithy_client_1._json,
705
+ });
706
+ Object.assign(contents, doc);
722
707
  return contents;
723
708
  };
724
709
  exports.de_ListTargetResourceTypesCommand = de_ListTargetResourceTypesCommand;
@@ -734,10 +719,9 @@ const de_ListTargetResourceTypesCommandError = async (output, context) => {
734
719
  throw await de_ValidationExceptionRes(parsedOutput, context);
735
720
  default:
736
721
  const parsedBody = parsedOutput.body;
737
- (0, smithy_client_1.throwDefaultError)({
722
+ return throwDefaultError({
738
723
  output,
739
724
  parsedBody,
740
- exceptionCtor: FisServiceException_1.FisServiceException,
741
725
  errorCode,
742
726
  });
743
727
  }
@@ -746,13 +730,14 @@ const de_StartExperimentCommand = async (output, context) => {
746
730
  if (output.statusCode !== 200 && output.statusCode >= 300) {
747
731
  return de_StartExperimentCommandError(output, context);
748
732
  }
749
- const contents = map({
733
+ const contents = (0, smithy_client_1.map)({
750
734
  $metadata: deserializeMetadata(output),
751
735
  });
752
736
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
753
- if (data.experiment != null) {
754
- contents.experiment = de_Experiment(data.experiment, context);
755
- }
737
+ const doc = (0, smithy_client_1.take)(data, {
738
+ experiment: (_) => de_Experiment(_, context),
739
+ });
740
+ Object.assign(contents, doc);
756
741
  return contents;
757
742
  };
758
743
  exports.de_StartExperimentCommand = de_StartExperimentCommand;
@@ -777,10 +762,9 @@ const de_StartExperimentCommandError = async (output, context) => {
777
762
  throw await de_ValidationExceptionRes(parsedOutput, context);
778
763
  default:
779
764
  const parsedBody = parsedOutput.body;
780
- (0, smithy_client_1.throwDefaultError)({
765
+ return throwDefaultError({
781
766
  output,
782
767
  parsedBody,
783
- exceptionCtor: FisServiceException_1.FisServiceException,
784
768
  errorCode,
785
769
  });
786
770
  }
@@ -789,13 +773,14 @@ const de_StopExperimentCommand = async (output, context) => {
789
773
  if (output.statusCode !== 200 && output.statusCode >= 300) {
790
774
  return de_StopExperimentCommandError(output, context);
791
775
  }
792
- const contents = map({
776
+ const contents = (0, smithy_client_1.map)({
793
777
  $metadata: deserializeMetadata(output),
794
778
  });
795
779
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
796
- if (data.experiment != null) {
797
- contents.experiment = de_Experiment(data.experiment, context);
798
- }
780
+ const doc = (0, smithy_client_1.take)(data, {
781
+ experiment: (_) => de_Experiment(_, context),
782
+ });
783
+ Object.assign(contents, doc);
799
784
  return contents;
800
785
  };
801
786
  exports.de_StopExperimentCommand = de_StopExperimentCommand;
@@ -814,10 +799,9 @@ const de_StopExperimentCommandError = async (output, context) => {
814
799
  throw await de_ValidationExceptionRes(parsedOutput, context);
815
800
  default:
816
801
  const parsedBody = parsedOutput.body;
817
- (0, smithy_client_1.throwDefaultError)({
802
+ return throwDefaultError({
818
803
  output,
819
804
  parsedBody,
820
- exceptionCtor: FisServiceException_1.FisServiceException,
821
805
  errorCode,
822
806
  });
823
807
  }
@@ -826,7 +810,7 @@ const de_TagResourceCommand = async (output, context) => {
826
810
  if (output.statusCode !== 200 && output.statusCode >= 300) {
827
811
  return de_TagResourceCommandError(output, context);
828
812
  }
829
- const contents = map({
813
+ const contents = (0, smithy_client_1.map)({
830
814
  $metadata: deserializeMetadata(output),
831
815
  });
832
816
  await collectBody(output.body, context);
@@ -840,10 +824,9 @@ const de_TagResourceCommandError = async (output, context) => {
840
824
  };
841
825
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
842
826
  const parsedBody = parsedOutput.body;
843
- (0, smithy_client_1.throwDefaultError)({
827
+ return throwDefaultError({
844
828
  output,
845
829
  parsedBody,
846
- exceptionCtor: FisServiceException_1.FisServiceException,
847
830
  errorCode,
848
831
  });
849
832
  };
@@ -851,7 +834,7 @@ const de_UntagResourceCommand = async (output, context) => {
851
834
  if (output.statusCode !== 200 && output.statusCode >= 300) {
852
835
  return de_UntagResourceCommandError(output, context);
853
836
  }
854
- const contents = map({
837
+ const contents = (0, smithy_client_1.map)({
855
838
  $metadata: deserializeMetadata(output),
856
839
  });
857
840
  await collectBody(output.body, context);
@@ -865,10 +848,9 @@ const de_UntagResourceCommandError = async (output, context) => {
865
848
  };
866
849
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
867
850
  const parsedBody = parsedOutput.body;
868
- (0, smithy_client_1.throwDefaultError)({
851
+ return throwDefaultError({
869
852
  output,
870
853
  parsedBody,
871
- exceptionCtor: FisServiceException_1.FisServiceException,
872
854
  errorCode,
873
855
  });
874
856
  };
@@ -876,13 +858,14 @@ const de_UpdateExperimentTemplateCommand = async (output, context) => {
876
858
  if (output.statusCode !== 200 && output.statusCode >= 300) {
877
859
  return de_UpdateExperimentTemplateCommandError(output, context);
878
860
  }
879
- const contents = map({
861
+ const contents = (0, smithy_client_1.map)({
880
862
  $metadata: deserializeMetadata(output),
881
863
  });
882
864
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
883
- if (data.experimentTemplate != null) {
884
- contents.experimentTemplate = de_ExperimentTemplate(data.experimentTemplate, context);
885
- }
865
+ const doc = (0, smithy_client_1.take)(data, {
866
+ experimentTemplate: (_) => de_ExperimentTemplate(_, context),
867
+ });
868
+ Object.assign(contents, doc);
886
869
  return contents;
887
870
  };
888
871
  exports.de_UpdateExperimentTemplateCommand = de_UpdateExperimentTemplateCommand;
@@ -904,21 +887,21 @@ const de_UpdateExperimentTemplateCommandError = async (output, context) => {
904
887
  throw await de_ValidationExceptionRes(parsedOutput, context);
905
888
  default:
906
889
  const parsedBody = parsedOutput.body;
907
- (0, smithy_client_1.throwDefaultError)({
890
+ return throwDefaultError({
908
891
  output,
909
892
  parsedBody,
910
- exceptionCtor: FisServiceException_1.FisServiceException,
911
893
  errorCode,
912
894
  });
913
895
  }
914
896
  };
915
- const map = smithy_client_1.map;
897
+ const throwDefaultError = (0, smithy_client_1.withBaseException)(FisServiceException_1.FisServiceException);
916
898
  const de_ConflictExceptionRes = async (parsedOutput, context) => {
917
- const contents = map({});
899
+ const contents = (0, smithy_client_1.map)({});
918
900
  const data = parsedOutput.body;
919
- if (data.message != null) {
920
- contents.message = (0, smithy_client_1.expectString)(data.message);
921
- }
901
+ const doc = (0, smithy_client_1.take)(data, {
902
+ message: smithy_client_1.expectString,
903
+ });
904
+ Object.assign(contents, doc);
922
905
  const exception = new models_0_1.ConflictException({
923
906
  $metadata: deserializeMetadata(parsedOutput),
924
907
  ...contents,
@@ -926,11 +909,12 @@ const de_ConflictExceptionRes = async (parsedOutput, context) => {
926
909
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
927
910
  };
928
911
  const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
929
- const contents = map({});
912
+ const contents = (0, smithy_client_1.map)({});
930
913
  const data = parsedOutput.body;
931
- if (data.message != null) {
932
- contents.message = (0, smithy_client_1.expectString)(data.message);
933
- }
914
+ const doc = (0, smithy_client_1.take)(data, {
915
+ message: smithy_client_1.expectString,
916
+ });
917
+ Object.assign(contents, doc);
934
918
  const exception = new models_0_1.ResourceNotFoundException({
935
919
  $metadata: deserializeMetadata(parsedOutput),
936
920
  ...contents,
@@ -938,11 +922,12 @@ const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
938
922
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
939
923
  };
940
924
  const de_ServiceQuotaExceededExceptionRes = async (parsedOutput, context) => {
941
- const contents = map({});
925
+ const contents = (0, smithy_client_1.map)({});
942
926
  const data = parsedOutput.body;
943
- if (data.message != null) {
944
- contents.message = (0, smithy_client_1.expectString)(data.message);
945
- }
927
+ const doc = (0, smithy_client_1.take)(data, {
928
+ message: smithy_client_1.expectString,
929
+ });
930
+ Object.assign(contents, doc);
946
931
  const exception = new models_0_1.ServiceQuotaExceededException({
947
932
  $metadata: deserializeMetadata(parsedOutput),
948
933
  ...contents,
@@ -950,310 +935,45 @@ const de_ServiceQuotaExceededExceptionRes = async (parsedOutput, context) => {
950
935
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
951
936
  };
952
937
  const de_ValidationExceptionRes = async (parsedOutput, context) => {
953
- const contents = map({});
938
+ const contents = (0, smithy_client_1.map)({});
954
939
  const data = parsedOutput.body;
955
- if (data.message != null) {
956
- contents.message = (0, smithy_client_1.expectString)(data.message);
957
- }
940
+ const doc = (0, smithy_client_1.take)(data, {
941
+ message: smithy_client_1.expectString,
942
+ });
943
+ Object.assign(contents, doc);
958
944
  const exception = new models_0_1.ValidationException({
959
945
  $metadata: deserializeMetadata(parsedOutput),
960
946
  ...contents,
961
947
  });
962
948
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
963
949
  };
964
- const se_CreateExperimentTemplateActionInput = (input, context) => {
965
- return {
966
- ...(input.actionId != null && { actionId: input.actionId }),
967
- ...(input.description != null && { description: input.description }),
968
- ...(input.parameters != null && { parameters: se_ExperimentTemplateActionParameterMap(input.parameters, context) }),
969
- ...(input.startAfter != null && {
970
- startAfter: se_ExperimentTemplateActionStartAfterList(input.startAfter, context),
971
- }),
972
- ...(input.targets != null && { targets: se_ExperimentTemplateActionTargetMap(input.targets, context) }),
973
- };
974
- };
975
- const se_CreateExperimentTemplateActionInputMap = (input, context) => {
976
- return Object.entries(input).reduce((acc, [key, value]) => {
977
- if (value === null) {
978
- return acc;
979
- }
980
- acc[key] = se_CreateExperimentTemplateActionInput(value, context);
981
- return acc;
982
- }, {});
983
- };
984
- const se_CreateExperimentTemplateLogConfigurationInput = (input, context) => {
985
- return {
986
- ...(input.cloudWatchLogsConfiguration != null && {
987
- cloudWatchLogsConfiguration: se_ExperimentTemplateCloudWatchLogsLogConfigurationInput(input.cloudWatchLogsConfiguration, context),
988
- }),
989
- ...(input.logSchemaVersion != null && { logSchemaVersion: input.logSchemaVersion }),
990
- ...(input.s3Configuration != null && {
991
- s3Configuration: se_ExperimentTemplateS3LogConfigurationInput(input.s3Configuration, context),
992
- }),
993
- };
994
- };
995
- const se_CreateExperimentTemplateStopConditionInput = (input, context) => {
996
- return {
997
- ...(input.source != null && { source: input.source }),
998
- ...(input.value != null && { value: input.value }),
999
- };
1000
- };
1001
- const se_CreateExperimentTemplateStopConditionInputList = (input, context) => {
1002
- return input
1003
- .filter((e) => e != null)
1004
- .map((entry) => {
1005
- return se_CreateExperimentTemplateStopConditionInput(entry, context);
1006
- });
1007
- };
1008
- const se_CreateExperimentTemplateTargetInput = (input, context) => {
1009
- return {
1010
- ...(input.filters != null && { filters: se_ExperimentTemplateTargetFilterInputList(input.filters, context) }),
1011
- ...(input.parameters != null && { parameters: se_ExperimentTemplateTargetParameterMap(input.parameters, context) }),
1012
- ...(input.resourceArns != null && { resourceArns: se_ResourceArnList(input.resourceArns, context) }),
1013
- ...(input.resourceTags != null && { resourceTags: se_TagMap(input.resourceTags, context) }),
1014
- ...(input.resourceType != null && { resourceType: input.resourceType }),
1015
- ...(input.selectionMode != null && { selectionMode: input.selectionMode }),
1016
- };
1017
- };
1018
- const se_CreateExperimentTemplateTargetInputMap = (input, context) => {
1019
- return Object.entries(input).reduce((acc, [key, value]) => {
1020
- if (value === null) {
1021
- return acc;
1022
- }
1023
- acc[key] = se_CreateExperimentTemplateTargetInput(value, context);
1024
- return acc;
1025
- }, {});
1026
- };
1027
- const se_ExperimentTemplateActionParameterMap = (input, context) => {
1028
- return Object.entries(input).reduce((acc, [key, value]) => {
1029
- if (value === null) {
1030
- return acc;
1031
- }
1032
- acc[key] = value;
1033
- return acc;
1034
- }, {});
1035
- };
1036
- const se_ExperimentTemplateActionStartAfterList = (input, context) => {
1037
- return input
1038
- .filter((e) => e != null)
1039
- .map((entry) => {
1040
- return entry;
1041
- });
1042
- };
1043
- const se_ExperimentTemplateActionTargetMap = (input, context) => {
1044
- return Object.entries(input).reduce((acc, [key, value]) => {
1045
- if (value === null) {
1046
- return acc;
1047
- }
1048
- acc[key] = value;
1049
- return acc;
1050
- }, {});
1051
- };
1052
- const se_ExperimentTemplateCloudWatchLogsLogConfigurationInput = (input, context) => {
1053
- return {
1054
- ...(input.logGroupArn != null && { logGroupArn: input.logGroupArn }),
1055
- };
1056
- };
1057
- const se_ExperimentTemplateS3LogConfigurationInput = (input, context) => {
1058
- return {
1059
- ...(input.bucketName != null && { bucketName: input.bucketName }),
1060
- ...(input.prefix != null && { prefix: input.prefix }),
1061
- };
1062
- };
1063
- const se_ExperimentTemplateTargetFilterInputList = (input, context) => {
1064
- return input
1065
- .filter((e) => e != null)
1066
- .map((entry) => {
1067
- return se_ExperimentTemplateTargetInputFilter(entry, context);
1068
- });
1069
- };
1070
- const se_ExperimentTemplateTargetFilterValues = (input, context) => {
1071
- return input
1072
- .filter((e) => e != null)
1073
- .map((entry) => {
1074
- return entry;
1075
- });
1076
- };
1077
- const se_ExperimentTemplateTargetInputFilter = (input, context) => {
1078
- return {
1079
- ...(input.path != null && { path: input.path }),
1080
- ...(input.values != null && { values: se_ExperimentTemplateTargetFilterValues(input.values, context) }),
1081
- };
1082
- };
1083
- const se_ExperimentTemplateTargetParameterMap = (input, context) => {
1084
- return Object.entries(input).reduce((acc, [key, value]) => {
1085
- if (value === null) {
1086
- return acc;
1087
- }
1088
- acc[key] = value;
1089
- return acc;
1090
- }, {});
1091
- };
1092
- const se_ResourceArnList = (input, context) => {
1093
- return input
1094
- .filter((e) => e != null)
1095
- .map((entry) => {
1096
- return entry;
1097
- });
1098
- };
1099
- const se_TagMap = (input, context) => {
1100
- return Object.entries(input).reduce((acc, [key, value]) => {
1101
- if (value === null) {
1102
- return acc;
1103
- }
1104
- acc[key] = value;
1105
- return acc;
1106
- }, {});
1107
- };
1108
- const se_UpdateExperimentTemplateActionInputItem = (input, context) => {
1109
- return {
1110
- ...(input.actionId != null && { actionId: input.actionId }),
1111
- ...(input.description != null && { description: input.description }),
1112
- ...(input.parameters != null && { parameters: se_ExperimentTemplateActionParameterMap(input.parameters, context) }),
1113
- ...(input.startAfter != null && {
1114
- startAfter: se_ExperimentTemplateActionStartAfterList(input.startAfter, context),
1115
- }),
1116
- ...(input.targets != null && { targets: se_ExperimentTemplateActionTargetMap(input.targets, context) }),
1117
- };
1118
- };
1119
- const se_UpdateExperimentTemplateActionInputMap = (input, context) => {
1120
- return Object.entries(input).reduce((acc, [key, value]) => {
1121
- if (value === null) {
1122
- return acc;
1123
- }
1124
- acc[key] = se_UpdateExperimentTemplateActionInputItem(value, context);
1125
- return acc;
1126
- }, {});
1127
- };
1128
- const se_UpdateExperimentTemplateLogConfigurationInput = (input, context) => {
1129
- return {
1130
- ...(input.cloudWatchLogsConfiguration != null && {
1131
- cloudWatchLogsConfiguration: se_ExperimentTemplateCloudWatchLogsLogConfigurationInput(input.cloudWatchLogsConfiguration, context),
1132
- }),
1133
- ...(input.logSchemaVersion != null && { logSchemaVersion: input.logSchemaVersion }),
1134
- ...(input.s3Configuration != null && {
1135
- s3Configuration: se_ExperimentTemplateS3LogConfigurationInput(input.s3Configuration, context),
1136
- }),
1137
- };
1138
- };
1139
- const se_UpdateExperimentTemplateStopConditionInput = (input, context) => {
1140
- return {
1141
- ...(input.source != null && { source: input.source }),
1142
- ...(input.value != null && { value: input.value }),
1143
- };
1144
- };
1145
- const se_UpdateExperimentTemplateStopConditionInputList = (input, context) => {
1146
- return input
1147
- .filter((e) => e != null)
1148
- .map((entry) => {
1149
- return se_UpdateExperimentTemplateStopConditionInput(entry, context);
1150
- });
1151
- };
1152
- const se_UpdateExperimentTemplateTargetInput = (input, context) => {
1153
- return {
1154
- ...(input.filters != null && { filters: se_ExperimentTemplateTargetFilterInputList(input.filters, context) }),
1155
- ...(input.parameters != null && { parameters: se_ExperimentTemplateTargetParameterMap(input.parameters, context) }),
1156
- ...(input.resourceArns != null && { resourceArns: se_ResourceArnList(input.resourceArns, context) }),
1157
- ...(input.resourceTags != null && { resourceTags: se_TagMap(input.resourceTags, context) }),
1158
- ...(input.resourceType != null && { resourceType: input.resourceType }),
1159
- ...(input.selectionMode != null && { selectionMode: input.selectionMode }),
1160
- };
1161
- };
1162
- const se_UpdateExperimentTemplateTargetInputMap = (input, context) => {
1163
- return Object.entries(input).reduce((acc, [key, value]) => {
1164
- if (value === null) {
1165
- return acc;
1166
- }
1167
- acc[key] = se_UpdateExperimentTemplateTargetInput(value, context);
1168
- return acc;
1169
- }, {});
1170
- };
1171
- const de_Action = (output, context) => {
1172
- return {
1173
- description: (0, smithy_client_1.expectString)(output.description),
1174
- id: (0, smithy_client_1.expectString)(output.id),
1175
- parameters: output.parameters != null ? de_ActionParameterMap(output.parameters, context) : undefined,
1176
- tags: output.tags != null ? de_TagMap(output.tags, context) : undefined,
1177
- targets: output.targets != null ? de_ActionTargetMap(output.targets, context) : undefined,
1178
- };
1179
- };
1180
- const de_ActionParameter = (output, context) => {
1181
- return {
1182
- description: (0, smithy_client_1.expectString)(output.description),
1183
- required: (0, smithy_client_1.expectBoolean)(output.required),
1184
- };
1185
- };
1186
- const de_ActionParameterMap = (output, context) => {
1187
- return Object.entries(output).reduce((acc, [key, value]) => {
1188
- if (value === null) {
1189
- return acc;
1190
- }
1191
- acc[key] = de_ActionParameter(value, context);
1192
- return acc;
1193
- }, {});
1194
- };
1195
- const de_ActionSummary = (output, context) => {
1196
- return {
1197
- description: (0, smithy_client_1.expectString)(output.description),
1198
- id: (0, smithy_client_1.expectString)(output.id),
1199
- tags: output.tags != null ? de_TagMap(output.tags, context) : undefined,
1200
- targets: output.targets != null ? de_ActionTargetMap(output.targets, context) : undefined,
1201
- };
1202
- };
1203
- const de_ActionSummaryList = (output, context) => {
1204
- const retVal = (output || [])
1205
- .filter((e) => e != null)
1206
- .map((entry) => {
1207
- if (entry === null) {
1208
- return null;
1209
- }
1210
- return de_ActionSummary(entry, context);
1211
- });
1212
- return retVal;
1213
- };
1214
- const de_ActionTarget = (output, context) => {
1215
- return {
1216
- resourceType: (0, smithy_client_1.expectString)(output.resourceType),
1217
- };
1218
- };
1219
- const de_ActionTargetMap = (output, context) => {
1220
- return Object.entries(output).reduce((acc, [key, value]) => {
1221
- if (value === null) {
1222
- return acc;
1223
- }
1224
- acc[key] = de_ActionTarget(value, context);
1225
- return acc;
1226
- }, {});
1227
- };
1228
950
  const de_Experiment = (output, context) => {
1229
- return {
1230
- actions: output.actions != null ? de_ExperimentActionMap(output.actions, context) : undefined,
1231
- creationTime: output.creationTime != null
1232
- ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.creationTime)))
1233
- : undefined,
1234
- endTime: output.endTime != null ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.endTime))) : undefined,
1235
- experimentTemplateId: (0, smithy_client_1.expectString)(output.experimentTemplateId),
1236
- id: (0, smithy_client_1.expectString)(output.id),
1237
- logConfiguration: output.logConfiguration != null ? de_ExperimentLogConfiguration(output.logConfiguration, context) : undefined,
1238
- roleArn: (0, smithy_client_1.expectString)(output.roleArn),
1239
- startTime: output.startTime != null ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.startTime))) : undefined,
1240
- state: output.state != null ? de_ExperimentState(output.state, context) : undefined,
1241
- stopConditions: output.stopConditions != null ? de_ExperimentStopConditionList(output.stopConditions, context) : undefined,
1242
- tags: output.tags != null ? de_TagMap(output.tags, context) : undefined,
1243
- targets: output.targets != null ? de_ExperimentTargetMap(output.targets, context) : undefined,
1244
- };
951
+ return (0, smithy_client_1.take)(output, {
952
+ actions: (_) => de_ExperimentActionMap(_, context),
953
+ creationTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
954
+ endTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
955
+ experimentTemplateId: smithy_client_1.expectString,
956
+ id: smithy_client_1.expectString,
957
+ logConfiguration: smithy_client_1._json,
958
+ roleArn: smithy_client_1.expectString,
959
+ startTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
960
+ state: smithy_client_1._json,
961
+ stopConditions: smithy_client_1._json,
962
+ tags: smithy_client_1._json,
963
+ targets: smithy_client_1._json,
964
+ });
1245
965
  };
1246
966
  const de_ExperimentAction = (output, context) => {
1247
- return {
1248
- actionId: (0, smithy_client_1.expectString)(output.actionId),
1249
- description: (0, smithy_client_1.expectString)(output.description),
1250
- endTime: output.endTime != null ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.endTime))) : undefined,
1251
- parameters: output.parameters != null ? de_ExperimentActionParameterMap(output.parameters, context) : undefined,
1252
- startAfter: output.startAfter != null ? de_ExperimentActionStartAfterList(output.startAfter, context) : undefined,
1253
- startTime: output.startTime != null ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.startTime))) : undefined,
1254
- state: output.state != null ? de_ExperimentActionState(output.state, context) : undefined,
1255
- targets: output.targets != null ? de_ExperimentActionTargetMap(output.targets, context) : undefined,
1256
- };
967
+ return (0, smithy_client_1.take)(output, {
968
+ actionId: smithy_client_1.expectString,
969
+ description: smithy_client_1.expectString,
970
+ endTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
971
+ parameters: smithy_client_1._json,
972
+ startAfter: smithy_client_1._json,
973
+ startTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
974
+ state: smithy_client_1._json,
975
+ targets: smithy_client_1._json,
976
+ });
1257
977
  };
1258
978
  const de_ExperimentActionMap = (output, context) => {
1259
979
  return Object.entries(output).reduce((acc, [key, value]) => {
@@ -1264,409 +984,54 @@ const de_ExperimentActionMap = (output, context) => {
1264
984
  return acc;
1265
985
  }, {});
1266
986
  };
1267
- const de_ExperimentActionParameterMap = (output, context) => {
1268
- return Object.entries(output).reduce((acc, [key, value]) => {
1269
- if (value === null) {
1270
- return acc;
1271
- }
1272
- acc[key] = (0, smithy_client_1.expectString)(value);
1273
- return acc;
1274
- }, {});
1275
- };
1276
- const de_ExperimentActionStartAfterList = (output, context) => {
1277
- const retVal = (output || [])
1278
- .filter((e) => e != null)
1279
- .map((entry) => {
1280
- if (entry === null) {
1281
- return null;
1282
- }
1283
- return (0, smithy_client_1.expectString)(entry);
1284
- });
1285
- return retVal;
1286
- };
1287
- const de_ExperimentActionState = (output, context) => {
1288
- return {
1289
- reason: (0, smithy_client_1.expectString)(output.reason),
1290
- status: (0, smithy_client_1.expectString)(output.status),
1291
- };
1292
- };
1293
- const de_ExperimentActionTargetMap = (output, context) => {
1294
- return Object.entries(output).reduce((acc, [key, value]) => {
1295
- if (value === null) {
1296
- return acc;
1297
- }
1298
- acc[key] = (0, smithy_client_1.expectString)(value);
1299
- return acc;
1300
- }, {});
1301
- };
1302
- const de_ExperimentCloudWatchLogsLogConfiguration = (output, context) => {
1303
- return {
1304
- logGroupArn: (0, smithy_client_1.expectString)(output.logGroupArn),
1305
- };
1306
- };
1307
- const de_ExperimentLogConfiguration = (output, context) => {
1308
- return {
1309
- cloudWatchLogsConfiguration: output.cloudWatchLogsConfiguration != null
1310
- ? de_ExperimentCloudWatchLogsLogConfiguration(output.cloudWatchLogsConfiguration, context)
1311
- : undefined,
1312
- logSchemaVersion: (0, smithy_client_1.expectInt32)(output.logSchemaVersion),
1313
- s3Configuration: output.s3Configuration != null ? de_ExperimentS3LogConfiguration(output.s3Configuration, context) : undefined,
1314
- };
1315
- };
1316
- const de_ExperimentS3LogConfiguration = (output, context) => {
1317
- return {
1318
- bucketName: (0, smithy_client_1.expectString)(output.bucketName),
1319
- prefix: (0, smithy_client_1.expectString)(output.prefix),
1320
- };
1321
- };
1322
- const de_ExperimentState = (output, context) => {
1323
- return {
1324
- reason: (0, smithy_client_1.expectString)(output.reason),
1325
- status: (0, smithy_client_1.expectString)(output.status),
1326
- };
1327
- };
1328
- const de_ExperimentStopCondition = (output, context) => {
1329
- return {
1330
- source: (0, smithy_client_1.expectString)(output.source),
1331
- value: (0, smithy_client_1.expectString)(output.value),
1332
- };
1333
- };
1334
- const de_ExperimentStopConditionList = (output, context) => {
1335
- const retVal = (output || [])
1336
- .filter((e) => e != null)
1337
- .map((entry) => {
1338
- if (entry === null) {
1339
- return null;
1340
- }
1341
- return de_ExperimentStopCondition(entry, context);
1342
- });
1343
- return retVal;
1344
- };
1345
987
  const de_ExperimentSummary = (output, context) => {
1346
- return {
1347
- creationTime: output.creationTime != null
1348
- ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.creationTime)))
1349
- : undefined,
1350
- experimentTemplateId: (0, smithy_client_1.expectString)(output.experimentTemplateId),
1351
- id: (0, smithy_client_1.expectString)(output.id),
1352
- state: output.state != null ? de_ExperimentState(output.state, context) : undefined,
1353
- tags: output.tags != null ? de_TagMap(output.tags, context) : undefined,
1354
- };
988
+ return (0, smithy_client_1.take)(output, {
989
+ creationTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
990
+ experimentTemplateId: smithy_client_1.expectString,
991
+ id: smithy_client_1.expectString,
992
+ state: smithy_client_1._json,
993
+ tags: smithy_client_1._json,
994
+ });
1355
995
  };
1356
996
  const de_ExperimentSummaryList = (output, context) => {
1357
997
  const retVal = (output || [])
1358
998
  .filter((e) => e != null)
1359
999
  .map((entry) => {
1360
- if (entry === null) {
1361
- return null;
1362
- }
1363
1000
  return de_ExperimentSummary(entry, context);
1364
1001
  });
1365
1002
  return retVal;
1366
1003
  };
1367
- const de_ExperimentTarget = (output, context) => {
1368
- return {
1369
- filters: output.filters != null ? de_ExperimentTargetFilterList(output.filters, context) : undefined,
1370
- parameters: output.parameters != null ? de_ExperimentTargetParameterMap(output.parameters, context) : undefined,
1371
- resourceArns: output.resourceArns != null ? de_ResourceArnList(output.resourceArns, context) : undefined,
1372
- resourceTags: output.resourceTags != null ? de_TagMap(output.resourceTags, context) : undefined,
1373
- resourceType: (0, smithy_client_1.expectString)(output.resourceType),
1374
- selectionMode: (0, smithy_client_1.expectString)(output.selectionMode),
1375
- };
1376
- };
1377
- const de_ExperimentTargetFilter = (output, context) => {
1378
- return {
1379
- path: (0, smithy_client_1.expectString)(output.path),
1380
- values: output.values != null ? de_ExperimentTargetFilterValues(output.values, context) : undefined,
1381
- };
1382
- };
1383
- const de_ExperimentTargetFilterList = (output, context) => {
1384
- const retVal = (output || [])
1385
- .filter((e) => e != null)
1386
- .map((entry) => {
1387
- if (entry === null) {
1388
- return null;
1389
- }
1390
- return de_ExperimentTargetFilter(entry, context);
1391
- });
1392
- return retVal;
1393
- };
1394
- const de_ExperimentTargetFilterValues = (output, context) => {
1395
- const retVal = (output || [])
1396
- .filter((e) => e != null)
1397
- .map((entry) => {
1398
- if (entry === null) {
1399
- return null;
1400
- }
1401
- return (0, smithy_client_1.expectString)(entry);
1402
- });
1403
- return retVal;
1404
- };
1405
- const de_ExperimentTargetMap = (output, context) => {
1406
- return Object.entries(output).reduce((acc, [key, value]) => {
1407
- if (value === null) {
1408
- return acc;
1409
- }
1410
- acc[key] = de_ExperimentTarget(value, context);
1411
- return acc;
1412
- }, {});
1413
- };
1414
- const de_ExperimentTargetParameterMap = (output, context) => {
1415
- return Object.entries(output).reduce((acc, [key, value]) => {
1416
- if (value === null) {
1417
- return acc;
1418
- }
1419
- acc[key] = (0, smithy_client_1.expectString)(value);
1420
- return acc;
1421
- }, {});
1422
- };
1423
1004
  const de_ExperimentTemplate = (output, context) => {
1424
- return {
1425
- actions: output.actions != null ? de_ExperimentTemplateActionMap(output.actions, context) : undefined,
1426
- creationTime: output.creationTime != null
1427
- ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.creationTime)))
1428
- : undefined,
1429
- description: (0, smithy_client_1.expectString)(output.description),
1430
- id: (0, smithy_client_1.expectString)(output.id),
1431
- lastUpdateTime: output.lastUpdateTime != null
1432
- ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.lastUpdateTime)))
1433
- : undefined,
1434
- logConfiguration: output.logConfiguration != null
1435
- ? de_ExperimentTemplateLogConfiguration(output.logConfiguration, context)
1436
- : undefined,
1437
- roleArn: (0, smithy_client_1.expectString)(output.roleArn),
1438
- stopConditions: output.stopConditions != null
1439
- ? de_ExperimentTemplateStopConditionList(output.stopConditions, context)
1440
- : undefined,
1441
- tags: output.tags != null ? de_TagMap(output.tags, context) : undefined,
1442
- targets: output.targets != null ? de_ExperimentTemplateTargetMap(output.targets, context) : undefined,
1443
- };
1444
- };
1445
- const de_ExperimentTemplateAction = (output, context) => {
1446
- return {
1447
- actionId: (0, smithy_client_1.expectString)(output.actionId),
1448
- description: (0, smithy_client_1.expectString)(output.description),
1449
- parameters: output.parameters != null ? de_ExperimentTemplateActionParameterMap(output.parameters, context) : undefined,
1450
- startAfter: output.startAfter != null ? de_ExperimentTemplateActionStartAfterList(output.startAfter, context) : undefined,
1451
- targets: output.targets != null ? de_ExperimentTemplateActionTargetMap(output.targets, context) : undefined,
1452
- };
1453
- };
1454
- const de_ExperimentTemplateActionMap = (output, context) => {
1455
- return Object.entries(output).reduce((acc, [key, value]) => {
1456
- if (value === null) {
1457
- return acc;
1458
- }
1459
- acc[key] = de_ExperimentTemplateAction(value, context);
1460
- return acc;
1461
- }, {});
1462
- };
1463
- const de_ExperimentTemplateActionParameterMap = (output, context) => {
1464
- return Object.entries(output).reduce((acc, [key, value]) => {
1465
- if (value === null) {
1466
- return acc;
1467
- }
1468
- acc[key] = (0, smithy_client_1.expectString)(value);
1469
- return acc;
1470
- }, {});
1471
- };
1472
- const de_ExperimentTemplateActionStartAfterList = (output, context) => {
1473
- const retVal = (output || [])
1474
- .filter((e) => e != null)
1475
- .map((entry) => {
1476
- if (entry === null) {
1477
- return null;
1478
- }
1479
- return (0, smithy_client_1.expectString)(entry);
1480
- });
1481
- return retVal;
1482
- };
1483
- const de_ExperimentTemplateActionTargetMap = (output, context) => {
1484
- return Object.entries(output).reduce((acc, [key, value]) => {
1485
- if (value === null) {
1486
- return acc;
1487
- }
1488
- acc[key] = (0, smithy_client_1.expectString)(value);
1489
- return acc;
1490
- }, {});
1491
- };
1492
- const de_ExperimentTemplateCloudWatchLogsLogConfiguration = (output, context) => {
1493
- return {
1494
- logGroupArn: (0, smithy_client_1.expectString)(output.logGroupArn),
1495
- };
1496
- };
1497
- const de_ExperimentTemplateLogConfiguration = (output, context) => {
1498
- return {
1499
- cloudWatchLogsConfiguration: output.cloudWatchLogsConfiguration != null
1500
- ? de_ExperimentTemplateCloudWatchLogsLogConfiguration(output.cloudWatchLogsConfiguration, context)
1501
- : undefined,
1502
- logSchemaVersion: (0, smithy_client_1.expectInt32)(output.logSchemaVersion),
1503
- s3Configuration: output.s3Configuration != null
1504
- ? de_ExperimentTemplateS3LogConfiguration(output.s3Configuration, context)
1505
- : undefined,
1506
- };
1507
- };
1508
- const de_ExperimentTemplateS3LogConfiguration = (output, context) => {
1509
- return {
1510
- bucketName: (0, smithy_client_1.expectString)(output.bucketName),
1511
- prefix: (0, smithy_client_1.expectString)(output.prefix),
1512
- };
1513
- };
1514
- const de_ExperimentTemplateStopCondition = (output, context) => {
1515
- return {
1516
- source: (0, smithy_client_1.expectString)(output.source),
1517
- value: (0, smithy_client_1.expectString)(output.value),
1518
- };
1519
- };
1520
- const de_ExperimentTemplateStopConditionList = (output, context) => {
1521
- const retVal = (output || [])
1522
- .filter((e) => e != null)
1523
- .map((entry) => {
1524
- if (entry === null) {
1525
- return null;
1526
- }
1527
- return de_ExperimentTemplateStopCondition(entry, context);
1005
+ return (0, smithy_client_1.take)(output, {
1006
+ actions: smithy_client_1._json,
1007
+ creationTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1008
+ description: smithy_client_1.expectString,
1009
+ id: smithy_client_1.expectString,
1010
+ lastUpdateTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1011
+ logConfiguration: smithy_client_1._json,
1012
+ roleArn: smithy_client_1.expectString,
1013
+ stopConditions: smithy_client_1._json,
1014
+ tags: smithy_client_1._json,
1015
+ targets: smithy_client_1._json,
1528
1016
  });
1529
- return retVal;
1530
1017
  };
1531
1018
  const de_ExperimentTemplateSummary = (output, context) => {
1532
- return {
1533
- creationTime: output.creationTime != null
1534
- ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.creationTime)))
1535
- : undefined,
1536
- description: (0, smithy_client_1.expectString)(output.description),
1537
- id: (0, smithy_client_1.expectString)(output.id),
1538
- lastUpdateTime: output.lastUpdateTime != null
1539
- ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.lastUpdateTime)))
1540
- : undefined,
1541
- tags: output.tags != null ? de_TagMap(output.tags, context) : undefined,
1542
- };
1019
+ return (0, smithy_client_1.take)(output, {
1020
+ creationTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1021
+ description: smithy_client_1.expectString,
1022
+ id: smithy_client_1.expectString,
1023
+ lastUpdateTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
1024
+ tags: smithy_client_1._json,
1025
+ });
1543
1026
  };
1544
1027
  const de_ExperimentTemplateSummaryList = (output, context) => {
1545
1028
  const retVal = (output || [])
1546
1029
  .filter((e) => e != null)
1547
1030
  .map((entry) => {
1548
- if (entry === null) {
1549
- return null;
1550
- }
1551
1031
  return de_ExperimentTemplateSummary(entry, context);
1552
1032
  });
1553
1033
  return retVal;
1554
1034
  };
1555
- const de_ExperimentTemplateTarget = (output, context) => {
1556
- return {
1557
- filters: output.filters != null ? de_ExperimentTemplateTargetFilterList(output.filters, context) : undefined,
1558
- parameters: output.parameters != null ? de_ExperimentTemplateTargetParameterMap(output.parameters, context) : undefined,
1559
- resourceArns: output.resourceArns != null ? de_ResourceArnList(output.resourceArns, context) : undefined,
1560
- resourceTags: output.resourceTags != null ? de_TagMap(output.resourceTags, context) : undefined,
1561
- resourceType: (0, smithy_client_1.expectString)(output.resourceType),
1562
- selectionMode: (0, smithy_client_1.expectString)(output.selectionMode),
1563
- };
1564
- };
1565
- const de_ExperimentTemplateTargetFilter = (output, context) => {
1566
- return {
1567
- path: (0, smithy_client_1.expectString)(output.path),
1568
- values: output.values != null ? de_ExperimentTemplateTargetFilterValues(output.values, context) : undefined,
1569
- };
1570
- };
1571
- const de_ExperimentTemplateTargetFilterList = (output, context) => {
1572
- const retVal = (output || [])
1573
- .filter((e) => e != null)
1574
- .map((entry) => {
1575
- if (entry === null) {
1576
- return null;
1577
- }
1578
- return de_ExperimentTemplateTargetFilter(entry, context);
1579
- });
1580
- return retVal;
1581
- };
1582
- const de_ExperimentTemplateTargetFilterValues = (output, context) => {
1583
- const retVal = (output || [])
1584
- .filter((e) => e != null)
1585
- .map((entry) => {
1586
- if (entry === null) {
1587
- return null;
1588
- }
1589
- return (0, smithy_client_1.expectString)(entry);
1590
- });
1591
- return retVal;
1592
- };
1593
- const de_ExperimentTemplateTargetMap = (output, context) => {
1594
- return Object.entries(output).reduce((acc, [key, value]) => {
1595
- if (value === null) {
1596
- return acc;
1597
- }
1598
- acc[key] = de_ExperimentTemplateTarget(value, context);
1599
- return acc;
1600
- }, {});
1601
- };
1602
- const de_ExperimentTemplateTargetParameterMap = (output, context) => {
1603
- return Object.entries(output).reduce((acc, [key, value]) => {
1604
- if (value === null) {
1605
- return acc;
1606
- }
1607
- acc[key] = (0, smithy_client_1.expectString)(value);
1608
- return acc;
1609
- }, {});
1610
- };
1611
- const de_ResourceArnList = (output, context) => {
1612
- const retVal = (output || [])
1613
- .filter((e) => e != null)
1614
- .map((entry) => {
1615
- if (entry === null) {
1616
- return null;
1617
- }
1618
- return (0, smithy_client_1.expectString)(entry);
1619
- });
1620
- return retVal;
1621
- };
1622
- const de_TagMap = (output, context) => {
1623
- return Object.entries(output).reduce((acc, [key, value]) => {
1624
- if (value === null) {
1625
- return acc;
1626
- }
1627
- acc[key] = (0, smithy_client_1.expectString)(value);
1628
- return acc;
1629
- }, {});
1630
- };
1631
- const de_TargetResourceType = (output, context) => {
1632
- return {
1633
- description: (0, smithy_client_1.expectString)(output.description),
1634
- parameters: output.parameters != null ? de_TargetResourceTypeParameterMap(output.parameters, context) : undefined,
1635
- resourceType: (0, smithy_client_1.expectString)(output.resourceType),
1636
- };
1637
- };
1638
- const de_TargetResourceTypeParameter = (output, context) => {
1639
- return {
1640
- description: (0, smithy_client_1.expectString)(output.description),
1641
- required: (0, smithy_client_1.expectBoolean)(output.required),
1642
- };
1643
- };
1644
- const de_TargetResourceTypeParameterMap = (output, context) => {
1645
- return Object.entries(output).reduce((acc, [key, value]) => {
1646
- if (value === null) {
1647
- return acc;
1648
- }
1649
- acc[key] = de_TargetResourceTypeParameter(value, context);
1650
- return acc;
1651
- }, {});
1652
- };
1653
- const de_TargetResourceTypeSummary = (output, context) => {
1654
- return {
1655
- description: (0, smithy_client_1.expectString)(output.description),
1656
- resourceType: (0, smithy_client_1.expectString)(output.resourceType),
1657
- };
1658
- };
1659
- const de_TargetResourceTypeSummaryList = (output, context) => {
1660
- const retVal = (output || [])
1661
- .filter((e) => e != null)
1662
- .map((entry) => {
1663
- if (entry === null) {
1664
- return null;
1665
- }
1666
- return de_TargetResourceTypeSummary(entry, context);
1667
- });
1668
- return retVal;
1669
- };
1670
1035
  const deserializeMetadata = (output) => ({
1671
1036
  httpStatusCode: output.statusCode,
1672
1037
  requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],