package models

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

type K8SListModel struct {
	// request fields
	ByID           types.Int64    `tfsdk:"by_id"`
	Name           types.String   `tfsdk:"name"`
	IPAddress      types.String   `tfsdk:"ip_address"`
	RGID           types.Int64    `tfsdk:"rg_id"`
	LBID           types.Int64    `tfsdk:"lb_id"`
	BasicServiceID types.Int64    `tfsdk:"bservice_id"`
	Status         types.String   `tfsdk:"status"`
	TechStatus     types.String   `tfsdk:"tech_status"`
	IncludeDeleted types.Bool     `tfsdk:"includedeleted"`
	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      []ItemInListK8SModel `tfsdk:"items"`
	EntryCount types.Int64          `tfsdk:"entry_count"`
}

type ItemInListK8SModel struct {
	AccountID      types.Int64                `tfsdk:"account_id"`
	AccountName    types.String               `tfsdk:"account_name"`
	ACL            types.List                 `tfsdk:"acl"`
	BServiceID     types.Int64                `tfsdk:"bservice_id"`
	CIID           types.Int64                `tfsdk:"k8sci_id"`
	CreatedBy      types.String               `tfsdk:"created_by"`
	CreatedTime    types.Int64                `tfsdk:"created_time"`
	DeletedBy      types.String               `tfsdk:"deleted_by"`
	DeletedTime    types.Int64                `tfsdk:"deleted_time"`
	Description    types.String               `tfsdk:"desc"`
	ExtNetID       types.Int64                `tfsdk:"extnet_id"`
	GID            types.Int64                `tfsdk:"gid"`
	GUID           types.Int64                `tfsdk:"guid"`
	K8SID          types.Int64                `tfsdk:"k8s_id"`
	LBID           types.Int64                `tfsdk:"lb_id"`
	Milestones     types.Int64                `tfsdk:"milestones"`
	Name           types.String               `tfsdk:"k8s_name"`
	NetworkPlugin  types.String               `tfsdk:"network_plugin"`
	RGID           types.Int64                `tfsdk:"rg_id"`
	RGName         types.String               `tfsdk:"rg_name"`
	ServiceAccount *ServiceAccountInListModel `tfsdk:"service_account"`
	Status         types.String               `tfsdk:"status"`
	TechStatus     types.String               `tfsdk:"tech_status"`
	UpdatedBy      types.String               `tfsdk:"updated_by"`
	UpdatedTime    types.Int64                `tfsdk:"updated_time"`
	VINSID         types.Int64                `tfsdk:"vins_id"`
	WorkersGroup   []ItemWGInListModel        `tfsdk:"workers_groups"`
}

type ServiceAccountInListModel struct {
	GUID     types.String `tfsdk:"guid"`
	Password types.String `tfsdk:"password"`
	Username types.String `tfsdk:"username"`
}

type ItemWGInListModel struct {
	Annotations     types.List                    `tfsdk:"annotations"`
	CPU             types.Int64                   `tfsdk:"cpu"`
	DetailedInfo    []ItemDetailedInfoInListModel `tfsdk:"detailed_info"`
	Disk            types.Int64                   `tfsdk:"disk"`
	GUID            types.String                  `tfsdk:"guid"`
	WorkerGroupID   types.Int64                   `tfsdk:"worker_group_id"`
	Labels          types.List                    `tfsdk:"labels"`
	WorkerGroupName types.String                  `tfsdk:"worker_group_name"`
	Num             types.Int64                   `tfsdk:"num"`
	RAM             types.Int64                   `tfsdk:"ram"`
	Taints          types.List                    `tfsdk:"taints"`
}

type ItemDetailedInfoInListModel struct {
	Externalip types.String `tfsdk:"externalip"`
	ID         types.Int64  `tfsdk:"id"`
	Name       types.String `tfsdk:"name"`
	Status     types.String `tfsdk:"status"`
	TechStatus types.String `tfsdk:"tech_status"`
}
