{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.FIS.Types.ExperimentTemplate
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.FIS.Types.ExperimentTemplate where

import qualified Amazonka.Core as Core
import Amazonka.FIS.Types.ExperimentTemplateAction
import Amazonka.FIS.Types.ExperimentTemplateStopCondition
import Amazonka.FIS.Types.ExperimentTemplateTarget
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Describes an experiment template.
--
-- /See:/ 'newExperimentTemplate' smart constructor.
data ExperimentTemplate = ExperimentTemplate'
  { -- | The time the experiment template was created.
    ExperimentTemplate -> Maybe POSIX
creationTime :: Prelude.Maybe Core.POSIX,
    -- | The actions for the experiment.
    ExperimentTemplate -> Maybe (HashMap Text ExperimentTemplateAction)
actions :: Prelude.Maybe (Prelude.HashMap Prelude.Text ExperimentTemplateAction),
    -- | The stop conditions for the experiment.
    ExperimentTemplate -> Maybe [ExperimentTemplateStopCondition]
stopConditions :: Prelude.Maybe [ExperimentTemplateStopCondition],
    -- | The targets for the experiment.
    ExperimentTemplate -> Maybe (HashMap Text ExperimentTemplateTarget)
targets :: Prelude.Maybe (Prelude.HashMap Prelude.Text ExperimentTemplateTarget),
    -- | The ID of the experiment template.
    ExperimentTemplate -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The time the experiment template was last updated.
    ExperimentTemplate -> Maybe POSIX
lastUpdateTime :: Prelude.Maybe Core.POSIX,
    -- | The description for the experiment template.
    ExperimentTemplate -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The tags for the experiment template.
    ExperimentTemplate -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The Amazon Resource Name (ARN) of an IAM role.
    ExperimentTemplate -> Maybe Text
roleArn :: Prelude.Maybe Prelude.Text
  }
  deriving (ExperimentTemplate -> ExperimentTemplate -> Bool
(ExperimentTemplate -> ExperimentTemplate -> Bool)
-> (ExperimentTemplate -> ExperimentTemplate -> Bool)
-> Eq ExperimentTemplate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExperimentTemplate -> ExperimentTemplate -> Bool
$c/= :: ExperimentTemplate -> ExperimentTemplate -> Bool
== :: ExperimentTemplate -> ExperimentTemplate -> Bool
$c== :: ExperimentTemplate -> ExperimentTemplate -> Bool
Prelude.Eq, ReadPrec [ExperimentTemplate]
ReadPrec ExperimentTemplate
Int -> ReadS ExperimentTemplate
ReadS [ExperimentTemplate]
(Int -> ReadS ExperimentTemplate)
-> ReadS [ExperimentTemplate]
-> ReadPrec ExperimentTemplate
-> ReadPrec [ExperimentTemplate]
-> Read ExperimentTemplate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ExperimentTemplate]
$creadListPrec :: ReadPrec [ExperimentTemplate]
readPrec :: ReadPrec ExperimentTemplate
$creadPrec :: ReadPrec ExperimentTemplate
readList :: ReadS [ExperimentTemplate]
$creadList :: ReadS [ExperimentTemplate]
readsPrec :: Int -> ReadS ExperimentTemplate
$creadsPrec :: Int -> ReadS ExperimentTemplate
Prelude.Read, Int -> ExperimentTemplate -> ShowS
[ExperimentTemplate] -> ShowS
ExperimentTemplate -> String
(Int -> ExperimentTemplate -> ShowS)
-> (ExperimentTemplate -> String)
-> ([ExperimentTemplate] -> ShowS)
-> Show ExperimentTemplate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ExperimentTemplate] -> ShowS
$cshowList :: [ExperimentTemplate] -> ShowS
show :: ExperimentTemplate -> String
$cshow :: ExperimentTemplate -> String
showsPrec :: Int -> ExperimentTemplate -> ShowS
$cshowsPrec :: Int -> ExperimentTemplate -> ShowS
Prelude.Show, (forall x. ExperimentTemplate -> Rep ExperimentTemplate x)
-> (forall x. Rep ExperimentTemplate x -> ExperimentTemplate)
-> Generic ExperimentTemplate
forall x. Rep ExperimentTemplate x -> ExperimentTemplate
forall x. ExperimentTemplate -> Rep ExperimentTemplate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ExperimentTemplate x -> ExperimentTemplate
$cfrom :: forall x. ExperimentTemplate -> Rep ExperimentTemplate x
Prelude.Generic)

-- |
-- Create a value of 'ExperimentTemplate' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'creationTime', 'experimentTemplate_creationTime' - The time the experiment template was created.
--
-- 'actions', 'experimentTemplate_actions' - The actions for the experiment.
--
-- 'stopConditions', 'experimentTemplate_stopConditions' - The stop conditions for the experiment.
--
-- 'targets', 'experimentTemplate_targets' - The targets for the experiment.
--
-- 'id', 'experimentTemplate_id' - The ID of the experiment template.
--
-- 'lastUpdateTime', 'experimentTemplate_lastUpdateTime' - The time the experiment template was last updated.
--
-- 'description', 'experimentTemplate_description' - The description for the experiment template.
--
-- 'tags', 'experimentTemplate_tags' - The tags for the experiment template.
--
-- 'roleArn', 'experimentTemplate_roleArn' - The Amazon Resource Name (ARN) of an IAM role.
newExperimentTemplate ::
  ExperimentTemplate
newExperimentTemplate :: ExperimentTemplate
newExperimentTemplate =
  ExperimentTemplate' :: Maybe POSIX
-> Maybe (HashMap Text ExperimentTemplateAction)
-> Maybe [ExperimentTemplateStopCondition]
-> Maybe (HashMap Text ExperimentTemplateTarget)
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Text
-> ExperimentTemplate
ExperimentTemplate'
    { $sel:creationTime:ExperimentTemplate' :: Maybe POSIX
creationTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:actions:ExperimentTemplate' :: Maybe (HashMap Text ExperimentTemplateAction)
actions = Maybe (HashMap Text ExperimentTemplateAction)
forall a. Maybe a
Prelude.Nothing,
      $sel:stopConditions:ExperimentTemplate' :: Maybe [ExperimentTemplateStopCondition]
stopConditions = Maybe [ExperimentTemplateStopCondition]
forall a. Maybe a
Prelude.Nothing,
      $sel:targets:ExperimentTemplate' :: Maybe (HashMap Text ExperimentTemplateTarget)
targets = Maybe (HashMap Text ExperimentTemplateTarget)
forall a. Maybe a
Prelude.Nothing,
      $sel:id:ExperimentTemplate' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdateTime:ExperimentTemplate' :: Maybe POSIX
lastUpdateTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:description:ExperimentTemplate' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:ExperimentTemplate' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:roleArn:ExperimentTemplate' :: Maybe Text
roleArn = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The time the experiment template was created.
experimentTemplate_creationTime :: Lens.Lens' ExperimentTemplate (Prelude.Maybe Prelude.UTCTime)
experimentTemplate_creationTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ExperimentTemplate -> f ExperimentTemplate
experimentTemplate_creationTime = (ExperimentTemplate -> Maybe POSIX)
-> (ExperimentTemplate -> Maybe POSIX -> ExperimentTemplate)
-> Lens
     ExperimentTemplate ExperimentTemplate (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExperimentTemplate' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:ExperimentTemplate' :: ExperimentTemplate -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: ExperimentTemplate
s@ExperimentTemplate' {} Maybe POSIX
a -> ExperimentTemplate
s {$sel:creationTime:ExperimentTemplate' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: ExperimentTemplate) ((Maybe POSIX -> f (Maybe POSIX))
 -> ExperimentTemplate -> f ExperimentTemplate)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ExperimentTemplate
-> f ExperimentTemplate
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The actions for the experiment.
experimentTemplate_actions :: Lens.Lens' ExperimentTemplate (Prelude.Maybe (Prelude.HashMap Prelude.Text ExperimentTemplateAction))
experimentTemplate_actions :: (Maybe (HashMap Text ExperimentTemplateAction)
 -> f (Maybe (HashMap Text ExperimentTemplateAction)))
-> ExperimentTemplate -> f ExperimentTemplate
experimentTemplate_actions = (ExperimentTemplate
 -> Maybe (HashMap Text ExperimentTemplateAction))
-> (ExperimentTemplate
    -> Maybe (HashMap Text ExperimentTemplateAction)
    -> ExperimentTemplate)
-> Lens
     ExperimentTemplate
     ExperimentTemplate
     (Maybe (HashMap Text ExperimentTemplateAction))
     (Maybe (HashMap Text ExperimentTemplateAction))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExperimentTemplate' {Maybe (HashMap Text ExperimentTemplateAction)
actions :: Maybe (HashMap Text ExperimentTemplateAction)
$sel:actions:ExperimentTemplate' :: ExperimentTemplate -> Maybe (HashMap Text ExperimentTemplateAction)
actions} -> Maybe (HashMap Text ExperimentTemplateAction)
actions) (\s :: ExperimentTemplate
s@ExperimentTemplate' {} Maybe (HashMap Text ExperimentTemplateAction)
a -> ExperimentTemplate
s {$sel:actions:ExperimentTemplate' :: Maybe (HashMap Text ExperimentTemplateAction)
actions = Maybe (HashMap Text ExperimentTemplateAction)
a} :: ExperimentTemplate) ((Maybe (HashMap Text ExperimentTemplateAction)
  -> f (Maybe (HashMap Text ExperimentTemplateAction)))
 -> ExperimentTemplate -> f ExperimentTemplate)
-> ((Maybe (HashMap Text ExperimentTemplateAction)
     -> f (Maybe (HashMap Text ExperimentTemplateAction)))
    -> Maybe (HashMap Text ExperimentTemplateAction)
    -> f (Maybe (HashMap Text ExperimentTemplateAction)))
-> (Maybe (HashMap Text ExperimentTemplateAction)
    -> f (Maybe (HashMap Text ExperimentTemplateAction)))
-> ExperimentTemplate
-> f ExperimentTemplate
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text ExperimentTemplateAction)
  (HashMap Text ExperimentTemplateAction)
  (HashMap Text ExperimentTemplateAction)
  (HashMap Text ExperimentTemplateAction)
-> Iso
     (Maybe (HashMap Text ExperimentTemplateAction))
     (Maybe (HashMap Text ExperimentTemplateAction))
     (Maybe (HashMap Text ExperimentTemplateAction))
     (Maybe (HashMap Text ExperimentTemplateAction))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (HashMap Text ExperimentTemplateAction)
  (HashMap Text ExperimentTemplateAction)
  (HashMap Text ExperimentTemplateAction)
  (HashMap Text ExperimentTemplateAction)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The stop conditions for the experiment.
experimentTemplate_stopConditions :: Lens.Lens' ExperimentTemplate (Prelude.Maybe [ExperimentTemplateStopCondition])
experimentTemplate_stopConditions :: (Maybe [ExperimentTemplateStopCondition]
 -> f (Maybe [ExperimentTemplateStopCondition]))
-> ExperimentTemplate -> f ExperimentTemplate
experimentTemplate_stopConditions = (ExperimentTemplate -> Maybe [ExperimentTemplateStopCondition])
-> (ExperimentTemplate
    -> Maybe [ExperimentTemplateStopCondition] -> ExperimentTemplate)
-> Lens
     ExperimentTemplate
     ExperimentTemplate
     (Maybe [ExperimentTemplateStopCondition])
     (Maybe [ExperimentTemplateStopCondition])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExperimentTemplate' {Maybe [ExperimentTemplateStopCondition]
stopConditions :: Maybe [ExperimentTemplateStopCondition]
$sel:stopConditions:ExperimentTemplate' :: ExperimentTemplate -> Maybe [ExperimentTemplateStopCondition]
stopConditions} -> Maybe [ExperimentTemplateStopCondition]
stopConditions) (\s :: ExperimentTemplate
s@ExperimentTemplate' {} Maybe [ExperimentTemplateStopCondition]
a -> ExperimentTemplate
s {$sel:stopConditions:ExperimentTemplate' :: Maybe [ExperimentTemplateStopCondition]
stopConditions = Maybe [ExperimentTemplateStopCondition]
a} :: ExperimentTemplate) ((Maybe [ExperimentTemplateStopCondition]
  -> f (Maybe [ExperimentTemplateStopCondition]))
 -> ExperimentTemplate -> f ExperimentTemplate)
-> ((Maybe [ExperimentTemplateStopCondition]
     -> f (Maybe [ExperimentTemplateStopCondition]))
    -> Maybe [ExperimentTemplateStopCondition]
    -> f (Maybe [ExperimentTemplateStopCondition]))
-> (Maybe [ExperimentTemplateStopCondition]
    -> f (Maybe [ExperimentTemplateStopCondition]))
-> ExperimentTemplate
-> f ExperimentTemplate
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ExperimentTemplateStopCondition]
  [ExperimentTemplateStopCondition]
  [ExperimentTemplateStopCondition]
  [ExperimentTemplateStopCondition]
-> Iso
     (Maybe [ExperimentTemplateStopCondition])
     (Maybe [ExperimentTemplateStopCondition])
     (Maybe [ExperimentTemplateStopCondition])
     (Maybe [ExperimentTemplateStopCondition])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  [ExperimentTemplateStopCondition]
  [ExperimentTemplateStopCondition]
  [ExperimentTemplateStopCondition]
  [ExperimentTemplateStopCondition]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The targets for the experiment.
experimentTemplate_targets :: Lens.Lens' ExperimentTemplate (Prelude.Maybe (Prelude.HashMap Prelude.Text ExperimentTemplateTarget))
experimentTemplate_targets :: (Maybe (HashMap Text ExperimentTemplateTarget)
 -> f (Maybe (HashMap Text ExperimentTemplateTarget)))
-> ExperimentTemplate -> f ExperimentTemplate
experimentTemplate_targets = (ExperimentTemplate
 -> Maybe (HashMap Text ExperimentTemplateTarget))
-> (ExperimentTemplate
    -> Maybe (HashMap Text ExperimentTemplateTarget)
    -> ExperimentTemplate)
-> Lens
     ExperimentTemplate
     ExperimentTemplate
     (Maybe (HashMap Text ExperimentTemplateTarget))
     (Maybe (HashMap Text ExperimentTemplateTarget))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExperimentTemplate' {Maybe (HashMap Text ExperimentTemplateTarget)
targets :: Maybe (HashMap Text ExperimentTemplateTarget)
$sel:targets:ExperimentTemplate' :: ExperimentTemplate -> Maybe (HashMap Text ExperimentTemplateTarget)
targets} -> Maybe (HashMap Text ExperimentTemplateTarget)
targets) (\s :: ExperimentTemplate
s@ExperimentTemplate' {} Maybe (HashMap Text ExperimentTemplateTarget)
a -> ExperimentTemplate
s {$sel:targets:ExperimentTemplate' :: Maybe (HashMap Text ExperimentTemplateTarget)
targets = Maybe (HashMap Text ExperimentTemplateTarget)
a} :: ExperimentTemplate) ((Maybe (HashMap Text ExperimentTemplateTarget)
  -> f (Maybe (HashMap Text ExperimentTemplateTarget)))
 -> ExperimentTemplate -> f ExperimentTemplate)
-> ((Maybe (HashMap Text ExperimentTemplateTarget)
     -> f (Maybe (HashMap Text ExperimentTemplateTarget)))
    -> Maybe (HashMap Text ExperimentTemplateTarget)
    -> f (Maybe (HashMap Text ExperimentTemplateTarget)))
-> (Maybe (HashMap Text ExperimentTemplateTarget)
    -> f (Maybe (HashMap Text ExperimentTemplateTarget)))
-> ExperimentTemplate
-> f ExperimentTemplate
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text ExperimentTemplateTarget)
  (HashMap Text ExperimentTemplateTarget)
  (HashMap Text ExperimentTemplateTarget)
  (HashMap Text ExperimentTemplateTarget)
-> Iso
     (Maybe (HashMap Text ExperimentTemplateTarget))
     (Maybe (HashMap Text ExperimentTemplateTarget))
     (Maybe (HashMap Text ExperimentTemplateTarget))
     (Maybe (HashMap Text ExperimentTemplateTarget))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (HashMap Text ExperimentTemplateTarget)
  (HashMap Text ExperimentTemplateTarget)
  (HashMap Text ExperimentTemplateTarget)
  (HashMap Text ExperimentTemplateTarget)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The ID of the experiment template.
experimentTemplate_id :: Lens.Lens' ExperimentTemplate (Prelude.Maybe Prelude.Text)
experimentTemplate_id :: (Maybe Text -> f (Maybe Text))
-> ExperimentTemplate -> f ExperimentTemplate
experimentTemplate_id = (ExperimentTemplate -> Maybe Text)
-> (ExperimentTemplate -> Maybe Text -> ExperimentTemplate)
-> Lens
     ExperimentTemplate ExperimentTemplate (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExperimentTemplate' {Maybe Text
id :: Maybe Text
$sel:id:ExperimentTemplate' :: ExperimentTemplate -> Maybe Text
id} -> Maybe Text
id) (\s :: ExperimentTemplate
s@ExperimentTemplate' {} Maybe Text
a -> ExperimentTemplate
s {$sel:id:ExperimentTemplate' :: Maybe Text
id = Maybe Text
a} :: ExperimentTemplate)

-- | The time the experiment template was last updated.
experimentTemplate_lastUpdateTime :: Lens.Lens' ExperimentTemplate (Prelude.Maybe Prelude.UTCTime)
experimentTemplate_lastUpdateTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ExperimentTemplate -> f ExperimentTemplate
experimentTemplate_lastUpdateTime = (ExperimentTemplate -> Maybe POSIX)
-> (ExperimentTemplate -> Maybe POSIX -> ExperimentTemplate)
-> Lens
     ExperimentTemplate ExperimentTemplate (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExperimentTemplate' {Maybe POSIX
lastUpdateTime :: Maybe POSIX
$sel:lastUpdateTime:ExperimentTemplate' :: ExperimentTemplate -> Maybe POSIX
lastUpdateTime} -> Maybe POSIX
lastUpdateTime) (\s :: ExperimentTemplate
s@ExperimentTemplate' {} Maybe POSIX
a -> ExperimentTemplate
s {$sel:lastUpdateTime:ExperimentTemplate' :: Maybe POSIX
lastUpdateTime = Maybe POSIX
a} :: ExperimentTemplate) ((Maybe POSIX -> f (Maybe POSIX))
 -> ExperimentTemplate -> f ExperimentTemplate)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ExperimentTemplate
-> f ExperimentTemplate
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The description for the experiment template.
experimentTemplate_description :: Lens.Lens' ExperimentTemplate (Prelude.Maybe Prelude.Text)
experimentTemplate_description :: (Maybe Text -> f (Maybe Text))
-> ExperimentTemplate -> f ExperimentTemplate
experimentTemplate_description = (ExperimentTemplate -> Maybe Text)
-> (ExperimentTemplate -> Maybe Text -> ExperimentTemplate)
-> Lens
     ExperimentTemplate ExperimentTemplate (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExperimentTemplate' {Maybe Text
description :: Maybe Text
$sel:description:ExperimentTemplate' :: ExperimentTemplate -> Maybe Text
description} -> Maybe Text
description) (\s :: ExperimentTemplate
s@ExperimentTemplate' {} Maybe Text
a -> ExperimentTemplate
s {$sel:description:ExperimentTemplate' :: Maybe Text
description = Maybe Text
a} :: ExperimentTemplate)

-- | The tags for the experiment template.
experimentTemplate_tags :: Lens.Lens' ExperimentTemplate (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
experimentTemplate_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> ExperimentTemplate -> f ExperimentTemplate
experimentTemplate_tags = (ExperimentTemplate -> Maybe (HashMap Text Text))
-> (ExperimentTemplate
    -> Maybe (HashMap Text Text) -> ExperimentTemplate)
-> Lens
     ExperimentTemplate
     ExperimentTemplate
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExperimentTemplate' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:ExperimentTemplate' :: ExperimentTemplate -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: ExperimentTemplate
s@ExperimentTemplate' {} Maybe (HashMap Text Text)
a -> ExperimentTemplate
s {$sel:tags:ExperimentTemplate' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: ExperimentTemplate) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> ExperimentTemplate -> f ExperimentTemplate)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> ExperimentTemplate
-> f ExperimentTemplate
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The Amazon Resource Name (ARN) of an IAM role.
experimentTemplate_roleArn :: Lens.Lens' ExperimentTemplate (Prelude.Maybe Prelude.Text)
experimentTemplate_roleArn :: (Maybe Text -> f (Maybe Text))
-> ExperimentTemplate -> f ExperimentTemplate
experimentTemplate_roleArn = (ExperimentTemplate -> Maybe Text)
-> (ExperimentTemplate -> Maybe Text -> ExperimentTemplate)
-> Lens
     ExperimentTemplate ExperimentTemplate (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExperimentTemplate' {Maybe Text
roleArn :: Maybe Text
$sel:roleArn:ExperimentTemplate' :: ExperimentTemplate -> Maybe Text
roleArn} -> Maybe Text
roleArn) (\s :: ExperimentTemplate
s@ExperimentTemplate' {} Maybe Text
a -> ExperimentTemplate
s {$sel:roleArn:ExperimentTemplate' :: Maybe Text
roleArn = Maybe Text
a} :: ExperimentTemplate)

instance Core.FromJSON ExperimentTemplate where
  parseJSON :: Value -> Parser ExperimentTemplate
parseJSON =
    String
-> (Object -> Parser ExperimentTemplate)
-> Value
-> Parser ExperimentTemplate
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ExperimentTemplate"
      ( \Object
x ->
          Maybe POSIX
-> Maybe (HashMap Text ExperimentTemplateAction)
-> Maybe [ExperimentTemplateStopCondition]
-> Maybe (HashMap Text ExperimentTemplateTarget)
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Text
-> ExperimentTemplate
ExperimentTemplate'
            (Maybe POSIX
 -> Maybe (HashMap Text ExperimentTemplateAction)
 -> Maybe [ExperimentTemplateStopCondition]
 -> Maybe (HashMap Text ExperimentTemplateTarget)
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe (HashMap Text Text)
 -> Maybe Text
 -> ExperimentTemplate)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe (HashMap Text ExperimentTemplateAction)
      -> Maybe [ExperimentTemplateStopCondition]
      -> Maybe (HashMap Text ExperimentTemplateTarget)
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> ExperimentTemplate)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"creationTime")
            Parser
  (Maybe (HashMap Text ExperimentTemplateAction)
   -> Maybe [ExperimentTemplateStopCondition]
   -> Maybe (HashMap Text ExperimentTemplateTarget)
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Maybe Text
   -> ExperimentTemplate)
-> Parser (Maybe (HashMap Text ExperimentTemplateAction))
-> Parser
     (Maybe [ExperimentTemplateStopCondition]
      -> Maybe (HashMap Text ExperimentTemplateTarget)
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> ExperimentTemplate)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text
-> Parser (Maybe (Maybe (HashMap Text ExperimentTemplateAction)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"actions" Parser (Maybe (Maybe (HashMap Text ExperimentTemplateAction)))
-> Maybe (HashMap Text ExperimentTemplateAction)
-> Parser (Maybe (HashMap Text ExperimentTemplateAction))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text ExperimentTemplateAction)
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe [ExperimentTemplateStopCondition]
   -> Maybe (HashMap Text ExperimentTemplateTarget)
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Maybe Text
   -> ExperimentTemplate)
-> Parser (Maybe [ExperimentTemplateStopCondition])
-> Parser
     (Maybe (HashMap Text ExperimentTemplateTarget)
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> ExperimentTemplate)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text -> Parser (Maybe (Maybe [ExperimentTemplateStopCondition]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"stopConditions" Parser (Maybe (Maybe [ExperimentTemplateStopCondition]))
-> Maybe [ExperimentTemplateStopCondition]
-> Parser (Maybe [ExperimentTemplateStopCondition])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [ExperimentTemplateStopCondition]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe (HashMap Text ExperimentTemplateTarget)
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Maybe Text
   -> ExperimentTemplate)
-> Parser (Maybe (HashMap Text ExperimentTemplateTarget))
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> ExperimentTemplate)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text
-> Parser (Maybe (Maybe (HashMap Text ExperimentTemplateTarget)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"targets" Parser (Maybe (Maybe (HashMap Text ExperimentTemplateTarget)))
-> Maybe (HashMap Text ExperimentTemplateTarget)
-> Parser (Maybe (HashMap Text ExperimentTemplateTarget))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text ExperimentTemplateTarget)
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Maybe Text
   -> ExperimentTemplate)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> ExperimentTemplate)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"id")
            Parser
  (Maybe POSIX
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Maybe Text
   -> ExperimentTemplate)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe (HashMap Text Text) -> Maybe Text -> ExperimentTemplate)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"lastUpdateTime")
            Parser
  (Maybe Text
   -> Maybe (HashMap Text Text) -> Maybe Text -> ExperimentTemplate)
-> Parser (Maybe Text)
-> Parser
     (Maybe (HashMap Text Text) -> Maybe Text -> ExperimentTemplate)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"description")
            Parser
  (Maybe (HashMap Text Text) -> Maybe Text -> ExperimentTemplate)
-> Parser (Maybe (HashMap Text Text))
-> Parser (Maybe Text -> ExperimentTemplate)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"tags" Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
            Parser (Maybe Text -> ExperimentTemplate)
-> Parser (Maybe Text) -> Parser ExperimentTemplate
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"roleArn")
      )

instance Prelude.Hashable ExperimentTemplate

instance Prelude.NFData ExperimentTemplate