package models

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

type DataSourceAccountListModel struct {
	// optional fields
	ByID     types.Int64    `tfsdk:"by_id"`
	Name     types.String   `tfsdk:"name"`
	ACL      types.String   `tfsdk:"acl"`
	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
	Id         types.String              `tfsdk:"id"`
	Items      []AccountListElementModel `tfsdk:"items"`
	EntryCount types.Int64               `tfsdk:"entry_count"`
}

type AccountListElementModel struct {
	DCLocation             types.String                    `tfsdk:"dc_location"`
	CKey                   types.String                    `tfsdk:"ckey"`
	ACL                    []AccountListACLModel           `tfsdk:"acl"`
	Company                types.String                    `tfsdk:"company"`
	CompanyURL             types.String                    `tfsdk:"companyurl"`
	ComputeFeatures        types.List                      `tfsdk:"compute_features"`
	CPUAllocationParameter types.String                    `tfsdk:"cpu_allocation_parameter"`
	CPUAllocationRatio     types.Float64                   `tfsdk:"cpu_allocation_ratio"`
	CreatedBy              types.String                    `tfsdk:"created_by"`
	CreatedTime            types.Int64                     `tfsdk:"created_time"`
	DeactivationTime       types.Float64                   `tfsdk:"deactivation_time"`
	DeletedBy              types.String                    `tfsdk:"deleted_by"`
	DeletedTime            types.Int64                     `tfsdk:"deleted_time"`
	DisplayName            types.String                    `tfsdk:"displayname"`
	GUID                   types.Int64                     `tfsdk:"guid"`
	ID                     types.Int64                     `tfsdk:"id"`
	Name                   types.String                    `tfsdk:"name"`
	ResourceLimits         *AccountListResourceLimitsModel `tfsdk:"resource_limits"`
	ResTypes               types.List                      `tfsdk:"resource_types"`
	SendAccessEmails       types.Bool                      `tfsdk:"send_access_emails"`
	Status                 types.String                    `tfsdk:"status"`
	UniqPools              types.List                      `tfsdk:"uniq_pools"`
	UpdatedTime            types.Int64                     `tfsdk:"updated_time"`
	Version                types.Int64                     `tfsdk:"version"`
	VINS                   types.List                      `tfsdk:"vins"`
}

type AccountListACLModel struct {
	Explicit    types.Bool   `tfsdk:"explicit"`
	GUID        types.String `tfsdk:"guid"`
	Right       types.String `tfsdk:"right"`
	Status      types.String `tfsdk:"status"`
	Type        types.String `tfsdk:"type"`
	UserGroupID types.String `tfsdk:"user_group_id"`
}

type AccountListResourceLimitsModel struct {
	CuC      types.Float64 `tfsdk:"cu_c"`
	CuD      types.Float64 `tfsdk:"cu_d"`
	CuDM     types.Float64 `tfsdk:"cu_dm"`
	CuI      types.Float64 `tfsdk:"cu_i"`
	CuM      types.Float64 `tfsdk:"cu_m"`
	CuNP     types.Float64 `tfsdk:"cu_np"`
	GPUUnits types.Float64 `tfsdk:"gpu_units"`
}
