module Network.AWS.CloudTrail.GetTrailStatus
(
GetTrailStatus
, getTrailStatus
, gtsName
, GetTrailStatusResponse
, getTrailStatusResponse
, gtsrIsLogging
, gtsrLatestCloudWatchLogsDeliveryError
, gtsrLatestCloudWatchLogsDeliveryTime
, gtsrLatestDeliveryError
, gtsrLatestDeliveryTime
, gtsrLatestNotificationError
, gtsrLatestNotificationTime
, gtsrStartLoggingTime
, gtsrStopLoggingTime
) where
import Network.AWS.Prelude
import Network.AWS.Request.JSON
import Network.AWS.CloudTrail.Types
import qualified GHC.Exts
newtype GetTrailStatus = GetTrailStatus
{ _gtsName :: Text
} deriving (Eq, Ord, Show, Monoid, IsString)
getTrailStatus :: Text
-> GetTrailStatus
getTrailStatus p1 = GetTrailStatus
{ _gtsName = p1
}
gtsName :: Lens' GetTrailStatus Text
gtsName = lens _gtsName (\s a -> s { _gtsName = a })
data GetTrailStatusResponse = GetTrailStatusResponse
{ _gtsrIsLogging :: Maybe Bool
, _gtsrLatestCloudWatchLogsDeliveryError :: Maybe Text
, _gtsrLatestCloudWatchLogsDeliveryTime :: Maybe POSIX
, _gtsrLatestDeliveryError :: Maybe Text
, _gtsrLatestDeliveryTime :: Maybe POSIX
, _gtsrLatestNotificationError :: Maybe Text
, _gtsrLatestNotificationTime :: Maybe POSIX
, _gtsrStartLoggingTime :: Maybe POSIX
, _gtsrStopLoggingTime :: Maybe POSIX
} deriving (Eq, Ord, Show)
getTrailStatusResponse :: GetTrailStatusResponse
getTrailStatusResponse = GetTrailStatusResponse
{ _gtsrIsLogging = Nothing
, _gtsrLatestDeliveryError = Nothing
, _gtsrLatestNotificationError = Nothing
, _gtsrLatestDeliveryTime = Nothing
, _gtsrLatestNotificationTime = Nothing
, _gtsrStartLoggingTime = Nothing
, _gtsrStopLoggingTime = Nothing
, _gtsrLatestCloudWatchLogsDeliveryError = Nothing
, _gtsrLatestCloudWatchLogsDeliveryTime = Nothing
}
gtsrIsLogging :: Lens' GetTrailStatusResponse (Maybe Bool)
gtsrIsLogging = lens _gtsrIsLogging (\s a -> s { _gtsrIsLogging = a })
gtsrLatestCloudWatchLogsDeliveryError :: Lens' GetTrailStatusResponse (Maybe Text)
gtsrLatestCloudWatchLogsDeliveryError =
lens _gtsrLatestCloudWatchLogsDeliveryError
(\s a -> s { _gtsrLatestCloudWatchLogsDeliveryError = a })
gtsrLatestCloudWatchLogsDeliveryTime :: Lens' GetTrailStatusResponse (Maybe UTCTime)
gtsrLatestCloudWatchLogsDeliveryTime =
lens _gtsrLatestCloudWatchLogsDeliveryTime
(\s a -> s { _gtsrLatestCloudWatchLogsDeliveryTime = a })
. mapping _Time
gtsrLatestDeliveryError :: Lens' GetTrailStatusResponse (Maybe Text)
gtsrLatestDeliveryError =
lens _gtsrLatestDeliveryError (\s a -> s { _gtsrLatestDeliveryError = a })
gtsrLatestDeliveryTime :: Lens' GetTrailStatusResponse (Maybe UTCTime)
gtsrLatestDeliveryTime =
lens _gtsrLatestDeliveryTime (\s a -> s { _gtsrLatestDeliveryTime = a })
. mapping _Time
gtsrLatestNotificationError :: Lens' GetTrailStatusResponse (Maybe Text)
gtsrLatestNotificationError =
lens _gtsrLatestNotificationError
(\s a -> s { _gtsrLatestNotificationError = a })
gtsrLatestNotificationTime :: Lens' GetTrailStatusResponse (Maybe UTCTime)
gtsrLatestNotificationTime =
lens _gtsrLatestNotificationTime
(\s a -> s { _gtsrLatestNotificationTime = a })
. mapping _Time
gtsrStartLoggingTime :: Lens' GetTrailStatusResponse (Maybe UTCTime)
gtsrStartLoggingTime =
lens _gtsrStartLoggingTime (\s a -> s { _gtsrStartLoggingTime = a })
. mapping _Time
gtsrStopLoggingTime :: Lens' GetTrailStatusResponse (Maybe UTCTime)
gtsrStopLoggingTime =
lens _gtsrStopLoggingTime (\s a -> s { _gtsrStopLoggingTime = a })
. mapping _Time
instance ToPath GetTrailStatus where
toPath = const "/"
instance ToQuery GetTrailStatus where
toQuery = const mempty
instance ToHeaders GetTrailStatus
instance ToJSON GetTrailStatus where
toJSON GetTrailStatus{..} = object
[ "Name" .= _gtsName
]
instance AWSRequest GetTrailStatus where
type Sv GetTrailStatus = CloudTrail
type Rs GetTrailStatus = GetTrailStatusResponse
request = post "GetTrailStatus"
response = jsonResponse
instance FromJSON GetTrailStatusResponse where
parseJSON = withObject "GetTrailStatusResponse" $ \o -> GetTrailStatusResponse
<$> o .:? "IsLogging"
<*> o .:? "LatestCloudWatchLogsDeliveryError"
<*> o .:? "LatestCloudWatchLogsDeliveryTime"
<*> o .:? "LatestDeliveryError"
<*> o .:? "LatestDeliveryTime"
<*> o .:? "LatestNotificationError"
<*> o .:? "LatestNotificationTime"
<*> o .:? "StartLoggingTime"
<*> o .:? "StopLoggingTime"