package models

import (
	"github.com/hashicorp/terraform-plugin-framework-timeouts/datasource/timeouts"
	"github.com/hashicorp/terraform-plugin-framework/types"
)

type DataSourceNodeList struct {
	// request fields
	ByID     types.Int64    `tfsdk:"by_id"`
	Name     types.String   `tfsdk:"name"`
	Version  types.String   `tfsdk:"version"`
	Release  types.String   `tfsdk:"release"`
	SepID    types.Int64    `tfsdk:"sep_id"`
	Role     types.String   `tfsdk:"role"`
	Status   types.String   `tfsdk:"status"`
	SortBy   types.String   `tfsdk:"sort_by"`
	Page     types.Int64    `tfsdk:"page"`
	Size     types.Int64    `tfsdk:"size"`
	Timeouts timeouts.Value `tfsdk:"timeouts"`
	// response fields
	Id         types.String    `tfsdk:"id"`
	Items      []ItemNodeModel `tfsdk:"items"`
	EntryCount types.Int64     `tfsdk:"entry_count"`
}

type ItemNodeModel struct {
	AdditionalPkgs   types.List         `tfsdk:"additional_pkgs"`
	CpuInfo          *CpuInfoModel      `tfsdk:"cpu_info"`
	Description      types.String       `tfsdk:"description"`
	DPDK             *DPDKModel         `tfsdk:"dpdk"`
	GID              types.Int64        `tfsdk:"gid"`
	GUID             types.String       `tfsdk:"guid"`
	HostKey          types.String       `tfsdk:"hostkey"`
	IPAddr           types.List         `tfsdk:"ipaddr"`
	IsolatedCPUs     types.List         `tfsdk:"isolated_cpus"`
	LastCheck        types.Int64        `tfsdk:"lastcheck"`
	MachineGUID      types.String       `tfsdk:"machine_guid"`
	MainboardSN      types.String       `tfsdk:"mainboard_sn"`
	Memory           types.Int64        `tfsdk:"memory"`
	Milestones       types.Int64        `tfsdk:"milestones"`
	Model            types.String       `tfsdk:"model"`
	Name             types.String       `tfsdk:"name"`
	NeedReboot       types.Bool         `tfsdk:"need_reboot"`
	NetAddr          []NetAddrModel     `tfsdk:"net_addr"`
	NetworkMode      types.String       `tfsdk:"network_mode"`
	NicInfo          []NicInfoModel     `tfsdk:"nic_info"`
	NodeUUID         types.String       `tfsdk:"node_uuid"`
	NodeID           types.Int64        `tfsdk:"node_id"`
	NumaTopology     *NumaTopologyModel `tfsdk:"numa_topology"`
	PeerBackup       types.Int64        `tfsdk:"peer_backup"`
	PeerLog          types.Int64        `tfsdk:"peer_log"`
	PeerStats        types.Int64        `tfsdk:"peer_stats"`
	Pgpus            types.List         `tfsdk:"pgpus"`
	PublicKeys       types.List         `tfsdk:"public_keys"`
	Release          types.String       `tfsdk:"release"`
	ReservedCPUs     types.List         `tfsdk:"reserved_cpus"`
	Roles            types.List         `tfsdk:"roles"`
	SEPs             types.List         `tfsdk:"seps"`
	SerialNum        types.String       `tfsdk:"serial_num"`
	SriovEnabled     types.Bool         `tfsdk:"sriov_enabled"`
	StackId          types.Int64        `tfsdk:"stack_id"`
	Status           types.String       `tfsdk:"status"`
	Tags             types.List         `tfsdk:"tags"`
	Type             types.String       `tfsdk:"type"`
	UEFIFirmwareFile types.String       `tfsdk:"uefi_firmware_file"`
	Version          types.String       `tfsdk:"version"`
}

type NetAddrModel struct {
	CIDR  types.List   `tfsdk:"cidr"`
	Index types.Int64  `tfsdk:"index"`
	IP    types.List   `tfsdk:"ip"`
	MAC   types.String `tfsdk:"mac"`
	MTU   types.Int64  `tfsdk:"mtu"`
	Name  types.String `tfsdk:"name"`
}
