package schemas

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

func MakeSchemaDataSourceCompute() map[string]schema.Attribute {
	return map[string]schema.Attribute{
		// required attributes
		"compute_id": schema.Int64Attribute{
			Required: true,
		},
		// computed attributes
		"id": schema.StringAttribute{
			Computed: true,
		},
		"acl": schema.SingleNestedAttribute{
			Computed: true,
			Attributes: map[string]schema.Attribute{
				"account_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,
							},
						},
					},
				},
				"compute_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,
							},
						},
					},
				},
				"rg_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{
					"ckey": schema.StringAttribute{
						Computed: true,
					},
					"acl": schema.StringAttribute{
						Computed: true,
					},
					"account_id": schema.Int64Attribute{
						Computed: true,
					},
					"boot_partition": schema.Int64Attribute{
						Computed: true,
					},
					"bus_number": schema.Int64Attribute{
						Computed: true,
					},
					"created_time": schema.Int64Attribute{
						Computed: true,
					},
					"deleted_time": schema.Int64Attribute{
						Computed: true,
					},
					"desc": schema.StringAttribute{
						Computed: true,
					},
					"destruction_time": schema.Int64Attribute{
						Computed: true,
					},
					"disk_path": schema.StringAttribute{
						Computed: true,
					},
					"gid": schema.Int64Attribute{
						Computed: true,
					},
					"guid": schema.Int64Attribute{
						Computed: true,
					},
					"disk_id": schema.Int64Attribute{
						Computed: true,
					},
					"image_id": schema.Int64Attribute{
						Computed: true,
					},
					"images": schema.ListAttribute{
						Computed:    true,
						ElementType: types.Int64Type,
					},
					"iotune": schema.SingleNestedAttribute{
						Computed: true,
						Attributes: map[string]schema.Attribute{
							"read_bytes_sec": schema.Int64Attribute{
								Computed: true,
							},
							"read_bytes_sec_max": schema.Int64Attribute{
								Computed: true,
							},
							"read_iops_sec": schema.Int64Attribute{
								Computed: true,
							},
							"read_iops_sec_max": schema.Int64Attribute{
								Computed: true,
							},
							"size_iops_sec": schema.Int64Attribute{
								Computed: true,
							},
							"total_bytes_sec": schema.Int64Attribute{
								Computed: true,
							},
							"total_bytes_sec_max": schema.Int64Attribute{
								Computed: true,
							},
							"total_iops_sec": schema.Int64Attribute{
								Computed: true,
							},
							"total_iops_sec_max": schema.Int64Attribute{
								Computed: true,
							},
							"write_bytes_sec": schema.Int64Attribute{
								Computed: true,
							},
							"write_bytes_sec_max": schema.Int64Attribute{
								Computed: true,
							},
							"write_iops_sec": schema.Int64Attribute{
								Computed: true,
							},
							"write_iops_sec_max": schema.Int64Attribute{
								Computed: true,
							},
						},
					},
					"iqn": schema.StringAttribute{
						Computed: true,
					},
					"login": schema.StringAttribute{
						Computed: true,
					},
					"milestones": schema.Int64Attribute{
						Computed: true,
					},
					"name": schema.StringAttribute{
						Computed: true,
					},
					"order": schema.Int64Attribute{
						Computed: true,
					},
					"params": schema.StringAttribute{
						Computed: true,
					},
					"parent_id": schema.Int64Attribute{
						Computed: true,
					},
					"passwd": schema.StringAttribute{
						Computed: true,
					},
					"pci_slot": schema.Int64Attribute{
						Computed: true,
					},
					"pool": schema.StringAttribute{
						Computed: true,
					},
					"present_to": schema.MapAttribute{
						Computed:    true,
						ElementType: types.Int64Type,
					},
					"purge_time": schema.Int64Attribute{
						Computed: true,
					},
					"replication": schema.SingleNestedAttribute{
						Computed: true,
						Attributes: map[string]schema.Attribute{
							"disk_id": schema.Int64Attribute{
								Computed: true,
							},
							"pool_id": schema.StringAttribute{
								Computed: true,
							},
							"role": schema.StringAttribute{
								Computed: true,
							},
							"self_volume_id": schema.StringAttribute{
								Computed: true,
							},
							"storage_id": schema.StringAttribute{
								Computed: true,
							},
							"volume_id": schema.StringAttribute{
								Computed: true,
							},
						},
					},
					"reality_device_number": schema.Int64Attribute{
						Computed: true,
					},
					"reference_id": schema.StringAttribute{
						Computed: true,
					},
					"res_id": schema.StringAttribute{
						Computed: true,
					},
					"role": schema.StringAttribute{
						Computed: true,
					},
					"sep_id": schema.Int64Attribute{
						Computed: true,
					},
					"shareable": schema.BoolAttribute{
						Computed: true,
					},
					"size_available": schema.Float64Attribute{
						Computed: true,
					},
					"size_max": schema.Int64Attribute{
						Computed: true,
					},
					"size_used": schema.Float64Attribute{
						Computed: true,
					},
					"snapshots": schema.ListNestedAttribute{
						Computed: true,
						NestedObject: schema.NestedAttributeObject{
							Attributes: map[string]schema.Attribute{
								"guid": schema.StringAttribute{
									Computed: true,
								},
								"label": schema.StringAttribute{
									Computed: true,
								},
								"reference_id": schema.StringAttribute{
									Computed: true,
								},
								"res_id": schema.StringAttribute{
									Computed: true,
								},
								"snap_set_guid": schema.StringAttribute{
									Computed: true,
								},
								"snap_set_time": schema.Int64Attribute{
									Computed: true,
								},
								"timestamp": schema.Int64Attribute{
									Computed: true,
								},
							},
						},
					},
					"status": schema.StringAttribute{
						Computed: true,
					},
					"tech_status": schema.StringAttribute{
						Computed: true,
					},
					"type": schema.StringAttribute{
						Computed: true,
					},
					"vmid": 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,
		},
		"image_id": schema.Int64Attribute{
			Computed: true,
		},
		"image_name": schema.StringAttribute{
			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,
					},
					"mtu": schema.Int64Attribute{
						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,
					},
				},
			},
		},
		"loader_type": schema.StringAttribute{
			Computed: true,
		},
		"lock_status": 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,
		},
		"natable_vins_id": schema.Int64Attribute{
			Computed: true,
		},
		"natable_vins_ip": schema.StringAttribute{
			Computed: true,
		},
		"natable_vins_name": schema.StringAttribute{
			Computed: true,
		},
		"natable_vins_network": schema.StringAttribute{
			Computed: true,
		},
		"natable_vins_network_name": schema.StringAttribute{
			Computed: true,
		},
		"os_users": schema.ListNestedAttribute{
			Computed: true,
			NestedObject: schema.NestedAttributeObject{
				Attributes: map[string]schema.Attribute{
					"guid": schema.StringAttribute{
						Computed: true,
					},
					"login": schema.StringAttribute{
						Computed: true,
					},
					"password": schema.StringAttribute{
						Computed: true,
					},
					"public_key": schema.StringAttribute{
						Computed: true,
					},
				},
			},
		},
		"pci_devices": schema.ListAttribute{
			Computed:    true,
			ElementType: types.Int64Type,
		},
		"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,
		},
		"updated_by": schema.StringAttribute{
			Computed: true,
		},
		"updated_time": schema.Int64Attribute{
			Computed: true,
		},
		"user_data": schema.StringAttribute{
			Computed: true,
		},
		"user_managed": schema.BoolAttribute{
			Computed: true,
		},
		"vgpus": schema.ListNestedAttribute{
			Computed: true,
			NestedObject: schema.NestedAttributeObject{
				Attributes: map[string]schema.Attribute{
					"id": schema.Int64Attribute{
						Computed: true,
					},
					"gid": schema.Int64Attribute{
						Computed: true,
					},
					"type": schema.StringAttribute{
						Computed: true,
					},
					"mode": schema.StringAttribute{
						Computed: true,
					},
					"status": schema.StringAttribute{
						Computed: true,
					},
					"profile_id": schema.Int64Attribute{
						Computed: true,
					},
					"ram": schema.Int64Attribute{
						Computed: true,
					},
					"last_update_time": schema.Int64Attribute{
						Computed: true,
					},
					"created_time": schema.Int64Attribute{
						Computed: true,
					},
					"deleted_time": schema.Int64Attribute{
						Computed: true,
					},
					"vmid": schema.Int64Attribute{
						Computed: true,
					},
					"pgpuid": schema.Int64Attribute{
						Computed: true,
					},
					"reference_id": schema.StringAttribute{
						Computed: true,
					},
					"account_id": schema.Int64Attribute{
						Computed: true,
					},
					"rg_id": schema.Int64Attribute{
						Computed: true,
					},
					"last_claimed_by": schema.Int64Attribute{
						Computed: true,
					},
					"pci_slot": schema.Int64Attribute{
						Computed: true,
					},
					"bus_number": schema.Int64Attribute{
						Computed: true,
					},
					"guid": schema.Int64Attribute{
						Computed: true,
					},
				},
			},
		},
		"virtual_image_id": schema.Int64Attribute{
			Computed: true,
		},
		"virtual_image_name": schema.StringAttribute{
			Computed: true,
		},
		"vnc_password": schema.StringAttribute{
			Computed: true,
		},
	}
}
