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 ImageResourceModel struct {
	// request fields
	ImageName              types.String   `tfsdk:"image_name"`
	URL                    types.String   `tfsdk:"url"`
	BootType               types.String   `tfsdk:"boot_type"`
	ImageType              types.String   `tfsdk:"image_type"`
	Drivers                types.List     `tfsdk:"drivers"`
	HotResize              types.Bool     `tfsdk:"hot_resize"`
	NetworkInterfaceNaming types.String   `tfsdk:"network_interface_naming"`
	Username               types.String   `tfsdk:"username"`
	Password               types.String   `tfsdk:"password"`
	AccountID              types.Int64    `tfsdk:"account_id"`
	UsernameDL             types.String   `tfsdk:"username_dl"`
	PasswordDL             types.String   `tfsdk:"password_dl"`
	SepID                  types.Int64    `tfsdk:"sep_id"`
	PoolName               types.String   `tfsdk:"pool_name"`
	Architecture           types.String   `tfsdk:"architecture"`
	Timeouts               timeouts.Value `tfsdk:"timeouts"`
	// responce fields
	Id            types.String `tfsdk:"id"`
	LastUpdated   types.String `tfsdk:"last_updated"`
	UNCPath       types.String `tfsdk:"unc_path"`
	CKey          types.String `tfsdk:"ckey"`
	ACL           types.List   `tfsdk:"acl"`
	Bootable      types.Bool   `tfsdk:"bootable"`
	ComputeCIID   types.Int64  `tfsdk:"compute_ci_id"`
	CdPresentedTo types.String `tfsdk:"cd_presented_to"`
	GID           types.Int64  `tfsdk:"gid"`
	DeletedTime   types.Int64  `tfsdk:"deleted_time"`
	Description   types.String `tfsdk:"desc"`
	Enabled       types.Bool   `tfsdk:"enabled"`
	GUID          types.Int64  `tfsdk:"guid"`
	History       types.List   `tfsdk:"history"`
	LastModified  types.Int64  `tfsdk:"last_modified"`
	LinkTo        types.Int64  `tfsdk:"link_to"`
	Milestones    types.Int64  `tfsdk:"milestones"`
	ImageId       types.Int64  `tfsdk:"image_id"`
	PresentTo     types.Map    `tfsdk:"present_to"`
	ProviderName  types.String `tfsdk:"provider_name"`
	PurgeAttempts types.Int64  `tfsdk:"purge_attempts"`
	ResID         types.String `tfsdk:"res_id"`
	RescueCD      types.Bool   `tfsdk:"rescuecd"`
	SharedWith    types.List   `tfsdk:"shared_with"`
	SnapshotID    types.String `tfsdk:"snapshot_id"`
	Size          types.Int64  `tfsdk:"size"`
	Status        types.String `tfsdk:"status"`
	TechStatus    types.String `tfsdk:"tech_status"`
	Version       types.String `tfsdk:"version"`
}

type HistoryInImageResourceModel struct {
	GUID      types.String `tfsdk:"guid"`
	ID        types.Int64  `tfsdk:"id"`
	Timestamp types.Int64  `tfsdk:"timestamp"`
}

var HistoryInResource = map[string]attr.Type{
	"guid":      types.StringType,
	"id":        types.Int64Type,
	"timestamp": types.Int64Type,
}
