package schemas

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

func MakeSchemaDataSourceK8CIList() map[string]schema.Attribute {
	return map[string]schema.Attribute{
		"by_id": schema.Int64Attribute{
			Optional:    true,
			Description: "Filter by ID",
		},
		"name": schema.StringAttribute{
			Optional:    true,
			Description: "Filter by name",
		},
		"status": schema.StringAttribute{
			Optional:    true,
			Description: "Filter by status",
		},
		"worker_driver": schema.StringAttribute{
			Optional:    true,
			Description: "Filter by worker driver",
		},
		"master_driver": schema.StringAttribute{
			Optional:    true,
			Description: "Filter by master driver",
		},
		"network_plugin": schema.StringAttribute{
			Optional:    true,
			Description: "Filter by network plugin",
		},
		"include_disabled": schema.BoolAttribute{
			Optional:    true,
			Description: "Include disabled k8cis in result",
		},
		"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: "Page size",
		},
		"id": schema.StringAttribute{
			Computed: true,
		},
		"items": schema.ListNestedAttribute{
			Computed: true,
			NestedObject: schema.NestedAttributeObject{
				Attributes: map[string]schema.Attribute{
					"created_time": schema.Int64Attribute{
						Computed: true,
					},
					"desc": schema.StringAttribute{
						Computed: true,
					},
					"gid": schema.Int64Attribute{
						Computed: true,
					},
					"guid": schema.Int64Attribute{
						Computed: true,
					},
					"k8ci_id": schema.Int64Attribute{
						Computed: true,
					},
					"lb_image_id": schema.Int64Attribute{
						Computed: true,
					},
					"master_driver": schema.StringAttribute{
						Computed: true,
					},
					"master_image_id": schema.Int64Attribute{
						Computed: true,
					},
					"max_master_count": schema.Int64Attribute{
						Computed: true,
					},
					"max_worker_count": schema.Int64Attribute{
						Computed: true,
					},
					"name": schema.StringAttribute{
						Computed: true,
					},
					"shared_with": schema.ListAttribute{
						Computed:    true,
						ElementType: types.Int64Type,
					},
					"status": schema.StringAttribute{
						Computed: true,
					},
					"version": schema.StringAttribute{
						Computed: true,
					},
					"worker_driver": schema.StringAttribute{
						Computed: true,
					},
					"worker_image_id": schema.Int64Attribute{
						Computed: true,
					},
				},
			},
		},
		"entry_count": schema.Int64Attribute{
			Computed: true,
		},
	}
}
