// Autogenerated by Thrift Compiler (0.9.2)
// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING

package CarreraProducer

import (
	"bytes"
	"fmt"
	"go.intra.xiaojukeji.com/golang/thrift-lib/0.9.2"
)

// (needed to ensure safety because of naive import list construction.)
var _ = thrift.ZERO
var _ = fmt.Printf
var _ = bytes.Equal

var GoUnusedProtection__ int

type Result struct {
	Code int32   `thrift:"code,1" json:"code"`
	Msg  string  `thrift:"msg,2" json:"msg"`
	Key  *string `thrift:"key,3" json:"key"`
}

func NewResult() *Result {
	return &Result{}
}

func (p *Result) GetCode() int32 {
	return p.Code
}

func (p *Result) GetMsg() string {
	return p.Msg
}

var Result_Key_DEFAULT string

func (p *Result) GetKey() string {
	if !p.IsSetKey() {
		return Result_Key_DEFAULT
	}
	return *p.Key
}
func (p *Result) IsSetKey() bool {
	return p.Key != nil
}

func (p *Result) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return fmt.Errorf("%T read error: %s", p, err)
	}
	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return fmt.Errorf("%T field %d read error: %s", p, fieldId, err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.ReadField1(iprot); err != nil {
				return err
			}
		case 2:
			if err := p.ReadField2(iprot); err != nil {
				return err
			}
		case 3:
			if err := p.ReadField3(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return fmt.Errorf("%T read struct end error: %s", p, err)
	}
	return nil
}

func (p *Result) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return fmt.Errorf("error reading field 1: %s", err)
	} else {
		p.Code = v
	}
	return nil
}

func (p *Result) ReadField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return fmt.Errorf("error reading field 2: %s", err)
	} else {
		p.Msg = v
	}
	return nil
}

func (p *Result) ReadField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return fmt.Errorf("error reading field 3: %s", err)
	} else {
		p.Key = &v
	}
	return nil
}

func (p *Result) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("Result"); err != nil {
		return fmt.Errorf("%T write struct begin error: %s", p, err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := p.writeField2(oprot); err != nil {
		return err
	}
	if err := p.writeField3(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return fmt.Errorf("write field stop error: %s", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return fmt.Errorf("write struct stop error: %s", err)
	}
	return nil
}

func (p *Result) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("code", thrift.I32, 1); err != nil {
		return fmt.Errorf("%T write field begin error 1:code: %s", p, err)
	}
	if err := oprot.WriteI32(int32(p.Code)); err != nil {
		return fmt.Errorf("%T.code (1) field write error: %s", p, err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 1:code: %s", p, err)
	}
	return err
}

func (p *Result) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("msg", thrift.STRING, 2); err != nil {
		return fmt.Errorf("%T write field begin error 2:msg: %s", p, err)
	}
	if err := oprot.WriteString(string(p.Msg)); err != nil {
		return fmt.Errorf("%T.msg (2) field write error: %s", p, err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 2:msg: %s", p, err)
	}
	return err
}

func (p *Result) writeField3(oprot thrift.TProtocol) (err error) {
	if p.IsSetKey() {
		if err := oprot.WriteFieldBegin("key", thrift.STRING, 3); err != nil {
			return fmt.Errorf("%T write field begin error 3:key: %s", p, err)
		}
		if err := oprot.WriteString(string(*p.Key)); err != nil {
			return fmt.Errorf("%T.key (3) field write error: %s", p, err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return fmt.Errorf("%T write field end error 3:key: %s", p, err)
		}
	}
	return err
}

func (p *Result) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("Result({Code:%v Msg:%v Key:%v})", p.Code, p.Msg, *p.Key)
}

type RestMessage struct {
	TypeA1    int8              `thrift:"type,1" json:"type"`
	Mode      int8              `thrift:"mode,2" json:"mode"`
	Url       string            `thrift:"url,3" json:"url"`
	Params    map[string]string `thrift:"params,4" json:"params"`
	Headers   map[string]string `thrift:"headers,5" json:"headers"`
	Timestamp int64             `thrift:"timestamp,6" json:"timestamp"`
	Expire    int64             `thrift:"expire,7" json:"expire"`
	Timeout   int64             `thrift:"timeout,8" json:"timeout"`
	RetryCnt  int32             `thrift:"retryCnt,9" json:"retryCnt"`
}

func NewRestMessage() *RestMessage {
	return &RestMessage{
		TypeA1: 1,

		Mode: 1,

		RetryCnt: 3,
	}
}

func (p *RestMessage) GetTypeA1() int8 {
	return p.TypeA1
}

func (p *RestMessage) GetMode() int8 {
	return p.Mode
}

func (p *RestMessage) GetUrl() string {
	return p.Url
}

func (p *RestMessage) GetParams() map[string]string {
	return p.Params
}

func (p *RestMessage) GetHeaders() map[string]string {
	return p.Headers
}

func (p *RestMessage) GetTimestamp() int64 {
	return p.Timestamp
}

func (p *RestMessage) GetExpire() int64 {
	return p.Expire
}

func (p *RestMessage) GetTimeout() int64 {
	return p.Timeout
}

func (p *RestMessage) GetRetryCnt() int32 {
	return p.RetryCnt
}
func (p *RestMessage) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return fmt.Errorf("%T read error: %s", p, err)
	}
	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return fmt.Errorf("%T field %d read error: %s", p, fieldId, err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.ReadField1(iprot); err != nil {
				return err
			}
		case 2:
			if err := p.ReadField2(iprot); err != nil {
				return err
			}
		case 3:
			if err := p.ReadField3(iprot); err != nil {
				return err
			}
		case 4:
			if err := p.ReadField4(iprot); err != nil {
				return err
			}
		case 5:
			if err := p.ReadField5(iprot); err != nil {
				return err
			}
		case 6:
			if err := p.ReadField6(iprot); err != nil {
				return err
			}
		case 7:
			if err := p.ReadField7(iprot); err != nil {
				return err
			}
		case 8:
			if err := p.ReadField8(iprot); err != nil {
				return err
			}
		case 9:
			if err := p.ReadField9(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return fmt.Errorf("%T read struct end error: %s", p, err)
	}
	return nil
}

func (p *RestMessage) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadByte(); err != nil {
		return fmt.Errorf("error reading field 1: %s", err)
	} else {
		temp := int8(v)
		p.TypeA1 = temp
	}
	return nil
}

func (p *RestMessage) ReadField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadByte(); err != nil {
		return fmt.Errorf("error reading field 2: %s", err)
	} else {
		temp := int8(v)
		p.Mode = temp
	}
	return nil
}

func (p *RestMessage) ReadField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return fmt.Errorf("error reading field 3: %s", err)
	} else {
		p.Url = v
	}
	return nil
}

func (p *RestMessage) ReadField4(iprot thrift.TProtocol) error {
	_, _, size, err := iprot.ReadMapBegin()
	if err != nil {
		return fmt.Errorf("error reading map begin: %s", err)
	}
	tMap := make(map[string]string, size)
	p.Params = tMap
	for i := 0; i < size; i++ {
		var _key0 string
		if v, err := iprot.ReadString(); err != nil {
			return fmt.Errorf("error reading field 0: %s", err)
		} else {
			_key0 = v
		}
		var _val1 string
		if v, err := iprot.ReadString(); err != nil {
			return fmt.Errorf("error reading field 0: %s", err)
		} else {
			_val1 = v
		}
		p.Params[_key0] = _val1
	}
	if err := iprot.ReadMapEnd(); err != nil {
		return fmt.Errorf("error reading map end: %s", err)
	}
	return nil
}

func (p *RestMessage) ReadField5(iprot thrift.TProtocol) error {
	_, _, size, err := iprot.ReadMapBegin()
	if err != nil {
		return fmt.Errorf("error reading map begin: %s", err)
	}
	tMap := make(map[string]string, size)
	p.Headers = tMap
	for i := 0; i < size; i++ {
		var _key2 string
		if v, err := iprot.ReadString(); err != nil {
			return fmt.Errorf("error reading field 0: %s", err)
		} else {
			_key2 = v
		}
		var _val3 string
		if v, err := iprot.ReadString(); err != nil {
			return fmt.Errorf("error reading field 0: %s", err)
		} else {
			_val3 = v
		}
		p.Headers[_key2] = _val3
	}
	if err := iprot.ReadMapEnd(); err != nil {
		return fmt.Errorf("error reading map end: %s", err)
	}
	return nil
}

func (p *RestMessage) ReadField6(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI64(); err != nil {
		return fmt.Errorf("error reading field 6: %s", err)
	} else {
		p.Timestamp = v
	}
	return nil
}

func (p *RestMessage) ReadField7(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI64(); err != nil {
		return fmt.Errorf("error reading field 7: %s", err)
	} else {
		p.Expire = v
	}
	return nil
}

func (p *RestMessage) ReadField8(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI64(); err != nil {
		return fmt.Errorf("error reading field 8: %s", err)
	} else {
		p.Timeout = v
	}
	return nil
}

func (p *RestMessage) ReadField9(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return fmt.Errorf("error reading field 9: %s", err)
	} else {
		p.RetryCnt = v
	}
	return nil
}

func (p *RestMessage) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("RestMessage"); err != nil {
		return fmt.Errorf("%T write struct begin error: %s", p, err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := p.writeField2(oprot); err != nil {
		return err
	}
	if err := p.writeField3(oprot); err != nil {
		return err
	}
	if err := p.writeField4(oprot); err != nil {
		return err
	}
	if err := p.writeField5(oprot); err != nil {
		return err
	}
	if err := p.writeField6(oprot); err != nil {
		return err
	}
	if err := p.writeField7(oprot); err != nil {
		return err
	}
	if err := p.writeField8(oprot); err != nil {
		return err
	}
	if err := p.writeField9(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return fmt.Errorf("write field stop error: %s", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return fmt.Errorf("write struct stop error: %s", err)
	}
	return nil
}

func (p *RestMessage) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("type", thrift.BYTE, 1); err != nil {
		return fmt.Errorf("%T write field begin error 1:type: %s", p, err)
	}
	if err := oprot.WriteByte(byte(p.TypeA1)); err != nil {
		return fmt.Errorf("%T.type (1) field write error: %s", p, err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 1:type: %s", p, err)
	}
	return err
}

func (p *RestMessage) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("mode", thrift.BYTE, 2); err != nil {
		return fmt.Errorf("%T write field begin error 2:mode: %s", p, err)
	}
	if err := oprot.WriteByte(byte(p.Mode)); err != nil {
		return fmt.Errorf("%T.mode (2) field write error: %s", p, err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 2:mode: %s", p, err)
	}
	return err
}

func (p *RestMessage) writeField3(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("url", thrift.STRING, 3); err != nil {
		return fmt.Errorf("%T write field begin error 3:url: %s", p, err)
	}
	if err := oprot.WriteString(string(p.Url)); err != nil {
		return fmt.Errorf("%T.url (3) field write error: %s", p, err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 3:url: %s", p, err)
	}
	return err
}

func (p *RestMessage) writeField4(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("params", thrift.MAP, 4); err != nil {
		return fmt.Errorf("%T write field begin error 4:params: %s", p, err)
	}
	if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.Params)); err != nil {
		return fmt.Errorf("error writing map begin: %s", err)
	}
	for k, v := range p.Params {
		if err := oprot.WriteString(string(k)); err != nil {
			return fmt.Errorf("%T. (0) field write error: %s", p, err)
		}
		if err := oprot.WriteString(string(v)); err != nil {
			return fmt.Errorf("%T. (0) field write error: %s", p, err)
		}
	}
	if err := oprot.WriteMapEnd(); err != nil {
		return fmt.Errorf("error writing map end: %s", err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 4:params: %s", p, err)
	}
	return err
}

func (p *RestMessage) writeField5(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("headers", thrift.MAP, 5); err != nil {
		return fmt.Errorf("%T write field begin error 5:headers: %s", p, err)
	}
	if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.Headers)); err != nil {
		return fmt.Errorf("error writing map begin: %s", err)
	}
	for k, v := range p.Headers {
		if err := oprot.WriteString(string(k)); err != nil {
			return fmt.Errorf("%T. (0) field write error: %s", p, err)
		}
		if err := oprot.WriteString(string(v)); err != nil {
			return fmt.Errorf("%T. (0) field write error: %s", p, err)
		}
	}
	if err := oprot.WriteMapEnd(); err != nil {
		return fmt.Errorf("error writing map end: %s", err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 5:headers: %s", p, err)
	}
	return err
}

func (p *RestMessage) writeField6(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("timestamp", thrift.I64, 6); err != nil {
		return fmt.Errorf("%T write field begin error 6:timestamp: %s", p, err)
	}
	if err := oprot.WriteI64(int64(p.Timestamp)); err != nil {
		return fmt.Errorf("%T.timestamp (6) field write error: %s", p, err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 6:timestamp: %s", p, err)
	}
	return err
}

func (p *RestMessage) writeField7(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("expire", thrift.I64, 7); err != nil {
		return fmt.Errorf("%T write field begin error 7:expire: %s", p, err)
	}
	if err := oprot.WriteI64(int64(p.Expire)); err != nil {
		return fmt.Errorf("%T.expire (7) field write error: %s", p, err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 7:expire: %s", p, err)
	}
	return err
}

func (p *RestMessage) writeField8(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("timeout", thrift.I64, 8); err != nil {
		return fmt.Errorf("%T write field begin error 8:timeout: %s", p, err)
	}
	if err := oprot.WriteI64(int64(p.Timeout)); err != nil {
		return fmt.Errorf("%T.timeout (8) field write error: %s", p, err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 8:timeout: %s", p, err)
	}
	return err
}

func (p *RestMessage) writeField9(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("retryCnt", thrift.I32, 9); err != nil {
		return fmt.Errorf("%T write field begin error 9:retryCnt: %s", p, err)
	}
	if err := oprot.WriteI32(int32(p.RetryCnt)); err != nil {
		return fmt.Errorf("%T.retryCnt (9) field write error: %s", p, err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 9:retryCnt: %s", p, err)
	}
	return err
}

func (p *RestMessage) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("RestMessage(%+v)", *p)
}

type Message struct {
	Topic       string            `thrift:"topic,1" json:"topic"`
	Key         string            `thrift:"key,2" json:"key"`
	Value       string            `thrift:"value,3" json:"value"`
	HashId      int64             `thrift:"hashId,4" json:"hashId"`
	Tags        string            `thrift:"tags,5" json:"tags"`
	PartitionId int32             `thrift:"partitionId,6" json:"partitionId"`
	Body        []byte            `thrift:"body,7" json:"body"`
	Version     *string           `thrift:"version,8" json:"version"`
	Properties  map[string]string `thrift:"properties,9" json:"properties"`
}

func NewMessage() *Message {
	return &Message{
		PartitionId: -1,
	}
}

func (p *Message) GetTopic() string {
	return p.Topic
}

func (p *Message) GetKey() string {
	return p.Key
}

func (p *Message) GetValue() string {
	return p.Value
}

func (p *Message) GetHashId() int64 {
	return p.HashId
}

func (p *Message) GetTags() string {
	return p.Tags
}

func (p *Message) GetPartitionId() int32 {
	return p.PartitionId
}

var Message_Body_DEFAULT []byte

func (p *Message) GetBody() []byte {
	return p.Body
}

var Message_Version_DEFAULT string

func (p *Message) GetVersion() string {
	if !p.IsSetVersion() {
		return Message_Version_DEFAULT
	}
	return *p.Version
}

var Message_Properties_DEFAULT map[string]string

func (p *Message) GetProperties() map[string]string {
	return p.Properties
}
func (p *Message) IsSetBody() bool {
	return p.Body != nil
}

func (p *Message) IsSetVersion() bool {
	return p.Version != nil
}

func (p *Message) IsSetProperties() bool {
	return p.Properties != nil
}

func (p *Message) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return fmt.Errorf("%T read error: %s", p, err)
	}
	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return fmt.Errorf("%T field %d read error: %s", p, fieldId, err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.ReadField1(iprot); err != nil {
				return err
			}
		case 2:
			if err := p.ReadField2(iprot); err != nil {
				return err
			}
		case 3:
			if err := p.ReadField3(iprot); err != nil {
				return err
			}
		case 4:
			if err := p.ReadField4(iprot); err != nil {
				return err
			}
		case 5:
			if err := p.ReadField5(iprot); err != nil {
				return err
			}
		case 6:
			if err := p.ReadField6(iprot); err != nil {
				return err
			}
		case 7:
			if err := p.ReadField7(iprot); err != nil {
				return err
			}
		case 8:
			if err := p.ReadField8(iprot); err != nil {
				return err
			}
		case 9:
			if err := p.ReadField9(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return fmt.Errorf("%T read struct end error: %s", p, err)
	}
	return nil
}

func (p *Message) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return fmt.Errorf("error reading field 1: %s", err)
	} else {
		p.Topic = v
	}
	return nil
}

func (p *Message) ReadField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return fmt.Errorf("error reading field 2: %s", err)
	} else {
		p.Key = v
	}
	return nil
}

func (p *Message) ReadField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return fmt.Errorf("error reading field 3: %s", err)
	} else {
		p.Value = v
	}
	return nil
}

func (p *Message) ReadField4(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI64(); err != nil {
		return fmt.Errorf("error reading field 4: %s", err)
	} else {
		p.HashId = v
	}
	return nil
}

func (p *Message) ReadField5(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return fmt.Errorf("error reading field 5: %s", err)
	} else {
		p.Tags = v
	}
	return nil
}

func (p *Message) ReadField6(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return fmt.Errorf("error reading field 6: %s", err)
	} else {
		p.PartitionId = v
	}
	return nil
}

func (p *Message) ReadField7(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadBinary(); err != nil {
		return fmt.Errorf("error reading field 7: %s", err)
	} else {
		p.Body = v
	}
	return nil
}

func (p *Message) ReadField8(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return fmt.Errorf("error reading field 8: %s", err)
	} else {
		p.Version = &v
	}
	return nil
}

func (p *Message) ReadField9(iprot thrift.TProtocol) error {
	_, _, size, err := iprot.ReadMapBegin()
	if err != nil {
		return fmt.Errorf("error reading map begin: %s", err)
	}
	tMap := make(map[string]string, size)
	p.Properties = tMap
	for i := 0; i < size; i++ {
		var _key4 string
		if v, err := iprot.ReadString(); err != nil {
			return fmt.Errorf("error reading field 0: %s", err)
		} else {
			_key4 = v
		}
		var _val5 string
		if v, err := iprot.ReadString(); err != nil {
			return fmt.Errorf("error reading field 0: %s", err)
		} else {
			_val5 = v
		}
		p.Properties[_key4] = _val5
	}
	if err := iprot.ReadMapEnd(); err != nil {
		return fmt.Errorf("error reading map end: %s", err)
	}
	return nil
}

func (p *Message) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("Message"); err != nil {
		return fmt.Errorf("%T write struct begin error: %s", p, err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := p.writeField2(oprot); err != nil {
		return err
	}
	if err := p.writeField3(oprot); err != nil {
		return err
	}
	if err := p.writeField4(oprot); err != nil {
		return err
	}
	if err := p.writeField5(oprot); err != nil {
		return err
	}
	if err := p.writeField6(oprot); err != nil {
		return err
	}
	if err := p.writeField7(oprot); err != nil {
		return err
	}
	if err := p.writeField8(oprot); err != nil {
		return err
	}
	if err := p.writeField9(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return fmt.Errorf("write field stop error: %s", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return fmt.Errorf("write struct stop error: %s", err)
	}
	return nil
}

func (p *Message) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("topic", thrift.STRING, 1); err != nil {
		return fmt.Errorf("%T write field begin error 1:topic: %s", p, err)
	}
	if err := oprot.WriteString(string(p.Topic)); err != nil {
		return fmt.Errorf("%T.topic (1) field write error: %s", p, err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 1:topic: %s", p, err)
	}
	return err
}

func (p *Message) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("key", thrift.STRING, 2); err != nil {
		return fmt.Errorf("%T write field begin error 2:key: %s", p, err)
	}
	if err := oprot.WriteString(string(p.Key)); err != nil {
		return fmt.Errorf("%T.key (2) field write error: %s", p, err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 2:key: %s", p, err)
	}
	return err
}

func (p *Message) writeField3(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("value", thrift.STRING, 3); err != nil {
		return fmt.Errorf("%T write field begin error 3:value: %s", p, err)
	}
	if err := oprot.WriteString(string(p.Value)); err != nil {
		return fmt.Errorf("%T.value (3) field write error: %s", p, err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 3:value: %s", p, err)
	}
	return err
}

func (p *Message) writeField4(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("hashId", thrift.I64, 4); err != nil {
		return fmt.Errorf("%T write field begin error 4:hashId: %s", p, err)
	}
	if err := oprot.WriteI64(int64(p.HashId)); err != nil {
		return fmt.Errorf("%T.hashId (4) field write error: %s", p, err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 4:hashId: %s", p, err)
	}
	return err
}

func (p *Message) writeField5(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("tags", thrift.STRING, 5); err != nil {
		return fmt.Errorf("%T write field begin error 5:tags: %s", p, err)
	}
	if err := oprot.WriteString(string(p.Tags)); err != nil {
		return fmt.Errorf("%T.tags (5) field write error: %s", p, err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 5:tags: %s", p, err)
	}
	return err
}

func (p *Message) writeField6(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("partitionId", thrift.I32, 6); err != nil {
		return fmt.Errorf("%T write field begin error 6:partitionId: %s", p, err)
	}
	if err := oprot.WriteI32(int32(p.PartitionId)); err != nil {
		return fmt.Errorf("%T.partitionId (6) field write error: %s", p, err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 6:partitionId: %s", p, err)
	}
	return err
}

func (p *Message) writeField7(oprot thrift.TProtocol) (err error) {
	if p.IsSetBody() {
		if err := oprot.WriteFieldBegin("body", thrift.STRING, 7); err != nil {
			return fmt.Errorf("%T write field begin error 7:body: %s", p, err)
		}
		if err := oprot.WriteBinary(p.Body); err != nil {
			return fmt.Errorf("%T.body (7) field write error: %s", p, err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return fmt.Errorf("%T write field end error 7:body: %s", p, err)
		}
	}
	return err
}

func (p *Message) writeField8(oprot thrift.TProtocol) (err error) {
	if p.IsSetVersion() {
		if err := oprot.WriteFieldBegin("version", thrift.STRING, 8); err != nil {
			return fmt.Errorf("%T write field begin error 8:version: %s", p, err)
		}
		if err := oprot.WriteString(string(*p.Version)); err != nil {
			return fmt.Errorf("%T.version (8) field write error: %s", p, err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return fmt.Errorf("%T write field end error 8:version: %s", p, err)
		}
	}
	return err
}

func (p *Message) writeField9(oprot thrift.TProtocol) (err error) {
	if p.IsSetProperties() {
		if err := oprot.WriteFieldBegin("properties", thrift.MAP, 9); err != nil {
			return fmt.Errorf("%T write field begin error 9:properties: %s", p, err)
		}
		if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.Properties)); err != nil {
			return fmt.Errorf("error writing map begin: %s", err)
		}
		for k, v := range p.Properties {
			if err := oprot.WriteString(string(k)); err != nil {
				return fmt.Errorf("%T. (0) field write error: %s", p, err)
			}
			if err := oprot.WriteString(string(v)); err != nil {
				return fmt.Errorf("%T. (0) field write error: %s", p, err)
			}
		}
		if err := oprot.WriteMapEnd(); err != nil {
			return fmt.Errorf("error writing map end: %s", err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return fmt.Errorf("%T write field end error 9:properties: %s", p, err)
		}
	}
	return err
}

func (p *Message) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("Message(%+v)", *p)
}

type DelayResult struct {
	Code           int32  `thrift:"code,1" json:"code"`
	Msg            string `thrift:"msg,2" json:"msg"`
	UniqDelayMsgId string `thrift:"uniqDelayMsgId,3" json:"uniqDelayMsgId"`
}

func NewDelayResult() *DelayResult {
	return &DelayResult{}
}

func (p *DelayResult) GetCode() int32 {
	return p.Code
}

func (p *DelayResult) GetMsg() string {
	return p.Msg
}

func (p *DelayResult) GetUniqDelayMsgId() string {
	return p.UniqDelayMsgId
}
func (p *DelayResult) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return fmt.Errorf("%T read error: %s", p, err)
	}
	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return fmt.Errorf("%T field %d read error: %s", p, fieldId, err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.ReadField1(iprot); err != nil {
				return err
			}
		case 2:
			if err := p.ReadField2(iprot); err != nil {
				return err
			}
		case 3:
			if err := p.ReadField3(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return fmt.Errorf("%T read struct end error: %s", p, err)
	}
	return nil
}

func (p *DelayResult) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return fmt.Errorf("error reading field 1: %s", err)
	} else {
		p.Code = v
	}
	return nil
}

func (p *DelayResult) ReadField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return fmt.Errorf("error reading field 2: %s", err)
	} else {
		p.Msg = v
	}
	return nil
}

func (p *DelayResult) ReadField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return fmt.Errorf("error reading field 3: %s", err)
	} else {
		p.UniqDelayMsgId = v
	}
	return nil
}

func (p *DelayResult) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("DelayResult"); err != nil {
		return fmt.Errorf("%T write struct begin error: %s", p, err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := p.writeField2(oprot); err != nil {
		return err
	}
	if err := p.writeField3(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return fmt.Errorf("write field stop error: %s", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return fmt.Errorf("write struct stop error: %s", err)
	}
	return nil
}

func (p *DelayResult) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("code", thrift.I32, 1); err != nil {
		return fmt.Errorf("%T write field begin error 1:code: %s", p, err)
	}
	if err := oprot.WriteI32(int32(p.Code)); err != nil {
		return fmt.Errorf("%T.code (1) field write error: %s", p, err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 1:code: %s", p, err)
	}
	return err
}

func (p *DelayResult) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("msg", thrift.STRING, 2); err != nil {
		return fmt.Errorf("%T write field begin error 2:msg: %s", p, err)
	}
	if err := oprot.WriteString(string(p.Msg)); err != nil {
		return fmt.Errorf("%T.msg (2) field write error: %s", p, err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 2:msg: %s", p, err)
	}
	return err
}

func (p *DelayResult) writeField3(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("uniqDelayMsgId", thrift.STRING, 3); err != nil {
		return fmt.Errorf("%T write field begin error 3:uniqDelayMsgId: %s", p, err)
	}
	if err := oprot.WriteString(string(p.UniqDelayMsgId)); err != nil {
		return fmt.Errorf("%T.uniqDelayMsgId (3) field write error: %s", p, err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 3:uniqDelayMsgId: %s", p, err)
	}
	return err
}

func (p *DelayResult) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("DelayResult(%+v)", *p)
}

type DelayMessage struct {
	Topic          string  `thrift:"topic,1" json:"topic"`
	UniqDelayMsgId *string `thrift:"uniqDelayMsgId,2" json:"uniqDelayMsgId"`
	Body           []byte  `thrift:"body,3" json:"body"`
	Tags           string  `thrift:"tags,4" json:"tags"`
	Action         int32   `thrift:"action,5" json:"action"`
	Timestamp      *int64  `thrift:"timestamp,6" json:"timestamp"`
	Dmsgtype       *int32  `thrift:"dmsgtype,7" json:"dmsgtype"`
	Interval       *int64  `thrift:"interval,8" json:"interval"`
	Expire         *int64  `thrift:"expire,9" json:"expire"`
	Times          *int64  `thrift:"times,10" json:"times"`
	Uuid           *string `thrift:"uuid,11" json:"uuid"`
	// unused field # 12
	Version    *string           `thrift:"version,13" json:"version"`
	Properties map[string]string `thrift:"properties,14" json:"properties"`
}

func NewDelayMessage() *DelayMessage {
	return &DelayMessage{}
}

func (p *DelayMessage) GetTopic() string {
	return p.Topic
}

var DelayMessage_UniqDelayMsgId_DEFAULT string

func (p *DelayMessage) GetUniqDelayMsgId() string {
	if !p.IsSetUniqDelayMsgId() {
		return DelayMessage_UniqDelayMsgId_DEFAULT
	}
	return *p.UniqDelayMsgId
}

var DelayMessage_Body_DEFAULT []byte

func (p *DelayMessage) GetBody() []byte {
	return p.Body
}

func (p *DelayMessage) GetTags() string {
	return p.Tags
}

func (p *DelayMessage) GetAction() int32 {
	return p.Action
}

var DelayMessage_Timestamp_DEFAULT int64

func (p *DelayMessage) GetTimestamp() int64 {
	if !p.IsSetTimestamp() {
		return DelayMessage_Timestamp_DEFAULT
	}
	return *p.Timestamp
}

var DelayMessage_Dmsgtype_DEFAULT int32

func (p *DelayMessage) GetDmsgtype() int32 {
	if !p.IsSetDmsgtype() {
		return DelayMessage_Dmsgtype_DEFAULT
	}
	return *p.Dmsgtype
}

var DelayMessage_Interval_DEFAULT int64

func (p *DelayMessage) GetInterval() int64 {
	if !p.IsSetInterval() {
		return DelayMessage_Interval_DEFAULT
	}
	return *p.Interval
}

var DelayMessage_Expire_DEFAULT int64

func (p *DelayMessage) GetExpire() int64 {
	if !p.IsSetExpire() {
		return DelayMessage_Expire_DEFAULT
	}
	return *p.Expire
}

var DelayMessage_Times_DEFAULT int64

func (p *DelayMessage) GetTimes() int64 {
	if !p.IsSetTimes() {
		return DelayMessage_Times_DEFAULT
	}
	return *p.Times
}

var DelayMessage_Uuid_DEFAULT string

func (p *DelayMessage) GetUuid() string {
	if !p.IsSetUuid() {
		return DelayMessage_Uuid_DEFAULT
	}
	return *p.Uuid
}

var DelayMessage_Version_DEFAULT string

func (p *DelayMessage) GetVersion() string {
	if !p.IsSetVersion() {
		return DelayMessage_Version_DEFAULT
	}
	return *p.Version
}

var DelayMessage_Properties_DEFAULT map[string]string

func (p *DelayMessage) GetProperties() map[string]string {
	return p.Properties
}
func (p *DelayMessage) IsSetUniqDelayMsgId() bool {
	return p.UniqDelayMsgId != nil
}

func (p *DelayMessage) IsSetBody() bool {
	return p.Body != nil
}

func (p *DelayMessage) IsSetTimestamp() bool {
	return p.Timestamp != nil
}

func (p *DelayMessage) IsSetDmsgtype() bool {
	return p.Dmsgtype != nil
}

func (p *DelayMessage) IsSetInterval() bool {
	return p.Interval != nil
}

func (p *DelayMessage) IsSetExpire() bool {
	return p.Expire != nil
}

func (p *DelayMessage) IsSetTimes() bool {
	return p.Times != nil
}

func (p *DelayMessage) IsSetUuid() bool {
	return p.Uuid != nil
}

func (p *DelayMessage) IsSetVersion() bool {
	return p.Version != nil
}

func (p *DelayMessage) IsSetProperties() bool {
	return p.Properties != nil
}

func (p *DelayMessage) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return fmt.Errorf("%T read error: %s", p, err)
	}
	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return fmt.Errorf("%T field %d read error: %s", p, fieldId, err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.ReadField1(iprot); err != nil {
				return err
			}
		case 2:
			if err := p.ReadField2(iprot); err != nil {
				return err
			}
		case 3:
			if err := p.ReadField3(iprot); err != nil {
				return err
			}
		case 4:
			if err := p.ReadField4(iprot); err != nil {
				return err
			}
		case 5:
			if err := p.ReadField5(iprot); err != nil {
				return err
			}
		case 6:
			if err := p.ReadField6(iprot); err != nil {
				return err
			}
		case 7:
			if err := p.ReadField7(iprot); err != nil {
				return err
			}
		case 8:
			if err := p.ReadField8(iprot); err != nil {
				return err
			}
		case 9:
			if err := p.ReadField9(iprot); err != nil {
				return err
			}
		case 10:
			if err := p.ReadField10(iprot); err != nil {
				return err
			}
		case 11:
			if err := p.ReadField11(iprot); err != nil {
				return err
			}
		case 13:
			if err := p.ReadField13(iprot); err != nil {
				return err
			}
		case 14:
			if err := p.ReadField14(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return fmt.Errorf("%T read struct end error: %s", p, err)
	}
	return nil
}

func (p *DelayMessage) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return fmt.Errorf("error reading field 1: %s", err)
	} else {
		p.Topic = v
	}
	return nil
}

func (p *DelayMessage) ReadField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return fmt.Errorf("error reading field 2: %s", err)
	} else {
		p.UniqDelayMsgId = &v
	}
	return nil
}

func (p *DelayMessage) ReadField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadBinary(); err != nil {
		return fmt.Errorf("error reading field 3: %s", err)
	} else {
		p.Body = v
	}
	return nil
}

func (p *DelayMessage) ReadField4(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return fmt.Errorf("error reading field 4: %s", err)
	} else {
		p.Tags = v
	}
	return nil
}

func (p *DelayMessage) ReadField5(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return fmt.Errorf("error reading field 5: %s", err)
	} else {
		p.Action = v
	}
	return nil
}

func (p *DelayMessage) ReadField6(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI64(); err != nil {
		return fmt.Errorf("error reading field 6: %s", err)
	} else {
		p.Timestamp = &v
	}
	return nil
}

func (p *DelayMessage) ReadField7(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return fmt.Errorf("error reading field 7: %s", err)
	} else {
		p.Dmsgtype = &v
	}
	return nil
}

func (p *DelayMessage) ReadField8(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI64(); err != nil {
		return fmt.Errorf("error reading field 8: %s", err)
	} else {
		p.Interval = &v
	}
	return nil
}

func (p *DelayMessage) ReadField9(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI64(); err != nil {
		return fmt.Errorf("error reading field 9: %s", err)
	} else {
		p.Expire = &v
	}
	return nil
}

func (p *DelayMessage) ReadField10(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI64(); err != nil {
		return fmt.Errorf("error reading field 10: %s", err)
	} else {
		p.Times = &v
	}
	return nil
}

func (p *DelayMessage) ReadField11(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return fmt.Errorf("error reading field 11: %s", err)
	} else {
		p.Uuid = &v
	}
	return nil
}

func (p *DelayMessage) ReadField13(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return fmt.Errorf("error reading field 13: %s", err)
	} else {
		p.Version = &v
	}
	return nil
}

func (p *DelayMessage) ReadField14(iprot thrift.TProtocol) error {
	_, _, size, err := iprot.ReadMapBegin()
	if err != nil {
		return fmt.Errorf("error reading map begin: %s", err)
	}
	tMap := make(map[string]string, size)
	p.Properties = tMap
	for i := 0; i < size; i++ {
		var _key6 string
		if v, err := iprot.ReadString(); err != nil {
			return fmt.Errorf("error reading field 0: %s", err)
		} else {
			_key6 = v
		}
		var _val7 string
		if v, err := iprot.ReadString(); err != nil {
			return fmt.Errorf("error reading field 0: %s", err)
		} else {
			_val7 = v
		}
		p.Properties[_key6] = _val7
	}
	if err := iprot.ReadMapEnd(); err != nil {
		return fmt.Errorf("error reading map end: %s", err)
	}
	return nil
}

func (p *DelayMessage) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("DelayMessage"); err != nil {
		return fmt.Errorf("%T write struct begin error: %s", p, err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := p.writeField2(oprot); err != nil {
		return err
	}
	if err := p.writeField3(oprot); err != nil {
		return err
	}
	if err := p.writeField4(oprot); err != nil {
		return err
	}
	if err := p.writeField5(oprot); err != nil {
		return err
	}
	if err := p.writeField6(oprot); err != nil {
		return err
	}
	if err := p.writeField7(oprot); err != nil {
		return err
	}
	if err := p.writeField8(oprot); err != nil {
		return err
	}
	if err := p.writeField9(oprot); err != nil {
		return err
	}
	if err := p.writeField10(oprot); err != nil {
		return err
	}
	if err := p.writeField11(oprot); err != nil {
		return err
	}
	if err := p.writeField13(oprot); err != nil {
		return err
	}
	if err := p.writeField14(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return fmt.Errorf("write field stop error: %s", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return fmt.Errorf("write struct stop error: %s", err)
	}
	return nil
}

func (p *DelayMessage) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("topic", thrift.STRING, 1); err != nil {
		return fmt.Errorf("%T write field begin error 1:topic: %s", p, err)
	}
	if err := oprot.WriteString(string(p.Topic)); err != nil {
		return fmt.Errorf("%T.topic (1) field write error: %s", p, err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 1:topic: %s", p, err)
	}
	return err
}

func (p *DelayMessage) writeField2(oprot thrift.TProtocol) (err error) {
	if p.IsSetUniqDelayMsgId() {
		if err := oprot.WriteFieldBegin("uniqDelayMsgId", thrift.STRING, 2); err != nil {
			return fmt.Errorf("%T write field begin error 2:uniqDelayMsgId: %s", p, err)
		}
		if err := oprot.WriteString(string(*p.UniqDelayMsgId)); err != nil {
			return fmt.Errorf("%T.uniqDelayMsgId (2) field write error: %s", p, err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return fmt.Errorf("%T write field end error 2:uniqDelayMsgId: %s", p, err)
		}
	}
	return err
}

func (p *DelayMessage) writeField3(oprot thrift.TProtocol) (err error) {
	if p.IsSetBody() {
		if err := oprot.WriteFieldBegin("body", thrift.STRING, 3); err != nil {
			return fmt.Errorf("%T write field begin error 3:body: %s", p, err)
		}
		if err := oprot.WriteBinary(p.Body); err != nil {
			return fmt.Errorf("%T.body (3) field write error: %s", p, err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return fmt.Errorf("%T write field end error 3:body: %s", p, err)
		}
	}
	return err
}

func (p *DelayMessage) writeField4(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("tags", thrift.STRING, 4); err != nil {
		return fmt.Errorf("%T write field begin error 4:tags: %s", p, err)
	}
	if err := oprot.WriteString(string(p.Tags)); err != nil {
		return fmt.Errorf("%T.tags (4) field write error: %s", p, err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 4:tags: %s", p, err)
	}
	return err
}

func (p *DelayMessage) writeField5(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("action", thrift.I32, 5); err != nil {
		return fmt.Errorf("%T write field begin error 5:action: %s", p, err)
	}
	if err := oprot.WriteI32(int32(p.Action)); err != nil {
		return fmt.Errorf("%T.action (5) field write error: %s", p, err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 5:action: %s", p, err)
	}
	return err
}

func (p *DelayMessage) writeField6(oprot thrift.TProtocol) (err error) {
	if p.IsSetTimestamp() {
		if err := oprot.WriteFieldBegin("timestamp", thrift.I64, 6); err != nil {
			return fmt.Errorf("%T write field begin error 6:timestamp: %s", p, err)
		}
		if err := oprot.WriteI64(int64(*p.Timestamp)); err != nil {
			return fmt.Errorf("%T.timestamp (6) field write error: %s", p, err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return fmt.Errorf("%T write field end error 6:timestamp: %s", p, err)
		}
	}
	return err
}

func (p *DelayMessage) writeField7(oprot thrift.TProtocol) (err error) {
	if p.IsSetDmsgtype() {
		if err := oprot.WriteFieldBegin("dmsgtype", thrift.I32, 7); err != nil {
			return fmt.Errorf("%T write field begin error 7:dmsgtype: %s", p, err)
		}
		if err := oprot.WriteI32(int32(*p.Dmsgtype)); err != nil {
			return fmt.Errorf("%T.dmsgtype (7) field write error: %s", p, err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return fmt.Errorf("%T write field end error 7:dmsgtype: %s", p, err)
		}
	}
	return err
}

func (p *DelayMessage) writeField8(oprot thrift.TProtocol) (err error) {
	if p.IsSetInterval() {
		if err := oprot.WriteFieldBegin("interval", thrift.I64, 8); err != nil {
			return fmt.Errorf("%T write field begin error 8:interval: %s", p, err)
		}
		if err := oprot.WriteI64(int64(*p.Interval)); err != nil {
			return fmt.Errorf("%T.interval (8) field write error: %s", p, err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return fmt.Errorf("%T write field end error 8:interval: %s", p, err)
		}
	}
	return err
}

func (p *DelayMessage) writeField9(oprot thrift.TProtocol) (err error) {
	if p.IsSetExpire() {
		if err := oprot.WriteFieldBegin("expire", thrift.I64, 9); err != nil {
			return fmt.Errorf("%T write field begin error 9:expire: %s", p, err)
		}
		if err := oprot.WriteI64(int64(*p.Expire)); err != nil {
			return fmt.Errorf("%T.expire (9) field write error: %s", p, err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return fmt.Errorf("%T write field end error 9:expire: %s", p, err)
		}
	}
	return err
}

func (p *DelayMessage) writeField10(oprot thrift.TProtocol) (err error) {
	if p.IsSetTimes() {
		if err := oprot.WriteFieldBegin("times", thrift.I64, 10); err != nil {
			return fmt.Errorf("%T write field begin error 10:times: %s", p, err)
		}
		if err := oprot.WriteI64(int64(*p.Times)); err != nil {
			return fmt.Errorf("%T.times (10) field write error: %s", p, err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return fmt.Errorf("%T write field end error 10:times: %s", p, err)
		}
	}
	return err
}

func (p *DelayMessage) writeField11(oprot thrift.TProtocol) (err error) {
	if p.IsSetUuid() {
		if err := oprot.WriteFieldBegin("uuid", thrift.STRING, 11); err != nil {
			return fmt.Errorf("%T write field begin error 11:uuid: %s", p, err)
		}
		if err := oprot.WriteString(string(*p.Uuid)); err != nil {
			return fmt.Errorf("%T.uuid (11) field write error: %s", p, err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return fmt.Errorf("%T write field end error 11:uuid: %s", p, err)
		}
	}
	return err
}

func (p *DelayMessage) writeField13(oprot thrift.TProtocol) (err error) {
	if p.IsSetVersion() {
		if err := oprot.WriteFieldBegin("version", thrift.STRING, 13); err != nil {
			return fmt.Errorf("%T write field begin error 13:version: %s", p, err)
		}
		if err := oprot.WriteString(string(*p.Version)); err != nil {
			return fmt.Errorf("%T.version (13) field write error: %s", p, err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return fmt.Errorf("%T write field end error 13:version: %s", p, err)
		}
	}
	return err
}

func (p *DelayMessage) writeField14(oprot thrift.TProtocol) (err error) {
	if p.IsSetProperties() {
		if err := oprot.WriteFieldBegin("properties", thrift.MAP, 14); err != nil {
			return fmt.Errorf("%T write field begin error 14:properties: %s", p, err)
		}
		if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.Properties)); err != nil {
			return fmt.Errorf("error writing map begin: %s", err)
		}
		for k, v := range p.Properties {
			if err := oprot.WriteString(string(k)); err != nil {
				return fmt.Errorf("%T. (0) field write error: %s", p, err)
			}
			if err := oprot.WriteString(string(v)); err != nil {
				return fmt.Errorf("%T. (0) field write error: %s", p, err)
			}
		}
		if err := oprot.WriteMapEnd(); err != nil {
			return fmt.Errorf("error writing map end: %s", err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return fmt.Errorf("%T write field end error 14:properties: %s", p, err)
		}
	}
	return err
}

func (p *DelayMessage) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("DelayMessage(%+v)", *p)
}

type DelayMeta struct {
	Timestamp int64  `thrift:"timestamp,1" json:"timestamp"`
	Dmsgtype  *int32 `thrift:"dmsgtype,2" json:"dmsgtype"`
	Interval  *int64 `thrift:"interval,3" json:"interval"`
	Expire    *int64 `thrift:"expire,4" json:"expire"`
	Times     *int64 `thrift:"times,5" json:"times"`
	// unused field # 6
	Properties map[string]string `thrift:"properties,7" json:"properties"`
}

func NewDelayMeta() *DelayMeta {
	return &DelayMeta{}
}

func (p *DelayMeta) GetTimestamp() int64 {
	return p.Timestamp
}

var DelayMeta_Dmsgtype_DEFAULT int32

func (p *DelayMeta) GetDmsgtype() int32 {
	if !p.IsSetDmsgtype() {
		return DelayMeta_Dmsgtype_DEFAULT
	}
	return *p.Dmsgtype
}

var DelayMeta_Interval_DEFAULT int64

func (p *DelayMeta) GetInterval() int64 {
	if !p.IsSetInterval() {
		return DelayMeta_Interval_DEFAULT
	}
	return *p.Interval
}

var DelayMeta_Expire_DEFAULT int64

func (p *DelayMeta) GetExpire() int64 {
	if !p.IsSetExpire() {
		return DelayMeta_Expire_DEFAULT
	}
	return *p.Expire
}

var DelayMeta_Times_DEFAULT int64

func (p *DelayMeta) GetTimes() int64 {
	if !p.IsSetTimes() {
		return DelayMeta_Times_DEFAULT
	}
	return *p.Times
}

var DelayMeta_Properties_DEFAULT map[string]string

func (p *DelayMeta) GetProperties() map[string]string {
	return p.Properties
}
func (p *DelayMeta) IsSetDmsgtype() bool {
	return p.Dmsgtype != nil
}

func (p *DelayMeta) IsSetInterval() bool {
	return p.Interval != nil
}

func (p *DelayMeta) IsSetExpire() bool {
	return p.Expire != nil
}

func (p *DelayMeta) IsSetTimes() bool {
	return p.Times != nil
}

func (p *DelayMeta) IsSetProperties() bool {
	return p.Properties != nil
}

func (p *DelayMeta) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return fmt.Errorf("%T read error: %s", p, err)
	}
	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return fmt.Errorf("%T field %d read error: %s", p, fieldId, err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.ReadField1(iprot); err != nil {
				return err
			}
		case 2:
			if err := p.ReadField2(iprot); err != nil {
				return err
			}
		case 3:
			if err := p.ReadField3(iprot); err != nil {
				return err
			}
		case 4:
			if err := p.ReadField4(iprot); err != nil {
				return err
			}
		case 5:
			if err := p.ReadField5(iprot); err != nil {
				return err
			}
		case 7:
			if err := p.ReadField7(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return fmt.Errorf("%T read struct end error: %s", p, err)
	}
	return nil
}

func (p *DelayMeta) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI64(); err != nil {
		return fmt.Errorf("error reading field 1: %s", err)
	} else {
		p.Timestamp = v
	}
	return nil
}

func (p *DelayMeta) ReadField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return fmt.Errorf("error reading field 2: %s", err)
	} else {
		p.Dmsgtype = &v
	}
	return nil
}

func (p *DelayMeta) ReadField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI64(); err != nil {
		return fmt.Errorf("error reading field 3: %s", err)
	} else {
		p.Interval = &v
	}
	return nil
}

func (p *DelayMeta) ReadField4(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI64(); err != nil {
		return fmt.Errorf("error reading field 4: %s", err)
	} else {
		p.Expire = &v
	}
	return nil
}

func (p *DelayMeta) ReadField5(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI64(); err != nil {
		return fmt.Errorf("error reading field 5: %s", err)
	} else {
		p.Times = &v
	}
	return nil
}

func (p *DelayMeta) ReadField7(iprot thrift.TProtocol) error {
	_, _, size, err := iprot.ReadMapBegin()
	if err != nil {
		return fmt.Errorf("error reading map begin: %s", err)
	}
	tMap := make(map[string]string, size)
	p.Properties = tMap
	for i := 0; i < size; i++ {
		var _key8 string
		if v, err := iprot.ReadString(); err != nil {
			return fmt.Errorf("error reading field 0: %s", err)
		} else {
			_key8 = v
		}
		var _val9 string
		if v, err := iprot.ReadString(); err != nil {
			return fmt.Errorf("error reading field 0: %s", err)
		} else {
			_val9 = v
		}
		p.Properties[_key8] = _val9
	}
	if err := iprot.ReadMapEnd(); err != nil {
		return fmt.Errorf("error reading map end: %s", err)
	}
	return nil
}

func (p *DelayMeta) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("DelayMeta"); err != nil {
		return fmt.Errorf("%T write struct begin error: %s", p, err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := p.writeField2(oprot); err != nil {
		return err
	}
	if err := p.writeField3(oprot); err != nil {
		return err
	}
	if err := p.writeField4(oprot); err != nil {
		return err
	}
	if err := p.writeField5(oprot); err != nil {
		return err
	}
	if err := p.writeField7(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return fmt.Errorf("write field stop error: %s", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return fmt.Errorf("write struct stop error: %s", err)
	}
	return nil
}

func (p *DelayMeta) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("timestamp", thrift.I64, 1); err != nil {
		return fmt.Errorf("%T write field begin error 1:timestamp: %s", p, err)
	}
	if err := oprot.WriteI64(int64(p.Timestamp)); err != nil {
		return fmt.Errorf("%T.timestamp (1) field write error: %s", p, err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 1:timestamp: %s", p, err)
	}
	return err
}

func (p *DelayMeta) writeField2(oprot thrift.TProtocol) (err error) {
	if p.IsSetDmsgtype() {
		if err := oprot.WriteFieldBegin("dmsgtype", thrift.I32, 2); err != nil {
			return fmt.Errorf("%T write field begin error 2:dmsgtype: %s", p, err)
		}
		if err := oprot.WriteI32(int32(*p.Dmsgtype)); err != nil {
			return fmt.Errorf("%T.dmsgtype (2) field write error: %s", p, err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return fmt.Errorf("%T write field end error 2:dmsgtype: %s", p, err)
		}
	}
	return err
}

func (p *DelayMeta) writeField3(oprot thrift.TProtocol) (err error) {
	if p.IsSetInterval() {
		if err := oprot.WriteFieldBegin("interval", thrift.I64, 3); err != nil {
			return fmt.Errorf("%T write field begin error 3:interval: %s", p, err)
		}
		if err := oprot.WriteI64(int64(*p.Interval)); err != nil {
			return fmt.Errorf("%T.interval (3) field write error: %s", p, err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return fmt.Errorf("%T write field end error 3:interval: %s", p, err)
		}
	}
	return err
}

func (p *DelayMeta) writeField4(oprot thrift.TProtocol) (err error) {
	if p.IsSetExpire() {
		if err := oprot.WriteFieldBegin("expire", thrift.I64, 4); err != nil {
			return fmt.Errorf("%T write field begin error 4:expire: %s", p, err)
		}
		if err := oprot.WriteI64(int64(*p.Expire)); err != nil {
			return fmt.Errorf("%T.expire (4) field write error: %s", p, err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return fmt.Errorf("%T write field end error 4:expire: %s", p, err)
		}
	}
	return err
}

func (p *DelayMeta) writeField5(oprot thrift.TProtocol) (err error) {
	if p.IsSetTimes() {
		if err := oprot.WriteFieldBegin("times", thrift.I64, 5); err != nil {
			return fmt.Errorf("%T write field begin error 5:times: %s", p, err)
		}
		if err := oprot.WriteI64(int64(*p.Times)); err != nil {
			return fmt.Errorf("%T.times (5) field write error: %s", p, err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return fmt.Errorf("%T write field end error 5:times: %s", p, err)
		}
	}
	return err
}

func (p *DelayMeta) writeField7(oprot thrift.TProtocol) (err error) {
	if p.IsSetProperties() {
		if err := oprot.WriteFieldBegin("properties", thrift.MAP, 7); err != nil {
			return fmt.Errorf("%T write field begin error 7:properties: %s", p, err)
		}
		if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.Properties)); err != nil {
			return fmt.Errorf("error writing map begin: %s", err)
		}
		for k, v := range p.Properties {
			if err := oprot.WriteString(string(k)); err != nil {
				return fmt.Errorf("%T. (0) field write error: %s", p, err)
			}
			if err := oprot.WriteString(string(v)); err != nil {
				return fmt.Errorf("%T. (0) field write error: %s", p, err)
			}
		}
		if err := oprot.WriteMapEnd(); err != nil {
			return fmt.Errorf("error writing map end: %s", err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return fmt.Errorf("%T write field end error 7:properties: %s", p, err)
		}
	}
	return err
}

func (p *DelayMeta) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("DelayMeta(%+v)", *p)
}
