package models

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

type InfoStackModel struct {
	//required and optional fields
	StackID  types.Int64    `tfsdk:"stack_id"`
	Timeouts timeouts.Value `tfsdk:"timeouts"`

	//computed fields
	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           *PackagesModel `tfsdk:"packages"`
	Password           types.String   `tfsdk:"passwd"`
	ReferenceID        types.String   `tfsdk:"reference_id"`
	Status             types.String   `tfsdk:"status"`
	Type               types.String   `tfsdk:"type"`
}

type PackagesModel struct {
	LibvirtBin        *LibvirtBinModel        `tfsdk:"libvirt_bin"`
	LibvirtDaemon     *LibvirtDaemonModel     `tfsdk:"libvirt_daemon"`
	Lvm2Lockd         *Lvm2LockdModel         `tfsdk:"lvm2_lockd"`
	OpenvswitchCommon *OpenvswitchCommonModel `tfsdk:"openvswitch_common"`
	OpenvswitchSwitch *OpenvswitchSwitchModel `tfsdk:"openvswitch_switch"`
	QemuSystemX86     *QemuSystemX86Model     `tfsdk:"qemu_system_x86"`
	Sanlock           *SanlockModel           `tfsdk:"sanlock"`
}

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

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

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

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

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

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

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