{-# 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 #-}
module Amazonka.FIS.Types.ExperimentActionState where
import qualified Amazonka.Core as Core
import Amazonka.FIS.Types.ExperimentActionStatus
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ExperimentActionState = ExperimentActionState'
{
ExperimentActionState -> Maybe ExperimentActionStatus
status :: Prelude.Maybe ExperimentActionStatus,
ExperimentActionState -> Maybe Text
reason :: Prelude.Maybe Prelude.Text
}
deriving (ExperimentActionState -> ExperimentActionState -> Bool
(ExperimentActionState -> ExperimentActionState -> Bool)
-> (ExperimentActionState -> ExperimentActionState -> Bool)
-> Eq ExperimentActionState
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExperimentActionState -> ExperimentActionState -> Bool
$c/= :: ExperimentActionState -> ExperimentActionState -> Bool
== :: ExperimentActionState -> ExperimentActionState -> Bool
$c== :: ExperimentActionState -> ExperimentActionState -> Bool
Prelude.Eq, ReadPrec [ExperimentActionState]
ReadPrec ExperimentActionState
Int -> ReadS ExperimentActionState
ReadS [ExperimentActionState]
(Int -> ReadS ExperimentActionState)
-> ReadS [ExperimentActionState]
-> ReadPrec ExperimentActionState
-> ReadPrec [ExperimentActionState]
-> Read ExperimentActionState
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ExperimentActionState]
$creadListPrec :: ReadPrec [ExperimentActionState]
readPrec :: ReadPrec ExperimentActionState
$creadPrec :: ReadPrec ExperimentActionState
readList :: ReadS [ExperimentActionState]
$creadList :: ReadS [ExperimentActionState]
readsPrec :: Int -> ReadS ExperimentActionState
$creadsPrec :: Int -> ReadS ExperimentActionState
Prelude.Read, Int -> ExperimentActionState -> ShowS
[ExperimentActionState] -> ShowS
ExperimentActionState -> String
(Int -> ExperimentActionState -> ShowS)
-> (ExperimentActionState -> String)
-> ([ExperimentActionState] -> ShowS)
-> Show ExperimentActionState
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ExperimentActionState] -> ShowS
$cshowList :: [ExperimentActionState] -> ShowS
show :: ExperimentActionState -> String
$cshow :: ExperimentActionState -> String
showsPrec :: Int -> ExperimentActionState -> ShowS
$cshowsPrec :: Int -> ExperimentActionState -> ShowS
Prelude.Show, (forall x. ExperimentActionState -> Rep ExperimentActionState x)
-> (forall x. Rep ExperimentActionState x -> ExperimentActionState)
-> Generic ExperimentActionState
forall x. Rep ExperimentActionState x -> ExperimentActionState
forall x. ExperimentActionState -> Rep ExperimentActionState x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ExperimentActionState x -> ExperimentActionState
$cfrom :: forall x. ExperimentActionState -> Rep ExperimentActionState x
Prelude.Generic)
newExperimentActionState ::
ExperimentActionState
newExperimentActionState :: ExperimentActionState
newExperimentActionState =
ExperimentActionState' :: Maybe ExperimentActionStatus -> Maybe Text -> ExperimentActionState
ExperimentActionState'
{ $sel:status:ExperimentActionState' :: Maybe ExperimentActionStatus
status = Maybe ExperimentActionStatus
forall a. Maybe a
Prelude.Nothing,
$sel:reason:ExperimentActionState' :: Maybe Text
reason = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
experimentActionState_status :: Lens.Lens' ExperimentActionState (Prelude.Maybe ExperimentActionStatus)
experimentActionState_status :: (Maybe ExperimentActionStatus -> f (Maybe ExperimentActionStatus))
-> ExperimentActionState -> f ExperimentActionState
experimentActionState_status = (ExperimentActionState -> Maybe ExperimentActionStatus)
-> (ExperimentActionState
-> Maybe ExperimentActionStatus -> ExperimentActionState)
-> Lens
ExperimentActionState
ExperimentActionState
(Maybe ExperimentActionStatus)
(Maybe ExperimentActionStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExperimentActionState' {Maybe ExperimentActionStatus
status :: Maybe ExperimentActionStatus
$sel:status:ExperimentActionState' :: ExperimentActionState -> Maybe ExperimentActionStatus
status} -> Maybe ExperimentActionStatus
status) (\s :: ExperimentActionState
s@ExperimentActionState' {} Maybe ExperimentActionStatus
a -> ExperimentActionState
s {$sel:status:ExperimentActionState' :: Maybe ExperimentActionStatus
status = Maybe ExperimentActionStatus
a} :: ExperimentActionState)
experimentActionState_reason :: Lens.Lens' ExperimentActionState (Prelude.Maybe Prelude.Text)
experimentActionState_reason :: (Maybe Text -> f (Maybe Text))
-> ExperimentActionState -> f ExperimentActionState
experimentActionState_reason = (ExperimentActionState -> Maybe Text)
-> (ExperimentActionState -> Maybe Text -> ExperimentActionState)
-> Lens
ExperimentActionState
ExperimentActionState
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExperimentActionState' {Maybe Text
reason :: Maybe Text
$sel:reason:ExperimentActionState' :: ExperimentActionState -> Maybe Text
reason} -> Maybe Text
reason) (\s :: ExperimentActionState
s@ExperimentActionState' {} Maybe Text
a -> ExperimentActionState
s {$sel:reason:ExperimentActionState' :: Maybe Text
reason = Maybe Text
a} :: ExperimentActionState)
instance Core.FromJSON ExperimentActionState where
parseJSON :: Value -> Parser ExperimentActionState
parseJSON =
String
-> (Object -> Parser ExperimentActionState)
-> Value
-> Parser ExperimentActionState
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ExperimentActionState"
( \Object
x ->
Maybe ExperimentActionStatus -> Maybe Text -> ExperimentActionState
ExperimentActionState'
(Maybe ExperimentActionStatus
-> Maybe Text -> ExperimentActionState)
-> Parser (Maybe ExperimentActionStatus)
-> Parser (Maybe Text -> ExperimentActionState)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ExperimentActionStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"status")
Parser (Maybe Text -> ExperimentActionState)
-> Parser (Maybe Text) -> Parser ExperimentActionState
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
"reason")
)
instance Prelude.Hashable ExperimentActionState
instance Prelude.NFData ExperimentActionState