import { IExecuteFunctions } from 'n8n-workflow';
import { logger } from '../../../helpers/logger';
import { getLabels } from './operations/getLabels.methods';
import { postLabel } from './operations/postLabel.methods';
import { getLabel } from './operations/getLabel.methods';
import { patchLabel } from './operations/patchLabel.methods';
import { deleteLabel } from './operations/deleteLabel.methods';
import { postDevices } from './operations/postDevices.methods';
import { deleteDevices } from './operations/deleteDevices.methods';
import { getCategories } from './operations/getCategories.methods';

/**
 * All operations available for the label resource
 */
export const labelOperations = {
	getLabels,
	postLabel,
	getLabel,
	patchLabel,
	deleteLabel,
	postDevices,
	deleteDevices,
	getCategories,
};

/**
 * Check if a label operation exists
 *
 * @param operation Operation name to check
 * @returns boolean indicating if the operation exists
 */
export function hasLabelOperation(operation: string): boolean {
	const exists = !!labelOperations[operation as keyof typeof labelOperations];
	logger.debug(
		'monitoring:label:check',
		`Operation "${operation}" ${exists ? 'exists' : 'does not exist'}`,
	);
	return exists;
}
