package request

type TaobaoTraderateAddRequest struct {
	/*
	   交易ID     */
	Tid *int64 `json:"tid" required:"true" `
	/*
	   子订单ID     */
	Oid *int64 `json:"oid,omitempty" required:"false" `
	/*
	   评价结果,可选值:good(好评),neutral(中评),bad(差评)     */
	Result *string `json:"result" required:"true" `
	/*
	   评价者角色,可选值:seller(卖家),buyer(买家)     */
	Role *string `json:"role" required:"true" `
	/*
	   评价内容,最大长度: 500个汉字 .注意：当评价结果为good时就不用输入评价内容.评价内容为neutral/bad的时候需要输入评价内容     */
	Content *string `json:"content,omitempty" required:"false" `
	/*
	   是否匿名,卖家评不能匿名。可选值:true(匿名),false(非匿名)。注意：如果交易订单匿名，则评价也匿名     */
	Anony *bool `json:"anony,omitempty" required:"false" `
}

func (s *TaobaoTraderateAddRequest) SetTid(v int64) *TaobaoTraderateAddRequest {
	s.Tid = &v
	return s
}
func (s *TaobaoTraderateAddRequest) SetOid(v int64) *TaobaoTraderateAddRequest {
	s.Oid = &v
	return s
}
func (s *TaobaoTraderateAddRequest) SetResult(v string) *TaobaoTraderateAddRequest {
	s.Result = &v
	return s
}
func (s *TaobaoTraderateAddRequest) SetRole(v string) *TaobaoTraderateAddRequest {
	s.Role = &v
	return s
}
func (s *TaobaoTraderateAddRequest) SetContent(v string) *TaobaoTraderateAddRequest {
	s.Content = &v
	return s
}
func (s *TaobaoTraderateAddRequest) SetAnony(v bool) *TaobaoTraderateAddRequest {
	s.Anony = &v
	return s
}

func (req *TaobaoTraderateAddRequest) ToMap() map[string]interface{} {
	paramMap := make(map[string]interface{})
	if req.Tid != nil {
		paramMap["tid"] = *req.Tid
	}
	if req.Oid != nil {
		paramMap["oid"] = *req.Oid
	}
	if req.Result != nil {
		paramMap["result"] = *req.Result
	}
	if req.Role != nil {
		paramMap["role"] = *req.Role
	}
	if req.Content != nil {
		paramMap["content"] = *req.Content
	}
	if req.Anony != nil {
		paramMap["anony"] = *req.Anony
	}
	return paramMap
}

func (req *TaobaoTraderateAddRequest) ToFileMap() map[string]interface{} {
	fileMap := make(map[string]interface{})
	return fileMap
}
