{-# 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.Evaluation where
import Amazonka.Config.Types.ComplianceType
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Evaluation = Evaluation'
{
Evaluation -> Maybe Text
annotation :: Prelude.Maybe Prelude.Text,
Evaluation -> Text
complianceResourceType :: Prelude.Text,
Evaluation -> Text
complianceResourceId :: Prelude.Text,
Evaluation -> ComplianceType
complianceType :: ComplianceType,
Evaluation -> POSIX
orderingTimestamp :: Core.POSIX
}
deriving (Evaluation -> Evaluation -> Bool
(Evaluation -> Evaluation -> Bool)
-> (Evaluation -> Evaluation -> Bool) -> Eq Evaluation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Evaluation -> Evaluation -> Bool
$c/= :: Evaluation -> Evaluation -> Bool
== :: Evaluation -> Evaluation -> Bool
$c== :: Evaluation -> Evaluation -> Bool
Prelude.Eq, ReadPrec [Evaluation]
ReadPrec Evaluation
Int -> ReadS Evaluation
ReadS [Evaluation]
(Int -> ReadS Evaluation)
-> ReadS [Evaluation]
-> ReadPrec Evaluation
-> ReadPrec [Evaluation]
-> Read Evaluation
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Evaluation]
$creadListPrec :: ReadPrec [Evaluation]
readPrec :: ReadPrec Evaluation
$creadPrec :: ReadPrec Evaluation
readList :: ReadS [Evaluation]
$creadList :: ReadS [Evaluation]
readsPrec :: Int -> ReadS Evaluation
$creadsPrec :: Int -> ReadS Evaluation
Prelude.Read, Int -> Evaluation -> ShowS
[Evaluation] -> ShowS
Evaluation -> String
(Int -> Evaluation -> ShowS)
-> (Evaluation -> String)
-> ([Evaluation] -> ShowS)
-> Show Evaluation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Evaluation] -> ShowS
$cshowList :: [Evaluation] -> ShowS
show :: Evaluation -> String
$cshow :: Evaluation -> String
showsPrec :: Int -> Evaluation -> ShowS
$cshowsPrec :: Int -> Evaluation -> ShowS
Prelude.Show, (forall x. Evaluation -> Rep Evaluation x)
-> (forall x. Rep Evaluation x -> Evaluation) -> Generic Evaluation
forall x. Rep Evaluation x -> Evaluation
forall x. Evaluation -> Rep Evaluation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Evaluation x -> Evaluation
$cfrom :: forall x. Evaluation -> Rep Evaluation x
Prelude.Generic)
newEvaluation ::
Prelude.Text ->
Prelude.Text ->
ComplianceType ->
Prelude.UTCTime ->
Evaluation
newEvaluation :: Text -> Text -> ComplianceType -> UTCTime -> Evaluation
newEvaluation
Text
pComplianceResourceType_
Text
pComplianceResourceId_
ComplianceType
pComplianceType_
UTCTime
pOrderingTimestamp_ =
Evaluation' :: Maybe Text -> Text -> Text -> ComplianceType -> POSIX -> Evaluation
Evaluation'
{ $sel:annotation:Evaluation' :: Maybe Text
annotation = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:complianceResourceType:Evaluation' :: Text
complianceResourceType = Text
pComplianceResourceType_,
$sel:complianceResourceId:Evaluation' :: Text
complianceResourceId = Text
pComplianceResourceId_,
$sel:complianceType:Evaluation' :: ComplianceType
complianceType = ComplianceType
pComplianceType_,
$sel:orderingTimestamp:Evaluation' :: POSIX
orderingTimestamp =
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
pOrderingTimestamp_
}
evaluation_annotation :: Lens.Lens' Evaluation (Prelude.Maybe Prelude.Text)
evaluation_annotation :: (Maybe Text -> f (Maybe Text)) -> Evaluation -> f Evaluation
evaluation_annotation = (Evaluation -> Maybe Text)
-> (Evaluation -> Maybe Text -> Evaluation)
-> Lens Evaluation Evaluation (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Evaluation' {Maybe Text
annotation :: Maybe Text
$sel:annotation:Evaluation' :: Evaluation -> Maybe Text
annotation} -> Maybe Text
annotation) (\s :: Evaluation
s@Evaluation' {} Maybe Text
a -> Evaluation
s {$sel:annotation:Evaluation' :: Maybe Text
annotation = Maybe Text
a} :: Evaluation)
evaluation_complianceResourceType :: Lens.Lens' Evaluation Prelude.Text
evaluation_complianceResourceType :: (Text -> f Text) -> Evaluation -> f Evaluation
evaluation_complianceResourceType = (Evaluation -> Text)
-> (Evaluation -> Text -> Evaluation)
-> Lens Evaluation Evaluation Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Evaluation' {Text
complianceResourceType :: Text
$sel:complianceResourceType:Evaluation' :: Evaluation -> Text
complianceResourceType} -> Text
complianceResourceType) (\s :: Evaluation
s@Evaluation' {} Text
a -> Evaluation
s {$sel:complianceResourceType:Evaluation' :: Text
complianceResourceType = Text
a} :: Evaluation)
evaluation_complianceResourceId :: Lens.Lens' Evaluation Prelude.Text
evaluation_complianceResourceId :: (Text -> f Text) -> Evaluation -> f Evaluation
evaluation_complianceResourceId = (Evaluation -> Text)
-> (Evaluation -> Text -> Evaluation)
-> Lens Evaluation Evaluation Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Evaluation' {Text
complianceResourceId :: Text
$sel:complianceResourceId:Evaluation' :: Evaluation -> Text
complianceResourceId} -> Text
complianceResourceId) (\s :: Evaluation
s@Evaluation' {} Text
a -> Evaluation
s {$sel:complianceResourceId:Evaluation' :: Text
complianceResourceId = Text
a} :: Evaluation)
evaluation_complianceType :: Lens.Lens' Evaluation ComplianceType
evaluation_complianceType :: (ComplianceType -> f ComplianceType) -> Evaluation -> f Evaluation
evaluation_complianceType = (Evaluation -> ComplianceType)
-> (Evaluation -> ComplianceType -> Evaluation)
-> Lens Evaluation Evaluation ComplianceType ComplianceType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Evaluation' {ComplianceType
complianceType :: ComplianceType
$sel:complianceType:Evaluation' :: Evaluation -> ComplianceType
complianceType} -> ComplianceType
complianceType) (\s :: Evaluation
s@Evaluation' {} ComplianceType
a -> Evaluation
s {$sel:complianceType:Evaluation' :: ComplianceType
complianceType = ComplianceType
a} :: Evaluation)
evaluation_orderingTimestamp :: Lens.Lens' Evaluation Prelude.UTCTime
evaluation_orderingTimestamp :: (UTCTime -> f UTCTime) -> Evaluation -> f Evaluation
evaluation_orderingTimestamp = (Evaluation -> POSIX)
-> (Evaluation -> POSIX -> Evaluation)
-> Lens Evaluation Evaluation POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Evaluation' {POSIX
orderingTimestamp :: POSIX
$sel:orderingTimestamp:Evaluation' :: Evaluation -> POSIX
orderingTimestamp} -> POSIX
orderingTimestamp) (\s :: Evaluation
s@Evaluation' {} POSIX
a -> Evaluation
s {$sel:orderingTimestamp:Evaluation' :: POSIX
orderingTimestamp = POSIX
a} :: Evaluation) ((POSIX -> f POSIX) -> Evaluation -> f Evaluation)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> Evaluation
-> f Evaluation
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 Evaluation where
parseJSON :: Value -> Parser Evaluation
parseJSON =
String
-> (Object -> Parser Evaluation) -> Value -> Parser Evaluation
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Evaluation"
( \Object
x ->
Maybe Text -> Text -> Text -> ComplianceType -> POSIX -> Evaluation
Evaluation'
(Maybe Text
-> Text -> Text -> ComplianceType -> POSIX -> Evaluation)
-> Parser (Maybe Text)
-> Parser (Text -> Text -> ComplianceType -> POSIX -> Evaluation)
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
"Annotation")
Parser (Text -> Text -> ComplianceType -> POSIX -> Evaluation)
-> Parser Text
-> Parser (Text -> ComplianceType -> POSIX -> Evaluation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ComplianceResourceType")
Parser (Text -> ComplianceType -> POSIX -> Evaluation)
-> Parser Text -> Parser (ComplianceType -> POSIX -> Evaluation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ComplianceResourceId")
Parser (ComplianceType -> POSIX -> Evaluation)
-> Parser ComplianceType -> Parser (POSIX -> Evaluation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser ComplianceType
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ComplianceType")
Parser (POSIX -> Evaluation) -> Parser POSIX -> Parser Evaluation
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
"OrderingTimestamp")
)
instance Prelude.Hashable Evaluation
instance Prelude.NFData Evaluation
instance Core.ToJSON Evaluation where
toJSON :: Evaluation -> Value
toJSON Evaluation' {Maybe Text
Text
POSIX
ComplianceType
orderingTimestamp :: POSIX
complianceType :: ComplianceType
complianceResourceId :: Text
complianceResourceType :: Text
annotation :: Maybe Text
$sel:orderingTimestamp:Evaluation' :: Evaluation -> POSIX
$sel:complianceType:Evaluation' :: Evaluation -> ComplianceType
$sel:complianceResourceId:Evaluation' :: Evaluation -> Text
$sel:complianceResourceType:Evaluation' :: Evaluation -> Text
$sel:annotation:Evaluation' :: Evaluation -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Annotation" 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
annotation,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"ComplianceResourceType"
Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
complianceResourceType
),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"ComplianceResourceId"
Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
complianceResourceId
),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"ComplianceType" Text -> ComplianceType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ComplianceType
complianceType),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"OrderingTimestamp" Text -> POSIX -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= POSIX
orderingTimestamp)
]
)