module Network.AWS.CloudWatchLogs.PutDestinationPolicy
(
putDestinationPolicy
, PutDestinationPolicy
, pdpDestinationName
, pdpAccessPolicy
, putDestinationPolicyResponse
, PutDestinationPolicyResponse
) where
import Network.AWS.CloudWatchLogs.Types
import Network.AWS.CloudWatchLogs.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data PutDestinationPolicy = PutDestinationPolicy'
{ _pdpDestinationName :: !Text
, _pdpAccessPolicy :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
putDestinationPolicy
:: Text
-> Text
-> PutDestinationPolicy
putDestinationPolicy pDestinationName_ pAccessPolicy_ =
PutDestinationPolicy'
{ _pdpDestinationName = pDestinationName_
, _pdpAccessPolicy = pAccessPolicy_
}
pdpDestinationName :: Lens' PutDestinationPolicy Text
pdpDestinationName = lens _pdpDestinationName (\ s a -> s{_pdpDestinationName = a});
pdpAccessPolicy :: Lens' PutDestinationPolicy Text
pdpAccessPolicy = lens _pdpAccessPolicy (\ s a -> s{_pdpAccessPolicy = a});
instance AWSRequest PutDestinationPolicy where
type Sv PutDestinationPolicy = CloudWatchLogs
type Rs PutDestinationPolicy =
PutDestinationPolicyResponse
request = postJSON
response = receiveNull PutDestinationPolicyResponse'
instance ToHeaders PutDestinationPolicy where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("Logs_20140328.PutDestinationPolicy" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON PutDestinationPolicy where
toJSON PutDestinationPolicy'{..}
= object
["destinationName" .= _pdpDestinationName,
"accessPolicy" .= _pdpAccessPolicy]
instance ToPath PutDestinationPolicy where
toPath = const "/"
instance ToQuery PutDestinationPolicy where
toQuery = const mempty
data PutDestinationPolicyResponse =
PutDestinationPolicyResponse'
deriving (Eq,Read,Show,Data,Typeable,Generic)
putDestinationPolicyResponse
:: PutDestinationPolicyResponse
putDestinationPolicyResponse = PutDestinationPolicyResponse'