module Network.AWS.CloudHSM.ListHAPGs
(
listHAPGs
, ListHAPGs
, lhNextToken
, listHAPGsResponse
, ListHAPGsResponse
, lhrsNextToken
, lhrsResponseStatus
, lhrsHAPGList
) where
import Network.AWS.CloudHSM.Types
import Network.AWS.CloudHSM.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype ListHAPGs = ListHAPGs'
{ _lhNextToken :: Maybe Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
listHAPGs
:: ListHAPGs
listHAPGs =
ListHAPGs'
{ _lhNextToken = Nothing
}
lhNextToken :: Lens' ListHAPGs (Maybe Text)
lhNextToken = lens _lhNextToken (\ s a -> s{_lhNextToken = a});
instance AWSRequest ListHAPGs where
type Rs ListHAPGs = ListHAPGsResponse
request = postJSON cloudHSM
response
= receiveJSON
(\ s h x ->
ListHAPGsResponse' <$>
(x .?> "NextToken") <*> (pure (fromEnum s)) <*>
(x .?> "HapgList" .!@ mempty))
instance Hashable ListHAPGs
instance NFData ListHAPGs
instance ToHeaders ListHAPGs where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("CloudHsmFrontendService.ListHapgs" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON ListHAPGs where
toJSON ListHAPGs'{..}
= object
(catMaybes [("NextToken" .=) <$> _lhNextToken])
instance ToPath ListHAPGs where
toPath = const "/"
instance ToQuery ListHAPGs where
toQuery = const mempty
data ListHAPGsResponse = ListHAPGsResponse'
{ _lhrsNextToken :: !(Maybe Text)
, _lhrsResponseStatus :: !Int
, _lhrsHAPGList :: ![Text]
} deriving (Eq,Read,Show,Data,Typeable,Generic)
listHAPGsResponse
:: Int
-> ListHAPGsResponse
listHAPGsResponse pResponseStatus_ =
ListHAPGsResponse'
{ _lhrsNextToken = Nothing
, _lhrsResponseStatus = pResponseStatus_
, _lhrsHAPGList = mempty
}
lhrsNextToken :: Lens' ListHAPGsResponse (Maybe Text)
lhrsNextToken = lens _lhrsNextToken (\ s a -> s{_lhrsNextToken = a});
lhrsResponseStatus :: Lens' ListHAPGsResponse Int
lhrsResponseStatus = lens _lhrsResponseStatus (\ s a -> s{_lhrsResponseStatus = a});
lhrsHAPGList :: Lens' ListHAPGsResponse [Text]
lhrsHAPGList = lens _lhrsHAPGList (\ s a -> s{_lhrsHAPGList = a}) . _Coerce;
instance NFData ListHAPGsResponse