package request

import (
	"topsdk/util"
)

type TmallExchangeAgreeRequest struct {
	/*
	   邮政编码     */
	Post *string `json:"post,omitempty" required:"false" `
	/*
	   上传图片举证     */
	LeaveMessagePics *[]byte `json:"leave_message_pics,omitempty" required:"false" `
	/*
	   卖家留言     */
	LeaveMessage *string `json:"leave_message,omitempty" required:"false" `
	/*
	   收货地址id，如需获取请调用该top接口：taobao.logistics.address.search，对应属性为contact_id     */
	AddressId *int64 `json:"address_id" required:"true" `
	/*
	   详细收货地址     */
	CompleteAddress *string `json:"complete_address,omitempty" required:"false" `
	/*
	   换货单号ID     */
	DisputeId *int64 `json:"dispute_id" required:"true" `
	/*
	   返回字段。当前支持的有 dispute_id, bizorder_id, modified, status     */
	Fields *[]string `json:"fields" required:"true" `
	/*
	   收货人手机号     */
	Mobile *string `json:"mobile,omitempty" required:"false" `
}

func (s *TmallExchangeAgreeRequest) SetPost(v string) *TmallExchangeAgreeRequest {
	s.Post = &v
	return s
}
func (s *TmallExchangeAgreeRequest) SetLeaveMessagePics(v []byte) *TmallExchangeAgreeRequest {
	s.LeaveMessagePics = &v
	return s
}
func (s *TmallExchangeAgreeRequest) SetLeaveMessage(v string) *TmallExchangeAgreeRequest {
	s.LeaveMessage = &v
	return s
}
func (s *TmallExchangeAgreeRequest) SetAddressId(v int64) *TmallExchangeAgreeRequest {
	s.AddressId = &v
	return s
}
func (s *TmallExchangeAgreeRequest) SetCompleteAddress(v string) *TmallExchangeAgreeRequest {
	s.CompleteAddress = &v
	return s
}
func (s *TmallExchangeAgreeRequest) SetDisputeId(v int64) *TmallExchangeAgreeRequest {
	s.DisputeId = &v
	return s
}
func (s *TmallExchangeAgreeRequest) SetFields(v []string) *TmallExchangeAgreeRequest {
	s.Fields = &v
	return s
}
func (s *TmallExchangeAgreeRequest) SetMobile(v string) *TmallExchangeAgreeRequest {
	s.Mobile = &v
	return s
}

func (req *TmallExchangeAgreeRequest) ToMap() map[string]interface{} {
	paramMap := make(map[string]interface{})
	if req.Post != nil {
		paramMap["post"] = *req.Post
	}
	if req.LeaveMessage != nil {
		paramMap["leave_message"] = *req.LeaveMessage
	}
	if req.AddressId != nil {
		paramMap["address_id"] = *req.AddressId
	}
	if req.CompleteAddress != nil {
		paramMap["complete_address"] = *req.CompleteAddress
	}
	if req.DisputeId != nil {
		paramMap["dispute_id"] = *req.DisputeId
	}
	if req.Fields != nil {
		paramMap["fields"] = util.ConvertBasicList(*req.Fields)
	}
	if req.Mobile != nil {
		paramMap["mobile"] = *req.Mobile
	}
	return paramMap
}

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