package getModelPoints

import (
	"GoSungrow/iSolarCloud/api"
	"GoSungrow/iSolarCloud/api/apiReflect"
	"GoSungrow/iSolarCloud/api/valueTypes"
	"fmt"
	"github.com/MickMake/GoUnify/Only"
)

const Url = "/v1/devService/getModelPoints"
const Disabled = false

type RequestData struct {
	DeviceModelId valueTypes.String `json:"device_model_id" required:"true"`
}

func (rd RequestData) IsValid() error {
	return apiReflect.VerifyOptionsRequired(rd)
}

func (rd RequestData) Help() string {
	ret := fmt.Sprintf("")
	return ret
}

type ResultData []struct {
	CodeID        valueTypes.Integer `json:"code_id"`
	DeviceModelID valueTypes.Integer `json:"device_model_id"`
	OrderNum      valueTypes.Integer `json:"order_num"`
	PointID       valueTypes.Integer `json:"point_id"`
}

func (e *ResultData) IsValid() error {
	var err error
	return err
}

func (e *EndPoint) GetData() api.DataMap {
	entries := api.NewDataMap()

	for range Only.Once {
		entries.StructToDataMap(*e, "system", nil)
	}

	return entries
}
