const CoolifyClient = require('../coolifyClient');

/**
 * Enable a resource (see OpenAPI for required params).
 * @param {string} host_url
 * @param {string} token
 * @param {Object} data - Parameters for enabling the resource.
 * @param {string} data.id - The UUID of the resource to enable. (required)
 * @param {string} [data.type] - The type of resource (e.g., 'application', 'database', etc.).
 * @returns {Promise<Object>}
 * @example
 * enable('https://coolify.example.com', 'TOKEN', { id: 'uuid', type: 'application' });
 */
async function enable(host_url, token, data) {
  const client = new CoolifyClient(host_url, token);
  return client.get('/api/v1/enable', { params: data });
}

module.exports = {
  enable,
};
