package pposRequest

import (
	"net/url"
)

func (that *PPOSClient) NewXiaoLiYunBraceletReturnVerify() *XiaoLiYunBraceletReturnVerifyRequest {
	return &XiaoLiYunBraceletReturnVerifyRequest{
		Request: Request{
			Client:     that,
			apiAddress: "/ticket/water/checkAuth",
		},
	}
}

// XiaoLiYunBraceletReturnVerify 请求参数...
type XiaoLiYunBraceletReturnVerifyRequest struct {
	Request
	BraceletCardNo      string `json:"bracelet_card_no"` //还手环号内码(必填)
	ClubId      string  `json:"club_id"` //标识场馆的 ID (选填)
	DeviceName      string `json:"device_name"` //设备名称(选填)
	BraceletNum      string `json:"bracelet_num"` //印在手环上的标记数字(选填)
}

//SetBraceletCardNo ...
func (that *XiaoLiYunBraceletReturnVerifyRequest) SetBraceletCardNo(value string) *XiaoLiYunBraceletReturnVerifyRequest {
	that.BraceletCardNo = value
	return that
}

//SetClubId ...
func (that *XiaoLiYunBraceletReturnVerifyRequest) SetClubId(value string) *XiaoLiYunBraceletReturnVerifyRequest {
	that.ClubId = value
	return that
}

//SetDeviceName ...
func (that *XiaoLiYunBraceletReturnVerifyRequest) SetDeviceName(value string) *XiaoLiYunBraceletReturnVerifyRequest {
	that.DeviceName = value
	return that
}

//SetBraceletNum ...
func (that *XiaoLiYunBraceletReturnVerifyRequest) SetBraceletNum(value string) *XiaoLiYunBraceletReturnVerifyRequest {
	that.BraceletNum = value
	return that
}

//Params ...
func (that *XiaoLiYunBraceletReturnVerifyRequest) Params() (url.Values, error) {
	var m = make(url.Values)
	m.Set("bracelet_card_no", that.BraceletCardNo)
	if that.ClubId != "" {
		m.Set("club_id", that.ClubId)
	}
	m.Set("device_name", that.DeviceName)
	if that.BraceletNum != "" {
		m.Set("bracelet_num", that.BraceletNum)
	}
	return m, nil
}

//Do ...
func (that *XiaoLiYunBraceletReturnVerifyRequest) Do() (interface{}, error) {
	_responData, _err := that.Client.GetData(that.apiAddress, that)
	if _err != nil {
		return nil, _err
	}
	return _responData, nil
}
