package schemas

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

func MakeSchemaDataSourceImage() map[string]schema.Attribute {
	return map[string]schema.Attribute{
		// required attributes
		"image_id": schema.Int64Attribute{
			Required: true,
		},
		// optional attributes
		"show_all": schema.BoolAttribute{
			Optional: true,
		},
		// computed attributes
		"id": schema.StringAttribute{
			Computed: true,
		},
		"unc_path": schema.StringAttribute{
			Computed: true,
		},
		"ckey": schema.StringAttribute{
			Computed: true,
		},
		"account_id": schema.Int64Attribute{
			Computed: true,
		},
		"acl": schema.ListAttribute{
			Computed:    true,
			ElementType: types.StringType,
		},
		"architecture": schema.StringAttribute{
			Computed: true,
		},
		"boot_type": schema.StringAttribute{
			Computed: true,
		},
		"bootable": schema.BoolAttribute{
			Computed: true,
		},
		"compute_ci_id": schema.Int64Attribute{
			Computed: true,
		},
		"cd_presented_to": schema.StringAttribute{
			Computed: true,
		},
		"gid": schema.Int64Attribute{
			Computed: true,
		},
		"deleted_time": schema.Int64Attribute{
			Computed: true,
		},
		"desc": schema.StringAttribute{
			Computed: true,
		},
		"drivers": schema.ListAttribute{
			Computed:    true,
			ElementType: types.StringType,
		},
		"enabled": schema.BoolAttribute{
			Computed: true,
		},
		"guid": schema.Int64Attribute{
			Computed: true,
		},
		"history": schema.ListNestedAttribute{
			Computed: true,
			NestedObject: schema.NestedAttributeObject{
				Attributes: map[string]schema.Attribute{
					"guid": schema.StringAttribute{
						Computed: true,
					},
					"id": schema.Int64Attribute{
						Computed: true,
					},
					"timestamp": schema.Int64Attribute{
						Computed: true,
					},
				},
			},
		},
		"hot_resize": schema.BoolAttribute{
			Computed: true,
		},
		"last_modified": schema.Int64Attribute{
			Computed: true,
		},
		"link_to": schema.Int64Attribute{
			Computed: true,
		},
		"milestones": schema.Int64Attribute{
			Computed: true,
		},
		"image_name": schema.StringAttribute{
			Computed: true,
		},
		"image_type": schema.StringAttribute{
			Computed: true,
		},
		"password": schema.StringAttribute{
			Computed: true,
		},
		"network_interface_naming": schema.StringAttribute{
			Computed: true,
		},
		"pool_name": schema.StringAttribute{
			Computed: true,
		},
		"provider_name": schema.StringAttribute{
			Computed: true,
		},
		"purge_attempts": schema.Int64Attribute{
			Computed: true,
		},
		"present_to": schema.MapAttribute{
			Computed:    true,
			ElementType: types.Int64Type,
		},
		"res_id": schema.StringAttribute{
			Computed: true,
		},
		"rescuecd": schema.BoolAttribute{
			Computed: true,
		},
		"sep_id": schema.Int64Attribute{
			Computed: true,
		},
		"snapshot_id": schema.StringAttribute{
			Computed: true,
		},
		"shared_with": schema.ListAttribute{
			Computed:    true,
			ElementType: types.Int64Type,
		},
		"size": schema.Int64Attribute{
			Computed: true,
		},
		"status": schema.StringAttribute{
			Computed: true,
		},
		"tech_status": schema.StringAttribute{
			Computed: true,
		},
		"username": schema.StringAttribute{
			Computed: true,
		},
		"version": schema.StringAttribute{
			Computed: true,
		},
	}
}
