import { IExecuteFunctions } from 'n8n-workflow';
import { logger } from '../../../helpers/logger';
import { getInsightsNetwork } from './operations/getInsightsNetwork.methods';
import { getInsightsSite } from './operations/getInsightsSite.methods';
import { getInsightsAp } from './operations/getInsightsAp.methods';
import { getInsightsClient } from './operations/getInsightsClient.methods';
import { getInsightsGateway } from './operations/getInsightsGateway.methods';
import { getInsightsSwitch } from './operations/getInsightsSwitch.methods';

/**
 * All operations available for the insights resource
 */
export const insightsOperations = {
	getInsightsNetwork,
	getInsightsSite,
	getInsightsAp,
	getInsightsClient,
	getInsightsGateway,
	getInsightsSwitch,
};

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