import { INodeProperties } from 'n8n-workflow';

/**
 * Parameters for getLabels operation
 */
export const getLabelsDescription: INodeProperties[] = [
	{
		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: ['getLabels'],
				resource: ['label'],
				domain: ['monitoring'],
			},
		},
	},
	{
		displayName: 'Limit',
		name: 'limit',
		type: 'number',
		default: 50,
		description: 'Max number of results to return',
		typeOptions: {
			minValue: 1,
		},
		displayOptions: {
			show: {
				operation: ['getLabels'],
				resource: ['label'],
				domain: ['monitoring'],
				returnAll: [false],
			},
		},
	},

	{
		displayName: 'Additional Fields',
		name: 'additionalFields',
		type: 'collection',
		placeholder: 'Add Field',
		default: {},
		displayOptions: {
			show: {
				resource: ['label'],
				domain: ['monitoring'],
				operation: ['getLabels'],
			},
		},
		options: [
			{
				displayName: 'Calculate_total',
				name: 'calculate_total',
				type: 'boolean',
				default: false,
				description: 'Whether to calculate total Default Labels',
			},
			{
				displayName: 'Sort',
				name: 'sort',
				type: 'string',
				default: '',
				description:
					'Sort parameter may be one of +label_name, -label_name. Default is +label_name',
			},
		],
	},
];
