package request

import (
	"topsdk/util"
)

type TmallExchangeMessageAddRequest struct {
	/*
	   留言内容     */
	Content *string `json:"content" required:"true" `
	/*
	   换货单号ID     */
	DisputeId *int64 `json:"dispute_id" required:"true" `
	/*
	   凭证图片列表     */
	MessagePics *[]byte `json:"message_pics,omitempty" required:"false" `
	/*
	   返回字段。目前支持id,refund_id,owner_id,owner_nick,owner_role,content,pic_urls,created,message_type     */
	Fields *[]string `json:"fields" required:"true" `
}

func (s *TmallExchangeMessageAddRequest) SetContent(v string) *TmallExchangeMessageAddRequest {
	s.Content = &v
	return s
}
func (s *TmallExchangeMessageAddRequest) SetDisputeId(v int64) *TmallExchangeMessageAddRequest {
	s.DisputeId = &v
	return s
}
func (s *TmallExchangeMessageAddRequest) SetMessagePics(v []byte) *TmallExchangeMessageAddRequest {
	s.MessagePics = &v
	return s
}
func (s *TmallExchangeMessageAddRequest) SetFields(v []string) *TmallExchangeMessageAddRequest {
	s.Fields = &v
	return s
}

func (req *TmallExchangeMessageAddRequest) ToMap() map[string]interface{} {
	paramMap := make(map[string]interface{})
	if req.Content != nil {
		paramMap["content"] = *req.Content
	}
	if req.DisputeId != nil {
		paramMap["dispute_id"] = *req.DisputeId
	}
	if req.Fields != nil {
		paramMap["fields"] = util.ConvertBasicList(*req.Fields)
	}
	return paramMap
}

func (req *TmallExchangeMessageAddRequest) ToFileMap() map[string]interface{} {
	fileMap := make(map[string]interface{})
	if req.MessagePics != nil {
		fileMap["message_pics"] = *req.MessagePics
	}
	return fileMap
}
