{-# 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 #-}
module Amazonka.CodeCommit.GetCommentsForPullRequest
(
GetCommentsForPullRequest (..),
newGetCommentsForPullRequest,
getCommentsForPullRequest_afterCommitId,
getCommentsForPullRequest_nextToken,
getCommentsForPullRequest_beforeCommitId,
getCommentsForPullRequest_repositoryName,
getCommentsForPullRequest_maxResults,
getCommentsForPullRequest_pullRequestId,
GetCommentsForPullRequestResponse (..),
newGetCommentsForPullRequestResponse,
getCommentsForPullRequestResponse_commentsForPullRequestData,
getCommentsForPullRequestResponse_nextToken,
getCommentsForPullRequestResponse_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
data =
{
:: Prelude.Maybe Prelude.Text,
:: Prelude.Maybe Prelude.Text,
:: Prelude.Maybe Prelude.Text,
:: Prelude.Maybe Prelude.Text,
:: Prelude.Maybe Prelude.Int,
:: Prelude.Text
}
deriving (GetCommentsForPullRequest -> GetCommentsForPullRequest -> Bool
(GetCommentsForPullRequest -> GetCommentsForPullRequest -> Bool)
-> (GetCommentsForPullRequest -> GetCommentsForPullRequest -> Bool)
-> Eq GetCommentsForPullRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetCommentsForPullRequest -> GetCommentsForPullRequest -> Bool
$c/= :: GetCommentsForPullRequest -> GetCommentsForPullRequest -> Bool
== :: GetCommentsForPullRequest -> GetCommentsForPullRequest -> Bool
$c== :: GetCommentsForPullRequest -> GetCommentsForPullRequest -> Bool
Prelude.Eq, ReadPrec [GetCommentsForPullRequest]
ReadPrec GetCommentsForPullRequest
Int -> ReadS GetCommentsForPullRequest
ReadS [GetCommentsForPullRequest]
(Int -> ReadS GetCommentsForPullRequest)
-> ReadS [GetCommentsForPullRequest]
-> ReadPrec GetCommentsForPullRequest
-> ReadPrec [GetCommentsForPullRequest]
-> Read GetCommentsForPullRequest
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetCommentsForPullRequest]
$creadListPrec :: ReadPrec [GetCommentsForPullRequest]
readPrec :: ReadPrec GetCommentsForPullRequest
$creadPrec :: ReadPrec GetCommentsForPullRequest
readList :: ReadS [GetCommentsForPullRequest]
$creadList :: ReadS [GetCommentsForPullRequest]
readsPrec :: Int -> ReadS GetCommentsForPullRequest
$creadsPrec :: Int -> ReadS GetCommentsForPullRequest
Prelude.Read, Int -> GetCommentsForPullRequest -> ShowS
[GetCommentsForPullRequest] -> ShowS
GetCommentsForPullRequest -> String
(Int -> GetCommentsForPullRequest -> ShowS)
-> (GetCommentsForPullRequest -> String)
-> ([GetCommentsForPullRequest] -> ShowS)
-> Show GetCommentsForPullRequest
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetCommentsForPullRequest] -> ShowS
$cshowList :: [GetCommentsForPullRequest] -> ShowS
show :: GetCommentsForPullRequest -> String
$cshow :: GetCommentsForPullRequest -> String
showsPrec :: Int -> GetCommentsForPullRequest -> ShowS
$cshowsPrec :: Int -> GetCommentsForPullRequest -> ShowS
Prelude.Show, (forall x.
GetCommentsForPullRequest -> Rep GetCommentsForPullRequest x)
-> (forall x.
Rep GetCommentsForPullRequest x -> GetCommentsForPullRequest)
-> Generic GetCommentsForPullRequest
forall x.
Rep GetCommentsForPullRequest x -> GetCommentsForPullRequest
forall x.
GetCommentsForPullRequest -> Rep GetCommentsForPullRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetCommentsForPullRequest x -> GetCommentsForPullRequest
$cfrom :: forall x.
GetCommentsForPullRequest -> Rep GetCommentsForPullRequest x
Prelude.Generic)
newGetCommentsForPullRequest ::
Prelude.Text ->
GetCommentsForPullRequest
Text
pPullRequestId_ =
GetCommentsForPullRequest' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Text
-> GetCommentsForPullRequest
GetCommentsForPullRequest'
{ $sel:afterCommitId:GetCommentsForPullRequest' :: Maybe Text
afterCommitId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:GetCommentsForPullRequest' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:beforeCommitId:GetCommentsForPullRequest' :: Maybe Text
beforeCommitId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:repositoryName:GetCommentsForPullRequest' :: Maybe Text
repositoryName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:maxResults:GetCommentsForPullRequest' :: Maybe Int
maxResults = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:pullRequestId:GetCommentsForPullRequest' :: Text
pullRequestId = Text
pPullRequestId_
}
getCommentsForPullRequest_afterCommitId :: Lens.Lens' GetCommentsForPullRequest (Prelude.Maybe Prelude.Text)
= (GetCommentsForPullRequest -> Maybe Text)
-> (GetCommentsForPullRequest
-> Maybe Text -> GetCommentsForPullRequest)
-> Lens
GetCommentsForPullRequest
GetCommentsForPullRequest
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCommentsForPullRequest' {Maybe Text
afterCommitId :: Maybe Text
$sel:afterCommitId:GetCommentsForPullRequest' :: GetCommentsForPullRequest -> Maybe Text
afterCommitId} -> Maybe Text
afterCommitId) (\s :: GetCommentsForPullRequest
s@GetCommentsForPullRequest' {} Maybe Text
a -> GetCommentsForPullRequest
s {$sel:afterCommitId:GetCommentsForPullRequest' :: Maybe Text
afterCommitId = Maybe Text
a} :: GetCommentsForPullRequest)
getCommentsForPullRequest_nextToken :: Lens.Lens' GetCommentsForPullRequest (Prelude.Maybe Prelude.Text)
= (GetCommentsForPullRequest -> Maybe Text)
-> (GetCommentsForPullRequest
-> Maybe Text -> GetCommentsForPullRequest)
-> Lens
GetCommentsForPullRequest
GetCommentsForPullRequest
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCommentsForPullRequest' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetCommentsForPullRequest' :: GetCommentsForPullRequest -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetCommentsForPullRequest
s@GetCommentsForPullRequest' {} Maybe Text
a -> GetCommentsForPullRequest
s {$sel:nextToken:GetCommentsForPullRequest' :: Maybe Text
nextToken = Maybe Text
a} :: GetCommentsForPullRequest)
getCommentsForPullRequest_beforeCommitId :: Lens.Lens' GetCommentsForPullRequest (Prelude.Maybe Prelude.Text)
= (GetCommentsForPullRequest -> Maybe Text)
-> (GetCommentsForPullRequest
-> Maybe Text -> GetCommentsForPullRequest)
-> Lens
GetCommentsForPullRequest
GetCommentsForPullRequest
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCommentsForPullRequest' {Maybe Text
beforeCommitId :: Maybe Text
$sel:beforeCommitId:GetCommentsForPullRequest' :: GetCommentsForPullRequest -> Maybe Text
beforeCommitId} -> Maybe Text
beforeCommitId) (\s :: GetCommentsForPullRequest
s@GetCommentsForPullRequest' {} Maybe Text
a -> GetCommentsForPullRequest
s {$sel:beforeCommitId:GetCommentsForPullRequest' :: Maybe Text
beforeCommitId = Maybe Text
a} :: GetCommentsForPullRequest)
getCommentsForPullRequest_repositoryName :: Lens.Lens' GetCommentsForPullRequest (Prelude.Maybe Prelude.Text)
= (GetCommentsForPullRequest -> Maybe Text)
-> (GetCommentsForPullRequest
-> Maybe Text -> GetCommentsForPullRequest)
-> Lens
GetCommentsForPullRequest
GetCommentsForPullRequest
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCommentsForPullRequest' {Maybe Text
repositoryName :: Maybe Text
$sel:repositoryName:GetCommentsForPullRequest' :: GetCommentsForPullRequest -> Maybe Text
repositoryName} -> Maybe Text
repositoryName) (\s :: GetCommentsForPullRequest
s@GetCommentsForPullRequest' {} Maybe Text
a -> GetCommentsForPullRequest
s {$sel:repositoryName:GetCommentsForPullRequest' :: Maybe Text
repositoryName = Maybe Text
a} :: GetCommentsForPullRequest)
getCommentsForPullRequest_maxResults :: Lens.Lens' GetCommentsForPullRequest (Prelude.Maybe Prelude.Int)
= (GetCommentsForPullRequest -> Maybe Int)
-> (GetCommentsForPullRequest
-> Maybe Int -> GetCommentsForPullRequest)
-> Lens
GetCommentsForPullRequest
GetCommentsForPullRequest
(Maybe Int)
(Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCommentsForPullRequest' {Maybe Int
maxResults :: Maybe Int
$sel:maxResults:GetCommentsForPullRequest' :: GetCommentsForPullRequest -> Maybe Int
maxResults} -> Maybe Int
maxResults) (\s :: GetCommentsForPullRequest
s@GetCommentsForPullRequest' {} Maybe Int
a -> GetCommentsForPullRequest
s {$sel:maxResults:GetCommentsForPullRequest' :: Maybe Int
maxResults = Maybe Int
a} :: GetCommentsForPullRequest)
getCommentsForPullRequest_pullRequestId :: Lens.Lens' GetCommentsForPullRequest Prelude.Text
= (GetCommentsForPullRequest -> Text)
-> (GetCommentsForPullRequest -> Text -> GetCommentsForPullRequest)
-> Lens
GetCommentsForPullRequest GetCommentsForPullRequest Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCommentsForPullRequest' {Text
pullRequestId :: Text
$sel:pullRequestId:GetCommentsForPullRequest' :: GetCommentsForPullRequest -> Text
pullRequestId} -> Text
pullRequestId) (\s :: GetCommentsForPullRequest
s@GetCommentsForPullRequest' {} Text
a -> GetCommentsForPullRequest
s {$sel:pullRequestId:GetCommentsForPullRequest' :: Text
pullRequestId = Text
a} :: GetCommentsForPullRequest)
instance Core.AWSPager GetCommentsForPullRequest where
page :: GetCommentsForPullRequest
-> AWSResponse GetCommentsForPullRequest
-> Maybe GetCommentsForPullRequest
page GetCommentsForPullRequest
rq AWSResponse GetCommentsForPullRequest
rs
| Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse GetCommentsForPullRequest
GetCommentsForPullRequestResponse
rs
GetCommentsForPullRequestResponse
-> Getting (First Text) GetCommentsForPullRequestResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> GetCommentsForPullRequestResponse
-> Const (First Text) GetCommentsForPullRequestResponse
Lens' GetCommentsForPullRequestResponse (Maybe Text)
getCommentsForPullRequestResponse_nextToken
((Maybe Text -> Const (First Text) (Maybe Text))
-> GetCommentsForPullRequestResponse
-> Const (First Text) GetCommentsForPullRequestResponse)
-> ((Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) GetCommentsForPullRequestResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
Maybe GetCommentsForPullRequest
forall a. Maybe a
Prelude.Nothing
| Maybe [CommentsForPullRequest] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse GetCommentsForPullRequest
GetCommentsForPullRequestResponse
rs
GetCommentsForPullRequestResponse
-> Getting
(First [CommentsForPullRequest])
GetCommentsForPullRequestResponse
[CommentsForPullRequest]
-> Maybe [CommentsForPullRequest]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [CommentsForPullRequest]
-> Const
(First [CommentsForPullRequest]) (Maybe [CommentsForPullRequest]))
-> GetCommentsForPullRequestResponse
-> Const
(First [CommentsForPullRequest]) GetCommentsForPullRequestResponse
Lens'
GetCommentsForPullRequestResponse (Maybe [CommentsForPullRequest])
getCommentsForPullRequestResponse_commentsForPullRequestData
((Maybe [CommentsForPullRequest]
-> Const
(First [CommentsForPullRequest]) (Maybe [CommentsForPullRequest]))
-> GetCommentsForPullRequestResponse
-> Const
(First [CommentsForPullRequest]) GetCommentsForPullRequestResponse)
-> (([CommentsForPullRequest]
-> Const (First [CommentsForPullRequest]) [CommentsForPullRequest])
-> Maybe [CommentsForPullRequest]
-> Const
(First [CommentsForPullRequest]) (Maybe [CommentsForPullRequest]))
-> Getting
(First [CommentsForPullRequest])
GetCommentsForPullRequestResponse
[CommentsForPullRequest]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([CommentsForPullRequest]
-> Const (First [CommentsForPullRequest]) [CommentsForPullRequest])
-> Maybe [CommentsForPullRequest]
-> Const
(First [CommentsForPullRequest]) (Maybe [CommentsForPullRequest])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
Maybe GetCommentsForPullRequest
forall a. Maybe a
Prelude.Nothing
| Bool
Prelude.otherwise =
GetCommentsForPullRequest -> Maybe GetCommentsForPullRequest
forall a. a -> Maybe a
Prelude.Just (GetCommentsForPullRequest -> Maybe GetCommentsForPullRequest)
-> GetCommentsForPullRequest -> Maybe GetCommentsForPullRequest
forall a b. (a -> b) -> a -> b
Prelude.$
GetCommentsForPullRequest
rq
GetCommentsForPullRequest
-> (GetCommentsForPullRequest -> GetCommentsForPullRequest)
-> GetCommentsForPullRequest
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> GetCommentsForPullRequest -> Identity GetCommentsForPullRequest
Lens
GetCommentsForPullRequest
GetCommentsForPullRequest
(Maybe Text)
(Maybe Text)
getCommentsForPullRequest_nextToken
((Maybe Text -> Identity (Maybe Text))
-> GetCommentsForPullRequest -> Identity GetCommentsForPullRequest)
-> Maybe Text
-> GetCommentsForPullRequest
-> GetCommentsForPullRequest
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse GetCommentsForPullRequest
GetCommentsForPullRequestResponse
rs
GetCommentsForPullRequestResponse
-> Getting (First Text) GetCommentsForPullRequestResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> GetCommentsForPullRequestResponse
-> Const (First Text) GetCommentsForPullRequestResponse
Lens' GetCommentsForPullRequestResponse (Maybe Text)
getCommentsForPullRequestResponse_nextToken
((Maybe Text -> Const (First Text) (Maybe Text))
-> GetCommentsForPullRequestResponse
-> Const (First Text) GetCommentsForPullRequestResponse)
-> ((Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) GetCommentsForPullRequestResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
instance Core.AWSRequest GetCommentsForPullRequest where
type
AWSResponse GetCommentsForPullRequest =
GetCommentsForPullRequestResponse
request :: GetCommentsForPullRequest -> Request GetCommentsForPullRequest
request = Service
-> GetCommentsForPullRequest -> Request GetCommentsForPullRequest
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy GetCommentsForPullRequest
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetCommentsForPullRequest)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetCommentsForPullRequest))
-> Logger
-> Service
-> Proxy GetCommentsForPullRequest
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetCommentsForPullRequest)))
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 [CommentsForPullRequest]
-> Maybe Text -> Int -> GetCommentsForPullRequestResponse
GetCommentsForPullRequestResponse'
(Maybe [CommentsForPullRequest]
-> Maybe Text -> Int -> GetCommentsForPullRequestResponse)
-> Either String (Maybe [CommentsForPullRequest])
-> Either
String (Maybe Text -> Int -> GetCommentsForPullRequestResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object
-> Text -> Either String (Maybe (Maybe [CommentsForPullRequest]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"commentsForPullRequestData"
Either String (Maybe (Maybe [CommentsForPullRequest]))
-> Maybe [CommentsForPullRequest]
-> Either String (Maybe [CommentsForPullRequest])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [CommentsForPullRequest]
forall a. Monoid a => a
Prelude.mempty
)
Either
String (Maybe Text -> Int -> GetCommentsForPullRequestResponse)
-> Either String (Maybe Text)
-> Either String (Int -> GetCommentsForPullRequestResponse)
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
"nextToken")
Either String (Int -> GetCommentsForPullRequestResponse)
-> Either String Int
-> Either String GetCommentsForPullRequestResponse
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 GetCommentsForPullRequest
instance Prelude.NFData GetCommentsForPullRequest
instance Core.ToHeaders GetCommentsForPullRequest where
toHeaders :: GetCommentsForPullRequest -> ResponseHeaders
toHeaders =
ResponseHeaders -> GetCommentsForPullRequest -> 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.GetCommentsForPullRequest" ::
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 GetCommentsForPullRequest where
toJSON :: GetCommentsForPullRequest -> Value
toJSON GetCommentsForPullRequest' {Maybe Int
Maybe Text
Text
pullRequestId :: Text
maxResults :: Maybe Int
repositoryName :: Maybe Text
beforeCommitId :: Maybe Text
nextToken :: Maybe Text
afterCommitId :: Maybe Text
$sel:pullRequestId:GetCommentsForPullRequest' :: GetCommentsForPullRequest -> Text
$sel:maxResults:GetCommentsForPullRequest' :: GetCommentsForPullRequest -> Maybe Int
$sel:repositoryName:GetCommentsForPullRequest' :: GetCommentsForPullRequest -> Maybe Text
$sel:beforeCommitId:GetCommentsForPullRequest' :: GetCommentsForPullRequest -> Maybe Text
$sel:nextToken:GetCommentsForPullRequest' :: GetCommentsForPullRequest -> Maybe Text
$sel:afterCommitId:GetCommentsForPullRequest' :: GetCommentsForPullRequest -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"afterCommitId" 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
afterCommitId,
(Text
"nextToken" 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
nextToken,
(Text
"beforeCommitId" 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
beforeCommitId,
(Text
"repositoryName" 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
repositoryName,
(Text
"maxResults" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
maxResults,
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)
]
)
instance Core.ToPath GetCommentsForPullRequest where
toPath :: GetCommentsForPullRequest -> ByteString
toPath = ByteString -> GetCommentsForPullRequest -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery GetCommentsForPullRequest where
toQuery :: GetCommentsForPullRequest -> QueryString
toQuery = QueryString -> GetCommentsForPullRequest -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data =
{
:: Prelude.Maybe [CommentsForPullRequest],
:: Prelude.Maybe Prelude.Text,
:: Prelude.Int
}
deriving (GetCommentsForPullRequestResponse
-> GetCommentsForPullRequestResponse -> Bool
(GetCommentsForPullRequestResponse
-> GetCommentsForPullRequestResponse -> Bool)
-> (GetCommentsForPullRequestResponse
-> GetCommentsForPullRequestResponse -> Bool)
-> Eq GetCommentsForPullRequestResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetCommentsForPullRequestResponse
-> GetCommentsForPullRequestResponse -> Bool
$c/= :: GetCommentsForPullRequestResponse
-> GetCommentsForPullRequestResponse -> Bool
== :: GetCommentsForPullRequestResponse
-> GetCommentsForPullRequestResponse -> Bool
$c== :: GetCommentsForPullRequestResponse
-> GetCommentsForPullRequestResponse -> Bool
Prelude.Eq, ReadPrec [GetCommentsForPullRequestResponse]
ReadPrec GetCommentsForPullRequestResponse
Int -> ReadS GetCommentsForPullRequestResponse
ReadS [GetCommentsForPullRequestResponse]
(Int -> ReadS GetCommentsForPullRequestResponse)
-> ReadS [GetCommentsForPullRequestResponse]
-> ReadPrec GetCommentsForPullRequestResponse
-> ReadPrec [GetCommentsForPullRequestResponse]
-> Read GetCommentsForPullRequestResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetCommentsForPullRequestResponse]
$creadListPrec :: ReadPrec [GetCommentsForPullRequestResponse]
readPrec :: ReadPrec GetCommentsForPullRequestResponse
$creadPrec :: ReadPrec GetCommentsForPullRequestResponse
readList :: ReadS [GetCommentsForPullRequestResponse]
$creadList :: ReadS [GetCommentsForPullRequestResponse]
readsPrec :: Int -> ReadS GetCommentsForPullRequestResponse
$creadsPrec :: Int -> ReadS GetCommentsForPullRequestResponse
Prelude.Read, Int -> GetCommentsForPullRequestResponse -> ShowS
[GetCommentsForPullRequestResponse] -> ShowS
GetCommentsForPullRequestResponse -> String
(Int -> GetCommentsForPullRequestResponse -> ShowS)
-> (GetCommentsForPullRequestResponse -> String)
-> ([GetCommentsForPullRequestResponse] -> ShowS)
-> Show GetCommentsForPullRequestResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetCommentsForPullRequestResponse] -> ShowS
$cshowList :: [GetCommentsForPullRequestResponse] -> ShowS
show :: GetCommentsForPullRequestResponse -> String
$cshow :: GetCommentsForPullRequestResponse -> String
showsPrec :: Int -> GetCommentsForPullRequestResponse -> ShowS
$cshowsPrec :: Int -> GetCommentsForPullRequestResponse -> ShowS
Prelude.Show, (forall x.
GetCommentsForPullRequestResponse
-> Rep GetCommentsForPullRequestResponse x)
-> (forall x.
Rep GetCommentsForPullRequestResponse x
-> GetCommentsForPullRequestResponse)
-> Generic GetCommentsForPullRequestResponse
forall x.
Rep GetCommentsForPullRequestResponse x
-> GetCommentsForPullRequestResponse
forall x.
GetCommentsForPullRequestResponse
-> Rep GetCommentsForPullRequestResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetCommentsForPullRequestResponse x
-> GetCommentsForPullRequestResponse
$cfrom :: forall x.
GetCommentsForPullRequestResponse
-> Rep GetCommentsForPullRequestResponse x
Prelude.Generic)
newGetCommentsForPullRequestResponse ::
Prelude.Int ->
GetCommentsForPullRequestResponse
Int
pHttpStatus_ =
GetCommentsForPullRequestResponse' :: Maybe [CommentsForPullRequest]
-> Maybe Text -> Int -> GetCommentsForPullRequestResponse
GetCommentsForPullRequestResponse'
{ $sel:commentsForPullRequestData:GetCommentsForPullRequestResponse' :: Maybe [CommentsForPullRequest]
commentsForPullRequestData =
Maybe [CommentsForPullRequest]
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:GetCommentsForPullRequestResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetCommentsForPullRequestResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getCommentsForPullRequestResponse_commentsForPullRequestData :: Lens.Lens' GetCommentsForPullRequestResponse (Prelude.Maybe [CommentsForPullRequest])
= (GetCommentsForPullRequestResponse
-> Maybe [CommentsForPullRequest])
-> (GetCommentsForPullRequestResponse
-> Maybe [CommentsForPullRequest]
-> GetCommentsForPullRequestResponse)
-> Lens'
GetCommentsForPullRequestResponse (Maybe [CommentsForPullRequest])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCommentsForPullRequestResponse' {Maybe [CommentsForPullRequest]
commentsForPullRequestData :: Maybe [CommentsForPullRequest]
$sel:commentsForPullRequestData:GetCommentsForPullRequestResponse' :: GetCommentsForPullRequestResponse -> Maybe [CommentsForPullRequest]
commentsForPullRequestData} -> Maybe [CommentsForPullRequest]
commentsForPullRequestData) (\s :: GetCommentsForPullRequestResponse
s@GetCommentsForPullRequestResponse' {} Maybe [CommentsForPullRequest]
a -> GetCommentsForPullRequestResponse
s {$sel:commentsForPullRequestData:GetCommentsForPullRequestResponse' :: Maybe [CommentsForPullRequest]
commentsForPullRequestData = Maybe [CommentsForPullRequest]
a} :: GetCommentsForPullRequestResponse) ((Maybe [CommentsForPullRequest]
-> f (Maybe [CommentsForPullRequest]))
-> GetCommentsForPullRequestResponse
-> f GetCommentsForPullRequestResponse)
-> ((Maybe [CommentsForPullRequest]
-> f (Maybe [CommentsForPullRequest]))
-> Maybe [CommentsForPullRequest]
-> f (Maybe [CommentsForPullRequest]))
-> (Maybe [CommentsForPullRequest]
-> f (Maybe [CommentsForPullRequest]))
-> GetCommentsForPullRequestResponse
-> f GetCommentsForPullRequestResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[CommentsForPullRequest]
[CommentsForPullRequest]
[CommentsForPullRequest]
[CommentsForPullRequest]
-> Iso
(Maybe [CommentsForPullRequest])
(Maybe [CommentsForPullRequest])
(Maybe [CommentsForPullRequest])
(Maybe [CommentsForPullRequest])
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
[CommentsForPullRequest]
[CommentsForPullRequest]
[CommentsForPullRequest]
[CommentsForPullRequest]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
getCommentsForPullRequestResponse_nextToken :: Lens.Lens' GetCommentsForPullRequestResponse (Prelude.Maybe Prelude.Text)
= (GetCommentsForPullRequestResponse -> Maybe Text)
-> (GetCommentsForPullRequestResponse
-> Maybe Text -> GetCommentsForPullRequestResponse)
-> Lens' GetCommentsForPullRequestResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCommentsForPullRequestResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetCommentsForPullRequestResponse' :: GetCommentsForPullRequestResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetCommentsForPullRequestResponse
s@GetCommentsForPullRequestResponse' {} Maybe Text
a -> GetCommentsForPullRequestResponse
s {$sel:nextToken:GetCommentsForPullRequestResponse' :: Maybe Text
nextToken = Maybe Text
a} :: GetCommentsForPullRequestResponse)
getCommentsForPullRequestResponse_httpStatus :: Lens.Lens' GetCommentsForPullRequestResponse Prelude.Int
= (GetCommentsForPullRequestResponse -> Int)
-> (GetCommentsForPullRequestResponse
-> Int -> GetCommentsForPullRequestResponse)
-> Lens
GetCommentsForPullRequestResponse
GetCommentsForPullRequestResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCommentsForPullRequestResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetCommentsForPullRequestResponse' :: GetCommentsForPullRequestResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetCommentsForPullRequestResponse
s@GetCommentsForPullRequestResponse' {} Int
a -> GetCommentsForPullRequestResponse
s {$sel:httpStatus:GetCommentsForPullRequestResponse' :: Int
httpStatus = Int
a} :: GetCommentsForPullRequestResponse)
instance
Prelude.NFData
GetCommentsForPullRequestResponse