{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.WorkDocs.Types.CommentStatusType
import Amazonka.WorkDocs.Types.CommentVisibilityType
import Amazonka.WorkDocs.Types.User
data =
{
:: Prelude.Maybe User,
:: Prelude.Maybe Data.POSIX,
:: Prelude.Maybe Prelude.Text,
:: Prelude.Maybe Prelude.Text,
:: Prelude.Maybe CommentStatusType,
:: Prelude.Maybe (Data.Sensitive Prelude.Text),
:: Prelude.Maybe Prelude.Text,
:: Prelude.Maybe CommentVisibilityType,
:: Prelude.Text
}
deriving (Comment -> Comment -> Bool
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
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. 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'
{ $sel:contributor:Comment' :: Maybe User
contributor = forall a. Maybe a
Prelude.Nothing,
$sel:createdTimestamp:Comment' :: Maybe POSIX
createdTimestamp = forall a. Maybe a
Prelude.Nothing,
$sel:parentId:Comment' :: Maybe Text
parentId = forall a. Maybe a
Prelude.Nothing,
$sel:recipientId:Comment' :: Maybe Text
recipientId = forall a. Maybe a
Prelude.Nothing,
$sel:status:Comment' :: Maybe CommentStatusType
status = forall a. Maybe a
Prelude.Nothing,
$sel:text:Comment' :: Maybe (Sensitive Text)
text = forall a. Maybe a
Prelude.Nothing,
$sel:threadId:Comment' :: Maybe Text
threadId = forall a. Maybe a
Prelude.Nothing,
$sel:visibility:Comment' :: Maybe CommentVisibilityType
visibility = forall a. Maybe a
Prelude.Nothing,
$sel:commentId:Comment' :: Text
commentId = Text
pCommentId_
}
comment_contributor :: Lens.Lens' Comment (Prelude.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)
= 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
comment_parentId :: Lens.Lens' Comment (Prelude.Maybe Prelude.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_recipientId :: Lens.Lens' Comment (Prelude.Maybe Prelude.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_status :: Lens.Lens' Comment (Prelude.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)
= 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall a. Iso' (Sensitive a) a
Data._Sensitive
comment_threadId :: Lens.Lens' Comment (Prelude.Maybe Prelude.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_visibility :: Lens.Lens' Comment (Prelude.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_commentId :: Lens.Lens' Comment Prelude.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 Data.FromJSON Comment where
parseJSON :: Value -> Parser Comment
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Comment"
( \Object
x ->
Maybe User
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe CommentStatusType
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe CommentVisibilityType
-> Text
-> Comment
Comment'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Contributor")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"CreatedTimestamp")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ParentId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"RecipientId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Status")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Text")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ThreadId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Visibility")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"CommentId")
)
instance Prelude.Hashable Comment where
hashWithSalt :: Int -> Comment -> Int
hashWithSalt Int
_salt Comment' {Maybe Text
Maybe (Sensitive Text)
Maybe POSIX
Maybe CommentStatusType
Maybe CommentVisibilityType
Maybe User
Text
commentId :: Text
visibility :: Maybe CommentVisibilityType
threadId :: Maybe Text
text :: Maybe (Sensitive Text)
status :: Maybe CommentStatusType
recipientId :: Maybe Text
parentId :: Maybe Text
createdTimestamp :: Maybe POSIX
contributor :: Maybe User
$sel:commentId:Comment' :: Comment -> Text
$sel:visibility:Comment' :: Comment -> Maybe CommentVisibilityType
$sel:threadId:Comment' :: Comment -> Maybe Text
$sel:text:Comment' :: Comment -> Maybe (Sensitive Text)
$sel:status:Comment' :: Comment -> Maybe CommentStatusType
$sel:recipientId:Comment' :: Comment -> Maybe Text
$sel:parentId:Comment' :: Comment -> Maybe Text
$sel:createdTimestamp:Comment' :: Comment -> Maybe POSIX
$sel:contributor:Comment' :: Comment -> Maybe User
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe User
contributor
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
createdTimestamp
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
parentId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
recipientId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CommentStatusType
status
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
text
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
threadId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CommentVisibilityType
visibility
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
commentId
instance Prelude.NFData Comment where
rnf :: Comment -> ()
rnf Comment' {Maybe Text
Maybe (Sensitive Text)
Maybe POSIX
Maybe CommentStatusType
Maybe CommentVisibilityType
Maybe User
Text
commentId :: Text
visibility :: Maybe CommentVisibilityType
threadId :: Maybe Text
text :: Maybe (Sensitive Text)
status :: Maybe CommentStatusType
recipientId :: Maybe Text
parentId :: Maybe Text
createdTimestamp :: Maybe POSIX
contributor :: Maybe User
$sel:commentId:Comment' :: Comment -> Text
$sel:visibility:Comment' :: Comment -> Maybe CommentVisibilityType
$sel:threadId:Comment' :: Comment -> Maybe Text
$sel:text:Comment' :: Comment -> Maybe (Sensitive Text)
$sel:status:Comment' :: Comment -> Maybe CommentStatusType
$sel:recipientId:Comment' :: Comment -> Maybe Text
$sel:parentId:Comment' :: Comment -> Maybe Text
$sel:createdTimestamp:Comment' :: Comment -> Maybe POSIX
$sel:contributor:Comment' :: Comment -> Maybe User
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe User
contributor
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
createdTimestamp
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
parentId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
recipientId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe CommentStatusType
status
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
text
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
threadId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe CommentVisibilityType
visibility
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
commentId