{-# 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.CloudWatchLogs.DeleteRetentionPolicy
(
deleteRetentionPolicy
, DeleteRetentionPolicy
, drpLogGroupName
, deleteRetentionPolicyResponse
, DeleteRetentionPolicyResponse
) where
import Network.AWS.CloudWatchLogs.Types
import Network.AWS.CloudWatchLogs.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype DeleteRetentionPolicy = DeleteRetentionPolicy'
{ _drpLogGroupName :: Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
deleteRetentionPolicy
:: Text
-> DeleteRetentionPolicy
deleteRetentionPolicy pLogGroupName_ =
DeleteRetentionPolicy'
{ _drpLogGroupName = pLogGroupName_
}
drpLogGroupName :: Lens' DeleteRetentionPolicy Text
drpLogGroupName = lens _drpLogGroupName (\ s a -> s{_drpLogGroupName = a});
instance AWSRequest DeleteRetentionPolicy where
type Rs DeleteRetentionPolicy =
DeleteRetentionPolicyResponse
request = postJSON cloudWatchLogs
response = receiveNull DeleteRetentionPolicyResponse'
instance Hashable DeleteRetentionPolicy
instance NFData DeleteRetentionPolicy
instance ToHeaders DeleteRetentionPolicy where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("Logs_20140328.DeleteRetentionPolicy" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DeleteRetentionPolicy where
toJSON DeleteRetentionPolicy'{..}
= object
(catMaybes
[Just ("logGroupName" .= _drpLogGroupName)])
instance ToPath DeleteRetentionPolicy where
toPath = const "/"
instance ToQuery DeleteRetentionPolicy where
toQuery = const mempty
data DeleteRetentionPolicyResponse =
DeleteRetentionPolicyResponse'
deriving (Eq,Read,Show,Data,Typeable,Generic)
deleteRetentionPolicyResponse
:: DeleteRetentionPolicyResponse
deleteRetentionPolicyResponse = DeleteRetentionPolicyResponse'
instance NFData DeleteRetentionPolicyResponse