module Network.AWS.CloudWatchLogs.PutRetentionPolicy
(
PutRetentionPolicy
, putRetentionPolicy
, prpLogGroupName
, prpRetentionInDays
, PutRetentionPolicyResponse
, putRetentionPolicyResponse
) where
import Network.AWS.Prelude
import Network.AWS.Request.JSON
import Network.AWS.CloudWatchLogs.Types
import qualified GHC.Exts
data PutRetentionPolicy = PutRetentionPolicy
{ _prpLogGroupName :: Text
, _prpRetentionInDays :: Int
} deriving (Eq, Ord, Show)
putRetentionPolicy :: Text
-> Int
-> PutRetentionPolicy
putRetentionPolicy p1 p2 = PutRetentionPolicy
{ _prpLogGroupName = p1
, _prpRetentionInDays = p2
}
prpLogGroupName :: Lens' PutRetentionPolicy Text
prpLogGroupName = lens _prpLogGroupName (\s a -> s { _prpLogGroupName = a })
prpRetentionInDays :: Lens' PutRetentionPolicy Int
prpRetentionInDays =
lens _prpRetentionInDays (\s a -> s { _prpRetentionInDays = a })
data PutRetentionPolicyResponse = PutRetentionPolicyResponse
deriving (Eq, Ord, Show, Generic)
putRetentionPolicyResponse :: PutRetentionPolicyResponse
putRetentionPolicyResponse = PutRetentionPolicyResponse
instance ToPath PutRetentionPolicy where
toPath = const "/"
instance ToQuery PutRetentionPolicy where
toQuery = const mempty
instance ToHeaders PutRetentionPolicy
instance ToJSON PutRetentionPolicy where
toJSON PutRetentionPolicy{..} = object
[ "logGroupName" .= _prpLogGroupName
, "retentionInDays" .= _prpRetentionInDays
]
instance AWSRequest PutRetentionPolicy where
type Sv PutRetentionPolicy = CloudWatchLogs
type Rs PutRetentionPolicy = PutRetentionPolicyResponse
request = post "PutRetentionPolicy"
response = nullResponse PutRetentionPolicyResponse