// gateway.descriptions.ts
import { INodeProperties } from 'n8n-workflow';
import { addDescriptions } from '../../../helpers/deduplicate';
import { getGatewaysDescription } from './operations/getGateways.descriptions';
import { getGatewayDescription } from './operations/getGateway.descriptions';
import { deleteGatewayDescription } from './operations/deleteGateway.descriptions';
import { getDetailDescription } from './operations/getDetail.descriptions';
import { getUplinkBandwidthUsageDescription } from './operations/getUplinkBandwidthUsage.descriptions';
import { getStatsDescription } from './operations/getStats.descriptions';
import { getWanCompressionStatsDescription } from './operations/getWanCompressionStats.descriptions';
import { getDistributionDescription } from './operations/getDistribution.descriptions';
import { getPortsBandwidthUsageDescription } from './operations/getPortsBandwidthUsage.descriptions';
import { getPortsDescription } from './operations/getPorts.descriptions';
import { getErrorsDescription } from './operations/getErrors.descriptions';
import { getTunnelsDescription } from './operations/getTunnels.descriptions';
import { getClientsDescription } from './operations/getClients.descriptions';
import { getPoolsDescription } from './operations/getPools.descriptions';
import { getInfoDescription } from './operations/getInfo.descriptions';

/**
 * Operation selector for the gateway resource
 */
export const gatewayOperationSelector: INodeProperties = {
	displayName: 'Operation',
	name: 'operation',
	type: 'options',
	noDataExpression: true,
	displayOptions: {
		show: {
			resource: ['gateway'],
			domain: ['monitoring'],
		},
	},
	options: [
		{
			name: 'Get Gateways',
			value: 'getGateways',
			description: 'Gateway List',
			action: 'Get Gateways',
		},
		{
			name: 'Get Gateway',
			value: 'getGateway',
			description: 'Gateway Details',
			action: 'Get Gateway',
		},
		{
			name: 'Delete Gateway',
			value: 'deleteGateway',
			description: 'Delete Gateway',
			action: 'Delete Gateway',
		},
		{
			name: 'Get Detail',
			value: 'getDetail',
			description: 'Gateway Uplink Details',
			action: 'Get Detail',
		},
		{
			name: 'Get Uplink Bandwidth Usage',
			value: 'getUplinkBandwidthUsage',
			description: 'Gateway Uplink Bandwidth Usage',
			action: 'Get Uplink Bandwidth Usage',
		},
		{
			name: 'Get Tunnel Stats',
			value: 'getStats',
			description: 'Gateway Uplink tunnel stats',
			action: 'Get Tunnel Stats',
		},
		{
			name: 'Get WAN Compression Stats',
			value: 'getWanCompressionStats',
			description: 'Gateway Uplink WAN compression stats',
			action: 'Get WAN Compression Stats',
		},
		{
			name: 'Get Distribution',
			value: 'getDistribution',
			description: 'Gateway Uplink distribution',
			action: 'Get Distribution',
		},
		{
			name: 'Get Ports Bandwidth Usage',
			value: 'getPortsBandwidthUsage',
			description: 'Gateway Ports Bandwidth Usage',
			action: 'Get Ports Bandwidth Usage',
		},
		{
			name: 'Get Ports',
			value: 'getPorts',
			description: 'Gateway Ports Details',
			action: 'Get Ports',
		},
		{
			name: 'Get Errors',
			value: 'getErrors',
			description: 'Gateway Port Errors',
			action: 'Get Errors',
		},
		{
			name: 'Get Tunnels',
			value: 'getTunnels',
			description: 'Gateway Tunnels Details',
			action: 'Get Tunnels',
		},
		{
			name: 'Get DHCP Clients',
			value: 'getClients',
			description: 'Gateway DHCP Clients information',
			action: 'Get DHCP Clients',
		},
		{
			name: 'Get DHCP Pools',
			value: 'getPools',
			description: 'Gateway DHCP Pools details',
			action: 'Get DHCP Pools',
		},
		{
			name: 'Get VLAN Info',
			value: 'getInfo',
			description: 'Gateway VLAN details',
			action: 'Get VLAN Info',
		},
	],
	default: 'getGateways',
};

// Combined descriptions for all operations in this resource
export const gatewayDescriptions: INodeProperties[] = [gatewayOperationSelector];

// Add each operation's descriptions
addDescriptions(gatewayDescriptions, getGatewaysDescription);
addDescriptions(gatewayDescriptions, getGatewayDescription);
addDescriptions(gatewayDescriptions, deleteGatewayDescription);
addDescriptions(gatewayDescriptions, getDetailDescription);
addDescriptions(gatewayDescriptions, getUplinkBandwidthUsageDescription);
addDescriptions(gatewayDescriptions, getStatsDescription);
addDescriptions(gatewayDescriptions, getWanCompressionStatsDescription);
addDescriptions(gatewayDescriptions, getDistributionDescription);
addDescriptions(gatewayDescriptions, getPortsBandwidthUsageDescription);
addDescriptions(gatewayDescriptions, getPortsDescription);
addDescriptions(gatewayDescriptions, getErrorsDescription);
addDescriptions(gatewayDescriptions, getTunnelsDescription);
addDescriptions(gatewayDescriptions, getClientsDescription);
addDescriptions(gatewayDescriptions, getPoolsDescription);
addDescriptions(gatewayDescriptions, getInfoDescription);
