module Network.AWS.RDS.CreateDBSnapshot
(
createDBSnapshot
, CreateDBSnapshot
, cdbsTags
, cdbsDBSnapshotIdentifier
, cdbsDBInstanceIdentifier
, createDBSnapshotResponse
, CreateDBSnapshotResponse
, cdbsrsDBSnapshot
, cdbsrsStatus
) 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 CreateDBSnapshot = CreateDBSnapshot'
{ _cdbsTags :: !(Maybe [Tag])
, _cdbsDBSnapshotIdentifier :: !Text
, _cdbsDBInstanceIdentifier :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createDBSnapshot
:: Text
-> Text
-> CreateDBSnapshot
createDBSnapshot pDBSnapshotIdentifier_ pDBInstanceIdentifier_ =
CreateDBSnapshot'
{ _cdbsTags = Nothing
, _cdbsDBSnapshotIdentifier = pDBSnapshotIdentifier_
, _cdbsDBInstanceIdentifier = pDBInstanceIdentifier_
}
cdbsTags :: Lens' CreateDBSnapshot [Tag]
cdbsTags = lens _cdbsTags (\ s a -> s{_cdbsTags = a}) . _Default . _Coerce;
cdbsDBSnapshotIdentifier :: Lens' CreateDBSnapshot Text
cdbsDBSnapshotIdentifier = lens _cdbsDBSnapshotIdentifier (\ s a -> s{_cdbsDBSnapshotIdentifier = a});
cdbsDBInstanceIdentifier :: Lens' CreateDBSnapshot Text
cdbsDBInstanceIdentifier = lens _cdbsDBInstanceIdentifier (\ s a -> s{_cdbsDBInstanceIdentifier = a});
instance AWSRequest CreateDBSnapshot where
type Sv CreateDBSnapshot = RDS
type Rs CreateDBSnapshot = CreateDBSnapshotResponse
request = postQuery
response
= receiveXMLWrapper "CreateDBSnapshotResult"
(\ s h x ->
CreateDBSnapshotResponse' <$>
(x .@? "DBSnapshot") <*> (pure (fromEnum s)))
instance ToHeaders CreateDBSnapshot where
toHeaders = const mempty
instance ToPath CreateDBSnapshot where
toPath = const "/"
instance ToQuery CreateDBSnapshot where
toQuery CreateDBSnapshot'{..}
= mconcat
["Action" =: ("CreateDBSnapshot" :: ByteString),
"Version" =: ("2014-10-31" :: ByteString),
"Tags" =: toQuery (toQueryList "Tag" <$> _cdbsTags),
"DBSnapshotIdentifier" =: _cdbsDBSnapshotIdentifier,
"DBInstanceIdentifier" =: _cdbsDBInstanceIdentifier]
data CreateDBSnapshotResponse = CreateDBSnapshotResponse'
{ _cdbsrsDBSnapshot :: !(Maybe DBSnapshot)
, _cdbsrsStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createDBSnapshotResponse
:: Int
-> CreateDBSnapshotResponse
createDBSnapshotResponse pStatus_ =
CreateDBSnapshotResponse'
{ _cdbsrsDBSnapshot = Nothing
, _cdbsrsStatus = pStatus_
}
cdbsrsDBSnapshot :: Lens' CreateDBSnapshotResponse (Maybe DBSnapshot)
cdbsrsDBSnapshot = lens _cdbsrsDBSnapshot (\ s a -> s{_cdbsrsDBSnapshot = a});
cdbsrsStatus :: Lens' CreateDBSnapshotResponse Int
cdbsrsStatus = lens _cdbsrsStatus (\ s a -> s{_cdbsrsStatus = a});