package schemas

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

func MakeSchemaDataSourceRGListVins() map[string]schema.Attribute {
	return map[string]schema.Attribute{
		// required attributes
		"rg_id": schema.Int64Attribute{
			Required:    true,
			Description: "ID of the RG",
		},

		// optional attributes
		"name": schema.StringAttribute{
			Optional:    true,
			Description: "find by name",
		},
		"account_id": schema.Int64Attribute{
			Optional:    true,
			Description: "find by account id",
		},
		"ext_ip": schema.StringAttribute{
			Optional:    true,
			Description: "find by external ip address",
		},
		"vins_id": schema.Int64Attribute{
			Optional:    true,
			Description: "find by vins id",
		},
		"sort_by": schema.StringAttribute{
			Optional:    true,
			Description: "sort by one of supported fields, format +|-(field)",
		},
		"page": schema.Int64Attribute{
			Optional:    true,
			Description: "page number",
		},
		"size": schema.Int64Attribute{
			Optional:    true,
			Description: "size number",
		},

		// computed attributes
		"id": schema.StringAttribute{
			Optional: true,
		},
		"items": schema.ListNestedAttribute{
			Computed: true,
			NestedObject: schema.NestedAttributeObject{
				Attributes: map[string]schema.Attribute{
					"account_id": schema.Int64Attribute{
						Computed: true,
					},
					"account_name": schema.StringAttribute{
						Computed: true,
					},
					"computes": schema.Int64Attribute{
						Computed: true,
					},
					"created_by": schema.StringAttribute{
						Computed: true,
					},
					"created_time": schema.Int64Attribute{
						Computed: true,
					},
					"deleted_by": schema.StringAttribute{
						Computed: true,
					},
					"deleted_time": schema.Int64Attribute{
						Computed: true,
					},
					"external_ip": schema.StringAttribute{
						Computed: true,
					},
					"extnet_id": schema.Int64Attribute{
						Computed: true,
					},
					"free_ips": schema.Int64Attribute{
						Computed: true,
					},
					"id": schema.Int64Attribute{
						Computed: true,
					},
					"name": schema.StringAttribute{
						Computed: true,
					},
					"network": schema.StringAttribute{
						Computed: true,
					},
					"pri_vnf_dev_id": schema.Int64Attribute{
						Computed: true,
					},
					"rg_id": schema.Int64Attribute{
						Computed: true,
					},
					"rg_name": schema.StringAttribute{
						Computed: true,
					},
					"status": schema.StringAttribute{
						Computed: true,
					},
					"updated_by": schema.StringAttribute{
						Computed: true,
					},
					"updated_time": schema.Int64Attribute{
						Computed: true,
					},
				},
			},
		},
		"entry_count": schema.Int64Attribute{
			Computed: true,
		},
	}
}
