package models

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

type ResourceK8SWGModel struct {
	// request fields
	K8SID         types.Int64    `tfsdk:"k8s_id"`
	Name          types.String   `tfsdk:"name"`
	Num           types.Int64    `tfsdk:"num"`
	CPU           types.Int64    `tfsdk:"cpu"`
	RAM           types.Int64    `tfsdk:"ram"`
	Chipset       types.String   `tfsdk:"chipset"`
	Disk          types.Int64    `tfsdk:"disk"`
	Annotations   types.List     `tfsdk:"annotations"`
	Labels        types.List     `tfsdk:"labels"`
	Taints        types.List     `tfsdk:"taints"`
	WorkerSEPID   types.Int64    `tfsdk:"worker_sep_id"`
	WorkerSEPPool types.String   `tfsdk:"worker_sep_pool"`
	CloudInit     types.String   `tfsdk:"cloud_init"`
	Timeouts      timeouts.Value `tfsdk:"timeouts"`
	// response fields
	Id            types.String `tfsdk:"id"`
	LastUpdated   types.String `tfsdk:"last_updated"`
	WorkerGroupId types.Int64  `tfsdk:"wg_id"`
	DetailedInfo  types.List   `tfsdk:"detailed_info"`
	GUID          types.String `tfsdk:"guid"`
}

type ItemDetailedInfoInK8sWGModel struct {
	ComputeId          types.Int64  `tfsdk:"compute_id"`
	Name               types.String `tfsdk:"name"`
	Status             types.String `tfsdk:"status"`
	TechStatus         types.String `tfsdk:"tech_status"`
	Interfaces         types.List   `tfsdk:"interfaces"`
	NatableVinsIp      types.String `tfsdk:"natable_vins_ip"`
	NatableVinsNetwork types.String `tfsdk:"natable_vins_network"`
}

type ItemInterfacesInK8sWGModel struct {
	DefGw     types.String `tfsdk:"def_gw"`
	IpAddress types.String `tfsdk:"ip_address"`
}

var ItemInterfacesInK8sWG map[string]attr.Type = map[string]attr.Type{
	"def_gw":     types.StringType,
	"ip_address": types.StringType,
}

var ItemDetailedInfoInK8sWG map[string]attr.Type = map[string]attr.Type{
	"compute_id":           types.Int64Type,
	"name":                 types.StringType,
	"status":               types.StringType,
	"tech_status":          types.StringType,
	"interfaces":           types.ListType{ElemType: types.ObjectType{AttrTypes: ItemInterfaces}},
	"natable_vins_ip":      types.StringType,
	"natable_vins_network": types.StringType,
}
