package schemas

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

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

		//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,
					},
					"other_node": schema.ListAttribute{
						Computed:    true,
						ElementType: types.Int64Type,
					},
					"other_node_indirect": schema.ListAttribute{
						Computed:    true,
						ElementType: types.Int64Type,
					},
					"other_node_indirect_soft": schema.ListAttribute{
						Computed:    true,
						ElementType: types.Int64Type,
					},
					"other_node_soft": schema.ListAttribute{
						Computed:    true,
						ElementType: types.Int64Type,
					},
					"same_node": schema.ListAttribute{
						Computed:    true,
						ElementType: types.Int64Type,
					},
					"same_node_soft": schema.ListAttribute{
						Computed:    true,
						ElementType: types.Int64Type,
					},
				},
			},
		},
	}
}
