{-# 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.StartLogging
(
startLogging
, StartLogging
, sName
, startLoggingResponse
, StartLoggingResponse
, srsResponseStatus
) 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 StartLogging = StartLogging'
{ _sName :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
startLogging
:: Text
-> StartLogging
startLogging pName_ = StartLogging' {_sName = pName_}
sName :: Lens' StartLogging Text
sName = lens _sName (\ s a -> s{_sName = a})
instance AWSRequest StartLogging where
type Rs StartLogging = StartLoggingResponse
request = postJSON cloudTrail
response
= receiveEmpty
(\ s h x ->
StartLoggingResponse' <$> (pure (fromEnum s)))
instance Hashable StartLogging where
instance NFData StartLogging where
instance ToHeaders StartLogging where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("com.amazonaws.cloudtrail.v20131101.CloudTrail_20131101.StartLogging"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON StartLogging where
toJSON StartLogging'{..}
= object (catMaybes [Just ("Name" .= _sName)])
instance ToPath StartLogging where
toPath = const "/"
instance ToQuery StartLogging where
toQuery = const mempty
newtype StartLoggingResponse = StartLoggingResponse'
{ _srsResponseStatus :: Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
startLoggingResponse
:: Int
-> StartLoggingResponse
startLoggingResponse pResponseStatus_ =
StartLoggingResponse' {_srsResponseStatus = pResponseStatus_}
srsResponseStatus :: Lens' StartLoggingResponse Int
srsResponseStatus = lens _srsResponseStatus (\ s a -> s{_srsResponseStatus = a})
instance NFData StartLoggingResponse where