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