{-# 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.CodeDeploy.ListGitHubAccountTokenNames
-- 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)
--
-- Lists the names of stored connections to GitHub accounts.
--
-- This operation returns paginated results.
module Amazonka.CodeDeploy.ListGitHubAccountTokenNames
  ( -- * Creating a Request
    ListGitHubAccountTokenNames (..),
    newListGitHubAccountTokenNames,

    -- * Request Lenses
    listGitHubAccountTokenNames_nextToken,

    -- * Destructuring the Response
    ListGitHubAccountTokenNamesResponse (..),
    newListGitHubAccountTokenNamesResponse,

    -- * Response Lenses
    listGitHubAccountTokenNamesResponse_tokenNameList,
    listGitHubAccountTokenNamesResponse_nextToken,
    listGitHubAccountTokenNamesResponse_httpStatus,
  )
where

import Amazonka.CodeDeploy.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

-- | Represents the input of a @ListGitHubAccountTokenNames@ operation.
--
-- /See:/ 'newListGitHubAccountTokenNames' smart constructor.
data ListGitHubAccountTokenNames = ListGitHubAccountTokenNames'
  { -- | An identifier returned from the previous @ListGitHubAccountTokenNames@
    -- call. It can be used to return the next set of names in the list.
    ListGitHubAccountTokenNames -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
  }
  deriving (ListGitHubAccountTokenNames -> ListGitHubAccountTokenNames -> Bool
(ListGitHubAccountTokenNames
 -> ListGitHubAccountTokenNames -> Bool)
-> (ListGitHubAccountTokenNames
    -> ListGitHubAccountTokenNames -> Bool)
-> Eq ListGitHubAccountTokenNames
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListGitHubAccountTokenNames -> ListGitHubAccountTokenNames -> Bool
$c/= :: ListGitHubAccountTokenNames -> ListGitHubAccountTokenNames -> Bool
== :: ListGitHubAccountTokenNames -> ListGitHubAccountTokenNames -> Bool
$c== :: ListGitHubAccountTokenNames -> ListGitHubAccountTokenNames -> Bool
Prelude.Eq, ReadPrec [ListGitHubAccountTokenNames]
ReadPrec ListGitHubAccountTokenNames
Int -> ReadS ListGitHubAccountTokenNames
ReadS [ListGitHubAccountTokenNames]
(Int -> ReadS ListGitHubAccountTokenNames)
-> ReadS [ListGitHubAccountTokenNames]
-> ReadPrec ListGitHubAccountTokenNames
-> ReadPrec [ListGitHubAccountTokenNames]
-> Read ListGitHubAccountTokenNames
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListGitHubAccountTokenNames]
$creadListPrec :: ReadPrec [ListGitHubAccountTokenNames]
readPrec :: ReadPrec ListGitHubAccountTokenNames
$creadPrec :: ReadPrec ListGitHubAccountTokenNames
readList :: ReadS [ListGitHubAccountTokenNames]
$creadList :: ReadS [ListGitHubAccountTokenNames]
readsPrec :: Int -> ReadS ListGitHubAccountTokenNames
$creadsPrec :: Int -> ReadS ListGitHubAccountTokenNames
Prelude.Read, Int -> ListGitHubAccountTokenNames -> ShowS
[ListGitHubAccountTokenNames] -> ShowS
ListGitHubAccountTokenNames -> String
(Int -> ListGitHubAccountTokenNames -> ShowS)
-> (ListGitHubAccountTokenNames -> String)
-> ([ListGitHubAccountTokenNames] -> ShowS)
-> Show ListGitHubAccountTokenNames
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListGitHubAccountTokenNames] -> ShowS
$cshowList :: [ListGitHubAccountTokenNames] -> ShowS
show :: ListGitHubAccountTokenNames -> String
$cshow :: ListGitHubAccountTokenNames -> String
showsPrec :: Int -> ListGitHubAccountTokenNames -> ShowS
$cshowsPrec :: Int -> ListGitHubAccountTokenNames -> ShowS
Prelude.Show, (forall x.
 ListGitHubAccountTokenNames -> Rep ListGitHubAccountTokenNames x)
-> (forall x.
    Rep ListGitHubAccountTokenNames x -> ListGitHubAccountTokenNames)
-> Generic ListGitHubAccountTokenNames
forall x.
Rep ListGitHubAccountTokenNames x -> ListGitHubAccountTokenNames
forall x.
ListGitHubAccountTokenNames -> Rep ListGitHubAccountTokenNames x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListGitHubAccountTokenNames x -> ListGitHubAccountTokenNames
$cfrom :: forall x.
ListGitHubAccountTokenNames -> Rep ListGitHubAccountTokenNames x
Prelude.Generic)

-- |
-- Create a value of 'ListGitHubAccountTokenNames' 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', 'listGitHubAccountTokenNames_nextToken' - An identifier returned from the previous @ListGitHubAccountTokenNames@
-- call. It can be used to return the next set of names in the list.
newListGitHubAccountTokenNames ::
  ListGitHubAccountTokenNames
newListGitHubAccountTokenNames :: ListGitHubAccountTokenNames
newListGitHubAccountTokenNames =
  ListGitHubAccountTokenNames' :: Maybe Text -> ListGitHubAccountTokenNames
ListGitHubAccountTokenNames'
    { $sel:nextToken:ListGitHubAccountTokenNames' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | An identifier returned from the previous @ListGitHubAccountTokenNames@
-- call. It can be used to return the next set of names in the list.
listGitHubAccountTokenNames_nextToken :: Lens.Lens' ListGitHubAccountTokenNames (Prelude.Maybe Prelude.Text)
listGitHubAccountTokenNames_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListGitHubAccountTokenNames -> f ListGitHubAccountTokenNames
listGitHubAccountTokenNames_nextToken = (ListGitHubAccountTokenNames -> Maybe Text)
-> (ListGitHubAccountTokenNames
    -> Maybe Text -> ListGitHubAccountTokenNames)
-> Lens
     ListGitHubAccountTokenNames
     ListGitHubAccountTokenNames
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGitHubAccountTokenNames' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListGitHubAccountTokenNames' :: ListGitHubAccountTokenNames -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListGitHubAccountTokenNames
s@ListGitHubAccountTokenNames' {} Maybe Text
a -> ListGitHubAccountTokenNames
s {$sel:nextToken:ListGitHubAccountTokenNames' :: Maybe Text
nextToken = Maybe Text
a} :: ListGitHubAccountTokenNames)

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

instance Prelude.NFData ListGitHubAccountTokenNames

instance Core.ToHeaders ListGitHubAccountTokenNames where
  toHeaders :: ListGitHubAccountTokenNames -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListGitHubAccountTokenNames -> 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
"CodeDeploy_20141006.ListGitHubAccountTokenNames" ::
                          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 ListGitHubAccountTokenNames where
  toJSON :: ListGitHubAccountTokenNames -> Value
toJSON ListGitHubAccountTokenNames' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListGitHubAccountTokenNames' :: ListGitHubAccountTokenNames -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [(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]
      )

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

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

-- | Represents the output of a @ListGitHubAccountTokenNames@ operation.
--
-- /See:/ 'newListGitHubAccountTokenNamesResponse' smart constructor.
data ListGitHubAccountTokenNamesResponse = ListGitHubAccountTokenNamesResponse'
  { -- | A list of names of connections to GitHub accounts.
    ListGitHubAccountTokenNamesResponse -> Maybe [Text]
tokenNameList :: Prelude.Maybe [Prelude.Text],
    -- | If a large amount of information is returned, an identifier is also
    -- returned. It can be used in a subsequent @ListGitHubAccountTokenNames@
    -- call to return the next set of names in the list.
    ListGitHubAccountTokenNamesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListGitHubAccountTokenNamesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListGitHubAccountTokenNamesResponse
-> ListGitHubAccountTokenNamesResponse -> Bool
(ListGitHubAccountTokenNamesResponse
 -> ListGitHubAccountTokenNamesResponse -> Bool)
-> (ListGitHubAccountTokenNamesResponse
    -> ListGitHubAccountTokenNamesResponse -> Bool)
-> Eq ListGitHubAccountTokenNamesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListGitHubAccountTokenNamesResponse
-> ListGitHubAccountTokenNamesResponse -> Bool
$c/= :: ListGitHubAccountTokenNamesResponse
-> ListGitHubAccountTokenNamesResponse -> Bool
== :: ListGitHubAccountTokenNamesResponse
-> ListGitHubAccountTokenNamesResponse -> Bool
$c== :: ListGitHubAccountTokenNamesResponse
-> ListGitHubAccountTokenNamesResponse -> Bool
Prelude.Eq, ReadPrec [ListGitHubAccountTokenNamesResponse]
ReadPrec ListGitHubAccountTokenNamesResponse
Int -> ReadS ListGitHubAccountTokenNamesResponse
ReadS [ListGitHubAccountTokenNamesResponse]
(Int -> ReadS ListGitHubAccountTokenNamesResponse)
-> ReadS [ListGitHubAccountTokenNamesResponse]
-> ReadPrec ListGitHubAccountTokenNamesResponse
-> ReadPrec [ListGitHubAccountTokenNamesResponse]
-> Read ListGitHubAccountTokenNamesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListGitHubAccountTokenNamesResponse]
$creadListPrec :: ReadPrec [ListGitHubAccountTokenNamesResponse]
readPrec :: ReadPrec ListGitHubAccountTokenNamesResponse
$creadPrec :: ReadPrec ListGitHubAccountTokenNamesResponse
readList :: ReadS [ListGitHubAccountTokenNamesResponse]
$creadList :: ReadS [ListGitHubAccountTokenNamesResponse]
readsPrec :: Int -> ReadS ListGitHubAccountTokenNamesResponse
$creadsPrec :: Int -> ReadS ListGitHubAccountTokenNamesResponse
Prelude.Read, Int -> ListGitHubAccountTokenNamesResponse -> ShowS
[ListGitHubAccountTokenNamesResponse] -> ShowS
ListGitHubAccountTokenNamesResponse -> String
(Int -> ListGitHubAccountTokenNamesResponse -> ShowS)
-> (ListGitHubAccountTokenNamesResponse -> String)
-> ([ListGitHubAccountTokenNamesResponse] -> ShowS)
-> Show ListGitHubAccountTokenNamesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListGitHubAccountTokenNamesResponse] -> ShowS
$cshowList :: [ListGitHubAccountTokenNamesResponse] -> ShowS
show :: ListGitHubAccountTokenNamesResponse -> String
$cshow :: ListGitHubAccountTokenNamesResponse -> String
showsPrec :: Int -> ListGitHubAccountTokenNamesResponse -> ShowS
$cshowsPrec :: Int -> ListGitHubAccountTokenNamesResponse -> ShowS
Prelude.Show, (forall x.
 ListGitHubAccountTokenNamesResponse
 -> Rep ListGitHubAccountTokenNamesResponse x)
-> (forall x.
    Rep ListGitHubAccountTokenNamesResponse x
    -> ListGitHubAccountTokenNamesResponse)
-> Generic ListGitHubAccountTokenNamesResponse
forall x.
Rep ListGitHubAccountTokenNamesResponse x
-> ListGitHubAccountTokenNamesResponse
forall x.
ListGitHubAccountTokenNamesResponse
-> Rep ListGitHubAccountTokenNamesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListGitHubAccountTokenNamesResponse x
-> ListGitHubAccountTokenNamesResponse
$cfrom :: forall x.
ListGitHubAccountTokenNamesResponse
-> Rep ListGitHubAccountTokenNamesResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListGitHubAccountTokenNamesResponse' 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:
--
-- 'tokenNameList', 'listGitHubAccountTokenNamesResponse_tokenNameList' - A list of names of connections to GitHub accounts.
--
-- 'nextToken', 'listGitHubAccountTokenNamesResponse_nextToken' - If a large amount of information is returned, an identifier is also
-- returned. It can be used in a subsequent @ListGitHubAccountTokenNames@
-- call to return the next set of names in the list.
--
-- 'httpStatus', 'listGitHubAccountTokenNamesResponse_httpStatus' - The response's http status code.
newListGitHubAccountTokenNamesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListGitHubAccountTokenNamesResponse
newListGitHubAccountTokenNamesResponse :: Int -> ListGitHubAccountTokenNamesResponse
newListGitHubAccountTokenNamesResponse Int
pHttpStatus_ =
  ListGitHubAccountTokenNamesResponse' :: Maybe [Text]
-> Maybe Text -> Int -> ListGitHubAccountTokenNamesResponse
ListGitHubAccountTokenNamesResponse'
    { $sel:tokenNameList:ListGitHubAccountTokenNamesResponse' :: Maybe [Text]
tokenNameList =
        Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListGitHubAccountTokenNamesResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListGitHubAccountTokenNamesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A list of names of connections to GitHub accounts.
listGitHubAccountTokenNamesResponse_tokenNameList :: Lens.Lens' ListGitHubAccountTokenNamesResponse (Prelude.Maybe [Prelude.Text])
listGitHubAccountTokenNamesResponse_tokenNameList :: (Maybe [Text] -> f (Maybe [Text]))
-> ListGitHubAccountTokenNamesResponse
-> f ListGitHubAccountTokenNamesResponse
listGitHubAccountTokenNamesResponse_tokenNameList = (ListGitHubAccountTokenNamesResponse -> Maybe [Text])
-> (ListGitHubAccountTokenNamesResponse
    -> Maybe [Text] -> ListGitHubAccountTokenNamesResponse)
-> Lens' ListGitHubAccountTokenNamesResponse (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGitHubAccountTokenNamesResponse' {Maybe [Text]
tokenNameList :: Maybe [Text]
$sel:tokenNameList:ListGitHubAccountTokenNamesResponse' :: ListGitHubAccountTokenNamesResponse -> Maybe [Text]
tokenNameList} -> Maybe [Text]
tokenNameList) (\s :: ListGitHubAccountTokenNamesResponse
s@ListGitHubAccountTokenNamesResponse' {} Maybe [Text]
a -> ListGitHubAccountTokenNamesResponse
s {$sel:tokenNameList:ListGitHubAccountTokenNamesResponse' :: Maybe [Text]
tokenNameList = Maybe [Text]
a} :: ListGitHubAccountTokenNamesResponse) ((Maybe [Text] -> f (Maybe [Text]))
 -> ListGitHubAccountTokenNamesResponse
 -> f ListGitHubAccountTokenNamesResponse)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ListGitHubAccountTokenNamesResponse
-> f ListGitHubAccountTokenNamesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | If a large amount of information is returned, an identifier is also
-- returned. It can be used in a subsequent @ListGitHubAccountTokenNames@
-- call to return the next set of names in the list.
listGitHubAccountTokenNamesResponse_nextToken :: Lens.Lens' ListGitHubAccountTokenNamesResponse (Prelude.Maybe Prelude.Text)
listGitHubAccountTokenNamesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListGitHubAccountTokenNamesResponse
-> f ListGitHubAccountTokenNamesResponse
listGitHubAccountTokenNamesResponse_nextToken = (ListGitHubAccountTokenNamesResponse -> Maybe Text)
-> (ListGitHubAccountTokenNamesResponse
    -> Maybe Text -> ListGitHubAccountTokenNamesResponse)
-> Lens' ListGitHubAccountTokenNamesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGitHubAccountTokenNamesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListGitHubAccountTokenNamesResponse' :: ListGitHubAccountTokenNamesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListGitHubAccountTokenNamesResponse
s@ListGitHubAccountTokenNamesResponse' {} Maybe Text
a -> ListGitHubAccountTokenNamesResponse
s {$sel:nextToken:ListGitHubAccountTokenNamesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListGitHubAccountTokenNamesResponse)

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

instance
  Prelude.NFData
    ListGitHubAccountTokenNamesResponse