{-# 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.ControlComment where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data =
{
:: Prelude.Maybe Prelude.Text,
:: Prelude.Maybe Core.POSIX,
ControlComment -> Maybe Text
commentBody :: Prelude.Maybe Prelude.Text
}
deriving (ControlComment -> ControlComment -> Bool
(ControlComment -> ControlComment -> Bool)
-> (ControlComment -> ControlComment -> Bool) -> Eq ControlComment
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ControlComment -> ControlComment -> Bool
$c/= :: ControlComment -> ControlComment -> Bool
== :: ControlComment -> ControlComment -> Bool
$c== :: ControlComment -> ControlComment -> Bool
Prelude.Eq, ReadPrec [ControlComment]
ReadPrec ControlComment
Int -> ReadS ControlComment
ReadS [ControlComment]
(Int -> ReadS ControlComment)
-> ReadS [ControlComment]
-> ReadPrec ControlComment
-> ReadPrec [ControlComment]
-> Read ControlComment
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ControlComment]
$creadListPrec :: ReadPrec [ControlComment]
readPrec :: ReadPrec ControlComment
$creadPrec :: ReadPrec ControlComment
readList :: ReadS [ControlComment]
$creadList :: ReadS [ControlComment]
readsPrec :: Int -> ReadS ControlComment
$creadsPrec :: Int -> ReadS ControlComment
Prelude.Read, Int -> ControlComment -> ShowS
[ControlComment] -> ShowS
ControlComment -> String
(Int -> ControlComment -> ShowS)
-> (ControlComment -> String)
-> ([ControlComment] -> ShowS)
-> Show ControlComment
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ControlComment] -> ShowS
$cshowList :: [ControlComment] -> ShowS
show :: ControlComment -> String
$cshow :: ControlComment -> String
showsPrec :: Int -> ControlComment -> ShowS
$cshowsPrec :: Int -> ControlComment -> ShowS
Prelude.Show, (forall x. ControlComment -> Rep ControlComment x)
-> (forall x. Rep ControlComment x -> ControlComment)
-> Generic ControlComment
forall x. Rep ControlComment x -> ControlComment
forall x. ControlComment -> Rep ControlComment x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ControlComment x -> ControlComment
$cfrom :: forall x. ControlComment -> Rep ControlComment x
Prelude.Generic)
newControlComment ::
ControlComment
=
ControlComment' :: Maybe Text -> Maybe POSIX -> Maybe Text -> ControlComment
ControlComment'
{ $sel:authorName:ControlComment' :: Maybe Text
authorName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:postedDate:ControlComment' :: Maybe POSIX
postedDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:commentBody:ControlComment' :: Maybe Text
commentBody = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
controlComment_authorName :: Lens.Lens' ControlComment (Prelude.Maybe Prelude.Text)
= (ControlComment -> Maybe Text)
-> (ControlComment -> Maybe Text -> ControlComment)
-> Lens ControlComment ControlComment (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ControlComment' {Maybe Text
authorName :: Maybe Text
$sel:authorName:ControlComment' :: ControlComment -> Maybe Text
authorName} -> Maybe Text
authorName) (\s :: ControlComment
s@ControlComment' {} Maybe Text
a -> ControlComment
s {$sel:authorName:ControlComment' :: Maybe Text
authorName = Maybe Text
a} :: ControlComment)
controlComment_postedDate :: Lens.Lens' ControlComment (Prelude.Maybe Prelude.UTCTime)
= (ControlComment -> Maybe POSIX)
-> (ControlComment -> Maybe POSIX -> ControlComment)
-> Lens ControlComment ControlComment (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ControlComment' {Maybe POSIX
postedDate :: Maybe POSIX
$sel:postedDate:ControlComment' :: ControlComment -> Maybe POSIX
postedDate} -> Maybe POSIX
postedDate) (\s :: ControlComment
s@ControlComment' {} Maybe POSIX
a -> ControlComment
s {$sel:postedDate:ControlComment' :: Maybe POSIX
postedDate = Maybe POSIX
a} :: ControlComment) ((Maybe POSIX -> f (Maybe POSIX))
-> ControlComment -> f ControlComment)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ControlComment
-> f ControlComment
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
controlComment_commentBody :: Lens.Lens' ControlComment (Prelude.Maybe Prelude.Text)
controlComment_commentBody :: (Maybe Text -> f (Maybe Text))
-> ControlComment -> f ControlComment
controlComment_commentBody = (ControlComment -> Maybe Text)
-> (ControlComment -> Maybe Text -> ControlComment)
-> Lens ControlComment ControlComment (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ControlComment' {Maybe Text
commentBody :: Maybe Text
$sel:commentBody:ControlComment' :: ControlComment -> Maybe Text
commentBody} -> Maybe Text
commentBody) (\s :: ControlComment
s@ControlComment' {} Maybe Text
a -> ControlComment
s {$sel:commentBody:ControlComment' :: Maybe Text
commentBody = Maybe Text
a} :: ControlComment)
instance Core.FromJSON ControlComment where
parseJSON :: Value -> Parser ControlComment
parseJSON =
String
-> (Object -> Parser ControlComment)
-> Value
-> Parser ControlComment
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ControlComment"
( \Object
x ->
Maybe Text -> Maybe POSIX -> Maybe Text -> ControlComment
ControlComment'
(Maybe Text -> Maybe POSIX -> Maybe Text -> ControlComment)
-> Parser (Maybe Text)
-> Parser (Maybe POSIX -> Maybe Text -> ControlComment)
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
"authorName")
Parser (Maybe POSIX -> Maybe Text -> ControlComment)
-> Parser (Maybe POSIX) -> Parser (Maybe Text -> ControlComment)
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
"postedDate")
Parser (Maybe Text -> ControlComment)
-> Parser (Maybe Text) -> Parser ControlComment
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
"commentBody")
)
instance Prelude.Hashable ControlComment
instance Prelude.NFData ControlComment