{-# 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.WorkDocs.Types.CommentMetadata where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.WorkDocs.Types.CommentStatusType
import Amazonka.WorkDocs.Types.User
data =
{
:: Prelude.Maybe CommentStatusType,
:: Prelude.Maybe User,
:: Prelude.Maybe Prelude.Text,
:: Prelude.Maybe Core.POSIX,
:: Prelude.Maybe Prelude.Text
}
deriving (CommentMetadata -> CommentMetadata -> Bool
(CommentMetadata -> CommentMetadata -> Bool)
-> (CommentMetadata -> CommentMetadata -> Bool)
-> Eq CommentMetadata
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CommentMetadata -> CommentMetadata -> Bool
$c/= :: CommentMetadata -> CommentMetadata -> Bool
== :: CommentMetadata -> CommentMetadata -> Bool
$c== :: CommentMetadata -> CommentMetadata -> Bool
Prelude.Eq, ReadPrec [CommentMetadata]
ReadPrec CommentMetadata
Int -> ReadS CommentMetadata
ReadS [CommentMetadata]
(Int -> ReadS CommentMetadata)
-> ReadS [CommentMetadata]
-> ReadPrec CommentMetadata
-> ReadPrec [CommentMetadata]
-> Read CommentMetadata
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CommentMetadata]
$creadListPrec :: ReadPrec [CommentMetadata]
readPrec :: ReadPrec CommentMetadata
$creadPrec :: ReadPrec CommentMetadata
readList :: ReadS [CommentMetadata]
$creadList :: ReadS [CommentMetadata]
readsPrec :: Int -> ReadS CommentMetadata
$creadsPrec :: Int -> ReadS CommentMetadata
Prelude.Read, Int -> CommentMetadata -> ShowS
[CommentMetadata] -> ShowS
CommentMetadata -> String
(Int -> CommentMetadata -> ShowS)
-> (CommentMetadata -> String)
-> ([CommentMetadata] -> ShowS)
-> Show CommentMetadata
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CommentMetadata] -> ShowS
$cshowList :: [CommentMetadata] -> ShowS
show :: CommentMetadata -> String
$cshow :: CommentMetadata -> String
showsPrec :: Int -> CommentMetadata -> ShowS
$cshowsPrec :: Int -> CommentMetadata -> ShowS
Prelude.Show, (forall x. CommentMetadata -> Rep CommentMetadata x)
-> (forall x. Rep CommentMetadata x -> CommentMetadata)
-> Generic CommentMetadata
forall x. Rep CommentMetadata x -> CommentMetadata
forall x. CommentMetadata -> Rep CommentMetadata x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CommentMetadata x -> CommentMetadata
$cfrom :: forall x. CommentMetadata -> Rep CommentMetadata x
Prelude.Generic)
newCommentMetadata ::
CommentMetadata
=
CommentMetadata' :: Maybe CommentStatusType
-> Maybe User
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> CommentMetadata
CommentMetadata'
{ $sel:commentStatus:CommentMetadata' :: Maybe CommentStatusType
commentStatus = Maybe CommentStatusType
forall a. Maybe a
Prelude.Nothing,
$sel:contributor:CommentMetadata' :: Maybe User
contributor = Maybe User
forall a. Maybe a
Prelude.Nothing,
$sel:commentId:CommentMetadata' :: Maybe Text
commentId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:createdTimestamp:CommentMetadata' :: Maybe POSIX
createdTimestamp = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:recipientId:CommentMetadata' :: Maybe Text
recipientId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
commentMetadata_commentStatus :: Lens.Lens' CommentMetadata (Prelude.Maybe CommentStatusType)
= (CommentMetadata -> Maybe CommentStatusType)
-> (CommentMetadata -> Maybe CommentStatusType -> CommentMetadata)
-> Lens
CommentMetadata
CommentMetadata
(Maybe CommentStatusType)
(Maybe CommentStatusType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CommentMetadata' {Maybe CommentStatusType
commentStatus :: Maybe CommentStatusType
$sel:commentStatus:CommentMetadata' :: CommentMetadata -> Maybe CommentStatusType
commentStatus} -> Maybe CommentStatusType
commentStatus) (\s :: CommentMetadata
s@CommentMetadata' {} Maybe CommentStatusType
a -> CommentMetadata
s {$sel:commentStatus:CommentMetadata' :: Maybe CommentStatusType
commentStatus = Maybe CommentStatusType
a} :: CommentMetadata)
commentMetadata_contributor :: Lens.Lens' CommentMetadata (Prelude.Maybe User)
= (CommentMetadata -> Maybe User)
-> (CommentMetadata -> Maybe User -> CommentMetadata)
-> Lens CommentMetadata CommentMetadata (Maybe User) (Maybe User)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CommentMetadata' {Maybe User
contributor :: Maybe User
$sel:contributor:CommentMetadata' :: CommentMetadata -> Maybe User
contributor} -> Maybe User
contributor) (\s :: CommentMetadata
s@CommentMetadata' {} Maybe User
a -> CommentMetadata
s {$sel:contributor:CommentMetadata' :: Maybe User
contributor = Maybe User
a} :: CommentMetadata)
commentMetadata_commentId :: Lens.Lens' CommentMetadata (Prelude.Maybe Prelude.Text)
= (CommentMetadata -> Maybe Text)
-> (CommentMetadata -> Maybe Text -> CommentMetadata)
-> Lens CommentMetadata CommentMetadata (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CommentMetadata' {Maybe Text
commentId :: Maybe Text
$sel:commentId:CommentMetadata' :: CommentMetadata -> Maybe Text
commentId} -> Maybe Text
commentId) (\s :: CommentMetadata
s@CommentMetadata' {} Maybe Text
a -> CommentMetadata
s {$sel:commentId:CommentMetadata' :: Maybe Text
commentId = Maybe Text
a} :: CommentMetadata)
commentMetadata_createdTimestamp :: Lens.Lens' CommentMetadata (Prelude.Maybe Prelude.UTCTime)
= (CommentMetadata -> Maybe POSIX)
-> (CommentMetadata -> Maybe POSIX -> CommentMetadata)
-> Lens CommentMetadata CommentMetadata (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CommentMetadata' {Maybe POSIX
createdTimestamp :: Maybe POSIX
$sel:createdTimestamp:CommentMetadata' :: CommentMetadata -> Maybe POSIX
createdTimestamp} -> Maybe POSIX
createdTimestamp) (\s :: CommentMetadata
s@CommentMetadata' {} Maybe POSIX
a -> CommentMetadata
s {$sel:createdTimestamp:CommentMetadata' :: Maybe POSIX
createdTimestamp = Maybe POSIX
a} :: CommentMetadata) ((Maybe POSIX -> f (Maybe POSIX))
-> CommentMetadata -> f CommentMetadata)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> CommentMetadata
-> f CommentMetadata
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
commentMetadata_recipientId :: Lens.Lens' CommentMetadata (Prelude.Maybe Prelude.Text)
= (CommentMetadata -> Maybe Text)
-> (CommentMetadata -> Maybe Text -> CommentMetadata)
-> Lens CommentMetadata CommentMetadata (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CommentMetadata' {Maybe Text
recipientId :: Maybe Text
$sel:recipientId:CommentMetadata' :: CommentMetadata -> Maybe Text
recipientId} -> Maybe Text
recipientId) (\s :: CommentMetadata
s@CommentMetadata' {} Maybe Text
a -> CommentMetadata
s {$sel:recipientId:CommentMetadata' :: Maybe Text
recipientId = Maybe Text
a} :: CommentMetadata)
instance Core.FromJSON CommentMetadata where
parseJSON :: Value -> Parser CommentMetadata
parseJSON =
String
-> (Object -> Parser CommentMetadata)
-> Value
-> Parser CommentMetadata
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"CommentMetadata"
( \Object
x ->
Maybe CommentStatusType
-> Maybe User
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> CommentMetadata
CommentMetadata'
(Maybe CommentStatusType
-> Maybe User
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> CommentMetadata)
-> Parser (Maybe CommentStatusType)
-> Parser
(Maybe User
-> Maybe Text -> Maybe POSIX -> Maybe Text -> CommentMetadata)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe CommentStatusType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CommentStatus")
Parser
(Maybe User
-> Maybe Text -> Maybe POSIX -> Maybe Text -> CommentMetadata)
-> Parser (Maybe User)
-> Parser
(Maybe Text -> Maybe POSIX -> Maybe Text -> CommentMetadata)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe User)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Contributor")
Parser (Maybe Text -> Maybe POSIX -> Maybe Text -> CommentMetadata)
-> Parser (Maybe Text)
-> Parser (Maybe POSIX -> Maybe Text -> CommentMetadata)
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
"CommentId")
Parser (Maybe POSIX -> Maybe Text -> CommentMetadata)
-> Parser (Maybe POSIX) -> Parser (Maybe Text -> CommentMetadata)
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
"CreatedTimestamp")
Parser (Maybe Text -> CommentMetadata)
-> Parser (Maybe Text) -> Parser CommentMetadata
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
"RecipientId")
)
instance Prelude.Hashable CommentMetadata
instance Prelude.NFData CommentMetadata