package schemas

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

func MakeSchemaDataSourceVINSList() map[string]schema.Attribute {
	return map[string]schema.Attribute{
		// optional attributes
		"by_id": schema.Int64Attribute{
			Optional:    true,
			Description: "Filter by ID",
		},
		"name": schema.StringAttribute{
			Optional:    true,
			Description: "Filter by Name",
		},
		"account_id": schema.Int64Attribute{
			Optional:    true,
			Description: "Filter by Account ID",
		},
		"rg_id": schema.Int64Attribute{
			Optional:    true,
			Description: "Filter by RG ID",
		},
		"ext_ip": schema.StringAttribute{
			Optional:    true,
			Description: "Filter by external IP address",
		},
		"vnfdev_id": schema.Int64Attribute{
			Optional:    true,
			Description: "find by VNF Device id",
		},
		"include_deleted": schema.BoolAttribute{
			Optional:    true,
			Description: "Include deleted computes",
		},
		"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",
		},

		// 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,
					},
					"created_by": schema.StringAttribute{
						Computed: true,
					},
					"created_time": schema.Int64Attribute{
						Computed: true,
					},
					"default_gw": schema.StringAttribute{
						Computed: true,
					},
					"default_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,
							},
						},
					},
					"deleted_by": schema.StringAttribute{
						Computed: true,
					},
					"deleted_time": schema.Int64Attribute{
						Computed: true,
					},
					"description": schema.StringAttribute{
						Computed: true,
					},
					"external_ip": schema.StringAttribute{
						Computed: true,
					},
					"extnet_id": schema.Int64Attribute{
						Computed: true,
					},
					"free_ips": schema.Int64Attribute{
						Computed: true,
					},
					"gid": schema.Int64Attribute{
						Computed: true,
					},
					"guid": schema.Int64Attribute{
						Computed: true,
					},
					"vins_id": schema.Int64Attribute{
						Computed: true,
					},
					"lock_status": schema.StringAttribute{
						Computed: true,
					},
					"manager_id": schema.Int64Attribute{
						Computed: true,
					},
					"manager_type": schema.StringAttribute{
						Computed: true,
					},
					"milestones": schema.Int64Attribute{
						Computed: true,
					},
					"name": schema.StringAttribute{
						Computed: true,
					},
					"netmask": schema.Int64Attribute{
						Computed: true,
					},
					"network": schema.StringAttribute{
						Computed: true,
					},
					"pre_reservations_num": schema.Int64Attribute{
						Computed: true,
					},
					"pri_vnf_dev_id": schema.Int64Attribute{
						Computed: true,
					},
					"redundant": schema.BoolAttribute{
						Computed: true,
					},
					"rg_id": schema.Int64Attribute{
						Computed: true,
					},
					"rg_name": schema.StringAttribute{
						Computed: true,
					},
					"sec_vnf_dev_id": schema.Int64Attribute{
						Computed: true,
					},
					"status": schema.StringAttribute{
						Computed: true,
					},
					"updated_by": schema.StringAttribute{
						Computed: true,
					},
					"updated_time": schema.Int64Attribute{
						Computed: true,
					},
					"user_managed": schema.BoolAttribute{
						Computed: true,
					},
					"vnfs": schema.SingleNestedAttribute{
						Computed: true,
						Attributes: map[string]schema.Attribute{
							"dhcp": schema.Int64Attribute{
								Computed: true,
							},
							"dns": schema.Int64Attribute{
								Computed: true,
							},
							"fw": schema.Int64Attribute{
								Computed: true,
							},
							"gw": schema.Int64Attribute{
								Computed: true,
							},
							"nat": schema.Int64Attribute{
								Computed: true,
							},
							"vpn": schema.Int64Attribute{
								Computed: true,
							},
						},
					},
					"vxlan_id": schema.Int64Attribute{
						Computed: true,
					},
				},
			},
		},
		"entry_count": schema.Int64Attribute{
			Computed: true,
		},
	}
}
