package models

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

type DataSourceStackListModel struct {
	// optional fields
	ByID     types.Int64    `tfsdk:"by_id"`
	Name     types.String   `tfsdk:"name"`
	Type     types.String   `tfsdk:"type"`
	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
	Items      []InfoStackListModel `tfsdk:"items"`
	EntryCount types.Int64          `tfsdk:"entry_count"`
}

type InfoStackListModel struct {
	StackID            types.Int64             `tfsdk:"stack_id"`
	Ckey               types.String            `tfsdk:"ckey"`
	Meta               types.List              `tfsdk:"meta"`
	APIURL             types.String            `tfsdk:"api_url"`
	Apikey             types.String            `tfsdk:"api_key"`
	AppID              types.String            `tfsdk:"app_id"`
	CPUAllocationRatio types.Float64           `tfsdk:"cpu_allocation_ratio"`
	Description        types.String            `tfsdk:"description"`
	Descr              types.String            `tfsdk:"descr"`
	Drivers            types.List              `tfsdk:"drivers"`
	Eco                types.String            `tfsdk:"eco"`
	Error              types.Int64             `tfsdk:"error"`
	GID                types.Int64             `tfsdk:"gid"`
	GUID               types.Int64             `tfsdk:"guid"`
	Images             types.List              `tfsdk:"images"`
	Login              types.String            `tfsdk:"login"`
	MemAllocationRatio types.Float64           `tfsdk:"mem_allocation_ratio"`
	Name               types.String            `tfsdk:"name"`
	Packages           *PackagesStackListModel `tfsdk:"packages"`
	Password           types.String            `tfsdk:"passwd"`
	ReferenceID        types.String            `tfsdk:"reference_id"`
	Status             types.String            `tfsdk:"status"`
	Type               types.String            `tfsdk:"type"`
}

type PackagesStackListModel struct {
	LibvirtBin        *LibvirtBinStackListModel        `tfsdk:"libvirt_bin"`
	LibvirtDaemon     *LibvirtDaemonStackListModel     `tfsdk:"libvirt_daemon"`
	Lvm2Lockd         *Lvm2LockdStackListModel         `tfsdk:"lvm2_lockd"`
	OpenvswitchCommon *OpenvswitchCommonStackListModel `tfsdk:"openvswitch_common"`
	OpenvswitchSwitch *OpenvswitchSwitchStackListModel `tfsdk:"openvswitch_switch"`
	QemuSystemX86     *QemuSystemX86StackListModel     `tfsdk:"qemu_system_x86"`
	Sanlock           *SanlockStackListModel           `tfsdk:"sanlock"`
}

type LibvirtBinStackListModel struct {
	InstalledSize types.String `tfsdk:"installed_size"`
	Ver           types.String `tfsdk:"ver"`
}

type LibvirtDaemonStackListModel struct {
	InstalledSize types.String `tfsdk:"installed_size"`
	Ver           types.String `tfsdk:"ver"`
}

type Lvm2LockdStackListModel struct {
	InstalledSize types.String `tfsdk:"installed_size"`
	Ver           types.String `tfsdk:"ver"`
}

type OpenvswitchCommonStackListModel struct {
	InstalledSize types.String `tfsdk:"installed_size"`
	Ver           types.String `tfsdk:"ver"`
}

type OpenvswitchSwitchStackListModel struct {
	InstalledSize types.String `tfsdk:"installed_size"`
	Ver           types.String `tfsdk:"ver"`
}

type QemuSystemX86StackListModel struct {
	InstalledSize types.String `tfsdk:"installed_size"`
	Ver           types.String `tfsdk:"ver"`
}

type SanlockStackListModel struct {
	InstalledSize types.String `tfsdk:"installed_size"`
	Ver           types.String `tfsdk:"ver"`
}
