package schemas

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

func MakeSchemaDataSourceComputePciDeviceList() map[string]schema.Attribute {
	return map[string]schema.Attribute{
		// required attributes
		"compute_id": schema.Int64Attribute{
			Required: true,
		},
		// optional attributes
		"rg_id": schema.Int64Attribute{
			Optional: true,
		},
		"device_id": schema.Int64Attribute{
			Optional: true,
		},
		"name": schema.StringAttribute{
			Optional: true,
		},
		"status": schema.StringAttribute{
			Optional: true,
		},
		"sort_by": schema.StringAttribute{
			Optional:    true,
			Description: "sort by one of supported fields, format +|-(field)",
		},
		"page": schema.Int64Attribute{
			Optional: true,
		},
		"size": schema.Int64Attribute{
			Optional: true,
		},
		// computed attributes
		"id": schema.StringAttribute{
			Computed: true,
		},
		"items": schema.ListNestedAttribute{
			Computed: true,
			NestedObject: schema.NestedAttributeObject{
				Attributes: map[string]schema.Attribute{
					"compute_id": schema.Int64Attribute{
						Computed: true,
					},
					"description": schema.StringAttribute{
						Computed: true,
					},
					"guid": schema.Int64Attribute{
						Computed: true,
					},
					"hwpath": schema.StringAttribute{
						Computed: true,
					},
					"device_id": schema.Int64Attribute{
						Computed: true,
					},
					"name": schema.StringAttribute{
						Computed: true,
					},
					"rg_id": schema.Int64Attribute{
						Computed: true,
					},
					"stack_id": schema.Int64Attribute{
						Computed: true,
					},
					"status": schema.StringAttribute{
						Computed: true,
					},
					"system_name": schema.StringAttribute{
						Computed: true,
					},
				},
			},
		},
		"entry_count": schema.Int64Attribute{
			Computed: true,
		},
	}
}
