package schemas

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

func MakeSchemaDataSourceRGGetResourceConsumption() map[string]schema.Attribute {
	return map[string]schema.Attribute{
		// required attributes
		"rg_id": schema.Int64Attribute{
			Required:    true,
			Description: "find by rg id",
		},

		//computed attributes
		"id": schema.StringAttribute{
			Computed: true,
		},
		"consumed": schema.SingleNestedAttribute{
			Computed: true,
			Attributes: map[string]schema.Attribute{
				"cpu": schema.Int64Attribute{
					Computed: true,
				},
				"disk_size": schema.Float64Attribute{
					Computed: true,
				},
				"disk_size_max": schema.Float64Attribute{
					Computed: true,
				},
				"extips": schema.Int64Attribute{
					Computed: true,
				},
				"exttraffic": schema.Int64Attribute{
					Computed: true,
				},
				"gpu": schema.Int64Attribute{
					Computed: true,
				},
				"ram": schema.Int64Attribute{
					Computed: true,
				},
				"seps": schema.ListNestedAttribute{
					Computed: true,
					NestedObject: schema.NestedAttributeObject{
						Attributes: map[string]schema.Attribute{
							"sep_id": schema.StringAttribute{
								Computed: true,
							},
							"data_name": schema.StringAttribute{
								Computed: true,
							},
							"disk_size": schema.Float64Attribute{
								Computed: true,
							},
							"disk_size_max": schema.Float64Attribute{
								Computed: true,
							},
						},
					},
				},
			},
		},
		"reserved": schema.SingleNestedAttribute{
			Computed: true,
			Attributes: map[string]schema.Attribute{
				"cpu": schema.Int64Attribute{
					Computed: true,
				},
				"disk_size": schema.Float64Attribute{
					Computed: true,
				},
				"disk_size_max": schema.Float64Attribute{
					Computed: true,
				},
				"extips": schema.Int64Attribute{
					Computed: true,
				},
				"exttraffic": schema.Int64Attribute{
					Computed: true,
				},
				"gpu": schema.Int64Attribute{
					Computed: true,
				},
				"ram": schema.Int64Attribute{
					Computed: true,
				},
				"seps": schema.ListNestedAttribute{
					Computed: true,
					NestedObject: schema.NestedAttributeObject{
						Attributes: map[string]schema.Attribute{
							"sep_id": schema.StringAttribute{
								Computed: true,
							},
							"data_name": schema.StringAttribute{
								Computed: true,
							},
							"disk_size": schema.Float64Attribute{
								Computed: true,
							},
							"disk_size_max": schema.Float64Attribute{
								Computed: true,
							},
						},
					},
				},
			},
		},
		"resource_limits": schema.SingleNestedAttribute{
			Computed: true,
			Attributes: map[string]schema.Attribute{
				"cu_c": schema.Float64Attribute{
					Computed: true,
				},
				"cu_d": schema.Float64Attribute{
					Computed: true,
				},
				"cu_dm": schema.Float64Attribute{
					Computed: true,
				},
				"cu_i": schema.Float64Attribute{
					Computed: true,
				},
				"cu_m": schema.Float64Attribute{
					Computed: true,
				},
				"cu_np": schema.Float64Attribute{
					Computed: true,
				},
				"gpu_units": schema.Float64Attribute{
					Computed: true,
				},
			},
		},
	}
}
