{-# 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.CloudTrail.StopLogging
(
stopLogging
, StopLogging
, slName
, stopLoggingResponse
, StopLoggingResponse
, slrsResponseStatus
) where
import Network.AWS.CloudTrail.Types
import Network.AWS.CloudTrail.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype StopLogging = StopLogging'
{ _slName :: Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
stopLogging
:: Text
-> StopLogging
stopLogging pName_ =
StopLogging'
{ _slName = pName_
}
slName :: Lens' StopLogging Text
slName = lens _slName (\ s a -> s{_slName = a});
instance AWSRequest StopLogging where
type Rs StopLogging = StopLoggingResponse
request = postJSON cloudTrail
response
= receiveEmpty
(\ s h x ->
StopLoggingResponse' <$> (pure (fromEnum s)))
instance Hashable StopLogging
instance NFData StopLogging
instance ToHeaders StopLogging where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("com.amazonaws.cloudtrail.v20131101.CloudTrail_20131101.StopLogging"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON StopLogging where
toJSON StopLogging'{..}
= object (catMaybes [Just ("Name" .= _slName)])
instance ToPath StopLogging where
toPath = const "/"
instance ToQuery StopLogging where
toQuery = const mempty
newtype StopLoggingResponse = StopLoggingResponse'
{ _slrsResponseStatus :: Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
stopLoggingResponse
:: Int
-> StopLoggingResponse
stopLoggingResponse pResponseStatus_ =
StopLoggingResponse'
{ _slrsResponseStatus = pResponseStatus_
}
slrsResponseStatus :: Lens' StopLoggingResponse Int
slrsResponseStatus = lens _slrsResponseStatus (\ s a -> s{_slrsResponseStatus = a});
instance NFData StopLoggingResponse