module Network.AWS.CloudTrail.UpdateTrail
(
UpdateTrail
, updateTrail
, utCloudWatchLogsLogGroupArn
, utCloudWatchLogsRoleArn
, utIncludeGlobalServiceEvents
, utName
, utS3BucketName
, utS3KeyPrefix
, utSnsTopicName
, UpdateTrailResponse
, updateTrailResponse
, utrCloudWatchLogsLogGroupArn
, utrCloudWatchLogsRoleArn
, utrIncludeGlobalServiceEvents
, utrName
, utrS3BucketName
, utrS3KeyPrefix
, utrSnsTopicName
) where
import Network.AWS.Prelude
import Network.AWS.Request.JSON
import Network.AWS.CloudTrail.Types
import qualified GHC.Exts
data UpdateTrail = UpdateTrail
{ _utCloudWatchLogsLogGroupArn :: Maybe Text
, _utCloudWatchLogsRoleArn :: Maybe Text
, _utIncludeGlobalServiceEvents :: Maybe Bool
, _utName :: Text
, _utS3BucketName :: Maybe Text
, _utS3KeyPrefix :: Maybe Text
, _utSnsTopicName :: Maybe Text
} deriving (Eq, Ord, Show)
updateTrail :: Text
-> UpdateTrail
updateTrail p1 = UpdateTrail
{ _utName = p1
, _utS3BucketName = Nothing
, _utS3KeyPrefix = Nothing
, _utSnsTopicName = Nothing
, _utIncludeGlobalServiceEvents = Nothing
, _utCloudWatchLogsLogGroupArn = Nothing
, _utCloudWatchLogsRoleArn = Nothing
}
utCloudWatchLogsLogGroupArn :: Lens' UpdateTrail (Maybe Text)
utCloudWatchLogsLogGroupArn =
lens _utCloudWatchLogsLogGroupArn
(\s a -> s { _utCloudWatchLogsLogGroupArn = a })
utCloudWatchLogsRoleArn :: Lens' UpdateTrail (Maybe Text)
utCloudWatchLogsRoleArn =
lens _utCloudWatchLogsRoleArn (\s a -> s { _utCloudWatchLogsRoleArn = a })
utIncludeGlobalServiceEvents :: Lens' UpdateTrail (Maybe Bool)
utIncludeGlobalServiceEvents =
lens _utIncludeGlobalServiceEvents
(\s a -> s { _utIncludeGlobalServiceEvents = a })
utName :: Lens' UpdateTrail Text
utName = lens _utName (\s a -> s { _utName = a })
utS3BucketName :: Lens' UpdateTrail (Maybe Text)
utS3BucketName = lens _utS3BucketName (\s a -> s { _utS3BucketName = a })
utS3KeyPrefix :: Lens' UpdateTrail (Maybe Text)
utS3KeyPrefix = lens _utS3KeyPrefix (\s a -> s { _utS3KeyPrefix = a })
utSnsTopicName :: Lens' UpdateTrail (Maybe Text)
utSnsTopicName = lens _utSnsTopicName (\s a -> s { _utSnsTopicName = a })
data UpdateTrailResponse = UpdateTrailResponse
{ _utrCloudWatchLogsLogGroupArn :: Maybe Text
, _utrCloudWatchLogsRoleArn :: Maybe Text
, _utrIncludeGlobalServiceEvents :: Maybe Bool
, _utrName :: Maybe Text
, _utrS3BucketName :: Maybe Text
, _utrS3KeyPrefix :: Maybe Text
, _utrSnsTopicName :: Maybe Text
} deriving (Eq, Ord, Show)
updateTrailResponse :: UpdateTrailResponse
updateTrailResponse = UpdateTrailResponse
{ _utrName = Nothing
, _utrS3BucketName = Nothing
, _utrS3KeyPrefix = Nothing
, _utrSnsTopicName = Nothing
, _utrIncludeGlobalServiceEvents = Nothing
, _utrCloudWatchLogsLogGroupArn = Nothing
, _utrCloudWatchLogsRoleArn = Nothing
}
utrCloudWatchLogsLogGroupArn :: Lens' UpdateTrailResponse (Maybe Text)
utrCloudWatchLogsLogGroupArn =
lens _utrCloudWatchLogsLogGroupArn
(\s a -> s { _utrCloudWatchLogsLogGroupArn = a })
utrCloudWatchLogsRoleArn :: Lens' UpdateTrailResponse (Maybe Text)
utrCloudWatchLogsRoleArn =
lens _utrCloudWatchLogsRoleArn
(\s a -> s { _utrCloudWatchLogsRoleArn = a })
utrIncludeGlobalServiceEvents :: Lens' UpdateTrailResponse (Maybe Bool)
utrIncludeGlobalServiceEvents =
lens _utrIncludeGlobalServiceEvents
(\s a -> s { _utrIncludeGlobalServiceEvents = a })
utrName :: Lens' UpdateTrailResponse (Maybe Text)
utrName = lens _utrName (\s a -> s { _utrName = a })
utrS3BucketName :: Lens' UpdateTrailResponse (Maybe Text)
utrS3BucketName = lens _utrS3BucketName (\s a -> s { _utrS3BucketName = a })
utrS3KeyPrefix :: Lens' UpdateTrailResponse (Maybe Text)
utrS3KeyPrefix = lens _utrS3KeyPrefix (\s a -> s { _utrS3KeyPrefix = a })
utrSnsTopicName :: Lens' UpdateTrailResponse (Maybe Text)
utrSnsTopicName = lens _utrSnsTopicName (\s a -> s { _utrSnsTopicName = a })
instance ToPath UpdateTrail where
toPath = const "/"
instance ToQuery UpdateTrail where
toQuery = const mempty
instance ToHeaders UpdateTrail
instance ToJSON UpdateTrail where
toJSON UpdateTrail{..} = object
[ "Name" .= _utName
, "S3BucketName" .= _utS3BucketName
, "S3KeyPrefix" .= _utS3KeyPrefix
, "SnsTopicName" .= _utSnsTopicName
, "IncludeGlobalServiceEvents" .= _utIncludeGlobalServiceEvents
, "CloudWatchLogsLogGroupArn" .= _utCloudWatchLogsLogGroupArn
, "CloudWatchLogsRoleArn" .= _utCloudWatchLogsRoleArn
]
instance AWSRequest UpdateTrail where
type Sv UpdateTrail = CloudTrail
type Rs UpdateTrail = UpdateTrailResponse
request = post "UpdateTrail"
response = jsonResponse
instance FromJSON UpdateTrailResponse where
parseJSON = withObject "UpdateTrailResponse" $ \o -> UpdateTrailResponse
<$> o .:? "CloudWatchLogsLogGroupArn"
<*> o .:? "CloudWatchLogsRoleArn"
<*> o .:? "IncludeGlobalServiceEvents"
<*> o .:? "Name"
<*> o .:? "S3BucketName"
<*> o .:? "S3KeyPrefix"
<*> o .:? "SnsTopicName"