{-# 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.ListPullRequests
-- 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)
--
-- Returns a list of pull requests for a specified repository. The return
-- list can be refined by pull request status or pull request author ARN.
--
-- This operation returns paginated results.
module Amazonka.CodeCommit.ListPullRequests
  ( -- * Creating a Request
    ListPullRequests (..),
    newListPullRequests,

    -- * Request Lenses
    listPullRequests_authorArn,
    listPullRequests_nextToken,
    listPullRequests_pullRequestStatus,
    listPullRequests_maxResults,
    listPullRequests_repositoryName,

    -- * Destructuring the Response
    ListPullRequestsResponse (..),
    newListPullRequestsResponse,

    -- * Response Lenses
    listPullRequestsResponse_nextToken,
    listPullRequestsResponse_httpStatus,
    listPullRequestsResponse_pullRequestIds,
  )
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:/ 'newListPullRequests' smart constructor.
data ListPullRequests = ListPullRequests'
  { -- | Optional. The Amazon Resource Name (ARN) of the user who created the
    -- pull request. If used, this filters the results to pull requests created
    -- by that user.
    ListPullRequests -> Maybe Text
authorArn :: Prelude.Maybe Prelude.Text,
    -- | An enumeration token that, when provided in a request, returns the next
    -- batch of the results.
    ListPullRequests -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Optional. The status of the pull request. If used, this refines the
    -- results to the pull requests that match the specified status.
    ListPullRequests -> Maybe PullRequestStatusEnum
pullRequestStatus :: Prelude.Maybe PullRequestStatusEnum,
    -- | A non-zero, non-negative integer used to limit the number of returned
    -- results.
    ListPullRequests -> Maybe Int
maxResults :: Prelude.Maybe Prelude.Int,
    -- | The name of the repository for which you want to list pull requests.
    ListPullRequests -> Text
repositoryName :: Prelude.Text
  }
  deriving (ListPullRequests -> ListPullRequests -> Bool
(ListPullRequests -> ListPullRequests -> Bool)
-> (ListPullRequests -> ListPullRequests -> Bool)
-> Eq ListPullRequests
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListPullRequests -> ListPullRequests -> Bool
$c/= :: ListPullRequests -> ListPullRequests -> Bool
== :: ListPullRequests -> ListPullRequests -> Bool
$c== :: ListPullRequests -> ListPullRequests -> Bool
Prelude.Eq, ReadPrec [ListPullRequests]
ReadPrec ListPullRequests
Int -> ReadS ListPullRequests
ReadS [ListPullRequests]
(Int -> ReadS ListPullRequests)
-> ReadS [ListPullRequests]
-> ReadPrec ListPullRequests
-> ReadPrec [ListPullRequests]
-> Read ListPullRequests
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListPullRequests]
$creadListPrec :: ReadPrec [ListPullRequests]
readPrec :: ReadPrec ListPullRequests
$creadPrec :: ReadPrec ListPullRequests
readList :: ReadS [ListPullRequests]
$creadList :: ReadS [ListPullRequests]
readsPrec :: Int -> ReadS ListPullRequests
$creadsPrec :: Int -> ReadS ListPullRequests
Prelude.Read, Int -> ListPullRequests -> ShowS
[ListPullRequests] -> ShowS
ListPullRequests -> String
(Int -> ListPullRequests -> ShowS)
-> (ListPullRequests -> String)
-> ([ListPullRequests] -> ShowS)
-> Show ListPullRequests
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListPullRequests] -> ShowS
$cshowList :: [ListPullRequests] -> ShowS
show :: ListPullRequests -> String
$cshow :: ListPullRequests -> String
showsPrec :: Int -> ListPullRequests -> ShowS
$cshowsPrec :: Int -> ListPullRequests -> ShowS
Prelude.Show, (forall x. ListPullRequests -> Rep ListPullRequests x)
-> (forall x. Rep ListPullRequests x -> ListPullRequests)
-> Generic ListPullRequests
forall x. Rep ListPullRequests x -> ListPullRequests
forall x. ListPullRequests -> Rep ListPullRequests x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListPullRequests x -> ListPullRequests
$cfrom :: forall x. ListPullRequests -> Rep ListPullRequests x
Prelude.Generic)

-- |
-- Create a value of 'ListPullRequests' 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:
--
-- 'authorArn', 'listPullRequests_authorArn' - Optional. The Amazon Resource Name (ARN) of the user who created the
-- pull request. If used, this filters the results to pull requests created
-- by that user.
--
-- 'nextToken', 'listPullRequests_nextToken' - An enumeration token that, when provided in a request, returns the next
-- batch of the results.
--
-- 'pullRequestStatus', 'listPullRequests_pullRequestStatus' - Optional. The status of the pull request. If used, this refines the
-- results to the pull requests that match the specified status.
--
-- 'maxResults', 'listPullRequests_maxResults' - A non-zero, non-negative integer used to limit the number of returned
-- results.
--
-- 'repositoryName', 'listPullRequests_repositoryName' - The name of the repository for which you want to list pull requests.
newListPullRequests ::
  -- | 'repositoryName'
  Prelude.Text ->
  ListPullRequests
newListPullRequests :: Text -> ListPullRequests
newListPullRequests Text
pRepositoryName_ =
  ListPullRequests' :: Maybe Text
-> Maybe Text
-> Maybe PullRequestStatusEnum
-> Maybe Int
-> Text
-> ListPullRequests
ListPullRequests'
    { $sel:authorArn:ListPullRequests' :: Maybe Text
authorArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListPullRequests' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:pullRequestStatus:ListPullRequests' :: Maybe PullRequestStatusEnum
pullRequestStatus = Maybe PullRequestStatusEnum
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListPullRequests' :: Maybe Int
maxResults = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:repositoryName:ListPullRequests' :: Text
repositoryName = Text
pRepositoryName_
    }

-- | Optional. The Amazon Resource Name (ARN) of the user who created the
-- pull request. If used, this filters the results to pull requests created
-- by that user.
listPullRequests_authorArn :: Lens.Lens' ListPullRequests (Prelude.Maybe Prelude.Text)
listPullRequests_authorArn :: (Maybe Text -> f (Maybe Text))
-> ListPullRequests -> f ListPullRequests
listPullRequests_authorArn = (ListPullRequests -> Maybe Text)
-> (ListPullRequests -> Maybe Text -> ListPullRequests)
-> Lens ListPullRequests ListPullRequests (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPullRequests' {Maybe Text
authorArn :: Maybe Text
$sel:authorArn:ListPullRequests' :: ListPullRequests -> Maybe Text
authorArn} -> Maybe Text
authorArn) (\s :: ListPullRequests
s@ListPullRequests' {} Maybe Text
a -> ListPullRequests
s {$sel:authorArn:ListPullRequests' :: Maybe Text
authorArn = Maybe Text
a} :: ListPullRequests)

-- | An enumeration token that, when provided in a request, returns the next
-- batch of the results.
listPullRequests_nextToken :: Lens.Lens' ListPullRequests (Prelude.Maybe Prelude.Text)
listPullRequests_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListPullRequests -> f ListPullRequests
listPullRequests_nextToken = (ListPullRequests -> Maybe Text)
-> (ListPullRequests -> Maybe Text -> ListPullRequests)
-> Lens ListPullRequests ListPullRequests (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPullRequests' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListPullRequests' :: ListPullRequests -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListPullRequests
s@ListPullRequests' {} Maybe Text
a -> ListPullRequests
s {$sel:nextToken:ListPullRequests' :: Maybe Text
nextToken = Maybe Text
a} :: ListPullRequests)

-- | Optional. The status of the pull request. If used, this refines the
-- results to the pull requests that match the specified status.
listPullRequests_pullRequestStatus :: Lens.Lens' ListPullRequests (Prelude.Maybe PullRequestStatusEnum)
listPullRequests_pullRequestStatus :: (Maybe PullRequestStatusEnum -> f (Maybe PullRequestStatusEnum))
-> ListPullRequests -> f ListPullRequests
listPullRequests_pullRequestStatus = (ListPullRequests -> Maybe PullRequestStatusEnum)
-> (ListPullRequests
    -> Maybe PullRequestStatusEnum -> ListPullRequests)
-> Lens
     ListPullRequests
     ListPullRequests
     (Maybe PullRequestStatusEnum)
     (Maybe PullRequestStatusEnum)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPullRequests' {Maybe PullRequestStatusEnum
pullRequestStatus :: Maybe PullRequestStatusEnum
$sel:pullRequestStatus:ListPullRequests' :: ListPullRequests -> Maybe PullRequestStatusEnum
pullRequestStatus} -> Maybe PullRequestStatusEnum
pullRequestStatus) (\s :: ListPullRequests
s@ListPullRequests' {} Maybe PullRequestStatusEnum
a -> ListPullRequests
s {$sel:pullRequestStatus:ListPullRequests' :: Maybe PullRequestStatusEnum
pullRequestStatus = Maybe PullRequestStatusEnum
a} :: ListPullRequests)

-- | A non-zero, non-negative integer used to limit the number of returned
-- results.
listPullRequests_maxResults :: Lens.Lens' ListPullRequests (Prelude.Maybe Prelude.Int)
listPullRequests_maxResults :: (Maybe Int -> f (Maybe Int))
-> ListPullRequests -> f ListPullRequests
listPullRequests_maxResults = (ListPullRequests -> Maybe Int)
-> (ListPullRequests -> Maybe Int -> ListPullRequests)
-> Lens ListPullRequests ListPullRequests (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPullRequests' {Maybe Int
maxResults :: Maybe Int
$sel:maxResults:ListPullRequests' :: ListPullRequests -> Maybe Int
maxResults} -> Maybe Int
maxResults) (\s :: ListPullRequests
s@ListPullRequests' {} Maybe Int
a -> ListPullRequests
s {$sel:maxResults:ListPullRequests' :: Maybe Int
maxResults = Maybe Int
a} :: ListPullRequests)

-- | The name of the repository for which you want to list pull requests.
listPullRequests_repositoryName :: Lens.Lens' ListPullRequests Prelude.Text
listPullRequests_repositoryName :: (Text -> f Text) -> ListPullRequests -> f ListPullRequests
listPullRequests_repositoryName = (ListPullRequests -> Text)
-> (ListPullRequests -> Text -> ListPullRequests)
-> Lens ListPullRequests ListPullRequests Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPullRequests' {Text
repositoryName :: Text
$sel:repositoryName:ListPullRequests' :: ListPullRequests -> Text
repositoryName} -> Text
repositoryName) (\s :: ListPullRequests
s@ListPullRequests' {} Text
a -> ListPullRequests
s {$sel:repositoryName:ListPullRequests' :: Text
repositoryName = Text
a} :: ListPullRequests)

instance Core.AWSPager ListPullRequests where
  page :: ListPullRequests
-> AWSResponse ListPullRequests -> Maybe ListPullRequests
page ListPullRequests
rq AWSResponse ListPullRequests
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListPullRequests
ListPullRequestsResponse
rs
            ListPullRequestsResponse
-> Getting (First Text) ListPullRequestsResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListPullRequestsResponse
-> Const (First Text) ListPullRequestsResponse
Lens' ListPullRequestsResponse (Maybe Text)
listPullRequestsResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListPullRequestsResponse
 -> Const (First Text) ListPullRequestsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListPullRequestsResponse 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 ListPullRequests
forall a. Maybe a
Prelude.Nothing
    | [Text] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        (AWSResponse ListPullRequests
ListPullRequestsResponse
rs ListPullRequestsResponse
-> Getting [Text] ListPullRequestsResponse [Text] -> [Text]
forall s a. s -> Getting a s a -> a
Lens.^. Getting [Text] ListPullRequestsResponse [Text]
Lens' ListPullRequestsResponse [Text]
listPullRequestsResponse_pullRequestIds) =
      Maybe ListPullRequests
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListPullRequests -> Maybe ListPullRequests
forall a. a -> Maybe a
Prelude.Just (ListPullRequests -> Maybe ListPullRequests)
-> ListPullRequests -> Maybe ListPullRequests
forall a b. (a -> b) -> a -> b
Prelude.$
        ListPullRequests
rq
          ListPullRequests
-> (ListPullRequests -> ListPullRequests) -> ListPullRequests
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListPullRequests -> Identity ListPullRequests
Lens ListPullRequests ListPullRequests (Maybe Text) (Maybe Text)
listPullRequests_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListPullRequests -> Identity ListPullRequests)
-> Maybe Text -> ListPullRequests -> ListPullRequests
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListPullRequests
ListPullRequestsResponse
rs
          ListPullRequestsResponse
-> Getting (First Text) ListPullRequestsResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListPullRequestsResponse
-> Const (First Text) ListPullRequestsResponse
Lens' ListPullRequestsResponse (Maybe Text)
listPullRequestsResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListPullRequestsResponse
 -> Const (First Text) ListPullRequestsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListPullRequestsResponse 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 ListPullRequests where
  type
    AWSResponse ListPullRequests =
      ListPullRequestsResponse
  request :: ListPullRequests -> Request ListPullRequests
request = Service -> ListPullRequests -> Request ListPullRequests
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ListPullRequests
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListPullRequests)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListPullRequests))
-> Logger
-> Service
-> Proxy ListPullRequests
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListPullRequests)))
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 -> Int -> [Text] -> ListPullRequestsResponse
ListPullRequestsResponse'
            (Maybe Text -> Int -> [Text] -> ListPullRequestsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> [Text] -> ListPullRequestsResponse)
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
"nextToken")
            Either String (Int -> [Text] -> ListPullRequestsResponse)
-> Either String Int
-> Either String ([Text] -> ListPullRequestsResponse)
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))
            Either String ([Text] -> ListPullRequestsResponse)
-> Either String [Text] -> Either String ListPullRequestsResponse
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
"pullRequestIds"
                            Either String (Maybe [Text]) -> [Text] -> Either String [Text]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Text]
forall a. Monoid a => a
Prelude.mempty
                        )
      )

instance Prelude.Hashable ListPullRequests

instance Prelude.NFData ListPullRequests

instance Core.ToHeaders ListPullRequests where
  toHeaders :: ListPullRequests -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListPullRequests -> 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.ListPullRequests" ::
                          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 ListPullRequests where
  toJSON :: ListPullRequests -> Value
toJSON ListPullRequests' {Maybe Int
Maybe Text
Maybe PullRequestStatusEnum
Text
repositoryName :: Text
maxResults :: Maybe Int
pullRequestStatus :: Maybe PullRequestStatusEnum
nextToken :: Maybe Text
authorArn :: Maybe Text
$sel:repositoryName:ListPullRequests' :: ListPullRequests -> Text
$sel:maxResults:ListPullRequests' :: ListPullRequests -> Maybe Int
$sel:pullRequestStatus:ListPullRequests' :: ListPullRequests -> Maybe PullRequestStatusEnum
$sel:nextToken:ListPullRequests' :: ListPullRequests -> Maybe Text
$sel:authorArn:ListPullRequests' :: ListPullRequests -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"authorArn" 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
authorArn,
            (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
"pullRequestStatus" Text -> PullRequestStatusEnum -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (PullRequestStatusEnum -> Pair)
-> Maybe PullRequestStatusEnum -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe PullRequestStatusEnum
pullRequestStatus,
            (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
"repositoryName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
repositoryName)
          ]
      )

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

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

-- | /See:/ 'newListPullRequestsResponse' smart constructor.
data ListPullRequestsResponse = ListPullRequestsResponse'
  { -- | An enumeration token that allows the operation to batch the next results
    -- of the operation.
    ListPullRequestsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListPullRequestsResponse -> Int
httpStatus :: Prelude.Int,
    -- | The system-generated IDs of the pull requests.
    ListPullRequestsResponse -> [Text]
pullRequestIds :: [Prelude.Text]
  }
  deriving (ListPullRequestsResponse -> ListPullRequestsResponse -> Bool
(ListPullRequestsResponse -> ListPullRequestsResponse -> Bool)
-> (ListPullRequestsResponse -> ListPullRequestsResponse -> Bool)
-> Eq ListPullRequestsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListPullRequestsResponse -> ListPullRequestsResponse -> Bool
$c/= :: ListPullRequestsResponse -> ListPullRequestsResponse -> Bool
== :: ListPullRequestsResponse -> ListPullRequestsResponse -> Bool
$c== :: ListPullRequestsResponse -> ListPullRequestsResponse -> Bool
Prelude.Eq, ReadPrec [ListPullRequestsResponse]
ReadPrec ListPullRequestsResponse
Int -> ReadS ListPullRequestsResponse
ReadS [ListPullRequestsResponse]
(Int -> ReadS ListPullRequestsResponse)
-> ReadS [ListPullRequestsResponse]
-> ReadPrec ListPullRequestsResponse
-> ReadPrec [ListPullRequestsResponse]
-> Read ListPullRequestsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListPullRequestsResponse]
$creadListPrec :: ReadPrec [ListPullRequestsResponse]
readPrec :: ReadPrec ListPullRequestsResponse
$creadPrec :: ReadPrec ListPullRequestsResponse
readList :: ReadS [ListPullRequestsResponse]
$creadList :: ReadS [ListPullRequestsResponse]
readsPrec :: Int -> ReadS ListPullRequestsResponse
$creadsPrec :: Int -> ReadS ListPullRequestsResponse
Prelude.Read, Int -> ListPullRequestsResponse -> ShowS
[ListPullRequestsResponse] -> ShowS
ListPullRequestsResponse -> String
(Int -> ListPullRequestsResponse -> ShowS)
-> (ListPullRequestsResponse -> String)
-> ([ListPullRequestsResponse] -> ShowS)
-> Show ListPullRequestsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListPullRequestsResponse] -> ShowS
$cshowList :: [ListPullRequestsResponse] -> ShowS
show :: ListPullRequestsResponse -> String
$cshow :: ListPullRequestsResponse -> String
showsPrec :: Int -> ListPullRequestsResponse -> ShowS
$cshowsPrec :: Int -> ListPullRequestsResponse -> ShowS
Prelude.Show, (forall x.
 ListPullRequestsResponse -> Rep ListPullRequestsResponse x)
-> (forall x.
    Rep ListPullRequestsResponse x -> ListPullRequestsResponse)
-> Generic ListPullRequestsResponse
forall x.
Rep ListPullRequestsResponse x -> ListPullRequestsResponse
forall x.
ListPullRequestsResponse -> Rep ListPullRequestsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListPullRequestsResponse x -> ListPullRequestsResponse
$cfrom :: forall x.
ListPullRequestsResponse -> Rep ListPullRequestsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListPullRequestsResponse' 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:
--
-- 'nextToken', 'listPullRequestsResponse_nextToken' - An enumeration token that allows the operation to batch the next results
-- of the operation.
--
-- 'httpStatus', 'listPullRequestsResponse_httpStatus' - The response's http status code.
--
-- 'pullRequestIds', 'listPullRequestsResponse_pullRequestIds' - The system-generated IDs of the pull requests.
newListPullRequestsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListPullRequestsResponse
newListPullRequestsResponse :: Int -> ListPullRequestsResponse
newListPullRequestsResponse Int
pHttpStatus_ =
  ListPullRequestsResponse' :: Maybe Text -> Int -> [Text] -> ListPullRequestsResponse
ListPullRequestsResponse'
    { $sel:nextToken:ListPullRequestsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListPullRequestsResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:pullRequestIds:ListPullRequestsResponse' :: [Text]
pullRequestIds = [Text]
forall a. Monoid a => a
Prelude.mempty
    }

-- | An enumeration token that allows the operation to batch the next results
-- of the operation.
listPullRequestsResponse_nextToken :: Lens.Lens' ListPullRequestsResponse (Prelude.Maybe Prelude.Text)
listPullRequestsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListPullRequestsResponse -> f ListPullRequestsResponse
listPullRequestsResponse_nextToken = (ListPullRequestsResponse -> Maybe Text)
-> (ListPullRequestsResponse
    -> Maybe Text -> ListPullRequestsResponse)
-> Lens' ListPullRequestsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPullRequestsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListPullRequestsResponse' :: ListPullRequestsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListPullRequestsResponse
s@ListPullRequestsResponse' {} Maybe Text
a -> ListPullRequestsResponse
s {$sel:nextToken:ListPullRequestsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListPullRequestsResponse)

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

-- | The system-generated IDs of the pull requests.
listPullRequestsResponse_pullRequestIds :: Lens.Lens' ListPullRequestsResponse [Prelude.Text]
listPullRequestsResponse_pullRequestIds :: ([Text] -> f [Text])
-> ListPullRequestsResponse -> f ListPullRequestsResponse
listPullRequestsResponse_pullRequestIds = (ListPullRequestsResponse -> [Text])
-> (ListPullRequestsResponse -> [Text] -> ListPullRequestsResponse)
-> Lens' ListPullRequestsResponse [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPullRequestsResponse' {[Text]
pullRequestIds :: [Text]
$sel:pullRequestIds:ListPullRequestsResponse' :: ListPullRequestsResponse -> [Text]
pullRequestIds} -> [Text]
pullRequestIds) (\s :: ListPullRequestsResponse
s@ListPullRequestsResponse' {} [Text]
a -> ListPullRequestsResponse
s {$sel:pullRequestIds:ListPullRequestsResponse' :: [Text]
pullRequestIds = [Text]
a} :: ListPullRequestsResponse) (([Text] -> f [Text])
 -> ListPullRequestsResponse -> f ListPullRequestsResponse)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> ListPullRequestsResponse
-> f ListPullRequestsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.NFData ListPullRequestsResponse