module Network.AWS.IAM.GetAccessKeyLastUsed
(
getAccessKeyLastUsed
, GetAccessKeyLastUsed
, gakluAccessKeyId
, getAccessKeyLastUsedResponse
, GetAccessKeyLastUsedResponse
, gaklursUserName
, gaklursAccessKeyLastUsed
, gaklursResponseStatus
) where
import Network.AWS.IAM.Types
import Network.AWS.IAM.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype GetAccessKeyLastUsed = GetAccessKeyLastUsed'
{ _gakluAccessKeyId :: Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getAccessKeyLastUsed
:: Text
-> GetAccessKeyLastUsed
getAccessKeyLastUsed pAccessKeyId_ =
GetAccessKeyLastUsed'
{ _gakluAccessKeyId = pAccessKeyId_
}
gakluAccessKeyId :: Lens' GetAccessKeyLastUsed Text
gakluAccessKeyId = lens _gakluAccessKeyId (\ s a -> s{_gakluAccessKeyId = a});
instance AWSRequest GetAccessKeyLastUsed where
type Rs GetAccessKeyLastUsed =
GetAccessKeyLastUsedResponse
request = postQuery iAM
response
= receiveXMLWrapper "GetAccessKeyLastUsedResult"
(\ s h x ->
GetAccessKeyLastUsedResponse' <$>
(x .@? "UserName") <*> (x .@? "AccessKeyLastUsed")
<*> (pure (fromEnum s)))
instance ToHeaders GetAccessKeyLastUsed where
toHeaders = const mempty
instance ToPath GetAccessKeyLastUsed where
toPath = const "/"
instance ToQuery GetAccessKeyLastUsed where
toQuery GetAccessKeyLastUsed'{..}
= mconcat
["Action" =: ("GetAccessKeyLastUsed" :: ByteString),
"Version" =: ("2010-05-08" :: ByteString),
"AccessKeyId" =: _gakluAccessKeyId]
data GetAccessKeyLastUsedResponse = GetAccessKeyLastUsedResponse'
{ _gaklursUserName :: !(Maybe Text)
, _gaklursAccessKeyLastUsed :: !(Maybe AccessKeyLastUsed)
, _gaklursResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getAccessKeyLastUsedResponse
:: Int
-> GetAccessKeyLastUsedResponse
getAccessKeyLastUsedResponse pResponseStatus_ =
GetAccessKeyLastUsedResponse'
{ _gaklursUserName = Nothing
, _gaklursAccessKeyLastUsed = Nothing
, _gaklursResponseStatus = pResponseStatus_
}
gaklursUserName :: Lens' GetAccessKeyLastUsedResponse (Maybe Text)
gaklursUserName = lens _gaklursUserName (\ s a -> s{_gaklursUserName = a});
gaklursAccessKeyLastUsed :: Lens' GetAccessKeyLastUsedResponse (Maybe AccessKeyLastUsed)
gaklursAccessKeyLastUsed = lens _gaklursAccessKeyLastUsed (\ s a -> s{_gaklursAccessKeyLastUsed = a});
gaklursResponseStatus :: Lens' GetAccessKeyLastUsedResponse Int
gaklursResponseStatus = lens _gaklursResponseStatus (\ s a -> s{_gaklursResponseStatus = a});