module Network.AWS.ElastiCache.RebootCacheCluster
(
rebootCacheCluster
, RebootCacheCluster
, rccCacheClusterId
, rccCacheNodeIdsToReboot
, rebootCacheClusterResponse
, RebootCacheClusterResponse
, rccrsCacheCluster
, rccrsResponseStatus
) 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 RebootCacheCluster = RebootCacheCluster'
{ _rccCacheClusterId :: !Text
, _rccCacheNodeIdsToReboot :: ![Text]
} deriving (Eq,Read,Show,Data,Typeable,Generic)
rebootCacheCluster
:: Text
-> RebootCacheCluster
rebootCacheCluster pCacheClusterId_ =
RebootCacheCluster'
{ _rccCacheClusterId = pCacheClusterId_
, _rccCacheNodeIdsToReboot = mempty
}
rccCacheClusterId :: Lens' RebootCacheCluster Text
rccCacheClusterId = lens _rccCacheClusterId (\ s a -> s{_rccCacheClusterId = a});
rccCacheNodeIdsToReboot :: Lens' RebootCacheCluster [Text]
rccCacheNodeIdsToReboot = lens _rccCacheNodeIdsToReboot (\ s a -> s{_rccCacheNodeIdsToReboot = a}) . _Coerce;
instance AWSRequest RebootCacheCluster where
type Rs RebootCacheCluster =
RebootCacheClusterResponse
request = postQuery elastiCache
response
= receiveXMLWrapper "RebootCacheClusterResult"
(\ s h x ->
RebootCacheClusterResponse' <$>
(x .@? "CacheCluster") <*> (pure (fromEnum s)))
instance ToHeaders RebootCacheCluster where
toHeaders = const mempty
instance ToPath RebootCacheCluster where
toPath = const "/"
instance ToQuery RebootCacheCluster where
toQuery RebootCacheCluster'{..}
= mconcat
["Action" =: ("RebootCacheCluster" :: ByteString),
"Version" =: ("2015-02-02" :: ByteString),
"CacheClusterId" =: _rccCacheClusterId,
"CacheNodeIdsToReboot" =:
toQueryList "CacheNodeId" _rccCacheNodeIdsToReboot]
data RebootCacheClusterResponse = RebootCacheClusterResponse'
{ _rccrsCacheCluster :: !(Maybe CacheCluster)
, _rccrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
rebootCacheClusterResponse
:: Int
-> RebootCacheClusterResponse
rebootCacheClusterResponse pResponseStatus_ =
RebootCacheClusterResponse'
{ _rccrsCacheCluster = Nothing
, _rccrsResponseStatus = pResponseStatus_
}
rccrsCacheCluster :: Lens' RebootCacheClusterResponse (Maybe CacheCluster)
rccrsCacheCluster = lens _rccrsCacheCluster (\ s a -> s{_rccrsCacheCluster = a});
rccrsResponseStatus :: Lens' RebootCacheClusterResponse Int
rccrsResponseStatus = lens _rccrsResponseStatus (\ s a -> s{_rccrsResponseStatus = a});