module Network.AWS.RDS.CopyDBSnapshot
(
copyDBSnapshot
, CopyDBSnapshot
, cdsCopyTags
, cdsTags
, cdsSourceDBSnapshotIdentifier
, cdsTargetDBSnapshotIdentifier
, copyDBSnapshotResponse
, CopyDBSnapshotResponse
, cdsrsDBSnapshot
, cdsrsStatus
) 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 CopyDBSnapshot = CopyDBSnapshot'
{ _cdsCopyTags :: !(Maybe Bool)
, _cdsTags :: !(Maybe [Tag])
, _cdsSourceDBSnapshotIdentifier :: !Text
, _cdsTargetDBSnapshotIdentifier :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
copyDBSnapshot
:: Text
-> Text
-> CopyDBSnapshot
copyDBSnapshot pSourceDBSnapshotIdentifier_ pTargetDBSnapshotIdentifier_ =
CopyDBSnapshot'
{ _cdsCopyTags = Nothing
, _cdsTags = Nothing
, _cdsSourceDBSnapshotIdentifier = pSourceDBSnapshotIdentifier_
, _cdsTargetDBSnapshotIdentifier = pTargetDBSnapshotIdentifier_
}
cdsCopyTags :: Lens' CopyDBSnapshot (Maybe Bool)
cdsCopyTags = lens _cdsCopyTags (\ s a -> s{_cdsCopyTags = a});
cdsTags :: Lens' CopyDBSnapshot [Tag]
cdsTags = lens _cdsTags (\ s a -> s{_cdsTags = a}) . _Default . _Coerce;
cdsSourceDBSnapshotIdentifier :: Lens' CopyDBSnapshot Text
cdsSourceDBSnapshotIdentifier = lens _cdsSourceDBSnapshotIdentifier (\ s a -> s{_cdsSourceDBSnapshotIdentifier = a});
cdsTargetDBSnapshotIdentifier :: Lens' CopyDBSnapshot Text
cdsTargetDBSnapshotIdentifier = lens _cdsTargetDBSnapshotIdentifier (\ s a -> s{_cdsTargetDBSnapshotIdentifier = a});
instance AWSRequest CopyDBSnapshot where
type Sv CopyDBSnapshot = RDS
type Rs CopyDBSnapshot = CopyDBSnapshotResponse
request = postQuery
response
= receiveXMLWrapper "CopyDBSnapshotResult"
(\ s h x ->
CopyDBSnapshotResponse' <$>
(x .@? "DBSnapshot") <*> (pure (fromEnum s)))
instance ToHeaders CopyDBSnapshot where
toHeaders = const mempty
instance ToPath CopyDBSnapshot where
toPath = const "/"
instance ToQuery CopyDBSnapshot where
toQuery CopyDBSnapshot'{..}
= mconcat
["Action" =: ("CopyDBSnapshot" :: ByteString),
"Version" =: ("2014-10-31" :: ByteString),
"CopyTags" =: _cdsCopyTags,
"Tags" =: toQuery (toQueryList "Tag" <$> _cdsTags),
"SourceDBSnapshotIdentifier" =:
_cdsSourceDBSnapshotIdentifier,
"TargetDBSnapshotIdentifier" =:
_cdsTargetDBSnapshotIdentifier]
data CopyDBSnapshotResponse = CopyDBSnapshotResponse'
{ _cdsrsDBSnapshot :: !(Maybe DBSnapshot)
, _cdsrsStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
copyDBSnapshotResponse
:: Int
-> CopyDBSnapshotResponse
copyDBSnapshotResponse pStatus_ =
CopyDBSnapshotResponse'
{ _cdsrsDBSnapshot = Nothing
, _cdsrsStatus = pStatus_
}
cdsrsDBSnapshot :: Lens' CopyDBSnapshotResponse (Maybe DBSnapshot)
cdsrsDBSnapshot = lens _cdsrsDBSnapshot (\ s a -> s{_cdsrsDBSnapshot = a});
cdsrsStatus :: Lens' CopyDBSnapshotResponse Int
cdsrsStatus = lens _cdsrsStatus (\ s a -> s{_cdsrsStatus = a});