{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Network.AWS.CodeDeploy.ListGitHubAccountTokenNames
(
listGitHubAccountTokenNames
, ListGitHubAccountTokenNames
, lghatnNextToken
, listGitHubAccountTokenNamesResponse
, ListGitHubAccountTokenNamesResponse
, lghatnrsTokenNameList
, lghatnrsNextToken
, lghatnrsResponseStatus
) where
import Network.AWS.CodeDeploy.Types
import Network.AWS.CodeDeploy.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype ListGitHubAccountTokenNames = ListGitHubAccountTokenNames'
{ _lghatnNextToken :: Maybe Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
listGitHubAccountTokenNames
:: ListGitHubAccountTokenNames
listGitHubAccountTokenNames =
ListGitHubAccountTokenNames' {_lghatnNextToken = Nothing}
lghatnNextToken :: Lens' ListGitHubAccountTokenNames (Maybe Text)
lghatnNextToken = lens _lghatnNextToken (\ s a -> s{_lghatnNextToken = a})
instance AWSRequest ListGitHubAccountTokenNames where
type Rs ListGitHubAccountTokenNames =
ListGitHubAccountTokenNamesResponse
request = postJSON codeDeploy
response
= receiveJSON
(\ s h x ->
ListGitHubAccountTokenNamesResponse' <$>
(x .?> "tokenNameList" .!@ mempty) <*>
(x .?> "nextToken")
<*> (pure (fromEnum s)))
instance Hashable ListGitHubAccountTokenNames where
instance NFData ListGitHubAccountTokenNames where
instance ToHeaders ListGitHubAccountTokenNames where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("CodeDeploy_20141006.ListGitHubAccountTokenNames" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON ListGitHubAccountTokenNames where
toJSON ListGitHubAccountTokenNames'{..}
= object
(catMaybes [("nextToken" .=) <$> _lghatnNextToken])
instance ToPath ListGitHubAccountTokenNames where
toPath = const "/"
instance ToQuery ListGitHubAccountTokenNames where
toQuery = const mempty
data ListGitHubAccountTokenNamesResponse = ListGitHubAccountTokenNamesResponse'
{ _lghatnrsTokenNameList :: !(Maybe [Text])
, _lghatnrsNextToken :: !(Maybe Text)
, _lghatnrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
listGitHubAccountTokenNamesResponse
:: Int
-> ListGitHubAccountTokenNamesResponse
listGitHubAccountTokenNamesResponse pResponseStatus_ =
ListGitHubAccountTokenNamesResponse'
{ _lghatnrsTokenNameList = Nothing
, _lghatnrsNextToken = Nothing
, _lghatnrsResponseStatus = pResponseStatus_
}
lghatnrsTokenNameList :: Lens' ListGitHubAccountTokenNamesResponse [Text]
lghatnrsTokenNameList = lens _lghatnrsTokenNameList (\ s a -> s{_lghatnrsTokenNameList = a}) . _Default . _Coerce
lghatnrsNextToken :: Lens' ListGitHubAccountTokenNamesResponse (Maybe Text)
lghatnrsNextToken = lens _lghatnrsNextToken (\ s a -> s{_lghatnrsNextToken = a})
lghatnrsResponseStatus :: Lens' ListGitHubAccountTokenNamesResponse Int
lghatnrsResponseStatus = lens _lghatnrsResponseStatus (\ s a -> s{_lghatnrsResponseStatus = a})
instance NFData ListGitHubAccountTokenNamesResponse
where