module Network.AWS.Redshift.EnableSnapshotCopy
(
EnableSnapshotCopy
, enableSnapshotCopy
, escClusterIdentifier
, escDestinationRegion
, escRetentionPeriod
, EnableSnapshotCopyResponse
, enableSnapshotCopyResponse
, escrCluster
) where
import Network.AWS.Prelude
import Network.AWS.Request.Query
import Network.AWS.Redshift.Types
import qualified GHC.Exts
data EnableSnapshotCopy = EnableSnapshotCopy
{ _escClusterIdentifier :: Text
, _escDestinationRegion :: Text
, _escRetentionPeriod :: Maybe Int
} deriving (Eq, Ord, Show)
enableSnapshotCopy :: Text
-> Text
-> EnableSnapshotCopy
enableSnapshotCopy p1 p2 = EnableSnapshotCopy
{ _escClusterIdentifier = p1
, _escDestinationRegion = p2
, _escRetentionPeriod = Nothing
}
escClusterIdentifier :: Lens' EnableSnapshotCopy Text
escClusterIdentifier =
lens _escClusterIdentifier (\s a -> s { _escClusterIdentifier = a })
escDestinationRegion :: Lens' EnableSnapshotCopy Text
escDestinationRegion =
lens _escDestinationRegion (\s a -> s { _escDestinationRegion = a })
escRetentionPeriod :: Lens' EnableSnapshotCopy (Maybe Int)
escRetentionPeriod =
lens _escRetentionPeriod (\s a -> s { _escRetentionPeriod = a })
newtype EnableSnapshotCopyResponse = EnableSnapshotCopyResponse
{ _escrCluster :: Maybe Cluster
} deriving (Eq, Show)
enableSnapshotCopyResponse :: EnableSnapshotCopyResponse
enableSnapshotCopyResponse = EnableSnapshotCopyResponse
{ _escrCluster = Nothing
}
escrCluster :: Lens' EnableSnapshotCopyResponse (Maybe Cluster)
escrCluster = lens _escrCluster (\s a -> s { _escrCluster = a })
instance ToPath EnableSnapshotCopy where
toPath = const "/"
instance ToQuery EnableSnapshotCopy where
toQuery EnableSnapshotCopy{..} = mconcat
[ "ClusterIdentifier" =? _escClusterIdentifier
, "DestinationRegion" =? _escDestinationRegion
, "RetentionPeriod" =? _escRetentionPeriod
]
instance ToHeaders EnableSnapshotCopy
instance AWSRequest EnableSnapshotCopy where
type Sv EnableSnapshotCopy = Redshift
type Rs EnableSnapshotCopy = EnableSnapshotCopyResponse
request = post "EnableSnapshotCopy"
response = xmlResponse
instance FromXML EnableSnapshotCopyResponse where
parseXML = withElement "EnableSnapshotCopyResult" $ \x -> EnableSnapshotCopyResponse
<$> x .@? "Cluster"