module Network.AWS.CloudTrail.GetTrailStatus
(
getTrailStatus
, GetTrailStatus
, gtsName
, getTrailStatusResponse
, GetTrailStatusResponse
, gtsrsLatestDeliveryError
, gtsrsStartLoggingTime
, gtsrsLatestNotificationError
, gtsrsIsLogging
, gtsrsLatestDeliveryTime
, gtsrsLatestCloudWatchLogsDeliveryTime
, gtsrsLatestCloudWatchLogsDeliveryError
, gtsrsLatestNotificationTime
, gtsrsStopLoggingTime
, gtsrsStatus
) where
import Network.AWS.CloudTrail.Types
import Network.AWS.CloudTrail.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype GetTrailStatus = GetTrailStatus'
{ _gtsName :: Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getTrailStatus
:: Text
-> GetTrailStatus
getTrailStatus pName_ =
GetTrailStatus'
{ _gtsName = pName_
}
gtsName :: Lens' GetTrailStatus Text
gtsName = lens _gtsName (\ s a -> s{_gtsName = a});
instance AWSRequest GetTrailStatus where
type Sv GetTrailStatus = CloudTrail
type Rs GetTrailStatus = GetTrailStatusResponse
request = postJSON
response
= receiveJSON
(\ s h x ->
GetTrailStatusResponse' <$>
(x .?> "LatestDeliveryError") <*>
(x .?> "StartLoggingTime")
<*> (x .?> "LatestNotificationError")
<*> (x .?> "IsLogging")
<*> (x .?> "LatestDeliveryTime")
<*> (x .?> "LatestCloudWatchLogsDeliveryTime")
<*> (x .?> "LatestCloudWatchLogsDeliveryError")
<*> (x .?> "LatestNotificationTime")
<*> (x .?> "StopLoggingTime")
<*> (pure (fromEnum s)))
instance ToHeaders GetTrailStatus where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("com.amazonaws.cloudtrail.v20131101.CloudTrail_20131101.GetTrailStatus"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON GetTrailStatus where
toJSON GetTrailStatus'{..}
= object ["Name" .= _gtsName]
instance ToPath GetTrailStatus where
toPath = const "/"
instance ToQuery GetTrailStatus where
toQuery = const mempty
data GetTrailStatusResponse = GetTrailStatusResponse'
{ _gtsrsLatestDeliveryError :: !(Maybe Text)
, _gtsrsStartLoggingTime :: !(Maybe POSIX)
, _gtsrsLatestNotificationError :: !(Maybe Text)
, _gtsrsIsLogging :: !(Maybe Bool)
, _gtsrsLatestDeliveryTime :: !(Maybe POSIX)
, _gtsrsLatestCloudWatchLogsDeliveryTime :: !(Maybe POSIX)
, _gtsrsLatestCloudWatchLogsDeliveryError :: !(Maybe Text)
, _gtsrsLatestNotificationTime :: !(Maybe POSIX)
, _gtsrsStopLoggingTime :: !(Maybe POSIX)
, _gtsrsStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getTrailStatusResponse
:: Int
-> GetTrailStatusResponse
getTrailStatusResponse pStatus_ =
GetTrailStatusResponse'
{ _gtsrsLatestDeliveryError = Nothing
, _gtsrsStartLoggingTime = Nothing
, _gtsrsLatestNotificationError = Nothing
, _gtsrsIsLogging = Nothing
, _gtsrsLatestDeliveryTime = Nothing
, _gtsrsLatestCloudWatchLogsDeliveryTime = Nothing
, _gtsrsLatestCloudWatchLogsDeliveryError = Nothing
, _gtsrsLatestNotificationTime = Nothing
, _gtsrsStopLoggingTime = Nothing
, _gtsrsStatus = pStatus_
}
gtsrsLatestDeliveryError :: Lens' GetTrailStatusResponse (Maybe Text)
gtsrsLatestDeliveryError = lens _gtsrsLatestDeliveryError (\ s a -> s{_gtsrsLatestDeliveryError = a});
gtsrsStartLoggingTime :: Lens' GetTrailStatusResponse (Maybe UTCTime)
gtsrsStartLoggingTime = lens _gtsrsStartLoggingTime (\ s a -> s{_gtsrsStartLoggingTime = a}) . mapping _Time;
gtsrsLatestNotificationError :: Lens' GetTrailStatusResponse (Maybe Text)
gtsrsLatestNotificationError = lens _gtsrsLatestNotificationError (\ s a -> s{_gtsrsLatestNotificationError = a});
gtsrsIsLogging :: Lens' GetTrailStatusResponse (Maybe Bool)
gtsrsIsLogging = lens _gtsrsIsLogging (\ s a -> s{_gtsrsIsLogging = a});
gtsrsLatestDeliveryTime :: Lens' GetTrailStatusResponse (Maybe UTCTime)
gtsrsLatestDeliveryTime = lens _gtsrsLatestDeliveryTime (\ s a -> s{_gtsrsLatestDeliveryTime = a}) . mapping _Time;
gtsrsLatestCloudWatchLogsDeliveryTime :: Lens' GetTrailStatusResponse (Maybe UTCTime)
gtsrsLatestCloudWatchLogsDeliveryTime = lens _gtsrsLatestCloudWatchLogsDeliveryTime (\ s a -> s{_gtsrsLatestCloudWatchLogsDeliveryTime = a}) . mapping _Time;
gtsrsLatestCloudWatchLogsDeliveryError :: Lens' GetTrailStatusResponse (Maybe Text)
gtsrsLatestCloudWatchLogsDeliveryError = lens _gtsrsLatestCloudWatchLogsDeliveryError (\ s a -> s{_gtsrsLatestCloudWatchLogsDeliveryError = a});
gtsrsLatestNotificationTime :: Lens' GetTrailStatusResponse (Maybe UTCTime)
gtsrsLatestNotificationTime = lens _gtsrsLatestNotificationTime (\ s a -> s{_gtsrsLatestNotificationTime = a}) . mapping _Time;
gtsrsStopLoggingTime :: Lens' GetTrailStatusResponse (Maybe UTCTime)
gtsrsStopLoggingTime = lens _gtsrsStopLoggingTime (\ s a -> s{_gtsrsStopLoggingTime = a}) . mapping _Time;
gtsrsStatus :: Lens' GetTrailStatusResponse Int
gtsrsStatus = lens _gtsrsStatus (\ s a -> s{_gtsrsStatus = a});