package cooper

import (
	"PPOSUtils/utils"
	"errors"
	"net/url"
)

//NewFaceUserDeleteRequest ...
func (that *CooperClient) NewFaceUserDeleteRequest() *FaceUserDeleteRequest {
	return &FaceUserDeleteRequest{
		Request: Request{
			Client:     that,
			apiAddress: "/baiduFace/userRemove",
		},
	}
}

//FaceUserDeleteRequest ...
type FaceUserDeleteRequest struct {
	Request
}

//SetUserID...
func (that *FaceUserDeleteRequest) SetUserId(value string) *FaceUserDeleteRequest {
	that.initParams()
	that.params.Set("user_id", value)
	return that
}

//SetGroupID..
func (that *FaceUserDeleteRequest) SetGroupID(value int64) *FaceUserDeleteRequest {
	that.initParams()
	that.params.Set("group_id", utils.ToString(value))
	return that
}

//Params ...
func (that *FaceUserDeleteRequest) 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 *FaceUserDeleteRequest) Do() (interface{}, error) {
	_data, _err := that.Client.Post(that.apiAddress, that)
	if _err != nil {
		return _data, _err
	}
	return _data, nil
}
