module Network.AWS.CloudHSM.ListLunaClients
(
listLunaClients
, ListLunaClients
, llcNextToken
, listLunaClientsResponse
, ListLunaClientsResponse
, llcrsNextToken
, llcrsResponseStatus
, llcrsClientList
) where
import Network.AWS.CloudHSM.Types
import Network.AWS.CloudHSM.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype ListLunaClients = ListLunaClients'
{ _llcNextToken :: Maybe Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
listLunaClients
:: ListLunaClients
listLunaClients =
ListLunaClients'
{ _llcNextToken = Nothing
}
llcNextToken :: Lens' ListLunaClients (Maybe Text)
llcNextToken = lens _llcNextToken (\ s a -> s{_llcNextToken = a});
instance AWSRequest ListLunaClients where
type Rs ListLunaClients = ListLunaClientsResponse
request = postJSON cloudHSM
response
= receiveJSON
(\ s h x ->
ListLunaClientsResponse' <$>
(x .?> "NextToken") <*> (pure (fromEnum s)) <*>
(x .?> "ClientList" .!@ mempty))
instance ToHeaders ListLunaClients where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("CloudHsmFrontendService.ListLunaClients" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON ListLunaClients where
toJSON ListLunaClients'{..}
= object
(catMaybes [("NextToken" .=) <$> _llcNextToken])
instance ToPath ListLunaClients where
toPath = const "/"
instance ToQuery ListLunaClients where
toQuery = const mempty
data ListLunaClientsResponse = ListLunaClientsResponse'
{ _llcrsNextToken :: !(Maybe Text)
, _llcrsResponseStatus :: !Int
, _llcrsClientList :: ![Text]
} deriving (Eq,Read,Show,Data,Typeable,Generic)
listLunaClientsResponse
:: Int
-> ListLunaClientsResponse
listLunaClientsResponse pResponseStatus_ =
ListLunaClientsResponse'
{ _llcrsNextToken = Nothing
, _llcrsResponseStatus = pResponseStatus_
, _llcrsClientList = mempty
}
llcrsNextToken :: Lens' ListLunaClientsResponse (Maybe Text)
llcrsNextToken = lens _llcrsNextToken (\ s a -> s{_llcrsNextToken = a});
llcrsResponseStatus :: Lens' ListLunaClientsResponse Int
llcrsResponseStatus = lens _llcrsResponseStatus (\ s a -> s{_llcrsResponseStatus = a});
llcrsClientList :: Lens' ListLunaClientsResponse [Text]
llcrsClientList = lens _llcrsClientList (\ s a -> s{_llcrsClientList = a}) . _Coerce;