{-# 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.ExternalEvaluation 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 ExternalEvaluation = ExternalEvaluation'
{
ExternalEvaluation -> Maybe Text
annotation :: Prelude.Maybe Prelude.Text,
ExternalEvaluation -> Text
complianceResourceType :: Prelude.Text,
ExternalEvaluation -> Text
complianceResourceId :: Prelude.Text,
ExternalEvaluation -> ComplianceType
complianceType :: ComplianceType,
ExternalEvaluation -> POSIX
orderingTimestamp :: Core.POSIX
}
deriving (ExternalEvaluation -> ExternalEvaluation -> Bool
(ExternalEvaluation -> ExternalEvaluation -> Bool)
-> (ExternalEvaluation -> ExternalEvaluation -> Bool)
-> Eq ExternalEvaluation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExternalEvaluation -> ExternalEvaluation -> Bool
$c/= :: ExternalEvaluation -> ExternalEvaluation -> Bool
== :: ExternalEvaluation -> ExternalEvaluation -> Bool
$c== :: ExternalEvaluation -> ExternalEvaluation -> Bool
Prelude.Eq, ReadPrec [ExternalEvaluation]
ReadPrec ExternalEvaluation
Int -> ReadS ExternalEvaluation
ReadS [ExternalEvaluation]
(Int -> ReadS ExternalEvaluation)
-> ReadS [ExternalEvaluation]
-> ReadPrec ExternalEvaluation
-> ReadPrec [ExternalEvaluation]
-> Read ExternalEvaluation
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ExternalEvaluation]
$creadListPrec :: ReadPrec [ExternalEvaluation]
readPrec :: ReadPrec ExternalEvaluation
$creadPrec :: ReadPrec ExternalEvaluation
readList :: ReadS [ExternalEvaluation]
$creadList :: ReadS [ExternalEvaluation]
readsPrec :: Int -> ReadS ExternalEvaluation
$creadsPrec :: Int -> ReadS ExternalEvaluation
Prelude.Read, Int -> ExternalEvaluation -> ShowS
[ExternalEvaluation] -> ShowS
ExternalEvaluation -> String
(Int -> ExternalEvaluation -> ShowS)
-> (ExternalEvaluation -> String)
-> ([ExternalEvaluation] -> ShowS)
-> Show ExternalEvaluation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ExternalEvaluation] -> ShowS
$cshowList :: [ExternalEvaluation] -> ShowS
show :: ExternalEvaluation -> String
$cshow :: ExternalEvaluation -> String
showsPrec :: Int -> ExternalEvaluation -> ShowS
$cshowsPrec :: Int -> ExternalEvaluation -> ShowS
Prelude.Show, (forall x. ExternalEvaluation -> Rep ExternalEvaluation x)
-> (forall x. Rep ExternalEvaluation x -> ExternalEvaluation)
-> Generic ExternalEvaluation
forall x. Rep ExternalEvaluation x -> ExternalEvaluation
forall x. ExternalEvaluation -> Rep ExternalEvaluation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ExternalEvaluation x -> ExternalEvaluation
$cfrom :: forall x. ExternalEvaluation -> Rep ExternalEvaluation x
Prelude.Generic)
newExternalEvaluation ::
Prelude.Text ->
Prelude.Text ->
ComplianceType ->
Prelude.UTCTime ->
ExternalEvaluation
newExternalEvaluation :: Text -> Text -> ComplianceType -> UTCTime -> ExternalEvaluation
newExternalEvaluation
Text
pComplianceResourceType_
Text
pComplianceResourceId_
ComplianceType
pComplianceType_
UTCTime
pOrderingTimestamp_ =
ExternalEvaluation' :: Maybe Text
-> Text -> Text -> ComplianceType -> POSIX -> ExternalEvaluation
ExternalEvaluation'
{ $sel:annotation:ExternalEvaluation' :: Maybe Text
annotation = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:complianceResourceType:ExternalEvaluation' :: Text
complianceResourceType = Text
pComplianceResourceType_,
$sel:complianceResourceId:ExternalEvaluation' :: Text
complianceResourceId = Text
pComplianceResourceId_,
$sel:complianceType:ExternalEvaluation' :: ComplianceType
complianceType = ComplianceType
pComplianceType_,
$sel:orderingTimestamp:ExternalEvaluation' :: 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_
}
externalEvaluation_annotation :: Lens.Lens' ExternalEvaluation (Prelude.Maybe Prelude.Text)
externalEvaluation_annotation :: (Maybe Text -> f (Maybe Text))
-> ExternalEvaluation -> f ExternalEvaluation
externalEvaluation_annotation = (ExternalEvaluation -> Maybe Text)
-> (ExternalEvaluation -> Maybe Text -> ExternalEvaluation)
-> Lens
ExternalEvaluation ExternalEvaluation (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExternalEvaluation' {Maybe Text
annotation :: Maybe Text
$sel:annotation:ExternalEvaluation' :: ExternalEvaluation -> Maybe Text
annotation} -> Maybe Text
annotation) (\s :: ExternalEvaluation
s@ExternalEvaluation' {} Maybe Text
a -> ExternalEvaluation
s {$sel:annotation:ExternalEvaluation' :: Maybe Text
annotation = Maybe Text
a} :: ExternalEvaluation)
externalEvaluation_complianceResourceType :: Lens.Lens' ExternalEvaluation Prelude.Text
externalEvaluation_complianceResourceType :: (Text -> f Text) -> ExternalEvaluation -> f ExternalEvaluation
externalEvaluation_complianceResourceType = (ExternalEvaluation -> Text)
-> (ExternalEvaluation -> Text -> ExternalEvaluation)
-> Lens ExternalEvaluation ExternalEvaluation Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExternalEvaluation' {Text
complianceResourceType :: Text
$sel:complianceResourceType:ExternalEvaluation' :: ExternalEvaluation -> Text
complianceResourceType} -> Text
complianceResourceType) (\s :: ExternalEvaluation
s@ExternalEvaluation' {} Text
a -> ExternalEvaluation
s {$sel:complianceResourceType:ExternalEvaluation' :: Text
complianceResourceType = Text
a} :: ExternalEvaluation)
externalEvaluation_complianceResourceId :: Lens.Lens' ExternalEvaluation Prelude.Text
externalEvaluation_complianceResourceId :: (Text -> f Text) -> ExternalEvaluation -> f ExternalEvaluation
externalEvaluation_complianceResourceId = (ExternalEvaluation -> Text)
-> (ExternalEvaluation -> Text -> ExternalEvaluation)
-> Lens ExternalEvaluation ExternalEvaluation Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExternalEvaluation' {Text
complianceResourceId :: Text
$sel:complianceResourceId:ExternalEvaluation' :: ExternalEvaluation -> Text
complianceResourceId} -> Text
complianceResourceId) (\s :: ExternalEvaluation
s@ExternalEvaluation' {} Text
a -> ExternalEvaluation
s {$sel:complianceResourceId:ExternalEvaluation' :: Text
complianceResourceId = Text
a} :: ExternalEvaluation)
externalEvaluation_complianceType :: Lens.Lens' ExternalEvaluation ComplianceType
externalEvaluation_complianceType :: (ComplianceType -> f ComplianceType)
-> ExternalEvaluation -> f ExternalEvaluation
externalEvaluation_complianceType = (ExternalEvaluation -> ComplianceType)
-> (ExternalEvaluation -> ComplianceType -> ExternalEvaluation)
-> Lens
ExternalEvaluation ExternalEvaluation ComplianceType ComplianceType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExternalEvaluation' {ComplianceType
complianceType :: ComplianceType
$sel:complianceType:ExternalEvaluation' :: ExternalEvaluation -> ComplianceType
complianceType} -> ComplianceType
complianceType) (\s :: ExternalEvaluation
s@ExternalEvaluation' {} ComplianceType
a -> ExternalEvaluation
s {$sel:complianceType:ExternalEvaluation' :: ComplianceType
complianceType = ComplianceType
a} :: ExternalEvaluation)
externalEvaluation_orderingTimestamp :: Lens.Lens' ExternalEvaluation Prelude.UTCTime
externalEvaluation_orderingTimestamp :: (UTCTime -> f UTCTime)
-> ExternalEvaluation -> f ExternalEvaluation
externalEvaluation_orderingTimestamp = (ExternalEvaluation -> POSIX)
-> (ExternalEvaluation -> POSIX -> ExternalEvaluation)
-> Lens ExternalEvaluation ExternalEvaluation POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExternalEvaluation' {POSIX
orderingTimestamp :: POSIX
$sel:orderingTimestamp:ExternalEvaluation' :: ExternalEvaluation -> POSIX
orderingTimestamp} -> POSIX
orderingTimestamp) (\s :: ExternalEvaluation
s@ExternalEvaluation' {} POSIX
a -> ExternalEvaluation
s {$sel:orderingTimestamp:ExternalEvaluation' :: POSIX
orderingTimestamp = POSIX
a} :: ExternalEvaluation) ((POSIX -> f POSIX) -> ExternalEvaluation -> f ExternalEvaluation)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> ExternalEvaluation
-> f ExternalEvaluation
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 Prelude.Hashable ExternalEvaluation
instance Prelude.NFData ExternalEvaluation
instance Core.ToJSON ExternalEvaluation where
toJSON :: ExternalEvaluation -> Value
toJSON ExternalEvaluation' {Maybe Text
Text
POSIX
ComplianceType
orderingTimestamp :: POSIX
complianceType :: ComplianceType
complianceResourceId :: Text
complianceResourceType :: Text
annotation :: Maybe Text
$sel:orderingTimestamp:ExternalEvaluation' :: ExternalEvaluation -> POSIX
$sel:complianceType:ExternalEvaluation' :: ExternalEvaluation -> ComplianceType
$sel:complianceResourceId:ExternalEvaluation' :: ExternalEvaluation -> Text
$sel:complianceResourceType:ExternalEvaluation' :: ExternalEvaluation -> Text
$sel:annotation:ExternalEvaluation' :: ExternalEvaluation -> 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)
]
)