import { INodeProperties } from 'n8n-workflow';

/**
 * Parameters for getTopNSwitches operation
 */
export const getTopNSwitchesDescription: INodeProperties[] = [
	{
		displayName: 'Filter Type',
		name: 'filterType',
		type: 'options',
		options: [
			{ name: 'Group', value: 'group' },
			{ name: 'Label', value: 'label' },
			{ name: 'Stack ID', value: 'stack_id' },
			{ name: 'None', value: 'none' },
		],
		default: 'none',
		description: 'Choose how to filter the switches',
		displayOptions: {
			show: {
				operation: ['getTopNSwitches'],
				resource: ['switch'],
				domain: ['monitoring'],
			},
		},
	},
	{
		displayName: 'Group',
		name: 'group',
		type: 'string',
		default: '',
		description: 'Group name to filter by',
		displayOptions: {
			show: {
				operation: ['getTopNSwitches'],
				resource: ['switch'],
				domain: ['monitoring'],
				filterType: ['group'],
			},
		},
	},
	{
		displayName: 'Label',
		name: 'label',
		type: 'string',
		default: '',
		description: 'Label name to filter by',
		displayOptions: {
			show: {
				operation: ['getTopNSwitches'],
				resource: ['switch'],
				domain: ['monitoring'],
				filterType: ['label'],
			},
		},
	},
	{
		displayName: 'Stack ID',
		name: 'stack_id',
		type: 'string',
		default: '',
		description: 'Switch stack ID to filter by',
		displayOptions: {
			show: {
				operation: ['getTopNSwitches'],
				resource: ['switch'],
				domain: ['monitoring'],
				filterType: ['stack_id'],
			},
		},
	},
	{
		displayName: 'Count',
		name: 'count',
		type: 'number',
		default: 5,
		description: 'Number of top switches to return (max 100)',
		typeOptions: {
			minValue: 1,
			maxValue: 100,
		},
		displayOptions: {
			show: {
				operation: ['getTopNSwitches'],
				resource: ['switch'],
				domain: ['monitoring'],
			},
		},
	},
	{
		displayName: 'From',
		name: 'from_timestamp',
		type: 'dateTime',
		default: '',
		description: 'Start time for data retrieval (defaults to current time minus 3 hours)',
		displayOptions: {
			show: {
				operation: ['getTopNSwitches'],
				resource: ['switch'],
				domain: ['monitoring'],
			},
		},
	},
	{
		displayName: 'To',
		name: 'to_timestamp',
		type: 'dateTime',
		default: '',
		description: 'End time for data retrieval (defaults to current time)',
		displayOptions: {
			show: {
				operation: ['getTopNSwitches'],
				resource: ['switch'],
				domain: ['monitoring'],
			},
		},
	},
];
