{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Network.AWS.ElastiCache.DeleteCacheCluster
(
deleteCacheCluster
, DeleteCacheCluster
, dccFinalSnapshotIdentifier
, dccCacheClusterId
, deleteCacheClusterResponse
, DeleteCacheClusterResponse
, dccrsCacheCluster
, dccrsResponseStatus
) where
import Network.AWS.ElastiCache.Types
import Network.AWS.ElastiCache.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data DeleteCacheCluster = DeleteCacheCluster'
{ _dccFinalSnapshotIdentifier :: !(Maybe Text)
, _dccCacheClusterId :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
deleteCacheCluster
:: Text
-> DeleteCacheCluster
deleteCacheCluster pCacheClusterId_ =
DeleteCacheCluster'
{ _dccFinalSnapshotIdentifier = Nothing
, _dccCacheClusterId = pCacheClusterId_
}
dccFinalSnapshotIdentifier :: Lens' DeleteCacheCluster (Maybe Text)
dccFinalSnapshotIdentifier = lens _dccFinalSnapshotIdentifier (\ s a -> s{_dccFinalSnapshotIdentifier = a});
dccCacheClusterId :: Lens' DeleteCacheCluster Text
dccCacheClusterId = lens _dccCacheClusterId (\ s a -> s{_dccCacheClusterId = a});
instance AWSRequest DeleteCacheCluster where
type Rs DeleteCacheCluster =
DeleteCacheClusterResponse
request = postQuery elastiCache
response
= receiveXMLWrapper "DeleteCacheClusterResult"
(\ s h x ->
DeleteCacheClusterResponse' <$>
(x .@? "CacheCluster") <*> (pure (fromEnum s)))
instance Hashable DeleteCacheCluster
instance NFData DeleteCacheCluster
instance ToHeaders DeleteCacheCluster where
toHeaders = const mempty
instance ToPath DeleteCacheCluster where
toPath = const "/"
instance ToQuery DeleteCacheCluster where
toQuery DeleteCacheCluster'{..}
= mconcat
["Action" =: ("DeleteCacheCluster" :: ByteString),
"Version" =: ("2015-02-02" :: ByteString),
"FinalSnapshotIdentifier" =:
_dccFinalSnapshotIdentifier,
"CacheClusterId" =: _dccCacheClusterId]
data DeleteCacheClusterResponse = DeleteCacheClusterResponse'
{ _dccrsCacheCluster :: !(Maybe CacheCluster)
, _dccrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
deleteCacheClusterResponse
:: Int
-> DeleteCacheClusterResponse
deleteCacheClusterResponse pResponseStatus_ =
DeleteCacheClusterResponse'
{ _dccrsCacheCluster = Nothing
, _dccrsResponseStatus = pResponseStatus_
}
dccrsCacheCluster :: Lens' DeleteCacheClusterResponse (Maybe CacheCluster)
dccrsCacheCluster = lens _dccrsCacheCluster (\ s a -> s{_dccrsCacheCluster = a});
dccrsResponseStatus :: Lens' DeleteCacheClusterResponse Int
dccrsResponseStatus = lens _dccrsResponseStatus (\ s a -> s{_dccrsResponseStatus = a});
instance NFData DeleteCacheClusterResponse