module Network.AWS.ElastiCache.DeleteReplicationGroup
(
deleteReplicationGroup
, DeleteReplicationGroup
, drgFinalSnapshotIdentifier
, drgRetainPrimaryCluster
, drgReplicationGroupId
, deleteReplicationGroupResponse
, DeleteReplicationGroupResponse
, delrsReplicationGroup
, delrsResponseStatus
) where
import Network.AWS.ElastiCache.Types
import Network.AWS.ElastiCache.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data DeleteReplicationGroup = DeleteReplicationGroup'
{ _drgFinalSnapshotIdentifier :: !(Maybe Text)
, _drgRetainPrimaryCluster :: !(Maybe Bool)
, _drgReplicationGroupId :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
deleteReplicationGroup
:: Text
-> DeleteReplicationGroup
deleteReplicationGroup pReplicationGroupId_ =
DeleteReplicationGroup'
{ _drgFinalSnapshotIdentifier = Nothing
, _drgRetainPrimaryCluster = Nothing
, _drgReplicationGroupId = pReplicationGroupId_
}
drgFinalSnapshotIdentifier :: Lens' DeleteReplicationGroup (Maybe Text)
drgFinalSnapshotIdentifier = lens _drgFinalSnapshotIdentifier (\ s a -> s{_drgFinalSnapshotIdentifier = a});
drgRetainPrimaryCluster :: Lens' DeleteReplicationGroup (Maybe Bool)
drgRetainPrimaryCluster = lens _drgRetainPrimaryCluster (\ s a -> s{_drgRetainPrimaryCluster = a});
drgReplicationGroupId :: Lens' DeleteReplicationGroup Text
drgReplicationGroupId = lens _drgReplicationGroupId (\ s a -> s{_drgReplicationGroupId = a});
instance AWSRequest DeleteReplicationGroup where
type Rs DeleteReplicationGroup =
DeleteReplicationGroupResponse
request = postQuery elastiCache
response
= receiveXMLWrapper "DeleteReplicationGroupResult"
(\ s h x ->
DeleteReplicationGroupResponse' <$>
(x .@? "ReplicationGroup") <*> (pure (fromEnum s)))
instance ToHeaders DeleteReplicationGroup where
toHeaders = const mempty
instance ToPath DeleteReplicationGroup where
toPath = const "/"
instance ToQuery DeleteReplicationGroup where
toQuery DeleteReplicationGroup'{..}
= mconcat
["Action" =:
("DeleteReplicationGroup" :: ByteString),
"Version" =: ("2015-02-02" :: ByteString),
"FinalSnapshotIdentifier" =:
_drgFinalSnapshotIdentifier,
"RetainPrimaryCluster" =: _drgRetainPrimaryCluster,
"ReplicationGroupId" =: _drgReplicationGroupId]
data DeleteReplicationGroupResponse = DeleteReplicationGroupResponse'
{ _delrsReplicationGroup :: !(Maybe ReplicationGroup)
, _delrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
deleteReplicationGroupResponse
:: Int
-> DeleteReplicationGroupResponse
deleteReplicationGroupResponse pResponseStatus_ =
DeleteReplicationGroupResponse'
{ _delrsReplicationGroup = Nothing
, _delrsResponseStatus = pResponseStatus_
}
delrsReplicationGroup :: Lens' DeleteReplicationGroupResponse (Maybe ReplicationGroup)
delrsReplicationGroup = lens _delrsReplicationGroup (\ s a -> s{_delrsReplicationGroup = a});
delrsResponseStatus :: Lens' DeleteReplicationGroupResponse Int
delrsResponseStatus = lens _delrsResponseStatus (\ s a -> s{_delrsResponseStatus = a});