module Network.AWS.Redshift.CopyClusterSnapshot
(
copyClusterSnapshot
, CopyClusterSnapshot
, ccsSourceSnapshotClusterIdentifier
, ccsSourceSnapshotIdentifier
, ccsTargetSnapshotIdentifier
, copyClusterSnapshotResponse
, CopyClusterSnapshotResponse
, ccsrsSnapshot
, ccsrsResponseStatus
) 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 CopyClusterSnapshot = CopyClusterSnapshot'
{ _ccsSourceSnapshotClusterIdentifier :: !(Maybe Text)
, _ccsSourceSnapshotIdentifier :: !Text
, _ccsTargetSnapshotIdentifier :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
copyClusterSnapshot
:: Text
-> Text
-> CopyClusterSnapshot
copyClusterSnapshot pSourceSnapshotIdentifier_ pTargetSnapshotIdentifier_ =
CopyClusterSnapshot'
{ _ccsSourceSnapshotClusterIdentifier = Nothing
, _ccsSourceSnapshotIdentifier = pSourceSnapshotIdentifier_
, _ccsTargetSnapshotIdentifier = pTargetSnapshotIdentifier_
}
ccsSourceSnapshotClusterIdentifier :: Lens' CopyClusterSnapshot (Maybe Text)
ccsSourceSnapshotClusterIdentifier = lens _ccsSourceSnapshotClusterIdentifier (\ s a -> s{_ccsSourceSnapshotClusterIdentifier = a});
ccsSourceSnapshotIdentifier :: Lens' CopyClusterSnapshot Text
ccsSourceSnapshotIdentifier = lens _ccsSourceSnapshotIdentifier (\ s a -> s{_ccsSourceSnapshotIdentifier = a});
ccsTargetSnapshotIdentifier :: Lens' CopyClusterSnapshot Text
ccsTargetSnapshotIdentifier = lens _ccsTargetSnapshotIdentifier (\ s a -> s{_ccsTargetSnapshotIdentifier = a});
instance AWSRequest CopyClusterSnapshot where
type Rs CopyClusterSnapshot =
CopyClusterSnapshotResponse
request = postQuery redshift
response
= receiveXMLWrapper "CopyClusterSnapshotResult"
(\ s h x ->
CopyClusterSnapshotResponse' <$>
(x .@? "Snapshot") <*> (pure (fromEnum s)))
instance Hashable CopyClusterSnapshot
instance NFData CopyClusterSnapshot
instance ToHeaders CopyClusterSnapshot where
toHeaders = const mempty
instance ToPath CopyClusterSnapshot where
toPath = const "/"
instance ToQuery CopyClusterSnapshot where
toQuery CopyClusterSnapshot'{..}
= mconcat
["Action" =: ("CopyClusterSnapshot" :: ByteString),
"Version" =: ("2012-12-01" :: ByteString),
"SourceSnapshotClusterIdentifier" =:
_ccsSourceSnapshotClusterIdentifier,
"SourceSnapshotIdentifier" =:
_ccsSourceSnapshotIdentifier,
"TargetSnapshotIdentifier" =:
_ccsTargetSnapshotIdentifier]
data CopyClusterSnapshotResponse = CopyClusterSnapshotResponse'
{ _ccsrsSnapshot :: !(Maybe Snapshot)
, _ccsrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
copyClusterSnapshotResponse
:: Int
-> CopyClusterSnapshotResponse
copyClusterSnapshotResponse pResponseStatus_ =
CopyClusterSnapshotResponse'
{ _ccsrsSnapshot = Nothing
, _ccsrsResponseStatus = pResponseStatus_
}
ccsrsSnapshot :: Lens' CopyClusterSnapshotResponse (Maybe Snapshot)
ccsrsSnapshot = lens _ccsrsSnapshot (\ s a -> s{_ccsrsSnapshot = a});
ccsrsResponseStatus :: Lens' CopyClusterSnapshotResponse Int
ccsrsResponseStatus = lens _ccsrsResponseStatus (\ s a -> s{_ccsrsResponseStatus = a});
instance NFData CopyClusterSnapshotResponse