{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# 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.PostCommentForPullRequest
-- 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)
--
-- Posts a comment on a pull request.
module Amazonka.CodeCommit.PostCommentForPullRequest
  ( -- * Creating a Request
    PostCommentForPullRequest (..),
    newPostCommentForPullRequest,

    -- * Request Lenses
    postCommentForPullRequest_location,
    postCommentForPullRequest_clientRequestToken,
    postCommentForPullRequest_pullRequestId,
    postCommentForPullRequest_repositoryName,
    postCommentForPullRequest_beforeCommitId,
    postCommentForPullRequest_afterCommitId,
    postCommentForPullRequest_content,

    -- * Destructuring the Response
    PostCommentForPullRequestResponse (..),
    newPostCommentForPullRequestResponse,

    -- * Response Lenses
    postCommentForPullRequestResponse_beforeBlobId,
    postCommentForPullRequestResponse_location,
    postCommentForPullRequestResponse_afterCommitId,
    postCommentForPullRequestResponse_pullRequestId,
    postCommentForPullRequestResponse_afterBlobId,
    postCommentForPullRequestResponse_beforeCommitId,
    postCommentForPullRequestResponse_repositoryName,
    postCommentForPullRequestResponse_comment,
    postCommentForPullRequestResponse_httpStatus,
  )
where

import Amazonka.CodeCommit.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newPostCommentForPullRequest' smart constructor.
data PostCommentForPullRequest = PostCommentForPullRequest'
  { -- | The location of the change where you want to post your comment. If no
    -- location is provided, the comment is posted as a general comment on the
    -- pull request difference between the before commit ID and the after
    -- commit ID.
    PostCommentForPullRequest -> Maybe Location
location :: Prelude.Maybe Location,
    -- | 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.
    PostCommentForPullRequest -> Maybe Text
clientRequestToken :: Prelude.Maybe Prelude.Text,
    -- | The system-generated ID of the pull request. To get this ID, use
    -- ListPullRequests.
    PostCommentForPullRequest -> Text
pullRequestId :: Prelude.Text,
    -- | The name of the repository where you want to post a comment on a pull
    -- request.
    PostCommentForPullRequest -> Text
repositoryName :: Prelude.Text,
    -- | The full commit ID of the commit in the destination branch that was the
    -- tip of the branch at the time the pull request was created.
    PostCommentForPullRequest -> Text
beforeCommitId :: Prelude.Text,
    -- | The full commit ID of the commit in the source branch that is the
    -- current tip of the branch for the pull request when you post the
    -- comment.
    PostCommentForPullRequest -> Text
afterCommitId :: Prelude.Text,
    -- | The content of your comment on the change.
    PostCommentForPullRequest -> Text
content :: Prelude.Text
  }
  deriving (PostCommentForPullRequest -> PostCommentForPullRequest -> Bool
(PostCommentForPullRequest -> PostCommentForPullRequest -> Bool)
-> (PostCommentForPullRequest -> PostCommentForPullRequest -> Bool)
-> Eq PostCommentForPullRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PostCommentForPullRequest -> PostCommentForPullRequest -> Bool
$c/= :: PostCommentForPullRequest -> PostCommentForPullRequest -> Bool
== :: PostCommentForPullRequest -> PostCommentForPullRequest -> Bool
$c== :: PostCommentForPullRequest -> PostCommentForPullRequest -> Bool
Prelude.Eq, ReadPrec [PostCommentForPullRequest]
ReadPrec PostCommentForPullRequest
Int -> ReadS PostCommentForPullRequest
ReadS [PostCommentForPullRequest]
(Int -> ReadS PostCommentForPullRequest)
-> ReadS [PostCommentForPullRequest]
-> ReadPrec PostCommentForPullRequest
-> ReadPrec [PostCommentForPullRequest]
-> Read PostCommentForPullRequest
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PostCommentForPullRequest]
$creadListPrec :: ReadPrec [PostCommentForPullRequest]
readPrec :: ReadPrec PostCommentForPullRequest
$creadPrec :: ReadPrec PostCommentForPullRequest
readList :: ReadS [PostCommentForPullRequest]
$creadList :: ReadS [PostCommentForPullRequest]
readsPrec :: Int -> ReadS PostCommentForPullRequest
$creadsPrec :: Int -> ReadS PostCommentForPullRequest
Prelude.Read, Int -> PostCommentForPullRequest -> ShowS
[PostCommentForPullRequest] -> ShowS
PostCommentForPullRequest -> String
(Int -> PostCommentForPullRequest -> ShowS)
-> (PostCommentForPullRequest -> String)
-> ([PostCommentForPullRequest] -> ShowS)
-> Show PostCommentForPullRequest
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PostCommentForPullRequest] -> ShowS
$cshowList :: [PostCommentForPullRequest] -> ShowS
show :: PostCommentForPullRequest -> String
$cshow :: PostCommentForPullRequest -> String
showsPrec :: Int -> PostCommentForPullRequest -> ShowS
$cshowsPrec :: Int -> PostCommentForPullRequest -> ShowS
Prelude.Show, (forall x.
 PostCommentForPullRequest -> Rep PostCommentForPullRequest x)
-> (forall x.
    Rep PostCommentForPullRequest x -> PostCommentForPullRequest)
-> Generic PostCommentForPullRequest
forall x.
Rep PostCommentForPullRequest x -> PostCommentForPullRequest
forall x.
PostCommentForPullRequest -> Rep PostCommentForPullRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PostCommentForPullRequest x -> PostCommentForPullRequest
$cfrom :: forall x.
PostCommentForPullRequest -> Rep PostCommentForPullRequest x
Prelude.Generic)

-- |
-- Create a value of 'PostCommentForPullRequest' 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:
--
-- 'location', 'postCommentForPullRequest_location' - The location of the change where you want to post your comment. If no
-- location is provided, the comment is posted as a general comment on the
-- pull request difference between the before commit ID and the after
-- commit ID.
--
-- 'clientRequestToken', 'postCommentForPullRequest_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.
--
-- 'pullRequestId', 'postCommentForPullRequest_pullRequestId' - The system-generated ID of the pull request. To get this ID, use
-- ListPullRequests.
--
-- 'repositoryName', 'postCommentForPullRequest_repositoryName' - The name of the repository where you want to post a comment on a pull
-- request.
--
-- 'beforeCommitId', 'postCommentForPullRequest_beforeCommitId' - The full commit ID of the commit in the destination branch that was the
-- tip of the branch at the time the pull request was created.
--
-- 'afterCommitId', 'postCommentForPullRequest_afterCommitId' - The full commit ID of the commit in the source branch that is the
-- current tip of the branch for the pull request when you post the
-- comment.
--
-- 'content', 'postCommentForPullRequest_content' - The content of your comment on the change.
newPostCommentForPullRequest ::
  -- | 'pullRequestId'
  Prelude.Text ->
  -- | 'repositoryName'
  Prelude.Text ->
  -- | 'beforeCommitId'
  Prelude.Text ->
  -- | 'afterCommitId'
  Prelude.Text ->
  -- | 'content'
  Prelude.Text ->
  PostCommentForPullRequest
newPostCommentForPullRequest :: Text -> Text -> Text -> Text -> Text -> PostCommentForPullRequest
newPostCommentForPullRequest
  Text
pPullRequestId_
  Text
pRepositoryName_
  Text
pBeforeCommitId_
  Text
pAfterCommitId_
  Text
pContent_ =
    PostCommentForPullRequest' :: Maybe Location
-> Maybe Text
-> Text
-> Text
-> Text
-> Text
-> Text
-> PostCommentForPullRequest
PostCommentForPullRequest'
      { $sel:location:PostCommentForPullRequest' :: Maybe Location
location =
          Maybe Location
forall a. Maybe a
Prelude.Nothing,
        $sel:clientRequestToken:PostCommentForPullRequest' :: Maybe Text
clientRequestToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:pullRequestId:PostCommentForPullRequest' :: Text
pullRequestId = Text
pPullRequestId_,
        $sel:repositoryName:PostCommentForPullRequest' :: Text
repositoryName = Text
pRepositoryName_,
        $sel:beforeCommitId:PostCommentForPullRequest' :: Text
beforeCommitId = Text
pBeforeCommitId_,
        $sel:afterCommitId:PostCommentForPullRequest' :: Text
afterCommitId = Text
pAfterCommitId_,
        $sel:content:PostCommentForPullRequest' :: Text
content = Text
pContent_
      }

-- | The location of the change where you want to post your comment. If no
-- location is provided, the comment is posted as a general comment on the
-- pull request difference between the before commit ID and the after
-- commit ID.
postCommentForPullRequest_location :: Lens.Lens' PostCommentForPullRequest (Prelude.Maybe Location)
postCommentForPullRequest_location :: (Maybe Location -> f (Maybe Location))
-> PostCommentForPullRequest -> f PostCommentForPullRequest
postCommentForPullRequest_location = (PostCommentForPullRequest -> Maybe Location)
-> (PostCommentForPullRequest
    -> Maybe Location -> PostCommentForPullRequest)
-> Lens
     PostCommentForPullRequest
     PostCommentForPullRequest
     (Maybe Location)
     (Maybe Location)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PostCommentForPullRequest' {Maybe Location
location :: Maybe Location
$sel:location:PostCommentForPullRequest' :: PostCommentForPullRequest -> Maybe Location
location} -> Maybe Location
location) (\s :: PostCommentForPullRequest
s@PostCommentForPullRequest' {} Maybe Location
a -> PostCommentForPullRequest
s {$sel:location:PostCommentForPullRequest' :: Maybe Location
location = Maybe Location
a} :: PostCommentForPullRequest)

-- | 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.
postCommentForPullRequest_clientRequestToken :: Lens.Lens' PostCommentForPullRequest (Prelude.Maybe Prelude.Text)
postCommentForPullRequest_clientRequestToken :: (Maybe Text -> f (Maybe Text))
-> PostCommentForPullRequest -> f PostCommentForPullRequest
postCommentForPullRequest_clientRequestToken = (PostCommentForPullRequest -> Maybe Text)
-> (PostCommentForPullRequest
    -> Maybe Text -> PostCommentForPullRequest)
-> Lens
     PostCommentForPullRequest
     PostCommentForPullRequest
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PostCommentForPullRequest' {Maybe Text
clientRequestToken :: Maybe Text
$sel:clientRequestToken:PostCommentForPullRequest' :: PostCommentForPullRequest -> Maybe Text
clientRequestToken} -> Maybe Text
clientRequestToken) (\s :: PostCommentForPullRequest
s@PostCommentForPullRequest' {} Maybe Text
a -> PostCommentForPullRequest
s {$sel:clientRequestToken:PostCommentForPullRequest' :: Maybe Text
clientRequestToken = Maybe Text
a} :: PostCommentForPullRequest)

-- | The system-generated ID of the pull request. To get this ID, use
-- ListPullRequests.
postCommentForPullRequest_pullRequestId :: Lens.Lens' PostCommentForPullRequest Prelude.Text
postCommentForPullRequest_pullRequestId :: (Text -> f Text)
-> PostCommentForPullRequest -> f PostCommentForPullRequest
postCommentForPullRequest_pullRequestId = (PostCommentForPullRequest -> Text)
-> (PostCommentForPullRequest -> Text -> PostCommentForPullRequest)
-> Lens
     PostCommentForPullRequest PostCommentForPullRequest Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PostCommentForPullRequest' {Text
pullRequestId :: Text
$sel:pullRequestId:PostCommentForPullRequest' :: PostCommentForPullRequest -> Text
pullRequestId} -> Text
pullRequestId) (\s :: PostCommentForPullRequest
s@PostCommentForPullRequest' {} Text
a -> PostCommentForPullRequest
s {$sel:pullRequestId:PostCommentForPullRequest' :: Text
pullRequestId = Text
a} :: PostCommentForPullRequest)

-- | The name of the repository where you want to post a comment on a pull
-- request.
postCommentForPullRequest_repositoryName :: Lens.Lens' PostCommentForPullRequest Prelude.Text
postCommentForPullRequest_repositoryName :: (Text -> f Text)
-> PostCommentForPullRequest -> f PostCommentForPullRequest
postCommentForPullRequest_repositoryName = (PostCommentForPullRequest -> Text)
-> (PostCommentForPullRequest -> Text -> PostCommentForPullRequest)
-> Lens
     PostCommentForPullRequest PostCommentForPullRequest Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PostCommentForPullRequest' {Text
repositoryName :: Text
$sel:repositoryName:PostCommentForPullRequest' :: PostCommentForPullRequest -> Text
repositoryName} -> Text
repositoryName) (\s :: PostCommentForPullRequest
s@PostCommentForPullRequest' {} Text
a -> PostCommentForPullRequest
s {$sel:repositoryName:PostCommentForPullRequest' :: Text
repositoryName = Text
a} :: PostCommentForPullRequest)

-- | The full commit ID of the commit in the destination branch that was the
-- tip of the branch at the time the pull request was created.
postCommentForPullRequest_beforeCommitId :: Lens.Lens' PostCommentForPullRequest Prelude.Text
postCommentForPullRequest_beforeCommitId :: (Text -> f Text)
-> PostCommentForPullRequest -> f PostCommentForPullRequest
postCommentForPullRequest_beforeCommitId = (PostCommentForPullRequest -> Text)
-> (PostCommentForPullRequest -> Text -> PostCommentForPullRequest)
-> Lens
     PostCommentForPullRequest PostCommentForPullRequest Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PostCommentForPullRequest' {Text
beforeCommitId :: Text
$sel:beforeCommitId:PostCommentForPullRequest' :: PostCommentForPullRequest -> Text
beforeCommitId} -> Text
beforeCommitId) (\s :: PostCommentForPullRequest
s@PostCommentForPullRequest' {} Text
a -> PostCommentForPullRequest
s {$sel:beforeCommitId:PostCommentForPullRequest' :: Text
beforeCommitId = Text
a} :: PostCommentForPullRequest)

-- | The full commit ID of the commit in the source branch that is the
-- current tip of the branch for the pull request when you post the
-- comment.
postCommentForPullRequest_afterCommitId :: Lens.Lens' PostCommentForPullRequest Prelude.Text
postCommentForPullRequest_afterCommitId :: (Text -> f Text)
-> PostCommentForPullRequest -> f PostCommentForPullRequest
postCommentForPullRequest_afterCommitId = (PostCommentForPullRequest -> Text)
-> (PostCommentForPullRequest -> Text -> PostCommentForPullRequest)
-> Lens
     PostCommentForPullRequest PostCommentForPullRequest Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PostCommentForPullRequest' {Text
afterCommitId :: Text
$sel:afterCommitId:PostCommentForPullRequest' :: PostCommentForPullRequest -> Text
afterCommitId} -> Text
afterCommitId) (\s :: PostCommentForPullRequest
s@PostCommentForPullRequest' {} Text
a -> PostCommentForPullRequest
s {$sel:afterCommitId:PostCommentForPullRequest' :: Text
afterCommitId = Text
a} :: PostCommentForPullRequest)

-- | The content of your comment on the change.
postCommentForPullRequest_content :: Lens.Lens' PostCommentForPullRequest Prelude.Text
postCommentForPullRequest_content :: (Text -> f Text)
-> PostCommentForPullRequest -> f PostCommentForPullRequest
postCommentForPullRequest_content = (PostCommentForPullRequest -> Text)
-> (PostCommentForPullRequest -> Text -> PostCommentForPullRequest)
-> Lens
     PostCommentForPullRequest PostCommentForPullRequest Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PostCommentForPullRequest' {Text
content :: Text
$sel:content:PostCommentForPullRequest' :: PostCommentForPullRequest -> Text
content} -> Text
content) (\s :: PostCommentForPullRequest
s@PostCommentForPullRequest' {} Text
a -> PostCommentForPullRequest
s {$sel:content:PostCommentForPullRequest' :: Text
content = Text
a} :: PostCommentForPullRequest)

instance Core.AWSRequest PostCommentForPullRequest where
  type
    AWSResponse PostCommentForPullRequest =
      PostCommentForPullRequestResponse
  request :: PostCommentForPullRequest -> Request PostCommentForPullRequest
request = Service
-> PostCommentForPullRequest -> Request PostCommentForPullRequest
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy PostCommentForPullRequest
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse PostCommentForPullRequest)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse PostCommentForPullRequest))
-> Logger
-> Service
-> Proxy PostCommentForPullRequest
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse PostCommentForPullRequest)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe Location
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Comment
-> Int
-> PostCommentForPullRequestResponse
PostCommentForPullRequestResponse'
            (Maybe Text
 -> Maybe Location
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Comment
 -> Int
 -> PostCommentForPullRequestResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Location
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Comment
      -> Int
      -> PostCommentForPullRequestResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"beforeBlobId")
            Either
  String
  (Maybe Location
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Comment
   -> Int
   -> PostCommentForPullRequestResponse)
-> Either String (Maybe Location)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Comment
      -> Int
      -> PostCommentForPullRequestResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Location)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"location")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Comment
   -> Int
   -> PostCommentForPullRequestResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Comment
      -> Int
      -> PostCommentForPullRequestResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"afterCommitId")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Comment
   -> Int
   -> PostCommentForPullRequestResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Comment
      -> Int
      -> PostCommentForPullRequestResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"pullRequestId")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Comment
   -> Int
   -> PostCommentForPullRequestResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Comment
      -> Int
      -> PostCommentForPullRequestResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"afterBlobId")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Comment
   -> Int
   -> PostCommentForPullRequestResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Comment -> Int -> PostCommentForPullRequestResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"beforeCommitId")
            Either
  String
  (Maybe Text
   -> Maybe Comment -> Int -> PostCommentForPullRequestResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe Comment -> Int -> PostCommentForPullRequestResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"repositoryName")
            Either
  String (Maybe Comment -> Int -> PostCommentForPullRequestResponse)
-> Either String (Maybe Comment)
-> Either String (Int -> PostCommentForPullRequestResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Comment)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"comment")
            Either String (Int -> PostCommentForPullRequestResponse)
-> Either String Int
-> Either String PostCommentForPullRequestResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable PostCommentForPullRequest

instance Prelude.NFData PostCommentForPullRequest

instance Core.ToHeaders PostCommentForPullRequest where
  toHeaders :: PostCommentForPullRequest -> ResponseHeaders
toHeaders =
    ResponseHeaders -> PostCommentForPullRequest -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"CodeCommit_20150413.PostCommentForPullRequest" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON PostCommentForPullRequest where
  toJSON :: PostCommentForPullRequest -> Value
toJSON PostCommentForPullRequest' {Maybe Text
Maybe Location
Text
content :: Text
afterCommitId :: Text
beforeCommitId :: Text
repositoryName :: Text
pullRequestId :: Text
clientRequestToken :: Maybe Text
location :: Maybe Location
$sel:content:PostCommentForPullRequest' :: PostCommentForPullRequest -> Text
$sel:afterCommitId:PostCommentForPullRequest' :: PostCommentForPullRequest -> Text
$sel:beforeCommitId:PostCommentForPullRequest' :: PostCommentForPullRequest -> Text
$sel:repositoryName:PostCommentForPullRequest' :: PostCommentForPullRequest -> Text
$sel:pullRequestId:PostCommentForPullRequest' :: PostCommentForPullRequest -> Text
$sel:clientRequestToken:PostCommentForPullRequest' :: PostCommentForPullRequest -> Maybe Text
$sel:location:PostCommentForPullRequest' :: PostCommentForPullRequest -> Maybe Location
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"location" Text -> Location -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Location -> Pair) -> Maybe Location -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Location
location,
            (Text
"clientRequestToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
clientRequestToken,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"pullRequestId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
pullRequestId),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"repositoryName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
repositoryName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"beforeCommitId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
beforeCommitId),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"afterCommitId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
afterCommitId),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"content" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
content)
          ]
      )

instance Core.ToPath PostCommentForPullRequest where
  toPath :: PostCommentForPullRequest -> ByteString
toPath = ByteString -> PostCommentForPullRequest -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery PostCommentForPullRequest where
  toQuery :: PostCommentForPullRequest -> QueryString
toQuery = QueryString -> PostCommentForPullRequest -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newPostCommentForPullRequestResponse' smart constructor.
data PostCommentForPullRequestResponse = PostCommentForPullRequestResponse'
  { -- | In the directionality of the pull request, the blob ID of the before
    -- blob.
    PostCommentForPullRequestResponse -> Maybe Text
beforeBlobId :: Prelude.Maybe Prelude.Text,
    -- | The location of the change where you posted your comment.
    PostCommentForPullRequestResponse -> Maybe Location
location :: Prelude.Maybe Location,
    -- | The full commit ID of the commit in the destination branch where the
    -- pull request is merged.
    PostCommentForPullRequestResponse -> Maybe Text
afterCommitId :: Prelude.Maybe Prelude.Text,
    -- | The system-generated ID of the pull request.
    PostCommentForPullRequestResponse -> Maybe Text
pullRequestId :: Prelude.Maybe Prelude.Text,
    -- | In the directionality of the pull request, the blob ID of the after
    -- blob.
    PostCommentForPullRequestResponse -> Maybe Text
afterBlobId :: Prelude.Maybe Prelude.Text,
    -- | The full commit ID of the commit in the source branch used to create the
    -- pull request, or in the case of an updated pull request, the full commit
    -- ID of the commit used to update the pull request.
    PostCommentForPullRequestResponse -> Maybe Text
beforeCommitId :: Prelude.Maybe Prelude.Text,
    -- | The name of the repository where you posted a comment on a pull request.
    PostCommentForPullRequestResponse -> Maybe Text
repositoryName :: Prelude.Maybe Prelude.Text,
    -- | The content of the comment you posted.
    PostCommentForPullRequestResponse -> Maybe Comment
comment :: Prelude.Maybe Comment,
    -- | The response's http status code.
    PostCommentForPullRequestResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (PostCommentForPullRequestResponse
-> PostCommentForPullRequestResponse -> Bool
(PostCommentForPullRequestResponse
 -> PostCommentForPullRequestResponse -> Bool)
-> (PostCommentForPullRequestResponse
    -> PostCommentForPullRequestResponse -> Bool)
-> Eq PostCommentForPullRequestResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PostCommentForPullRequestResponse
-> PostCommentForPullRequestResponse -> Bool
$c/= :: PostCommentForPullRequestResponse
-> PostCommentForPullRequestResponse -> Bool
== :: PostCommentForPullRequestResponse
-> PostCommentForPullRequestResponse -> Bool
$c== :: PostCommentForPullRequestResponse
-> PostCommentForPullRequestResponse -> Bool
Prelude.Eq, ReadPrec [PostCommentForPullRequestResponse]
ReadPrec PostCommentForPullRequestResponse
Int -> ReadS PostCommentForPullRequestResponse
ReadS [PostCommentForPullRequestResponse]
(Int -> ReadS PostCommentForPullRequestResponse)
-> ReadS [PostCommentForPullRequestResponse]
-> ReadPrec PostCommentForPullRequestResponse
-> ReadPrec [PostCommentForPullRequestResponse]
-> Read PostCommentForPullRequestResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PostCommentForPullRequestResponse]
$creadListPrec :: ReadPrec [PostCommentForPullRequestResponse]
readPrec :: ReadPrec PostCommentForPullRequestResponse
$creadPrec :: ReadPrec PostCommentForPullRequestResponse
readList :: ReadS [PostCommentForPullRequestResponse]
$creadList :: ReadS [PostCommentForPullRequestResponse]
readsPrec :: Int -> ReadS PostCommentForPullRequestResponse
$creadsPrec :: Int -> ReadS PostCommentForPullRequestResponse
Prelude.Read, Int -> PostCommentForPullRequestResponse -> ShowS
[PostCommentForPullRequestResponse] -> ShowS
PostCommentForPullRequestResponse -> String
(Int -> PostCommentForPullRequestResponse -> ShowS)
-> (PostCommentForPullRequestResponse -> String)
-> ([PostCommentForPullRequestResponse] -> ShowS)
-> Show PostCommentForPullRequestResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PostCommentForPullRequestResponse] -> ShowS
$cshowList :: [PostCommentForPullRequestResponse] -> ShowS
show :: PostCommentForPullRequestResponse -> String
$cshow :: PostCommentForPullRequestResponse -> String
showsPrec :: Int -> PostCommentForPullRequestResponse -> ShowS
$cshowsPrec :: Int -> PostCommentForPullRequestResponse -> ShowS
Prelude.Show, (forall x.
 PostCommentForPullRequestResponse
 -> Rep PostCommentForPullRequestResponse x)
-> (forall x.
    Rep PostCommentForPullRequestResponse x
    -> PostCommentForPullRequestResponse)
-> Generic PostCommentForPullRequestResponse
forall x.
Rep PostCommentForPullRequestResponse x
-> PostCommentForPullRequestResponse
forall x.
PostCommentForPullRequestResponse
-> Rep PostCommentForPullRequestResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PostCommentForPullRequestResponse x
-> PostCommentForPullRequestResponse
$cfrom :: forall x.
PostCommentForPullRequestResponse
-> Rep PostCommentForPullRequestResponse x
Prelude.Generic)

-- |
-- Create a value of 'PostCommentForPullRequestResponse' 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', 'postCommentForPullRequestResponse_beforeBlobId' - In the directionality of the pull request, the blob ID of the before
-- blob.
--
-- 'location', 'postCommentForPullRequestResponse_location' - The location of the change where you posted your comment.
--
-- 'afterCommitId', 'postCommentForPullRequestResponse_afterCommitId' - The full commit ID of the commit in the destination branch where the
-- pull request is merged.
--
-- 'pullRequestId', 'postCommentForPullRequestResponse_pullRequestId' - The system-generated ID of the pull request.
--
-- 'afterBlobId', 'postCommentForPullRequestResponse_afterBlobId' - In the directionality of the pull request, the blob ID of the after
-- blob.
--
-- 'beforeCommitId', 'postCommentForPullRequestResponse_beforeCommitId' - The full commit ID of the commit in the source branch used to create the
-- pull request, or in the case of an updated pull request, the full commit
-- ID of the commit used to update the pull request.
--
-- 'repositoryName', 'postCommentForPullRequestResponse_repositoryName' - The name of the repository where you posted a comment on a pull request.
--
-- 'comment', 'postCommentForPullRequestResponse_comment' - The content of the comment you posted.
--
-- 'httpStatus', 'postCommentForPullRequestResponse_httpStatus' - The response's http status code.
newPostCommentForPullRequestResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  PostCommentForPullRequestResponse
newPostCommentForPullRequestResponse :: Int -> PostCommentForPullRequestResponse
newPostCommentForPullRequestResponse Int
pHttpStatus_ =
  PostCommentForPullRequestResponse' :: Maybe Text
-> Maybe Location
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Comment
-> Int
-> PostCommentForPullRequestResponse
PostCommentForPullRequestResponse'
    { $sel:beforeBlobId:PostCommentForPullRequestResponse' :: Maybe Text
beforeBlobId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:location:PostCommentForPullRequestResponse' :: Maybe Location
location = Maybe Location
forall a. Maybe a
Prelude.Nothing,
      $sel:afterCommitId:PostCommentForPullRequestResponse' :: Maybe Text
afterCommitId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:pullRequestId:PostCommentForPullRequestResponse' :: Maybe Text
pullRequestId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:afterBlobId:PostCommentForPullRequestResponse' :: Maybe Text
afterBlobId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:beforeCommitId:PostCommentForPullRequestResponse' :: Maybe Text
beforeCommitId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:repositoryName:PostCommentForPullRequestResponse' :: Maybe Text
repositoryName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:comment:PostCommentForPullRequestResponse' :: Maybe Comment
comment = Maybe Comment
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:PostCommentForPullRequestResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | In the directionality of the pull request, the blob ID of the before
-- blob.
postCommentForPullRequestResponse_beforeBlobId :: Lens.Lens' PostCommentForPullRequestResponse (Prelude.Maybe Prelude.Text)
postCommentForPullRequestResponse_beforeBlobId :: (Maybe Text -> f (Maybe Text))
-> PostCommentForPullRequestResponse
-> f PostCommentForPullRequestResponse
postCommentForPullRequestResponse_beforeBlobId = (PostCommentForPullRequestResponse -> Maybe Text)
-> (PostCommentForPullRequestResponse
    -> Maybe Text -> PostCommentForPullRequestResponse)
-> Lens
     PostCommentForPullRequestResponse
     PostCommentForPullRequestResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PostCommentForPullRequestResponse' {Maybe Text
beforeBlobId :: Maybe Text
$sel:beforeBlobId:PostCommentForPullRequestResponse' :: PostCommentForPullRequestResponse -> Maybe Text
beforeBlobId} -> Maybe Text
beforeBlobId) (\s :: PostCommentForPullRequestResponse
s@PostCommentForPullRequestResponse' {} Maybe Text
a -> PostCommentForPullRequestResponse
s {$sel:beforeBlobId:PostCommentForPullRequestResponse' :: Maybe Text
beforeBlobId = Maybe Text
a} :: PostCommentForPullRequestResponse)

-- | The location of the change where you posted your comment.
postCommentForPullRequestResponse_location :: Lens.Lens' PostCommentForPullRequestResponse (Prelude.Maybe Location)
postCommentForPullRequestResponse_location :: (Maybe Location -> f (Maybe Location))
-> PostCommentForPullRequestResponse
-> f PostCommentForPullRequestResponse
postCommentForPullRequestResponse_location = (PostCommentForPullRequestResponse -> Maybe Location)
-> (PostCommentForPullRequestResponse
    -> Maybe Location -> PostCommentForPullRequestResponse)
-> Lens
     PostCommentForPullRequestResponse
     PostCommentForPullRequestResponse
     (Maybe Location)
     (Maybe Location)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PostCommentForPullRequestResponse' {Maybe Location
location :: Maybe Location
$sel:location:PostCommentForPullRequestResponse' :: PostCommentForPullRequestResponse -> Maybe Location
location} -> Maybe Location
location) (\s :: PostCommentForPullRequestResponse
s@PostCommentForPullRequestResponse' {} Maybe Location
a -> PostCommentForPullRequestResponse
s {$sel:location:PostCommentForPullRequestResponse' :: Maybe Location
location = Maybe Location
a} :: PostCommentForPullRequestResponse)

-- | The full commit ID of the commit in the destination branch where the
-- pull request is merged.
postCommentForPullRequestResponse_afterCommitId :: Lens.Lens' PostCommentForPullRequestResponse (Prelude.Maybe Prelude.Text)
postCommentForPullRequestResponse_afterCommitId :: (Maybe Text -> f (Maybe Text))
-> PostCommentForPullRequestResponse
-> f PostCommentForPullRequestResponse
postCommentForPullRequestResponse_afterCommitId = (PostCommentForPullRequestResponse -> Maybe Text)
-> (PostCommentForPullRequestResponse
    -> Maybe Text -> PostCommentForPullRequestResponse)
-> Lens
     PostCommentForPullRequestResponse
     PostCommentForPullRequestResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PostCommentForPullRequestResponse' {Maybe Text
afterCommitId :: Maybe Text
$sel:afterCommitId:PostCommentForPullRequestResponse' :: PostCommentForPullRequestResponse -> Maybe Text
afterCommitId} -> Maybe Text
afterCommitId) (\s :: PostCommentForPullRequestResponse
s@PostCommentForPullRequestResponse' {} Maybe Text
a -> PostCommentForPullRequestResponse
s {$sel:afterCommitId:PostCommentForPullRequestResponse' :: Maybe Text
afterCommitId = Maybe Text
a} :: PostCommentForPullRequestResponse)

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

-- | In the directionality of the pull request, the blob ID of the after
-- blob.
postCommentForPullRequestResponse_afterBlobId :: Lens.Lens' PostCommentForPullRequestResponse (Prelude.Maybe Prelude.Text)
postCommentForPullRequestResponse_afterBlobId :: (Maybe Text -> f (Maybe Text))
-> PostCommentForPullRequestResponse
-> f PostCommentForPullRequestResponse
postCommentForPullRequestResponse_afterBlobId = (PostCommentForPullRequestResponse -> Maybe Text)
-> (PostCommentForPullRequestResponse
    -> Maybe Text -> PostCommentForPullRequestResponse)
-> Lens
     PostCommentForPullRequestResponse
     PostCommentForPullRequestResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PostCommentForPullRequestResponse' {Maybe Text
afterBlobId :: Maybe Text
$sel:afterBlobId:PostCommentForPullRequestResponse' :: PostCommentForPullRequestResponse -> Maybe Text
afterBlobId} -> Maybe Text
afterBlobId) (\s :: PostCommentForPullRequestResponse
s@PostCommentForPullRequestResponse' {} Maybe Text
a -> PostCommentForPullRequestResponse
s {$sel:afterBlobId:PostCommentForPullRequestResponse' :: Maybe Text
afterBlobId = Maybe Text
a} :: PostCommentForPullRequestResponse)

-- | The full commit ID of the commit in the source branch used to create the
-- pull request, or in the case of an updated pull request, the full commit
-- ID of the commit used to update the pull request.
postCommentForPullRequestResponse_beforeCommitId :: Lens.Lens' PostCommentForPullRequestResponse (Prelude.Maybe Prelude.Text)
postCommentForPullRequestResponse_beforeCommitId :: (Maybe Text -> f (Maybe Text))
-> PostCommentForPullRequestResponse
-> f PostCommentForPullRequestResponse
postCommentForPullRequestResponse_beforeCommitId = (PostCommentForPullRequestResponse -> Maybe Text)
-> (PostCommentForPullRequestResponse
    -> Maybe Text -> PostCommentForPullRequestResponse)
-> Lens
     PostCommentForPullRequestResponse
     PostCommentForPullRequestResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PostCommentForPullRequestResponse' {Maybe Text
beforeCommitId :: Maybe Text
$sel:beforeCommitId:PostCommentForPullRequestResponse' :: PostCommentForPullRequestResponse -> Maybe Text
beforeCommitId} -> Maybe Text
beforeCommitId) (\s :: PostCommentForPullRequestResponse
s@PostCommentForPullRequestResponse' {} Maybe Text
a -> PostCommentForPullRequestResponse
s {$sel:beforeCommitId:PostCommentForPullRequestResponse' :: Maybe Text
beforeCommitId = Maybe Text
a} :: PostCommentForPullRequestResponse)

-- | The name of the repository where you posted a comment on a pull request.
postCommentForPullRequestResponse_repositoryName :: Lens.Lens' PostCommentForPullRequestResponse (Prelude.Maybe Prelude.Text)
postCommentForPullRequestResponse_repositoryName :: (Maybe Text -> f (Maybe Text))
-> PostCommentForPullRequestResponse
-> f PostCommentForPullRequestResponse
postCommentForPullRequestResponse_repositoryName = (PostCommentForPullRequestResponse -> Maybe Text)
-> (PostCommentForPullRequestResponse
    -> Maybe Text -> PostCommentForPullRequestResponse)
-> Lens
     PostCommentForPullRequestResponse
     PostCommentForPullRequestResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PostCommentForPullRequestResponse' {Maybe Text
repositoryName :: Maybe Text
$sel:repositoryName:PostCommentForPullRequestResponse' :: PostCommentForPullRequestResponse -> Maybe Text
repositoryName} -> Maybe Text
repositoryName) (\s :: PostCommentForPullRequestResponse
s@PostCommentForPullRequestResponse' {} Maybe Text
a -> PostCommentForPullRequestResponse
s {$sel:repositoryName:PostCommentForPullRequestResponse' :: Maybe Text
repositoryName = Maybe Text
a} :: PostCommentForPullRequestResponse)

-- | The content of the comment you posted.
postCommentForPullRequestResponse_comment :: Lens.Lens' PostCommentForPullRequestResponse (Prelude.Maybe Comment)
postCommentForPullRequestResponse_comment :: (Maybe Comment -> f (Maybe Comment))
-> PostCommentForPullRequestResponse
-> f PostCommentForPullRequestResponse
postCommentForPullRequestResponse_comment = (PostCommentForPullRequestResponse -> Maybe Comment)
-> (PostCommentForPullRequestResponse
    -> Maybe Comment -> PostCommentForPullRequestResponse)
-> Lens
     PostCommentForPullRequestResponse
     PostCommentForPullRequestResponse
     (Maybe Comment)
     (Maybe Comment)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PostCommentForPullRequestResponse' {Maybe Comment
comment :: Maybe Comment
$sel:comment:PostCommentForPullRequestResponse' :: PostCommentForPullRequestResponse -> Maybe Comment
comment} -> Maybe Comment
comment) (\s :: PostCommentForPullRequestResponse
s@PostCommentForPullRequestResponse' {} Maybe Comment
a -> PostCommentForPullRequestResponse
s {$sel:comment:PostCommentForPullRequestResponse' :: Maybe Comment
comment = Maybe Comment
a} :: PostCommentForPullRequestResponse)

-- | The response's http status code.
postCommentForPullRequestResponse_httpStatus :: Lens.Lens' PostCommentForPullRequestResponse Prelude.Int
postCommentForPullRequestResponse_httpStatus :: (Int -> f Int)
-> PostCommentForPullRequestResponse
-> f PostCommentForPullRequestResponse
postCommentForPullRequestResponse_httpStatus = (PostCommentForPullRequestResponse -> Int)
-> (PostCommentForPullRequestResponse
    -> Int -> PostCommentForPullRequestResponse)
-> Lens
     PostCommentForPullRequestResponse
     PostCommentForPullRequestResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PostCommentForPullRequestResponse' {Int
httpStatus :: Int
$sel:httpStatus:PostCommentForPullRequestResponse' :: PostCommentForPullRequestResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: PostCommentForPullRequestResponse
s@PostCommentForPullRequestResponse' {} Int
a -> PostCommentForPullRequestResponse
s {$sel:httpStatus:PostCommentForPullRequestResponse' :: Int
httpStatus = Int
a} :: PostCommentForPullRequestResponse)

instance
  Prelude.NFData
    PostCommentForPullRequestResponse