module Network.AWS.IAM.GetCredentialReport
(
getCredentialReport
, GetCredentialReport
, getCredentialReportResponse
, GetCredentialReportResponse
, grsContent
, grsGeneratedTime
, grsReportFormat
, grsStatus
) 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 GetCredentialReport =
GetCredentialReport'
deriving (Eq,Read,Show,Data,Typeable,Generic)
getCredentialReport
:: GetCredentialReport
getCredentialReport = GetCredentialReport'
instance AWSRequest GetCredentialReport where
type Sv GetCredentialReport = IAM
type Rs GetCredentialReport =
GetCredentialReportResponse
request = postQuery
response
= receiveXMLWrapper "GetCredentialReportResult"
(\ s h x ->
GetCredentialReportResponse' <$>
(x .@? "Content") <*> (x .@? "GeneratedTime") <*>
(x .@? "ReportFormat")
<*> (pure (fromEnum s)))
instance ToHeaders GetCredentialReport where
toHeaders = const mempty
instance ToPath GetCredentialReport where
toPath = const "/"
instance ToQuery GetCredentialReport where
toQuery
= const
(mconcat
["Action" =: ("GetCredentialReport" :: ByteString),
"Version" =: ("2010-05-08" :: ByteString)])
data GetCredentialReportResponse = GetCredentialReportResponse'
{ _grsContent :: !(Maybe Base64)
, _grsGeneratedTime :: !(Maybe ISO8601)
, _grsReportFormat :: !(Maybe ReportFormatType)
, _grsStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getCredentialReportResponse
:: Int
-> GetCredentialReportResponse
getCredentialReportResponse pStatus_ =
GetCredentialReportResponse'
{ _grsContent = Nothing
, _grsGeneratedTime = Nothing
, _grsReportFormat = Nothing
, _grsStatus = pStatus_
}
grsContent :: Lens' GetCredentialReportResponse (Maybe ByteString)
grsContent = lens _grsContent (\ s a -> s{_grsContent = a}) . mapping _Base64;
grsGeneratedTime :: Lens' GetCredentialReportResponse (Maybe UTCTime)
grsGeneratedTime = lens _grsGeneratedTime (\ s a -> s{_grsGeneratedTime = a}) . mapping _Time;
grsReportFormat :: Lens' GetCredentialReportResponse (Maybe ReportFormatType)
grsReportFormat = lens _grsReportFormat (\ s a -> s{_grsReportFormat = a});
grsStatus :: Lens' GetCredentialReportResponse Int
grsStatus = lens _grsStatus (\ s a -> s{_grsStatus = a});