{-# 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.ComplianceSummary where
import Amazonka.Config.Types.ComplianceContributorCount
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ComplianceSummary = ComplianceSummary'
{
ComplianceSummary -> Maybe POSIX
complianceSummaryTimestamp :: Prelude.Maybe Core.POSIX,
ComplianceSummary -> Maybe ComplianceContributorCount
compliantResourceCount :: Prelude.Maybe ComplianceContributorCount,
ComplianceSummary -> Maybe ComplianceContributorCount
nonCompliantResourceCount :: Prelude.Maybe ComplianceContributorCount
}
deriving (ComplianceSummary -> ComplianceSummary -> Bool
(ComplianceSummary -> ComplianceSummary -> Bool)
-> (ComplianceSummary -> ComplianceSummary -> Bool)
-> Eq ComplianceSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ComplianceSummary -> ComplianceSummary -> Bool
$c/= :: ComplianceSummary -> ComplianceSummary -> Bool
== :: ComplianceSummary -> ComplianceSummary -> Bool
$c== :: ComplianceSummary -> ComplianceSummary -> Bool
Prelude.Eq, ReadPrec [ComplianceSummary]
ReadPrec ComplianceSummary
Int -> ReadS ComplianceSummary
ReadS [ComplianceSummary]
(Int -> ReadS ComplianceSummary)
-> ReadS [ComplianceSummary]
-> ReadPrec ComplianceSummary
-> ReadPrec [ComplianceSummary]
-> Read ComplianceSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ComplianceSummary]
$creadListPrec :: ReadPrec [ComplianceSummary]
readPrec :: ReadPrec ComplianceSummary
$creadPrec :: ReadPrec ComplianceSummary
readList :: ReadS [ComplianceSummary]
$creadList :: ReadS [ComplianceSummary]
readsPrec :: Int -> ReadS ComplianceSummary
$creadsPrec :: Int -> ReadS ComplianceSummary
Prelude.Read, Int -> ComplianceSummary -> ShowS
[ComplianceSummary] -> ShowS
ComplianceSummary -> String
(Int -> ComplianceSummary -> ShowS)
-> (ComplianceSummary -> String)
-> ([ComplianceSummary] -> ShowS)
-> Show ComplianceSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ComplianceSummary] -> ShowS
$cshowList :: [ComplianceSummary] -> ShowS
show :: ComplianceSummary -> String
$cshow :: ComplianceSummary -> String
showsPrec :: Int -> ComplianceSummary -> ShowS
$cshowsPrec :: Int -> ComplianceSummary -> ShowS
Prelude.Show, (forall x. ComplianceSummary -> Rep ComplianceSummary x)
-> (forall x. Rep ComplianceSummary x -> ComplianceSummary)
-> Generic ComplianceSummary
forall x. Rep ComplianceSummary x -> ComplianceSummary
forall x. ComplianceSummary -> Rep ComplianceSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ComplianceSummary x -> ComplianceSummary
$cfrom :: forall x. ComplianceSummary -> Rep ComplianceSummary x
Prelude.Generic)
newComplianceSummary ::
ComplianceSummary
newComplianceSummary :: ComplianceSummary
newComplianceSummary =
ComplianceSummary' :: Maybe POSIX
-> Maybe ComplianceContributorCount
-> Maybe ComplianceContributorCount
-> ComplianceSummary
ComplianceSummary'
{ $sel:complianceSummaryTimestamp:ComplianceSummary' :: Maybe POSIX
complianceSummaryTimestamp =
Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:compliantResourceCount:ComplianceSummary' :: Maybe ComplianceContributorCount
compliantResourceCount = Maybe ComplianceContributorCount
forall a. Maybe a
Prelude.Nothing,
$sel:nonCompliantResourceCount:ComplianceSummary' :: Maybe ComplianceContributorCount
nonCompliantResourceCount = Maybe ComplianceContributorCount
forall a. Maybe a
Prelude.Nothing
}
complianceSummary_complianceSummaryTimestamp :: Lens.Lens' ComplianceSummary (Prelude.Maybe Prelude.UTCTime)
complianceSummary_complianceSummaryTimestamp :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ComplianceSummary -> f ComplianceSummary
complianceSummary_complianceSummaryTimestamp = (ComplianceSummary -> Maybe POSIX)
-> (ComplianceSummary -> Maybe POSIX -> ComplianceSummary)
-> Lens
ComplianceSummary ComplianceSummary (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComplianceSummary' {Maybe POSIX
complianceSummaryTimestamp :: Maybe POSIX
$sel:complianceSummaryTimestamp:ComplianceSummary' :: ComplianceSummary -> Maybe POSIX
complianceSummaryTimestamp} -> Maybe POSIX
complianceSummaryTimestamp) (\s :: ComplianceSummary
s@ComplianceSummary' {} Maybe POSIX
a -> ComplianceSummary
s {$sel:complianceSummaryTimestamp:ComplianceSummary' :: Maybe POSIX
complianceSummaryTimestamp = Maybe POSIX
a} :: ComplianceSummary) ((Maybe POSIX -> f (Maybe POSIX))
-> ComplianceSummary -> f ComplianceSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ComplianceSummary
-> f ComplianceSummary
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
complianceSummary_compliantResourceCount :: Lens.Lens' ComplianceSummary (Prelude.Maybe ComplianceContributorCount)
complianceSummary_compliantResourceCount :: (Maybe ComplianceContributorCount
-> f (Maybe ComplianceContributorCount))
-> ComplianceSummary -> f ComplianceSummary
complianceSummary_compliantResourceCount = (ComplianceSummary -> Maybe ComplianceContributorCount)
-> (ComplianceSummary
-> Maybe ComplianceContributorCount -> ComplianceSummary)
-> Lens
ComplianceSummary
ComplianceSummary
(Maybe ComplianceContributorCount)
(Maybe ComplianceContributorCount)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComplianceSummary' {Maybe ComplianceContributorCount
compliantResourceCount :: Maybe ComplianceContributorCount
$sel:compliantResourceCount:ComplianceSummary' :: ComplianceSummary -> Maybe ComplianceContributorCount
compliantResourceCount} -> Maybe ComplianceContributorCount
compliantResourceCount) (\s :: ComplianceSummary
s@ComplianceSummary' {} Maybe ComplianceContributorCount
a -> ComplianceSummary
s {$sel:compliantResourceCount:ComplianceSummary' :: Maybe ComplianceContributorCount
compliantResourceCount = Maybe ComplianceContributorCount
a} :: ComplianceSummary)
complianceSummary_nonCompliantResourceCount :: Lens.Lens' ComplianceSummary (Prelude.Maybe ComplianceContributorCount)
complianceSummary_nonCompliantResourceCount :: (Maybe ComplianceContributorCount
-> f (Maybe ComplianceContributorCount))
-> ComplianceSummary -> f ComplianceSummary
complianceSummary_nonCompliantResourceCount = (ComplianceSummary -> Maybe ComplianceContributorCount)
-> (ComplianceSummary
-> Maybe ComplianceContributorCount -> ComplianceSummary)
-> Lens
ComplianceSummary
ComplianceSummary
(Maybe ComplianceContributorCount)
(Maybe ComplianceContributorCount)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComplianceSummary' {Maybe ComplianceContributorCount
nonCompliantResourceCount :: Maybe ComplianceContributorCount
$sel:nonCompliantResourceCount:ComplianceSummary' :: ComplianceSummary -> Maybe ComplianceContributorCount
nonCompliantResourceCount} -> Maybe ComplianceContributorCount
nonCompliantResourceCount) (\s :: ComplianceSummary
s@ComplianceSummary' {} Maybe ComplianceContributorCount
a -> ComplianceSummary
s {$sel:nonCompliantResourceCount:ComplianceSummary' :: Maybe ComplianceContributorCount
nonCompliantResourceCount = Maybe ComplianceContributorCount
a} :: ComplianceSummary)
instance Core.FromJSON ComplianceSummary where
parseJSON :: Value -> Parser ComplianceSummary
parseJSON =
String
-> (Object -> Parser ComplianceSummary)
-> Value
-> Parser ComplianceSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ComplianceSummary"
( \Object
x ->
Maybe POSIX
-> Maybe ComplianceContributorCount
-> Maybe ComplianceContributorCount
-> ComplianceSummary
ComplianceSummary'
(Maybe POSIX
-> Maybe ComplianceContributorCount
-> Maybe ComplianceContributorCount
-> ComplianceSummary)
-> Parser (Maybe POSIX)
-> Parser
(Maybe ComplianceContributorCount
-> Maybe ComplianceContributorCount -> ComplianceSummary)
forall (f :: * -> *) a b. Functor 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
"ComplianceSummaryTimestamp")
Parser
(Maybe ComplianceContributorCount
-> Maybe ComplianceContributorCount -> ComplianceSummary)
-> Parser (Maybe ComplianceContributorCount)
-> Parser (Maybe ComplianceContributorCount -> ComplianceSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ComplianceContributorCount)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CompliantResourceCount")
Parser (Maybe ComplianceContributorCount -> ComplianceSummary)
-> Parser (Maybe ComplianceContributorCount)
-> Parser ComplianceSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ComplianceContributorCount)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"NonCompliantResourceCount")
)
instance Prelude.Hashable ComplianceSummary
instance Prelude.NFData ComplianceSummary