{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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 :: Data.POSIX
}
deriving (Evaluation -> Evaluation -> Bool
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]
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
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. 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'
{ $sel:annotation:Evaluation' :: Maybe Text
annotation = 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 =
forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pOrderingTimestamp_
}
evaluation_annotation :: Lens.Lens' Evaluation (Prelude.Maybe Prelude.Text)
evaluation_annotation :: Lens' Evaluation (Maybe Text)
evaluation_annotation = 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 :: Lens' Evaluation Text
evaluation_complianceResourceType = 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 :: Lens' Evaluation Text
evaluation_complianceResourceId = 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 :: Lens' Evaluation ComplianceType
evaluation_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 :: Lens' Evaluation UTCTime
evaluation_orderingTimestamp = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
instance Data.FromJSON Evaluation where
parseJSON :: Value -> Parser Evaluation
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Evaluation"
( \Object
x ->
Maybe Text -> Text -> Text -> ComplianceType -> POSIX -> Evaluation
Evaluation'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Annotation")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"ComplianceResourceType")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"ComplianceResourceId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"ComplianceType")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"OrderingTimestamp")
)
instance Prelude.Hashable Evaluation where
hashWithSalt :: Int -> Evaluation -> Int
hashWithSalt Int
_salt 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
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
annotation
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
complianceResourceType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
complianceResourceId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ComplianceType
complianceType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` POSIX
orderingTimestamp
instance Prelude.NFData Evaluation where
rnf :: Evaluation -> ()
rnf 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
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
annotation
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
complianceResourceType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
complianceResourceId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ComplianceType
complianceType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf POSIX
orderingTimestamp
instance Data.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
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"Annotation" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
annotation,
forall a. a -> Maybe a
Prelude.Just
( Key
"ComplianceResourceType"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
complianceResourceType
),
forall a. a -> Maybe a
Prelude.Just
( Key
"ComplianceResourceId"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
complianceResourceId
),
forall a. a -> Maybe a
Prelude.Just
(Key
"ComplianceType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= ComplianceType
complianceType),
forall a. a -> Maybe a
Prelude.Just
(Key
"OrderingTimestamp" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= POSIX
orderingTimestamp)
]
)