{-# 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.Config.Types.RemediationExecutionStatus where
import Amazonka.Config.Types.RemediationExecutionState
import Amazonka.Config.Types.RemediationExecutionStep
import Amazonka.Config.Types.ResourceKey
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data RemediationExecutionStatus = RemediationExecutionStatus'
{
RemediationExecutionStatus -> Maybe RemediationExecutionState
state :: Prelude.Maybe RemediationExecutionState,
RemediationExecutionStatus -> Maybe POSIX
lastUpdatedTime :: Prelude.Maybe Core.POSIX,
RemediationExecutionStatus -> Maybe ResourceKey
resourceKey :: Prelude.Maybe ResourceKey,
RemediationExecutionStatus -> Maybe [RemediationExecutionStep]
stepDetails :: Prelude.Maybe [RemediationExecutionStep],
RemediationExecutionStatus -> Maybe POSIX
invocationTime :: Prelude.Maybe Core.POSIX
}
deriving (RemediationExecutionStatus -> RemediationExecutionStatus -> Bool
(RemediationExecutionStatus -> RemediationExecutionStatus -> Bool)
-> (RemediationExecutionStatus
-> RemediationExecutionStatus -> Bool)
-> Eq RemediationExecutionStatus
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RemediationExecutionStatus -> RemediationExecutionStatus -> Bool
$c/= :: RemediationExecutionStatus -> RemediationExecutionStatus -> Bool
== :: RemediationExecutionStatus -> RemediationExecutionStatus -> Bool
$c== :: RemediationExecutionStatus -> RemediationExecutionStatus -> Bool
Prelude.Eq, ReadPrec [RemediationExecutionStatus]
ReadPrec RemediationExecutionStatus
Int -> ReadS RemediationExecutionStatus
ReadS [RemediationExecutionStatus]
(Int -> ReadS RemediationExecutionStatus)
-> ReadS [RemediationExecutionStatus]
-> ReadPrec RemediationExecutionStatus
-> ReadPrec [RemediationExecutionStatus]
-> Read RemediationExecutionStatus
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RemediationExecutionStatus]
$creadListPrec :: ReadPrec [RemediationExecutionStatus]
readPrec :: ReadPrec RemediationExecutionStatus
$creadPrec :: ReadPrec RemediationExecutionStatus
readList :: ReadS [RemediationExecutionStatus]
$creadList :: ReadS [RemediationExecutionStatus]
readsPrec :: Int -> ReadS RemediationExecutionStatus
$creadsPrec :: Int -> ReadS RemediationExecutionStatus
Prelude.Read, Int -> RemediationExecutionStatus -> ShowS
[RemediationExecutionStatus] -> ShowS
RemediationExecutionStatus -> String
(Int -> RemediationExecutionStatus -> ShowS)
-> (RemediationExecutionStatus -> String)
-> ([RemediationExecutionStatus] -> ShowS)
-> Show RemediationExecutionStatus
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RemediationExecutionStatus] -> ShowS
$cshowList :: [RemediationExecutionStatus] -> ShowS
show :: RemediationExecutionStatus -> String
$cshow :: RemediationExecutionStatus -> String
showsPrec :: Int -> RemediationExecutionStatus -> ShowS
$cshowsPrec :: Int -> RemediationExecutionStatus -> ShowS
Prelude.Show, (forall x.
RemediationExecutionStatus -> Rep RemediationExecutionStatus x)
-> (forall x.
Rep RemediationExecutionStatus x -> RemediationExecutionStatus)
-> Generic RemediationExecutionStatus
forall x.
Rep RemediationExecutionStatus x -> RemediationExecutionStatus
forall x.
RemediationExecutionStatus -> Rep RemediationExecutionStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RemediationExecutionStatus x -> RemediationExecutionStatus
$cfrom :: forall x.
RemediationExecutionStatus -> Rep RemediationExecutionStatus x
Prelude.Generic)
newRemediationExecutionStatus ::
RemediationExecutionStatus
newRemediationExecutionStatus :: RemediationExecutionStatus
newRemediationExecutionStatus =
RemediationExecutionStatus' :: Maybe RemediationExecutionState
-> Maybe POSIX
-> Maybe ResourceKey
-> Maybe [RemediationExecutionStep]
-> Maybe POSIX
-> RemediationExecutionStatus
RemediationExecutionStatus'
{ $sel:state:RemediationExecutionStatus' :: Maybe RemediationExecutionState
state =
Maybe RemediationExecutionState
forall a. Maybe a
Prelude.Nothing,
$sel:lastUpdatedTime:RemediationExecutionStatus' :: Maybe POSIX
lastUpdatedTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:resourceKey:RemediationExecutionStatus' :: Maybe ResourceKey
resourceKey = Maybe ResourceKey
forall a. Maybe a
Prelude.Nothing,
$sel:stepDetails:RemediationExecutionStatus' :: Maybe [RemediationExecutionStep]
stepDetails = Maybe [RemediationExecutionStep]
forall a. Maybe a
Prelude.Nothing,
$sel:invocationTime:RemediationExecutionStatus' :: Maybe POSIX
invocationTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing
}
remediationExecutionStatus_state :: Lens.Lens' RemediationExecutionStatus (Prelude.Maybe RemediationExecutionState)
remediationExecutionStatus_state :: (Maybe RemediationExecutionState
-> f (Maybe RemediationExecutionState))
-> RemediationExecutionStatus -> f RemediationExecutionStatus
remediationExecutionStatus_state = (RemediationExecutionStatus -> Maybe RemediationExecutionState)
-> (RemediationExecutionStatus
-> Maybe RemediationExecutionState -> RemediationExecutionStatus)
-> Lens
RemediationExecutionStatus
RemediationExecutionStatus
(Maybe RemediationExecutionState)
(Maybe RemediationExecutionState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RemediationExecutionStatus' {Maybe RemediationExecutionState
state :: Maybe RemediationExecutionState
$sel:state:RemediationExecutionStatus' :: RemediationExecutionStatus -> Maybe RemediationExecutionState
state} -> Maybe RemediationExecutionState
state) (\s :: RemediationExecutionStatus
s@RemediationExecutionStatus' {} Maybe RemediationExecutionState
a -> RemediationExecutionStatus
s {$sel:state:RemediationExecutionStatus' :: Maybe RemediationExecutionState
state = Maybe RemediationExecutionState
a} :: RemediationExecutionStatus)
remediationExecutionStatus_lastUpdatedTime :: Lens.Lens' RemediationExecutionStatus (Prelude.Maybe Prelude.UTCTime)
remediationExecutionStatus_lastUpdatedTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> RemediationExecutionStatus -> f RemediationExecutionStatus
remediationExecutionStatus_lastUpdatedTime = (RemediationExecutionStatus -> Maybe POSIX)
-> (RemediationExecutionStatus
-> Maybe POSIX -> RemediationExecutionStatus)
-> Lens
RemediationExecutionStatus
RemediationExecutionStatus
(Maybe POSIX)
(Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RemediationExecutionStatus' {Maybe POSIX
lastUpdatedTime :: Maybe POSIX
$sel:lastUpdatedTime:RemediationExecutionStatus' :: RemediationExecutionStatus -> Maybe POSIX
lastUpdatedTime} -> Maybe POSIX
lastUpdatedTime) (\s :: RemediationExecutionStatus
s@RemediationExecutionStatus' {} Maybe POSIX
a -> RemediationExecutionStatus
s {$sel:lastUpdatedTime:RemediationExecutionStatus' :: Maybe POSIX
lastUpdatedTime = Maybe POSIX
a} :: RemediationExecutionStatus) ((Maybe POSIX -> f (Maybe POSIX))
-> RemediationExecutionStatus -> f RemediationExecutionStatus)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> RemediationExecutionStatus
-> f RemediationExecutionStatus
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
remediationExecutionStatus_resourceKey :: Lens.Lens' RemediationExecutionStatus (Prelude.Maybe ResourceKey)
remediationExecutionStatus_resourceKey :: (Maybe ResourceKey -> f (Maybe ResourceKey))
-> RemediationExecutionStatus -> f RemediationExecutionStatus
remediationExecutionStatus_resourceKey = (RemediationExecutionStatus -> Maybe ResourceKey)
-> (RemediationExecutionStatus
-> Maybe ResourceKey -> RemediationExecutionStatus)
-> Lens
RemediationExecutionStatus
RemediationExecutionStatus
(Maybe ResourceKey)
(Maybe ResourceKey)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RemediationExecutionStatus' {Maybe ResourceKey
resourceKey :: Maybe ResourceKey
$sel:resourceKey:RemediationExecutionStatus' :: RemediationExecutionStatus -> Maybe ResourceKey
resourceKey} -> Maybe ResourceKey
resourceKey) (\s :: RemediationExecutionStatus
s@RemediationExecutionStatus' {} Maybe ResourceKey
a -> RemediationExecutionStatus
s {$sel:resourceKey:RemediationExecutionStatus' :: Maybe ResourceKey
resourceKey = Maybe ResourceKey
a} :: RemediationExecutionStatus)
remediationExecutionStatus_stepDetails :: Lens.Lens' RemediationExecutionStatus (Prelude.Maybe [RemediationExecutionStep])
remediationExecutionStatus_stepDetails :: (Maybe [RemediationExecutionStep]
-> f (Maybe [RemediationExecutionStep]))
-> RemediationExecutionStatus -> f RemediationExecutionStatus
remediationExecutionStatus_stepDetails = (RemediationExecutionStatus -> Maybe [RemediationExecutionStep])
-> (RemediationExecutionStatus
-> Maybe [RemediationExecutionStep] -> RemediationExecutionStatus)
-> Lens
RemediationExecutionStatus
RemediationExecutionStatus
(Maybe [RemediationExecutionStep])
(Maybe [RemediationExecutionStep])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RemediationExecutionStatus' {Maybe [RemediationExecutionStep]
stepDetails :: Maybe [RemediationExecutionStep]
$sel:stepDetails:RemediationExecutionStatus' :: RemediationExecutionStatus -> Maybe [RemediationExecutionStep]
stepDetails} -> Maybe [RemediationExecutionStep]
stepDetails) (\s :: RemediationExecutionStatus
s@RemediationExecutionStatus' {} Maybe [RemediationExecutionStep]
a -> RemediationExecutionStatus
s {$sel:stepDetails:RemediationExecutionStatus' :: Maybe [RemediationExecutionStep]
stepDetails = Maybe [RemediationExecutionStep]
a} :: RemediationExecutionStatus) ((Maybe [RemediationExecutionStep]
-> f (Maybe [RemediationExecutionStep]))
-> RemediationExecutionStatus -> f RemediationExecutionStatus)
-> ((Maybe [RemediationExecutionStep]
-> f (Maybe [RemediationExecutionStep]))
-> Maybe [RemediationExecutionStep]
-> f (Maybe [RemediationExecutionStep]))
-> (Maybe [RemediationExecutionStep]
-> f (Maybe [RemediationExecutionStep]))
-> RemediationExecutionStatus
-> f RemediationExecutionStatus
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[RemediationExecutionStep]
[RemediationExecutionStep]
[RemediationExecutionStep]
[RemediationExecutionStep]
-> Iso
(Maybe [RemediationExecutionStep])
(Maybe [RemediationExecutionStep])
(Maybe [RemediationExecutionStep])
(Maybe [RemediationExecutionStep])
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
[RemediationExecutionStep]
[RemediationExecutionStep]
[RemediationExecutionStep]
[RemediationExecutionStep]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
remediationExecutionStatus_invocationTime :: Lens.Lens' RemediationExecutionStatus (Prelude.Maybe Prelude.UTCTime)
remediationExecutionStatus_invocationTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> RemediationExecutionStatus -> f RemediationExecutionStatus
remediationExecutionStatus_invocationTime = (RemediationExecutionStatus -> Maybe POSIX)
-> (RemediationExecutionStatus
-> Maybe POSIX -> RemediationExecutionStatus)
-> Lens
RemediationExecutionStatus
RemediationExecutionStatus
(Maybe POSIX)
(Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RemediationExecutionStatus' {Maybe POSIX
invocationTime :: Maybe POSIX
$sel:invocationTime:RemediationExecutionStatus' :: RemediationExecutionStatus -> Maybe POSIX
invocationTime} -> Maybe POSIX
invocationTime) (\s :: RemediationExecutionStatus
s@RemediationExecutionStatus' {} Maybe POSIX
a -> RemediationExecutionStatus
s {$sel:invocationTime:RemediationExecutionStatus' :: Maybe POSIX
invocationTime = Maybe POSIX
a} :: RemediationExecutionStatus) ((Maybe POSIX -> f (Maybe POSIX))
-> RemediationExecutionStatus -> f RemediationExecutionStatus)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> RemediationExecutionStatus
-> f RemediationExecutionStatus
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
instance Core.FromJSON RemediationExecutionStatus where
parseJSON :: Value -> Parser RemediationExecutionStatus
parseJSON =
String
-> (Object -> Parser RemediationExecutionStatus)
-> Value
-> Parser RemediationExecutionStatus
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"RemediationExecutionStatus"
( \Object
x ->
Maybe RemediationExecutionState
-> Maybe POSIX
-> Maybe ResourceKey
-> Maybe [RemediationExecutionStep]
-> Maybe POSIX
-> RemediationExecutionStatus
RemediationExecutionStatus'
(Maybe RemediationExecutionState
-> Maybe POSIX
-> Maybe ResourceKey
-> Maybe [RemediationExecutionStep]
-> Maybe POSIX
-> RemediationExecutionStatus)
-> Parser (Maybe RemediationExecutionState)
-> Parser
(Maybe POSIX
-> Maybe ResourceKey
-> Maybe [RemediationExecutionStep]
-> Maybe POSIX
-> RemediationExecutionStatus)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe RemediationExecutionState)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"State")
Parser
(Maybe POSIX
-> Maybe ResourceKey
-> Maybe [RemediationExecutionStep]
-> Maybe POSIX
-> RemediationExecutionStatus)
-> Parser (Maybe POSIX)
-> Parser
(Maybe ResourceKey
-> Maybe [RemediationExecutionStep]
-> Maybe POSIX
-> RemediationExecutionStatus)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LastUpdatedTime")
Parser
(Maybe ResourceKey
-> Maybe [RemediationExecutionStep]
-> Maybe POSIX
-> RemediationExecutionStatus)
-> Parser (Maybe ResourceKey)
-> Parser
(Maybe [RemediationExecutionStep]
-> Maybe POSIX -> RemediationExecutionStatus)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ResourceKey)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ResourceKey")
Parser
(Maybe [RemediationExecutionStep]
-> Maybe POSIX -> RemediationExecutionStatus)
-> Parser (Maybe [RemediationExecutionStep])
-> Parser (Maybe POSIX -> RemediationExecutionStatus)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [RemediationExecutionStep]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"StepDetails" Parser (Maybe (Maybe [RemediationExecutionStep]))
-> Maybe [RemediationExecutionStep]
-> Parser (Maybe [RemediationExecutionStep])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [RemediationExecutionStep]
forall a. Monoid a => a
Prelude.mempty)
Parser (Maybe POSIX -> RemediationExecutionStatus)
-> Parser (Maybe POSIX) -> Parser RemediationExecutionStatus
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"InvocationTime")
)
instance Prelude.Hashable RemediationExecutionStatus
instance Prelude.NFData RemediationExecutionStatus