{-# 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.CommentsForPullRequest
-- 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.CommentsForPullRequest where

import Amazonka.CodeCommit.Types.Comment
import Amazonka.CodeCommit.Types.Location
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Returns information about comments on a pull request.
--
-- /See:/ 'newCommentsForPullRequest' smart constructor.
data CommentsForPullRequest = CommentsForPullRequest'
  { -- | The full blob ID of the file on which you want to comment on the
    -- destination commit.
    CommentsForPullRequest -> Maybe Text
beforeBlobId :: Prelude.Maybe Prelude.Text,
    -- | Location information about the comment on the pull request, including
    -- the file name, line number, and whether the version of the file where
    -- the comment was made is BEFORE (destination branch) or AFTER (source
    -- branch).
    CommentsForPullRequest -> Maybe Location
location :: Prelude.Maybe Location,
    -- | The full commit ID of the commit that was the tip of the source branch
    -- at the time the comment was made.
    CommentsForPullRequest -> Maybe Text
afterCommitId :: Prelude.Maybe Prelude.Text,
    -- | The system-generated ID of the pull request.
    CommentsForPullRequest -> Maybe Text
pullRequestId :: Prelude.Maybe Prelude.Text,
    -- | The full blob ID of the file on which you want to comment on the source
    -- commit.
    CommentsForPullRequest -> Maybe Text
afterBlobId :: Prelude.Maybe Prelude.Text,
    -- | The full commit ID of the commit that was the tip of the destination
    -- branch when the pull request was created. This commit is superceded by
    -- the after commit in the source branch when and if you merge the source
    -- branch into the destination branch.
    CommentsForPullRequest -> Maybe Text
beforeCommitId :: Prelude.Maybe Prelude.Text,
    -- | The name of the repository that contains the pull request.
    CommentsForPullRequest -> Maybe Text
repositoryName :: Prelude.Maybe Prelude.Text,
    -- | An array of comment objects. Each comment object contains information
    -- about a comment on the pull request.
    CommentsForPullRequest -> Maybe [Comment]
comments :: Prelude.Maybe [Comment]
  }
  deriving (CommentsForPullRequest -> CommentsForPullRequest -> Bool
(CommentsForPullRequest -> CommentsForPullRequest -> Bool)
-> (CommentsForPullRequest -> CommentsForPullRequest -> Bool)
-> Eq CommentsForPullRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CommentsForPullRequest -> CommentsForPullRequest -> Bool
$c/= :: CommentsForPullRequest -> CommentsForPullRequest -> Bool
== :: CommentsForPullRequest -> CommentsForPullRequest -> Bool
$c== :: CommentsForPullRequest -> CommentsForPullRequest -> Bool
Prelude.Eq, ReadPrec [CommentsForPullRequest]
ReadPrec CommentsForPullRequest
Int -> ReadS CommentsForPullRequest
ReadS [CommentsForPullRequest]
(Int -> ReadS CommentsForPullRequest)
-> ReadS [CommentsForPullRequest]
-> ReadPrec CommentsForPullRequest
-> ReadPrec [CommentsForPullRequest]
-> Read CommentsForPullRequest
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CommentsForPullRequest]
$creadListPrec :: ReadPrec [CommentsForPullRequest]
readPrec :: ReadPrec CommentsForPullRequest
$creadPrec :: ReadPrec CommentsForPullRequest
readList :: ReadS [CommentsForPullRequest]
$creadList :: ReadS [CommentsForPullRequest]
readsPrec :: Int -> ReadS CommentsForPullRequest
$creadsPrec :: Int -> ReadS CommentsForPullRequest
Prelude.Read, Int -> CommentsForPullRequest -> ShowS
[CommentsForPullRequest] -> ShowS
CommentsForPullRequest -> String
(Int -> CommentsForPullRequest -> ShowS)
-> (CommentsForPullRequest -> String)
-> ([CommentsForPullRequest] -> ShowS)
-> Show CommentsForPullRequest
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CommentsForPullRequest] -> ShowS
$cshowList :: [CommentsForPullRequest] -> ShowS
show :: CommentsForPullRequest -> String
$cshow :: CommentsForPullRequest -> String
showsPrec :: Int -> CommentsForPullRequest -> ShowS
$cshowsPrec :: Int -> CommentsForPullRequest -> ShowS
Prelude.Show, (forall x. CommentsForPullRequest -> Rep CommentsForPullRequest x)
-> (forall x.
    Rep CommentsForPullRequest x -> CommentsForPullRequest)
-> Generic CommentsForPullRequest
forall x. Rep CommentsForPullRequest x -> CommentsForPullRequest
forall x. CommentsForPullRequest -> Rep CommentsForPullRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CommentsForPullRequest x -> CommentsForPullRequest
$cfrom :: forall x. CommentsForPullRequest -> Rep CommentsForPullRequest x
Prelude.Generic)

-- |
-- Create a value of 'CommentsForPullRequest' 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:
--
-- 'beforeBlobId', 'commentsForPullRequest_beforeBlobId' - The full blob ID of the file on which you want to comment on the
-- destination commit.
--
-- 'location', 'commentsForPullRequest_location' - Location information about the comment on the pull request, including
-- the file name, line number, and whether the version of the file where
-- the comment was made is BEFORE (destination branch) or AFTER (source
-- branch).
--
-- 'afterCommitId', 'commentsForPullRequest_afterCommitId' - The full commit ID of the commit that was the tip of the source branch
-- at the time the comment was made.
--
-- 'pullRequestId', 'commentsForPullRequest_pullRequestId' - The system-generated ID of the pull request.
--
-- 'afterBlobId', 'commentsForPullRequest_afterBlobId' - The full blob ID of the file on which you want to comment on the source
-- commit.
--
-- 'beforeCommitId', 'commentsForPullRequest_beforeCommitId' - The full commit ID of the commit that was the tip of the destination
-- branch when the pull request was created. This commit is superceded by
-- the after commit in the source branch when and if you merge the source
-- branch into the destination branch.
--
-- 'repositoryName', 'commentsForPullRequest_repositoryName' - The name of the repository that contains the pull request.
--
-- 'comments', 'commentsForPullRequest_comments' - An array of comment objects. Each comment object contains information
-- about a comment on the pull request.
newCommentsForPullRequest ::
  CommentsForPullRequest
newCommentsForPullRequest :: CommentsForPullRequest
newCommentsForPullRequest =
  CommentsForPullRequest' :: Maybe Text
-> Maybe Location
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Comment]
-> CommentsForPullRequest
CommentsForPullRequest'
    { $sel:beforeBlobId:CommentsForPullRequest' :: Maybe Text
beforeBlobId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:location:CommentsForPullRequest' :: Maybe Location
location = Maybe Location
forall a. Maybe a
Prelude.Nothing,
      $sel:afterCommitId:CommentsForPullRequest' :: Maybe Text
afterCommitId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:pullRequestId:CommentsForPullRequest' :: Maybe Text
pullRequestId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:afterBlobId:CommentsForPullRequest' :: Maybe Text
afterBlobId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:beforeCommitId:CommentsForPullRequest' :: Maybe Text
beforeCommitId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:repositoryName:CommentsForPullRequest' :: Maybe Text
repositoryName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:comments:CommentsForPullRequest' :: Maybe [Comment]
comments = Maybe [Comment]
forall a. Maybe a
Prelude.Nothing
    }

-- | The full blob ID of the file on which you want to comment on the
-- destination commit.
commentsForPullRequest_beforeBlobId :: Lens.Lens' CommentsForPullRequest (Prelude.Maybe Prelude.Text)
commentsForPullRequest_beforeBlobId :: (Maybe Text -> f (Maybe Text))
-> CommentsForPullRequest -> f CommentsForPullRequest
commentsForPullRequest_beforeBlobId = (CommentsForPullRequest -> Maybe Text)
-> (CommentsForPullRequest -> Maybe Text -> CommentsForPullRequest)
-> Lens
     CommentsForPullRequest
     CommentsForPullRequest
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CommentsForPullRequest' {Maybe Text
beforeBlobId :: Maybe Text
$sel:beforeBlobId:CommentsForPullRequest' :: CommentsForPullRequest -> Maybe Text
beforeBlobId} -> Maybe Text
beforeBlobId) (\s :: CommentsForPullRequest
s@CommentsForPullRequest' {} Maybe Text
a -> CommentsForPullRequest
s {$sel:beforeBlobId:CommentsForPullRequest' :: Maybe Text
beforeBlobId = Maybe Text
a} :: CommentsForPullRequest)

-- | Location information about the comment on the pull request, including
-- the file name, line number, and whether the version of the file where
-- the comment was made is BEFORE (destination branch) or AFTER (source
-- branch).
commentsForPullRequest_location :: Lens.Lens' CommentsForPullRequest (Prelude.Maybe Location)
commentsForPullRequest_location :: (Maybe Location -> f (Maybe Location))
-> CommentsForPullRequest -> f CommentsForPullRequest
commentsForPullRequest_location = (CommentsForPullRequest -> Maybe Location)
-> (CommentsForPullRequest
    -> Maybe Location -> CommentsForPullRequest)
-> Lens
     CommentsForPullRequest
     CommentsForPullRequest
     (Maybe Location)
     (Maybe Location)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CommentsForPullRequest' {Maybe Location
location :: Maybe Location
$sel:location:CommentsForPullRequest' :: CommentsForPullRequest -> Maybe Location
location} -> Maybe Location
location) (\s :: CommentsForPullRequest
s@CommentsForPullRequest' {} Maybe Location
a -> CommentsForPullRequest
s {$sel:location:CommentsForPullRequest' :: Maybe Location
location = Maybe Location
a} :: CommentsForPullRequest)

-- | The full commit ID of the commit that was the tip of the source branch
-- at the time the comment was made.
commentsForPullRequest_afterCommitId :: Lens.Lens' CommentsForPullRequest (Prelude.Maybe Prelude.Text)
commentsForPullRequest_afterCommitId :: (Maybe Text -> f (Maybe Text))
-> CommentsForPullRequest -> f CommentsForPullRequest
commentsForPullRequest_afterCommitId = (CommentsForPullRequest -> Maybe Text)
-> (CommentsForPullRequest -> Maybe Text -> CommentsForPullRequest)
-> Lens
     CommentsForPullRequest
     CommentsForPullRequest
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CommentsForPullRequest' {Maybe Text
afterCommitId :: Maybe Text
$sel:afterCommitId:CommentsForPullRequest' :: CommentsForPullRequest -> Maybe Text
afterCommitId} -> Maybe Text
afterCommitId) (\s :: CommentsForPullRequest
s@CommentsForPullRequest' {} Maybe Text
a -> CommentsForPullRequest
s {$sel:afterCommitId:CommentsForPullRequest' :: Maybe Text
afterCommitId = Maybe Text
a} :: CommentsForPullRequest)

-- | The system-generated ID of the pull request.
commentsForPullRequest_pullRequestId :: Lens.Lens' CommentsForPullRequest (Prelude.Maybe Prelude.Text)
commentsForPullRequest_pullRequestId :: (Maybe Text -> f (Maybe Text))
-> CommentsForPullRequest -> f CommentsForPullRequest
commentsForPullRequest_pullRequestId = (CommentsForPullRequest -> Maybe Text)
-> (CommentsForPullRequest -> Maybe Text -> CommentsForPullRequest)
-> Lens
     CommentsForPullRequest
     CommentsForPullRequest
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CommentsForPullRequest' {Maybe Text
pullRequestId :: Maybe Text
$sel:pullRequestId:CommentsForPullRequest' :: CommentsForPullRequest -> Maybe Text
pullRequestId} -> Maybe Text
pullRequestId) (\s :: CommentsForPullRequest
s@CommentsForPullRequest' {} Maybe Text
a -> CommentsForPullRequest
s {$sel:pullRequestId:CommentsForPullRequest' :: Maybe Text
pullRequestId = Maybe Text
a} :: CommentsForPullRequest)

-- | The full blob ID of the file on which you want to comment on the source
-- commit.
commentsForPullRequest_afterBlobId :: Lens.Lens' CommentsForPullRequest (Prelude.Maybe Prelude.Text)
commentsForPullRequest_afterBlobId :: (Maybe Text -> f (Maybe Text))
-> CommentsForPullRequest -> f CommentsForPullRequest
commentsForPullRequest_afterBlobId = (CommentsForPullRequest -> Maybe Text)
-> (CommentsForPullRequest -> Maybe Text -> CommentsForPullRequest)
-> Lens
     CommentsForPullRequest
     CommentsForPullRequest
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CommentsForPullRequest' {Maybe Text
afterBlobId :: Maybe Text
$sel:afterBlobId:CommentsForPullRequest' :: CommentsForPullRequest -> Maybe Text
afterBlobId} -> Maybe Text
afterBlobId) (\s :: CommentsForPullRequest
s@CommentsForPullRequest' {} Maybe Text
a -> CommentsForPullRequest
s {$sel:afterBlobId:CommentsForPullRequest' :: Maybe Text
afterBlobId = Maybe Text
a} :: CommentsForPullRequest)

-- | The full commit ID of the commit that was the tip of the destination
-- branch when the pull request was created. This commit is superceded by
-- the after commit in the source branch when and if you merge the source
-- branch into the destination branch.
commentsForPullRequest_beforeCommitId :: Lens.Lens' CommentsForPullRequest (Prelude.Maybe Prelude.Text)
commentsForPullRequest_beforeCommitId :: (Maybe Text -> f (Maybe Text))
-> CommentsForPullRequest -> f CommentsForPullRequest
commentsForPullRequest_beforeCommitId = (CommentsForPullRequest -> Maybe Text)
-> (CommentsForPullRequest -> Maybe Text -> CommentsForPullRequest)
-> Lens
     CommentsForPullRequest
     CommentsForPullRequest
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CommentsForPullRequest' {Maybe Text
beforeCommitId :: Maybe Text
$sel:beforeCommitId:CommentsForPullRequest' :: CommentsForPullRequest -> Maybe Text
beforeCommitId} -> Maybe Text
beforeCommitId) (\s :: CommentsForPullRequest
s@CommentsForPullRequest' {} Maybe Text
a -> CommentsForPullRequest
s {$sel:beforeCommitId:CommentsForPullRequest' :: Maybe Text
beforeCommitId = Maybe Text
a} :: CommentsForPullRequest)

-- | The name of the repository that contains the pull request.
commentsForPullRequest_repositoryName :: Lens.Lens' CommentsForPullRequest (Prelude.Maybe Prelude.Text)
commentsForPullRequest_repositoryName :: (Maybe Text -> f (Maybe Text))
-> CommentsForPullRequest -> f CommentsForPullRequest
commentsForPullRequest_repositoryName = (CommentsForPullRequest -> Maybe Text)
-> (CommentsForPullRequest -> Maybe Text -> CommentsForPullRequest)
-> Lens
     CommentsForPullRequest
     CommentsForPullRequest
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CommentsForPullRequest' {Maybe Text
repositoryName :: Maybe Text
$sel:repositoryName:CommentsForPullRequest' :: CommentsForPullRequest -> Maybe Text
repositoryName} -> Maybe Text
repositoryName) (\s :: CommentsForPullRequest
s@CommentsForPullRequest' {} Maybe Text
a -> CommentsForPullRequest
s {$sel:repositoryName:CommentsForPullRequest' :: Maybe Text
repositoryName = Maybe Text
a} :: CommentsForPullRequest)

-- | An array of comment objects. Each comment object contains information
-- about a comment on the pull request.
commentsForPullRequest_comments :: Lens.Lens' CommentsForPullRequest (Prelude.Maybe [Comment])
commentsForPullRequest_comments :: (Maybe [Comment] -> f (Maybe [Comment]))
-> CommentsForPullRequest -> f CommentsForPullRequest
commentsForPullRequest_comments = (CommentsForPullRequest -> Maybe [Comment])
-> (CommentsForPullRequest
    -> Maybe [Comment] -> CommentsForPullRequest)
-> Lens
     CommentsForPullRequest
     CommentsForPullRequest
     (Maybe [Comment])
     (Maybe [Comment])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CommentsForPullRequest' {Maybe [Comment]
comments :: Maybe [Comment]
$sel:comments:CommentsForPullRequest' :: CommentsForPullRequest -> Maybe [Comment]
comments} -> Maybe [Comment]
comments) (\s :: CommentsForPullRequest
s@CommentsForPullRequest' {} Maybe [Comment]
a -> CommentsForPullRequest
s {$sel:comments:CommentsForPullRequest' :: Maybe [Comment]
comments = Maybe [Comment]
a} :: CommentsForPullRequest) ((Maybe [Comment] -> f (Maybe [Comment]))
 -> CommentsForPullRequest -> f CommentsForPullRequest)
-> ((Maybe [Comment] -> f (Maybe [Comment]))
    -> Maybe [Comment] -> f (Maybe [Comment]))
-> (Maybe [Comment] -> f (Maybe [Comment]))
-> CommentsForPullRequest
-> f CommentsForPullRequest
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Comment] [Comment] [Comment] [Comment]
-> Iso
     (Maybe [Comment])
     (Maybe [Comment])
     (Maybe [Comment])
     (Maybe [Comment])
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 [Comment] [Comment] [Comment] [Comment]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.FromJSON CommentsForPullRequest where
  parseJSON :: Value -> Parser CommentsForPullRequest
parseJSON =
    String
-> (Object -> Parser CommentsForPullRequest)
-> Value
-> Parser CommentsForPullRequest
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"CommentsForPullRequest"
      ( \Object
x ->
          Maybe Text
-> Maybe Location
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Comment]
-> CommentsForPullRequest
CommentsForPullRequest'
            (Maybe Text
 -> Maybe Location
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe [Comment]
 -> CommentsForPullRequest)
-> Parser (Maybe Text)
-> Parser
     (Maybe Location
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Comment]
      -> CommentsForPullRequest)
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
"beforeBlobId")
            Parser
  (Maybe Location
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Comment]
   -> CommentsForPullRequest)
-> Parser (Maybe Location)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Comment]
      -> CommentsForPullRequest)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Location)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"location")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Comment]
   -> CommentsForPullRequest)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Comment]
      -> CommentsForPullRequest)
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
"afterCommitId")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Comment]
   -> CommentsForPullRequest)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Comment]
      -> CommentsForPullRequest)
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
"pullRequestId")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Comment]
   -> CommentsForPullRequest)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe [Comment] -> CommentsForPullRequest)
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
"afterBlobId")
            Parser
  (Maybe Text
   -> Maybe Text -> Maybe [Comment] -> CommentsForPullRequest)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe [Comment] -> CommentsForPullRequest)
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
"beforeCommitId")
            Parser (Maybe Text -> Maybe [Comment] -> CommentsForPullRequest)
-> Parser (Maybe Text)
-> Parser (Maybe [Comment] -> CommentsForPullRequest)
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
"repositoryName")
            Parser (Maybe [Comment] -> CommentsForPullRequest)
-> Parser (Maybe [Comment]) -> Parser CommentsForPullRequest
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Comment]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"comments" Parser (Maybe (Maybe [Comment]))
-> Maybe [Comment] -> Parser (Maybe [Comment])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Comment]
forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable CommentsForPullRequest

instance Prelude.NFData CommentsForPullRequest