{-# 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.Redshift.ModifySnapshotCopyRetentionPeriod
(
modifySnapshotCopyRetentionPeriod
, ModifySnapshotCopyRetentionPeriod
, mscrpClusterIdentifier
, mscrpRetentionPeriod
, modifySnapshotCopyRetentionPeriodResponse
, ModifySnapshotCopyRetentionPeriodResponse
, mscrprsCluster
, mscrprsResponseStatus
) where
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Redshift.Types
import Network.AWS.Redshift.Types.Product
import Network.AWS.Request
import Network.AWS.Response
data ModifySnapshotCopyRetentionPeriod = ModifySnapshotCopyRetentionPeriod'
{ _mscrpClusterIdentifier :: !Text
, _mscrpRetentionPeriod :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
modifySnapshotCopyRetentionPeriod
:: Text
-> Int
-> ModifySnapshotCopyRetentionPeriod
modifySnapshotCopyRetentionPeriod pClusterIdentifier_ pRetentionPeriod_ =
ModifySnapshotCopyRetentionPeriod'
{ _mscrpClusterIdentifier = pClusterIdentifier_
, _mscrpRetentionPeriod = pRetentionPeriod_
}
mscrpClusterIdentifier :: Lens' ModifySnapshotCopyRetentionPeriod Text
mscrpClusterIdentifier = lens _mscrpClusterIdentifier (\ s a -> s{_mscrpClusterIdentifier = a})
mscrpRetentionPeriod :: Lens' ModifySnapshotCopyRetentionPeriod Int
mscrpRetentionPeriod = lens _mscrpRetentionPeriod (\ s a -> s{_mscrpRetentionPeriod = a})
instance AWSRequest ModifySnapshotCopyRetentionPeriod
where
type Rs ModifySnapshotCopyRetentionPeriod =
ModifySnapshotCopyRetentionPeriodResponse
request = postQuery redshift
response
= receiveXMLWrapper
"ModifySnapshotCopyRetentionPeriodResult"
(\ s h x ->
ModifySnapshotCopyRetentionPeriodResponse' <$>
(x .@? "Cluster") <*> (pure (fromEnum s)))
instance Hashable ModifySnapshotCopyRetentionPeriod
where
instance NFData ModifySnapshotCopyRetentionPeriod
where
instance ToHeaders ModifySnapshotCopyRetentionPeriod
where
toHeaders = const mempty
instance ToPath ModifySnapshotCopyRetentionPeriod
where
toPath = const "/"
instance ToQuery ModifySnapshotCopyRetentionPeriod
where
toQuery ModifySnapshotCopyRetentionPeriod'{..}
= mconcat
["Action" =:
("ModifySnapshotCopyRetentionPeriod" :: ByteString),
"Version" =: ("2012-12-01" :: ByteString),
"ClusterIdentifier" =: _mscrpClusterIdentifier,
"RetentionPeriod" =: _mscrpRetentionPeriod]
data ModifySnapshotCopyRetentionPeriodResponse = ModifySnapshotCopyRetentionPeriodResponse'
{ _mscrprsCluster :: !(Maybe Cluster)
, _mscrprsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
modifySnapshotCopyRetentionPeriodResponse
:: Int
-> ModifySnapshotCopyRetentionPeriodResponse
modifySnapshotCopyRetentionPeriodResponse pResponseStatus_ =
ModifySnapshotCopyRetentionPeriodResponse'
{_mscrprsCluster = Nothing, _mscrprsResponseStatus = pResponseStatus_}
mscrprsCluster :: Lens' ModifySnapshotCopyRetentionPeriodResponse (Maybe Cluster)
mscrprsCluster = lens _mscrprsCluster (\ s a -> s{_mscrprsCluster = a})
mscrprsResponseStatus :: Lens' ModifySnapshotCopyRetentionPeriodResponse Int
mscrprsResponseStatus = lens _mscrprsResponseStatus (\ s a -> s{_mscrprsResponseStatus = a})
instance NFData
ModifySnapshotCopyRetentionPeriodResponse
where