package schemas

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

func MakeSchemaDataSourceExtNetList() map[string]schema.Attribute {
	return map[string]schema.Attribute{
		// optional attributes
		"account_id": schema.Int64Attribute{
			Optional:    true,
			Description: "find by account id",
		},
		"by_id": schema.Int64Attribute{
			Optional:    true,
			Description: "find by id",
		},
		"name": schema.StringAttribute{
			Optional:    true,
			Description: "find by name",
		},
		"network": schema.StringAttribute{
			Optional:    true,
			Description: "find by network ip address",
		},
		"vlan_id": schema.Int64Attribute{
			Optional:    true,
			Description: "find by vlan id",
		},
		"vnfdev_id": schema.Int64Attribute{
			Optional:    true,
			Description: "find by vnfdevices id",
		},
		"ovs_bridge": schema.StringAttribute{
			Optional:    true,
			Description: "find by ovs_bridge",
		},
		"status": schema.StringAttribute{
			Optional:    true,
			Description: "find by status",
		},
		"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{
					"net_id": schema.Int64Attribute{
						Computed: true,
					},
					"ipcidr": schema.StringAttribute{
						Computed: true,
					},
					"name": schema.StringAttribute{
						Computed: true,
					},
					"status": schema.StringAttribute{
						Computed: true,
					},
				},
			},
		},
		"entry_count": schema.Int64Attribute{
			Computed: true,
		},
	}
}
