package cooper

import (
	"errors"
	"net/url"
)

//删除灯路配置
func (that *CooperClient) NewUsrK3LightModDelRequest() *UsrK3LightModDelRequest {
	return &UsrK3LightModDelRequest{
		Request: Request{
			Client:     that,
			apiAddress: "/usrK3/lightModDel",
		},
	}
}

//UsrK3LightModDelRequest ...
type UsrK3LightModDelRequest struct {
	Request
}

//设备ID
func (that *UsrK3LightModDelRequest) ModId(value int64) *UsrK3LightModDelRequest {
	that.initParams()
	that.params.Set("mod_id", ToString(value))
	return that
}

//Params ...
func (that *UsrK3LightModDelRequest) Params() (url.Values, error) {
	that.initParams()
	_params := that.params
	if that.publicParamsSlice != nil {
		for _, _v := range that.publicParamsSlice {
			if _params.Get(_v) == "" {
				return nil, errors.New(that.apiAddress + "缺少参数:" + _v)
			}
		}
	}
	return _params, nil
}

//Do ...
func (that *UsrK3LightModDelRequest) Do() (interface{}, error) {
	//返回data
	_data, _err := that.Client.Post(that.apiAddress, that)
	if _err != nil {
		return nil, _err
	}
	return _data, nil
}
