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

package CarreraConsumer

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 Message struct {
	Key        string            `thrift:"key,1" json:"key"`
	Value      []byte            `thrift:"value,2" json:"value"`
	Tag        string            `thrift:"tag,3" json:"tag"`
	Offset     int64             `thrift:"offset,4" json:"offset"`
	Properties map[string]string `thrift:"properties,5" json:"properties"`
}

func NewMessage() *Message {
	return &Message{}
}

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

func (p *Message) GetValue() []byte {
	return p.Value
}

func (p *Message) GetTag() string {
	return p.Tag
}

func (p *Message) GetOffset() int64 {
	return p.Offset
}

var Message_Properties_DEFAULT map[string]string

func (p *Message) GetProperties() map[string]string {
	return p.Properties
}
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
			}
		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.Key = v
	}
	return nil
}

func (p *Message) ReadField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadBinary(); err != nil {
		return fmt.Errorf("error reading field 2: %s", err)
	} else {
		p.Value = 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.Tag = 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.Offset = v
	}
	return nil
}

func (p *Message) 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.Properties = 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.Properties[_key0] = _val1
	}
	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 := 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("key", thrift.STRING, 1); err != nil {
		return fmt.Errorf("%T write field begin error 1:key: %s", p, err)
	}
	if err := oprot.WriteString(string(p.Key)); err != nil {
		return fmt.Errorf("%T.key (1) field write error: %s", p, err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 1:key: %s", p, err)
	}
	return err
}

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

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

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

func (p *Message) writeField5(oprot thrift.TProtocol) (err error) {
	if p.IsSetProperties() {
		if err := oprot.WriteFieldBegin("properties", thrift.MAP, 5); err != nil {
			return fmt.Errorf("%T write field begin error 5: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 5:properties: %s", p, err)
		}
	}
	return err
}

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

type Context struct {
	GroupId string `thrift:"groupId,1" json:"groupId"`
	Topic   string `thrift:"topic,2" json:"topic"`
	Qid     string `thrift:"qid,3" json:"qid"`
}

func NewContext() *Context {
	return &Context{}
}

func (p *Context) GetGroupId() string {
	return p.GroupId
}

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

func (p *Context) GetQid() string {
	return p.Qid
}
func (p *Context) 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 *Context) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return fmt.Errorf("error reading field 1: %s", err)
	} else {
		p.GroupId = v
	}
	return nil
}

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

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

func (p *Context) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("Context"); 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 *Context) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("groupId", thrift.STRING, 1); err != nil {
		return fmt.Errorf("%T write field begin error 1:groupId: %s", p, err)
	}
	if err := oprot.WriteString(string(p.GroupId)); err != nil {
		return fmt.Errorf("%T.groupId (1) field write error: %s", p, err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 1:groupId: %s", p, err)
	}
	return err
}

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

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

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

type ConsumeResult_ struct {
	Context *Context `thrift:"context,1" json:"context"`
	// unused field # 2
	SuccessOffsets []int64 `thrift:"successOffsets,3" json:"successOffsets"`
	FailOffsets    []int64 `thrift:"failOffsets,4" json:"failOffsets"`
	// unused fields # 5 to 9
	NextResult_ *ConsumeResult_ `thrift:"nextResult,10" json:"nextResult"`
}

func NewConsumeResult_() *ConsumeResult_ {
	return &ConsumeResult_{}
}

var ConsumeResult__Context_DEFAULT *Context

func (p *ConsumeResult_) GetContext() *Context {
	if !p.IsSetContext() {
		return ConsumeResult__Context_DEFAULT
	}
	return p.Context
}

func (p *ConsumeResult_) GetSuccessOffsets() []int64 {
	return p.SuccessOffsets
}

func (p *ConsumeResult_) GetFailOffsets() []int64 {
	return p.FailOffsets
}

var ConsumeResult__NextResult__DEFAULT ConsumeResult_

func (p *ConsumeResult_) GetNextResult_() ConsumeResult_ {
	if !p.IsSetNextResult_() {
		return ConsumeResult__NextResult__DEFAULT
	}
	return *p.NextResult_
}
func (p *ConsumeResult_) IsSetContext() bool {
	return p.Context != nil
}

func (p *ConsumeResult_) IsSetNextResult_() bool {
	return p.NextResult_ != nil
}

func (p *ConsumeResult_) 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 3:
			if err := p.ReadField3(iprot); err != nil {
				return err
			}
		case 4:
			if err := p.ReadField4(iprot); err != nil {
				return err
			}
		case 10:
			if err := p.ReadField10(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 *ConsumeResult_) ReadField1(iprot thrift.TProtocol) error {
	p.Context = &Context{}
	if err := p.Context.Read(iprot); err != nil {
		return fmt.Errorf("%T error reading struct: %s", p.Context, err)
	}
	return nil
}

func (p *ConsumeResult_) ReadField3(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return fmt.Errorf("error reading list begin: %s", err)
	}
	tSlice := make([]int64, 0, size)
	p.SuccessOffsets = tSlice
	for i := 0; i < size; i++ {
		var _elem2 int64
		if v, err := iprot.ReadI64(); err != nil {
			return fmt.Errorf("error reading field 0: %s", err)
		} else {
			_elem2 = v
		}
		p.SuccessOffsets = append(p.SuccessOffsets, _elem2)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return fmt.Errorf("error reading list end: %s", err)
	}
	return nil
}

func (p *ConsumeResult_) ReadField4(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return fmt.Errorf("error reading list begin: %s", err)
	}
	tSlice := make([]int64, 0, size)
	p.FailOffsets = tSlice
	for i := 0; i < size; i++ {
		var _elem3 int64
		if v, err := iprot.ReadI64(); err != nil {
			return fmt.Errorf("error reading field 0: %s", err)
		} else {
			_elem3 = v
		}
		p.FailOffsets = append(p.FailOffsets, _elem3)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return fmt.Errorf("error reading list end: %s", err)
	}
	return nil
}

func (p *ConsumeResult_) ReadField10(iprot thrift.TProtocol) error {
	p.NextResult_ = &ConsumeResult_{}
	if err := p.NextResult_.Read(iprot); err != nil {
		return fmt.Errorf("%T error reading struct: %s", p.NextResult_, err)
	}
	return nil
}

func (p *ConsumeResult_) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("ConsumeResult"); 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.writeField3(oprot); err != nil {
		return err
	}
	if err := p.writeField4(oprot); err != nil {
		return err
	}
	if err := p.writeField10(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 *ConsumeResult_) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("context", thrift.STRUCT, 1); err != nil {
		return fmt.Errorf("%T write field begin error 1:context: %s", p, err)
	}
	if err := p.Context.Write(oprot); err != nil {
		return fmt.Errorf("%T error writing struct: %s", p.Context, err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 1:context: %s", p, err)
	}
	return err
}

func (p *ConsumeResult_) writeField3(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("successOffsets", thrift.LIST, 3); err != nil {
		return fmt.Errorf("%T write field begin error 3:successOffsets: %s", p, err)
	}
	if err := oprot.WriteListBegin(thrift.I64, len(p.SuccessOffsets)); err != nil {
		return fmt.Errorf("error writing list begin: %s", err)
	}
	for _, v := range p.SuccessOffsets {
		if err := oprot.WriteI64(int64(v)); err != nil {
			return fmt.Errorf("%T. (0) field write error: %s", p, err)
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return fmt.Errorf("error writing list end: %s", err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 3:successOffsets: %s", p, err)
	}
	return err
}

func (p *ConsumeResult_) writeField4(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("failOffsets", thrift.LIST, 4); err != nil {
		return fmt.Errorf("%T write field begin error 4:failOffsets: %s", p, err)
	}
	if err := oprot.WriteListBegin(thrift.I64, len(p.FailOffsets)); err != nil {
		return fmt.Errorf("error writing list begin: %s", err)
	}
	for _, v := range p.FailOffsets {
		if err := oprot.WriteI64(int64(v)); err != nil {
			return fmt.Errorf("%T. (0) field write error: %s", p, err)
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return fmt.Errorf("error writing list end: %s", err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 4:failOffsets: %s", p, err)
	}
	return err
}

func (p *ConsumeResult_) writeField10(oprot thrift.TProtocol) (err error) {
	if p.IsSetNextResult_() {
		if err := oprot.WriteFieldBegin("nextResult", thrift.STRUCT, 10); err != nil {
			return fmt.Errorf("%T write field begin error 10:nextResult: %s", p, err)
		}
		if err := p.NextResult_.Write(oprot); err != nil {
			return fmt.Errorf("%T error writing struct: %s", p.NextResult_, err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return fmt.Errorf("%T write field end error 10:nextResult: %s", p, err)
		}
	}
	return err
}

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

type PullRequest struct {
	GroupId string  `thrift:"groupId,1,required" json:"groupId"`
	Topic   *string `thrift:"topic,2" json:"topic"`
	// unused fields # 3 to 9
	MaxBatchSize  *int32 `thrift:"maxBatchSize,10" json:"maxBatchSize"`
	MaxLingerTime *int32 `thrift:"maxLingerTime,11" json:"maxLingerTime"`
	// unused fields # 12 to 49
	Result_ *ConsumeResult_ `thrift:"result,50" json:"result"`
	// unused fields # 51 to 59
	Version *string `thrift:"version,60" json:"version"`
}

func NewPullRequest() *PullRequest {
	return &PullRequest{}
}

func (p *PullRequest) GetGroupId() string {
	return p.GroupId
}

var PullRequest_Topic_DEFAULT string

func (p *PullRequest) GetTopic() string {
	if !p.IsSetTopic() {
		return PullRequest_Topic_DEFAULT
	}
	return *p.Topic
}

var PullRequest_MaxBatchSize_DEFAULT int32

func (p *PullRequest) GetMaxBatchSize() int32 {
	if !p.IsSetMaxBatchSize() {
		return PullRequest_MaxBatchSize_DEFAULT
	}
	return *p.MaxBatchSize
}

var PullRequest_MaxLingerTime_DEFAULT int32

func (p *PullRequest) GetMaxLingerTime() int32 {
	if !p.IsSetMaxLingerTime() {
		return PullRequest_MaxLingerTime_DEFAULT
	}
	return *p.MaxLingerTime
}

var PullRequest_Result__DEFAULT *ConsumeResult_

func (p *PullRequest) GetResult_() *ConsumeResult_ {
	if !p.IsSetResult_() {
		return PullRequest_Result__DEFAULT
	}
	return p.Result_
}

var PullRequest_Version_DEFAULT string

func (p *PullRequest) GetVersion() string {
	if !p.IsSetVersion() {
		return PullRequest_Version_DEFAULT
	}
	return *p.Version
}
func (p *PullRequest) IsSetTopic() bool {
	return p.Topic != nil
}

func (p *PullRequest) IsSetMaxBatchSize() bool {
	return p.MaxBatchSize != nil
}

func (p *PullRequest) IsSetMaxLingerTime() bool {
	return p.MaxLingerTime != nil
}

func (p *PullRequest) IsSetResult_() bool {
	return p.Result_ != nil
}

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

func (p *PullRequest) 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 10:
			if err := p.ReadField10(iprot); err != nil {
				return err
			}
		case 11:
			if err := p.ReadField11(iprot); err != nil {
				return err
			}
		case 50:
			if err := p.ReadField50(iprot); err != nil {
				return err
			}
		case 60:
			if err := p.ReadField60(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 *PullRequest) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return fmt.Errorf("error reading field 1: %s", err)
	} else {
		p.GroupId = v
	}
	return nil
}

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

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

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

func (p *PullRequest) ReadField50(iprot thrift.TProtocol) error {
	p.Result_ = &ConsumeResult_{}
	if err := p.Result_.Read(iprot); err != nil {
		return fmt.Errorf("%T error reading struct: %s", p.Result_, err)
	}
	return nil
}

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

func (p *PullRequest) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("PullRequest"); 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.writeField10(oprot); err != nil {
		return err
	}
	if err := p.writeField11(oprot); err != nil {
		return err
	}
	if err := p.writeField50(oprot); err != nil {
		return err
	}
	if err := p.writeField60(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 *PullRequest) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("groupId", thrift.STRING, 1); err != nil {
		return fmt.Errorf("%T write field begin error 1:groupId: %s", p, err)
	}
	if err := oprot.WriteString(string(p.GroupId)); err != nil {
		return fmt.Errorf("%T.groupId (1) field write error: %s", p, err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 1:groupId: %s", p, err)
	}
	return err
}

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

func (p *PullRequest) writeField10(oprot thrift.TProtocol) (err error) {
	if p.IsSetMaxBatchSize() {
		if err := oprot.WriteFieldBegin("maxBatchSize", thrift.I32, 10); err != nil {
			return fmt.Errorf("%T write field begin error 10:maxBatchSize: %s", p, err)
		}
		if err := oprot.WriteI32(int32(*p.MaxBatchSize)); err != nil {
			return fmt.Errorf("%T.maxBatchSize (10) field write error: %s", p, err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return fmt.Errorf("%T write field end error 10:maxBatchSize: %s", p, err)
		}
	}
	return err
}

func (p *PullRequest) writeField11(oprot thrift.TProtocol) (err error) {
	if p.IsSetMaxLingerTime() {
		if err := oprot.WriteFieldBegin("maxLingerTime", thrift.I32, 11); err != nil {
			return fmt.Errorf("%T write field begin error 11:maxLingerTime: %s", p, err)
		}
		if err := oprot.WriteI32(int32(*p.MaxLingerTime)); err != nil {
			return fmt.Errorf("%T.maxLingerTime (11) field write error: %s", p, err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return fmt.Errorf("%T write field end error 11:maxLingerTime: %s", p, err)
		}
	}
	return err
}

func (p *PullRequest) writeField50(oprot thrift.TProtocol) (err error) {
	if p.IsSetResult_() {
		if err := oprot.WriteFieldBegin("result", thrift.STRUCT, 50); err != nil {
			return fmt.Errorf("%T write field begin error 50:result: %s", p, err)
		}
		if err := p.Result_.Write(oprot); err != nil {
			return fmt.Errorf("%T error writing struct: %s", p.Result_, err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return fmt.Errorf("%T write field end error 50:result: %s", p, err)
		}
	}
	return err
}

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

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

type PullResponse struct {
	Context  *Context   `thrift:"context,1" json:"context"`
	Messages []*Message `thrift:"messages,2" json:"messages"`
}

func NewPullResponse() *PullResponse {
	return &PullResponse{}
}

var PullResponse_Context_DEFAULT *Context

func (p *PullResponse) GetContext() *Context {
	if !p.IsSetContext() {
		return PullResponse_Context_DEFAULT
	}
	return p.Context
}

func (p *PullResponse) GetMessages() []*Message {
	return p.Messages
}
func (p *PullResponse) IsSetContext() bool {
	return p.Context != nil
}

func (p *PullResponse) 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
			}
		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 *PullResponse) ReadField1(iprot thrift.TProtocol) error {
	p.Context = &Context{}
	if err := p.Context.Read(iprot); err != nil {
		return fmt.Errorf("%T error reading struct: %s", p.Context, err)
	}
	return nil
}

func (p *PullResponse) ReadField2(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return fmt.Errorf("error reading list begin: %s", err)
	}
	tSlice := make([]*Message, 0, size)
	p.Messages = tSlice
	for i := 0; i < size; i++ {
		_elem4 := &Message{}
		if err := _elem4.Read(iprot); err != nil {
			return fmt.Errorf("%T error reading struct: %s", _elem4, err)
		}
		p.Messages = append(p.Messages, _elem4)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return fmt.Errorf("error reading list end: %s", err)
	}
	return nil
}

func (p *PullResponse) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("PullResponse"); 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 := 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 *PullResponse) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("context", thrift.STRUCT, 1); err != nil {
		return fmt.Errorf("%T write field begin error 1:context: %s", p, err)
	}
	if err := p.Context.Write(oprot); err != nil {
		return fmt.Errorf("%T error writing struct: %s", p.Context, err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 1:context: %s", p, err)
	}
	return err
}

func (p *PullResponse) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("messages", thrift.LIST, 2); err != nil {
		return fmt.Errorf("%T write field begin error 2:messages: %s", p, err)
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Messages)); err != nil {
		return fmt.Errorf("error writing list begin: %s", err)
	}
	for _, v := range p.Messages {
		if err := v.Write(oprot); err != nil {
			return fmt.Errorf("%T error writing struct: %s", v, err)
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return fmt.Errorf("error writing list end: %s", err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 2:messages: %s", p, err)
	}
	return err
}

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

type ConsumeStatsRequest struct {
	Group   string  `thrift:"group,1,required" json:"group"`
	Topic   *string `thrift:"topic,2" json:"topic"`
	Version *string `thrift:"version,3" json:"version"`
}

func NewConsumeStatsRequest() *ConsumeStatsRequest {
	return &ConsumeStatsRequest{}
}

func (p *ConsumeStatsRequest) GetGroup() string {
	return p.Group
}

var ConsumeStatsRequest_Topic_DEFAULT string

func (p *ConsumeStatsRequest) GetTopic() string {
	if !p.IsSetTopic() {
		return ConsumeStatsRequest_Topic_DEFAULT
	}
	return *p.Topic
}

var ConsumeStatsRequest_Version_DEFAULT string

func (p *ConsumeStatsRequest) GetVersion() string {
	if !p.IsSetVersion() {
		return ConsumeStatsRequest_Version_DEFAULT
	}
	return *p.Version
}
func (p *ConsumeStatsRequest) IsSetTopic() bool {
	return p.Topic != nil
}

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

func (p *ConsumeStatsRequest) 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 *ConsumeStatsRequest) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return fmt.Errorf("error reading field 1: %s", err)
	} else {
		p.Group = v
	}
	return nil
}

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

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

func (p *ConsumeStatsRequest) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("ConsumeStatsRequest"); 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 *ConsumeStatsRequest) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("group", thrift.STRING, 1); err != nil {
		return fmt.Errorf("%T write field begin error 1:group: %s", p, err)
	}
	if err := oprot.WriteString(string(p.Group)); err != nil {
		return fmt.Errorf("%T.group (1) field write error: %s", p, err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 1:group: %s", p, err)
	}
	return err
}

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

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

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

type FetchRequest struct {
	ConsumerId  string                      `thrift:"consumerId,1,required" json:"consumerId"`
	GroupId     string                      `thrift:"groupId,2,required" json:"groupId"`
	Cluster     string                      `thrift:"cluster,3,required" json:"cluster"`
	FetchOffset map[string]map[string]int64 `thrift:"fetchOffset,4" json:"fetchOffset"`
	// unused fields # 5 to 9
	MaxBatchSize  *int32 `thrift:"maxBatchSize,10" json:"maxBatchSize"`
	MaxLingerTime *int32 `thrift:"maxLingerTime,11" json:"maxLingerTime"`
	// unused fields # 12 to 59
	Version *string `thrift:"version,60" json:"version"`
}

func NewFetchRequest() *FetchRequest {
	return &FetchRequest{}
}

func (p *FetchRequest) GetConsumerId() string {
	return p.ConsumerId
}

func (p *FetchRequest) GetGroupId() string {
	return p.GroupId
}

func (p *FetchRequest) GetCluster() string {
	return p.Cluster
}

var FetchRequest_FetchOffset_DEFAULT map[string]map[string]int64

func (p *FetchRequest) GetFetchOffset() map[string]map[string]int64 {
	return p.FetchOffset
}

var FetchRequest_MaxBatchSize_DEFAULT int32

func (p *FetchRequest) GetMaxBatchSize() int32 {
	if !p.IsSetMaxBatchSize() {
		return FetchRequest_MaxBatchSize_DEFAULT
	}
	return *p.MaxBatchSize
}

var FetchRequest_MaxLingerTime_DEFAULT int32

func (p *FetchRequest) GetMaxLingerTime() int32 {
	if !p.IsSetMaxLingerTime() {
		return FetchRequest_MaxLingerTime_DEFAULT
	}
	return *p.MaxLingerTime
}

var FetchRequest_Version_DEFAULT string

func (p *FetchRequest) GetVersion() string {
	if !p.IsSetVersion() {
		return FetchRequest_Version_DEFAULT
	}
	return *p.Version
}
func (p *FetchRequest) IsSetFetchOffset() bool {
	return p.FetchOffset != nil
}

func (p *FetchRequest) IsSetMaxBatchSize() bool {
	return p.MaxBatchSize != nil
}

func (p *FetchRequest) IsSetMaxLingerTime() bool {
	return p.MaxLingerTime != nil
}

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

func (p *FetchRequest) 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 10:
			if err := p.ReadField10(iprot); err != nil {
				return err
			}
		case 11:
			if err := p.ReadField11(iprot); err != nil {
				return err
			}
		case 60:
			if err := p.ReadField60(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 *FetchRequest) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return fmt.Errorf("error reading field 1: %s", err)
	} else {
		p.ConsumerId = v
	}
	return nil
}

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

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

func (p *FetchRequest) 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]map[string]int64, size)
	p.FetchOffset = tMap
	for i := 0; i < size; i++ {
		var _key5 string
		if v, err := iprot.ReadString(); err != nil {
			return fmt.Errorf("error reading field 0: %s", err)
		} else {
			_key5 = v
		}
		_, _, size, err := iprot.ReadMapBegin()
		if err != nil {
			return fmt.Errorf("error reading map begin: %s", err)
		}
		tMap := make(map[string]int64, size)
		_val6 := tMap
		for i := 0; i < size; i++ {
			var _key7 string
			if v, err := iprot.ReadString(); err != nil {
				return fmt.Errorf("error reading field 0: %s", err)
			} else {
				_key7 = v
			}
			var _val8 int64
			if v, err := iprot.ReadI64(); err != nil {
				return fmt.Errorf("error reading field 0: %s", err)
			} else {
				_val8 = v
			}
			_val6[_key7] = _val8
		}
		if err := iprot.ReadMapEnd(); err != nil {
			return fmt.Errorf("error reading map end: %s", err)
		}
		p.FetchOffset[_key5] = _val6
	}
	if err := iprot.ReadMapEnd(); err != nil {
		return fmt.Errorf("error reading map end: %s", err)
	}
	return nil
}

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

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

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

func (p *FetchRequest) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("FetchRequest"); 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.writeField10(oprot); err != nil {
		return err
	}
	if err := p.writeField11(oprot); err != nil {
		return err
	}
	if err := p.writeField60(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 *FetchRequest) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("consumerId", thrift.STRING, 1); err != nil {
		return fmt.Errorf("%T write field begin error 1:consumerId: %s", p, err)
	}
	if err := oprot.WriteString(string(p.ConsumerId)); err != nil {
		return fmt.Errorf("%T.consumerId (1) field write error: %s", p, err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 1:consumerId: %s", p, err)
	}
	return err
}

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

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

func (p *FetchRequest) writeField4(oprot thrift.TProtocol) (err error) {
	if p.IsSetFetchOffset() {
		if err := oprot.WriteFieldBegin("fetchOffset", thrift.MAP, 4); err != nil {
			return fmt.Errorf("%T write field begin error 4:fetchOffset: %s", p, err)
		}
		if err := oprot.WriteMapBegin(thrift.STRING, thrift.MAP, len(p.FetchOffset)); err != nil {
			return fmt.Errorf("error writing map begin: %s", err)
		}
		for k, v := range p.FetchOffset {
			if err := oprot.WriteString(string(k)); err != nil {
				return fmt.Errorf("%T. (0) field write error: %s", p, err)
			}
			if err := oprot.WriteMapBegin(thrift.STRING, thrift.I64, len(v)); err != nil {
				return fmt.Errorf("error writing map begin: %s", err)
			}
			for k, v := range v {
				if err := oprot.WriteString(string(k)); err != nil {
					return fmt.Errorf("%T. (0) field write error: %s", p, err)
				}
				if err := oprot.WriteI64(int64(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.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:fetchOffset: %s", p, err)
		}
	}
	return err
}

func (p *FetchRequest) writeField10(oprot thrift.TProtocol) (err error) {
	if p.IsSetMaxBatchSize() {
		if err := oprot.WriteFieldBegin("maxBatchSize", thrift.I32, 10); err != nil {
			return fmt.Errorf("%T write field begin error 10:maxBatchSize: %s", p, err)
		}
		if err := oprot.WriteI32(int32(*p.MaxBatchSize)); err != nil {
			return fmt.Errorf("%T.maxBatchSize (10) field write error: %s", p, err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return fmt.Errorf("%T write field end error 10:maxBatchSize: %s", p, err)
		}
	}
	return err
}

func (p *FetchRequest) writeField11(oprot thrift.TProtocol) (err error) {
	if p.IsSetMaxLingerTime() {
		if err := oprot.WriteFieldBegin("maxLingerTime", thrift.I32, 11); err != nil {
			return fmt.Errorf("%T write field begin error 11:maxLingerTime: %s", p, err)
		}
		if err := oprot.WriteI32(int32(*p.MaxLingerTime)); err != nil {
			return fmt.Errorf("%T.maxLingerTime (11) field write error: %s", p, err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return fmt.Errorf("%T write field end error 11:maxLingerTime: %s", p, err)
		}
	}
	return err
}

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

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

type QidResponse struct {
	Topic             string `thrift:"topic,1,required" json:"topic"`
	Qid               string `thrift:"qid,2,required" json:"qid"`
	NextRequestOffset *int64 `thrift:"nextRequestOffset,3" json:"nextRequestOffset"`
	// unused fields # 4 to 9
	Messages []*Message `thrift:"messages,10,required" json:"messages"`
}

func NewQidResponse() *QidResponse {
	return &QidResponse{}
}

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

func (p *QidResponse) GetQid() string {
	return p.Qid
}

var QidResponse_NextRequestOffset_DEFAULT int64

func (p *QidResponse) GetNextRequestOffset() int64 {
	if !p.IsSetNextRequestOffset() {
		return QidResponse_NextRequestOffset_DEFAULT
	}
	return *p.NextRequestOffset
}

func (p *QidResponse) GetMessages() []*Message {
	return p.Messages
}
func (p *QidResponse) IsSetNextRequestOffset() bool {
	return p.NextRequestOffset != nil
}

func (p *QidResponse) 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 10:
			if err := p.ReadField10(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 *QidResponse) 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 *QidResponse) ReadField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return fmt.Errorf("error reading field 2: %s", err)
	} else {
		p.Qid = v
	}
	return nil
}

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

func (p *QidResponse) ReadField10(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return fmt.Errorf("error reading list begin: %s", err)
	}
	tSlice := make([]*Message, 0, size)
	p.Messages = tSlice
	for i := 0; i < size; i++ {
		_elem9 := &Message{}
		if err := _elem9.Read(iprot); err != nil {
			return fmt.Errorf("%T error reading struct: %s", _elem9, err)
		}
		p.Messages = append(p.Messages, _elem9)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return fmt.Errorf("error reading list end: %s", err)
	}
	return nil
}

func (p *QidResponse) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("QidResponse"); 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.writeField10(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 *QidResponse) 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 *QidResponse) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("qid", thrift.STRING, 2); err != nil {
		return fmt.Errorf("%T write field begin error 2:qid: %s", p, err)
	}
	if err := oprot.WriteString(string(p.Qid)); err != nil {
		return fmt.Errorf("%T.qid (2) field write error: %s", p, err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 2:qid: %s", p, err)
	}
	return err
}

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

func (p *QidResponse) writeField10(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("messages", thrift.LIST, 10); err != nil {
		return fmt.Errorf("%T write field begin error 10:messages: %s", p, err)
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Messages)); err != nil {
		return fmt.Errorf("error writing list begin: %s", err)
	}
	for _, v := range p.Messages {
		if err := v.Write(oprot); err != nil {
			return fmt.Errorf("%T error writing struct: %s", v, err)
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return fmt.Errorf("error writing list end: %s", err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 10:messages: %s", p, err)
	}
	return err
}

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

type FetchResponse struct {
	Code *int32 `thrift:"code,1" json:"code"`
	// unused fields # 2 to 9
	Results []*QidResponse `thrift:"results,10,required" json:"results"`
}

func NewFetchResponse() *FetchResponse {
	return &FetchResponse{}
}

var FetchResponse_Code_DEFAULT int32

func (p *FetchResponse) GetCode() int32 {
	if !p.IsSetCode() {
		return FetchResponse_Code_DEFAULT
	}
	return *p.Code
}

func (p *FetchResponse) GetResults() []*QidResponse {
	return p.Results
}
func (p *FetchResponse) IsSetCode() bool {
	return p.Code != nil
}

func (p *FetchResponse) 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 10:
			if err := p.ReadField10(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 *FetchResponse) 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 *FetchResponse) ReadField10(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return fmt.Errorf("error reading list begin: %s", err)
	}
	tSlice := make([]*QidResponse, 0, size)
	p.Results = tSlice
	for i := 0; i < size; i++ {
		_elem10 := &QidResponse{}
		if err := _elem10.Read(iprot); err != nil {
			return fmt.Errorf("%T error reading struct: %s", _elem10, err)
		}
		p.Results = append(p.Results, _elem10)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return fmt.Errorf("error reading list end: %s", err)
	}
	return nil
}

func (p *FetchResponse) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("FetchResponse"); 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.writeField10(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 *FetchResponse) writeField1(oprot thrift.TProtocol) (err error) {
	if p.IsSetCode() {
		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 *FetchResponse) writeField10(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("results", thrift.LIST, 10); err != nil {
		return fmt.Errorf("%T write field begin error 10:results: %s", p, err)
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Results)); err != nil {
		return fmt.Errorf("error writing list begin: %s", err)
	}
	for _, v := range p.Results {
		if err := v.Write(oprot); err != nil {
			return fmt.Errorf("%T error writing struct: %s", v, err)
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return fmt.Errorf("error writing list end: %s", err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 10:results: %s", p, err)
	}
	return err
}

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

type AckResult_ struct {
	ConsumerId string                      `thrift:"consumerId,1,required" json:"consumerId"`
	GroupId    string                      `thrift:"groupId,2,required" json:"groupId"`
	Cluster    string                      `thrift:"cluster,3,required" json:"cluster"`
	Offsets    map[string]map[string]int64 `thrift:"offsets,4,required" json:"offsets"`
}

func NewAckResult_() *AckResult_ {
	return &AckResult_{}
}

func (p *AckResult_) GetConsumerId() string {
	return p.ConsumerId
}

func (p *AckResult_) GetGroupId() string {
	return p.GroupId
}

func (p *AckResult_) GetCluster() string {
	return p.Cluster
}

func (p *AckResult_) GetOffsets() map[string]map[string]int64 {
	return p.Offsets
}
func (p *AckResult_) 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
			}
		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 *AckResult_) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return fmt.Errorf("error reading field 1: %s", err)
	} else {
		p.ConsumerId = v
	}
	return nil
}

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

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

func (p *AckResult_) 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]map[string]int64, size)
	p.Offsets = tMap
	for i := 0; i < size; i++ {
		var _key11 string
		if v, err := iprot.ReadString(); err != nil {
			return fmt.Errorf("error reading field 0: %s", err)
		} else {
			_key11 = v
		}
		_, _, size, err := iprot.ReadMapBegin()
		if err != nil {
			return fmt.Errorf("error reading map begin: %s", err)
		}
		tMap := make(map[string]int64, size)
		_val12 := tMap
		for i := 0; i < size; i++ {
			var _key13 string
			if v, err := iprot.ReadString(); err != nil {
				return fmt.Errorf("error reading field 0: %s", err)
			} else {
				_key13 = v
			}
			var _val14 int64
			if v, err := iprot.ReadI64(); err != nil {
				return fmt.Errorf("error reading field 0: %s", err)
			} else {
				_val14 = v
			}
			_val12[_key13] = _val14
		}
		if err := iprot.ReadMapEnd(); err != nil {
			return fmt.Errorf("error reading map end: %s", err)
		}
		p.Offsets[_key11] = _val12
	}
	if err := iprot.ReadMapEnd(); err != nil {
		return fmt.Errorf("error reading map end: %s", err)
	}
	return nil
}

func (p *AckResult_) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("AckResult"); 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 := 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 *AckResult_) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("consumerId", thrift.STRING, 1); err != nil {
		return fmt.Errorf("%T write field begin error 1:consumerId: %s", p, err)
	}
	if err := oprot.WriteString(string(p.ConsumerId)); err != nil {
		return fmt.Errorf("%T.consumerId (1) field write error: %s", p, err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 1:consumerId: %s", p, err)
	}
	return err
}

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

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

func (p *AckResult_) writeField4(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("offsets", thrift.MAP, 4); err != nil {
		return fmt.Errorf("%T write field begin error 4:offsets: %s", p, err)
	}
	if err := oprot.WriteMapBegin(thrift.STRING, thrift.MAP, len(p.Offsets)); err != nil {
		return fmt.Errorf("error writing map begin: %s", err)
	}
	for k, v := range p.Offsets {
		if err := oprot.WriteString(string(k)); err != nil {
			return fmt.Errorf("%T. (0) field write error: %s", p, err)
		}
		if err := oprot.WriteMapBegin(thrift.STRING, thrift.I64, len(v)); err != nil {
			return fmt.Errorf("error writing map begin: %s", err)
		}
		for k, v := range v {
			if err := oprot.WriteString(string(k)); err != nil {
				return fmt.Errorf("%T. (0) field write error: %s", p, err)
			}
			if err := oprot.WriteI64(int64(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.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:offsets: %s", p, err)
	}
	return err
}

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

type ConsumeStats struct {
	Group          string           `thrift:"group,1" json:"group"`
	Topic          string           `thrift:"topic,2" json:"topic"`
	ConsumeOffsets map[string]int64 `thrift:"consumeOffsets,3" json:"consumeOffsets"`
	ProduceOffsets map[string]int64 `thrift:"produceOffsets,4" json:"produceOffsets"`
}

func NewConsumeStats() *ConsumeStats {
	return &ConsumeStats{}
}

func (p *ConsumeStats) GetGroup() string {
	return p.Group
}

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

func (p *ConsumeStats) GetConsumeOffsets() map[string]int64 {
	return p.ConsumeOffsets
}

func (p *ConsumeStats) GetProduceOffsets() map[string]int64 {
	return p.ProduceOffsets
}
func (p *ConsumeStats) 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
			}
		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 *ConsumeStats) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return fmt.Errorf("error reading field 1: %s", err)
	} else {
		p.Group = v
	}
	return nil
}

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

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

func (p *ConsumeStats) 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]int64, size)
	p.ProduceOffsets = tMap
	for i := 0; i < size; i++ {
		var _key17 string
		if v, err := iprot.ReadString(); err != nil {
			return fmt.Errorf("error reading field 0: %s", err)
		} else {
			_key17 = v
		}
		var _val18 int64
		if v, err := iprot.ReadI64(); err != nil {
			return fmt.Errorf("error reading field 0: %s", err)
		} else {
			_val18 = v
		}
		p.ProduceOffsets[_key17] = _val18
	}
	if err := iprot.ReadMapEnd(); err != nil {
		return fmt.Errorf("error reading map end: %s", err)
	}
	return nil
}

func (p *ConsumeStats) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("ConsumeStats"); 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 := 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 *ConsumeStats) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("group", thrift.STRING, 1); err != nil {
		return fmt.Errorf("%T write field begin error 1:group: %s", p, err)
	}
	if err := oprot.WriteString(string(p.Group)); err != nil {
		return fmt.Errorf("%T.group (1) field write error: %s", p, err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 1:group: %s", p, err)
	}
	return err
}

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

func (p *ConsumeStats) writeField3(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("consumeOffsets", thrift.MAP, 3); err != nil {
		return fmt.Errorf("%T write field begin error 3:consumeOffsets: %s", p, err)
	}
	if err := oprot.WriteMapBegin(thrift.STRING, thrift.I64, len(p.ConsumeOffsets)); err != nil {
		return fmt.Errorf("error writing map begin: %s", err)
	}
	for k, v := range p.ConsumeOffsets {
		if err := oprot.WriteString(string(k)); err != nil {
			return fmt.Errorf("%T. (0) field write error: %s", p, err)
		}
		if err := oprot.WriteI64(int64(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 3:consumeOffsets: %s", p, err)
	}
	return err
}

func (p *ConsumeStats) writeField4(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("produceOffsets", thrift.MAP, 4); err != nil {
		return fmt.Errorf("%T write field begin error 4:produceOffsets: %s", p, err)
	}
	if err := oprot.WriteMapBegin(thrift.STRING, thrift.I64, len(p.ProduceOffsets)); err != nil {
		return fmt.Errorf("error writing map begin: %s", err)
	}
	for k, v := range p.ProduceOffsets {
		if err := oprot.WriteString(string(k)); err != nil {
			return fmt.Errorf("%T. (0) field write error: %s", p, err)
		}
		if err := oprot.WriteI64(int64(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:produceOffsets: %s", p, err)
	}
	return err
}

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

type PullException struct {
	Code    int32  `thrift:"code,1" json:"code"`
	Message string `thrift:"message,2" json:"message"`
}

func NewPullException() *PullException {
	return &PullException{}
}

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

func (p *PullException) GetMessage() string {
	return p.Message
}
func (p *PullException) 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
			}
		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 *PullException) 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 *PullException) ReadField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return fmt.Errorf("error reading field 2: %s", err)
	} else {
		p.Message = v
	}
	return nil
}

func (p *PullException) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("PullException"); 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 := 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 *PullException) 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 *PullException) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("message", thrift.STRING, 2); err != nil {
		return fmt.Errorf("%T write field begin error 2:message: %s", p, err)
	}
	if err := oprot.WriteString(string(p.Message)); err != nil {
		return fmt.Errorf("%T.message (2) field write error: %s", p, err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 2:message: %s", p, err)
	}
	return err
}

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

func (p *PullException) Error() string {
	return p.String()
}
