module Network.AWS.CloudTrail.UpdateTrail
(
updateTrail
, UpdateTrail
, utS3KeyPrefix
, utSNSTopicName
, utCloudWatchLogsLogGroupARN
, utIncludeGlobalServiceEvents
, utCloudWatchLogsRoleARN
, utS3BucketName
, utName
, updateTrailResponse
, UpdateTrailResponse
, utrsS3KeyPrefix
, utrsSNSTopicName
, utrsCloudWatchLogsLogGroupARN
, utrsName
, utrsIncludeGlobalServiceEvents
, utrsCloudWatchLogsRoleARN
, utrsS3BucketName
, utrsResponseStatus
) where
import Network.AWS.CloudTrail.Types
import Network.AWS.CloudTrail.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data UpdateTrail = UpdateTrail'
{ _utS3KeyPrefix :: !(Maybe Text)
, _utSNSTopicName :: !(Maybe Text)
, _utCloudWatchLogsLogGroupARN :: !(Maybe Text)
, _utIncludeGlobalServiceEvents :: !(Maybe Bool)
, _utCloudWatchLogsRoleARN :: !(Maybe Text)
, _utS3BucketName :: !(Maybe Text)
, _utName :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
updateTrail
:: Text
-> UpdateTrail
updateTrail pName_ =
UpdateTrail'
{ _utS3KeyPrefix = Nothing
, _utSNSTopicName = Nothing
, _utCloudWatchLogsLogGroupARN = Nothing
, _utIncludeGlobalServiceEvents = Nothing
, _utCloudWatchLogsRoleARN = Nothing
, _utS3BucketName = Nothing
, _utName = pName_
}
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});
utCloudWatchLogsLogGroupARN :: Lens' UpdateTrail (Maybe Text)
utCloudWatchLogsLogGroupARN = lens _utCloudWatchLogsLogGroupARN (\ s a -> s{_utCloudWatchLogsLogGroupARN = a});
utIncludeGlobalServiceEvents :: Lens' UpdateTrail (Maybe Bool)
utIncludeGlobalServiceEvents = lens _utIncludeGlobalServiceEvents (\ s a -> s{_utIncludeGlobalServiceEvents = a});
utCloudWatchLogsRoleARN :: Lens' UpdateTrail (Maybe Text)
utCloudWatchLogsRoleARN = lens _utCloudWatchLogsRoleARN (\ s a -> s{_utCloudWatchLogsRoleARN = a});
utS3BucketName :: Lens' UpdateTrail (Maybe Text)
utS3BucketName = lens _utS3BucketName (\ s a -> s{_utS3BucketName = a});
utName :: Lens' UpdateTrail Text
utName = lens _utName (\ s a -> s{_utName = a});
instance AWSRequest UpdateTrail where
type Rs UpdateTrail = UpdateTrailResponse
request = postJSON cloudTrail
response
= receiveJSON
(\ s h x ->
UpdateTrailResponse' <$>
(x .?> "S3KeyPrefix") <*> (x .?> "SnsTopicName") <*>
(x .?> "CloudWatchLogsLogGroupArn")
<*> (x .?> "Name")
<*> (x .?> "IncludeGlobalServiceEvents")
<*> (x .?> "CloudWatchLogsRoleArn")
<*> (x .?> "S3BucketName")
<*> (pure (fromEnum s)))
instance ToHeaders UpdateTrail where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("com.amazonaws.cloudtrail.v20131101.CloudTrail_20131101.UpdateTrail"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON UpdateTrail where
toJSON UpdateTrail'{..}
= object
(catMaybes
[("S3KeyPrefix" .=) <$> _utS3KeyPrefix,
("SnsTopicName" .=) <$> _utSNSTopicName,
("CloudWatchLogsLogGroupArn" .=) <$>
_utCloudWatchLogsLogGroupARN,
("IncludeGlobalServiceEvents" .=) <$>
_utIncludeGlobalServiceEvents,
("CloudWatchLogsRoleArn" .=) <$>
_utCloudWatchLogsRoleARN,
("S3BucketName" .=) <$> _utS3BucketName,
Just ("Name" .= _utName)])
instance ToPath UpdateTrail where
toPath = const "/"
instance ToQuery UpdateTrail where
toQuery = const mempty
data UpdateTrailResponse = UpdateTrailResponse'
{ _utrsS3KeyPrefix :: !(Maybe Text)
, _utrsSNSTopicName :: !(Maybe Text)
, _utrsCloudWatchLogsLogGroupARN :: !(Maybe Text)
, _utrsName :: !(Maybe Text)
, _utrsIncludeGlobalServiceEvents :: !(Maybe Bool)
, _utrsCloudWatchLogsRoleARN :: !(Maybe Text)
, _utrsS3BucketName :: !(Maybe Text)
, _utrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
updateTrailResponse
:: Int
-> UpdateTrailResponse
updateTrailResponse pResponseStatus_ =
UpdateTrailResponse'
{ _utrsS3KeyPrefix = Nothing
, _utrsSNSTopicName = Nothing
, _utrsCloudWatchLogsLogGroupARN = Nothing
, _utrsName = Nothing
, _utrsIncludeGlobalServiceEvents = Nothing
, _utrsCloudWatchLogsRoleARN = Nothing
, _utrsS3BucketName = Nothing
, _utrsResponseStatus = pResponseStatus_
}
utrsS3KeyPrefix :: Lens' UpdateTrailResponse (Maybe Text)
utrsS3KeyPrefix = lens _utrsS3KeyPrefix (\ s a -> s{_utrsS3KeyPrefix = a});
utrsSNSTopicName :: Lens' UpdateTrailResponse (Maybe Text)
utrsSNSTopicName = lens _utrsSNSTopicName (\ s a -> s{_utrsSNSTopicName = a});
utrsCloudWatchLogsLogGroupARN :: Lens' UpdateTrailResponse (Maybe Text)
utrsCloudWatchLogsLogGroupARN = lens _utrsCloudWatchLogsLogGroupARN (\ s a -> s{_utrsCloudWatchLogsLogGroupARN = a});
utrsName :: Lens' UpdateTrailResponse (Maybe Text)
utrsName = lens _utrsName (\ s a -> s{_utrsName = a});
utrsIncludeGlobalServiceEvents :: Lens' UpdateTrailResponse (Maybe Bool)
utrsIncludeGlobalServiceEvents = lens _utrsIncludeGlobalServiceEvents (\ s a -> s{_utrsIncludeGlobalServiceEvents = a});
utrsCloudWatchLogsRoleARN :: Lens' UpdateTrailResponse (Maybe Text)
utrsCloudWatchLogsRoleARN = lens _utrsCloudWatchLogsRoleARN (\ s a -> s{_utrsCloudWatchLogsRoleARN = a});
utrsS3BucketName :: Lens' UpdateTrailResponse (Maybe Text)
utrsS3BucketName = lens _utrsS3BucketName (\ s a -> s{_utrsS3BucketName = a});
utrsResponseStatus :: Lens' UpdateTrailResponse Int
utrsResponseStatus = lens _utrsResponseStatus (\ s a -> s{_utrsResponseStatus = a});