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