package schemas

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

func MakeSchemaDataSourceRGAffinityGroupsList() map[string]schema.Attribute {
	return map[string]schema.Attribute{
		// required attributes
		"rg_id": schema.Int64Attribute{
			Required:    true,
			Description: "find by rg id",
		},

		// optional attributes
		"page": schema.Int64Attribute{
			Optional:    true,
			Description: "page number",
		},
		"size": schema.Int64Attribute{
			Optional:    true,
			Description: "size number",
		},

		//computed attributes
		"id": schema.StringAttribute{
			Computed: true,
		},
		"affinity_groups": schema.ListNestedAttribute{
			Computed: true,
			NestedObject: schema.NestedAttributeObject{
				Attributes: map[string]schema.Attribute{
					"label": schema.StringAttribute{
						Computed: true,
					},
					"ids": schema.ListNestedAttribute{
						Computed: true,
						NestedObject: schema.NestedAttributeObject{
							Attributes: map[string]schema.Attribute{
								"id": schema.Int64Attribute{
									Computed: true,
								},
								"node_id": schema.Int64Attribute{
									Computed: true,
								},
							},
						},
					},
				},
			},
		},
		"entry_count": schema.Int64Attribute{
			Computed: true,
		},
	}
}
