package models

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

type DataSourceRGGetResourceConsumptionModel struct {
	// request fields
	RGID     types.Int64    `tfsdk:"rg_id"`
	Timeouts timeouts.Value `tfsdk:"timeouts"`

	// response fields
	Id             types.String `tfsdk:"id"`
	Consumed       types.Object `tfsdk:"consumed"`
	Reserved       types.Object `tfsdk:"reserved"`
	ResourceLimits types.Object `tfsdk:"resource_limits"`
}

type ResourceModel struct {
	CPU         types.Int64   `tfsdk:"cpu"`
	DiskSize    types.Float64 `tfsdk:"disk_size"`
	DiskSizeMax types.Float64 `tfsdk:"disk_size_max"`
	ExtIPs      types.Int64   `tfsdk:"extips"`
	ExtTraffic  types.Int64   `tfsdk:"exttraffic"`
	GPU         types.Int64   `tfsdk:"gpu"`
	RAM         types.Int64   `tfsdk:"ram"`
	SEPs        types.List    `tfsdk:"seps"`
}

type SEPsModel struct {
	SepID       types.String  `tfsdk:"sep_id"`
	DataName    types.String  `tfsdk:"data_name"`
	DiskSize    types.Float64 `tfsdk:"disk_size"`
	DiskSizeMax types.Float64 `tfsdk:"disk_size_max"`
}

var ItemSEPs = map[string]attr.Type{
	"sep_id":        types.StringType,
	"data_name":     types.StringType,
	"disk_size":     types.Float64Type,
	"disk_size_max": types.Float64Type,
}

var ItemResource = map[string]attr.Type{
	"cpu":           types.Int64Type,
	"disk_size":     types.Float64Type,
	"disk_size_max": types.Float64Type,
	"extips":        types.Int64Type,
	"exttraffic":    types.Int64Type,
	"gpu":           types.Int64Type,
	"ram":           types.Int64Type,
	"seps":          types.ListType{ElemType: types.ObjectType{AttrTypes: ItemSEPs}},
}
