{-# 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.SSM.Types.ComplianceExecutionSummary where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ComplianceExecutionSummary = ComplianceExecutionSummary'
{
ComplianceExecutionSummary -> Maybe Text
executionId :: Prelude.Maybe Prelude.Text,
ComplianceExecutionSummary -> Maybe Text
executionType :: Prelude.Maybe Prelude.Text,
ComplianceExecutionSummary -> POSIX
executionTime :: Core.POSIX
}
deriving (ComplianceExecutionSummary -> ComplianceExecutionSummary -> Bool
(ComplianceExecutionSummary -> ComplianceExecutionSummary -> Bool)
-> (ComplianceExecutionSummary
-> ComplianceExecutionSummary -> Bool)
-> Eq ComplianceExecutionSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ComplianceExecutionSummary -> ComplianceExecutionSummary -> Bool
$c/= :: ComplianceExecutionSummary -> ComplianceExecutionSummary -> Bool
== :: ComplianceExecutionSummary -> ComplianceExecutionSummary -> Bool
$c== :: ComplianceExecutionSummary -> ComplianceExecutionSummary -> Bool
Prelude.Eq, ReadPrec [ComplianceExecutionSummary]
ReadPrec ComplianceExecutionSummary
Int -> ReadS ComplianceExecutionSummary
ReadS [ComplianceExecutionSummary]
(Int -> ReadS ComplianceExecutionSummary)
-> ReadS [ComplianceExecutionSummary]
-> ReadPrec ComplianceExecutionSummary
-> ReadPrec [ComplianceExecutionSummary]
-> Read ComplianceExecutionSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ComplianceExecutionSummary]
$creadListPrec :: ReadPrec [ComplianceExecutionSummary]
readPrec :: ReadPrec ComplianceExecutionSummary
$creadPrec :: ReadPrec ComplianceExecutionSummary
readList :: ReadS [ComplianceExecutionSummary]
$creadList :: ReadS [ComplianceExecutionSummary]
readsPrec :: Int -> ReadS ComplianceExecutionSummary
$creadsPrec :: Int -> ReadS ComplianceExecutionSummary
Prelude.Read, Int -> ComplianceExecutionSummary -> ShowS
[ComplianceExecutionSummary] -> ShowS
ComplianceExecutionSummary -> String
(Int -> ComplianceExecutionSummary -> ShowS)
-> (ComplianceExecutionSummary -> String)
-> ([ComplianceExecutionSummary] -> ShowS)
-> Show ComplianceExecutionSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ComplianceExecutionSummary] -> ShowS
$cshowList :: [ComplianceExecutionSummary] -> ShowS
show :: ComplianceExecutionSummary -> String
$cshow :: ComplianceExecutionSummary -> String
showsPrec :: Int -> ComplianceExecutionSummary -> ShowS
$cshowsPrec :: Int -> ComplianceExecutionSummary -> ShowS
Prelude.Show, (forall x.
ComplianceExecutionSummary -> Rep ComplianceExecutionSummary x)
-> (forall x.
Rep ComplianceExecutionSummary x -> ComplianceExecutionSummary)
-> Generic ComplianceExecutionSummary
forall x.
Rep ComplianceExecutionSummary x -> ComplianceExecutionSummary
forall x.
ComplianceExecutionSummary -> Rep ComplianceExecutionSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ComplianceExecutionSummary x -> ComplianceExecutionSummary
$cfrom :: forall x.
ComplianceExecutionSummary -> Rep ComplianceExecutionSummary x
Prelude.Generic)
newComplianceExecutionSummary ::
Prelude.UTCTime ->
ComplianceExecutionSummary
newComplianceExecutionSummary :: UTCTime -> ComplianceExecutionSummary
newComplianceExecutionSummary UTCTime
pExecutionTime_ =
ComplianceExecutionSummary' :: Maybe Text -> Maybe Text -> POSIX -> ComplianceExecutionSummary
ComplianceExecutionSummary'
{ $sel:executionId:ComplianceExecutionSummary' :: Maybe Text
executionId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:executionType:ComplianceExecutionSummary' :: Maybe Text
executionType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:executionTime:ComplianceExecutionSummary' :: POSIX
executionTime =
Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
-> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pExecutionTime_
}
complianceExecutionSummary_executionId :: Lens.Lens' ComplianceExecutionSummary (Prelude.Maybe Prelude.Text)
complianceExecutionSummary_executionId :: (Maybe Text -> f (Maybe Text))
-> ComplianceExecutionSummary -> f ComplianceExecutionSummary
complianceExecutionSummary_executionId = (ComplianceExecutionSummary -> Maybe Text)
-> (ComplianceExecutionSummary
-> Maybe Text -> ComplianceExecutionSummary)
-> Lens
ComplianceExecutionSummary
ComplianceExecutionSummary
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComplianceExecutionSummary' {Maybe Text
executionId :: Maybe Text
$sel:executionId:ComplianceExecutionSummary' :: ComplianceExecutionSummary -> Maybe Text
executionId} -> Maybe Text
executionId) (\s :: ComplianceExecutionSummary
s@ComplianceExecutionSummary' {} Maybe Text
a -> ComplianceExecutionSummary
s {$sel:executionId:ComplianceExecutionSummary' :: Maybe Text
executionId = Maybe Text
a} :: ComplianceExecutionSummary)
complianceExecutionSummary_executionType :: Lens.Lens' ComplianceExecutionSummary (Prelude.Maybe Prelude.Text)
complianceExecutionSummary_executionType :: (Maybe Text -> f (Maybe Text))
-> ComplianceExecutionSummary -> f ComplianceExecutionSummary
complianceExecutionSummary_executionType = (ComplianceExecutionSummary -> Maybe Text)
-> (ComplianceExecutionSummary
-> Maybe Text -> ComplianceExecutionSummary)
-> Lens
ComplianceExecutionSummary
ComplianceExecutionSummary
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComplianceExecutionSummary' {Maybe Text
executionType :: Maybe Text
$sel:executionType:ComplianceExecutionSummary' :: ComplianceExecutionSummary -> Maybe Text
executionType} -> Maybe Text
executionType) (\s :: ComplianceExecutionSummary
s@ComplianceExecutionSummary' {} Maybe Text
a -> ComplianceExecutionSummary
s {$sel:executionType:ComplianceExecutionSummary' :: Maybe Text
executionType = Maybe Text
a} :: ComplianceExecutionSummary)
complianceExecutionSummary_executionTime :: Lens.Lens' ComplianceExecutionSummary Prelude.UTCTime
complianceExecutionSummary_executionTime :: (UTCTime -> f UTCTime)
-> ComplianceExecutionSummary -> f ComplianceExecutionSummary
complianceExecutionSummary_executionTime = (ComplianceExecutionSummary -> POSIX)
-> (ComplianceExecutionSummary
-> POSIX -> ComplianceExecutionSummary)
-> Lens
ComplianceExecutionSummary ComplianceExecutionSummary POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComplianceExecutionSummary' {POSIX
executionTime :: POSIX
$sel:executionTime:ComplianceExecutionSummary' :: ComplianceExecutionSummary -> POSIX
executionTime} -> POSIX
executionTime) (\s :: ComplianceExecutionSummary
s@ComplianceExecutionSummary' {} POSIX
a -> ComplianceExecutionSummary
s {$sel:executionTime:ComplianceExecutionSummary' :: POSIX
executionTime = POSIX
a} :: ComplianceExecutionSummary) ((POSIX -> f POSIX)
-> ComplianceExecutionSummary -> f ComplianceExecutionSummary)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> ComplianceExecutionSummary
-> f ComplianceExecutionSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
instance Core.FromJSON ComplianceExecutionSummary where
parseJSON :: Value -> Parser ComplianceExecutionSummary
parseJSON =
String
-> (Object -> Parser ComplianceExecutionSummary)
-> Value
-> Parser ComplianceExecutionSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ComplianceExecutionSummary"
( \Object
x ->
Maybe Text -> Maybe Text -> POSIX -> ComplianceExecutionSummary
ComplianceExecutionSummary'
(Maybe Text -> Maybe Text -> POSIX -> ComplianceExecutionSummary)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> POSIX -> ComplianceExecutionSummary)
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
"ExecutionId")
Parser (Maybe Text -> POSIX -> ComplianceExecutionSummary)
-> Parser (Maybe Text)
-> Parser (POSIX -> ComplianceExecutionSummary)
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
"ExecutionType")
Parser (POSIX -> ComplianceExecutionSummary)
-> Parser POSIX -> Parser ComplianceExecutionSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser POSIX
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ExecutionTime")
)
instance Prelude.Hashable ComplianceExecutionSummary
instance Prelude.NFData ComplianceExecutionSummary
instance Core.ToJSON ComplianceExecutionSummary where
toJSON :: ComplianceExecutionSummary -> Value
toJSON ComplianceExecutionSummary' {Maybe Text
POSIX
executionTime :: POSIX
executionType :: Maybe Text
executionId :: Maybe Text
$sel:executionTime:ComplianceExecutionSummary' :: ComplianceExecutionSummary -> POSIX
$sel:executionType:ComplianceExecutionSummary' :: ComplianceExecutionSummary -> Maybe Text
$sel:executionId:ComplianceExecutionSummary' :: ComplianceExecutionSummary -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"ExecutionId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
executionId,
(Text
"ExecutionType" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
executionType,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"ExecutionTime" Text -> POSIX -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= POSIX
executionTime)
]
)