module Network.AWS.Redshift.EnableSnapshotCopy
(
enableSnapshotCopy
, EnableSnapshotCopy
, escRetentionPeriod
, escSnapshotCopyGrantName
, escClusterIdentifier
, escDestinationRegion
, enableSnapshotCopyResponse
, EnableSnapshotCopyResponse
, escrsCluster
, escrsResponseStatus
) where
import Network.AWS.Prelude
import Network.AWS.Redshift.Types
import Network.AWS.Redshift.Types.Product
import Network.AWS.Request
import Network.AWS.Response
data EnableSnapshotCopy = EnableSnapshotCopy'
{ _escRetentionPeriod :: !(Maybe Int)
, _escSnapshotCopyGrantName :: !(Maybe Text)
, _escClusterIdentifier :: !Text
, _escDestinationRegion :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
enableSnapshotCopy
:: Text
-> Text
-> EnableSnapshotCopy
enableSnapshotCopy pClusterIdentifier_ pDestinationRegion_ =
EnableSnapshotCopy'
{ _escRetentionPeriod = Nothing
, _escSnapshotCopyGrantName = Nothing
, _escClusterIdentifier = pClusterIdentifier_
, _escDestinationRegion = pDestinationRegion_
}
escRetentionPeriod :: Lens' EnableSnapshotCopy (Maybe Int)
escRetentionPeriod = lens _escRetentionPeriod (\ s a -> s{_escRetentionPeriod = a});
escSnapshotCopyGrantName :: Lens' EnableSnapshotCopy (Maybe Text)
escSnapshotCopyGrantName = lens _escSnapshotCopyGrantName (\ s a -> s{_escSnapshotCopyGrantName = a});
escClusterIdentifier :: Lens' EnableSnapshotCopy Text
escClusterIdentifier = lens _escClusterIdentifier (\ s a -> s{_escClusterIdentifier = a});
escDestinationRegion :: Lens' EnableSnapshotCopy Text
escDestinationRegion = lens _escDestinationRegion (\ s a -> s{_escDestinationRegion = a});
instance AWSRequest EnableSnapshotCopy where
type Rs EnableSnapshotCopy =
EnableSnapshotCopyResponse
request = postQuery redshift
response
= receiveXMLWrapper "EnableSnapshotCopyResult"
(\ s h x ->
EnableSnapshotCopyResponse' <$>
(x .@? "Cluster") <*> (pure (fromEnum s)))
instance ToHeaders EnableSnapshotCopy where
toHeaders = const mempty
instance ToPath EnableSnapshotCopy where
toPath = const "/"
instance ToQuery EnableSnapshotCopy where
toQuery EnableSnapshotCopy'{..}
= mconcat
["Action" =: ("EnableSnapshotCopy" :: ByteString),
"Version" =: ("2012-12-01" :: ByteString),
"RetentionPeriod" =: _escRetentionPeriod,
"SnapshotCopyGrantName" =: _escSnapshotCopyGrantName,
"ClusterIdentifier" =: _escClusterIdentifier,
"DestinationRegion" =: _escDestinationRegion]
data EnableSnapshotCopyResponse = EnableSnapshotCopyResponse'
{ _escrsCluster :: !(Maybe Cluster)
, _escrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
enableSnapshotCopyResponse
:: Int
-> EnableSnapshotCopyResponse
enableSnapshotCopyResponse pResponseStatus_ =
EnableSnapshotCopyResponse'
{ _escrsCluster = Nothing
, _escrsResponseStatus = pResponseStatus_
}
escrsCluster :: Lens' EnableSnapshotCopyResponse (Maybe Cluster)
escrsCluster = lens _escrsCluster (\ s a -> s{_escrsCluster = a});
escrsResponseStatus :: Lens' EnableSnapshotCopyResponse Int
escrsResponseStatus = lens _escrsResponseStatus (\ s a -> s{_escrsResponseStatus = a});