{-# 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.AuditManager.Types.ControlMetadata where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ControlMetadata = ControlMetadata'
{
ControlMetadata -> Maybe POSIX
lastUpdatedAt :: Prelude.Maybe Core.POSIX,
ControlMetadata -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
ControlMetadata -> Maybe POSIX
createdAt :: Prelude.Maybe Core.POSIX,
ControlMetadata -> Maybe Text
controlSources :: Prelude.Maybe Prelude.Text,
ControlMetadata -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
ControlMetadata -> Maybe Text
id :: Prelude.Maybe Prelude.Text
}
deriving (ControlMetadata -> ControlMetadata -> Bool
(ControlMetadata -> ControlMetadata -> Bool)
-> (ControlMetadata -> ControlMetadata -> Bool)
-> Eq ControlMetadata
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ControlMetadata -> ControlMetadata -> Bool
$c/= :: ControlMetadata -> ControlMetadata -> Bool
== :: ControlMetadata -> ControlMetadata -> Bool
$c== :: ControlMetadata -> ControlMetadata -> Bool
Prelude.Eq, ReadPrec [ControlMetadata]
ReadPrec ControlMetadata
Int -> ReadS ControlMetadata
ReadS [ControlMetadata]
(Int -> ReadS ControlMetadata)
-> ReadS [ControlMetadata]
-> ReadPrec ControlMetadata
-> ReadPrec [ControlMetadata]
-> Read ControlMetadata
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ControlMetadata]
$creadListPrec :: ReadPrec [ControlMetadata]
readPrec :: ReadPrec ControlMetadata
$creadPrec :: ReadPrec ControlMetadata
readList :: ReadS [ControlMetadata]
$creadList :: ReadS [ControlMetadata]
readsPrec :: Int -> ReadS ControlMetadata
$creadsPrec :: Int -> ReadS ControlMetadata
Prelude.Read, Int -> ControlMetadata -> ShowS
[ControlMetadata] -> ShowS
ControlMetadata -> String
(Int -> ControlMetadata -> ShowS)
-> (ControlMetadata -> String)
-> ([ControlMetadata] -> ShowS)
-> Show ControlMetadata
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ControlMetadata] -> ShowS
$cshowList :: [ControlMetadata] -> ShowS
show :: ControlMetadata -> String
$cshow :: ControlMetadata -> String
showsPrec :: Int -> ControlMetadata -> ShowS
$cshowsPrec :: Int -> ControlMetadata -> ShowS
Prelude.Show, (forall x. ControlMetadata -> Rep ControlMetadata x)
-> (forall x. Rep ControlMetadata x -> ControlMetadata)
-> Generic ControlMetadata
forall x. Rep ControlMetadata x -> ControlMetadata
forall x. ControlMetadata -> Rep ControlMetadata x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ControlMetadata x -> ControlMetadata
$cfrom :: forall x. ControlMetadata -> Rep ControlMetadata x
Prelude.Generic)
newControlMetadata ::
ControlMetadata
newControlMetadata :: ControlMetadata
newControlMetadata =
ControlMetadata' :: Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> ControlMetadata
ControlMetadata'
{ $sel:lastUpdatedAt:ControlMetadata' :: Maybe POSIX
lastUpdatedAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:arn:ControlMetadata' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:createdAt:ControlMetadata' :: Maybe POSIX
createdAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:controlSources:ControlMetadata' :: Maybe Text
controlSources = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:name:ControlMetadata' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:id:ControlMetadata' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
controlMetadata_lastUpdatedAt :: Lens.Lens' ControlMetadata (Prelude.Maybe Prelude.UTCTime)
controlMetadata_lastUpdatedAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ControlMetadata -> f ControlMetadata
controlMetadata_lastUpdatedAt = (ControlMetadata -> Maybe POSIX)
-> (ControlMetadata -> Maybe POSIX -> ControlMetadata)
-> Lens ControlMetadata ControlMetadata (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ControlMetadata' {Maybe POSIX
lastUpdatedAt :: Maybe POSIX
$sel:lastUpdatedAt:ControlMetadata' :: ControlMetadata -> Maybe POSIX
lastUpdatedAt} -> Maybe POSIX
lastUpdatedAt) (\s :: ControlMetadata
s@ControlMetadata' {} Maybe POSIX
a -> ControlMetadata
s {$sel:lastUpdatedAt:ControlMetadata' :: Maybe POSIX
lastUpdatedAt = Maybe POSIX
a} :: ControlMetadata) ((Maybe POSIX -> f (Maybe POSIX))
-> ControlMetadata -> f ControlMetadata)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ControlMetadata
-> f ControlMetadata
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
controlMetadata_arn :: Lens.Lens' ControlMetadata (Prelude.Maybe Prelude.Text)
controlMetadata_arn :: (Maybe Text -> f (Maybe Text))
-> ControlMetadata -> f ControlMetadata
controlMetadata_arn = (ControlMetadata -> Maybe Text)
-> (ControlMetadata -> Maybe Text -> ControlMetadata)
-> Lens ControlMetadata ControlMetadata (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ControlMetadata' {Maybe Text
arn :: Maybe Text
$sel:arn:ControlMetadata' :: ControlMetadata -> Maybe Text
arn} -> Maybe Text
arn) (\s :: ControlMetadata
s@ControlMetadata' {} Maybe Text
a -> ControlMetadata
s {$sel:arn:ControlMetadata' :: Maybe Text
arn = Maybe Text
a} :: ControlMetadata)
controlMetadata_createdAt :: Lens.Lens' ControlMetadata (Prelude.Maybe Prelude.UTCTime)
controlMetadata_createdAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ControlMetadata -> f ControlMetadata
controlMetadata_createdAt = (ControlMetadata -> Maybe POSIX)
-> (ControlMetadata -> Maybe POSIX -> ControlMetadata)
-> Lens ControlMetadata ControlMetadata (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ControlMetadata' {Maybe POSIX
createdAt :: Maybe POSIX
$sel:createdAt:ControlMetadata' :: ControlMetadata -> Maybe POSIX
createdAt} -> Maybe POSIX
createdAt) (\s :: ControlMetadata
s@ControlMetadata' {} Maybe POSIX
a -> ControlMetadata
s {$sel:createdAt:ControlMetadata' :: Maybe POSIX
createdAt = Maybe POSIX
a} :: ControlMetadata) ((Maybe POSIX -> f (Maybe POSIX))
-> ControlMetadata -> f ControlMetadata)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ControlMetadata
-> f ControlMetadata
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
controlMetadata_controlSources :: Lens.Lens' ControlMetadata (Prelude.Maybe Prelude.Text)
controlMetadata_controlSources :: (Maybe Text -> f (Maybe Text))
-> ControlMetadata -> f ControlMetadata
controlMetadata_controlSources = (ControlMetadata -> Maybe Text)
-> (ControlMetadata -> Maybe Text -> ControlMetadata)
-> Lens ControlMetadata ControlMetadata (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ControlMetadata' {Maybe Text
controlSources :: Maybe Text
$sel:controlSources:ControlMetadata' :: ControlMetadata -> Maybe Text
controlSources} -> Maybe Text
controlSources) (\s :: ControlMetadata
s@ControlMetadata' {} Maybe Text
a -> ControlMetadata
s {$sel:controlSources:ControlMetadata' :: Maybe Text
controlSources = Maybe Text
a} :: ControlMetadata)
controlMetadata_name :: Lens.Lens' ControlMetadata (Prelude.Maybe Prelude.Text)
controlMetadata_name :: (Maybe Text -> f (Maybe Text))
-> ControlMetadata -> f ControlMetadata
controlMetadata_name = (ControlMetadata -> Maybe Text)
-> (ControlMetadata -> Maybe Text -> ControlMetadata)
-> Lens ControlMetadata ControlMetadata (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ControlMetadata' {Maybe Text
name :: Maybe Text
$sel:name:ControlMetadata' :: ControlMetadata -> Maybe Text
name} -> Maybe Text
name) (\s :: ControlMetadata
s@ControlMetadata' {} Maybe Text
a -> ControlMetadata
s {$sel:name:ControlMetadata' :: Maybe Text
name = Maybe Text
a} :: ControlMetadata)
controlMetadata_id :: Lens.Lens' ControlMetadata (Prelude.Maybe Prelude.Text)
controlMetadata_id :: (Maybe Text -> f (Maybe Text))
-> ControlMetadata -> f ControlMetadata
controlMetadata_id = (ControlMetadata -> Maybe Text)
-> (ControlMetadata -> Maybe Text -> ControlMetadata)
-> Lens ControlMetadata ControlMetadata (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ControlMetadata' {Maybe Text
id :: Maybe Text
$sel:id:ControlMetadata' :: ControlMetadata -> Maybe Text
id} -> Maybe Text
id) (\s :: ControlMetadata
s@ControlMetadata' {} Maybe Text
a -> ControlMetadata
s {$sel:id:ControlMetadata' :: Maybe Text
id = Maybe Text
a} :: ControlMetadata)
instance Core.FromJSON ControlMetadata where
parseJSON :: Value -> Parser ControlMetadata
parseJSON =
String
-> (Object -> Parser ControlMetadata)
-> Value
-> Parser ControlMetadata
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ControlMetadata"
( \Object
x ->
Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> ControlMetadata
ControlMetadata'
(Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> ControlMetadata)
-> Parser (Maybe POSIX)
-> Parser
(Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> ControlMetadata)
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
"lastUpdatedAt")
Parser
(Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> ControlMetadata)
-> Parser (Maybe Text)
-> Parser
(Maybe POSIX
-> Maybe Text -> Maybe Text -> Maybe Text -> ControlMetadata)
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
"arn")
Parser
(Maybe POSIX
-> Maybe Text -> Maybe Text -> Maybe Text -> ControlMetadata)
-> Parser (Maybe POSIX)
-> Parser
(Maybe Text -> Maybe Text -> Maybe Text -> ControlMetadata)
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
"createdAt")
Parser (Maybe Text -> Maybe Text -> Maybe Text -> ControlMetadata)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> ControlMetadata)
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
"controlSources")
Parser (Maybe Text -> Maybe Text -> ControlMetadata)
-> Parser (Maybe Text) -> Parser (Maybe Text -> ControlMetadata)
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
"name")
Parser (Maybe Text -> ControlMetadata)
-> Parser (Maybe Text) -> Parser ControlMetadata
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
"id")
)
instance Prelude.Hashable ControlMetadata
instance Prelude.NFData ControlMetadata