package request

import (
	"topsdk/util"
)

type TmallExchangeRefuseRequest struct {
	/*
	   凭证图片     */
	LeaveMessagePics *[]byte `json:"leave_message_pics,omitempty" required:"false" `
	/*
	   拒绝换货申请时的留言     */
	LeaveMessage *string `json:"leave_message,omitempty" required:"false" `
	/*
	   换货单号ID     */
	DisputeId *int64 `json:"dispute_id" required:"true" `
	/*
	   换货原因对应ID     */
	SellerRefuseReasonId *int64 `json:"seller_refuse_reason_id" required:"true" `
	/*
	   返回字段。目前支持dispute_id, bizorder_id, modified, status     */
	Fields *[]string `json:"fields" required:"true" `
}

func (s *TmallExchangeRefuseRequest) SetLeaveMessagePics(v []byte) *TmallExchangeRefuseRequest {
	s.LeaveMessagePics = &v
	return s
}
func (s *TmallExchangeRefuseRequest) SetLeaveMessage(v string) *TmallExchangeRefuseRequest {
	s.LeaveMessage = &v
	return s
}
func (s *TmallExchangeRefuseRequest) SetDisputeId(v int64) *TmallExchangeRefuseRequest {
	s.DisputeId = &v
	return s
}
func (s *TmallExchangeRefuseRequest) SetSellerRefuseReasonId(v int64) *TmallExchangeRefuseRequest {
	s.SellerRefuseReasonId = &v
	return s
}
func (s *TmallExchangeRefuseRequest) SetFields(v []string) *TmallExchangeRefuseRequest {
	s.Fields = &v
	return s
}

func (req *TmallExchangeRefuseRequest) ToMap() map[string]interface{} {
	paramMap := make(map[string]interface{})
	if req.LeaveMessage != nil {
		paramMap["leave_message"] = *req.LeaveMessage
	}
	if req.DisputeId != nil {
		paramMap["dispute_id"] = *req.DisputeId
	}
	if req.SellerRefuseReasonId != nil {
		paramMap["seller_refuse_reason_id"] = *req.SellerRefuseReasonId
	}
	if req.Fields != nil {
		paramMap["fields"] = util.ConvertBasicList(*req.Fields)
	}
	return paramMap
}

func (req *TmallExchangeRefuseRequest) ToFileMap() map[string]interface{} {
	fileMap := make(map[string]interface{})
	if req.LeaveMessagePics != nil {
		fileMap["leave_message_pics"] = *req.LeaveMessagePics
	}
	return fileMap
}
