module Network.AWS.RDS.CreateDBClusterSnapshot
(
createDBClusterSnapshot
, CreateDBClusterSnapshot
, cdcsTags
, cdcsDBClusterSnapshotIdentifier
, cdcsDBClusterIdentifier
, createDBClusterSnapshotResponse
, CreateDBClusterSnapshotResponse
, cdbcsrsDBClusterSnapshot
, cdbcsrsStatus
) 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 CreateDBClusterSnapshot = CreateDBClusterSnapshot'
{ _cdcsTags :: !(Maybe [Tag])
, _cdcsDBClusterSnapshotIdentifier :: !Text
, _cdcsDBClusterIdentifier :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createDBClusterSnapshot
:: Text
-> Text
-> CreateDBClusterSnapshot
createDBClusterSnapshot pDBClusterSnapshotIdentifier_ pDBClusterIdentifier_ =
CreateDBClusterSnapshot'
{ _cdcsTags = Nothing
, _cdcsDBClusterSnapshotIdentifier = pDBClusterSnapshotIdentifier_
, _cdcsDBClusterIdentifier = pDBClusterIdentifier_
}
cdcsTags :: Lens' CreateDBClusterSnapshot [Tag]
cdcsTags = lens _cdcsTags (\ s a -> s{_cdcsTags = a}) . _Default . _Coerce;
cdcsDBClusterSnapshotIdentifier :: Lens' CreateDBClusterSnapshot Text
cdcsDBClusterSnapshotIdentifier = lens _cdcsDBClusterSnapshotIdentifier (\ s a -> s{_cdcsDBClusterSnapshotIdentifier = a});
cdcsDBClusterIdentifier :: Lens' CreateDBClusterSnapshot Text
cdcsDBClusterIdentifier = lens _cdcsDBClusterIdentifier (\ s a -> s{_cdcsDBClusterIdentifier = a});
instance AWSRequest CreateDBClusterSnapshot where
type Sv CreateDBClusterSnapshot = RDS
type Rs CreateDBClusterSnapshot =
CreateDBClusterSnapshotResponse
request = postQuery
response
= receiveXMLWrapper "CreateDBClusterSnapshotResult"
(\ s h x ->
CreateDBClusterSnapshotResponse' <$>
(x .@? "DBClusterSnapshot") <*> (pure (fromEnum s)))
instance ToHeaders CreateDBClusterSnapshot where
toHeaders = const mempty
instance ToPath CreateDBClusterSnapshot where
toPath = const "/"
instance ToQuery CreateDBClusterSnapshot where
toQuery CreateDBClusterSnapshot'{..}
= mconcat
["Action" =:
("CreateDBClusterSnapshot" :: ByteString),
"Version" =: ("2014-10-31" :: ByteString),
"Tags" =: toQuery (toQueryList "Tag" <$> _cdcsTags),
"DBClusterSnapshotIdentifier" =:
_cdcsDBClusterSnapshotIdentifier,
"DBClusterIdentifier" =: _cdcsDBClusterIdentifier]
data CreateDBClusterSnapshotResponse = CreateDBClusterSnapshotResponse'
{ _cdbcsrsDBClusterSnapshot :: !(Maybe DBClusterSnapshot)
, _cdbcsrsStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createDBClusterSnapshotResponse
:: Int
-> CreateDBClusterSnapshotResponse
createDBClusterSnapshotResponse pStatus_ =
CreateDBClusterSnapshotResponse'
{ _cdbcsrsDBClusterSnapshot = Nothing
, _cdbcsrsStatus = pStatus_
}
cdbcsrsDBClusterSnapshot :: Lens' CreateDBClusterSnapshotResponse (Maybe DBClusterSnapshot)
cdbcsrsDBClusterSnapshot = lens _cdbcsrsDBClusterSnapshot (\ s a -> s{_cdbcsrsDBClusterSnapshot = a});
cdbcsrsStatus :: Lens' CreateDBClusterSnapshotResponse Int
cdbcsrsStatus = lens _cdbcsrsStatus (\ s a -> s{_cdbcsrsStatus = a});