{-# 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.Comment 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.CommentVisibilityType
import Amazonka.WorkDocs.Types.User
data =
{
:: Prelude.Maybe CommentStatusType,
:: Prelude.Maybe (Core.Sensitive Prelude.Text),
:: Prelude.Maybe CommentVisibilityType,
:: Prelude.Maybe Prelude.Text,
:: Prelude.Maybe User,
:: Prelude.Maybe Core.POSIX,
:: Prelude.Maybe Prelude.Text,
:: Prelude.Maybe Prelude.Text,
:: Prelude.Text
}
deriving (Comment -> Comment -> Bool
(Comment -> Comment -> Bool)
-> (Comment -> Comment -> Bool) -> Eq Comment
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Comment -> Comment -> Bool
$c/= :: Comment -> Comment -> Bool
== :: Comment -> Comment -> Bool
$c== :: Comment -> Comment -> Bool
Prelude.Eq, Int -> Comment -> ShowS
[Comment] -> ShowS
Comment -> String
(Int -> Comment -> ShowS)
-> (Comment -> String) -> ([Comment] -> ShowS) -> Show Comment
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Comment] -> ShowS
$cshowList :: [Comment] -> ShowS
show :: Comment -> String
$cshow :: Comment -> String
showsPrec :: Int -> Comment -> ShowS
$cshowsPrec :: Int -> Comment -> ShowS
Prelude.Show, (forall x. Comment -> Rep Comment x)
-> (forall x. Rep Comment x -> Comment) -> Generic Comment
forall x. Rep Comment x -> Comment
forall x. Comment -> Rep Comment x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Comment x -> Comment
$cfrom :: forall x. Comment -> Rep Comment x
Prelude.Generic)
newComment ::
Prelude.Text ->
Comment
Text
pCommentId_ =
Comment' :: Maybe CommentStatusType
-> Maybe (Sensitive Text)
-> Maybe CommentVisibilityType
-> Maybe Text
-> Maybe User
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Text
-> Comment
Comment'
{ $sel:status:Comment' :: Maybe CommentStatusType
status = Maybe CommentStatusType
forall a. Maybe a
Prelude.Nothing,
$sel:text:Comment' :: Maybe (Sensitive Text)
text = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
$sel:visibility:Comment' :: Maybe CommentVisibilityType
visibility = Maybe CommentVisibilityType
forall a. Maybe a
Prelude.Nothing,
$sel:threadId:Comment' :: Maybe Text
threadId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:contributor:Comment' :: Maybe User
contributor = Maybe User
forall a. Maybe a
Prelude.Nothing,
$sel:createdTimestamp:Comment' :: Maybe POSIX
createdTimestamp = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:recipientId:Comment' :: Maybe Text
recipientId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:parentId:Comment' :: Maybe Text
parentId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:commentId:Comment' :: Text
commentId = Text
pCommentId_
}
comment_status :: Lens.Lens' Comment (Prelude.Maybe CommentStatusType)
= (Comment -> Maybe CommentStatusType)
-> (Comment -> Maybe CommentStatusType -> Comment)
-> Lens
Comment Comment (Maybe CommentStatusType) (Maybe CommentStatusType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Comment' {Maybe CommentStatusType
status :: Maybe CommentStatusType
$sel:status:Comment' :: Comment -> Maybe CommentStatusType
status} -> Maybe CommentStatusType
status) (\s :: Comment
s@Comment' {} Maybe CommentStatusType
a -> Comment
s {$sel:status:Comment' :: Maybe CommentStatusType
status = Maybe CommentStatusType
a} :: Comment)
comment_text :: Lens.Lens' Comment (Prelude.Maybe Prelude.Text)
= (Comment -> Maybe (Sensitive Text))
-> (Comment -> Maybe (Sensitive Text) -> Comment)
-> Lens
Comment Comment (Maybe (Sensitive Text)) (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Comment' {Maybe (Sensitive Text)
text :: Maybe (Sensitive Text)
$sel:text:Comment' :: Comment -> Maybe (Sensitive Text)
text} -> Maybe (Sensitive Text)
text) (\s :: Comment
s@Comment' {} Maybe (Sensitive Text)
a -> Comment
s {$sel:text:Comment' :: Maybe (Sensitive Text)
text = Maybe (Sensitive Text)
a} :: Comment) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> Comment -> f Comment)
-> ((Maybe Text -> f (Maybe Text))
-> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> Comment
-> f Comment
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
(Maybe Text)
(Maybe Text)
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 (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive
comment_visibility :: Lens.Lens' Comment (Prelude.Maybe CommentVisibilityType)
= (Comment -> Maybe CommentVisibilityType)
-> (Comment -> Maybe CommentVisibilityType -> Comment)
-> Lens
Comment
Comment
(Maybe CommentVisibilityType)
(Maybe CommentVisibilityType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Comment' {Maybe CommentVisibilityType
visibility :: Maybe CommentVisibilityType
$sel:visibility:Comment' :: Comment -> Maybe CommentVisibilityType
visibility} -> Maybe CommentVisibilityType
visibility) (\s :: Comment
s@Comment' {} Maybe CommentVisibilityType
a -> Comment
s {$sel:visibility:Comment' :: Maybe CommentVisibilityType
visibility = Maybe CommentVisibilityType
a} :: Comment)
comment_threadId :: Lens.Lens' Comment (Prelude.Maybe Prelude.Text)
= (Comment -> Maybe Text)
-> (Comment -> Maybe Text -> Comment)
-> Lens Comment Comment (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Comment' {Maybe Text
threadId :: Maybe Text
$sel:threadId:Comment' :: Comment -> Maybe Text
threadId} -> Maybe Text
threadId) (\s :: Comment
s@Comment' {} Maybe Text
a -> Comment
s {$sel:threadId:Comment' :: Maybe Text
threadId = Maybe Text
a} :: Comment)
comment_contributor :: Lens.Lens' Comment (Prelude.Maybe User)
= (Comment -> Maybe User)
-> (Comment -> Maybe User -> Comment)
-> Lens Comment Comment (Maybe User) (Maybe User)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Comment' {Maybe User
contributor :: Maybe User
$sel:contributor:Comment' :: Comment -> Maybe User
contributor} -> Maybe User
contributor) (\s :: Comment
s@Comment' {} Maybe User
a -> Comment
s {$sel:contributor:Comment' :: Maybe User
contributor = Maybe User
a} :: Comment)
comment_createdTimestamp :: Lens.Lens' Comment (Prelude.Maybe Prelude.UTCTime)
= (Comment -> Maybe POSIX)
-> (Comment -> Maybe POSIX -> Comment)
-> Lens Comment Comment (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Comment' {Maybe POSIX
createdTimestamp :: Maybe POSIX
$sel:createdTimestamp:Comment' :: Comment -> Maybe POSIX
createdTimestamp} -> Maybe POSIX
createdTimestamp) (\s :: Comment
s@Comment' {} Maybe POSIX
a -> Comment
s {$sel:createdTimestamp:Comment' :: Maybe POSIX
createdTimestamp = Maybe POSIX
a} :: Comment) ((Maybe POSIX -> f (Maybe POSIX)) -> Comment -> f Comment)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Comment
-> f Comment
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
comment_recipientId :: Lens.Lens' Comment (Prelude.Maybe Prelude.Text)
= (Comment -> Maybe Text)
-> (Comment -> Maybe Text -> Comment)
-> Lens Comment Comment (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Comment' {Maybe Text
recipientId :: Maybe Text
$sel:recipientId:Comment' :: Comment -> Maybe Text
recipientId} -> Maybe Text
recipientId) (\s :: Comment
s@Comment' {} Maybe Text
a -> Comment
s {$sel:recipientId:Comment' :: Maybe Text
recipientId = Maybe Text
a} :: Comment)
comment_parentId :: Lens.Lens' Comment (Prelude.Maybe Prelude.Text)
= (Comment -> Maybe Text)
-> (Comment -> Maybe Text -> Comment)
-> Lens Comment Comment (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Comment' {Maybe Text
parentId :: Maybe Text
$sel:parentId:Comment' :: Comment -> Maybe Text
parentId} -> Maybe Text
parentId) (\s :: Comment
s@Comment' {} Maybe Text
a -> Comment
s {$sel:parentId:Comment' :: Maybe Text
parentId = Maybe Text
a} :: Comment)
comment_commentId :: Lens.Lens' Comment Prelude.Text
= (Comment -> Text)
-> (Comment -> Text -> Comment) -> Lens Comment Comment Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Comment' {Text
commentId :: Text
$sel:commentId:Comment' :: Comment -> Text
commentId} -> Text
commentId) (\s :: Comment
s@Comment' {} Text
a -> Comment
s {$sel:commentId:Comment' :: Text
commentId = Text
a} :: Comment)
instance Core.FromJSON Comment where
parseJSON :: Value -> Parser Comment
parseJSON =
String -> (Object -> Parser Comment) -> Value -> Parser Comment
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Comment"
( \Object
x ->
Maybe CommentStatusType
-> Maybe (Sensitive Text)
-> Maybe CommentVisibilityType
-> Maybe Text
-> Maybe User
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Text
-> Comment
Comment'
(Maybe CommentStatusType
-> Maybe (Sensitive Text)
-> Maybe CommentVisibilityType
-> Maybe Text
-> Maybe User
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Text
-> Comment)
-> Parser (Maybe CommentStatusType)
-> Parser
(Maybe (Sensitive Text)
-> Maybe CommentVisibilityType
-> Maybe Text
-> Maybe User
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Text
-> Comment)
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
"Status")
Parser
(Maybe (Sensitive Text)
-> Maybe CommentVisibilityType
-> Maybe Text
-> Maybe User
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Text
-> Comment)
-> Parser (Maybe (Sensitive Text))
-> Parser
(Maybe CommentVisibilityType
-> Maybe Text
-> Maybe User
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Text
-> Comment)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Sensitive Text))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Text")
Parser
(Maybe CommentVisibilityType
-> Maybe Text
-> Maybe User
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Text
-> Comment)
-> Parser (Maybe CommentVisibilityType)
-> Parser
(Maybe Text
-> Maybe User
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Text
-> Comment)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe CommentVisibilityType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Visibility")
Parser
(Maybe Text
-> Maybe User
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Text
-> Comment)
-> Parser (Maybe Text)
-> Parser
(Maybe User
-> Maybe POSIX -> Maybe Text -> Maybe Text -> Text -> Comment)
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
"ThreadId")
Parser
(Maybe User
-> Maybe POSIX -> Maybe Text -> Maybe Text -> Text -> Comment)
-> Parser (Maybe User)
-> Parser
(Maybe POSIX -> Maybe Text -> Maybe Text -> Text -> Comment)
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 POSIX -> Maybe Text -> Maybe Text -> Text -> Comment)
-> Parser (Maybe POSIX)
-> Parser (Maybe Text -> Maybe Text -> Text -> Comment)
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 -> Maybe Text -> Text -> Comment)
-> Parser (Maybe Text) -> Parser (Maybe Text -> Text -> Comment)
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")
Parser (Maybe Text -> Text -> Comment)
-> Parser (Maybe Text) -> Parser (Text -> Comment)
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
"ParentId")
Parser (Text -> Comment) -> Parser Text -> Parser Comment
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"CommentId")
)
instance Prelude.Hashable Comment
instance Prelude.NFData Comment