{-# 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.UpdateExperimentTemplateActionInputItem
-- 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.UpdateExperimentTemplateActionInputItem where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Specifies an action for an experiment template.
--
-- /See:/ 'newUpdateExperimentTemplateActionInputItem' smart constructor.
data UpdateExperimentTemplateActionInputItem = UpdateExperimentTemplateActionInputItem'
  { -- | The name of the action that must be completed before the current action
    -- starts. Omit this parameter to run the action at the start of the
    -- experiment.
    UpdateExperimentTemplateActionInputItem -> Maybe [Text]
startAfter :: Prelude.Maybe [Prelude.Text],
    -- | The ID of the action.
    UpdateExperimentTemplateActionInputItem -> Maybe Text
actionId :: Prelude.Maybe Prelude.Text,
    -- | The parameters for the action, if applicable.
    UpdateExperimentTemplateActionInputItem
-> Maybe (HashMap Text Text)
parameters :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The targets for the action.
    UpdateExperimentTemplateActionInputItem
-> Maybe (HashMap Text Text)
targets :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | A description for the action.
    UpdateExperimentTemplateActionInputItem -> Maybe Text
description :: Prelude.Maybe Prelude.Text
  }
  deriving (UpdateExperimentTemplateActionInputItem
-> UpdateExperimentTemplateActionInputItem -> Bool
(UpdateExperimentTemplateActionInputItem
 -> UpdateExperimentTemplateActionInputItem -> Bool)
-> (UpdateExperimentTemplateActionInputItem
    -> UpdateExperimentTemplateActionInputItem -> Bool)
-> Eq UpdateExperimentTemplateActionInputItem
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateExperimentTemplateActionInputItem
-> UpdateExperimentTemplateActionInputItem -> Bool
$c/= :: UpdateExperimentTemplateActionInputItem
-> UpdateExperimentTemplateActionInputItem -> Bool
== :: UpdateExperimentTemplateActionInputItem
-> UpdateExperimentTemplateActionInputItem -> Bool
$c== :: UpdateExperimentTemplateActionInputItem
-> UpdateExperimentTemplateActionInputItem -> Bool
Prelude.Eq, ReadPrec [UpdateExperimentTemplateActionInputItem]
ReadPrec UpdateExperimentTemplateActionInputItem
Int -> ReadS UpdateExperimentTemplateActionInputItem
ReadS [UpdateExperimentTemplateActionInputItem]
(Int -> ReadS UpdateExperimentTemplateActionInputItem)
-> ReadS [UpdateExperimentTemplateActionInputItem]
-> ReadPrec UpdateExperimentTemplateActionInputItem
-> ReadPrec [UpdateExperimentTemplateActionInputItem]
-> Read UpdateExperimentTemplateActionInputItem
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateExperimentTemplateActionInputItem]
$creadListPrec :: ReadPrec [UpdateExperimentTemplateActionInputItem]
readPrec :: ReadPrec UpdateExperimentTemplateActionInputItem
$creadPrec :: ReadPrec UpdateExperimentTemplateActionInputItem
readList :: ReadS [UpdateExperimentTemplateActionInputItem]
$creadList :: ReadS [UpdateExperimentTemplateActionInputItem]
readsPrec :: Int -> ReadS UpdateExperimentTemplateActionInputItem
$creadsPrec :: Int -> ReadS UpdateExperimentTemplateActionInputItem
Prelude.Read, Int -> UpdateExperimentTemplateActionInputItem -> ShowS
[UpdateExperimentTemplateActionInputItem] -> ShowS
UpdateExperimentTemplateActionInputItem -> String
(Int -> UpdateExperimentTemplateActionInputItem -> ShowS)
-> (UpdateExperimentTemplateActionInputItem -> String)
-> ([UpdateExperimentTemplateActionInputItem] -> ShowS)
-> Show UpdateExperimentTemplateActionInputItem
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateExperimentTemplateActionInputItem] -> ShowS
$cshowList :: [UpdateExperimentTemplateActionInputItem] -> ShowS
show :: UpdateExperimentTemplateActionInputItem -> String
$cshow :: UpdateExperimentTemplateActionInputItem -> String
showsPrec :: Int -> UpdateExperimentTemplateActionInputItem -> ShowS
$cshowsPrec :: Int -> UpdateExperimentTemplateActionInputItem -> ShowS
Prelude.Show, (forall x.
 UpdateExperimentTemplateActionInputItem
 -> Rep UpdateExperimentTemplateActionInputItem x)
-> (forall x.
    Rep UpdateExperimentTemplateActionInputItem x
    -> UpdateExperimentTemplateActionInputItem)
-> Generic UpdateExperimentTemplateActionInputItem
forall x.
Rep UpdateExperimentTemplateActionInputItem x
-> UpdateExperimentTemplateActionInputItem
forall x.
UpdateExperimentTemplateActionInputItem
-> Rep UpdateExperimentTemplateActionInputItem x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateExperimentTemplateActionInputItem x
-> UpdateExperimentTemplateActionInputItem
$cfrom :: forall x.
UpdateExperimentTemplateActionInputItem
-> Rep UpdateExperimentTemplateActionInputItem x
Prelude.Generic)

-- |
-- Create a value of 'UpdateExperimentTemplateActionInputItem' 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:
--
-- 'startAfter', 'updateExperimentTemplateActionInputItem_startAfter' - The name of the action that must be completed before the current action
-- starts. Omit this parameter to run the action at the start of the
-- experiment.
--
-- 'actionId', 'updateExperimentTemplateActionInputItem_actionId' - The ID of the action.
--
-- 'parameters', 'updateExperimentTemplateActionInputItem_parameters' - The parameters for the action, if applicable.
--
-- 'targets', 'updateExperimentTemplateActionInputItem_targets' - The targets for the action.
--
-- 'description', 'updateExperimentTemplateActionInputItem_description' - A description for the action.
newUpdateExperimentTemplateActionInputItem ::
  UpdateExperimentTemplateActionInputItem
newUpdateExperimentTemplateActionInputItem :: UpdateExperimentTemplateActionInputItem
newUpdateExperimentTemplateActionInputItem =
  UpdateExperimentTemplateActionInputItem' :: Maybe [Text]
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe (HashMap Text Text)
-> Maybe Text
-> UpdateExperimentTemplateActionInputItem
UpdateExperimentTemplateActionInputItem'
    { $sel:startAfter:UpdateExperimentTemplateActionInputItem' :: Maybe [Text]
startAfter =
        Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:actionId:UpdateExperimentTemplateActionInputItem' :: Maybe Text
actionId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:parameters:UpdateExperimentTemplateActionInputItem' :: Maybe (HashMap Text Text)
parameters = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:targets:UpdateExperimentTemplateActionInputItem' :: Maybe (HashMap Text Text)
targets = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:description:UpdateExperimentTemplateActionInputItem' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The name of the action that must be completed before the current action
-- starts. Omit this parameter to run the action at the start of the
-- experiment.
updateExperimentTemplateActionInputItem_startAfter :: Lens.Lens' UpdateExperimentTemplateActionInputItem (Prelude.Maybe [Prelude.Text])
updateExperimentTemplateActionInputItem_startAfter :: (Maybe [Text] -> f (Maybe [Text]))
-> UpdateExperimentTemplateActionInputItem
-> f UpdateExperimentTemplateActionInputItem
updateExperimentTemplateActionInputItem_startAfter = (UpdateExperimentTemplateActionInputItem -> Maybe [Text])
-> (UpdateExperimentTemplateActionInputItem
    -> Maybe [Text] -> UpdateExperimentTemplateActionInputItem)
-> Lens
     UpdateExperimentTemplateActionInputItem
     UpdateExperimentTemplateActionInputItem
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateExperimentTemplateActionInputItem' {Maybe [Text]
startAfter :: Maybe [Text]
$sel:startAfter:UpdateExperimentTemplateActionInputItem' :: UpdateExperimentTemplateActionInputItem -> Maybe [Text]
startAfter} -> Maybe [Text]
startAfter) (\s :: UpdateExperimentTemplateActionInputItem
s@UpdateExperimentTemplateActionInputItem' {} Maybe [Text]
a -> UpdateExperimentTemplateActionInputItem
s {$sel:startAfter:UpdateExperimentTemplateActionInputItem' :: Maybe [Text]
startAfter = Maybe [Text]
a} :: UpdateExperimentTemplateActionInputItem) ((Maybe [Text] -> f (Maybe [Text]))
 -> UpdateExperimentTemplateActionInputItem
 -> f UpdateExperimentTemplateActionInputItem)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> UpdateExperimentTemplateActionInputItem
-> f UpdateExperimentTemplateActionInputItem
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The ID of the action.
updateExperimentTemplateActionInputItem_actionId :: Lens.Lens' UpdateExperimentTemplateActionInputItem (Prelude.Maybe Prelude.Text)
updateExperimentTemplateActionInputItem_actionId :: (Maybe Text -> f (Maybe Text))
-> UpdateExperimentTemplateActionInputItem
-> f UpdateExperimentTemplateActionInputItem
updateExperimentTemplateActionInputItem_actionId = (UpdateExperimentTemplateActionInputItem -> Maybe Text)
-> (UpdateExperimentTemplateActionInputItem
    -> Maybe Text -> UpdateExperimentTemplateActionInputItem)
-> Lens
     UpdateExperimentTemplateActionInputItem
     UpdateExperimentTemplateActionInputItem
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateExperimentTemplateActionInputItem' {Maybe Text
actionId :: Maybe Text
$sel:actionId:UpdateExperimentTemplateActionInputItem' :: UpdateExperimentTemplateActionInputItem -> Maybe Text
actionId} -> Maybe Text
actionId) (\s :: UpdateExperimentTemplateActionInputItem
s@UpdateExperimentTemplateActionInputItem' {} Maybe Text
a -> UpdateExperimentTemplateActionInputItem
s {$sel:actionId:UpdateExperimentTemplateActionInputItem' :: Maybe Text
actionId = Maybe Text
a} :: UpdateExperimentTemplateActionInputItem)

-- | The parameters for the action, if applicable.
updateExperimentTemplateActionInputItem_parameters :: Lens.Lens' UpdateExperimentTemplateActionInputItem (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
updateExperimentTemplateActionInputItem_parameters :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> UpdateExperimentTemplateActionInputItem
-> f UpdateExperimentTemplateActionInputItem
updateExperimentTemplateActionInputItem_parameters = (UpdateExperimentTemplateActionInputItem
 -> Maybe (HashMap Text Text))
-> (UpdateExperimentTemplateActionInputItem
    -> Maybe (HashMap Text Text)
    -> UpdateExperimentTemplateActionInputItem)
-> Lens
     UpdateExperimentTemplateActionInputItem
     UpdateExperimentTemplateActionInputItem
     (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 (\UpdateExperimentTemplateActionInputItem' {Maybe (HashMap Text Text)
parameters :: Maybe (HashMap Text Text)
$sel:parameters:UpdateExperimentTemplateActionInputItem' :: UpdateExperimentTemplateActionInputItem
-> Maybe (HashMap Text Text)
parameters} -> Maybe (HashMap Text Text)
parameters) (\s :: UpdateExperimentTemplateActionInputItem
s@UpdateExperimentTemplateActionInputItem' {} Maybe (HashMap Text Text)
a -> UpdateExperimentTemplateActionInputItem
s {$sel:parameters:UpdateExperimentTemplateActionInputItem' :: Maybe (HashMap Text Text)
parameters = Maybe (HashMap Text Text)
a} :: UpdateExperimentTemplateActionInputItem) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> UpdateExperimentTemplateActionInputItem
 -> f UpdateExperimentTemplateActionInputItem)
-> ((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)))
-> UpdateExperimentTemplateActionInputItem
-> f UpdateExperimentTemplateActionInputItem
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 targets for the action.
updateExperimentTemplateActionInputItem_targets :: Lens.Lens' UpdateExperimentTemplateActionInputItem (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
updateExperimentTemplateActionInputItem_targets :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> UpdateExperimentTemplateActionInputItem
-> f UpdateExperimentTemplateActionInputItem
updateExperimentTemplateActionInputItem_targets = (UpdateExperimentTemplateActionInputItem
 -> Maybe (HashMap Text Text))
-> (UpdateExperimentTemplateActionInputItem
    -> Maybe (HashMap Text Text)
    -> UpdateExperimentTemplateActionInputItem)
-> Lens
     UpdateExperimentTemplateActionInputItem
     UpdateExperimentTemplateActionInputItem
     (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 (\UpdateExperimentTemplateActionInputItem' {Maybe (HashMap Text Text)
targets :: Maybe (HashMap Text Text)
$sel:targets:UpdateExperimentTemplateActionInputItem' :: UpdateExperimentTemplateActionInputItem
-> Maybe (HashMap Text Text)
targets} -> Maybe (HashMap Text Text)
targets) (\s :: UpdateExperimentTemplateActionInputItem
s@UpdateExperimentTemplateActionInputItem' {} Maybe (HashMap Text Text)
a -> UpdateExperimentTemplateActionInputItem
s {$sel:targets:UpdateExperimentTemplateActionInputItem' :: Maybe (HashMap Text Text)
targets = Maybe (HashMap Text Text)
a} :: UpdateExperimentTemplateActionInputItem) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> UpdateExperimentTemplateActionInputItem
 -> f UpdateExperimentTemplateActionInputItem)
-> ((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)))
-> UpdateExperimentTemplateActionInputItem
-> f UpdateExperimentTemplateActionInputItem
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

-- | A description for the action.
updateExperimentTemplateActionInputItem_description :: Lens.Lens' UpdateExperimentTemplateActionInputItem (Prelude.Maybe Prelude.Text)
updateExperimentTemplateActionInputItem_description :: (Maybe Text -> f (Maybe Text))
-> UpdateExperimentTemplateActionInputItem
-> f UpdateExperimentTemplateActionInputItem
updateExperimentTemplateActionInputItem_description = (UpdateExperimentTemplateActionInputItem -> Maybe Text)
-> (UpdateExperimentTemplateActionInputItem
    -> Maybe Text -> UpdateExperimentTemplateActionInputItem)
-> Lens
     UpdateExperimentTemplateActionInputItem
     UpdateExperimentTemplateActionInputItem
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateExperimentTemplateActionInputItem' {Maybe Text
description :: Maybe Text
$sel:description:UpdateExperimentTemplateActionInputItem' :: UpdateExperimentTemplateActionInputItem -> Maybe Text
description} -> Maybe Text
description) (\s :: UpdateExperimentTemplateActionInputItem
s@UpdateExperimentTemplateActionInputItem' {} Maybe Text
a -> UpdateExperimentTemplateActionInputItem
s {$sel:description:UpdateExperimentTemplateActionInputItem' :: Maybe Text
description = Maybe Text
a} :: UpdateExperimentTemplateActionInputItem)

instance
  Prelude.Hashable
    UpdateExperimentTemplateActionInputItem

instance
  Prelude.NFData
    UpdateExperimentTemplateActionInputItem

instance
  Core.ToJSON
    UpdateExperimentTemplateActionInputItem
  where
  toJSON :: UpdateExperimentTemplateActionInputItem -> Value
toJSON UpdateExperimentTemplateActionInputItem' {Maybe [Text]
Maybe Text
Maybe (HashMap Text Text)
description :: Maybe Text
targets :: Maybe (HashMap Text Text)
parameters :: Maybe (HashMap Text Text)
actionId :: Maybe Text
startAfter :: Maybe [Text]
$sel:description:UpdateExperimentTemplateActionInputItem' :: UpdateExperimentTemplateActionInputItem -> Maybe Text
$sel:targets:UpdateExperimentTemplateActionInputItem' :: UpdateExperimentTemplateActionInputItem
-> Maybe (HashMap Text Text)
$sel:parameters:UpdateExperimentTemplateActionInputItem' :: UpdateExperimentTemplateActionInputItem
-> Maybe (HashMap Text Text)
$sel:actionId:UpdateExperimentTemplateActionInputItem' :: UpdateExperimentTemplateActionInputItem -> Maybe Text
$sel:startAfter:UpdateExperimentTemplateActionInputItem' :: UpdateExperimentTemplateActionInputItem -> Maybe [Text]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"startAfter" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Text] -> Pair) -> Maybe [Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
startAfter,
            (Text
"actionId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
actionId,
            (Text
"parameters" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
parameters,
            (Text
"targets" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
targets,
            (Text
"description" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
description
          ]
      )