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