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

package lightstep_thrift

import (
	"bytes"
	"fmt"
	"github.com/lightstep/thrift/lib/go/thrift"
)

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

var GoUnusedProtection__ int

type KeyValue struct {
	Key   string `thrift:"Key,1,required" json:"Key"`
	Value string `thrift:"Value,2,required" json:"Value"`
}

func NewKeyValue() *KeyValue {
	return &KeyValue{}
}

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

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

func (p *KeyValue) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("KeyValue"); 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 *KeyValue) 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 *KeyValue) 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.WriteString(string(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 *KeyValue) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("KeyValue(%+v)", *p)
}

type NamedCounter struct {
	Name  string `thrift:"Name,1,required" json:"Name"`
	Value int64  `thrift:"Value,2,required" json:"Value"`
}

func NewNamedCounter() *NamedCounter {
	return &NamedCounter{}
}

func (p *NamedCounter) GetName() string {
	return p.Name
}

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

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

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

func (p *NamedCounter) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("Value", thrift.I64, 2); err != nil {
		return fmt.Errorf("%T write field begin error 2:Value: %s", p, err)
	}
	if err := oprot.WriteI64(int64(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 *NamedCounter) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("NamedCounter(%+v)", *p)
}

type Runtime struct {
	Guid        *string     `thrift:"guid,1" json:"guid"`
	StartMicros *int64      `thrift:"start_micros,2" json:"start_micros"`
	GroupName   *string     `thrift:"group_name,3" json:"group_name"`
	Attrs       []*KeyValue `thrift:"attrs,4" json:"attrs"`
}

func NewRuntime() *Runtime {
	return &Runtime{}
}

var Runtime_Guid_DEFAULT string

func (p *Runtime) GetGuid() string {
	if !p.IsSetGuid() {
		return Runtime_Guid_DEFAULT
	}
	return *p.Guid
}

var Runtime_StartMicros_DEFAULT int64

func (p *Runtime) GetStartMicros() int64 {
	if !p.IsSetStartMicros() {
		return Runtime_StartMicros_DEFAULT
	}
	return *p.StartMicros
}

var Runtime_GroupName_DEFAULT string

func (p *Runtime) GetGroupName() string {
	if !p.IsSetGroupName() {
		return Runtime_GroupName_DEFAULT
	}
	return *p.GroupName
}

var Runtime_Attrs_DEFAULT []*KeyValue

func (p *Runtime) GetAttrs() []*KeyValue {
	return p.Attrs
}
func (p *Runtime) IsSetGuid() bool {
	return p.Guid != nil
}

func (p *Runtime) IsSetStartMicros() bool {
	return p.StartMicros != nil
}

func (p *Runtime) IsSetGroupName() bool {
	return p.GroupName != nil
}

func (p *Runtime) IsSetAttrs() bool {
	return p.Attrs != nil
}

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

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

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

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

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

func (p *Runtime) writeField2(oprot thrift.TProtocol) (err error) {
	if p.IsSetStartMicros() {
		if err := oprot.WriteFieldBegin("start_micros", thrift.I64, 2); err != nil {
			return fmt.Errorf("%T write field begin error 2:start_micros: %s", p, err)
		}
		if err := oprot.WriteI64(int64(*p.StartMicros)); err != nil {
			return fmt.Errorf("%T.start_micros (2) field write error: %s", p, err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return fmt.Errorf("%T write field end error 2:start_micros: %s", p, err)
		}
	}
	return err
}

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

func (p *Runtime) writeField4(oprot thrift.TProtocol) (err error) {
	if p.IsSetAttrs() {
		if err := oprot.WriteFieldBegin("attrs", thrift.LIST, 4); err != nil {
			return fmt.Errorf("%T write field begin error 4:attrs: %s", p, err)
		}
		if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Attrs)); err != nil {
			return fmt.Errorf("error writing list begin: %s", err)
		}
		for _, v := range p.Attrs {
			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 4:attrs: %s", p, err)
		}
	}
	return err
}

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

type LogRecord struct {
	TimestampMicros *int64      `thrift:"timestamp_micros,1" json:"timestamp_micros"`
	RuntimeGuid     *string     `thrift:"runtime_guid,2" json:"runtime_guid"`
	SpanGuid        *string     `thrift:"span_guid,3" json:"span_guid"`
	StableName      *string     `thrift:"stable_name,4" json:"stable_name"`
	Message         *string     `thrift:"message,5" json:"message"`
	Level           *string     `thrift:"level,6" json:"level"`
	ThreadId        *int64      `thrift:"thread_id,7" json:"thread_id"`
	Filename        *string     `thrift:"filename,8" json:"filename"`
	LineNumber      *int64      `thrift:"line_number,9" json:"line_number"`
	StackFrames     []string    `thrift:"stack_frames,10" json:"stack_frames"`
	PayloadJson     *string     `thrift:"payload_json,11" json:"payload_json"`
	ErrorFlag       *bool       `thrift:"error_flag,12" json:"error_flag"`
	Fields          []*KeyValue `thrift:"fields,13" json:"fields"`
}

func NewLogRecord() *LogRecord {
	return &LogRecord{}
}

var LogRecord_TimestampMicros_DEFAULT int64

func (p *LogRecord) GetTimestampMicros() int64 {
	if !p.IsSetTimestampMicros() {
		return LogRecord_TimestampMicros_DEFAULT
	}
	return *p.TimestampMicros
}

var LogRecord_Fields_DEFAULT []*KeyValue

func (p *LogRecord) GetFields() []*KeyValue {
	return p.Fields
}

var LogRecord_RuntimeGuid_DEFAULT string

func (p *LogRecord) GetRuntimeGuid() string {
	if !p.IsSetRuntimeGuid() {
		return LogRecord_RuntimeGuid_DEFAULT
	}
	return *p.RuntimeGuid
}

var LogRecord_SpanGuid_DEFAULT string

func (p *LogRecord) GetSpanGuid() string {
	if !p.IsSetSpanGuid() {
		return LogRecord_SpanGuid_DEFAULT
	}
	return *p.SpanGuid
}

var LogRecord_StableName_DEFAULT string

func (p *LogRecord) GetStableName() string {
	if !p.IsSetStableName() {
		return LogRecord_StableName_DEFAULT
	}
	return *p.StableName
}

var LogRecord_Message_DEFAULT string

func (p *LogRecord) GetMessage() string {
	if !p.IsSetMessage() {
		return LogRecord_Message_DEFAULT
	}
	return *p.Message
}

var LogRecord_Level_DEFAULT string

func (p *LogRecord) GetLevel() string {
	if !p.IsSetLevel() {
		return LogRecord_Level_DEFAULT
	}
	return *p.Level
}

var LogRecord_ThreadId_DEFAULT int64

func (p *LogRecord) GetThreadId() int64 {
	if !p.IsSetThreadId() {
		return LogRecord_ThreadId_DEFAULT
	}
	return *p.ThreadId
}

var LogRecord_Filename_DEFAULT string

func (p *LogRecord) GetFilename() string {
	if !p.IsSetFilename() {
		return LogRecord_Filename_DEFAULT
	}
	return *p.Filename
}

var LogRecord_LineNumber_DEFAULT int64

func (p *LogRecord) GetLineNumber() int64 {
	if !p.IsSetLineNumber() {
		return LogRecord_LineNumber_DEFAULT
	}
	return *p.LineNumber
}

var LogRecord_StackFrames_DEFAULT []string

func (p *LogRecord) GetStackFrames() []string {
	return p.StackFrames
}

var LogRecord_PayloadJson_DEFAULT string

func (p *LogRecord) GetPayloadJson() string {
	if !p.IsSetPayloadJson() {
		return LogRecord_PayloadJson_DEFAULT
	}
	return *p.PayloadJson
}

var LogRecord_ErrorFlag_DEFAULT bool

func (p *LogRecord) GetErrorFlag() bool {
	if !p.IsSetErrorFlag() {
		return LogRecord_ErrorFlag_DEFAULT
	}
	return *p.ErrorFlag
}
func (p *LogRecord) IsSetTimestampMicros() bool {
	return p.TimestampMicros != nil
}

func (p *LogRecord) IsSetFields() bool {
	return p.Fields != nil
}

func (p *LogRecord) IsSetRuntimeGuid() bool {
	return p.RuntimeGuid != nil
}

func (p *LogRecord) IsSetSpanGuid() bool {
	return p.SpanGuid != nil
}

func (p *LogRecord) IsSetStableName() bool {
	return p.StableName != nil
}

func (p *LogRecord) IsSetMessage() bool {
	return p.Message != nil
}

func (p *LogRecord) IsSetLevel() bool {
	return p.Level != nil
}

func (p *LogRecord) IsSetThreadId() bool {
	return p.ThreadId != nil
}

func (p *LogRecord) IsSetFilename() bool {
	return p.Filename != nil
}

func (p *LogRecord) IsSetLineNumber() bool {
	return p.LineNumber != nil
}

func (p *LogRecord) IsSetStackFrames() bool {
	return p.StackFrames != nil
}

func (p *LogRecord) IsSetPayloadJson() bool {
	return p.PayloadJson != nil
}

func (p *LogRecord) IsSetErrorFlag() bool {
	return p.ErrorFlag != nil
}

func (p *LogRecord) 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 13:
			if err := p.ReadField13(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 12:
			if err := p.ReadField12(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 *LogRecord) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI64(); err != nil {
		return fmt.Errorf("error reading field 1: %s", err)
	} else {
		p.TimestampMicros = &v
	}
	return nil
}

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

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

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

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

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

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

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

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

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

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

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

func (p *LogRecord) ReadField12(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadBool(); err != nil {
		return fmt.Errorf("error reading field 12: %s", err)
	} else {
		p.ErrorFlag = &v
	}
	return nil
}

func (p *LogRecord) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("LogRecord"); 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.writeField12(oprot); err != nil {
		return err
	}
	if err := p.writeField13(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 *LogRecord) writeField1(oprot thrift.TProtocol) (err error) {
	if p.IsSetTimestampMicros() {
		if err := oprot.WriteFieldBegin("timestamp_micros", thrift.I64, 1); err != nil {
			return fmt.Errorf("%T write field begin error 1:timestamp_micros: %s", p, err)
		}
		if err := oprot.WriteI64(int64(*p.TimestampMicros)); err != nil {
			return fmt.Errorf("%T.timestamp_micros (1) field write error: %s", p, err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return fmt.Errorf("%T write field end error 1:timestamp_micros: %s", p, err)
		}
	}
	return err
}

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

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

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

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

func (p *LogRecord) writeField6(oprot thrift.TProtocol) (err error) {
	if p.IsSetLevel() {
		if err := oprot.WriteFieldBegin("level", thrift.STRING, 6); err != nil {
			return fmt.Errorf("%T write field begin error 6:level: %s", p, err)
		}
		if err := oprot.WriteString(string(*p.Level)); err != nil {
			return fmt.Errorf("%T.level (6) field write error: %s", p, err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return fmt.Errorf("%T write field end error 6:level: %s", p, err)
		}
	}
	return err
}

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

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

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

func (p *LogRecord) writeField10(oprot thrift.TProtocol) (err error) {
	if p.IsSetStackFrames() {
		if err := oprot.WriteFieldBegin("stack_frames", thrift.LIST, 10); err != nil {
			return fmt.Errorf("%T write field begin error 10:stack_frames: %s", p, err)
		}
		if err := oprot.WriteListBegin(thrift.STRING, len(p.StackFrames)); err != nil {
			return fmt.Errorf("error writing list begin: %s", err)
		}
		for _, v := range p.StackFrames {
			if err := oprot.WriteString(string(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 10:stack_frames: %s", p, err)
		}
	}
	return err
}

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

func (p *LogRecord) writeField12(oprot thrift.TProtocol) (err error) {
	if p.IsSetErrorFlag() {
		if err := oprot.WriteFieldBegin("error_flag", thrift.BOOL, 12); err != nil {
			return fmt.Errorf("%T write field begin error 12:error_flag: %s", p, err)
		}
		if err := oprot.WriteBool(bool(*p.ErrorFlag)); err != nil {
			return fmt.Errorf("%T.error_flag (12) field write error: %s", p, err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return fmt.Errorf("%T write field end error 12:error_flag: %s", p, err)
		}
	}
	return err
}

func (p *LogRecord) writeField13(oprot thrift.TProtocol) (err error) {
	if p.IsSetFields() {
		if err := oprot.WriteFieldBegin("fields", thrift.LIST, 13); err != nil {
			return fmt.Errorf("%T write field begin error 13:fields: %s", p, err)
		}
		if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Fields)); err != nil {
			return fmt.Errorf("error writing list begin: %s", err)
		}
		for _, v := range p.Fields {
			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 13:fields: %s", p, err)
		}
	}
	return err
}

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

type TraceJoinId struct {
	TraceKey string `thrift:"TraceKey,1,required" json:"TraceKey"`
	Value    string `thrift:"Value,2,required" json:"Value"`
}

func NewTraceJoinId() *TraceJoinId {
	return &TraceJoinId{}
}

func (p *TraceJoinId) GetTraceKey() string {
	return p.TraceKey
}

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

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

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

func (p *TraceJoinId) 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.WriteString(string(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 *TraceJoinId) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("TraceJoinId(%+v)", *p)
}

type SpanRecord struct {
	SpanGuid       *string        `thrift:"span_guid,1" json:"span_guid"`
	RuntimeGuid    *string        `thrift:"runtime_guid,2" json:"runtime_guid"`
	SpanName       *string        `thrift:"span_name,3" json:"span_name"`
	JoinIds        []*TraceJoinId `thrift:"join_ids,4" json:"join_ids"`
	OldestMicros   *int64         `thrift:"oldest_micros,5" json:"oldest_micros"`
	YoungestMicros *int64         `thrift:"youngest_micros,6" json:"youngest_micros"`
	// unused field # 7
	Attributes []*KeyValue  `thrift:"attributes,8" json:"attributes"`
	ErrorFlag  *bool        `thrift:"error_flag,9" json:"error_flag"`
	LogRecords []*LogRecord `thrift:"log_records,10" json:"log_records"`
	TraceGuid  *string      `thrift:"trace_guid,11" json:"trace_guid"`
}

func NewSpanRecord() *SpanRecord {
	return &SpanRecord{}
}

var SpanRecord_SpanGuid_DEFAULT string

func (p *SpanRecord) GetSpanGuid() string {
	if !p.IsSetSpanGuid() {
		return SpanRecord_SpanGuid_DEFAULT
	}
	return *p.SpanGuid
}

var SpanRecord_TraceGuid_DEFAULT string

func (p *SpanRecord) GetTraceGuid() string {
	if !p.IsSetTraceGuid() {
		return SpanRecord_TraceGuid_DEFAULT
	}
	return *p.TraceGuid
}

var SpanRecord_RuntimeGuid_DEFAULT string

func (p *SpanRecord) GetRuntimeGuid() string {
	if !p.IsSetRuntimeGuid() {
		return SpanRecord_RuntimeGuid_DEFAULT
	}
	return *p.RuntimeGuid
}

var SpanRecord_SpanName_DEFAULT string

func (p *SpanRecord) GetSpanName() string {
	if !p.IsSetSpanName() {
		return SpanRecord_SpanName_DEFAULT
	}
	return *p.SpanName
}

var SpanRecord_JoinIds_DEFAULT []*TraceJoinId

func (p *SpanRecord) GetJoinIds() []*TraceJoinId {
	return p.JoinIds
}

var SpanRecord_OldestMicros_DEFAULT int64

func (p *SpanRecord) GetOldestMicros() int64 {
	if !p.IsSetOldestMicros() {
		return SpanRecord_OldestMicros_DEFAULT
	}
	return *p.OldestMicros
}

var SpanRecord_YoungestMicros_DEFAULT int64

func (p *SpanRecord) GetYoungestMicros() int64 {
	if !p.IsSetYoungestMicros() {
		return SpanRecord_YoungestMicros_DEFAULT
	}
	return *p.YoungestMicros
}

var SpanRecord_Attributes_DEFAULT []*KeyValue

func (p *SpanRecord) GetAttributes() []*KeyValue {
	return p.Attributes
}

var SpanRecord_ErrorFlag_DEFAULT bool

func (p *SpanRecord) GetErrorFlag() bool {
	if !p.IsSetErrorFlag() {
		return SpanRecord_ErrorFlag_DEFAULT
	}
	return *p.ErrorFlag
}

var SpanRecord_LogRecords_DEFAULT []*LogRecord

func (p *SpanRecord) GetLogRecords() []*LogRecord {
	return p.LogRecords
}
func (p *SpanRecord) IsSetSpanGuid() bool {
	return p.SpanGuid != nil
}

func (p *SpanRecord) IsSetTraceGuid() bool {
	return p.TraceGuid != nil
}

func (p *SpanRecord) IsSetRuntimeGuid() bool {
	return p.RuntimeGuid != nil
}

func (p *SpanRecord) IsSetSpanName() bool {
	return p.SpanName != nil
}

func (p *SpanRecord) IsSetJoinIds() bool {
	return p.JoinIds != nil
}

func (p *SpanRecord) IsSetOldestMicros() bool {
	return p.OldestMicros != nil
}

func (p *SpanRecord) IsSetYoungestMicros() bool {
	return p.YoungestMicros != nil
}

func (p *SpanRecord) IsSetAttributes() bool {
	return p.Attributes != nil
}

func (p *SpanRecord) IsSetErrorFlag() bool {
	return p.ErrorFlag != nil
}

func (p *SpanRecord) IsSetLogRecords() bool {
	return p.LogRecords != nil
}

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

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

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

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

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

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

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

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

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

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

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

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

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

func (p *SpanRecord) writeField4(oprot thrift.TProtocol) (err error) {
	if p.IsSetJoinIds() {
		if err := oprot.WriteFieldBegin("join_ids", thrift.LIST, 4); err != nil {
			return fmt.Errorf("%T write field begin error 4:join_ids: %s", p, err)
		}
		if err := oprot.WriteListBegin(thrift.STRUCT, len(p.JoinIds)); err != nil {
			return fmt.Errorf("error writing list begin: %s", err)
		}
		for _, v := range p.JoinIds {
			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 4:join_ids: %s", p, err)
		}
	}
	return err
}

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

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

func (p *SpanRecord) writeField8(oprot thrift.TProtocol) (err error) {
	if p.IsSetAttributes() {
		if err := oprot.WriteFieldBegin("attributes", thrift.LIST, 8); err != nil {
			return fmt.Errorf("%T write field begin error 8:attributes: %s", p, err)
		}
		if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Attributes)); err != nil {
			return fmt.Errorf("error writing list begin: %s", err)
		}
		for _, v := range p.Attributes {
			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 8:attributes: %s", p, err)
		}
	}
	return err
}

func (p *SpanRecord) writeField9(oprot thrift.TProtocol) (err error) {
	if p.IsSetErrorFlag() {
		if err := oprot.WriteFieldBegin("error_flag", thrift.BOOL, 9); err != nil {
			return fmt.Errorf("%T write field begin error 9:error_flag: %s", p, err)
		}
		if err := oprot.WriteBool(bool(*p.ErrorFlag)); err != nil {
			return fmt.Errorf("%T.error_flag (9) field write error: %s", p, err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return fmt.Errorf("%T write field end error 9:error_flag: %s", p, err)
		}
	}
	return err
}

func (p *SpanRecord) writeField10(oprot thrift.TProtocol) (err error) {
	if p.IsSetLogRecords() {
		if err := oprot.WriteFieldBegin("log_records", thrift.LIST, 10); err != nil {
			return fmt.Errorf("%T write field begin error 10:log_records: %s", p, err)
		}
		if err := oprot.WriteListBegin(thrift.STRUCT, len(p.LogRecords)); err != nil {
			return fmt.Errorf("error writing list begin: %s", err)
		}
		for _, v := range p.LogRecords {
			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:log_records: %s", p, err)
		}
	}
	return err
}

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

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

type Auth struct {
	AccessToken *string `thrift:"access_token,1" json:"access_token"`
}

func NewAuth() *Auth {
	return &Auth{}
}

var Auth_AccessToken_DEFAULT string

func (p *Auth) GetAccessToken() string {
	if !p.IsSetAccessToken() {
		return Auth_AccessToken_DEFAULT
	}
	return *p.AccessToken
}
func (p *Auth) IsSetAccessToken() bool {
	return p.AccessToken != nil
}

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

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

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

type Timing struct {
	ReceiveMicros  *int64 `thrift:"receive_micros,1" json:"receive_micros"`
	TransmitMicros *int64 `thrift:"transmit_micros,2" json:"transmit_micros"`
}

func NewTiming() *Timing {
	return &Timing{}
}

var Timing_ReceiveMicros_DEFAULT int64

func (p *Timing) GetReceiveMicros() int64 {
	if !p.IsSetReceiveMicros() {
		return Timing_ReceiveMicros_DEFAULT
	}
	return *p.ReceiveMicros
}

var Timing_TransmitMicros_DEFAULT int64

func (p *Timing) GetTransmitMicros() int64 {
	if !p.IsSetTransmitMicros() {
		return Timing_TransmitMicros_DEFAULT
	}
	return *p.TransmitMicros
}
func (p *Timing) IsSetReceiveMicros() bool {
	return p.ReceiveMicros != nil
}

func (p *Timing) IsSetTransmitMicros() bool {
	return p.TransmitMicros != nil
}

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

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

func (p *Timing) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("Timing"); 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 *Timing) writeField1(oprot thrift.TProtocol) (err error) {
	if p.IsSetReceiveMicros() {
		if err := oprot.WriteFieldBegin("receive_micros", thrift.I64, 1); err != nil {
			return fmt.Errorf("%T write field begin error 1:receive_micros: %s", p, err)
		}
		if err := oprot.WriteI64(int64(*p.ReceiveMicros)); err != nil {
			return fmt.Errorf("%T.receive_micros (1) field write error: %s", p, err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return fmt.Errorf("%T write field end error 1:receive_micros: %s", p, err)
		}
	}
	return err
}

func (p *Timing) writeField2(oprot thrift.TProtocol) (err error) {
	if p.IsSetTransmitMicros() {
		if err := oprot.WriteFieldBegin("transmit_micros", thrift.I64, 2); err != nil {
			return fmt.Errorf("%T write field begin error 2:transmit_micros: %s", p, err)
		}
		if err := oprot.WriteI64(int64(*p.TransmitMicros)); err != nil {
			return fmt.Errorf("%T.transmit_micros (2) field write error: %s", p, err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return fmt.Errorf("%T write field end error 2:transmit_micros: %s", p, err)
		}
	}
	return err
}

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

type SampleCount struct {
	OldestMicros   *int64 `thrift:"oldest_micros,1" json:"oldest_micros"`
	YoungestMicros *int64 `thrift:"youngest_micros,2" json:"youngest_micros"`
	Count          *int64 `thrift:"count,3" json:"count"`
}

func NewSampleCount() *SampleCount {
	return &SampleCount{}
}

var SampleCount_OldestMicros_DEFAULT int64

func (p *SampleCount) GetOldestMicros() int64 {
	if !p.IsSetOldestMicros() {
		return SampleCount_OldestMicros_DEFAULT
	}
	return *p.OldestMicros
}

var SampleCount_YoungestMicros_DEFAULT int64

func (p *SampleCount) GetYoungestMicros() int64 {
	if !p.IsSetYoungestMicros() {
		return SampleCount_YoungestMicros_DEFAULT
	}
	return *p.YoungestMicros
}

var SampleCount_Count_DEFAULT int64

func (p *SampleCount) GetCount() int64 {
	if !p.IsSetCount() {
		return SampleCount_Count_DEFAULT
	}
	return *p.Count
}
func (p *SampleCount) IsSetOldestMicros() bool {
	return p.OldestMicros != nil
}

func (p *SampleCount) IsSetYoungestMicros() bool {
	return p.YoungestMicros != nil
}

func (p *SampleCount) IsSetCount() bool {
	return p.Count != nil
}

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

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

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

func (p *SampleCount) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("SampleCount"); 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 *SampleCount) writeField1(oprot thrift.TProtocol) (err error) {
	if p.IsSetOldestMicros() {
		if err := oprot.WriteFieldBegin("oldest_micros", thrift.I64, 1); err != nil {
			return fmt.Errorf("%T write field begin error 1:oldest_micros: %s", p, err)
		}
		if err := oprot.WriteI64(int64(*p.OldestMicros)); err != nil {
			return fmt.Errorf("%T.oldest_micros (1) field write error: %s", p, err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return fmt.Errorf("%T write field end error 1:oldest_micros: %s", p, err)
		}
	}
	return err
}

func (p *SampleCount) writeField2(oprot thrift.TProtocol) (err error) {
	if p.IsSetYoungestMicros() {
		if err := oprot.WriteFieldBegin("youngest_micros", thrift.I64, 2); err != nil {
			return fmt.Errorf("%T write field begin error 2:youngest_micros: %s", p, err)
		}
		if err := oprot.WriteI64(int64(*p.YoungestMicros)); err != nil {
			return fmt.Errorf("%T.youngest_micros (2) field write error: %s", p, err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return fmt.Errorf("%T write field end error 2:youngest_micros: %s", p, err)
		}
	}
	return err
}

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

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

type MetricsSample struct {
	Name        string   `thrift:"name,1,required" json:"name"`
	Int64Value  *int64   `thrift:"int64_value,2" json:"int64_value"`
	DoubleValue *float64 `thrift:"double_value,3" json:"double_value"`
}

func NewMetricsSample() *MetricsSample {
	return &MetricsSample{}
}

func (p *MetricsSample) GetName() string {
	return p.Name
}

var MetricsSample_Int64Value_DEFAULT int64

func (p *MetricsSample) GetInt64Value() int64 {
	if !p.IsSetInt64Value() {
		return MetricsSample_Int64Value_DEFAULT
	}
	return *p.Int64Value
}

var MetricsSample_DoubleValue_DEFAULT float64

func (p *MetricsSample) GetDoubleValue() float64 {
	if !p.IsSetDoubleValue() {
		return MetricsSample_DoubleValue_DEFAULT
	}
	return *p.DoubleValue
}
func (p *MetricsSample) IsSetInt64Value() bool {
	return p.Int64Value != nil
}

func (p *MetricsSample) IsSetDoubleValue() bool {
	return p.DoubleValue != nil
}

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

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

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

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

func (p *MetricsSample) writeField2(oprot thrift.TProtocol) (err error) {
	if p.IsSetInt64Value() {
		if err := oprot.WriteFieldBegin("int64_value", thrift.I64, 2); err != nil {
			return fmt.Errorf("%T write field begin error 2:int64_value: %s", p, err)
		}
		if err := oprot.WriteI64(int64(*p.Int64Value)); err != nil {
			return fmt.Errorf("%T.int64_value (2) field write error: %s", p, err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return fmt.Errorf("%T write field end error 2:int64_value: %s", p, err)
		}
	}
	return err
}

func (p *MetricsSample) writeField3(oprot thrift.TProtocol) (err error) {
	if p.IsSetDoubleValue() {
		if err := oprot.WriteFieldBegin("double_value", thrift.DOUBLE, 3); err != nil {
			return fmt.Errorf("%T write field begin error 3:double_value: %s", p, err)
		}
		if err := oprot.WriteDouble(float64(*p.DoubleValue)); err != nil {
			return fmt.Errorf("%T.double_value (3) field write error: %s", p, err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return fmt.Errorf("%T write field end error 3:double_value: %s", p, err)
		}
	}
	return err
}

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

type Metrics struct {
	Counts []*MetricsSample `thrift:"counts,1" json:"counts"`
	Gauges []*MetricsSample `thrift:"gauges,2" json:"gauges"`
}

func NewMetrics() *Metrics {
	return &Metrics{}
}

var Metrics_Counts_DEFAULT []*MetricsSample

func (p *Metrics) GetCounts() []*MetricsSample {
	return p.Counts
}

var Metrics_Gauges_DEFAULT []*MetricsSample

func (p *Metrics) GetGauges() []*MetricsSample {
	return p.Gauges
}
func (p *Metrics) IsSetCounts() bool {
	return p.Counts != nil
}

func (p *Metrics) IsSetGauges() bool {
	return p.Gauges != nil
}

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

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

func (p *Metrics) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("Metrics"); 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 *Metrics) writeField1(oprot thrift.TProtocol) (err error) {
	if p.IsSetCounts() {
		if err := oprot.WriteFieldBegin("counts", thrift.LIST, 1); err != nil {
			return fmt.Errorf("%T write field begin error 1:counts: %s", p, err)
		}
		if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Counts)); err != nil {
			return fmt.Errorf("error writing list begin: %s", err)
		}
		for _, v := range p.Counts {
			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 1:counts: %s", p, err)
		}
	}
	return err
}

func (p *Metrics) writeField2(oprot thrift.TProtocol) (err error) {
	if p.IsSetGauges() {
		if err := oprot.WriteFieldBegin("gauges", thrift.LIST, 2); err != nil {
			return fmt.Errorf("%T write field begin error 2:gauges: %s", p, err)
		}
		if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Gauges)); err != nil {
			return fmt.Errorf("error writing list begin: %s", err)
		}
		for _, v := range p.Gauges {
			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:gauges: %s", p, err)
		}
	}
	return err
}

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

type ReportRequest struct {
	Runtime *Runtime `thrift:"runtime,1" json:"runtime"`
	// unused field # 2
	SpanRecords           []*SpanRecord `thrift:"span_records,3" json:"span_records"`
	LogRecords            []*LogRecord  `thrift:"log_records,4" json:"log_records"`
	TimestampOffsetMicros *int64        `thrift:"timestamp_offset_micros,5" json:"timestamp_offset_micros"`
	// unused field # 6
	OldestMicros    *int64          `thrift:"oldest_micros,7" json:"oldest_micros"`
	YoungestMicros  *int64          `thrift:"youngest_micros,8" json:"youngest_micros"`
	Counters        []*NamedCounter `thrift:"counters,9" json:"counters"`
	InternalLogs    []*LogRecord    `thrift:"internal_logs,10" json:"internal_logs"`
	InternalMetrics *Metrics        `thrift:"internal_metrics,11" json:"internal_metrics"`
}

func NewReportRequest() *ReportRequest {
	return &ReportRequest{}
}

var ReportRequest_Runtime_DEFAULT *Runtime

func (p *ReportRequest) GetRuntime() *Runtime {
	if !p.IsSetRuntime() {
		return ReportRequest_Runtime_DEFAULT
	}
	return p.Runtime
}

var ReportRequest_SpanRecords_DEFAULT []*SpanRecord

func (p *ReportRequest) GetSpanRecords() []*SpanRecord {
	return p.SpanRecords
}

var ReportRequest_LogRecords_DEFAULT []*LogRecord

func (p *ReportRequest) GetLogRecords() []*LogRecord {
	return p.LogRecords
}

var ReportRequest_TimestampOffsetMicros_DEFAULT int64

func (p *ReportRequest) GetTimestampOffsetMicros() int64 {
	if !p.IsSetTimestampOffsetMicros() {
		return ReportRequest_TimestampOffsetMicros_DEFAULT
	}
	return *p.TimestampOffsetMicros
}

var ReportRequest_OldestMicros_DEFAULT int64

func (p *ReportRequest) GetOldestMicros() int64 {
	if !p.IsSetOldestMicros() {
		return ReportRequest_OldestMicros_DEFAULT
	}
	return *p.OldestMicros
}

var ReportRequest_YoungestMicros_DEFAULT int64

func (p *ReportRequest) GetYoungestMicros() int64 {
	if !p.IsSetYoungestMicros() {
		return ReportRequest_YoungestMicros_DEFAULT
	}
	return *p.YoungestMicros
}

var ReportRequest_Counters_DEFAULT []*NamedCounter

func (p *ReportRequest) GetCounters() []*NamedCounter {
	return p.Counters
}

var ReportRequest_InternalLogs_DEFAULT []*LogRecord

func (p *ReportRequest) GetInternalLogs() []*LogRecord {
	return p.InternalLogs
}

var ReportRequest_InternalMetrics_DEFAULT *Metrics

func (p *ReportRequest) GetInternalMetrics() *Metrics {
	if !p.IsSetInternalMetrics() {
		return ReportRequest_InternalMetrics_DEFAULT
	}
	return p.InternalMetrics
}
func (p *ReportRequest) IsSetRuntime() bool {
	return p.Runtime != nil
}

func (p *ReportRequest) IsSetSpanRecords() bool {
	return p.SpanRecords != nil
}

func (p *ReportRequest) IsSetLogRecords() bool {
	return p.LogRecords != nil
}

func (p *ReportRequest) IsSetTimestampOffsetMicros() bool {
	return p.TimestampOffsetMicros != nil
}

func (p *ReportRequest) IsSetOldestMicros() bool {
	return p.OldestMicros != nil
}

func (p *ReportRequest) IsSetYoungestMicros() bool {
	return p.YoungestMicros != nil
}

func (p *ReportRequest) IsSetCounters() bool {
	return p.Counters != nil
}

func (p *ReportRequest) IsSetInternalLogs() bool {
	return p.InternalLogs != nil
}

func (p *ReportRequest) IsSetInternalMetrics() bool {
	return p.InternalMetrics != nil
}

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

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

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

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

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

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

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

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

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

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

func (p *ReportRequest) writeField3(oprot thrift.TProtocol) (err error) {
	if p.IsSetSpanRecords() {
		if err := oprot.WriteFieldBegin("span_records", thrift.LIST, 3); err != nil {
			return fmt.Errorf("%T write field begin error 3:span_records: %s", p, err)
		}
		if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SpanRecords)); err != nil {
			return fmt.Errorf("error writing list begin: %s", err)
		}
		for _, v := range p.SpanRecords {
			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 3:span_records: %s", p, err)
		}
	}
	return err
}

func (p *ReportRequest) writeField4(oprot thrift.TProtocol) (err error) {
	if p.IsSetLogRecords() {
		if err := oprot.WriteFieldBegin("log_records", thrift.LIST, 4); err != nil {
			return fmt.Errorf("%T write field begin error 4:log_records: %s", p, err)
		}
		if err := oprot.WriteListBegin(thrift.STRUCT, len(p.LogRecords)); err != nil {
			return fmt.Errorf("error writing list begin: %s", err)
		}
		for _, v := range p.LogRecords {
			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 4:log_records: %s", p, err)
		}
	}
	return err
}

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

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

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

func (p *ReportRequest) writeField9(oprot thrift.TProtocol) (err error) {
	if p.IsSetCounters() {
		if err := oprot.WriteFieldBegin("counters", thrift.LIST, 9); err != nil {
			return fmt.Errorf("%T write field begin error 9:counters: %s", p, err)
		}
		if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Counters)); err != nil {
			return fmt.Errorf("error writing list begin: %s", err)
		}
		for _, v := range p.Counters {
			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 9:counters: %s", p, err)
		}
	}
	return err
}

func (p *ReportRequest) writeField10(oprot thrift.TProtocol) (err error) {
	if p.IsSetInternalLogs() {
		if err := oprot.WriteFieldBegin("internal_logs", thrift.LIST, 10); err != nil {
			return fmt.Errorf("%T write field begin error 10:internal_logs: %s", p, err)
		}
		if err := oprot.WriteListBegin(thrift.STRUCT, len(p.InternalLogs)); err != nil {
			return fmt.Errorf("error writing list begin: %s", err)
		}
		for _, v := range p.InternalLogs {
			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:internal_logs: %s", p, err)
		}
	}
	return err
}

func (p *ReportRequest) writeField11(oprot thrift.TProtocol) (err error) {
	if p.IsSetInternalMetrics() {
		if err := oprot.WriteFieldBegin("internal_metrics", thrift.STRUCT, 11); err != nil {
			return fmt.Errorf("%T write field begin error 11:internal_metrics: %s", p, err)
		}
		if err := p.InternalMetrics.Write(oprot); err != nil {
			return fmt.Errorf("%T error writing struct: %s", p.InternalMetrics, err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return fmt.Errorf("%T write field end error 11:internal_metrics: %s", p, err)
		}
	}
	return err
}

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

type Command struct {
	Disable *bool `thrift:"disable,1" json:"disable"`
}

func NewCommand() *Command {
	return &Command{}
}

var Command_Disable_DEFAULT bool

func (p *Command) GetDisable() bool {
	if !p.IsSetDisable() {
		return Command_Disable_DEFAULT
	}
	return *p.Disable
}
func (p *Command) IsSetDisable() bool {
	return p.Disable != nil
}

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

func (p *Command) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("Command"); err != nil {
		return fmt.Errorf("%T write struct begin error: %s", p, err)
	}
	if err := p.writeField1(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 *Command) writeField1(oprot thrift.TProtocol) (err error) {
	if p.IsSetDisable() {
		if err := oprot.WriteFieldBegin("disable", thrift.BOOL, 1); err != nil {
			return fmt.Errorf("%T write field begin error 1:disable: %s", p, err)
		}
		if err := oprot.WriteBool(bool(*p.Disable)); err != nil {
			return fmt.Errorf("%T.disable (1) field write error: %s", p, err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return fmt.Errorf("%T write field end error 1:disable: %s", p, err)
		}
	}
	return err
}

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

type ReportResponse struct {
	Commands []*Command `thrift:"commands,1" json:"commands"`
	Timing   *Timing    `thrift:"timing,2" json:"timing"`
	Errors   []string   `thrift:"errors,3" json:"errors"`
}

func NewReportResponse() *ReportResponse {
	return &ReportResponse{}
}

var ReportResponse_Commands_DEFAULT []*Command

func (p *ReportResponse) GetCommands() []*Command {
	return p.Commands
}

var ReportResponse_Timing_DEFAULT *Timing

func (p *ReportResponse) GetTiming() *Timing {
	if !p.IsSetTiming() {
		return ReportResponse_Timing_DEFAULT
	}
	return p.Timing
}

var ReportResponse_Errors_DEFAULT []string

func (p *ReportResponse) GetErrors() []string {
	return p.Errors
}
func (p *ReportResponse) IsSetCommands() bool {
	return p.Commands != nil
}

func (p *ReportResponse) IsSetTiming() bool {
	return p.Timing != nil
}

func (p *ReportResponse) IsSetErrors() bool {
	return p.Errors != nil
}

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

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

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

func (p *ReportResponse) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("ReportResponse"); 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 *ReportResponse) writeField1(oprot thrift.TProtocol) (err error) {
	if p.IsSetCommands() {
		if err := oprot.WriteFieldBegin("commands", thrift.LIST, 1); err != nil {
			return fmt.Errorf("%T write field begin error 1:commands: %s", p, err)
		}
		if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Commands)); err != nil {
			return fmt.Errorf("error writing list begin: %s", err)
		}
		for _, v := range p.Commands {
			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 1:commands: %s", p, err)
		}
	}
	return err
}

func (p *ReportResponse) writeField2(oprot thrift.TProtocol) (err error) {
	if p.IsSetTiming() {
		if err := oprot.WriteFieldBegin("timing", thrift.STRUCT, 2); err != nil {
			return fmt.Errorf("%T write field begin error 2:timing: %s", p, err)
		}
		if err := p.Timing.Write(oprot); err != nil {
			return fmt.Errorf("%T error writing struct: %s", p.Timing, err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return fmt.Errorf("%T write field end error 2:timing: %s", p, err)
		}
	}
	return err
}

func (p *ReportResponse) writeField3(oprot thrift.TProtocol) (err error) {
	if p.IsSetErrors() {
		if err := oprot.WriteFieldBegin("errors", thrift.LIST, 3); err != nil {
			return fmt.Errorf("%T write field begin error 3:errors: %s", p, err)
		}
		if err := oprot.WriteListBegin(thrift.STRING, len(p.Errors)); err != nil {
			return fmt.Errorf("error writing list begin: %s", err)
		}
		for _, v := range p.Errors {
			if err := oprot.WriteString(string(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:errors: %s", p, err)
		}
	}
	return err
}

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