module Network.AWS.IAM.GetSSHPublicKey
(
getSSHPublicKey
, GetSSHPublicKey
, gspkUserName
, gspkSSHPublicKeyId
, gspkEncoding
, getSSHPublicKeyResponse
, GetSSHPublicKeyResponse
, gspkrsSSHPublicKey
, gspkrsResponseStatus
) where
import Network.AWS.IAM.Types
import Network.AWS.IAM.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data GetSSHPublicKey = GetSSHPublicKey'
{ _gspkUserName :: !Text
, _gspkSSHPublicKeyId :: !Text
, _gspkEncoding :: !EncodingType
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getSSHPublicKey
:: Text
-> Text
-> EncodingType
-> GetSSHPublicKey
getSSHPublicKey pUserName_ pSSHPublicKeyId_ pEncoding_ =
GetSSHPublicKey'
{ _gspkUserName = pUserName_
, _gspkSSHPublicKeyId = pSSHPublicKeyId_
, _gspkEncoding = pEncoding_
}
gspkUserName :: Lens' GetSSHPublicKey Text
gspkUserName = lens _gspkUserName (\ s a -> s{_gspkUserName = a});
gspkSSHPublicKeyId :: Lens' GetSSHPublicKey Text
gspkSSHPublicKeyId = lens _gspkSSHPublicKeyId (\ s a -> s{_gspkSSHPublicKeyId = a});
gspkEncoding :: Lens' GetSSHPublicKey EncodingType
gspkEncoding = lens _gspkEncoding (\ s a -> s{_gspkEncoding = a});
instance AWSRequest GetSSHPublicKey where
type Rs GetSSHPublicKey = GetSSHPublicKeyResponse
request = postQuery iAM
response
= receiveXMLWrapper "GetSSHPublicKeyResult"
(\ s h x ->
GetSSHPublicKeyResponse' <$>
(x .@? "SSHPublicKey") <*> (pure (fromEnum s)))
instance ToHeaders GetSSHPublicKey where
toHeaders = const mempty
instance ToPath GetSSHPublicKey where
toPath = const "/"
instance ToQuery GetSSHPublicKey where
toQuery GetSSHPublicKey'{..}
= mconcat
["Action" =: ("GetSSHPublicKey" :: ByteString),
"Version" =: ("2010-05-08" :: ByteString),
"UserName" =: _gspkUserName,
"SSHPublicKeyId" =: _gspkSSHPublicKeyId,
"Encoding" =: _gspkEncoding]
data GetSSHPublicKeyResponse = GetSSHPublicKeyResponse'
{ _gspkrsSSHPublicKey :: !(Maybe SSHPublicKey)
, _gspkrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getSSHPublicKeyResponse
:: Int
-> GetSSHPublicKeyResponse
getSSHPublicKeyResponse pResponseStatus_ =
GetSSHPublicKeyResponse'
{ _gspkrsSSHPublicKey = Nothing
, _gspkrsResponseStatus = pResponseStatus_
}
gspkrsSSHPublicKey :: Lens' GetSSHPublicKeyResponse (Maybe SSHPublicKey)
gspkrsSSHPublicKey = lens _gspkrsSSHPublicKey (\ s a -> s{_gspkrsSSHPublicKey = a});
gspkrsResponseStatus :: Lens' GetSSHPublicKeyResponse Int
gspkrsResponseStatus = lens _gspkrsResponseStatus (\ s a -> s{_gspkrsResponseStatus = a});