module Network.AWS.RDS.CopyDBClusterSnapshot
(
copyDBClusterSnapshot
, CopyDBClusterSnapshot
, cdbcsTags
, cdbcsSourceDBClusterSnapshotIdentifier
, cdbcsTargetDBClusterSnapshotIdentifier
, copyDBClusterSnapshotResponse
, CopyDBClusterSnapshotResponse
, cdcsrsDBClusterSnapshot
, cdcsrsResponseStatus
) where
import Network.AWS.Prelude
import Network.AWS.RDS.Types
import Network.AWS.RDS.Types.Product
import Network.AWS.Request
import Network.AWS.Response
data CopyDBClusterSnapshot = CopyDBClusterSnapshot'
{ _cdbcsTags :: !(Maybe [Tag])
, _cdbcsSourceDBClusterSnapshotIdentifier :: !Text
, _cdbcsTargetDBClusterSnapshotIdentifier :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
copyDBClusterSnapshot
:: Text
-> Text
-> CopyDBClusterSnapshot
copyDBClusterSnapshot pSourceDBClusterSnapshotIdentifier_ pTargetDBClusterSnapshotIdentifier_ =
CopyDBClusterSnapshot'
{ _cdbcsTags = Nothing
, _cdbcsSourceDBClusterSnapshotIdentifier = pSourceDBClusterSnapshotIdentifier_
, _cdbcsTargetDBClusterSnapshotIdentifier = pTargetDBClusterSnapshotIdentifier_
}
cdbcsTags :: Lens' CopyDBClusterSnapshot [Tag]
cdbcsTags = lens _cdbcsTags (\ s a -> s{_cdbcsTags = a}) . _Default . _Coerce;
cdbcsSourceDBClusterSnapshotIdentifier :: Lens' CopyDBClusterSnapshot Text
cdbcsSourceDBClusterSnapshotIdentifier = lens _cdbcsSourceDBClusterSnapshotIdentifier (\ s a -> s{_cdbcsSourceDBClusterSnapshotIdentifier = a});
cdbcsTargetDBClusterSnapshotIdentifier :: Lens' CopyDBClusterSnapshot Text
cdbcsTargetDBClusterSnapshotIdentifier = lens _cdbcsTargetDBClusterSnapshotIdentifier (\ s a -> s{_cdbcsTargetDBClusterSnapshotIdentifier = a});
instance AWSRequest CopyDBClusterSnapshot where
type Rs CopyDBClusterSnapshot =
CopyDBClusterSnapshotResponse
request = postQuery rDS
response
= receiveXMLWrapper "CopyDBClusterSnapshotResult"
(\ s h x ->
CopyDBClusterSnapshotResponse' <$>
(x .@? "DBClusterSnapshot") <*> (pure (fromEnum s)))
instance ToHeaders CopyDBClusterSnapshot where
toHeaders = const mempty
instance ToPath CopyDBClusterSnapshot where
toPath = const "/"
instance ToQuery CopyDBClusterSnapshot where
toQuery CopyDBClusterSnapshot'{..}
= mconcat
["Action" =: ("CopyDBClusterSnapshot" :: ByteString),
"Version" =: ("2014-10-31" :: ByteString),
"Tags" =: toQuery (toQueryList "Tag" <$> _cdbcsTags),
"SourceDBClusterSnapshotIdentifier" =:
_cdbcsSourceDBClusterSnapshotIdentifier,
"TargetDBClusterSnapshotIdentifier" =:
_cdbcsTargetDBClusterSnapshotIdentifier]
data CopyDBClusterSnapshotResponse = CopyDBClusterSnapshotResponse'
{ _cdcsrsDBClusterSnapshot :: !(Maybe DBClusterSnapshot)
, _cdcsrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
copyDBClusterSnapshotResponse
:: Int
-> CopyDBClusterSnapshotResponse
copyDBClusterSnapshotResponse pResponseStatus_ =
CopyDBClusterSnapshotResponse'
{ _cdcsrsDBClusterSnapshot = Nothing
, _cdcsrsResponseStatus = pResponseStatus_
}
cdcsrsDBClusterSnapshot :: Lens' CopyDBClusterSnapshotResponse (Maybe DBClusterSnapshot)
cdcsrsDBClusterSnapshot = lens _cdcsrsDBClusterSnapshot (\ s a -> s{_cdcsrsDBClusterSnapshot = a});
cdcsrsResponseStatus :: Lens' CopyDBClusterSnapshotResponse Int
cdcsrsResponseStatus = lens _cdcsrsResponseStatus (\ s a -> s{_cdcsrsResponseStatus = a});