package schemas

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

func MakeSchemaDataSourceExtNet() map[string]schema.Attribute {
	return map[string]schema.Attribute{
		// required attributes
		"net_id": schema.Int64Attribute{
			Required:    true,
			Description: "ext net id",
		},

		// computed attributes
		"id": schema.StringAttribute{
			Computed: true,
		},
		"ckey": schema.StringAttribute{
			Computed: true,
		},
		"meta": schema.ListAttribute{
			Computed:    true,
			ElementType: types.StringType,
		},
		"check_ips": schema.ListAttribute{
			Computed:    true,
			ElementType: types.StringType,
		},
		"default": schema.BoolAttribute{
			Computed: true,
		},
		"ntp": schema.ListAttribute{
			Computed:    true,
			ElementType: types.StringType,
		},
		"default_qos": schema.SingleNestedAttribute{
			Computed: true,
			Attributes: map[string]schema.Attribute{
				"e_rate": schema.Int64Attribute{
					Computed: true,
				},
				"e_burst": schema.Int64Attribute{
					Computed: true,
				},
				"guid": schema.StringAttribute{
					Computed: true,
				},
				"in_burst": schema.Int64Attribute{
					Computed: true,
				},
				"in_rate": schema.Int64Attribute{
					Computed: true,
				},
			},
		},
		"desc": schema.StringAttribute{
			Computed: true,
		},
		"dns": schema.ListAttribute{
			Computed:    true,
			ElementType: types.StringType,
		},
		"excluded": schema.ListNestedAttribute{
			Computed: true,
			NestedObject: schema.NestedAttributeObject{
				Attributes: map[string]schema.Attribute{
					"client_type": schema.StringAttribute{
						Computed: true,
					},
					"mac": schema.StringAttribute{
						Computed: true,
					},
					"ip": schema.StringAttribute{
						Computed: true,
					},
					"type": schema.StringAttribute{
						Computed: true,
					},
					"vm_id": schema.Int64Attribute{
						Computed: true,
					},
				},
			},
		},
		"free_ips": schema.Int64Attribute{
			Computed: true,
		},
		"gateway": schema.StringAttribute{
			Computed: true,
		},
		"gid": schema.Int64Attribute{
			Computed: true,
		},
		"guid": schema.Int64Attribute{
			Computed: true,
		},
		"ipcidr": schema.StringAttribute{
			Computed: true,
		},
		"milestones": schema.Int64Attribute{
			Computed: true,
		},
		"net_name": schema.StringAttribute{
			Computed: true,
		},
		"network": schema.StringAttribute{
			Computed: true,
		},
		"network_id": schema.Int64Attribute{
			Computed: true,
		},
		"pre_reservations_num": schema.Int64Attribute{
			Computed: true,
		},
		"prefix": schema.Int64Attribute{
			Computed: true,
		},
		"pri_vnf_dev_id": schema.Int64Attribute{
			Computed: true,
		},
		"reservations": schema.ListNestedAttribute{
			Computed: true,
			NestedObject: schema.NestedAttributeObject{
				Attributes: map[string]schema.Attribute{
					"account_id": schema.Int64Attribute{
						Computed: true,
					},
					"client_type": schema.StringAttribute{
						Computed: true,
					},
					"domainname": schema.StringAttribute{
						Computed: true,
					},
					"hostname": schema.StringAttribute{
						Computed: true,
					},
					"desc": schema.StringAttribute{
						Computed: true,
					},
					"ip": schema.StringAttribute{
						Computed: true,
					},
					"mac": schema.StringAttribute{
						Computed: true,
					},
					"type": schema.StringAttribute{
						Computed: true,
					},
					"vm_id": schema.Int64Attribute{
						Computed: true,
					},
				},
			},
		},
		"shared_with": schema.ListAttribute{
			Computed:    true,
			ElementType: types.Int64Type,
		},
		"status": schema.StringAttribute{
			Computed: true,
		},
		"vlan_id": schema.Int64Attribute{
			Computed: true,
		},
		"vnfs": schema.SingleNestedAttribute{
			Computed: true,
			Attributes: map[string]schema.Attribute{
				"dhcp": schema.Int64Attribute{
					Computed: true,
				},
			},
		},
	}
}
