import { logger } from '../../../helpers/logger';
import { postSwitch } from './operations/postSwitch.methods';

/**
 * All operations available for the actioncommand resource
 */
export const actioncommandOperations = {
	postSwitch,
};

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