// firmware/device/operations/getDevices.descriptions.ts - FIXED VERSION
import { INodeProperties } from 'n8n-workflow';

/**
 * Parameters for the getDevices operation
 */
export const getDevicesDescription: INodeProperties[] = [
	{
		displayName: 'Device Type',
		name: 'deviceType',
		type: 'options',
		required: true,
		default: 'HP',
		description: 'Type of device to retrieve',
		options: [
			{
				name: 'Access Points (IAP)',
				value: 'IAP',
			},
			{
				name: 'MAS Switches',
				value: 'MAS',
			},
			{
				name: 'Aruba Switches',
				value: 'HP',
			},
			{
				name: 'CX Switches',
				value: 'CX',
			},
			{
				name: 'Controllers',
				value: 'CONTROLLER',
			},
		],
		displayOptions: {
			show: {
				operation: ['getDevices'],
				resource: ['device'],
				domain: ['firmware'],
			},
		},
	},
	{
		displayName: 'Return All',
		name: 'returnAll',
		type: 'boolean',
		default: false,
		description: 'Whether to return all results or only up to a given limit',
		displayOptions: {
			show: {
				operation: ['getDevices'],
				resource: ['device'],
				domain: ['firmware'],
			},
		},
	},
	{
		displayName: 'Limit',
		name: 'limit',
		type: 'number',
		default: 20,
		description: 'Max number of results to return',
		typeOptions: {
			minValue: 1,
			maxValue: 1000,
		},
		displayOptions: {
			show: {
				operation: ['getDevices'],
				resource: ['device'],
				domain: ['firmware'],
				returnAll: [false],
			},
		},
	},
	{
		displayName: 'Additional Fields',
		name: 'additionalFields',
		type: 'collection',
		placeholder: 'Add Field',
		default: {},
		displayOptions: {
			show: {
				operation: ['getDevices'],
				resource: ['device'],
				domain: ['firmware'],
			},
		},
		options: [
			{
				displayName: 'Group Name',
				name: 'group',
				type: 'string',
				default: '',
				description: 'Filter devices by group name',
			},
		],
	},
];
