package schemas

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

func MakeSchemaDataSourceK8SWgList() map[string]schema.Attribute {
	return map[string]schema.Attribute{
		// required attributes
		"k8s_id": schema.Int64Attribute{
			Required: true,
		},
		// computed attributes
		"id": schema.StringAttribute{
			Computed: true,
		},
		"items": schema.ListNestedAttribute{
			Computed: true,
			NestedObject: schema.NestedAttributeObject{
				Attributes: map[string]schema.Attribute{
					"annotations": schema.ListAttribute{
						Computed:    true,
						ElementType: types.StringType,
					},
					"cpu": schema.Int64Attribute{
						Computed: true,
					},
					"detailed_info": schema.ListNestedAttribute{
						Computed: true,
						NestedObject: schema.NestedAttributeObject{
							Attributes: map[string]schema.Attribute{
								"compute_id": schema.Int64Attribute{
									Computed: true,
								},
								"name": schema.StringAttribute{
									Computed: true,
								},
								"status": schema.StringAttribute{
									Computed: true,
								},
								"tech_status": schema.StringAttribute{
									Computed: true,
								},
								"interfaces": schema.ListNestedAttribute{
									Computed: true,
									NestedObject: schema.NestedAttributeObject{
										Attributes: map[string]schema.Attribute{
											"def_gw": schema.StringAttribute{
												Computed: true,
											},
											"ip_address": schema.StringAttribute{
												Computed: true,
											},
										},
									},
								},
								"natable_vins_ip": schema.StringAttribute{
									Computed: true,
								},
								"natable_vins_network": schema.StringAttribute{
									Computed: true,
								},
							},
						},
					},
					"disk": schema.Int64Attribute{
						Computed: true,
					},
					"guid": schema.StringAttribute{
						Computed: true,
					},
					"labels": schema.ListAttribute{
						Computed:    true,
						ElementType: types.StringType,
					},
					"worker_group_id": schema.Int64Attribute{
						Computed: true,
					},
					"worker_group_name": schema.StringAttribute{
						Computed: true,
					},
					"num": schema.Int64Attribute{
						Computed: true,
					},
					"ram": schema.Int64Attribute{
						Computed: true,
					},
					"taints": schema.ListAttribute{
						Computed:    true,
						ElementType: types.StringType,
					},
				},
			},
		},
	}
}
