package schemas

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

func MakeSchemaDataSourceAccountDisksList() map[string]schema.Attribute {
	return map[string]schema.Attribute{
		// required attributes
		"account_id": schema.Int64Attribute{
			Required:    true,
			Description: "account id",
		},

		// optional attributes
		"disk_id": schema.Int64Attribute{
			Optional:    true,
			Description: "find by disk id",
		},
		"name": schema.StringAttribute{
			Optional:    true,
			Description: "find by name",
		},
		"disk_max_size": schema.Int64Attribute{
			Optional:    true,
			Description: "find by max size disk",
		},
		"type": schema.StringAttribute{
			Optional:    true,
			Description: "find by type of the disks",
		},
		"page": schema.Int64Attribute{
			Optional:    true,
			Description: "page number",
		},
		"size": schema.Int64Attribute{
			Optional:    true,
			Description: "page size",
		},
		"sort_by": schema.StringAttribute{
			Optional:    true,
			Description: "sort by one of supported fields, format +|-(field)",
		},

		// computed attributes
		"id": schema.StringAttribute{
			Computed: true,
		},
		"items": schema.ListNestedAttribute{
			Computed: true,
			NestedObject: schema.NestedAttributeObject{
				Attributes: map[string]schema.Attribute{
					"disk_id": schema.Int64Attribute{
						Computed: true,
					},
					"disk_name": schema.StringAttribute{
						Computed: true,
					},
					"pool": schema.StringAttribute{
						Computed: true,
					},
					"sep_id": schema.Int64Attribute{
						Computed: true,
					},
					"shareable": schema.BoolAttribute{
						Computed: true,
					},
					"size_max": schema.Int64Attribute{
						Computed: true,
					},
					"type": schema.StringAttribute{
						Computed: true,
					},
				},
			},
		},
		"entry_count": schema.Int64Attribute{
			Computed: true,
		},
	}
}
