{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.CodeCommit.Types.Comment
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.CodeCommit.Types.Comment where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Returns information about a specific comment.
--
-- /See:/ 'newComment' smart constructor.
data Comment = Comment'
  { -- | The date and time the comment was most recently modified, in timestamp
    -- format.
    Comment -> Maybe POSIX
lastModifiedDate :: Prelude.Maybe Core.POSIX,
    -- | The Amazon Resource Name (ARN) of the person who posted the comment.
    Comment -> Maybe Text
authorArn :: Prelude.Maybe Prelude.Text,
    -- | The content of the comment.
    Comment -> Maybe Text
content :: Prelude.Maybe Prelude.Text,
    -- | The emoji reactions to a comment, if any, submitted by the user whose
    -- credentials are associated with the call to the API.
    Comment -> Maybe [Text]
callerReactions :: Prelude.Maybe [Prelude.Text],
    -- | The date and time the comment was created, in timestamp format.
    Comment -> Maybe POSIX
creationDate :: Prelude.Maybe Core.POSIX,
    -- | A Boolean value indicating whether the comment has been deleted.
    Comment -> Maybe Bool
deleted :: Prelude.Maybe Prelude.Bool,
    -- | A unique, client-generated idempotency token that, when provided in a
    -- request, ensures the request cannot be repeated with a changed
    -- parameter. If a request is received with the same parameters and a token
    -- is included, the request returns information about the initial request
    -- that used that token.
    Comment -> Maybe Text
clientRequestToken :: Prelude.Maybe Prelude.Text,
    -- | The system-generated comment ID.
    Comment -> Maybe Text
commentId :: Prelude.Maybe Prelude.Text,
    -- | The ID of the comment for which this comment is a reply, if any.
    Comment -> Maybe Text
inReplyTo :: Prelude.Maybe Prelude.Text,
    -- | A string to integer map that represents the number of individual users
    -- who have responded to a comment with the specified reactions.
    Comment -> Maybe (HashMap Text Int)
reactionCounts :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Int)
  }
  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, ReadPrec [Comment]
ReadPrec Comment
Int -> ReadS Comment
ReadS [Comment]
(Int -> ReadS Comment)
-> ReadS [Comment]
-> ReadPrec Comment
-> ReadPrec [Comment]
-> Read Comment
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Comment]
$creadListPrec :: ReadPrec [Comment]
readPrec :: ReadPrec Comment
$creadPrec :: ReadPrec Comment
readList :: ReadS [Comment]
$creadList :: ReadS [Comment]
readsPrec :: Int -> ReadS Comment
$creadsPrec :: Int -> ReadS Comment
Prelude.Read, 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)

-- |
-- Create a value of 'Comment' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'lastModifiedDate', 'comment_lastModifiedDate' - The date and time the comment was most recently modified, in timestamp
-- format.
--
-- 'authorArn', 'comment_authorArn' - The Amazon Resource Name (ARN) of the person who posted the comment.
--
-- 'content', 'comment_content' - The content of the comment.
--
-- 'callerReactions', 'comment_callerReactions' - The emoji reactions to a comment, if any, submitted by the user whose
-- credentials are associated with the call to the API.
--
-- 'creationDate', 'comment_creationDate' - The date and time the comment was created, in timestamp format.
--
-- 'deleted', 'comment_deleted' - A Boolean value indicating whether the comment has been deleted.
--
-- 'clientRequestToken', 'comment_clientRequestToken' - A unique, client-generated idempotency token that, when provided in a
-- request, ensures the request cannot be repeated with a changed
-- parameter. If a request is received with the same parameters and a token
-- is included, the request returns information about the initial request
-- that used that token.
--
-- 'commentId', 'comment_commentId' - The system-generated comment ID.
--
-- 'inReplyTo', 'comment_inReplyTo' - The ID of the comment for which this comment is a reply, if any.
--
-- 'reactionCounts', 'comment_reactionCounts' - A string to integer map that represents the number of individual users
-- who have responded to a comment with the specified reactions.
newComment ::
  Comment
newComment :: Comment
newComment =
  Comment' :: Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe POSIX
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Int)
-> Comment
Comment'
    { $sel:lastModifiedDate:Comment' :: Maybe POSIX
lastModifiedDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:authorArn:Comment' :: Maybe Text
authorArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:content:Comment' :: Maybe Text
content = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:callerReactions:Comment' :: Maybe [Text]
callerReactions = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:creationDate:Comment' :: Maybe POSIX
creationDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:deleted:Comment' :: Maybe Bool
deleted = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:clientRequestToken:Comment' :: Maybe Text
clientRequestToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:commentId:Comment' :: Maybe Text
commentId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:inReplyTo:Comment' :: Maybe Text
inReplyTo = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:reactionCounts:Comment' :: Maybe (HashMap Text Int)
reactionCounts = Maybe (HashMap Text Int)
forall a. Maybe a
Prelude.Nothing
    }

-- | The date and time the comment was most recently modified, in timestamp
-- format.
comment_lastModifiedDate :: Lens.Lens' Comment (Prelude.Maybe Prelude.UTCTime)
comment_lastModifiedDate :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Comment -> f Comment
comment_lastModifiedDate = (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
lastModifiedDate :: Maybe POSIX
$sel:lastModifiedDate:Comment' :: Comment -> Maybe POSIX
lastModifiedDate} -> Maybe POSIX
lastModifiedDate) (\s :: Comment
s@Comment' {} Maybe POSIX
a -> Comment
s {$sel:lastModifiedDate:Comment' :: Maybe POSIX
lastModifiedDate = 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

-- | The Amazon Resource Name (ARN) of the person who posted the comment.
comment_authorArn :: Lens.Lens' Comment (Prelude.Maybe Prelude.Text)
comment_authorArn :: (Maybe Text -> f (Maybe Text)) -> Comment -> f Comment
comment_authorArn = (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
authorArn :: Maybe Text
$sel:authorArn:Comment' :: Comment -> Maybe Text
authorArn} -> Maybe Text
authorArn) (\s :: Comment
s@Comment' {} Maybe Text
a -> Comment
s {$sel:authorArn:Comment' :: Maybe Text
authorArn = Maybe Text
a} :: Comment)

-- | The content of the comment.
comment_content :: Lens.Lens' Comment (Prelude.Maybe Prelude.Text)
comment_content :: (Maybe Text -> f (Maybe Text)) -> Comment -> f Comment
comment_content = (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
content :: Maybe Text
$sel:content:Comment' :: Comment -> Maybe Text
content} -> Maybe Text
content) (\s :: Comment
s@Comment' {} Maybe Text
a -> Comment
s {$sel:content:Comment' :: Maybe Text
content = Maybe Text
a} :: Comment)

-- | The emoji reactions to a comment, if any, submitted by the user whose
-- credentials are associated with the call to the API.
comment_callerReactions :: Lens.Lens' Comment (Prelude.Maybe [Prelude.Text])
comment_callerReactions :: (Maybe [Text] -> f (Maybe [Text])) -> Comment -> f Comment
comment_callerReactions = (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]
callerReactions :: Maybe [Text]
$sel:callerReactions:Comment' :: Comment -> Maybe [Text]
callerReactions} -> Maybe [Text]
callerReactions) (\s :: Comment
s@Comment' {} Maybe [Text]
a -> Comment
s {$sel:callerReactions:Comment' :: Maybe [Text]
callerReactions = Maybe [Text]
a} :: Comment) ((Maybe [Text] -> f (Maybe [Text])) -> Comment -> f Comment)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> Comment
-> f Comment
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The date and time the comment was created, in timestamp format.
comment_creationDate :: Lens.Lens' Comment (Prelude.Maybe Prelude.UTCTime)
comment_creationDate :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Comment -> f Comment
comment_creationDate = (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
creationDate :: Maybe POSIX
$sel:creationDate:Comment' :: Comment -> Maybe POSIX
creationDate} -> Maybe POSIX
creationDate) (\s :: Comment
s@Comment' {} Maybe POSIX
a -> Comment
s {$sel:creationDate:Comment' :: Maybe POSIX
creationDate = 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

-- | A Boolean value indicating whether the comment has been deleted.
comment_deleted :: Lens.Lens' Comment (Prelude.Maybe Prelude.Bool)
comment_deleted :: (Maybe Bool -> f (Maybe Bool)) -> Comment -> f Comment
comment_deleted = (Comment -> Maybe Bool)
-> (Comment -> Maybe Bool -> Comment)
-> Lens Comment Comment (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Comment' {Maybe Bool
deleted :: Maybe Bool
$sel:deleted:Comment' :: Comment -> Maybe Bool
deleted} -> Maybe Bool
deleted) (\s :: Comment
s@Comment' {} Maybe Bool
a -> Comment
s {$sel:deleted:Comment' :: Maybe Bool
deleted = Maybe Bool
a} :: Comment)

-- | A unique, client-generated idempotency token that, when provided in a
-- request, ensures the request cannot be repeated with a changed
-- parameter. If a request is received with the same parameters and a token
-- is included, the request returns information about the initial request
-- that used that token.
comment_clientRequestToken :: Lens.Lens' Comment (Prelude.Maybe Prelude.Text)
comment_clientRequestToken :: (Maybe Text -> f (Maybe Text)) -> Comment -> f Comment
comment_clientRequestToken = (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
clientRequestToken :: Maybe Text
$sel:clientRequestToken:Comment' :: Comment -> Maybe Text
clientRequestToken} -> Maybe Text
clientRequestToken) (\s :: Comment
s@Comment' {} Maybe Text
a -> Comment
s {$sel:clientRequestToken:Comment' :: Maybe Text
clientRequestToken = Maybe Text
a} :: Comment)

-- | The system-generated comment ID.
comment_commentId :: Lens.Lens' Comment (Prelude.Maybe Prelude.Text)
comment_commentId :: (Maybe Text -> f (Maybe Text)) -> Comment -> f Comment
comment_commentId = (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
commentId :: Maybe Text
$sel:commentId:Comment' :: Comment -> Maybe Text
commentId} -> Maybe Text
commentId) (\s :: Comment
s@Comment' {} Maybe Text
a -> Comment
s {$sel:commentId:Comment' :: Maybe Text
commentId = Maybe Text
a} :: Comment)

-- | The ID of the comment for which this comment is a reply, if any.
comment_inReplyTo :: Lens.Lens' Comment (Prelude.Maybe Prelude.Text)
comment_inReplyTo :: (Maybe Text -> f (Maybe Text)) -> Comment -> f Comment
comment_inReplyTo = (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
inReplyTo :: Maybe Text
$sel:inReplyTo:Comment' :: Comment -> Maybe Text
inReplyTo} -> Maybe Text
inReplyTo) (\s :: Comment
s@Comment' {} Maybe Text
a -> Comment
s {$sel:inReplyTo:Comment' :: Maybe Text
inReplyTo = Maybe Text
a} :: Comment)

-- | A string to integer map that represents the number of individual users
-- who have responded to a comment with the specified reactions.
comment_reactionCounts :: Lens.Lens' Comment (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Int))
comment_reactionCounts :: (Maybe (HashMap Text Int) -> f (Maybe (HashMap Text Int)))
-> Comment -> f Comment
comment_reactionCounts = (Comment -> Maybe (HashMap Text Int))
-> (Comment -> Maybe (HashMap Text Int) -> Comment)
-> Lens
     Comment
     Comment
     (Maybe (HashMap Text Int))
     (Maybe (HashMap Text Int))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Comment' {Maybe (HashMap Text Int)
reactionCounts :: Maybe (HashMap Text Int)
$sel:reactionCounts:Comment' :: Comment -> Maybe (HashMap Text Int)
reactionCounts} -> Maybe (HashMap Text Int)
reactionCounts) (\s :: Comment
s@Comment' {} Maybe (HashMap Text Int)
a -> Comment
s {$sel:reactionCounts:Comment' :: Maybe (HashMap Text Int)
reactionCounts = Maybe (HashMap Text Int)
a} :: Comment) ((Maybe (HashMap Text Int) -> f (Maybe (HashMap Text Int)))
 -> Comment -> f Comment)
-> ((Maybe (HashMap Text Int) -> f (Maybe (HashMap Text Int)))
    -> Maybe (HashMap Text Int) -> f (Maybe (HashMap Text Int)))
-> (Maybe (HashMap Text Int) -> f (Maybe (HashMap Text Int)))
-> Comment
-> f Comment
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Int)
  (HashMap Text Int)
  (HashMap Text Int)
  (HashMap Text Int)
-> Iso
     (Maybe (HashMap Text Int))
     (Maybe (HashMap Text Int))
     (Maybe (HashMap Text Int))
     (Maybe (HashMap Text Int))
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
  (HashMap Text Int)
  (HashMap Text Int)
  (HashMap Text Int)
  (HashMap Text Int)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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 POSIX
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe POSIX
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Int)
-> Comment
Comment'
            (Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> Maybe [Text]
 -> Maybe POSIX
 -> Maybe Bool
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe (HashMap Text Int)
 -> Comment)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe POSIX
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Int)
      -> Comment)
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
"lastModifiedDate")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe POSIX
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Int)
   -> Comment)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe [Text]
      -> Maybe POSIX
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Int)
      -> 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
"authorArn")
            Parser
  (Maybe Text
   -> Maybe [Text]
   -> Maybe POSIX
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Int)
   -> Comment)
-> Parser (Maybe Text)
-> Parser
     (Maybe [Text]
      -> Maybe POSIX
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Int)
      -> 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
"content")
            Parser
  (Maybe [Text]
   -> Maybe POSIX
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Int)
   -> Comment)
-> Parser (Maybe [Text])
-> Parser
     (Maybe POSIX
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Int)
      -> Comment)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"callerReactions"
                            Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser
  (Maybe POSIX
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Int)
   -> Comment)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Int)
      -> 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
"creationDate")
            Parser
  (Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Int)
   -> Comment)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe Text -> Maybe (HashMap Text Int) -> Comment)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"deleted")
            Parser
  (Maybe Text
   -> Maybe Text -> Maybe Text -> Maybe (HashMap Text Int) -> Comment)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe Text -> Maybe (HashMap Text Int) -> 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
"clientRequestToken")
            Parser
  (Maybe Text -> Maybe Text -> Maybe (HashMap Text Int) -> Comment)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe (HashMap Text Int) -> 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
"commentId")
            Parser (Maybe Text -> Maybe (HashMap Text Int) -> Comment)
-> Parser (Maybe Text)
-> Parser (Maybe (HashMap Text Int) -> 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
"inReplyTo")
            Parser (Maybe (HashMap Text Int) -> Comment)
-> Parser (Maybe (HashMap Text Int)) -> Parser Comment
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Int)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"reactionCounts"
                            Parser (Maybe (Maybe (HashMap Text Int)))
-> Maybe (HashMap Text Int) -> Parser (Maybe (HashMap Text Int))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Int)
forall a. Monoid a => a
Prelude.mempty
                        )
      )

instance Prelude.Hashable Comment

instance Prelude.NFData Comment