{-# 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.CodeDeploy.ListGitHubAccountTokenNames
(
ListGitHubAccountTokenNames (..),
newListGitHubAccountTokenNames,
listGitHubAccountTokenNames_nextToken,
ListGitHubAccountTokenNamesResponse (..),
newListGitHubAccountTokenNamesResponse,
listGitHubAccountTokenNamesResponse_nextToken,
listGitHubAccountTokenNamesResponse_tokenNameList,
listGitHubAccountTokenNamesResponse_httpStatus,
)
where
import Amazonka.CodeDeploy.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ListGitHubAccountTokenNames = ListGitHubAccountTokenNames'
{
ListGitHubAccountTokenNames -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
}
deriving (ListGitHubAccountTokenNames -> ListGitHubAccountTokenNames -> Bool
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]
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
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.
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)
newListGitHubAccountTokenNames ::
ListGitHubAccountTokenNames
newListGitHubAccountTokenNames :: ListGitHubAccountTokenNames
newListGitHubAccountTokenNames =
ListGitHubAccountTokenNames'
{ $sel:nextToken:ListGitHubAccountTokenNames' :: Maybe Text
nextToken =
forall a. Maybe a
Prelude.Nothing
}
listGitHubAccountTokenNames_nextToken :: Lens.Lens' ListGitHubAccountTokenNames (Prelude.Maybe Prelude.Text)
listGitHubAccountTokenNames_nextToken :: Lens' ListGitHubAccountTokenNames (Maybe Text)
listGitHubAccountTokenNames_nextToken = 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
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListGitHubAccountTokenNames
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListGitHubAccountTokenNamesResponse (Maybe Text)
listGitHubAccountTokenNamesResponse_nextToken
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
forall a. Maybe a
Prelude.Nothing
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListGitHubAccountTokenNames
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListGitHubAccountTokenNamesResponse (Maybe [Text])
listGitHubAccountTokenNamesResponse_tokenNameList
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
forall a. Maybe a
Prelude.Nothing
| Bool
Prelude.otherwise =
forall a. a -> Maybe a
Prelude.Just
forall a b. (a -> b) -> a -> b
Prelude.$ ListGitHubAccountTokenNames
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListGitHubAccountTokenNames (Maybe Text)
listGitHubAccountTokenNames_nextToken
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListGitHubAccountTokenNames
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListGitHubAccountTokenNamesResponse (Maybe Text)
listGitHubAccountTokenNamesResponse_nextToken
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
instance Core.AWSRequest ListGitHubAccountTokenNames where
type
AWSResponse ListGitHubAccountTokenNames =
ListGitHubAccountTokenNamesResponse
request :: (Service -> Service)
-> ListGitHubAccountTokenNames
-> Request ListGitHubAccountTokenNames
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListGitHubAccountTokenNames
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListGitHubAccountTokenNames)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> 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'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"nextToken")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"tokenNameList" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable ListGitHubAccountTokenNames where
hashWithSalt :: Int -> ListGitHubAccountTokenNames -> Int
hashWithSalt Int
_salt ListGitHubAccountTokenNames' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListGitHubAccountTokenNames' :: ListGitHubAccountTokenNames -> Maybe Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
instance Prelude.NFData ListGitHubAccountTokenNames where
rnf :: ListGitHubAccountTokenNames -> ()
rnf ListGitHubAccountTokenNames' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListGitHubAccountTokenNames' :: ListGitHubAccountTokenNames -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
instance Data.ToHeaders ListGitHubAccountTokenNames where
toHeaders :: ListGitHubAccountTokenNames -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"CodeDeploy_20141006.ListGitHubAccountTokenNames" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON ListGitHubAccountTokenNames where
toJSON :: ListGitHubAccountTokenNames -> Value
toJSON ListGitHubAccountTokenNames' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListGitHubAccountTokenNames' :: ListGitHubAccountTokenNames -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[(Key
"nextToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken]
)
instance Data.ToPath ListGitHubAccountTokenNames where
toPath :: ListGitHubAccountTokenNames -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery ListGitHubAccountTokenNames where
toQuery :: ListGitHubAccountTokenNames -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data ListGitHubAccountTokenNamesResponse = ListGitHubAccountTokenNamesResponse'
{
ListGitHubAccountTokenNamesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListGitHubAccountTokenNamesResponse -> Maybe [Text]
tokenNameList :: Prelude.Maybe [Prelude.Text],
ListGitHubAccountTokenNamesResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListGitHubAccountTokenNamesResponse
-> ListGitHubAccountTokenNamesResponse -> Bool
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]
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
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.
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)
newListGitHubAccountTokenNamesResponse ::
Prelude.Int ->
ListGitHubAccountTokenNamesResponse
newListGitHubAccountTokenNamesResponse :: Int -> ListGitHubAccountTokenNamesResponse
newListGitHubAccountTokenNamesResponse Int
pHttpStatus_ =
ListGitHubAccountTokenNamesResponse'
{ $sel:nextToken:ListGitHubAccountTokenNamesResponse' :: Maybe Text
nextToken =
forall a. Maybe a
Prelude.Nothing,
$sel:tokenNameList:ListGitHubAccountTokenNamesResponse' :: Maybe [Text]
tokenNameList = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListGitHubAccountTokenNamesResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listGitHubAccountTokenNamesResponse_nextToken :: Lens.Lens' ListGitHubAccountTokenNamesResponse (Prelude.Maybe Prelude.Text)
listGitHubAccountTokenNamesResponse_nextToken :: Lens' ListGitHubAccountTokenNamesResponse (Maybe Text)
listGitHubAccountTokenNamesResponse_nextToken = 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)
listGitHubAccountTokenNamesResponse_tokenNameList :: Lens.Lens' ListGitHubAccountTokenNamesResponse (Prelude.Maybe [Prelude.Text])
listGitHubAccountTokenNamesResponse_tokenNameList :: Lens' ListGitHubAccountTokenNamesResponse (Maybe [Text])
listGitHubAccountTokenNamesResponse_tokenNameList = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listGitHubAccountTokenNamesResponse_httpStatus :: Lens.Lens' ListGitHubAccountTokenNamesResponse Prelude.Int
listGitHubAccountTokenNamesResponse_httpStatus :: Lens' ListGitHubAccountTokenNamesResponse Int
listGitHubAccountTokenNamesResponse_httpStatus = 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
where
rnf :: ListGitHubAccountTokenNamesResponse -> ()
rnf ListGitHubAccountTokenNamesResponse' {Int
Maybe [Text]
Maybe Text
httpStatus :: Int
tokenNameList :: Maybe [Text]
nextToken :: Maybe Text
$sel:httpStatus:ListGitHubAccountTokenNamesResponse' :: ListGitHubAccountTokenNamesResponse -> Int
$sel:tokenNameList:ListGitHubAccountTokenNamesResponse' :: ListGitHubAccountTokenNamesResponse -> Maybe [Text]
$sel:nextToken:ListGitHubAccountTokenNamesResponse' :: ListGitHubAccountTokenNamesResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
tokenNameList
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus