package schemas

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

func MakeSchemaDataSourceRGListDeleted() map[string]schema.Attribute {
	return map[string]schema.Attribute{
		// optional attributes
		"by_id": schema.Int64Attribute{
			Optional:    true,
			Description: "find by id",
		},
		"name": schema.StringAttribute{
			Optional:    true,
			Description: "find by name",
		},
		"account_id": schema.Int64Attribute{
			Optional:    true,
			Description: "find by account id",
		},
		"account_name": schema.StringAttribute{
			Optional:    true,
			Description: "find by account name",
		},
		"created_after": schema.Int64Attribute{
			Optional:    true,
			Description: "find by created after time (unix timestamp)",
		},
		"created_before": schema.Int64Attribute{
			Optional:    true,
			Description: "find by created before time (unix timestamp)",
		},
		"lock_status": schema.StringAttribute{
			Optional:    true,
			Description: "find by lock status",
		},
		"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{
					"acl": schema.ListNestedAttribute{
						Computed: true,
						NestedObject: schema.NestedAttributeObject{
							Attributes: map[string]schema.Attribute{
								"explicit": schema.BoolAttribute{
									Computed: true,
								},
								"guid": schema.StringAttribute{
									Computed: true,
								},
								"right": schema.StringAttribute{
									Computed: true,
								},
								"status": schema.StringAttribute{
									Computed: true,
								},
								"type": schema.StringAttribute{
									Computed: true,
								},
								"user_group_id": schema.StringAttribute{
									Computed: true,
								},
							},
						},
					},
					"account_id": schema.Int64Attribute{
						Computed: true,
					},
					"account_name": schema.StringAttribute{
						Computed: true,
					},
					"compute_features": schema.ListAttribute{
						Computed:    true,
						ElementType: types.StringType,
					},
					"created_by": schema.StringAttribute{
						Computed: true,
					},
					"created_time": schema.Int64Attribute{
						Computed: true,
					},
					"def_net_id": schema.Int64Attribute{
						Computed: true,
					},
					"def_net_type": schema.StringAttribute{
						Computed: true,
					},
					"deleted_by": schema.StringAttribute{
						Computed: true,
					},
					"deleted_time": schema.Int64Attribute{
						Computed: true,
					},
					"desc": schema.StringAttribute{
						Computed: true,
					},
					"dirty": schema.BoolAttribute{
						Computed: true,
					},
					"gid": schema.Int64Attribute{
						Computed: true,
					},
					"guid": schema.Int64Attribute{
						Computed: true,
					},
					"rg_id": schema.Int64Attribute{
						Computed: true,
					},
					"lock_status": schema.StringAttribute{
						Computed: true,
					},
					"milestones": schema.Int64Attribute{
						Computed: true,
					},
					"name": schema.StringAttribute{
						Computed: true,
					},
					"register_computes": schema.BoolAttribute{
						Computed: true,
					},
					"resource_limits": schema.SingleNestedAttribute{
						Computed: true,
						Attributes: map[string]schema.Attribute{
							"cu_c": schema.Float64Attribute{
								Computed: true,
							},
							"cu_d": schema.Float64Attribute{
								Computed: true,
							},
							"cu_dm": schema.Float64Attribute{
								Computed: true,
							},
							"cu_i": schema.Float64Attribute{
								Computed: true,
							},
							"cu_m": schema.Float64Attribute{
								Computed: true,
							},
							"cu_np": schema.Float64Attribute{
								Computed: true,
							},
							"gpu_units": schema.Float64Attribute{
								Computed: true,
							},
						},
					},
					"secret": schema.StringAttribute{
						Computed: true,
					},
					"status": schema.StringAttribute{
						Computed: true,
					},
					"updated_by": schema.StringAttribute{
						Computed: true,
					},
					"updated_time": schema.Int64Attribute{
						Computed: true,
					},
					"vins": schema.ListAttribute{
						Computed:    true,
						ElementType: types.Int64Type,
					},
					"vms": schema.ListAttribute{
						Computed:    true,
						ElementType: types.Int64Type,
					},
					"resource_types": schema.ListAttribute{
						Computed:    true,
						ElementType: types.StringType,
					},
					"cpu_allocation_parameter": schema.StringAttribute{
						Computed: true,
					},
					"cpu_allocation_ratio": schema.Float64Attribute{
						Computed: true,
					},
					"uniq_pools": schema.ListAttribute{
						Computed:    true,
						ElementType: types.StringType,
					},
				},
			},
		},
		"entry_count": schema.Int64Attribute{
			Computed: true,
		},
	}
}
