module Network.AWS.IAM.UploadSSHPublicKey
(
uploadSSHPublicKey
, UploadSSHPublicKey
, usshpkUserName
, usshpkSSHPublicKeyBody
, uploadSSHPublicKeyResponse
, UploadSSHPublicKeyResponse
, uspkrsSSHPublicKey
, uspkrsResponseStatus
) 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 UploadSSHPublicKey = UploadSSHPublicKey'
{ _usshpkUserName :: !Text
, _usshpkSSHPublicKeyBody :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
uploadSSHPublicKey
:: Text
-> Text
-> UploadSSHPublicKey
uploadSSHPublicKey pUserName_ pSSHPublicKeyBody_ =
UploadSSHPublicKey'
{ _usshpkUserName = pUserName_
, _usshpkSSHPublicKeyBody = pSSHPublicKeyBody_
}
usshpkUserName :: Lens' UploadSSHPublicKey Text
usshpkUserName = lens _usshpkUserName (\ s a -> s{_usshpkUserName = a});
usshpkSSHPublicKeyBody :: Lens' UploadSSHPublicKey Text
usshpkSSHPublicKeyBody = lens _usshpkSSHPublicKeyBody (\ s a -> s{_usshpkSSHPublicKeyBody = a});
instance AWSRequest UploadSSHPublicKey where
type Rs UploadSSHPublicKey =
UploadSSHPublicKeyResponse
request = postQuery iAM
response
= receiveXMLWrapper "UploadSSHPublicKeyResult"
(\ s h x ->
UploadSSHPublicKeyResponse' <$>
(x .@? "SSHPublicKey") <*> (pure (fromEnum s)))
instance ToHeaders UploadSSHPublicKey where
toHeaders = const mempty
instance ToPath UploadSSHPublicKey where
toPath = const "/"
instance ToQuery UploadSSHPublicKey where
toQuery UploadSSHPublicKey'{..}
= mconcat
["Action" =: ("UploadSSHPublicKey" :: ByteString),
"Version" =: ("2010-05-08" :: ByteString),
"UserName" =: _usshpkUserName,
"SSHPublicKeyBody" =: _usshpkSSHPublicKeyBody]
data UploadSSHPublicKeyResponse = UploadSSHPublicKeyResponse'
{ _uspkrsSSHPublicKey :: !(Maybe SSHPublicKey)
, _uspkrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
uploadSSHPublicKeyResponse
:: Int
-> UploadSSHPublicKeyResponse
uploadSSHPublicKeyResponse pResponseStatus_ =
UploadSSHPublicKeyResponse'
{ _uspkrsSSHPublicKey = Nothing
, _uspkrsResponseStatus = pResponseStatus_
}
uspkrsSSHPublicKey :: Lens' UploadSSHPublicKeyResponse (Maybe SSHPublicKey)
uspkrsSSHPublicKey = lens _uspkrsSSHPublicKey (\ s a -> s{_uspkrsSSHPublicKey = a});
uspkrsResponseStatus :: Lens' UploadSSHPublicKeyResponse Int
uspkrsResponseStatus = lens _uspkrsResponseStatus (\ s a -> s{_uspkrsResponseStatus = a});