package schemas

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

func MakeSchemaDataSourceComputeListDeleted() 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 AccountID",
		},
		"rg_name": schema.StringAttribute{
			Optional:    true,
			Description: "Find by resgroup name",
		},
		"rg_id": schema.Int64Attribute{
			Optional:    true,
			Description: "Find by RGID",
		},
		"tech_status": schema.StringAttribute{
			Optional:    true,
			Description: "Find by tech status",
		},
		"ip_address": schema.StringAttribute{
			Optional:    true,
			Description: "Find by IP address",
		},
		"extnet_name": schema.StringAttribute{
			Optional:    true,
			Description: "Find by Extnet name",
		},
		"extnet_id": schema.Int64Attribute{
			Optional:    true,
			Description: "Find by Extnet ID",
		},
		"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",
		},
		"ignore_k8s": schema.BoolAttribute{
			Optional:    true,
			Description: "If set to true, ignores any VMs associated with any k8s cluster",
		},
		// computed attributes
		"id": schema.StringAttribute{
			Computed: 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,
					},
					"affinity_label": schema.StringAttribute{
						Computed: true,
					},
					"affinity_rules": schema.ListNestedAttribute{
						Computed: true,
						NestedObject: schema.NestedAttributeObject{
							Attributes: map[string]schema.Attribute{
								"guid": schema.StringAttribute{
									Computed: true,
								},
								"key": schema.StringAttribute{
									Computed: true,
								},
								"mode": schema.StringAttribute{
									Computed: true,
								},
								"policy": schema.StringAttribute{
									Computed: true,
								},
								"topology": schema.StringAttribute{
									Computed: true,
								},
								"value": schema.StringAttribute{
									Computed: true,
								},
							},
						},
					},
					"affinity_weight": schema.Int64Attribute{
						Computed: true,
					},
					"anti_affinity_rules": schema.ListNestedAttribute{
						Computed: true,
						NestedObject: schema.NestedAttributeObject{
							Attributes: map[string]schema.Attribute{
								"guid": schema.StringAttribute{
									Computed: true,
								},
								"key": schema.StringAttribute{
									Computed: true,
								},
								"mode": schema.StringAttribute{
									Computed: true,
								},
								"policy": schema.StringAttribute{
									Computed: true,
								},
								"topology": schema.StringAttribute{
									Computed: true,
								},
								"value": schema.StringAttribute{
									Computed: true,
								},
							},
						},
					},
					"arch": schema.StringAttribute{
						Computed: true,
					},
					"auto_start_w_node": schema.BoolAttribute{
						Computed: true,
					},
					"chipset": schema.StringAttribute{
						Computed: true,
					},
					"boot_order": schema.ListAttribute{
						Computed:    true,
						ElementType: types.StringType,
					},
					"boot_type": schema.StringAttribute{
						Computed: true,
					},
					"bootdisk_size": schema.Int64Attribute{
						Computed: true,
					},
					"cd_image_id": schema.Int64Attribute{
						Computed: true,
					},
					"clone_reference": schema.Int64Attribute{
						Computed: true,
					},
					"clones": schema.ListAttribute{
						Computed:    true,
						ElementType: types.Int64Type,
					},
					"computeci_id": schema.Int64Attribute{
						Computed: true,
					},
					"cpu_pin": schema.BoolAttribute{
						Computed: true,
					},
					"cpus": schema.Int64Attribute{
						Computed: true,
					},
					"created_by": schema.StringAttribute{
						Computed: true,
					},
					"created_time": schema.Int64Attribute{
						Computed: true,
					},
					"custom_fields": schema.StringAttribute{
						Computed: true,
					},
					"deleted_by": schema.StringAttribute{
						Computed: true,
					},
					"deleted_time": schema.Int64Attribute{
						Computed: true,
					},
					"desc": schema.StringAttribute{
						Computed: true,
					},
					"devices": schema.StringAttribute{
						Computed: true,
					},
					"disks": schema.ListNestedAttribute{
						Computed: true,
						NestedObject: schema.NestedAttributeObject{
							Attributes: map[string]schema.Attribute{
								"bus_number": schema.Int64Attribute{
									Computed: true,
								},
								"disk_id": schema.Int64Attribute{
									Computed: true,
								},
								"pci_slot": schema.Int64Attribute{
									Computed: true,
								},
							},
						},
					},
					"driver": schema.StringAttribute{
						Computed: true,
					},
					"gid": schema.Int64Attribute{
						Computed: true,
					},
					"guid": schema.Int64Attribute{
						Computed: true,
					},
					"hp_backed": schema.BoolAttribute{
						Computed: true,
					},
					"hot_resize": schema.BoolAttribute{
						Computed: true,
					},
					"compute_id": schema.Int64Attribute{
						Computed: true,
					},
					"image_id": schema.Int64Attribute{
						Computed: true,
					},
					"interfaces": schema.ListNestedAttribute{
						Computed: true,
						NestedObject: schema.NestedAttributeObject{
							Attributes: map[string]schema.Attribute{
								"bus_number": schema.Int64Attribute{
									Computed: true,
								},
								"conn_id": schema.Int64Attribute{
									Computed: true,
								},
								"conn_type": schema.StringAttribute{
									Computed: true,
								},
								"def_gw": schema.StringAttribute{
									Computed: true,
								},
								"enabled": schema.BoolAttribute{
									Computed: true,
								},
								"flip_group_id": schema.Int64Attribute{
									Computed: true,
								},
								"guid": schema.StringAttribute{
									Computed: true,
								},
								"ip_address": schema.StringAttribute{
									Computed: true,
								},
								"libvirt_settings": schema.SingleNestedAttribute{
									Computed: true,
									Attributes: map[string]schema.Attribute{
										"guid": schema.StringAttribute{
											Computed: true,
										},
										"txmode": schema.StringAttribute{
											Computed: true,
										},
										"ioeventfd": schema.StringAttribute{
											Computed: true,
										},
										"event_idx": schema.StringAttribute{
											Computed: true,
										},
										"queues": schema.Int64Attribute{
											Computed: true,
										},
										"rx_queue_size": schema.Int64Attribute{
											Computed: true,
										},
										"tx_queue_size": schema.Int64Attribute{
											Computed: true,
										},
									},
								},
								"listen_ssh": schema.BoolAttribute{
									Computed: true,
								},
								"mac": schema.StringAttribute{
									Computed: true,
								},
								"name": schema.StringAttribute{
									Computed: true,
								},
								"net_id": schema.Int64Attribute{
									Computed: true,
								},
								"netmask": schema.Int64Attribute{
									Computed: true,
								},
								"net_type": schema.StringAttribute{
									Computed: true,
								},
								"node_id": schema.Int64Attribute{
									Computed: true,
								},
								"pci_slot": schema.Int64Attribute{
									Computed: true,
								},
								"qos": schema.SingleNestedAttribute{
									Computed: true,
									Attributes: map[string]schema.Attribute{
										"e_rate": schema.Int64Attribute{
											Computed: true,
										},
										"guid": schema.StringAttribute{
											Computed: true,
										},
										"in_burst": schema.Int64Attribute{
											Computed: true,
										},
										"in_rate": schema.Int64Attribute{
											Computed: true,
										},
									},
								},
								"target": schema.StringAttribute{
									Computed: true,
								},
								"type": schema.StringAttribute{
									Computed: true,
								},
								"vnfs": schema.ListAttribute{
									Computed:    true,
									ElementType: types.Int64Type,
								},
							},
						},
					},
					"lock_status": schema.StringAttribute{
						Computed: true,
					},
					"loader_type": schema.StringAttribute{
						Computed: true,
					},
					"manager_id": schema.Int64Attribute{
						Computed: true,
					},
					"manager_type": schema.StringAttribute{
						Computed: true,
					},
					"migrationjob": schema.Int64Attribute{
						Computed: true,
					},
					"milestones": schema.Int64Attribute{
						Computed: true,
					},
					"name": schema.StringAttribute{
						Computed: true,
					},
					"network_interface_naming": schema.StringAttribute{
						Computed: true,
					},
					"need_reboot": schema.BoolAttribute{
						Computed: true,
					},
					"numa_affinity": schema.StringAttribute{
						Computed: true,
					},
					"numa_node_id": schema.Int64Attribute{
						Computed: true,
					},
					"pinned": schema.BoolAttribute{
						Computed: true,
					},
					"preferred_cpu": schema.ListAttribute{
						Computed:    true,
						ElementType: types.Int64Type,
					},
					"ram": schema.Int64Attribute{
						Computed: true,
					},
					"reference_id": schema.StringAttribute{
						Computed: true,
					},
					"registered": schema.BoolAttribute{
						Computed: true,
					},
					"res_name": schema.StringAttribute{
						Computed: true,
					},
					"reserved_node_cpus": schema.ListAttribute{
						Computed:    true,
						ElementType: types.Int64Type,
					},
					"rg_id": schema.Int64Attribute{
						Computed: true,
					},
					"rg_name": schema.StringAttribute{
						Computed: true,
					},
					"snap_sets": schema.ListNestedAttribute{
						Computed: true,
						NestedObject: schema.NestedAttributeObject{
							Attributes: map[string]schema.Attribute{
								"disks": schema.ListAttribute{
									Computed:    true,
									ElementType: types.Int64Type,
								},
								"guid": schema.StringAttribute{
									Computed: true,
								},
								"label": schema.StringAttribute{
									Computed: true,
								},
								"timestamp": schema.Int64Attribute{
									Computed: true,
								},
							},
						},
					},
					"stateless_sep_id": schema.Int64Attribute{
						Computed: true,
					},
					"stateless_sep_type": schema.StringAttribute{
						Computed: true,
					},
					"status": schema.StringAttribute{
						Computed: true,
					},
					"tags": schema.MapAttribute{
						Computed:    true,
						ElementType: types.StringType,
					},
					"tech_status": schema.StringAttribute{
						Computed: true,
					},
					"total_disks_size": schema.Int64Attribute{
						Computed: true,
					},
					"updated_by": schema.StringAttribute{
						Computed: true,
					},
					"updated_time": schema.Int64Attribute{
						Computed: true,
					},
					"user_managed": schema.BoolAttribute{
						Computed: true,
					},
					"vgpus": schema.ListAttribute{
						Computed:    true,
						ElementType: types.Int64Type,
					},
					"vins_connected": schema.Int64Attribute{
						Computed: true,
					},
					"virtual_image_id": schema.Int64Attribute{
						Computed: true,
					},
				},
			},
		},
		"entry_count": schema.Int64Attribute{
			Computed: true,
		},
	}
}
