{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Network.AWS.IAM.GetCredentialReport
(
getCredentialReport
, GetCredentialReport
, getCredentialReportResponse
, GetCredentialReportResponse
, grsContent
, grsGeneratedTime
, grsReportFormat
, grsResponseStatus
) where
import Network.AWS.IAM.Types
import Network.AWS.IAM.Types.Product
import Network.AWS.Lens
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 Rs GetCredentialReport =
GetCredentialReportResponse
request = postQuery iam
response
= receiveXMLWrapper "GetCredentialReportResult"
(\ s h x ->
GetCredentialReportResponse' <$>
(x .@? "Content") <*> (x .@? "GeneratedTime") <*>
(x .@? "ReportFormat")
<*> (pure (fromEnum s)))
instance Hashable GetCredentialReport
instance NFData GetCredentialReport
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)
, _grsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getCredentialReportResponse
:: Int
-> GetCredentialReportResponse
getCredentialReportResponse pResponseStatus_ =
GetCredentialReportResponse'
{ _grsContent = Nothing
, _grsGeneratedTime = Nothing
, _grsReportFormat = Nothing
, _grsResponseStatus = pResponseStatus_
}
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});
grsResponseStatus :: Lens' GetCredentialReportResponse Int
grsResponseStatus = lens _grsResponseStatus (\ s a -> s{_grsResponseStatus = a});
instance NFData GetCredentialReportResponse