package schemas

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

func MakeSchemaDataSourceDPDKList() map[string]schema.Attribute {
	return map[string]schema.Attribute{
		// optional attributes
		"by_id": schema.Int64Attribute{
			Optional: true,
		},
		"gid": schema.Int64Attribute{
			Optional: true,
		},
		"name": schema.StringAttribute{
			Optional: true,
		},
		"desc": schema.StringAttribute{
			Optional: true,
		},
		"status": schema.StringAttribute{
			Optional: true,
		},
		"compute_ids": schema.ListAttribute{
			Optional:    true,
			ElementType: types.Int64Type,
		},
		"sort_by": schema.StringAttribute{
			Optional: true,
		},
		"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{
					"dpdk_id": schema.Int64Attribute{
						Required: true,
					},
					"account_access": schema.ListAttribute{
						Computed:    true,
						ElementType: types.Int64Type,
					},
					"created_time": schema.Int64Attribute{
						Computed: true,
					},
					"desc": schema.StringAttribute{
						Computed: true,
					},
					"gid": schema.Int64Attribute{
						Computed: true,
					},
					"guid": schema.Int64Attribute{
						Computed: true,
					},
					"name": schema.StringAttribute{
						Computed: true,
					},
					"rg_access": schema.ListAttribute{
						Computed:    true,
						ElementType: types.Int64Type,
					},
					"status": schema.StringAttribute{
						Computed: true,
					},
					"ovs_bridge": schema.StringAttribute{
						Computed: true,
					},
					"vlan_id": schema.Int64Attribute{
						Computed: true,
					},
					"compute_ids": schema.ListAttribute{
						Computed:    true,
						ElementType: types.Int64Type,
					},
					"updated_time": schema.Int64Attribute{
						Computed: true,
					},
				},
			},
		},
		"entry_count": schema.Int64Attribute{
			Computed: true,
		},
	}
}
