{-# 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.EvaluationResult where
import Amazonka.Config.Types.ComplianceType
import Amazonka.Config.Types.EvaluationResultIdentifier
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data EvaluationResult = EvaluationResult'
{
EvaluationResult -> Maybe EvaluationResultIdentifier
evaluationResultIdentifier :: Prelude.Maybe EvaluationResultIdentifier,
EvaluationResult -> Maybe Text
annotation :: Prelude.Maybe Prelude.Text,
EvaluationResult -> Maybe POSIX
configRuleInvokedTime :: Prelude.Maybe Core.POSIX,
EvaluationResult -> Maybe POSIX
resultRecordedTime :: Prelude.Maybe Core.POSIX,
EvaluationResult -> Maybe Text
resultToken :: Prelude.Maybe Prelude.Text,
EvaluationResult -> Maybe ComplianceType
complianceType :: Prelude.Maybe ComplianceType
}
deriving (EvaluationResult -> EvaluationResult -> Bool
(EvaluationResult -> EvaluationResult -> Bool)
-> (EvaluationResult -> EvaluationResult -> Bool)
-> Eq EvaluationResult
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EvaluationResult -> EvaluationResult -> Bool
$c/= :: EvaluationResult -> EvaluationResult -> Bool
== :: EvaluationResult -> EvaluationResult -> Bool
$c== :: EvaluationResult -> EvaluationResult -> Bool
Prelude.Eq, ReadPrec [EvaluationResult]
ReadPrec EvaluationResult
Int -> ReadS EvaluationResult
ReadS [EvaluationResult]
(Int -> ReadS EvaluationResult)
-> ReadS [EvaluationResult]
-> ReadPrec EvaluationResult
-> ReadPrec [EvaluationResult]
-> Read EvaluationResult
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EvaluationResult]
$creadListPrec :: ReadPrec [EvaluationResult]
readPrec :: ReadPrec EvaluationResult
$creadPrec :: ReadPrec EvaluationResult
readList :: ReadS [EvaluationResult]
$creadList :: ReadS [EvaluationResult]
readsPrec :: Int -> ReadS EvaluationResult
$creadsPrec :: Int -> ReadS EvaluationResult
Prelude.Read, Int -> EvaluationResult -> ShowS
[EvaluationResult] -> ShowS
EvaluationResult -> String
(Int -> EvaluationResult -> ShowS)
-> (EvaluationResult -> String)
-> ([EvaluationResult] -> ShowS)
-> Show EvaluationResult
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EvaluationResult] -> ShowS
$cshowList :: [EvaluationResult] -> ShowS
show :: EvaluationResult -> String
$cshow :: EvaluationResult -> String
showsPrec :: Int -> EvaluationResult -> ShowS
$cshowsPrec :: Int -> EvaluationResult -> ShowS
Prelude.Show, (forall x. EvaluationResult -> Rep EvaluationResult x)
-> (forall x. Rep EvaluationResult x -> EvaluationResult)
-> Generic EvaluationResult
forall x. Rep EvaluationResult x -> EvaluationResult
forall x. EvaluationResult -> Rep EvaluationResult x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EvaluationResult x -> EvaluationResult
$cfrom :: forall x. EvaluationResult -> Rep EvaluationResult x
Prelude.Generic)
newEvaluationResult ::
EvaluationResult
newEvaluationResult :: EvaluationResult
newEvaluationResult =
EvaluationResult' :: Maybe EvaluationResultIdentifier
-> Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe ComplianceType
-> EvaluationResult
EvaluationResult'
{ $sel:evaluationResultIdentifier:EvaluationResult' :: Maybe EvaluationResultIdentifier
evaluationResultIdentifier =
Maybe EvaluationResultIdentifier
forall a. Maybe a
Prelude.Nothing,
$sel:annotation:EvaluationResult' :: Maybe Text
annotation = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:configRuleInvokedTime:EvaluationResult' :: Maybe POSIX
configRuleInvokedTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:resultRecordedTime:EvaluationResult' :: Maybe POSIX
resultRecordedTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:resultToken:EvaluationResult' :: Maybe Text
resultToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:complianceType:EvaluationResult' :: Maybe ComplianceType
complianceType = Maybe ComplianceType
forall a. Maybe a
Prelude.Nothing
}
evaluationResult_evaluationResultIdentifier :: Lens.Lens' EvaluationResult (Prelude.Maybe EvaluationResultIdentifier)
evaluationResult_evaluationResultIdentifier :: (Maybe EvaluationResultIdentifier
-> f (Maybe EvaluationResultIdentifier))
-> EvaluationResult -> f EvaluationResult
evaluationResult_evaluationResultIdentifier = (EvaluationResult -> Maybe EvaluationResultIdentifier)
-> (EvaluationResult
-> Maybe EvaluationResultIdentifier -> EvaluationResult)
-> Lens
EvaluationResult
EvaluationResult
(Maybe EvaluationResultIdentifier)
(Maybe EvaluationResultIdentifier)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EvaluationResult' {Maybe EvaluationResultIdentifier
evaluationResultIdentifier :: Maybe EvaluationResultIdentifier
$sel:evaluationResultIdentifier:EvaluationResult' :: EvaluationResult -> Maybe EvaluationResultIdentifier
evaluationResultIdentifier} -> Maybe EvaluationResultIdentifier
evaluationResultIdentifier) (\s :: EvaluationResult
s@EvaluationResult' {} Maybe EvaluationResultIdentifier
a -> EvaluationResult
s {$sel:evaluationResultIdentifier:EvaluationResult' :: Maybe EvaluationResultIdentifier
evaluationResultIdentifier = Maybe EvaluationResultIdentifier
a} :: EvaluationResult)
evaluationResult_annotation :: Lens.Lens' EvaluationResult (Prelude.Maybe Prelude.Text)
evaluationResult_annotation :: (Maybe Text -> f (Maybe Text))
-> EvaluationResult -> f EvaluationResult
evaluationResult_annotation = (EvaluationResult -> Maybe Text)
-> (EvaluationResult -> Maybe Text -> EvaluationResult)
-> Lens EvaluationResult EvaluationResult (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EvaluationResult' {Maybe Text
annotation :: Maybe Text
$sel:annotation:EvaluationResult' :: EvaluationResult -> Maybe Text
annotation} -> Maybe Text
annotation) (\s :: EvaluationResult
s@EvaluationResult' {} Maybe Text
a -> EvaluationResult
s {$sel:annotation:EvaluationResult' :: Maybe Text
annotation = Maybe Text
a} :: EvaluationResult)
evaluationResult_configRuleInvokedTime :: Lens.Lens' EvaluationResult (Prelude.Maybe Prelude.UTCTime)
evaluationResult_configRuleInvokedTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> EvaluationResult -> f EvaluationResult
evaluationResult_configRuleInvokedTime = (EvaluationResult -> Maybe POSIX)
-> (EvaluationResult -> Maybe POSIX -> EvaluationResult)
-> Lens
EvaluationResult EvaluationResult (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EvaluationResult' {Maybe POSIX
configRuleInvokedTime :: Maybe POSIX
$sel:configRuleInvokedTime:EvaluationResult' :: EvaluationResult -> Maybe POSIX
configRuleInvokedTime} -> Maybe POSIX
configRuleInvokedTime) (\s :: EvaluationResult
s@EvaluationResult' {} Maybe POSIX
a -> EvaluationResult
s {$sel:configRuleInvokedTime:EvaluationResult' :: Maybe POSIX
configRuleInvokedTime = Maybe POSIX
a} :: EvaluationResult) ((Maybe POSIX -> f (Maybe POSIX))
-> EvaluationResult -> f EvaluationResult)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> EvaluationResult
-> f EvaluationResult
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
evaluationResult_resultRecordedTime :: Lens.Lens' EvaluationResult (Prelude.Maybe Prelude.UTCTime)
evaluationResult_resultRecordedTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> EvaluationResult -> f EvaluationResult
evaluationResult_resultRecordedTime = (EvaluationResult -> Maybe POSIX)
-> (EvaluationResult -> Maybe POSIX -> EvaluationResult)
-> Lens
EvaluationResult EvaluationResult (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EvaluationResult' {Maybe POSIX
resultRecordedTime :: Maybe POSIX
$sel:resultRecordedTime:EvaluationResult' :: EvaluationResult -> Maybe POSIX
resultRecordedTime} -> Maybe POSIX
resultRecordedTime) (\s :: EvaluationResult
s@EvaluationResult' {} Maybe POSIX
a -> EvaluationResult
s {$sel:resultRecordedTime:EvaluationResult' :: Maybe POSIX
resultRecordedTime = Maybe POSIX
a} :: EvaluationResult) ((Maybe POSIX -> f (Maybe POSIX))
-> EvaluationResult -> f EvaluationResult)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> EvaluationResult
-> f EvaluationResult
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
evaluationResult_resultToken :: Lens.Lens' EvaluationResult (Prelude.Maybe Prelude.Text)
evaluationResult_resultToken :: (Maybe Text -> f (Maybe Text))
-> EvaluationResult -> f EvaluationResult
evaluationResult_resultToken = (EvaluationResult -> Maybe Text)
-> (EvaluationResult -> Maybe Text -> EvaluationResult)
-> Lens EvaluationResult EvaluationResult (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EvaluationResult' {Maybe Text
resultToken :: Maybe Text
$sel:resultToken:EvaluationResult' :: EvaluationResult -> Maybe Text
resultToken} -> Maybe Text
resultToken) (\s :: EvaluationResult
s@EvaluationResult' {} Maybe Text
a -> EvaluationResult
s {$sel:resultToken:EvaluationResult' :: Maybe Text
resultToken = Maybe Text
a} :: EvaluationResult)
evaluationResult_complianceType :: Lens.Lens' EvaluationResult (Prelude.Maybe ComplianceType)
evaluationResult_complianceType :: (Maybe ComplianceType -> f (Maybe ComplianceType))
-> EvaluationResult -> f EvaluationResult
evaluationResult_complianceType = (EvaluationResult -> Maybe ComplianceType)
-> (EvaluationResult -> Maybe ComplianceType -> EvaluationResult)
-> Lens
EvaluationResult
EvaluationResult
(Maybe ComplianceType)
(Maybe ComplianceType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EvaluationResult' {Maybe ComplianceType
complianceType :: Maybe ComplianceType
$sel:complianceType:EvaluationResult' :: EvaluationResult -> Maybe ComplianceType
complianceType} -> Maybe ComplianceType
complianceType) (\s :: EvaluationResult
s@EvaluationResult' {} Maybe ComplianceType
a -> EvaluationResult
s {$sel:complianceType:EvaluationResult' :: Maybe ComplianceType
complianceType = Maybe ComplianceType
a} :: EvaluationResult)
instance Core.FromJSON EvaluationResult where
parseJSON :: Value -> Parser EvaluationResult
parseJSON =
String
-> (Object -> Parser EvaluationResult)
-> Value
-> Parser EvaluationResult
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"EvaluationResult"
( \Object
x ->
Maybe EvaluationResultIdentifier
-> Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe ComplianceType
-> EvaluationResult
EvaluationResult'
(Maybe EvaluationResultIdentifier
-> Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe ComplianceType
-> EvaluationResult)
-> Parser (Maybe EvaluationResultIdentifier)
-> Parser
(Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe ComplianceType
-> EvaluationResult)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe EvaluationResultIdentifier)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EvaluationResultIdentifier")
Parser
(Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe ComplianceType
-> EvaluationResult)
-> Parser (Maybe Text)
-> Parser
(Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe ComplianceType
-> EvaluationResult)
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
"Annotation")
Parser
(Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe ComplianceType
-> EvaluationResult)
-> Parser (Maybe POSIX)
-> Parser
(Maybe POSIX
-> Maybe Text -> Maybe ComplianceType -> EvaluationResult)
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
"ConfigRuleInvokedTime")
Parser
(Maybe POSIX
-> Maybe Text -> Maybe ComplianceType -> EvaluationResult)
-> Parser (Maybe POSIX)
-> Parser (Maybe Text -> Maybe ComplianceType -> EvaluationResult)
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
"ResultRecordedTime")
Parser (Maybe Text -> Maybe ComplianceType -> EvaluationResult)
-> Parser (Maybe Text)
-> Parser (Maybe ComplianceType -> EvaluationResult)
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
"ResultToken")
Parser (Maybe ComplianceType -> EvaluationResult)
-> Parser (Maybe ComplianceType) -> Parser EvaluationResult
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ComplianceType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ComplianceType")
)
instance Prelude.Hashable EvaluationResult
instance Prelude.NFData EvaluationResult