package schemas

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

func MakeSchemaDataSourceK8SListDeleted() map[string]schema.Attribute {
	return map[string]schema.Attribute{
		// optional attributes
		"by_id": schema.Int64Attribute{
			Optional: true,
		},
		"name": schema.StringAttribute{
			Optional: true,
		},
		"ip_address": schema.StringAttribute{
			Optional: true,
		},
		"rg_id": schema.Int64Attribute{
			Optional: true,
		},
		"lb_id": schema.Int64Attribute{
			Optional: true,
		},
		"bservice_id": schema.Int64Attribute{
			Optional: true,
		},
		"tech_status": schema.StringAttribute{
			Optional: true,
		},
		"sort_by": schema.StringAttribute{
			Optional:    true,
			Description: "sort by one of supported fields, format +|-(field)",
		},
		"page": schema.Int64Attribute{
			Optional: true,
		},
		"size": schema.Int64Attribute{
			Optional: true,
		},
		// computed attributes
		"id": schema.StringAttribute{
			Computed: true,
		},
		"items": schema.ListNestedAttribute{
			Computed: true,
			NestedObject: schema.NestedAttributeObject{
				Attributes: map[string]schema.Attribute{
					"account_id": schema.Int64Attribute{
						Computed: true,
					},
					"account_name": schema.StringAttribute{
						Computed: true,
					},
					"acl": schema.ListAttribute{
						Computed:    true,
						ElementType: types.StringType,
					},
					"bservice_id": schema.Int64Attribute{
						Computed: true,
					},
					"k8sci_id": schema.Int64Attribute{
						Computed: true,
					},
					"created_by": schema.StringAttribute{
						Computed: true,
					},
					"created_time": schema.Int64Attribute{
						Computed: true,
					},
					"deleted_by": schema.StringAttribute{
						Computed: true,
					},
					"deleted_time": schema.Int64Attribute{
						Computed: true,
					},
					"desc": schema.StringAttribute{
						Computed: true,
					},
					"extnet_id": schema.Int64Attribute{
						Computed: true,
					},
					"gid": schema.Int64Attribute{
						Computed: true,
					},
					"guid": schema.Int64Attribute{
						Computed: true,
					},
					"k8s_id": schema.Int64Attribute{
						Computed: true,
					},
					"lb_id": schema.Int64Attribute{
						Computed: true,
					},
					"milestones": schema.Int64Attribute{
						Computed: true,
					},
					"k8s_name": schema.StringAttribute{
						Computed: true,
					},
					"network_plugin": schema.StringAttribute{
						Computed: true,
					},
					"rg_id": schema.Int64Attribute{
						Computed: true,
					},
					"rg_name": schema.StringAttribute{
						Computed: true,
					},
					"service_account": schema.SingleNestedAttribute{
						Computed: true,
						Attributes: map[string]schema.Attribute{
							"guid": schema.StringAttribute{
								Computed: true,
							},
							"password": schema.StringAttribute{
								Computed: true,
							},
							"username": schema.StringAttribute{
								Computed: true,
							},
						},
					},
					"status": schema.StringAttribute{
						Computed: true,
					},
					"tech_status": schema.StringAttribute{
						Computed: true,
					},
					"updated_by": schema.StringAttribute{
						Computed: true,
					},
					"updated_time": schema.Int64Attribute{
						Computed: true,
					},
					"vins_id": schema.Int64Attribute{
						Computed: true,
					},
					"workers_groups": 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{
											"externalip": schema.StringAttribute{
												Computed: true,
											},
											"id": schema.Int64Attribute{
												Computed: true,
											},
											"name": schema.StringAttribute{
												Computed: true,
											},
											"status": schema.StringAttribute{
												Computed: true,
											},
											"tech_status": schema.StringAttribute{
												Computed: true,
											},
										},
									},
								},
								"disk": schema.Int64Attribute{
									Computed: true,
								},
								"guid": schema.StringAttribute{
									Computed: true,
								},
								"worker_group_id": schema.Int64Attribute{
									Computed: true,
								},
								"labels": schema.ListAttribute{
									Computed:    true,
									ElementType: types.StringType,
								},
								"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,
								},
							},
						},
					},
				},
			},
		},
		"entry_count": schema.Int64Attribute{
			Computed: true,
		},
	}
}
