// Code generated by thriftrw v1.29.2. DO NOT EDIT.
// @generated

package matching

import (
	bytes "bytes"
	base64 "encoding/base64"
	json "encoding/json"
	errors "errors"
	fmt "fmt"
	math "math"
	strconv "strconv"
	strings "strings"

	multierr "go.uber.org/multierr"
	stream "go.uber.org/thriftrw/protocol/stream"
	thriftreflect "go.uber.org/thriftrw/thriftreflect"
	wire "go.uber.org/thriftrw/wire"
	zapcore "go.uber.org/zap/zapcore"

	shared "github.com/uber/cadence/.gen/go/shared"
)

type ActivityTaskDispatchInfo struct {
	ScheduledEvent                  *shared.HistoryEvent `json:"scheduledEvent,omitempty"`
	StartedTimestamp                *int64               `json:"startedTimestamp,omitempty"`
	Attempt                         *int64               `json:"attempt,omitempty"`
	ScheduledTimestampOfThisAttempt *int64               `json:"scheduledTimestampOfThisAttempt,omitempty"`
	ScheduledTimestamp              *int64               `json:"scheduledTimestamp,omitempty"`
	HeartbeatDetails                []byte               `json:"heartbeatDetails,omitempty"`
	WorkflowType                    *shared.WorkflowType `json:"workflowType,omitempty"`
	WorkflowDomain                  *string              `json:"workflowDomain,omitempty"`
}

// ToWire translates a ActivityTaskDispatchInfo struct into a Thrift-level intermediate
// representation. This intermediate representation may be serialized
// into bytes using a ThriftRW protocol implementation.
//
// An error is returned if the struct or any of its fields failed to
// validate.
//
//	x, err := v.ToWire()
//	if err != nil {
//	  return err
//	}
//
//	if err := binaryProtocol.Encode(x, writer); err != nil {
//	  return err
//	}
func (v *ActivityTaskDispatchInfo) ToWire() (wire.Value, error) {
	var (
		fields [8]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.ScheduledEvent != nil {
		w, err = v.ScheduledEvent.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.StartedTimestamp != nil {
		w, err = wire.NewValueI64(*(v.StartedTimestamp)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.Attempt != nil {
		w, err = wire.NewValueI64(*(v.Attempt)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.ScheduledTimestampOfThisAttempt != nil {
		w, err = wire.NewValueI64(*(v.ScheduledTimestampOfThisAttempt)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 40, Value: w}
		i++
	}
	if v.ScheduledTimestamp != nil {
		w, err = wire.NewValueI64(*(v.ScheduledTimestamp)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 50, Value: w}
		i++
	}
	if v.HeartbeatDetails != nil {
		w, err = wire.NewValueBinary(v.HeartbeatDetails), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 60, Value: w}
		i++
	}
	if v.WorkflowType != nil {
		w, err = v.WorkflowType.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 70, Value: w}
		i++
	}
	if v.WorkflowDomain != nil {
		w, err = wire.NewValueString(*(v.WorkflowDomain)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 80, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

func _HistoryEvent_Read(w wire.Value) (*shared.HistoryEvent, error) {
	var v shared.HistoryEvent
	err := v.FromWire(w)
	return &v, err
}

func _WorkflowType_Read(w wire.Value) (*shared.WorkflowType, error) {
	var v shared.WorkflowType
	err := v.FromWire(w)
	return &v, err
}

// FromWire deserializes a ActivityTaskDispatchInfo struct from its Thrift-level
// representation. The Thrift-level representation may be obtained
// from a ThriftRW protocol implementation.
//
// An error is returned if we were unable to build a ActivityTaskDispatchInfo struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v ActivityTaskDispatchInfo
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *ActivityTaskDispatchInfo) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			if field.Value.Type() == wire.TStruct {
				v.ScheduledEvent, err = _HistoryEvent_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 20:
			if field.Value.Type() == wire.TI64 {
				var x int64
				x, err = field.Value.GetI64(), error(nil)
				v.StartedTimestamp = &x
				if err != nil {
					return err
				}

			}
		case 30:
			if field.Value.Type() == wire.TI64 {
				var x int64
				x, err = field.Value.GetI64(), error(nil)
				v.Attempt = &x
				if err != nil {
					return err
				}

			}
		case 40:
			if field.Value.Type() == wire.TI64 {
				var x int64
				x, err = field.Value.GetI64(), error(nil)
				v.ScheduledTimestampOfThisAttempt = &x
				if err != nil {
					return err
				}

			}
		case 50:
			if field.Value.Type() == wire.TI64 {
				var x int64
				x, err = field.Value.GetI64(), error(nil)
				v.ScheduledTimestamp = &x
				if err != nil {
					return err
				}

			}
		case 60:
			if field.Value.Type() == wire.TBinary {
				v.HeartbeatDetails, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		case 70:
			if field.Value.Type() == wire.TStruct {
				v.WorkflowType, err = _WorkflowType_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 80:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.WorkflowDomain = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// Encode serializes a ActivityTaskDispatchInfo struct directly into bytes, without going
// through an intermediary type.
//
// An error is returned if a ActivityTaskDispatchInfo struct could not be encoded.
func (v *ActivityTaskDispatchInfo) Encode(sw stream.Writer) error {
	if err := sw.WriteStructBegin(); err != nil {
		return err
	}

	if v.ScheduledEvent != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 10, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.ScheduledEvent.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.StartedTimestamp != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 20, Type: wire.TI64}); err != nil {
			return err
		}
		if err := sw.WriteInt64(*(v.StartedTimestamp)); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.Attempt != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 30, Type: wire.TI64}); err != nil {
			return err
		}
		if err := sw.WriteInt64(*(v.Attempt)); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.ScheduledTimestampOfThisAttempt != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 40, Type: wire.TI64}); err != nil {
			return err
		}
		if err := sw.WriteInt64(*(v.ScheduledTimestampOfThisAttempt)); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.ScheduledTimestamp != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 50, Type: wire.TI64}); err != nil {
			return err
		}
		if err := sw.WriteInt64(*(v.ScheduledTimestamp)); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.HeartbeatDetails != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 60, Type: wire.TBinary}); err != nil {
			return err
		}
		if err := sw.WriteBinary(v.HeartbeatDetails); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.WorkflowType != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 70, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.WorkflowType.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.WorkflowDomain != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 80, Type: wire.TBinary}); err != nil {
			return err
		}
		if err := sw.WriteString(*(v.WorkflowDomain)); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	return sw.WriteStructEnd()
}

func _HistoryEvent_Decode(sr stream.Reader) (*shared.HistoryEvent, error) {
	var v shared.HistoryEvent
	err := v.Decode(sr)
	return &v, err
}

func _WorkflowType_Decode(sr stream.Reader) (*shared.WorkflowType, error) {
	var v shared.WorkflowType
	err := v.Decode(sr)
	return &v, err
}

// Decode deserializes a ActivityTaskDispatchInfo struct directly from its Thrift-level
// representation, without going through an intemediary type.
//
// An error is returned if a ActivityTaskDispatchInfo struct could not be generated from the wire
// representation.
func (v *ActivityTaskDispatchInfo) Decode(sr stream.Reader) error {

	if err := sr.ReadStructBegin(); err != nil {
		return err
	}

	fh, ok, err := sr.ReadFieldBegin()
	if err != nil {
		return err
	}

	for ok {
		switch {
		case fh.ID == 10 && fh.Type == wire.TStruct:
			v.ScheduledEvent, err = _HistoryEvent_Decode(sr)
			if err != nil {
				return err
			}

		case fh.ID == 20 && fh.Type == wire.TI64:
			var x int64
			x, err = sr.ReadInt64()
			v.StartedTimestamp = &x
			if err != nil {
				return err
			}

		case fh.ID == 30 && fh.Type == wire.TI64:
			var x int64
			x, err = sr.ReadInt64()
			v.Attempt = &x
			if err != nil {
				return err
			}

		case fh.ID == 40 && fh.Type == wire.TI64:
			var x int64
			x, err = sr.ReadInt64()
			v.ScheduledTimestampOfThisAttempt = &x
			if err != nil {
				return err
			}

		case fh.ID == 50 && fh.Type == wire.TI64:
			var x int64
			x, err = sr.ReadInt64()
			v.ScheduledTimestamp = &x
			if err != nil {
				return err
			}

		case fh.ID == 60 && fh.Type == wire.TBinary:
			v.HeartbeatDetails, err = sr.ReadBinary()
			if err != nil {
				return err
			}

		case fh.ID == 70 && fh.Type == wire.TStruct:
			v.WorkflowType, err = _WorkflowType_Decode(sr)
			if err != nil {
				return err
			}

		case fh.ID == 80 && fh.Type == wire.TBinary:
			var x string
			x, err = sr.ReadString()
			v.WorkflowDomain = &x
			if err != nil {
				return err
			}

		default:
			if err := sr.Skip(fh.Type); err != nil {
				return err
			}
		}

		if err := sr.ReadFieldEnd(); err != nil {
			return err
		}

		if fh, ok, err = sr.ReadFieldBegin(); err != nil {
			return err
		}
	}

	if err := sr.ReadStructEnd(); err != nil {
		return err
	}

	return nil
}

// String returns a readable string representation of a ActivityTaskDispatchInfo
// struct.
func (v *ActivityTaskDispatchInfo) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [8]string
	i := 0
	if v.ScheduledEvent != nil {
		fields[i] = fmt.Sprintf("ScheduledEvent: %v", v.ScheduledEvent)
		i++
	}
	if v.StartedTimestamp != nil {
		fields[i] = fmt.Sprintf("StartedTimestamp: %v", *(v.StartedTimestamp))
		i++
	}
	if v.Attempt != nil {
		fields[i] = fmt.Sprintf("Attempt: %v", *(v.Attempt))
		i++
	}
	if v.ScheduledTimestampOfThisAttempt != nil {
		fields[i] = fmt.Sprintf("ScheduledTimestampOfThisAttempt: %v", *(v.ScheduledTimestampOfThisAttempt))
		i++
	}
	if v.ScheduledTimestamp != nil {
		fields[i] = fmt.Sprintf("ScheduledTimestamp: %v", *(v.ScheduledTimestamp))
		i++
	}
	if v.HeartbeatDetails != nil {
		fields[i] = fmt.Sprintf("HeartbeatDetails: %v", v.HeartbeatDetails)
		i++
	}
	if v.WorkflowType != nil {
		fields[i] = fmt.Sprintf("WorkflowType: %v", v.WorkflowType)
		i++
	}
	if v.WorkflowDomain != nil {
		fields[i] = fmt.Sprintf("WorkflowDomain: %v", *(v.WorkflowDomain))
		i++
	}

	return fmt.Sprintf("ActivityTaskDispatchInfo{%v}", strings.Join(fields[:i], ", "))
}

func _I64_EqualsPtr(lhs, rhs *int64) bool {
	if lhs != nil && rhs != nil {

		x := *lhs
		y := *rhs
		return (x == y)
	}
	return lhs == nil && rhs == nil
}

func _String_EqualsPtr(lhs, rhs *string) bool {
	if lhs != nil && rhs != nil {

		x := *lhs
		y := *rhs
		return (x == y)
	}
	return lhs == nil && rhs == nil
}

// Equals returns true if all the fields of this ActivityTaskDispatchInfo match the
// provided ActivityTaskDispatchInfo.
//
// This function performs a deep comparison.
func (v *ActivityTaskDispatchInfo) Equals(rhs *ActivityTaskDispatchInfo) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !((v.ScheduledEvent == nil && rhs.ScheduledEvent == nil) || (v.ScheduledEvent != nil && rhs.ScheduledEvent != nil && v.ScheduledEvent.Equals(rhs.ScheduledEvent))) {
		return false
	}
	if !_I64_EqualsPtr(v.StartedTimestamp, rhs.StartedTimestamp) {
		return false
	}
	if !_I64_EqualsPtr(v.Attempt, rhs.Attempt) {
		return false
	}
	if !_I64_EqualsPtr(v.ScheduledTimestampOfThisAttempt, rhs.ScheduledTimestampOfThisAttempt) {
		return false
	}
	if !_I64_EqualsPtr(v.ScheduledTimestamp, rhs.ScheduledTimestamp) {
		return false
	}
	if !((v.HeartbeatDetails == nil && rhs.HeartbeatDetails == nil) || (v.HeartbeatDetails != nil && rhs.HeartbeatDetails != nil && bytes.Equal(v.HeartbeatDetails, rhs.HeartbeatDetails))) {
		return false
	}
	if !((v.WorkflowType == nil && rhs.WorkflowType == nil) || (v.WorkflowType != nil && rhs.WorkflowType != nil && v.WorkflowType.Equals(rhs.WorkflowType))) {
		return false
	}
	if !_String_EqualsPtr(v.WorkflowDomain, rhs.WorkflowDomain) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of ActivityTaskDispatchInfo.
func (v *ActivityTaskDispatchInfo) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.ScheduledEvent != nil {
		err = multierr.Append(err, enc.AddObject("scheduledEvent", v.ScheduledEvent))
	}
	if v.StartedTimestamp != nil {
		enc.AddInt64("startedTimestamp", *v.StartedTimestamp)
	}
	if v.Attempt != nil {
		enc.AddInt64("attempt", *v.Attempt)
	}
	if v.ScheduledTimestampOfThisAttempt != nil {
		enc.AddInt64("scheduledTimestampOfThisAttempt", *v.ScheduledTimestampOfThisAttempt)
	}
	if v.ScheduledTimestamp != nil {
		enc.AddInt64("scheduledTimestamp", *v.ScheduledTimestamp)
	}
	if v.HeartbeatDetails != nil {
		enc.AddString("heartbeatDetails", base64.StdEncoding.EncodeToString(v.HeartbeatDetails))
	}
	if v.WorkflowType != nil {
		err = multierr.Append(err, enc.AddObject("workflowType", v.WorkflowType))
	}
	if v.WorkflowDomain != nil {
		enc.AddString("workflowDomain", *v.WorkflowDomain)
	}
	return err
}

// GetScheduledEvent returns the value of ScheduledEvent if it is set or its
// zero value if it is unset.
func (v *ActivityTaskDispatchInfo) GetScheduledEvent() (o *shared.HistoryEvent) {
	if v != nil && v.ScheduledEvent != nil {
		return v.ScheduledEvent
	}

	return
}

// IsSetScheduledEvent returns true if ScheduledEvent is not nil.
func (v *ActivityTaskDispatchInfo) IsSetScheduledEvent() bool {
	return v != nil && v.ScheduledEvent != nil
}

// GetStartedTimestamp returns the value of StartedTimestamp if it is set or its
// zero value if it is unset.
func (v *ActivityTaskDispatchInfo) GetStartedTimestamp() (o int64) {
	if v != nil && v.StartedTimestamp != nil {
		return *v.StartedTimestamp
	}

	return
}

// IsSetStartedTimestamp returns true if StartedTimestamp is not nil.
func (v *ActivityTaskDispatchInfo) IsSetStartedTimestamp() bool {
	return v != nil && v.StartedTimestamp != nil
}

// GetAttempt returns the value of Attempt if it is set or its
// zero value if it is unset.
func (v *ActivityTaskDispatchInfo) GetAttempt() (o int64) {
	if v != nil && v.Attempt != nil {
		return *v.Attempt
	}

	return
}

// IsSetAttempt returns true if Attempt is not nil.
func (v *ActivityTaskDispatchInfo) IsSetAttempt() bool {
	return v != nil && v.Attempt != nil
}

// GetScheduledTimestampOfThisAttempt returns the value of ScheduledTimestampOfThisAttempt if it is set or its
// zero value if it is unset.
func (v *ActivityTaskDispatchInfo) GetScheduledTimestampOfThisAttempt() (o int64) {
	if v != nil && v.ScheduledTimestampOfThisAttempt != nil {
		return *v.ScheduledTimestampOfThisAttempt
	}

	return
}

// IsSetScheduledTimestampOfThisAttempt returns true if ScheduledTimestampOfThisAttempt is not nil.
func (v *ActivityTaskDispatchInfo) IsSetScheduledTimestampOfThisAttempt() bool {
	return v != nil && v.ScheduledTimestampOfThisAttempt != nil
}

// GetScheduledTimestamp returns the value of ScheduledTimestamp if it is set or its
// zero value if it is unset.
func (v *ActivityTaskDispatchInfo) GetScheduledTimestamp() (o int64) {
	if v != nil && v.ScheduledTimestamp != nil {
		return *v.ScheduledTimestamp
	}

	return
}

// IsSetScheduledTimestamp returns true if ScheduledTimestamp is not nil.
func (v *ActivityTaskDispatchInfo) IsSetScheduledTimestamp() bool {
	return v != nil && v.ScheduledTimestamp != nil
}

// GetHeartbeatDetails returns the value of HeartbeatDetails if it is set or its
// zero value if it is unset.
func (v *ActivityTaskDispatchInfo) GetHeartbeatDetails() (o []byte) {
	if v != nil && v.HeartbeatDetails != nil {
		return v.HeartbeatDetails
	}

	return
}

// IsSetHeartbeatDetails returns true if HeartbeatDetails is not nil.
func (v *ActivityTaskDispatchInfo) IsSetHeartbeatDetails() bool {
	return v != nil && v.HeartbeatDetails != nil
}

// GetWorkflowType returns the value of WorkflowType if it is set or its
// zero value if it is unset.
func (v *ActivityTaskDispatchInfo) GetWorkflowType() (o *shared.WorkflowType) {
	if v != nil && v.WorkflowType != nil {
		return v.WorkflowType
	}

	return
}

// IsSetWorkflowType returns true if WorkflowType is not nil.
func (v *ActivityTaskDispatchInfo) IsSetWorkflowType() bool {
	return v != nil && v.WorkflowType != nil
}

// GetWorkflowDomain returns the value of WorkflowDomain if it is set or its
// zero value if it is unset.
func (v *ActivityTaskDispatchInfo) GetWorkflowDomain() (o string) {
	if v != nil && v.WorkflowDomain != nil {
		return *v.WorkflowDomain
	}

	return
}

// IsSetWorkflowDomain returns true if WorkflowDomain is not nil.
func (v *ActivityTaskDispatchInfo) IsSetWorkflowDomain() bool {
	return v != nil && v.WorkflowDomain != nil
}

type AddActivityTaskRequest struct {
	DomainUUID                    *string                   `json:"domainUUID,omitempty"`
	Execution                     *shared.WorkflowExecution `json:"execution,omitempty"`
	SourceDomainUUID              *string                   `json:"sourceDomainUUID,omitempty"`
	TaskList                      *shared.TaskList          `json:"taskList,omitempty"`
	ScheduleId                    *int64                    `json:"scheduleId,omitempty"`
	ScheduleToStartTimeoutSeconds *int32                    `json:"scheduleToStartTimeoutSeconds,omitempty"`
	Source                        *TaskSource               `json:"source,omitempty"`
	ForwardedFrom                 *string                   `json:"forwardedFrom,omitempty"`
	ActivityTaskDispatchInfo      *ActivityTaskDispatchInfo `json:"activityTaskDispatchInfo,omitempty"`
	PartitionConfig               map[string]string         `json:"partitionConfig,omitempty"`
}

type _Map_String_String_MapItemList map[string]string

func (m _Map_String_String_MapItemList) ForEach(f func(wire.MapItem) error) error {
	for k, v := range m {
		kw, err := wire.NewValueString(k), error(nil)
		if err != nil {
			return err
		}

		vw, err := wire.NewValueString(v), error(nil)
		if err != nil {
			return err
		}
		err = f(wire.MapItem{Key: kw, Value: vw})
		if err != nil {
			return err
		}
	}
	return nil
}

func (m _Map_String_String_MapItemList) Size() int {
	return len(m)
}

func (_Map_String_String_MapItemList) KeyType() wire.Type {
	return wire.TBinary
}

func (_Map_String_String_MapItemList) ValueType() wire.Type {
	return wire.TBinary
}

func (_Map_String_String_MapItemList) Close() {}

// ToWire translates a AddActivityTaskRequest struct into a Thrift-level intermediate
// representation. This intermediate representation may be serialized
// into bytes using a ThriftRW protocol implementation.
//
// An error is returned if the struct or any of its fields failed to
// validate.
//
//	x, err := v.ToWire()
//	if err != nil {
//	  return err
//	}
//
//	if err := binaryProtocol.Encode(x, writer); err != nil {
//	  return err
//	}
func (v *AddActivityTaskRequest) ToWire() (wire.Value, error) {
	var (
		fields [10]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.DomainUUID != nil {
		w, err = wire.NewValueString(*(v.DomainUUID)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.Execution != nil {
		w, err = v.Execution.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.SourceDomainUUID != nil {
		w, err = wire.NewValueString(*(v.SourceDomainUUID)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.TaskList != nil {
		w, err = v.TaskList.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 40, Value: w}
		i++
	}
	if v.ScheduleId != nil {
		w, err = wire.NewValueI64(*(v.ScheduleId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 50, Value: w}
		i++
	}
	if v.ScheduleToStartTimeoutSeconds != nil {
		w, err = wire.NewValueI32(*(v.ScheduleToStartTimeoutSeconds)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 60, Value: w}
		i++
	}
	if v.Source != nil {
		w, err = v.Source.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 69, Value: w}
		i++
	}
	if v.ForwardedFrom != nil {
		w, err = wire.NewValueString(*(v.ForwardedFrom)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 70, Value: w}
		i++
	}
	if v.ActivityTaskDispatchInfo != nil {
		w, err = v.ActivityTaskDispatchInfo.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 80, Value: w}
		i++
	}
	if v.PartitionConfig != nil {
		w, err = wire.NewValueMap(_Map_String_String_MapItemList(v.PartitionConfig)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 90, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

func _WorkflowExecution_Read(w wire.Value) (*shared.WorkflowExecution, error) {
	var v shared.WorkflowExecution
	err := v.FromWire(w)
	return &v, err
}

func _TaskList_Read(w wire.Value) (*shared.TaskList, error) {
	var v shared.TaskList
	err := v.FromWire(w)
	return &v, err
}

func _TaskSource_Read(w wire.Value) (TaskSource, error) {
	var v TaskSource
	err := v.FromWire(w)
	return v, err
}

func _ActivityTaskDispatchInfo_Read(w wire.Value) (*ActivityTaskDispatchInfo, error) {
	var v ActivityTaskDispatchInfo
	err := v.FromWire(w)
	return &v, err
}

func _Map_String_String_Read(m wire.MapItemList) (map[string]string, error) {
	if m.KeyType() != wire.TBinary {
		return nil, nil
	}

	if m.ValueType() != wire.TBinary {
		return nil, nil
	}

	o := make(map[string]string, m.Size())
	err := m.ForEach(func(x wire.MapItem) error {
		k, err := x.Key.GetString(), error(nil)
		if err != nil {
			return err
		}

		v, err := x.Value.GetString(), error(nil)
		if err != nil {
			return err
		}

		o[k] = v
		return nil
	})
	m.Close()
	return o, err
}

// FromWire deserializes a AddActivityTaskRequest struct from its Thrift-level
// representation. The Thrift-level representation may be obtained
// from a ThriftRW protocol implementation.
//
// An error is returned if we were unable to build a AddActivityTaskRequest struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v AddActivityTaskRequest
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *AddActivityTaskRequest) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.DomainUUID = &x
				if err != nil {
					return err
				}

			}
		case 20:
			if field.Value.Type() == wire.TStruct {
				v.Execution, err = _WorkflowExecution_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 30:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.SourceDomainUUID = &x
				if err != nil {
					return err
				}

			}
		case 40:
			if field.Value.Type() == wire.TStruct {
				v.TaskList, err = _TaskList_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 50:
			if field.Value.Type() == wire.TI64 {
				var x int64
				x, err = field.Value.GetI64(), error(nil)
				v.ScheduleId = &x
				if err != nil {
					return err
				}

			}
		case 60:
			if field.Value.Type() == wire.TI32 {
				var x int32
				x, err = field.Value.GetI32(), error(nil)
				v.ScheduleToStartTimeoutSeconds = &x
				if err != nil {
					return err
				}

			}
		case 69:
			if field.Value.Type() == wire.TI32 {
				var x TaskSource
				x, err = _TaskSource_Read(field.Value)
				v.Source = &x
				if err != nil {
					return err
				}

			}
		case 70:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.ForwardedFrom = &x
				if err != nil {
					return err
				}

			}
		case 80:
			if field.Value.Type() == wire.TStruct {
				v.ActivityTaskDispatchInfo, err = _ActivityTaskDispatchInfo_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 90:
			if field.Value.Type() == wire.TMap {
				v.PartitionConfig, err = _Map_String_String_Read(field.Value.GetMap())
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

func _Map_String_String_Encode(val map[string]string, sw stream.Writer) error {

	mh := stream.MapHeader{
		KeyType:   wire.TBinary,
		ValueType: wire.TBinary,
		Length:    len(val),
	}
	if err := sw.WriteMapBegin(mh); err != nil {
		return err
	}

	for k, v := range val {
		if err := sw.WriteString(k); err != nil {
			return err
		}
		if err := sw.WriteString(v); err != nil {
			return err
		}
	}

	return sw.WriteMapEnd()
}

// Encode serializes a AddActivityTaskRequest struct directly into bytes, without going
// through an intermediary type.
//
// An error is returned if a AddActivityTaskRequest struct could not be encoded.
func (v *AddActivityTaskRequest) Encode(sw stream.Writer) error {
	if err := sw.WriteStructBegin(); err != nil {
		return err
	}

	if v.DomainUUID != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 10, Type: wire.TBinary}); err != nil {
			return err
		}
		if err := sw.WriteString(*(v.DomainUUID)); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.Execution != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 20, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.Execution.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.SourceDomainUUID != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 30, Type: wire.TBinary}); err != nil {
			return err
		}
		if err := sw.WriteString(*(v.SourceDomainUUID)); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.TaskList != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 40, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.TaskList.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.ScheduleId != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 50, Type: wire.TI64}); err != nil {
			return err
		}
		if err := sw.WriteInt64(*(v.ScheduleId)); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.ScheduleToStartTimeoutSeconds != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 60, Type: wire.TI32}); err != nil {
			return err
		}
		if err := sw.WriteInt32(*(v.ScheduleToStartTimeoutSeconds)); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.Source != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 69, Type: wire.TI32}); err != nil {
			return err
		}
		if err := v.Source.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.ForwardedFrom != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 70, Type: wire.TBinary}); err != nil {
			return err
		}
		if err := sw.WriteString(*(v.ForwardedFrom)); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.ActivityTaskDispatchInfo != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 80, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.ActivityTaskDispatchInfo.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.PartitionConfig != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 90, Type: wire.TMap}); err != nil {
			return err
		}
		if err := _Map_String_String_Encode(v.PartitionConfig, sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	return sw.WriteStructEnd()
}

func _WorkflowExecution_Decode(sr stream.Reader) (*shared.WorkflowExecution, error) {
	var v shared.WorkflowExecution
	err := v.Decode(sr)
	return &v, err
}

func _TaskList_Decode(sr stream.Reader) (*shared.TaskList, error) {
	var v shared.TaskList
	err := v.Decode(sr)
	return &v, err
}

func _TaskSource_Decode(sr stream.Reader) (TaskSource, error) {
	var v TaskSource
	err := v.Decode(sr)
	return v, err
}

func _ActivityTaskDispatchInfo_Decode(sr stream.Reader) (*ActivityTaskDispatchInfo, error) {
	var v ActivityTaskDispatchInfo
	err := v.Decode(sr)
	return &v, err
}

func _Map_String_String_Decode(sr stream.Reader) (map[string]string, error) {
	mh, err := sr.ReadMapBegin()
	if err != nil {
		return nil, err
	}

	if mh.KeyType != wire.TBinary || mh.ValueType != wire.TBinary {
		for i := 0; i < mh.Length; i++ {
			if err := sr.Skip(mh.KeyType); err != nil {
				return nil, err
			}

			if err := sr.Skip(mh.ValueType); err != nil {
				return nil, err
			}
		}
		return nil, sr.ReadMapEnd()
	}

	o := make(map[string]string, mh.Length)
	for i := 0; i < mh.Length; i++ {
		k, err := sr.ReadString()
		if err != nil {
			return nil, err
		}

		v, err := sr.ReadString()
		if err != nil {
			return nil, err
		}

		o[k] = v
	}

	if err = sr.ReadMapEnd(); err != nil {
		return nil, err
	}
	return o, err
}

// Decode deserializes a AddActivityTaskRequest struct directly from its Thrift-level
// representation, without going through an intemediary type.
//
// An error is returned if a AddActivityTaskRequest struct could not be generated from the wire
// representation.
func (v *AddActivityTaskRequest) Decode(sr stream.Reader) error {

	if err := sr.ReadStructBegin(); err != nil {
		return err
	}

	fh, ok, err := sr.ReadFieldBegin()
	if err != nil {
		return err
	}

	for ok {
		switch {
		case fh.ID == 10 && fh.Type == wire.TBinary:
			var x string
			x, err = sr.ReadString()
			v.DomainUUID = &x
			if err != nil {
				return err
			}

		case fh.ID == 20 && fh.Type == wire.TStruct:
			v.Execution, err = _WorkflowExecution_Decode(sr)
			if err != nil {
				return err
			}

		case fh.ID == 30 && fh.Type == wire.TBinary:
			var x string
			x, err = sr.ReadString()
			v.SourceDomainUUID = &x
			if err != nil {
				return err
			}

		case fh.ID == 40 && fh.Type == wire.TStruct:
			v.TaskList, err = _TaskList_Decode(sr)
			if err != nil {
				return err
			}

		case fh.ID == 50 && fh.Type == wire.TI64:
			var x int64
			x, err = sr.ReadInt64()
			v.ScheduleId = &x
			if err != nil {
				return err
			}

		case fh.ID == 60 && fh.Type == wire.TI32:
			var x int32
			x, err = sr.ReadInt32()
			v.ScheduleToStartTimeoutSeconds = &x
			if err != nil {
				return err
			}

		case fh.ID == 69 && fh.Type == wire.TI32:
			var x TaskSource
			x, err = _TaskSource_Decode(sr)
			v.Source = &x
			if err != nil {
				return err
			}

		case fh.ID == 70 && fh.Type == wire.TBinary:
			var x string
			x, err = sr.ReadString()
			v.ForwardedFrom = &x
			if err != nil {
				return err
			}

		case fh.ID == 80 && fh.Type == wire.TStruct:
			v.ActivityTaskDispatchInfo, err = _ActivityTaskDispatchInfo_Decode(sr)
			if err != nil {
				return err
			}

		case fh.ID == 90 && fh.Type == wire.TMap:
			v.PartitionConfig, err = _Map_String_String_Decode(sr)
			if err != nil {
				return err
			}

		default:
			if err := sr.Skip(fh.Type); err != nil {
				return err
			}
		}

		if err := sr.ReadFieldEnd(); err != nil {
			return err
		}

		if fh, ok, err = sr.ReadFieldBegin(); err != nil {
			return err
		}
	}

	if err := sr.ReadStructEnd(); err != nil {
		return err
	}

	return nil
}

// String returns a readable string representation of a AddActivityTaskRequest
// struct.
func (v *AddActivityTaskRequest) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [10]string
	i := 0
	if v.DomainUUID != nil {
		fields[i] = fmt.Sprintf("DomainUUID: %v", *(v.DomainUUID))
		i++
	}
	if v.Execution != nil {
		fields[i] = fmt.Sprintf("Execution: %v", v.Execution)
		i++
	}
	if v.SourceDomainUUID != nil {
		fields[i] = fmt.Sprintf("SourceDomainUUID: %v", *(v.SourceDomainUUID))
		i++
	}
	if v.TaskList != nil {
		fields[i] = fmt.Sprintf("TaskList: %v", v.TaskList)
		i++
	}
	if v.ScheduleId != nil {
		fields[i] = fmt.Sprintf("ScheduleId: %v", *(v.ScheduleId))
		i++
	}
	if v.ScheduleToStartTimeoutSeconds != nil {
		fields[i] = fmt.Sprintf("ScheduleToStartTimeoutSeconds: %v", *(v.ScheduleToStartTimeoutSeconds))
		i++
	}
	if v.Source != nil {
		fields[i] = fmt.Sprintf("Source: %v", *(v.Source))
		i++
	}
	if v.ForwardedFrom != nil {
		fields[i] = fmt.Sprintf("ForwardedFrom: %v", *(v.ForwardedFrom))
		i++
	}
	if v.ActivityTaskDispatchInfo != nil {
		fields[i] = fmt.Sprintf("ActivityTaskDispatchInfo: %v", v.ActivityTaskDispatchInfo)
		i++
	}
	if v.PartitionConfig != nil {
		fields[i] = fmt.Sprintf("PartitionConfig: %v", v.PartitionConfig)
		i++
	}

	return fmt.Sprintf("AddActivityTaskRequest{%v}", strings.Join(fields[:i], ", "))
}

func _I32_EqualsPtr(lhs, rhs *int32) bool {
	if lhs != nil && rhs != nil {

		x := *lhs
		y := *rhs
		return (x == y)
	}
	return lhs == nil && rhs == nil
}

func _TaskSource_EqualsPtr(lhs, rhs *TaskSource) bool {
	if lhs != nil && rhs != nil {

		x := *lhs
		y := *rhs
		return x.Equals(y)
	}
	return lhs == nil && rhs == nil
}

func _Map_String_String_Equals(lhs, rhs map[string]string) bool {
	if len(lhs) != len(rhs) {
		return false
	}

	for lk, lv := range lhs {
		rv, ok := rhs[lk]
		if !ok {
			return false
		}
		if !(lv == rv) {
			return false
		}
	}
	return true
}

// Equals returns true if all the fields of this AddActivityTaskRequest match the
// provided AddActivityTaskRequest.
//
// This function performs a deep comparison.
func (v *AddActivityTaskRequest) Equals(rhs *AddActivityTaskRequest) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.DomainUUID, rhs.DomainUUID) {
		return false
	}
	if !((v.Execution == nil && rhs.Execution == nil) || (v.Execution != nil && rhs.Execution != nil && v.Execution.Equals(rhs.Execution))) {
		return false
	}
	if !_String_EqualsPtr(v.SourceDomainUUID, rhs.SourceDomainUUID) {
		return false
	}
	if !((v.TaskList == nil && rhs.TaskList == nil) || (v.TaskList != nil && rhs.TaskList != nil && v.TaskList.Equals(rhs.TaskList))) {
		return false
	}
	if !_I64_EqualsPtr(v.ScheduleId, rhs.ScheduleId) {
		return false
	}
	if !_I32_EqualsPtr(v.ScheduleToStartTimeoutSeconds, rhs.ScheduleToStartTimeoutSeconds) {
		return false
	}
	if !_TaskSource_EqualsPtr(v.Source, rhs.Source) {
		return false
	}
	if !_String_EqualsPtr(v.ForwardedFrom, rhs.ForwardedFrom) {
		return false
	}
	if !((v.ActivityTaskDispatchInfo == nil && rhs.ActivityTaskDispatchInfo == nil) || (v.ActivityTaskDispatchInfo != nil && rhs.ActivityTaskDispatchInfo != nil && v.ActivityTaskDispatchInfo.Equals(rhs.ActivityTaskDispatchInfo))) {
		return false
	}
	if !((v.PartitionConfig == nil && rhs.PartitionConfig == nil) || (v.PartitionConfig != nil && rhs.PartitionConfig != nil && _Map_String_String_Equals(v.PartitionConfig, rhs.PartitionConfig))) {
		return false
	}

	return true
}

type _Map_String_String_Zapper map[string]string

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of _Map_String_String_Zapper.
func (m _Map_String_String_Zapper) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	for k, v := range m {
		enc.AddString((string)(k), v)
	}
	return err
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of AddActivityTaskRequest.
func (v *AddActivityTaskRequest) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.DomainUUID != nil {
		enc.AddString("domainUUID", *v.DomainUUID)
	}
	if v.Execution != nil {
		err = multierr.Append(err, enc.AddObject("execution", v.Execution))
	}
	if v.SourceDomainUUID != nil {
		enc.AddString("sourceDomainUUID", *v.SourceDomainUUID)
	}
	if v.TaskList != nil {
		err = multierr.Append(err, enc.AddObject("taskList", v.TaskList))
	}
	if v.ScheduleId != nil {
		enc.AddInt64("scheduleId", *v.ScheduleId)
	}
	if v.ScheduleToStartTimeoutSeconds != nil {
		enc.AddInt32("scheduleToStartTimeoutSeconds", *v.ScheduleToStartTimeoutSeconds)
	}
	if v.Source != nil {
		err = multierr.Append(err, enc.AddObject("source", *v.Source))
	}
	if v.ForwardedFrom != nil {
		enc.AddString("forwardedFrom", *v.ForwardedFrom)
	}
	if v.ActivityTaskDispatchInfo != nil {
		err = multierr.Append(err, enc.AddObject("activityTaskDispatchInfo", v.ActivityTaskDispatchInfo))
	}
	if v.PartitionConfig != nil {
		err = multierr.Append(err, enc.AddObject("partitionConfig", (_Map_String_String_Zapper)(v.PartitionConfig)))
	}
	return err
}

// GetDomainUUID returns the value of DomainUUID if it is set or its
// zero value if it is unset.
func (v *AddActivityTaskRequest) GetDomainUUID() (o string) {
	if v != nil && v.DomainUUID != nil {
		return *v.DomainUUID
	}

	return
}

// IsSetDomainUUID returns true if DomainUUID is not nil.
func (v *AddActivityTaskRequest) IsSetDomainUUID() bool {
	return v != nil && v.DomainUUID != nil
}

// GetExecution returns the value of Execution if it is set or its
// zero value if it is unset.
func (v *AddActivityTaskRequest) GetExecution() (o *shared.WorkflowExecution) {
	if v != nil && v.Execution != nil {
		return v.Execution
	}

	return
}

// IsSetExecution returns true if Execution is not nil.
func (v *AddActivityTaskRequest) IsSetExecution() bool {
	return v != nil && v.Execution != nil
}

// GetSourceDomainUUID returns the value of SourceDomainUUID if it is set or its
// zero value if it is unset.
func (v *AddActivityTaskRequest) GetSourceDomainUUID() (o string) {
	if v != nil && v.SourceDomainUUID != nil {
		return *v.SourceDomainUUID
	}

	return
}

// IsSetSourceDomainUUID returns true if SourceDomainUUID is not nil.
func (v *AddActivityTaskRequest) IsSetSourceDomainUUID() bool {
	return v != nil && v.SourceDomainUUID != nil
}

// GetTaskList returns the value of TaskList if it is set or its
// zero value if it is unset.
func (v *AddActivityTaskRequest) GetTaskList() (o *shared.TaskList) {
	if v != nil && v.TaskList != nil {
		return v.TaskList
	}

	return
}

// IsSetTaskList returns true if TaskList is not nil.
func (v *AddActivityTaskRequest) IsSetTaskList() bool {
	return v != nil && v.TaskList != nil
}

// GetScheduleId returns the value of ScheduleId if it is set or its
// zero value if it is unset.
func (v *AddActivityTaskRequest) GetScheduleId() (o int64) {
	if v != nil && v.ScheduleId != nil {
		return *v.ScheduleId
	}

	return
}

// IsSetScheduleId returns true if ScheduleId is not nil.
func (v *AddActivityTaskRequest) IsSetScheduleId() bool {
	return v != nil && v.ScheduleId != nil
}

// GetScheduleToStartTimeoutSeconds returns the value of ScheduleToStartTimeoutSeconds if it is set or its
// zero value if it is unset.
func (v *AddActivityTaskRequest) GetScheduleToStartTimeoutSeconds() (o int32) {
	if v != nil && v.ScheduleToStartTimeoutSeconds != nil {
		return *v.ScheduleToStartTimeoutSeconds
	}

	return
}

// IsSetScheduleToStartTimeoutSeconds returns true if ScheduleToStartTimeoutSeconds is not nil.
func (v *AddActivityTaskRequest) IsSetScheduleToStartTimeoutSeconds() bool {
	return v != nil && v.ScheduleToStartTimeoutSeconds != nil
}

// GetSource returns the value of Source if it is set or its
// zero value if it is unset.
func (v *AddActivityTaskRequest) GetSource() (o TaskSource) {
	if v != nil && v.Source != nil {
		return *v.Source
	}

	return
}

// IsSetSource returns true if Source is not nil.
func (v *AddActivityTaskRequest) IsSetSource() bool {
	return v != nil && v.Source != nil
}

// GetForwardedFrom returns the value of ForwardedFrom if it is set or its
// zero value if it is unset.
func (v *AddActivityTaskRequest) GetForwardedFrom() (o string) {
	if v != nil && v.ForwardedFrom != nil {
		return *v.ForwardedFrom
	}

	return
}

// IsSetForwardedFrom returns true if ForwardedFrom is not nil.
func (v *AddActivityTaskRequest) IsSetForwardedFrom() bool {
	return v != nil && v.ForwardedFrom != nil
}

// GetActivityTaskDispatchInfo returns the value of ActivityTaskDispatchInfo if it is set or its
// zero value if it is unset.
func (v *AddActivityTaskRequest) GetActivityTaskDispatchInfo() (o *ActivityTaskDispatchInfo) {
	if v != nil && v.ActivityTaskDispatchInfo != nil {
		return v.ActivityTaskDispatchInfo
	}

	return
}

// IsSetActivityTaskDispatchInfo returns true if ActivityTaskDispatchInfo is not nil.
func (v *AddActivityTaskRequest) IsSetActivityTaskDispatchInfo() bool {
	return v != nil && v.ActivityTaskDispatchInfo != nil
}

// GetPartitionConfig returns the value of PartitionConfig if it is set or its
// zero value if it is unset.
func (v *AddActivityTaskRequest) GetPartitionConfig() (o map[string]string) {
	if v != nil && v.PartitionConfig != nil {
		return v.PartitionConfig
	}

	return
}

// IsSetPartitionConfig returns true if PartitionConfig is not nil.
func (v *AddActivityTaskRequest) IsSetPartitionConfig() bool {
	return v != nil && v.PartitionConfig != nil
}

type AddDecisionTaskRequest struct {
	DomainUUID                    *string                   `json:"domainUUID,omitempty"`
	Execution                     *shared.WorkflowExecution `json:"execution,omitempty"`
	TaskList                      *shared.TaskList          `json:"taskList,omitempty"`
	ScheduleId                    *int64                    `json:"scheduleId,omitempty"`
	ScheduleToStartTimeoutSeconds *int32                    `json:"scheduleToStartTimeoutSeconds,omitempty"`
	Source                        *TaskSource               `json:"source,omitempty"`
	ForwardedFrom                 *string                   `json:"forwardedFrom,omitempty"`
	PartitionConfig               map[string]string         `json:"partitionConfig,omitempty"`
}

// ToWire translates a AddDecisionTaskRequest struct into a Thrift-level intermediate
// representation. This intermediate representation may be serialized
// into bytes using a ThriftRW protocol implementation.
//
// An error is returned if the struct or any of its fields failed to
// validate.
//
//	x, err := v.ToWire()
//	if err != nil {
//	  return err
//	}
//
//	if err := binaryProtocol.Encode(x, writer); err != nil {
//	  return err
//	}
func (v *AddDecisionTaskRequest) ToWire() (wire.Value, error) {
	var (
		fields [8]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.DomainUUID != nil {
		w, err = wire.NewValueString(*(v.DomainUUID)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.Execution != nil {
		w, err = v.Execution.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.TaskList != nil {
		w, err = v.TaskList.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.ScheduleId != nil {
		w, err = wire.NewValueI64(*(v.ScheduleId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 40, Value: w}
		i++
	}
	if v.ScheduleToStartTimeoutSeconds != nil {
		w, err = wire.NewValueI32(*(v.ScheduleToStartTimeoutSeconds)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 50, Value: w}
		i++
	}
	if v.Source != nil {
		w, err = v.Source.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 59, Value: w}
		i++
	}
	if v.ForwardedFrom != nil {
		w, err = wire.NewValueString(*(v.ForwardedFrom)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 60, Value: w}
		i++
	}
	if v.PartitionConfig != nil {
		w, err = wire.NewValueMap(_Map_String_String_MapItemList(v.PartitionConfig)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 70, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

// FromWire deserializes a AddDecisionTaskRequest struct from its Thrift-level
// representation. The Thrift-level representation may be obtained
// from a ThriftRW protocol implementation.
//
// An error is returned if we were unable to build a AddDecisionTaskRequest struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v AddDecisionTaskRequest
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *AddDecisionTaskRequest) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.DomainUUID = &x
				if err != nil {
					return err
				}

			}
		case 20:
			if field.Value.Type() == wire.TStruct {
				v.Execution, err = _WorkflowExecution_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 30:
			if field.Value.Type() == wire.TStruct {
				v.TaskList, err = _TaskList_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 40:
			if field.Value.Type() == wire.TI64 {
				var x int64
				x, err = field.Value.GetI64(), error(nil)
				v.ScheduleId = &x
				if err != nil {
					return err
				}

			}
		case 50:
			if field.Value.Type() == wire.TI32 {
				var x int32
				x, err = field.Value.GetI32(), error(nil)
				v.ScheduleToStartTimeoutSeconds = &x
				if err != nil {
					return err
				}

			}
		case 59:
			if field.Value.Type() == wire.TI32 {
				var x TaskSource
				x, err = _TaskSource_Read(field.Value)
				v.Source = &x
				if err != nil {
					return err
				}

			}
		case 60:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.ForwardedFrom = &x
				if err != nil {
					return err
				}

			}
		case 70:
			if field.Value.Type() == wire.TMap {
				v.PartitionConfig, err = _Map_String_String_Read(field.Value.GetMap())
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// Encode serializes a AddDecisionTaskRequest struct directly into bytes, without going
// through an intermediary type.
//
// An error is returned if a AddDecisionTaskRequest struct could not be encoded.
func (v *AddDecisionTaskRequest) Encode(sw stream.Writer) error {
	if err := sw.WriteStructBegin(); err != nil {
		return err
	}

	if v.DomainUUID != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 10, Type: wire.TBinary}); err != nil {
			return err
		}
		if err := sw.WriteString(*(v.DomainUUID)); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.Execution != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 20, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.Execution.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.TaskList != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 30, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.TaskList.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.ScheduleId != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 40, Type: wire.TI64}); err != nil {
			return err
		}
		if err := sw.WriteInt64(*(v.ScheduleId)); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.ScheduleToStartTimeoutSeconds != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 50, Type: wire.TI32}); err != nil {
			return err
		}
		if err := sw.WriteInt32(*(v.ScheduleToStartTimeoutSeconds)); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.Source != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 59, Type: wire.TI32}); err != nil {
			return err
		}
		if err := v.Source.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.ForwardedFrom != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 60, Type: wire.TBinary}); err != nil {
			return err
		}
		if err := sw.WriteString(*(v.ForwardedFrom)); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.PartitionConfig != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 70, Type: wire.TMap}); err != nil {
			return err
		}
		if err := _Map_String_String_Encode(v.PartitionConfig, sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	return sw.WriteStructEnd()
}

// Decode deserializes a AddDecisionTaskRequest struct directly from its Thrift-level
// representation, without going through an intemediary type.
//
// An error is returned if a AddDecisionTaskRequest struct could not be generated from the wire
// representation.
func (v *AddDecisionTaskRequest) Decode(sr stream.Reader) error {

	if err := sr.ReadStructBegin(); err != nil {
		return err
	}

	fh, ok, err := sr.ReadFieldBegin()
	if err != nil {
		return err
	}

	for ok {
		switch {
		case fh.ID == 10 && fh.Type == wire.TBinary:
			var x string
			x, err = sr.ReadString()
			v.DomainUUID = &x
			if err != nil {
				return err
			}

		case fh.ID == 20 && fh.Type == wire.TStruct:
			v.Execution, err = _WorkflowExecution_Decode(sr)
			if err != nil {
				return err
			}

		case fh.ID == 30 && fh.Type == wire.TStruct:
			v.TaskList, err = _TaskList_Decode(sr)
			if err != nil {
				return err
			}

		case fh.ID == 40 && fh.Type == wire.TI64:
			var x int64
			x, err = sr.ReadInt64()
			v.ScheduleId = &x
			if err != nil {
				return err
			}

		case fh.ID == 50 && fh.Type == wire.TI32:
			var x int32
			x, err = sr.ReadInt32()
			v.ScheduleToStartTimeoutSeconds = &x
			if err != nil {
				return err
			}

		case fh.ID == 59 && fh.Type == wire.TI32:
			var x TaskSource
			x, err = _TaskSource_Decode(sr)
			v.Source = &x
			if err != nil {
				return err
			}

		case fh.ID == 60 && fh.Type == wire.TBinary:
			var x string
			x, err = sr.ReadString()
			v.ForwardedFrom = &x
			if err != nil {
				return err
			}

		case fh.ID == 70 && fh.Type == wire.TMap:
			v.PartitionConfig, err = _Map_String_String_Decode(sr)
			if err != nil {
				return err
			}

		default:
			if err := sr.Skip(fh.Type); err != nil {
				return err
			}
		}

		if err := sr.ReadFieldEnd(); err != nil {
			return err
		}

		if fh, ok, err = sr.ReadFieldBegin(); err != nil {
			return err
		}
	}

	if err := sr.ReadStructEnd(); err != nil {
		return err
	}

	return nil
}

// String returns a readable string representation of a AddDecisionTaskRequest
// struct.
func (v *AddDecisionTaskRequest) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [8]string
	i := 0
	if v.DomainUUID != nil {
		fields[i] = fmt.Sprintf("DomainUUID: %v", *(v.DomainUUID))
		i++
	}
	if v.Execution != nil {
		fields[i] = fmt.Sprintf("Execution: %v", v.Execution)
		i++
	}
	if v.TaskList != nil {
		fields[i] = fmt.Sprintf("TaskList: %v", v.TaskList)
		i++
	}
	if v.ScheduleId != nil {
		fields[i] = fmt.Sprintf("ScheduleId: %v", *(v.ScheduleId))
		i++
	}
	if v.ScheduleToStartTimeoutSeconds != nil {
		fields[i] = fmt.Sprintf("ScheduleToStartTimeoutSeconds: %v", *(v.ScheduleToStartTimeoutSeconds))
		i++
	}
	if v.Source != nil {
		fields[i] = fmt.Sprintf("Source: %v", *(v.Source))
		i++
	}
	if v.ForwardedFrom != nil {
		fields[i] = fmt.Sprintf("ForwardedFrom: %v", *(v.ForwardedFrom))
		i++
	}
	if v.PartitionConfig != nil {
		fields[i] = fmt.Sprintf("PartitionConfig: %v", v.PartitionConfig)
		i++
	}

	return fmt.Sprintf("AddDecisionTaskRequest{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this AddDecisionTaskRequest match the
// provided AddDecisionTaskRequest.
//
// This function performs a deep comparison.
func (v *AddDecisionTaskRequest) Equals(rhs *AddDecisionTaskRequest) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.DomainUUID, rhs.DomainUUID) {
		return false
	}
	if !((v.Execution == nil && rhs.Execution == nil) || (v.Execution != nil && rhs.Execution != nil && v.Execution.Equals(rhs.Execution))) {
		return false
	}
	if !((v.TaskList == nil && rhs.TaskList == nil) || (v.TaskList != nil && rhs.TaskList != nil && v.TaskList.Equals(rhs.TaskList))) {
		return false
	}
	if !_I64_EqualsPtr(v.ScheduleId, rhs.ScheduleId) {
		return false
	}
	if !_I32_EqualsPtr(v.ScheduleToStartTimeoutSeconds, rhs.ScheduleToStartTimeoutSeconds) {
		return false
	}
	if !_TaskSource_EqualsPtr(v.Source, rhs.Source) {
		return false
	}
	if !_String_EqualsPtr(v.ForwardedFrom, rhs.ForwardedFrom) {
		return false
	}
	if !((v.PartitionConfig == nil && rhs.PartitionConfig == nil) || (v.PartitionConfig != nil && rhs.PartitionConfig != nil && _Map_String_String_Equals(v.PartitionConfig, rhs.PartitionConfig))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of AddDecisionTaskRequest.
func (v *AddDecisionTaskRequest) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.DomainUUID != nil {
		enc.AddString("domainUUID", *v.DomainUUID)
	}
	if v.Execution != nil {
		err = multierr.Append(err, enc.AddObject("execution", v.Execution))
	}
	if v.TaskList != nil {
		err = multierr.Append(err, enc.AddObject("taskList", v.TaskList))
	}
	if v.ScheduleId != nil {
		enc.AddInt64("scheduleId", *v.ScheduleId)
	}
	if v.ScheduleToStartTimeoutSeconds != nil {
		enc.AddInt32("scheduleToStartTimeoutSeconds", *v.ScheduleToStartTimeoutSeconds)
	}
	if v.Source != nil {
		err = multierr.Append(err, enc.AddObject("source", *v.Source))
	}
	if v.ForwardedFrom != nil {
		enc.AddString("forwardedFrom", *v.ForwardedFrom)
	}
	if v.PartitionConfig != nil {
		err = multierr.Append(err, enc.AddObject("partitionConfig", (_Map_String_String_Zapper)(v.PartitionConfig)))
	}
	return err
}

// GetDomainUUID returns the value of DomainUUID if it is set or its
// zero value if it is unset.
func (v *AddDecisionTaskRequest) GetDomainUUID() (o string) {
	if v != nil && v.DomainUUID != nil {
		return *v.DomainUUID
	}

	return
}

// IsSetDomainUUID returns true if DomainUUID is not nil.
func (v *AddDecisionTaskRequest) IsSetDomainUUID() bool {
	return v != nil && v.DomainUUID != nil
}

// GetExecution returns the value of Execution if it is set or its
// zero value if it is unset.
func (v *AddDecisionTaskRequest) GetExecution() (o *shared.WorkflowExecution) {
	if v != nil && v.Execution != nil {
		return v.Execution
	}

	return
}

// IsSetExecution returns true if Execution is not nil.
func (v *AddDecisionTaskRequest) IsSetExecution() bool {
	return v != nil && v.Execution != nil
}

// GetTaskList returns the value of TaskList if it is set or its
// zero value if it is unset.
func (v *AddDecisionTaskRequest) GetTaskList() (o *shared.TaskList) {
	if v != nil && v.TaskList != nil {
		return v.TaskList
	}

	return
}

// IsSetTaskList returns true if TaskList is not nil.
func (v *AddDecisionTaskRequest) IsSetTaskList() bool {
	return v != nil && v.TaskList != nil
}

// GetScheduleId returns the value of ScheduleId if it is set or its
// zero value if it is unset.
func (v *AddDecisionTaskRequest) GetScheduleId() (o int64) {
	if v != nil && v.ScheduleId != nil {
		return *v.ScheduleId
	}

	return
}

// IsSetScheduleId returns true if ScheduleId is not nil.
func (v *AddDecisionTaskRequest) IsSetScheduleId() bool {
	return v != nil && v.ScheduleId != nil
}

// GetScheduleToStartTimeoutSeconds returns the value of ScheduleToStartTimeoutSeconds if it is set or its
// zero value if it is unset.
func (v *AddDecisionTaskRequest) GetScheduleToStartTimeoutSeconds() (o int32) {
	if v != nil && v.ScheduleToStartTimeoutSeconds != nil {
		return *v.ScheduleToStartTimeoutSeconds
	}

	return
}

// IsSetScheduleToStartTimeoutSeconds returns true if ScheduleToStartTimeoutSeconds is not nil.
func (v *AddDecisionTaskRequest) IsSetScheduleToStartTimeoutSeconds() bool {
	return v != nil && v.ScheduleToStartTimeoutSeconds != nil
}

// GetSource returns the value of Source if it is set or its
// zero value if it is unset.
func (v *AddDecisionTaskRequest) GetSource() (o TaskSource) {
	if v != nil && v.Source != nil {
		return *v.Source
	}

	return
}

// IsSetSource returns true if Source is not nil.
func (v *AddDecisionTaskRequest) IsSetSource() bool {
	return v != nil && v.Source != nil
}

// GetForwardedFrom returns the value of ForwardedFrom if it is set or its
// zero value if it is unset.
func (v *AddDecisionTaskRequest) GetForwardedFrom() (o string) {
	if v != nil && v.ForwardedFrom != nil {
		return *v.ForwardedFrom
	}

	return
}

// IsSetForwardedFrom returns true if ForwardedFrom is not nil.
func (v *AddDecisionTaskRequest) IsSetForwardedFrom() bool {
	return v != nil && v.ForwardedFrom != nil
}

// GetPartitionConfig returns the value of PartitionConfig if it is set or its
// zero value if it is unset.
func (v *AddDecisionTaskRequest) GetPartitionConfig() (o map[string]string) {
	if v != nil && v.PartitionConfig != nil {
		return v.PartitionConfig
	}

	return
}

// IsSetPartitionConfig returns true if PartitionConfig is not nil.
func (v *AddDecisionTaskRequest) IsSetPartitionConfig() bool {
	return v != nil && v.PartitionConfig != nil
}

type CancelOutstandingPollRequest struct {
	DomainUUID   *string          `json:"domainUUID,omitempty"`
	TaskListType *int32           `json:"taskListType,omitempty"`
	TaskList     *shared.TaskList `json:"taskList,omitempty"`
	PollerID     *string          `json:"pollerID,omitempty"`
}

// ToWire translates a CancelOutstandingPollRequest struct into a Thrift-level intermediate
// representation. This intermediate representation may be serialized
// into bytes using a ThriftRW protocol implementation.
//
// An error is returned if the struct or any of its fields failed to
// validate.
//
//	x, err := v.ToWire()
//	if err != nil {
//	  return err
//	}
//
//	if err := binaryProtocol.Encode(x, writer); err != nil {
//	  return err
//	}
func (v *CancelOutstandingPollRequest) ToWire() (wire.Value, error) {
	var (
		fields [4]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.DomainUUID != nil {
		w, err = wire.NewValueString(*(v.DomainUUID)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.TaskListType != nil {
		w, err = wire.NewValueI32(*(v.TaskListType)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.TaskList != nil {
		w, err = v.TaskList.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.PollerID != nil {
		w, err = wire.NewValueString(*(v.PollerID)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 40, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

// FromWire deserializes a CancelOutstandingPollRequest struct from its Thrift-level
// representation. The Thrift-level representation may be obtained
// from a ThriftRW protocol implementation.
//
// An error is returned if we were unable to build a CancelOutstandingPollRequest struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v CancelOutstandingPollRequest
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *CancelOutstandingPollRequest) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.DomainUUID = &x
				if err != nil {
					return err
				}

			}
		case 20:
			if field.Value.Type() == wire.TI32 {
				var x int32
				x, err = field.Value.GetI32(), error(nil)
				v.TaskListType = &x
				if err != nil {
					return err
				}

			}
		case 30:
			if field.Value.Type() == wire.TStruct {
				v.TaskList, err = _TaskList_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 40:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.PollerID = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// Encode serializes a CancelOutstandingPollRequest struct directly into bytes, without going
// through an intermediary type.
//
// An error is returned if a CancelOutstandingPollRequest struct could not be encoded.
func (v *CancelOutstandingPollRequest) Encode(sw stream.Writer) error {
	if err := sw.WriteStructBegin(); err != nil {
		return err
	}

	if v.DomainUUID != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 10, Type: wire.TBinary}); err != nil {
			return err
		}
		if err := sw.WriteString(*(v.DomainUUID)); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.TaskListType != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 20, Type: wire.TI32}); err != nil {
			return err
		}
		if err := sw.WriteInt32(*(v.TaskListType)); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.TaskList != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 30, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.TaskList.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.PollerID != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 40, Type: wire.TBinary}); err != nil {
			return err
		}
		if err := sw.WriteString(*(v.PollerID)); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	return sw.WriteStructEnd()
}

// Decode deserializes a CancelOutstandingPollRequest struct directly from its Thrift-level
// representation, without going through an intemediary type.
//
// An error is returned if a CancelOutstandingPollRequest struct could not be generated from the wire
// representation.
func (v *CancelOutstandingPollRequest) Decode(sr stream.Reader) error {

	if err := sr.ReadStructBegin(); err != nil {
		return err
	}

	fh, ok, err := sr.ReadFieldBegin()
	if err != nil {
		return err
	}

	for ok {
		switch {
		case fh.ID == 10 && fh.Type == wire.TBinary:
			var x string
			x, err = sr.ReadString()
			v.DomainUUID = &x
			if err != nil {
				return err
			}

		case fh.ID == 20 && fh.Type == wire.TI32:
			var x int32
			x, err = sr.ReadInt32()
			v.TaskListType = &x
			if err != nil {
				return err
			}

		case fh.ID == 30 && fh.Type == wire.TStruct:
			v.TaskList, err = _TaskList_Decode(sr)
			if err != nil {
				return err
			}

		case fh.ID == 40 && fh.Type == wire.TBinary:
			var x string
			x, err = sr.ReadString()
			v.PollerID = &x
			if err != nil {
				return err
			}

		default:
			if err := sr.Skip(fh.Type); err != nil {
				return err
			}
		}

		if err := sr.ReadFieldEnd(); err != nil {
			return err
		}

		if fh, ok, err = sr.ReadFieldBegin(); err != nil {
			return err
		}
	}

	if err := sr.ReadStructEnd(); err != nil {
		return err
	}

	return nil
}

// String returns a readable string representation of a CancelOutstandingPollRequest
// struct.
func (v *CancelOutstandingPollRequest) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [4]string
	i := 0
	if v.DomainUUID != nil {
		fields[i] = fmt.Sprintf("DomainUUID: %v", *(v.DomainUUID))
		i++
	}
	if v.TaskListType != nil {
		fields[i] = fmt.Sprintf("TaskListType: %v", *(v.TaskListType))
		i++
	}
	if v.TaskList != nil {
		fields[i] = fmt.Sprintf("TaskList: %v", v.TaskList)
		i++
	}
	if v.PollerID != nil {
		fields[i] = fmt.Sprintf("PollerID: %v", *(v.PollerID))
		i++
	}

	return fmt.Sprintf("CancelOutstandingPollRequest{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this CancelOutstandingPollRequest match the
// provided CancelOutstandingPollRequest.
//
// This function performs a deep comparison.
func (v *CancelOutstandingPollRequest) Equals(rhs *CancelOutstandingPollRequest) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.DomainUUID, rhs.DomainUUID) {
		return false
	}
	if !_I32_EqualsPtr(v.TaskListType, rhs.TaskListType) {
		return false
	}
	if !((v.TaskList == nil && rhs.TaskList == nil) || (v.TaskList != nil && rhs.TaskList != nil && v.TaskList.Equals(rhs.TaskList))) {
		return false
	}
	if !_String_EqualsPtr(v.PollerID, rhs.PollerID) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of CancelOutstandingPollRequest.
func (v *CancelOutstandingPollRequest) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.DomainUUID != nil {
		enc.AddString("domainUUID", *v.DomainUUID)
	}
	if v.TaskListType != nil {
		enc.AddInt32("taskListType", *v.TaskListType)
	}
	if v.TaskList != nil {
		err = multierr.Append(err, enc.AddObject("taskList", v.TaskList))
	}
	if v.PollerID != nil {
		enc.AddString("pollerID", *v.PollerID)
	}
	return err
}

// GetDomainUUID returns the value of DomainUUID if it is set or its
// zero value if it is unset.
func (v *CancelOutstandingPollRequest) GetDomainUUID() (o string) {
	if v != nil && v.DomainUUID != nil {
		return *v.DomainUUID
	}

	return
}

// IsSetDomainUUID returns true if DomainUUID is not nil.
func (v *CancelOutstandingPollRequest) IsSetDomainUUID() bool {
	return v != nil && v.DomainUUID != nil
}

// GetTaskListType returns the value of TaskListType if it is set or its
// zero value if it is unset.
func (v *CancelOutstandingPollRequest) GetTaskListType() (o int32) {
	if v != nil && v.TaskListType != nil {
		return *v.TaskListType
	}

	return
}

// IsSetTaskListType returns true if TaskListType is not nil.
func (v *CancelOutstandingPollRequest) IsSetTaskListType() bool {
	return v != nil && v.TaskListType != nil
}

// GetTaskList returns the value of TaskList if it is set or its
// zero value if it is unset.
func (v *CancelOutstandingPollRequest) GetTaskList() (o *shared.TaskList) {
	if v != nil && v.TaskList != nil {
		return v.TaskList
	}

	return
}

// IsSetTaskList returns true if TaskList is not nil.
func (v *CancelOutstandingPollRequest) IsSetTaskList() bool {
	return v != nil && v.TaskList != nil
}

// GetPollerID returns the value of PollerID if it is set or its
// zero value if it is unset.
func (v *CancelOutstandingPollRequest) GetPollerID() (o string) {
	if v != nil && v.PollerID != nil {
		return *v.PollerID
	}

	return
}

// IsSetPollerID returns true if PollerID is not nil.
func (v *CancelOutstandingPollRequest) IsSetPollerID() bool {
	return v != nil && v.PollerID != nil
}

type DescribeTaskListRequest struct {
	DomainUUID  *string                         `json:"domainUUID,omitempty"`
	DescRequest *shared.DescribeTaskListRequest `json:"descRequest,omitempty"`
}

// ToWire translates a DescribeTaskListRequest struct into a Thrift-level intermediate
// representation. This intermediate representation may be serialized
// into bytes using a ThriftRW protocol implementation.
//
// An error is returned if the struct or any of its fields failed to
// validate.
//
//	x, err := v.ToWire()
//	if err != nil {
//	  return err
//	}
//
//	if err := binaryProtocol.Encode(x, writer); err != nil {
//	  return err
//	}
func (v *DescribeTaskListRequest) ToWire() (wire.Value, error) {
	var (
		fields [2]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.DomainUUID != nil {
		w, err = wire.NewValueString(*(v.DomainUUID)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.DescRequest != nil {
		w, err = v.DescRequest.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

func _DescribeTaskListRequest_Read(w wire.Value) (*shared.DescribeTaskListRequest, error) {
	var v shared.DescribeTaskListRequest
	err := v.FromWire(w)
	return &v, err
}

// FromWire deserializes a DescribeTaskListRequest struct from its Thrift-level
// representation. The Thrift-level representation may be obtained
// from a ThriftRW protocol implementation.
//
// An error is returned if we were unable to build a DescribeTaskListRequest struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v DescribeTaskListRequest
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *DescribeTaskListRequest) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.DomainUUID = &x
				if err != nil {
					return err
				}

			}
		case 20:
			if field.Value.Type() == wire.TStruct {
				v.DescRequest, err = _DescribeTaskListRequest_Read(field.Value)
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// Encode serializes a DescribeTaskListRequest struct directly into bytes, without going
// through an intermediary type.
//
// An error is returned if a DescribeTaskListRequest struct could not be encoded.
func (v *DescribeTaskListRequest) Encode(sw stream.Writer) error {
	if err := sw.WriteStructBegin(); err != nil {
		return err
	}

	if v.DomainUUID != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 10, Type: wire.TBinary}); err != nil {
			return err
		}
		if err := sw.WriteString(*(v.DomainUUID)); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.DescRequest != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 20, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.DescRequest.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	return sw.WriteStructEnd()
}

func _DescribeTaskListRequest_Decode(sr stream.Reader) (*shared.DescribeTaskListRequest, error) {
	var v shared.DescribeTaskListRequest
	err := v.Decode(sr)
	return &v, err
}

// Decode deserializes a DescribeTaskListRequest struct directly from its Thrift-level
// representation, without going through an intemediary type.
//
// An error is returned if a DescribeTaskListRequest struct could not be generated from the wire
// representation.
func (v *DescribeTaskListRequest) Decode(sr stream.Reader) error {

	if err := sr.ReadStructBegin(); err != nil {
		return err
	}

	fh, ok, err := sr.ReadFieldBegin()
	if err != nil {
		return err
	}

	for ok {
		switch {
		case fh.ID == 10 && fh.Type == wire.TBinary:
			var x string
			x, err = sr.ReadString()
			v.DomainUUID = &x
			if err != nil {
				return err
			}

		case fh.ID == 20 && fh.Type == wire.TStruct:
			v.DescRequest, err = _DescribeTaskListRequest_Decode(sr)
			if err != nil {
				return err
			}

		default:
			if err := sr.Skip(fh.Type); err != nil {
				return err
			}
		}

		if err := sr.ReadFieldEnd(); err != nil {
			return err
		}

		if fh, ok, err = sr.ReadFieldBegin(); err != nil {
			return err
		}
	}

	if err := sr.ReadStructEnd(); err != nil {
		return err
	}

	return nil
}

// String returns a readable string representation of a DescribeTaskListRequest
// struct.
func (v *DescribeTaskListRequest) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [2]string
	i := 0
	if v.DomainUUID != nil {
		fields[i] = fmt.Sprintf("DomainUUID: %v", *(v.DomainUUID))
		i++
	}
	if v.DescRequest != nil {
		fields[i] = fmt.Sprintf("DescRequest: %v", v.DescRequest)
		i++
	}

	return fmt.Sprintf("DescribeTaskListRequest{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this DescribeTaskListRequest match the
// provided DescribeTaskListRequest.
//
// This function performs a deep comparison.
func (v *DescribeTaskListRequest) Equals(rhs *DescribeTaskListRequest) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.DomainUUID, rhs.DomainUUID) {
		return false
	}
	if !((v.DescRequest == nil && rhs.DescRequest == nil) || (v.DescRequest != nil && rhs.DescRequest != nil && v.DescRequest.Equals(rhs.DescRequest))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of DescribeTaskListRequest.
func (v *DescribeTaskListRequest) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.DomainUUID != nil {
		enc.AddString("domainUUID", *v.DomainUUID)
	}
	if v.DescRequest != nil {
		err = multierr.Append(err, enc.AddObject("descRequest", v.DescRequest))
	}
	return err
}

// GetDomainUUID returns the value of DomainUUID if it is set or its
// zero value if it is unset.
func (v *DescribeTaskListRequest) GetDomainUUID() (o string) {
	if v != nil && v.DomainUUID != nil {
		return *v.DomainUUID
	}

	return
}

// IsSetDomainUUID returns true if DomainUUID is not nil.
func (v *DescribeTaskListRequest) IsSetDomainUUID() bool {
	return v != nil && v.DomainUUID != nil
}

// GetDescRequest returns the value of DescRequest if it is set or its
// zero value if it is unset.
func (v *DescribeTaskListRequest) GetDescRequest() (o *shared.DescribeTaskListRequest) {
	if v != nil && v.DescRequest != nil {
		return v.DescRequest
	}

	return
}

// IsSetDescRequest returns true if DescRequest is not nil.
func (v *DescribeTaskListRequest) IsSetDescRequest() bool {
	return v != nil && v.DescRequest != nil
}

type ListTaskListPartitionsRequest struct {
	Domain   *string          `json:"domain,omitempty"`
	TaskList *shared.TaskList `json:"taskList,omitempty"`
}

// ToWire translates a ListTaskListPartitionsRequest struct into a Thrift-level intermediate
// representation. This intermediate representation may be serialized
// into bytes using a ThriftRW protocol implementation.
//
// An error is returned if the struct or any of its fields failed to
// validate.
//
//	x, err := v.ToWire()
//	if err != nil {
//	  return err
//	}
//
//	if err := binaryProtocol.Encode(x, writer); err != nil {
//	  return err
//	}
func (v *ListTaskListPartitionsRequest) ToWire() (wire.Value, error) {
	var (
		fields [2]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.Domain != nil {
		w, err = wire.NewValueString(*(v.Domain)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.TaskList != nil {
		w, err = v.TaskList.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

// FromWire deserializes a ListTaskListPartitionsRequest struct from its Thrift-level
// representation. The Thrift-level representation may be obtained
// from a ThriftRW protocol implementation.
//
// An error is returned if we were unable to build a ListTaskListPartitionsRequest struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v ListTaskListPartitionsRequest
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *ListTaskListPartitionsRequest) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.Domain = &x
				if err != nil {
					return err
				}

			}
		case 20:
			if field.Value.Type() == wire.TStruct {
				v.TaskList, err = _TaskList_Read(field.Value)
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// Encode serializes a ListTaskListPartitionsRequest struct directly into bytes, without going
// through an intermediary type.
//
// An error is returned if a ListTaskListPartitionsRequest struct could not be encoded.
func (v *ListTaskListPartitionsRequest) Encode(sw stream.Writer) error {
	if err := sw.WriteStructBegin(); err != nil {
		return err
	}

	if v.Domain != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 10, Type: wire.TBinary}); err != nil {
			return err
		}
		if err := sw.WriteString(*(v.Domain)); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.TaskList != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 20, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.TaskList.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	return sw.WriteStructEnd()
}

// Decode deserializes a ListTaskListPartitionsRequest struct directly from its Thrift-level
// representation, without going through an intemediary type.
//
// An error is returned if a ListTaskListPartitionsRequest struct could not be generated from the wire
// representation.
func (v *ListTaskListPartitionsRequest) Decode(sr stream.Reader) error {

	if err := sr.ReadStructBegin(); err != nil {
		return err
	}

	fh, ok, err := sr.ReadFieldBegin()
	if err != nil {
		return err
	}

	for ok {
		switch {
		case fh.ID == 10 && fh.Type == wire.TBinary:
			var x string
			x, err = sr.ReadString()
			v.Domain = &x
			if err != nil {
				return err
			}

		case fh.ID == 20 && fh.Type == wire.TStruct:
			v.TaskList, err = _TaskList_Decode(sr)
			if err != nil {
				return err
			}

		default:
			if err := sr.Skip(fh.Type); err != nil {
				return err
			}
		}

		if err := sr.ReadFieldEnd(); err != nil {
			return err
		}

		if fh, ok, err = sr.ReadFieldBegin(); err != nil {
			return err
		}
	}

	if err := sr.ReadStructEnd(); err != nil {
		return err
	}

	return nil
}

// String returns a readable string representation of a ListTaskListPartitionsRequest
// struct.
func (v *ListTaskListPartitionsRequest) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [2]string
	i := 0
	if v.Domain != nil {
		fields[i] = fmt.Sprintf("Domain: %v", *(v.Domain))
		i++
	}
	if v.TaskList != nil {
		fields[i] = fmt.Sprintf("TaskList: %v", v.TaskList)
		i++
	}

	return fmt.Sprintf("ListTaskListPartitionsRequest{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this ListTaskListPartitionsRequest match the
// provided ListTaskListPartitionsRequest.
//
// This function performs a deep comparison.
func (v *ListTaskListPartitionsRequest) Equals(rhs *ListTaskListPartitionsRequest) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.Domain, rhs.Domain) {
		return false
	}
	if !((v.TaskList == nil && rhs.TaskList == nil) || (v.TaskList != nil && rhs.TaskList != nil && v.TaskList.Equals(rhs.TaskList))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of ListTaskListPartitionsRequest.
func (v *ListTaskListPartitionsRequest) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Domain != nil {
		enc.AddString("domain", *v.Domain)
	}
	if v.TaskList != nil {
		err = multierr.Append(err, enc.AddObject("taskList", v.TaskList))
	}
	return err
}

// GetDomain returns the value of Domain if it is set or its
// zero value if it is unset.
func (v *ListTaskListPartitionsRequest) GetDomain() (o string) {
	if v != nil && v.Domain != nil {
		return *v.Domain
	}

	return
}

// IsSetDomain returns true if Domain is not nil.
func (v *ListTaskListPartitionsRequest) IsSetDomain() bool {
	return v != nil && v.Domain != nil
}

// GetTaskList returns the value of TaskList if it is set or its
// zero value if it is unset.
func (v *ListTaskListPartitionsRequest) GetTaskList() (o *shared.TaskList) {
	if v != nil && v.TaskList != nil {
		return v.TaskList
	}

	return
}

// IsSetTaskList returns true if TaskList is not nil.
func (v *ListTaskListPartitionsRequest) IsSetTaskList() bool {
	return v != nil && v.TaskList != nil
}

type PollForActivityTaskRequest struct {
	DomainUUID     *string                            `json:"domainUUID,omitempty"`
	PollerID       *string                            `json:"pollerID,omitempty"`
	PollRequest    *shared.PollForActivityTaskRequest `json:"pollRequest,omitempty"`
	ForwardedFrom  *string                            `json:"forwardedFrom,omitempty"`
	IsolationGroup *string                            `json:"isolationGroup,omitempty"`
}

// ToWire translates a PollForActivityTaskRequest struct into a Thrift-level intermediate
// representation. This intermediate representation may be serialized
// into bytes using a ThriftRW protocol implementation.
//
// An error is returned if the struct or any of its fields failed to
// validate.
//
//	x, err := v.ToWire()
//	if err != nil {
//	  return err
//	}
//
//	if err := binaryProtocol.Encode(x, writer); err != nil {
//	  return err
//	}
func (v *PollForActivityTaskRequest) ToWire() (wire.Value, error) {
	var (
		fields [5]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.DomainUUID != nil {
		w, err = wire.NewValueString(*(v.DomainUUID)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.PollerID != nil {
		w, err = wire.NewValueString(*(v.PollerID)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 15, Value: w}
		i++
	}
	if v.PollRequest != nil {
		w, err = v.PollRequest.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.ForwardedFrom != nil {
		w, err = wire.NewValueString(*(v.ForwardedFrom)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.IsolationGroup != nil {
		w, err = wire.NewValueString(*(v.IsolationGroup)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 40, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

func _PollForActivityTaskRequest_Read(w wire.Value) (*shared.PollForActivityTaskRequest, error) {
	var v shared.PollForActivityTaskRequest
	err := v.FromWire(w)
	return &v, err
}

// FromWire deserializes a PollForActivityTaskRequest struct from its Thrift-level
// representation. The Thrift-level representation may be obtained
// from a ThriftRW protocol implementation.
//
// An error is returned if we were unable to build a PollForActivityTaskRequest struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v PollForActivityTaskRequest
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *PollForActivityTaskRequest) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.DomainUUID = &x
				if err != nil {
					return err
				}

			}
		case 15:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.PollerID = &x
				if err != nil {
					return err
				}

			}
		case 20:
			if field.Value.Type() == wire.TStruct {
				v.PollRequest, err = _PollForActivityTaskRequest_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 30:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.ForwardedFrom = &x
				if err != nil {
					return err
				}

			}
		case 40:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.IsolationGroup = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// Encode serializes a PollForActivityTaskRequest struct directly into bytes, without going
// through an intermediary type.
//
// An error is returned if a PollForActivityTaskRequest struct could not be encoded.
func (v *PollForActivityTaskRequest) Encode(sw stream.Writer) error {
	if err := sw.WriteStructBegin(); err != nil {
		return err
	}

	if v.DomainUUID != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 10, Type: wire.TBinary}); err != nil {
			return err
		}
		if err := sw.WriteString(*(v.DomainUUID)); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.PollerID != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 15, Type: wire.TBinary}); err != nil {
			return err
		}
		if err := sw.WriteString(*(v.PollerID)); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.PollRequest != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 20, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.PollRequest.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.ForwardedFrom != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 30, Type: wire.TBinary}); err != nil {
			return err
		}
		if err := sw.WriteString(*(v.ForwardedFrom)); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.IsolationGroup != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 40, Type: wire.TBinary}); err != nil {
			return err
		}
		if err := sw.WriteString(*(v.IsolationGroup)); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	return sw.WriteStructEnd()
}

func _PollForActivityTaskRequest_Decode(sr stream.Reader) (*shared.PollForActivityTaskRequest, error) {
	var v shared.PollForActivityTaskRequest
	err := v.Decode(sr)
	return &v, err
}

// Decode deserializes a PollForActivityTaskRequest struct directly from its Thrift-level
// representation, without going through an intemediary type.
//
// An error is returned if a PollForActivityTaskRequest struct could not be generated from the wire
// representation.
func (v *PollForActivityTaskRequest) Decode(sr stream.Reader) error {

	if err := sr.ReadStructBegin(); err != nil {
		return err
	}

	fh, ok, err := sr.ReadFieldBegin()
	if err != nil {
		return err
	}

	for ok {
		switch {
		case fh.ID == 10 && fh.Type == wire.TBinary:
			var x string
			x, err = sr.ReadString()
			v.DomainUUID = &x
			if err != nil {
				return err
			}

		case fh.ID == 15 && fh.Type == wire.TBinary:
			var x string
			x, err = sr.ReadString()
			v.PollerID = &x
			if err != nil {
				return err
			}

		case fh.ID == 20 && fh.Type == wire.TStruct:
			v.PollRequest, err = _PollForActivityTaskRequest_Decode(sr)
			if err != nil {
				return err
			}

		case fh.ID == 30 && fh.Type == wire.TBinary:
			var x string
			x, err = sr.ReadString()
			v.ForwardedFrom = &x
			if err != nil {
				return err
			}

		case fh.ID == 40 && fh.Type == wire.TBinary:
			var x string
			x, err = sr.ReadString()
			v.IsolationGroup = &x
			if err != nil {
				return err
			}

		default:
			if err := sr.Skip(fh.Type); err != nil {
				return err
			}
		}

		if err := sr.ReadFieldEnd(); err != nil {
			return err
		}

		if fh, ok, err = sr.ReadFieldBegin(); err != nil {
			return err
		}
	}

	if err := sr.ReadStructEnd(); err != nil {
		return err
	}

	return nil
}

// String returns a readable string representation of a PollForActivityTaskRequest
// struct.
func (v *PollForActivityTaskRequest) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [5]string
	i := 0
	if v.DomainUUID != nil {
		fields[i] = fmt.Sprintf("DomainUUID: %v", *(v.DomainUUID))
		i++
	}
	if v.PollerID != nil {
		fields[i] = fmt.Sprintf("PollerID: %v", *(v.PollerID))
		i++
	}
	if v.PollRequest != nil {
		fields[i] = fmt.Sprintf("PollRequest: %v", v.PollRequest)
		i++
	}
	if v.ForwardedFrom != nil {
		fields[i] = fmt.Sprintf("ForwardedFrom: %v", *(v.ForwardedFrom))
		i++
	}
	if v.IsolationGroup != nil {
		fields[i] = fmt.Sprintf("IsolationGroup: %v", *(v.IsolationGroup))
		i++
	}

	return fmt.Sprintf("PollForActivityTaskRequest{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this PollForActivityTaskRequest match the
// provided PollForActivityTaskRequest.
//
// This function performs a deep comparison.
func (v *PollForActivityTaskRequest) Equals(rhs *PollForActivityTaskRequest) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.DomainUUID, rhs.DomainUUID) {
		return false
	}
	if !_String_EqualsPtr(v.PollerID, rhs.PollerID) {
		return false
	}
	if !((v.PollRequest == nil && rhs.PollRequest == nil) || (v.PollRequest != nil && rhs.PollRequest != nil && v.PollRequest.Equals(rhs.PollRequest))) {
		return false
	}
	if !_String_EqualsPtr(v.ForwardedFrom, rhs.ForwardedFrom) {
		return false
	}
	if !_String_EqualsPtr(v.IsolationGroup, rhs.IsolationGroup) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of PollForActivityTaskRequest.
func (v *PollForActivityTaskRequest) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.DomainUUID != nil {
		enc.AddString("domainUUID", *v.DomainUUID)
	}
	if v.PollerID != nil {
		enc.AddString("pollerID", *v.PollerID)
	}
	if v.PollRequest != nil {
		err = multierr.Append(err, enc.AddObject("pollRequest", v.PollRequest))
	}
	if v.ForwardedFrom != nil {
		enc.AddString("forwardedFrom", *v.ForwardedFrom)
	}
	if v.IsolationGroup != nil {
		enc.AddString("isolationGroup", *v.IsolationGroup)
	}
	return err
}

// GetDomainUUID returns the value of DomainUUID if it is set or its
// zero value if it is unset.
func (v *PollForActivityTaskRequest) GetDomainUUID() (o string) {
	if v != nil && v.DomainUUID != nil {
		return *v.DomainUUID
	}

	return
}

// IsSetDomainUUID returns true if DomainUUID is not nil.
func (v *PollForActivityTaskRequest) IsSetDomainUUID() bool {
	return v != nil && v.DomainUUID != nil
}

// GetPollerID returns the value of PollerID if it is set or its
// zero value if it is unset.
func (v *PollForActivityTaskRequest) GetPollerID() (o string) {
	if v != nil && v.PollerID != nil {
		return *v.PollerID
	}

	return
}

// IsSetPollerID returns true if PollerID is not nil.
func (v *PollForActivityTaskRequest) IsSetPollerID() bool {
	return v != nil && v.PollerID != nil
}

// GetPollRequest returns the value of PollRequest if it is set or its
// zero value if it is unset.
func (v *PollForActivityTaskRequest) GetPollRequest() (o *shared.PollForActivityTaskRequest) {
	if v != nil && v.PollRequest != nil {
		return v.PollRequest
	}

	return
}

// IsSetPollRequest returns true if PollRequest is not nil.
func (v *PollForActivityTaskRequest) IsSetPollRequest() bool {
	return v != nil && v.PollRequest != nil
}

// GetForwardedFrom returns the value of ForwardedFrom if it is set or its
// zero value if it is unset.
func (v *PollForActivityTaskRequest) GetForwardedFrom() (o string) {
	if v != nil && v.ForwardedFrom != nil {
		return *v.ForwardedFrom
	}

	return
}

// IsSetForwardedFrom returns true if ForwardedFrom is not nil.
func (v *PollForActivityTaskRequest) IsSetForwardedFrom() bool {
	return v != nil && v.ForwardedFrom != nil
}

// GetIsolationGroup returns the value of IsolationGroup if it is set or its
// zero value if it is unset.
func (v *PollForActivityTaskRequest) GetIsolationGroup() (o string) {
	if v != nil && v.IsolationGroup != nil {
		return *v.IsolationGroup
	}

	return
}

// IsSetIsolationGroup returns true if IsolationGroup is not nil.
func (v *PollForActivityTaskRequest) IsSetIsolationGroup() bool {
	return v != nil && v.IsolationGroup != nil
}

type PollForDecisionTaskRequest struct {
	DomainUUID     *string                            `json:"domainUUID,omitempty"`
	PollerID       *string                            `json:"pollerID,omitempty"`
	PollRequest    *shared.PollForDecisionTaskRequest `json:"pollRequest,omitempty"`
	ForwardedFrom  *string                            `json:"forwardedFrom,omitempty"`
	IsolationGroup *string                            `json:"isolationGroup,omitempty"`
}

// ToWire translates a PollForDecisionTaskRequest struct into a Thrift-level intermediate
// representation. This intermediate representation may be serialized
// into bytes using a ThriftRW protocol implementation.
//
// An error is returned if the struct or any of its fields failed to
// validate.
//
//	x, err := v.ToWire()
//	if err != nil {
//	  return err
//	}
//
//	if err := binaryProtocol.Encode(x, writer); err != nil {
//	  return err
//	}
func (v *PollForDecisionTaskRequest) ToWire() (wire.Value, error) {
	var (
		fields [5]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.DomainUUID != nil {
		w, err = wire.NewValueString(*(v.DomainUUID)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.PollerID != nil {
		w, err = wire.NewValueString(*(v.PollerID)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 15, Value: w}
		i++
	}
	if v.PollRequest != nil {
		w, err = v.PollRequest.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.ForwardedFrom != nil {
		w, err = wire.NewValueString(*(v.ForwardedFrom)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.IsolationGroup != nil {
		w, err = wire.NewValueString(*(v.IsolationGroup)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 40, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

func _PollForDecisionTaskRequest_Read(w wire.Value) (*shared.PollForDecisionTaskRequest, error) {
	var v shared.PollForDecisionTaskRequest
	err := v.FromWire(w)
	return &v, err
}

// FromWire deserializes a PollForDecisionTaskRequest struct from its Thrift-level
// representation. The Thrift-level representation may be obtained
// from a ThriftRW protocol implementation.
//
// An error is returned if we were unable to build a PollForDecisionTaskRequest struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v PollForDecisionTaskRequest
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *PollForDecisionTaskRequest) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.DomainUUID = &x
				if err != nil {
					return err
				}

			}
		case 15:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.PollerID = &x
				if err != nil {
					return err
				}

			}
		case 20:
			if field.Value.Type() == wire.TStruct {
				v.PollRequest, err = _PollForDecisionTaskRequest_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 30:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.ForwardedFrom = &x
				if err != nil {
					return err
				}

			}
		case 40:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.IsolationGroup = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// Encode serializes a PollForDecisionTaskRequest struct directly into bytes, without going
// through an intermediary type.
//
// An error is returned if a PollForDecisionTaskRequest struct could not be encoded.
func (v *PollForDecisionTaskRequest) Encode(sw stream.Writer) error {
	if err := sw.WriteStructBegin(); err != nil {
		return err
	}

	if v.DomainUUID != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 10, Type: wire.TBinary}); err != nil {
			return err
		}
		if err := sw.WriteString(*(v.DomainUUID)); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.PollerID != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 15, Type: wire.TBinary}); err != nil {
			return err
		}
		if err := sw.WriteString(*(v.PollerID)); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.PollRequest != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 20, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.PollRequest.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.ForwardedFrom != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 30, Type: wire.TBinary}); err != nil {
			return err
		}
		if err := sw.WriteString(*(v.ForwardedFrom)); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.IsolationGroup != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 40, Type: wire.TBinary}); err != nil {
			return err
		}
		if err := sw.WriteString(*(v.IsolationGroup)); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	return sw.WriteStructEnd()
}

func _PollForDecisionTaskRequest_Decode(sr stream.Reader) (*shared.PollForDecisionTaskRequest, error) {
	var v shared.PollForDecisionTaskRequest
	err := v.Decode(sr)
	return &v, err
}

// Decode deserializes a PollForDecisionTaskRequest struct directly from its Thrift-level
// representation, without going through an intemediary type.
//
// An error is returned if a PollForDecisionTaskRequest struct could not be generated from the wire
// representation.
func (v *PollForDecisionTaskRequest) Decode(sr stream.Reader) error {

	if err := sr.ReadStructBegin(); err != nil {
		return err
	}

	fh, ok, err := sr.ReadFieldBegin()
	if err != nil {
		return err
	}

	for ok {
		switch {
		case fh.ID == 10 && fh.Type == wire.TBinary:
			var x string
			x, err = sr.ReadString()
			v.DomainUUID = &x
			if err != nil {
				return err
			}

		case fh.ID == 15 && fh.Type == wire.TBinary:
			var x string
			x, err = sr.ReadString()
			v.PollerID = &x
			if err != nil {
				return err
			}

		case fh.ID == 20 && fh.Type == wire.TStruct:
			v.PollRequest, err = _PollForDecisionTaskRequest_Decode(sr)
			if err != nil {
				return err
			}

		case fh.ID == 30 && fh.Type == wire.TBinary:
			var x string
			x, err = sr.ReadString()
			v.ForwardedFrom = &x
			if err != nil {
				return err
			}

		case fh.ID == 40 && fh.Type == wire.TBinary:
			var x string
			x, err = sr.ReadString()
			v.IsolationGroup = &x
			if err != nil {
				return err
			}

		default:
			if err := sr.Skip(fh.Type); err != nil {
				return err
			}
		}

		if err := sr.ReadFieldEnd(); err != nil {
			return err
		}

		if fh, ok, err = sr.ReadFieldBegin(); err != nil {
			return err
		}
	}

	if err := sr.ReadStructEnd(); err != nil {
		return err
	}

	return nil
}

// String returns a readable string representation of a PollForDecisionTaskRequest
// struct.
func (v *PollForDecisionTaskRequest) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [5]string
	i := 0
	if v.DomainUUID != nil {
		fields[i] = fmt.Sprintf("DomainUUID: %v", *(v.DomainUUID))
		i++
	}
	if v.PollerID != nil {
		fields[i] = fmt.Sprintf("PollerID: %v", *(v.PollerID))
		i++
	}
	if v.PollRequest != nil {
		fields[i] = fmt.Sprintf("PollRequest: %v", v.PollRequest)
		i++
	}
	if v.ForwardedFrom != nil {
		fields[i] = fmt.Sprintf("ForwardedFrom: %v", *(v.ForwardedFrom))
		i++
	}
	if v.IsolationGroup != nil {
		fields[i] = fmt.Sprintf("IsolationGroup: %v", *(v.IsolationGroup))
		i++
	}

	return fmt.Sprintf("PollForDecisionTaskRequest{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this PollForDecisionTaskRequest match the
// provided PollForDecisionTaskRequest.
//
// This function performs a deep comparison.
func (v *PollForDecisionTaskRequest) Equals(rhs *PollForDecisionTaskRequest) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.DomainUUID, rhs.DomainUUID) {
		return false
	}
	if !_String_EqualsPtr(v.PollerID, rhs.PollerID) {
		return false
	}
	if !((v.PollRequest == nil && rhs.PollRequest == nil) || (v.PollRequest != nil && rhs.PollRequest != nil && v.PollRequest.Equals(rhs.PollRequest))) {
		return false
	}
	if !_String_EqualsPtr(v.ForwardedFrom, rhs.ForwardedFrom) {
		return false
	}
	if !_String_EqualsPtr(v.IsolationGroup, rhs.IsolationGroup) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of PollForDecisionTaskRequest.
func (v *PollForDecisionTaskRequest) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.DomainUUID != nil {
		enc.AddString("domainUUID", *v.DomainUUID)
	}
	if v.PollerID != nil {
		enc.AddString("pollerID", *v.PollerID)
	}
	if v.PollRequest != nil {
		err = multierr.Append(err, enc.AddObject("pollRequest", v.PollRequest))
	}
	if v.ForwardedFrom != nil {
		enc.AddString("forwardedFrom", *v.ForwardedFrom)
	}
	if v.IsolationGroup != nil {
		enc.AddString("isolationGroup", *v.IsolationGroup)
	}
	return err
}

// GetDomainUUID returns the value of DomainUUID if it is set or its
// zero value if it is unset.
func (v *PollForDecisionTaskRequest) GetDomainUUID() (o string) {
	if v != nil && v.DomainUUID != nil {
		return *v.DomainUUID
	}

	return
}

// IsSetDomainUUID returns true if DomainUUID is not nil.
func (v *PollForDecisionTaskRequest) IsSetDomainUUID() bool {
	return v != nil && v.DomainUUID != nil
}

// GetPollerID returns the value of PollerID if it is set or its
// zero value if it is unset.
func (v *PollForDecisionTaskRequest) GetPollerID() (o string) {
	if v != nil && v.PollerID != nil {
		return *v.PollerID
	}

	return
}

// IsSetPollerID returns true if PollerID is not nil.
func (v *PollForDecisionTaskRequest) IsSetPollerID() bool {
	return v != nil && v.PollerID != nil
}

// GetPollRequest returns the value of PollRequest if it is set or its
// zero value if it is unset.
func (v *PollForDecisionTaskRequest) GetPollRequest() (o *shared.PollForDecisionTaskRequest) {
	if v != nil && v.PollRequest != nil {
		return v.PollRequest
	}

	return
}

// IsSetPollRequest returns true if PollRequest is not nil.
func (v *PollForDecisionTaskRequest) IsSetPollRequest() bool {
	return v != nil && v.PollRequest != nil
}

// GetForwardedFrom returns the value of ForwardedFrom if it is set or its
// zero value if it is unset.
func (v *PollForDecisionTaskRequest) GetForwardedFrom() (o string) {
	if v != nil && v.ForwardedFrom != nil {
		return *v.ForwardedFrom
	}

	return
}

// IsSetForwardedFrom returns true if ForwardedFrom is not nil.
func (v *PollForDecisionTaskRequest) IsSetForwardedFrom() bool {
	return v != nil && v.ForwardedFrom != nil
}

// GetIsolationGroup returns the value of IsolationGroup if it is set or its
// zero value if it is unset.
func (v *PollForDecisionTaskRequest) GetIsolationGroup() (o string) {
	if v != nil && v.IsolationGroup != nil {
		return *v.IsolationGroup
	}

	return
}

// IsSetIsolationGroup returns true if IsolationGroup is not nil.
func (v *PollForDecisionTaskRequest) IsSetIsolationGroup() bool {
	return v != nil && v.IsolationGroup != nil
}

type PollForDecisionTaskResponse struct {
	TaskToken                 []byte                           `json:"taskToken,omitempty"`
	WorkflowExecution         *shared.WorkflowExecution        `json:"workflowExecution,omitempty"`
	WorkflowType              *shared.WorkflowType             `json:"workflowType,omitempty"`
	PreviousStartedEventId    *int64                           `json:"previousStartedEventId,omitempty"`
	StartedEventId            *int64                           `json:"startedEventId,omitempty"`
	Attempt                   *int64                           `json:"attempt,omitempty"`
	NextEventId               *int64                           `json:"nextEventId,omitempty"`
	BacklogCountHint          *int64                           `json:"backlogCountHint,omitempty"`
	StickyExecutionEnabled    *bool                            `json:"stickyExecutionEnabled,omitempty"`
	Query                     *shared.WorkflowQuery            `json:"query,omitempty"`
	DecisionInfo              *shared.TransientDecisionInfo    `json:"decisionInfo,omitempty"`
	WorkflowExecutionTaskList *shared.TaskList                 `json:"WorkflowExecutionTaskList,omitempty"`
	EventStoreVersion         *int32                           `json:"eventStoreVersion,omitempty"`
	BranchToken               []byte                           `json:"branchToken,omitempty"`
	ScheduledTimestamp        *int64                           `json:"scheduledTimestamp,omitempty"`
	StartedTimestamp          *int64                           `json:"startedTimestamp,omitempty"`
	Queries                   map[string]*shared.WorkflowQuery `json:"queries,omitempty"`
	TotalHistoryBytes         *int64                           `json:"totalHistoryBytes,omitempty"`
	AutoConfigHint            *shared.AutoConfigHint           `json:"autoConfigHint,omitempty"`
}

type _Map_String_WorkflowQuery_MapItemList map[string]*shared.WorkflowQuery

func (m _Map_String_WorkflowQuery_MapItemList) ForEach(f func(wire.MapItem) error) error {
	for k, v := range m {
		if v == nil {
			return fmt.Errorf("invalid map 'map[string]*shared.WorkflowQuery', key [%v]: value is nil", k)
		}
		kw, err := wire.NewValueString(k), error(nil)
		if err != nil {
			return err
		}

		vw, err := v.ToWire()
		if err != nil {
			return err
		}
		err = f(wire.MapItem{Key: kw, Value: vw})
		if err != nil {
			return err
		}
	}
	return nil
}

func (m _Map_String_WorkflowQuery_MapItemList) Size() int {
	return len(m)
}

func (_Map_String_WorkflowQuery_MapItemList) KeyType() wire.Type {
	return wire.TBinary
}

func (_Map_String_WorkflowQuery_MapItemList) ValueType() wire.Type {
	return wire.TStruct
}

func (_Map_String_WorkflowQuery_MapItemList) Close() {}

// ToWire translates a PollForDecisionTaskResponse struct into a Thrift-level intermediate
// representation. This intermediate representation may be serialized
// into bytes using a ThriftRW protocol implementation.
//
// An error is returned if the struct or any of its fields failed to
// validate.
//
//	x, err := v.ToWire()
//	if err != nil {
//	  return err
//	}
//
//	if err := binaryProtocol.Encode(x, writer); err != nil {
//	  return err
//	}
func (v *PollForDecisionTaskResponse) ToWire() (wire.Value, error) {
	var (
		fields [19]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.TaskToken != nil {
		w, err = wire.NewValueBinary(v.TaskToken), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.WorkflowExecution != nil {
		w, err = v.WorkflowExecution.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.WorkflowType != nil {
		w, err = v.WorkflowType.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.PreviousStartedEventId != nil {
		w, err = wire.NewValueI64(*(v.PreviousStartedEventId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 40, Value: w}
		i++
	}
	if v.StartedEventId != nil {
		w, err = wire.NewValueI64(*(v.StartedEventId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 50, Value: w}
		i++
	}
	if v.Attempt != nil {
		w, err = wire.NewValueI64(*(v.Attempt)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 51, Value: w}
		i++
	}
	if v.NextEventId != nil {
		w, err = wire.NewValueI64(*(v.NextEventId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 60, Value: w}
		i++
	}
	if v.BacklogCountHint != nil {
		w, err = wire.NewValueI64(*(v.BacklogCountHint)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 65, Value: w}
		i++
	}
	if v.StickyExecutionEnabled != nil {
		w, err = wire.NewValueBool(*(v.StickyExecutionEnabled)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 70, Value: w}
		i++
	}
	if v.Query != nil {
		w, err = v.Query.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 80, Value: w}
		i++
	}
	if v.DecisionInfo != nil {
		w, err = v.DecisionInfo.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 90, Value: w}
		i++
	}
	if v.WorkflowExecutionTaskList != nil {
		w, err = v.WorkflowExecutionTaskList.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 100, Value: w}
		i++
	}
	if v.EventStoreVersion != nil {
		w, err = wire.NewValueI32(*(v.EventStoreVersion)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 110, Value: w}
		i++
	}
	if v.BranchToken != nil {
		w, err = wire.NewValueBinary(v.BranchToken), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 120, Value: w}
		i++
	}
	if v.ScheduledTimestamp != nil {
		w, err = wire.NewValueI64(*(v.ScheduledTimestamp)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 130, Value: w}
		i++
	}
	if v.StartedTimestamp != nil {
		w, err = wire.NewValueI64(*(v.StartedTimestamp)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 140, Value: w}
		i++
	}
	if v.Queries != nil {
		w, err = wire.NewValueMap(_Map_String_WorkflowQuery_MapItemList(v.Queries)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 150, Value: w}
		i++
	}
	if v.TotalHistoryBytes != nil {
		w, err = wire.NewValueI64(*(v.TotalHistoryBytes)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 160, Value: w}
		i++
	}
	if v.AutoConfigHint != nil {
		w, err = v.AutoConfigHint.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 170, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

func _WorkflowQuery_Read(w wire.Value) (*shared.WorkflowQuery, error) {
	var v shared.WorkflowQuery
	err := v.FromWire(w)
	return &v, err
}

func _TransientDecisionInfo_Read(w wire.Value) (*shared.TransientDecisionInfo, error) {
	var v shared.TransientDecisionInfo
	err := v.FromWire(w)
	return &v, err
}

func _Map_String_WorkflowQuery_Read(m wire.MapItemList) (map[string]*shared.WorkflowQuery, error) {
	if m.KeyType() != wire.TBinary {
		return nil, nil
	}

	if m.ValueType() != wire.TStruct {
		return nil, nil
	}

	o := make(map[string]*shared.WorkflowQuery, m.Size())
	err := m.ForEach(func(x wire.MapItem) error {
		k, err := x.Key.GetString(), error(nil)
		if err != nil {
			return err
		}

		v, err := _WorkflowQuery_Read(x.Value)
		if err != nil {
			return err
		}

		o[k] = v
		return nil
	})
	m.Close()
	return o, err
}

func _AutoConfigHint_Read(w wire.Value) (*shared.AutoConfigHint, error) {
	var v shared.AutoConfigHint
	err := v.FromWire(w)
	return &v, err
}

// FromWire deserializes a PollForDecisionTaskResponse struct from its Thrift-level
// representation. The Thrift-level representation may be obtained
// from a ThriftRW protocol implementation.
//
// An error is returned if we were unable to build a PollForDecisionTaskResponse struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v PollForDecisionTaskResponse
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *PollForDecisionTaskResponse) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			if field.Value.Type() == wire.TBinary {
				v.TaskToken, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		case 20:
			if field.Value.Type() == wire.TStruct {
				v.WorkflowExecution, err = _WorkflowExecution_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 30:
			if field.Value.Type() == wire.TStruct {
				v.WorkflowType, err = _WorkflowType_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 40:
			if field.Value.Type() == wire.TI64 {
				var x int64
				x, err = field.Value.GetI64(), error(nil)
				v.PreviousStartedEventId = &x
				if err != nil {
					return err
				}

			}
		case 50:
			if field.Value.Type() == wire.TI64 {
				var x int64
				x, err = field.Value.GetI64(), error(nil)
				v.StartedEventId = &x
				if err != nil {
					return err
				}

			}
		case 51:
			if field.Value.Type() == wire.TI64 {
				var x int64
				x, err = field.Value.GetI64(), error(nil)
				v.Attempt = &x
				if err != nil {
					return err
				}

			}
		case 60:
			if field.Value.Type() == wire.TI64 {
				var x int64
				x, err = field.Value.GetI64(), error(nil)
				v.NextEventId = &x
				if err != nil {
					return err
				}

			}
		case 65:
			if field.Value.Type() == wire.TI64 {
				var x int64
				x, err = field.Value.GetI64(), error(nil)
				v.BacklogCountHint = &x
				if err != nil {
					return err
				}

			}
		case 70:
			if field.Value.Type() == wire.TBool {
				var x bool
				x, err = field.Value.GetBool(), error(nil)
				v.StickyExecutionEnabled = &x
				if err != nil {
					return err
				}

			}
		case 80:
			if field.Value.Type() == wire.TStruct {
				v.Query, err = _WorkflowQuery_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 90:
			if field.Value.Type() == wire.TStruct {
				v.DecisionInfo, err = _TransientDecisionInfo_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 100:
			if field.Value.Type() == wire.TStruct {
				v.WorkflowExecutionTaskList, err = _TaskList_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 110:
			if field.Value.Type() == wire.TI32 {
				var x int32
				x, err = field.Value.GetI32(), error(nil)
				v.EventStoreVersion = &x
				if err != nil {
					return err
				}

			}
		case 120:
			if field.Value.Type() == wire.TBinary {
				v.BranchToken, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		case 130:
			if field.Value.Type() == wire.TI64 {
				var x int64
				x, err = field.Value.GetI64(), error(nil)
				v.ScheduledTimestamp = &x
				if err != nil {
					return err
				}

			}
		case 140:
			if field.Value.Type() == wire.TI64 {
				var x int64
				x, err = field.Value.GetI64(), error(nil)
				v.StartedTimestamp = &x
				if err != nil {
					return err
				}

			}
		case 150:
			if field.Value.Type() == wire.TMap {
				v.Queries, err = _Map_String_WorkflowQuery_Read(field.Value.GetMap())
				if err != nil {
					return err
				}

			}
		case 160:
			if field.Value.Type() == wire.TI64 {
				var x int64
				x, err = field.Value.GetI64(), error(nil)
				v.TotalHistoryBytes = &x
				if err != nil {
					return err
				}

			}
		case 170:
			if field.Value.Type() == wire.TStruct {
				v.AutoConfigHint, err = _AutoConfigHint_Read(field.Value)
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

func _Map_String_WorkflowQuery_Encode(val map[string]*shared.WorkflowQuery, sw stream.Writer) error {

	mh := stream.MapHeader{
		KeyType:   wire.TBinary,
		ValueType: wire.TStruct,
		Length:    len(val),
	}
	if err := sw.WriteMapBegin(mh); err != nil {
		return err
	}

	for k, v := range val {
		if v == nil {
			return fmt.Errorf("invalid map 'map[string]*shared.WorkflowQuery', key [%v]: value is nil", k)
		}
		if err := sw.WriteString(k); err != nil {
			return err
		}
		if err := v.Encode(sw); err != nil {
			return err
		}
	}

	return sw.WriteMapEnd()
}

// Encode serializes a PollForDecisionTaskResponse struct directly into bytes, without going
// through an intermediary type.
//
// An error is returned if a PollForDecisionTaskResponse struct could not be encoded.
func (v *PollForDecisionTaskResponse) Encode(sw stream.Writer) error {
	if err := sw.WriteStructBegin(); err != nil {
		return err
	}

	if v.TaskToken != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 10, Type: wire.TBinary}); err != nil {
			return err
		}
		if err := sw.WriteBinary(v.TaskToken); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.WorkflowExecution != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 20, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.WorkflowExecution.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.WorkflowType != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 30, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.WorkflowType.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.PreviousStartedEventId != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 40, Type: wire.TI64}); err != nil {
			return err
		}
		if err := sw.WriteInt64(*(v.PreviousStartedEventId)); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.StartedEventId != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 50, Type: wire.TI64}); err != nil {
			return err
		}
		if err := sw.WriteInt64(*(v.StartedEventId)); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.Attempt != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 51, Type: wire.TI64}); err != nil {
			return err
		}
		if err := sw.WriteInt64(*(v.Attempt)); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.NextEventId != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 60, Type: wire.TI64}); err != nil {
			return err
		}
		if err := sw.WriteInt64(*(v.NextEventId)); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.BacklogCountHint != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 65, Type: wire.TI64}); err != nil {
			return err
		}
		if err := sw.WriteInt64(*(v.BacklogCountHint)); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.StickyExecutionEnabled != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 70, Type: wire.TBool}); err != nil {
			return err
		}
		if err := sw.WriteBool(*(v.StickyExecutionEnabled)); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.Query != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 80, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.Query.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.DecisionInfo != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 90, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.DecisionInfo.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.WorkflowExecutionTaskList != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 100, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.WorkflowExecutionTaskList.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.EventStoreVersion != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 110, Type: wire.TI32}); err != nil {
			return err
		}
		if err := sw.WriteInt32(*(v.EventStoreVersion)); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.BranchToken != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 120, Type: wire.TBinary}); err != nil {
			return err
		}
		if err := sw.WriteBinary(v.BranchToken); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.ScheduledTimestamp != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 130, Type: wire.TI64}); err != nil {
			return err
		}
		if err := sw.WriteInt64(*(v.ScheduledTimestamp)); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.StartedTimestamp != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 140, Type: wire.TI64}); err != nil {
			return err
		}
		if err := sw.WriteInt64(*(v.StartedTimestamp)); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.Queries != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 150, Type: wire.TMap}); err != nil {
			return err
		}
		if err := _Map_String_WorkflowQuery_Encode(v.Queries, sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.TotalHistoryBytes != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 160, Type: wire.TI64}); err != nil {
			return err
		}
		if err := sw.WriteInt64(*(v.TotalHistoryBytes)); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.AutoConfigHint != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 170, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.AutoConfigHint.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	return sw.WriteStructEnd()
}

func _WorkflowQuery_Decode(sr stream.Reader) (*shared.WorkflowQuery, error) {
	var v shared.WorkflowQuery
	err := v.Decode(sr)
	return &v, err
}

func _TransientDecisionInfo_Decode(sr stream.Reader) (*shared.TransientDecisionInfo, error) {
	var v shared.TransientDecisionInfo
	err := v.Decode(sr)
	return &v, err
}

func _Map_String_WorkflowQuery_Decode(sr stream.Reader) (map[string]*shared.WorkflowQuery, error) {
	mh, err := sr.ReadMapBegin()
	if err != nil {
		return nil, err
	}

	if mh.KeyType != wire.TBinary || mh.ValueType != wire.TStruct {
		for i := 0; i < mh.Length; i++ {
			if err := sr.Skip(mh.KeyType); err != nil {
				return nil, err
			}

			if err := sr.Skip(mh.ValueType); err != nil {
				return nil, err
			}
		}
		return nil, sr.ReadMapEnd()
	}

	o := make(map[string]*shared.WorkflowQuery, mh.Length)
	for i := 0; i < mh.Length; i++ {
		k, err := sr.ReadString()
		if err != nil {
			return nil, err
		}

		v, err := _WorkflowQuery_Decode(sr)
		if err != nil {
			return nil, err
		}

		o[k] = v
	}

	if err = sr.ReadMapEnd(); err != nil {
		return nil, err
	}
	return o, err
}

func _AutoConfigHint_Decode(sr stream.Reader) (*shared.AutoConfigHint, error) {
	var v shared.AutoConfigHint
	err := v.Decode(sr)
	return &v, err
}

// Decode deserializes a PollForDecisionTaskResponse struct directly from its Thrift-level
// representation, without going through an intemediary type.
//
// An error is returned if a PollForDecisionTaskResponse struct could not be generated from the wire
// representation.
func (v *PollForDecisionTaskResponse) Decode(sr stream.Reader) error {

	if err := sr.ReadStructBegin(); err != nil {
		return err
	}

	fh, ok, err := sr.ReadFieldBegin()
	if err != nil {
		return err
	}

	for ok {
		switch {
		case fh.ID == 10 && fh.Type == wire.TBinary:
			v.TaskToken, err = sr.ReadBinary()
			if err != nil {
				return err
			}

		case fh.ID == 20 && fh.Type == wire.TStruct:
			v.WorkflowExecution, err = _WorkflowExecution_Decode(sr)
			if err != nil {
				return err
			}

		case fh.ID == 30 && fh.Type == wire.TStruct:
			v.WorkflowType, err = _WorkflowType_Decode(sr)
			if err != nil {
				return err
			}

		case fh.ID == 40 && fh.Type == wire.TI64:
			var x int64
			x, err = sr.ReadInt64()
			v.PreviousStartedEventId = &x
			if err != nil {
				return err
			}

		case fh.ID == 50 && fh.Type == wire.TI64:
			var x int64
			x, err = sr.ReadInt64()
			v.StartedEventId = &x
			if err != nil {
				return err
			}

		case fh.ID == 51 && fh.Type == wire.TI64:
			var x int64
			x, err = sr.ReadInt64()
			v.Attempt = &x
			if err != nil {
				return err
			}

		case fh.ID == 60 && fh.Type == wire.TI64:
			var x int64
			x, err = sr.ReadInt64()
			v.NextEventId = &x
			if err != nil {
				return err
			}

		case fh.ID == 65 && fh.Type == wire.TI64:
			var x int64
			x, err = sr.ReadInt64()
			v.BacklogCountHint = &x
			if err != nil {
				return err
			}

		case fh.ID == 70 && fh.Type == wire.TBool:
			var x bool
			x, err = sr.ReadBool()
			v.StickyExecutionEnabled = &x
			if err != nil {
				return err
			}

		case fh.ID == 80 && fh.Type == wire.TStruct:
			v.Query, err = _WorkflowQuery_Decode(sr)
			if err != nil {
				return err
			}

		case fh.ID == 90 && fh.Type == wire.TStruct:
			v.DecisionInfo, err = _TransientDecisionInfo_Decode(sr)
			if err != nil {
				return err
			}

		case fh.ID == 100 && fh.Type == wire.TStruct:
			v.WorkflowExecutionTaskList, err = _TaskList_Decode(sr)
			if err != nil {
				return err
			}

		case fh.ID == 110 && fh.Type == wire.TI32:
			var x int32
			x, err = sr.ReadInt32()
			v.EventStoreVersion = &x
			if err != nil {
				return err
			}

		case fh.ID == 120 && fh.Type == wire.TBinary:
			v.BranchToken, err = sr.ReadBinary()
			if err != nil {
				return err
			}

		case fh.ID == 130 && fh.Type == wire.TI64:
			var x int64
			x, err = sr.ReadInt64()
			v.ScheduledTimestamp = &x
			if err != nil {
				return err
			}

		case fh.ID == 140 && fh.Type == wire.TI64:
			var x int64
			x, err = sr.ReadInt64()
			v.StartedTimestamp = &x
			if err != nil {
				return err
			}

		case fh.ID == 150 && fh.Type == wire.TMap:
			v.Queries, err = _Map_String_WorkflowQuery_Decode(sr)
			if err != nil {
				return err
			}

		case fh.ID == 160 && fh.Type == wire.TI64:
			var x int64
			x, err = sr.ReadInt64()
			v.TotalHistoryBytes = &x
			if err != nil {
				return err
			}

		case fh.ID == 170 && fh.Type == wire.TStruct:
			v.AutoConfigHint, err = _AutoConfigHint_Decode(sr)
			if err != nil {
				return err
			}

		default:
			if err := sr.Skip(fh.Type); err != nil {
				return err
			}
		}

		if err := sr.ReadFieldEnd(); err != nil {
			return err
		}

		if fh, ok, err = sr.ReadFieldBegin(); err != nil {
			return err
		}
	}

	if err := sr.ReadStructEnd(); err != nil {
		return err
	}

	return nil
}

// String returns a readable string representation of a PollForDecisionTaskResponse
// struct.
func (v *PollForDecisionTaskResponse) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [19]string
	i := 0
	if v.TaskToken != nil {
		fields[i] = fmt.Sprintf("TaskToken: %v", v.TaskToken)
		i++
	}
	if v.WorkflowExecution != nil {
		fields[i] = fmt.Sprintf("WorkflowExecution: %v", v.WorkflowExecution)
		i++
	}
	if v.WorkflowType != nil {
		fields[i] = fmt.Sprintf("WorkflowType: %v", v.WorkflowType)
		i++
	}
	if v.PreviousStartedEventId != nil {
		fields[i] = fmt.Sprintf("PreviousStartedEventId: %v", *(v.PreviousStartedEventId))
		i++
	}
	if v.StartedEventId != nil {
		fields[i] = fmt.Sprintf("StartedEventId: %v", *(v.StartedEventId))
		i++
	}
	if v.Attempt != nil {
		fields[i] = fmt.Sprintf("Attempt: %v", *(v.Attempt))
		i++
	}
	if v.NextEventId != nil {
		fields[i] = fmt.Sprintf("NextEventId: %v", *(v.NextEventId))
		i++
	}
	if v.BacklogCountHint != nil {
		fields[i] = fmt.Sprintf("BacklogCountHint: %v", *(v.BacklogCountHint))
		i++
	}
	if v.StickyExecutionEnabled != nil {
		fields[i] = fmt.Sprintf("StickyExecutionEnabled: %v", *(v.StickyExecutionEnabled))
		i++
	}
	if v.Query != nil {
		fields[i] = fmt.Sprintf("Query: %v", v.Query)
		i++
	}
	if v.DecisionInfo != nil {
		fields[i] = fmt.Sprintf("DecisionInfo: %v", v.DecisionInfo)
		i++
	}
	if v.WorkflowExecutionTaskList != nil {
		fields[i] = fmt.Sprintf("WorkflowExecutionTaskList: %v", v.WorkflowExecutionTaskList)
		i++
	}
	if v.EventStoreVersion != nil {
		fields[i] = fmt.Sprintf("EventStoreVersion: %v", *(v.EventStoreVersion))
		i++
	}
	if v.BranchToken != nil {
		fields[i] = fmt.Sprintf("BranchToken: %v", v.BranchToken)
		i++
	}
	if v.ScheduledTimestamp != nil {
		fields[i] = fmt.Sprintf("ScheduledTimestamp: %v", *(v.ScheduledTimestamp))
		i++
	}
	if v.StartedTimestamp != nil {
		fields[i] = fmt.Sprintf("StartedTimestamp: %v", *(v.StartedTimestamp))
		i++
	}
	if v.Queries != nil {
		fields[i] = fmt.Sprintf("Queries: %v", v.Queries)
		i++
	}
	if v.TotalHistoryBytes != nil {
		fields[i] = fmt.Sprintf("TotalHistoryBytes: %v", *(v.TotalHistoryBytes))
		i++
	}
	if v.AutoConfigHint != nil {
		fields[i] = fmt.Sprintf("AutoConfigHint: %v", v.AutoConfigHint)
		i++
	}

	return fmt.Sprintf("PollForDecisionTaskResponse{%v}", strings.Join(fields[:i], ", "))
}

func _Bool_EqualsPtr(lhs, rhs *bool) bool {
	if lhs != nil && rhs != nil {

		x := *lhs
		y := *rhs
		return (x == y)
	}
	return lhs == nil && rhs == nil
}

func _Map_String_WorkflowQuery_Equals(lhs, rhs map[string]*shared.WorkflowQuery) bool {
	if len(lhs) != len(rhs) {
		return false
	}

	for lk, lv := range lhs {
		rv, ok := rhs[lk]
		if !ok {
			return false
		}
		if !lv.Equals(rv) {
			return false
		}
	}
	return true
}

// Equals returns true if all the fields of this PollForDecisionTaskResponse match the
// provided PollForDecisionTaskResponse.
//
// This function performs a deep comparison.
func (v *PollForDecisionTaskResponse) Equals(rhs *PollForDecisionTaskResponse) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !((v.TaskToken == nil && rhs.TaskToken == nil) || (v.TaskToken != nil && rhs.TaskToken != nil && bytes.Equal(v.TaskToken, rhs.TaskToken))) {
		return false
	}
	if !((v.WorkflowExecution == nil && rhs.WorkflowExecution == nil) || (v.WorkflowExecution != nil && rhs.WorkflowExecution != nil && v.WorkflowExecution.Equals(rhs.WorkflowExecution))) {
		return false
	}
	if !((v.WorkflowType == nil && rhs.WorkflowType == nil) || (v.WorkflowType != nil && rhs.WorkflowType != nil && v.WorkflowType.Equals(rhs.WorkflowType))) {
		return false
	}
	if !_I64_EqualsPtr(v.PreviousStartedEventId, rhs.PreviousStartedEventId) {
		return false
	}
	if !_I64_EqualsPtr(v.StartedEventId, rhs.StartedEventId) {
		return false
	}
	if !_I64_EqualsPtr(v.Attempt, rhs.Attempt) {
		return false
	}
	if !_I64_EqualsPtr(v.NextEventId, rhs.NextEventId) {
		return false
	}
	if !_I64_EqualsPtr(v.BacklogCountHint, rhs.BacklogCountHint) {
		return false
	}
	if !_Bool_EqualsPtr(v.StickyExecutionEnabled, rhs.StickyExecutionEnabled) {
		return false
	}
	if !((v.Query == nil && rhs.Query == nil) || (v.Query != nil && rhs.Query != nil && v.Query.Equals(rhs.Query))) {
		return false
	}
	if !((v.DecisionInfo == nil && rhs.DecisionInfo == nil) || (v.DecisionInfo != nil && rhs.DecisionInfo != nil && v.DecisionInfo.Equals(rhs.DecisionInfo))) {
		return false
	}
	if !((v.WorkflowExecutionTaskList == nil && rhs.WorkflowExecutionTaskList == nil) || (v.WorkflowExecutionTaskList != nil && rhs.WorkflowExecutionTaskList != nil && v.WorkflowExecutionTaskList.Equals(rhs.WorkflowExecutionTaskList))) {
		return false
	}
	if !_I32_EqualsPtr(v.EventStoreVersion, rhs.EventStoreVersion) {
		return false
	}
	if !((v.BranchToken == nil && rhs.BranchToken == nil) || (v.BranchToken != nil && rhs.BranchToken != nil && bytes.Equal(v.BranchToken, rhs.BranchToken))) {
		return false
	}
	if !_I64_EqualsPtr(v.ScheduledTimestamp, rhs.ScheduledTimestamp) {
		return false
	}
	if !_I64_EqualsPtr(v.StartedTimestamp, rhs.StartedTimestamp) {
		return false
	}
	if !((v.Queries == nil && rhs.Queries == nil) || (v.Queries != nil && rhs.Queries != nil && _Map_String_WorkflowQuery_Equals(v.Queries, rhs.Queries))) {
		return false
	}
	if !_I64_EqualsPtr(v.TotalHistoryBytes, rhs.TotalHistoryBytes) {
		return false
	}
	if !((v.AutoConfigHint == nil && rhs.AutoConfigHint == nil) || (v.AutoConfigHint != nil && rhs.AutoConfigHint != nil && v.AutoConfigHint.Equals(rhs.AutoConfigHint))) {
		return false
	}

	return true
}

type _Map_String_WorkflowQuery_Zapper map[string]*shared.WorkflowQuery

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of _Map_String_WorkflowQuery_Zapper.
func (m _Map_String_WorkflowQuery_Zapper) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	for k, v := range m {
		err = multierr.Append(err, enc.AddObject((string)(k), v))
	}
	return err
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of PollForDecisionTaskResponse.
func (v *PollForDecisionTaskResponse) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.TaskToken != nil {
		enc.AddString("taskToken", base64.StdEncoding.EncodeToString(v.TaskToken))
	}
	if v.WorkflowExecution != nil {
		err = multierr.Append(err, enc.AddObject("workflowExecution", v.WorkflowExecution))
	}
	if v.WorkflowType != nil {
		err = multierr.Append(err, enc.AddObject("workflowType", v.WorkflowType))
	}
	if v.PreviousStartedEventId != nil {
		enc.AddInt64("previousStartedEventId", *v.PreviousStartedEventId)
	}
	if v.StartedEventId != nil {
		enc.AddInt64("startedEventId", *v.StartedEventId)
	}
	if v.Attempt != nil {
		enc.AddInt64("attempt", *v.Attempt)
	}
	if v.NextEventId != nil {
		enc.AddInt64("nextEventId", *v.NextEventId)
	}
	if v.BacklogCountHint != nil {
		enc.AddInt64("backlogCountHint", *v.BacklogCountHint)
	}
	if v.StickyExecutionEnabled != nil {
		enc.AddBool("stickyExecutionEnabled", *v.StickyExecutionEnabled)
	}
	if v.Query != nil {
		err = multierr.Append(err, enc.AddObject("query", v.Query))
	}
	if v.DecisionInfo != nil {
		err = multierr.Append(err, enc.AddObject("decisionInfo", v.DecisionInfo))
	}
	if v.WorkflowExecutionTaskList != nil {
		err = multierr.Append(err, enc.AddObject("WorkflowExecutionTaskList", v.WorkflowExecutionTaskList))
	}
	if v.EventStoreVersion != nil {
		enc.AddInt32("eventStoreVersion", *v.EventStoreVersion)
	}
	if v.BranchToken != nil {
		enc.AddString("branchToken", base64.StdEncoding.EncodeToString(v.BranchToken))
	}
	if v.ScheduledTimestamp != nil {
		enc.AddInt64("scheduledTimestamp", *v.ScheduledTimestamp)
	}
	if v.StartedTimestamp != nil {
		enc.AddInt64("startedTimestamp", *v.StartedTimestamp)
	}
	if v.Queries != nil {
		err = multierr.Append(err, enc.AddObject("queries", (_Map_String_WorkflowQuery_Zapper)(v.Queries)))
	}
	if v.TotalHistoryBytes != nil {
		enc.AddInt64("totalHistoryBytes", *v.TotalHistoryBytes)
	}
	if v.AutoConfigHint != nil {
		err = multierr.Append(err, enc.AddObject("autoConfigHint", v.AutoConfigHint))
	}
	return err
}

// GetTaskToken returns the value of TaskToken if it is set or its
// zero value if it is unset.
func (v *PollForDecisionTaskResponse) GetTaskToken() (o []byte) {
	if v != nil && v.TaskToken != nil {
		return v.TaskToken
	}

	return
}

// IsSetTaskToken returns true if TaskToken is not nil.
func (v *PollForDecisionTaskResponse) IsSetTaskToken() bool {
	return v != nil && v.TaskToken != nil
}

// GetWorkflowExecution returns the value of WorkflowExecution if it is set or its
// zero value if it is unset.
func (v *PollForDecisionTaskResponse) GetWorkflowExecution() (o *shared.WorkflowExecution) {
	if v != nil && v.WorkflowExecution != nil {
		return v.WorkflowExecution
	}

	return
}

// IsSetWorkflowExecution returns true if WorkflowExecution is not nil.
func (v *PollForDecisionTaskResponse) IsSetWorkflowExecution() bool {
	return v != nil && v.WorkflowExecution != nil
}

// GetWorkflowType returns the value of WorkflowType if it is set or its
// zero value if it is unset.
func (v *PollForDecisionTaskResponse) GetWorkflowType() (o *shared.WorkflowType) {
	if v != nil && v.WorkflowType != nil {
		return v.WorkflowType
	}

	return
}

// IsSetWorkflowType returns true if WorkflowType is not nil.
func (v *PollForDecisionTaskResponse) IsSetWorkflowType() bool {
	return v != nil && v.WorkflowType != nil
}

// GetPreviousStartedEventId returns the value of PreviousStartedEventId if it is set or its
// zero value if it is unset.
func (v *PollForDecisionTaskResponse) GetPreviousStartedEventId() (o int64) {
	if v != nil && v.PreviousStartedEventId != nil {
		return *v.PreviousStartedEventId
	}

	return
}

// IsSetPreviousStartedEventId returns true if PreviousStartedEventId is not nil.
func (v *PollForDecisionTaskResponse) IsSetPreviousStartedEventId() bool {
	return v != nil && v.PreviousStartedEventId != nil
}

// GetStartedEventId returns the value of StartedEventId if it is set or its
// zero value if it is unset.
func (v *PollForDecisionTaskResponse) GetStartedEventId() (o int64) {
	if v != nil && v.StartedEventId != nil {
		return *v.StartedEventId
	}

	return
}

// IsSetStartedEventId returns true if StartedEventId is not nil.
func (v *PollForDecisionTaskResponse) IsSetStartedEventId() bool {
	return v != nil && v.StartedEventId != nil
}

// GetAttempt returns the value of Attempt if it is set or its
// zero value if it is unset.
func (v *PollForDecisionTaskResponse) GetAttempt() (o int64) {
	if v != nil && v.Attempt != nil {
		return *v.Attempt
	}

	return
}

// IsSetAttempt returns true if Attempt is not nil.
func (v *PollForDecisionTaskResponse) IsSetAttempt() bool {
	return v != nil && v.Attempt != nil
}

// GetNextEventId returns the value of NextEventId if it is set or its
// zero value if it is unset.
func (v *PollForDecisionTaskResponse) GetNextEventId() (o int64) {
	if v != nil && v.NextEventId != nil {
		return *v.NextEventId
	}

	return
}

// IsSetNextEventId returns true if NextEventId is not nil.
func (v *PollForDecisionTaskResponse) IsSetNextEventId() bool {
	return v != nil && v.NextEventId != nil
}

// GetBacklogCountHint returns the value of BacklogCountHint if it is set or its
// zero value if it is unset.
func (v *PollForDecisionTaskResponse) GetBacklogCountHint() (o int64) {
	if v != nil && v.BacklogCountHint != nil {
		return *v.BacklogCountHint
	}

	return
}

// IsSetBacklogCountHint returns true if BacklogCountHint is not nil.
func (v *PollForDecisionTaskResponse) IsSetBacklogCountHint() bool {
	return v != nil && v.BacklogCountHint != nil
}

// GetStickyExecutionEnabled returns the value of StickyExecutionEnabled if it is set or its
// zero value if it is unset.
func (v *PollForDecisionTaskResponse) GetStickyExecutionEnabled() (o bool) {
	if v != nil && v.StickyExecutionEnabled != nil {
		return *v.StickyExecutionEnabled
	}

	return
}

// IsSetStickyExecutionEnabled returns true if StickyExecutionEnabled is not nil.
func (v *PollForDecisionTaskResponse) IsSetStickyExecutionEnabled() bool {
	return v != nil && v.StickyExecutionEnabled != nil
}

// GetQuery returns the value of Query if it is set or its
// zero value if it is unset.
func (v *PollForDecisionTaskResponse) GetQuery() (o *shared.WorkflowQuery) {
	if v != nil && v.Query != nil {
		return v.Query
	}

	return
}

// IsSetQuery returns true if Query is not nil.
func (v *PollForDecisionTaskResponse) IsSetQuery() bool {
	return v != nil && v.Query != nil
}

// GetDecisionInfo returns the value of DecisionInfo if it is set or its
// zero value if it is unset.
func (v *PollForDecisionTaskResponse) GetDecisionInfo() (o *shared.TransientDecisionInfo) {
	if v != nil && v.DecisionInfo != nil {
		return v.DecisionInfo
	}

	return
}

// IsSetDecisionInfo returns true if DecisionInfo is not nil.
func (v *PollForDecisionTaskResponse) IsSetDecisionInfo() bool {
	return v != nil && v.DecisionInfo != nil
}

// GetWorkflowExecutionTaskList returns the value of WorkflowExecutionTaskList if it is set or its
// zero value if it is unset.
func (v *PollForDecisionTaskResponse) GetWorkflowExecutionTaskList() (o *shared.TaskList) {
	if v != nil && v.WorkflowExecutionTaskList != nil {
		return v.WorkflowExecutionTaskList
	}

	return
}

// IsSetWorkflowExecutionTaskList returns true if WorkflowExecutionTaskList is not nil.
func (v *PollForDecisionTaskResponse) IsSetWorkflowExecutionTaskList() bool {
	return v != nil && v.WorkflowExecutionTaskList != nil
}

// GetEventStoreVersion returns the value of EventStoreVersion if it is set or its
// zero value if it is unset.
func (v *PollForDecisionTaskResponse) GetEventStoreVersion() (o int32) {
	if v != nil && v.EventStoreVersion != nil {
		return *v.EventStoreVersion
	}

	return
}

// IsSetEventStoreVersion returns true if EventStoreVersion is not nil.
func (v *PollForDecisionTaskResponse) IsSetEventStoreVersion() bool {
	return v != nil && v.EventStoreVersion != nil
}

// GetBranchToken returns the value of BranchToken if it is set or its
// zero value if it is unset.
func (v *PollForDecisionTaskResponse) GetBranchToken() (o []byte) {
	if v != nil && v.BranchToken != nil {
		return v.BranchToken
	}

	return
}

// IsSetBranchToken returns true if BranchToken is not nil.
func (v *PollForDecisionTaskResponse) IsSetBranchToken() bool {
	return v != nil && v.BranchToken != nil
}

// GetScheduledTimestamp returns the value of ScheduledTimestamp if it is set or its
// zero value if it is unset.
func (v *PollForDecisionTaskResponse) GetScheduledTimestamp() (o int64) {
	if v != nil && v.ScheduledTimestamp != nil {
		return *v.ScheduledTimestamp
	}

	return
}

// IsSetScheduledTimestamp returns true if ScheduledTimestamp is not nil.
func (v *PollForDecisionTaskResponse) IsSetScheduledTimestamp() bool {
	return v != nil && v.ScheduledTimestamp != nil
}

// GetStartedTimestamp returns the value of StartedTimestamp if it is set or its
// zero value if it is unset.
func (v *PollForDecisionTaskResponse) GetStartedTimestamp() (o int64) {
	if v != nil && v.StartedTimestamp != nil {
		return *v.StartedTimestamp
	}

	return
}

// IsSetStartedTimestamp returns true if StartedTimestamp is not nil.
func (v *PollForDecisionTaskResponse) IsSetStartedTimestamp() bool {
	return v != nil && v.StartedTimestamp != nil
}

// GetQueries returns the value of Queries if it is set or its
// zero value if it is unset.
func (v *PollForDecisionTaskResponse) GetQueries() (o map[string]*shared.WorkflowQuery) {
	if v != nil && v.Queries != nil {
		return v.Queries
	}

	return
}

// IsSetQueries returns true if Queries is not nil.
func (v *PollForDecisionTaskResponse) IsSetQueries() bool {
	return v != nil && v.Queries != nil
}

// GetTotalHistoryBytes returns the value of TotalHistoryBytes if it is set or its
// zero value if it is unset.
func (v *PollForDecisionTaskResponse) GetTotalHistoryBytes() (o int64) {
	if v != nil && v.TotalHistoryBytes != nil {
		return *v.TotalHistoryBytes
	}

	return
}

// IsSetTotalHistoryBytes returns true if TotalHistoryBytes is not nil.
func (v *PollForDecisionTaskResponse) IsSetTotalHistoryBytes() bool {
	return v != nil && v.TotalHistoryBytes != nil
}

// GetAutoConfigHint returns the value of AutoConfigHint if it is set or its
// zero value if it is unset.
func (v *PollForDecisionTaskResponse) GetAutoConfigHint() (o *shared.AutoConfigHint) {
	if v != nil && v.AutoConfigHint != nil {
		return v.AutoConfigHint
	}

	return
}

// IsSetAutoConfigHint returns true if AutoConfigHint is not nil.
func (v *PollForDecisionTaskResponse) IsSetAutoConfigHint() bool {
	return v != nil && v.AutoConfigHint != nil
}

type QueryWorkflowRequest struct {
	DomainUUID    *string                      `json:"domainUUID,omitempty"`
	TaskList      *shared.TaskList             `json:"taskList,omitempty"`
	QueryRequest  *shared.QueryWorkflowRequest `json:"queryRequest,omitempty"`
	ForwardedFrom *string                      `json:"forwardedFrom,omitempty"`
}

// ToWire translates a QueryWorkflowRequest struct into a Thrift-level intermediate
// representation. This intermediate representation may be serialized
// into bytes using a ThriftRW protocol implementation.
//
// An error is returned if the struct or any of its fields failed to
// validate.
//
//	x, err := v.ToWire()
//	if err != nil {
//	  return err
//	}
//
//	if err := binaryProtocol.Encode(x, writer); err != nil {
//	  return err
//	}
func (v *QueryWorkflowRequest) ToWire() (wire.Value, error) {
	var (
		fields [4]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.DomainUUID != nil {
		w, err = wire.NewValueString(*(v.DomainUUID)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.TaskList != nil {
		w, err = v.TaskList.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.QueryRequest != nil {
		w, err = v.QueryRequest.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.ForwardedFrom != nil {
		w, err = wire.NewValueString(*(v.ForwardedFrom)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 40, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

func _QueryWorkflowRequest_Read(w wire.Value) (*shared.QueryWorkflowRequest, error) {
	var v shared.QueryWorkflowRequest
	err := v.FromWire(w)
	return &v, err
}

// FromWire deserializes a QueryWorkflowRequest struct from its Thrift-level
// representation. The Thrift-level representation may be obtained
// from a ThriftRW protocol implementation.
//
// An error is returned if we were unable to build a QueryWorkflowRequest struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v QueryWorkflowRequest
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *QueryWorkflowRequest) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.DomainUUID = &x
				if err != nil {
					return err
				}

			}
		case 20:
			if field.Value.Type() == wire.TStruct {
				v.TaskList, err = _TaskList_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 30:
			if field.Value.Type() == wire.TStruct {
				v.QueryRequest, err = _QueryWorkflowRequest_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 40:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.ForwardedFrom = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// Encode serializes a QueryWorkflowRequest struct directly into bytes, without going
// through an intermediary type.
//
// An error is returned if a QueryWorkflowRequest struct could not be encoded.
func (v *QueryWorkflowRequest) Encode(sw stream.Writer) error {
	if err := sw.WriteStructBegin(); err != nil {
		return err
	}

	if v.DomainUUID != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 10, Type: wire.TBinary}); err != nil {
			return err
		}
		if err := sw.WriteString(*(v.DomainUUID)); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.TaskList != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 20, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.TaskList.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.QueryRequest != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 30, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.QueryRequest.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.ForwardedFrom != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 40, Type: wire.TBinary}); err != nil {
			return err
		}
		if err := sw.WriteString(*(v.ForwardedFrom)); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	return sw.WriteStructEnd()
}

func _QueryWorkflowRequest_Decode(sr stream.Reader) (*shared.QueryWorkflowRequest, error) {
	var v shared.QueryWorkflowRequest
	err := v.Decode(sr)
	return &v, err
}

// Decode deserializes a QueryWorkflowRequest struct directly from its Thrift-level
// representation, without going through an intemediary type.
//
// An error is returned if a QueryWorkflowRequest struct could not be generated from the wire
// representation.
func (v *QueryWorkflowRequest) Decode(sr stream.Reader) error {

	if err := sr.ReadStructBegin(); err != nil {
		return err
	}

	fh, ok, err := sr.ReadFieldBegin()
	if err != nil {
		return err
	}

	for ok {
		switch {
		case fh.ID == 10 && fh.Type == wire.TBinary:
			var x string
			x, err = sr.ReadString()
			v.DomainUUID = &x
			if err != nil {
				return err
			}

		case fh.ID == 20 && fh.Type == wire.TStruct:
			v.TaskList, err = _TaskList_Decode(sr)
			if err != nil {
				return err
			}

		case fh.ID == 30 && fh.Type == wire.TStruct:
			v.QueryRequest, err = _QueryWorkflowRequest_Decode(sr)
			if err != nil {
				return err
			}

		case fh.ID == 40 && fh.Type == wire.TBinary:
			var x string
			x, err = sr.ReadString()
			v.ForwardedFrom = &x
			if err != nil {
				return err
			}

		default:
			if err := sr.Skip(fh.Type); err != nil {
				return err
			}
		}

		if err := sr.ReadFieldEnd(); err != nil {
			return err
		}

		if fh, ok, err = sr.ReadFieldBegin(); err != nil {
			return err
		}
	}

	if err := sr.ReadStructEnd(); err != nil {
		return err
	}

	return nil
}

// String returns a readable string representation of a QueryWorkflowRequest
// struct.
func (v *QueryWorkflowRequest) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [4]string
	i := 0
	if v.DomainUUID != nil {
		fields[i] = fmt.Sprintf("DomainUUID: %v", *(v.DomainUUID))
		i++
	}
	if v.TaskList != nil {
		fields[i] = fmt.Sprintf("TaskList: %v", v.TaskList)
		i++
	}
	if v.QueryRequest != nil {
		fields[i] = fmt.Sprintf("QueryRequest: %v", v.QueryRequest)
		i++
	}
	if v.ForwardedFrom != nil {
		fields[i] = fmt.Sprintf("ForwardedFrom: %v", *(v.ForwardedFrom))
		i++
	}

	return fmt.Sprintf("QueryWorkflowRequest{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this QueryWorkflowRequest match the
// provided QueryWorkflowRequest.
//
// This function performs a deep comparison.
func (v *QueryWorkflowRequest) Equals(rhs *QueryWorkflowRequest) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.DomainUUID, rhs.DomainUUID) {
		return false
	}
	if !((v.TaskList == nil && rhs.TaskList == nil) || (v.TaskList != nil && rhs.TaskList != nil && v.TaskList.Equals(rhs.TaskList))) {
		return false
	}
	if !((v.QueryRequest == nil && rhs.QueryRequest == nil) || (v.QueryRequest != nil && rhs.QueryRequest != nil && v.QueryRequest.Equals(rhs.QueryRequest))) {
		return false
	}
	if !_String_EqualsPtr(v.ForwardedFrom, rhs.ForwardedFrom) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of QueryWorkflowRequest.
func (v *QueryWorkflowRequest) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.DomainUUID != nil {
		enc.AddString("domainUUID", *v.DomainUUID)
	}
	if v.TaskList != nil {
		err = multierr.Append(err, enc.AddObject("taskList", v.TaskList))
	}
	if v.QueryRequest != nil {
		err = multierr.Append(err, enc.AddObject("queryRequest", v.QueryRequest))
	}
	if v.ForwardedFrom != nil {
		enc.AddString("forwardedFrom", *v.ForwardedFrom)
	}
	return err
}

// GetDomainUUID returns the value of DomainUUID if it is set or its
// zero value if it is unset.
func (v *QueryWorkflowRequest) GetDomainUUID() (o string) {
	if v != nil && v.DomainUUID != nil {
		return *v.DomainUUID
	}

	return
}

// IsSetDomainUUID returns true if DomainUUID is not nil.
func (v *QueryWorkflowRequest) IsSetDomainUUID() bool {
	return v != nil && v.DomainUUID != nil
}

// GetTaskList returns the value of TaskList if it is set or its
// zero value if it is unset.
func (v *QueryWorkflowRequest) GetTaskList() (o *shared.TaskList) {
	if v != nil && v.TaskList != nil {
		return v.TaskList
	}

	return
}

// IsSetTaskList returns true if TaskList is not nil.
func (v *QueryWorkflowRequest) IsSetTaskList() bool {
	return v != nil && v.TaskList != nil
}

// GetQueryRequest returns the value of QueryRequest if it is set or its
// zero value if it is unset.
func (v *QueryWorkflowRequest) GetQueryRequest() (o *shared.QueryWorkflowRequest) {
	if v != nil && v.QueryRequest != nil {
		return v.QueryRequest
	}

	return
}

// IsSetQueryRequest returns true if QueryRequest is not nil.
func (v *QueryWorkflowRequest) IsSetQueryRequest() bool {
	return v != nil && v.QueryRequest != nil
}

// GetForwardedFrom returns the value of ForwardedFrom if it is set or its
// zero value if it is unset.
func (v *QueryWorkflowRequest) GetForwardedFrom() (o string) {
	if v != nil && v.ForwardedFrom != nil {
		return *v.ForwardedFrom
	}

	return
}

// IsSetForwardedFrom returns true if ForwardedFrom is not nil.
func (v *QueryWorkflowRequest) IsSetForwardedFrom() bool {
	return v != nil && v.ForwardedFrom != nil
}

type RespondQueryTaskCompletedRequest struct {
	DomainUUID       *string                                  `json:"domainUUID,omitempty"`
	TaskList         *shared.TaskList                         `json:"taskList,omitempty"`
	TaskID           *string                                  `json:"taskID,omitempty"`
	CompletedRequest *shared.RespondQueryTaskCompletedRequest `json:"completedRequest,omitempty"`
}

// ToWire translates a RespondQueryTaskCompletedRequest struct into a Thrift-level intermediate
// representation. This intermediate representation may be serialized
// into bytes using a ThriftRW protocol implementation.
//
// An error is returned if the struct or any of its fields failed to
// validate.
//
//	x, err := v.ToWire()
//	if err != nil {
//	  return err
//	}
//
//	if err := binaryProtocol.Encode(x, writer); err != nil {
//	  return err
//	}
func (v *RespondQueryTaskCompletedRequest) ToWire() (wire.Value, error) {
	var (
		fields [4]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.DomainUUID != nil {
		w, err = wire.NewValueString(*(v.DomainUUID)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.TaskList != nil {
		w, err = v.TaskList.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.TaskID != nil {
		w, err = wire.NewValueString(*(v.TaskID)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.CompletedRequest != nil {
		w, err = v.CompletedRequest.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 40, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

func _RespondQueryTaskCompletedRequest_Read(w wire.Value) (*shared.RespondQueryTaskCompletedRequest, error) {
	var v shared.RespondQueryTaskCompletedRequest
	err := v.FromWire(w)
	return &v, err
}

// FromWire deserializes a RespondQueryTaskCompletedRequest struct from its Thrift-level
// representation. The Thrift-level representation may be obtained
// from a ThriftRW protocol implementation.
//
// An error is returned if we were unable to build a RespondQueryTaskCompletedRequest struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v RespondQueryTaskCompletedRequest
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *RespondQueryTaskCompletedRequest) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.DomainUUID = &x
				if err != nil {
					return err
				}

			}
		case 20:
			if field.Value.Type() == wire.TStruct {
				v.TaskList, err = _TaskList_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 30:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.TaskID = &x
				if err != nil {
					return err
				}

			}
		case 40:
			if field.Value.Type() == wire.TStruct {
				v.CompletedRequest, err = _RespondQueryTaskCompletedRequest_Read(field.Value)
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// Encode serializes a RespondQueryTaskCompletedRequest struct directly into bytes, without going
// through an intermediary type.
//
// An error is returned if a RespondQueryTaskCompletedRequest struct could not be encoded.
func (v *RespondQueryTaskCompletedRequest) Encode(sw stream.Writer) error {
	if err := sw.WriteStructBegin(); err != nil {
		return err
	}

	if v.DomainUUID != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 10, Type: wire.TBinary}); err != nil {
			return err
		}
		if err := sw.WriteString(*(v.DomainUUID)); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.TaskList != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 20, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.TaskList.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.TaskID != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 30, Type: wire.TBinary}); err != nil {
			return err
		}
		if err := sw.WriteString(*(v.TaskID)); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.CompletedRequest != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 40, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.CompletedRequest.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	return sw.WriteStructEnd()
}

func _RespondQueryTaskCompletedRequest_Decode(sr stream.Reader) (*shared.RespondQueryTaskCompletedRequest, error) {
	var v shared.RespondQueryTaskCompletedRequest
	err := v.Decode(sr)
	return &v, err
}

// Decode deserializes a RespondQueryTaskCompletedRequest struct directly from its Thrift-level
// representation, without going through an intemediary type.
//
// An error is returned if a RespondQueryTaskCompletedRequest struct could not be generated from the wire
// representation.
func (v *RespondQueryTaskCompletedRequest) Decode(sr stream.Reader) error {

	if err := sr.ReadStructBegin(); err != nil {
		return err
	}

	fh, ok, err := sr.ReadFieldBegin()
	if err != nil {
		return err
	}

	for ok {
		switch {
		case fh.ID == 10 && fh.Type == wire.TBinary:
			var x string
			x, err = sr.ReadString()
			v.DomainUUID = &x
			if err != nil {
				return err
			}

		case fh.ID == 20 && fh.Type == wire.TStruct:
			v.TaskList, err = _TaskList_Decode(sr)
			if err != nil {
				return err
			}

		case fh.ID == 30 && fh.Type == wire.TBinary:
			var x string
			x, err = sr.ReadString()
			v.TaskID = &x
			if err != nil {
				return err
			}

		case fh.ID == 40 && fh.Type == wire.TStruct:
			v.CompletedRequest, err = _RespondQueryTaskCompletedRequest_Decode(sr)
			if err != nil {
				return err
			}

		default:
			if err := sr.Skip(fh.Type); err != nil {
				return err
			}
		}

		if err := sr.ReadFieldEnd(); err != nil {
			return err
		}

		if fh, ok, err = sr.ReadFieldBegin(); err != nil {
			return err
		}
	}

	if err := sr.ReadStructEnd(); err != nil {
		return err
	}

	return nil
}

// String returns a readable string representation of a RespondQueryTaskCompletedRequest
// struct.
func (v *RespondQueryTaskCompletedRequest) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [4]string
	i := 0
	if v.DomainUUID != nil {
		fields[i] = fmt.Sprintf("DomainUUID: %v", *(v.DomainUUID))
		i++
	}
	if v.TaskList != nil {
		fields[i] = fmt.Sprintf("TaskList: %v", v.TaskList)
		i++
	}
	if v.TaskID != nil {
		fields[i] = fmt.Sprintf("TaskID: %v", *(v.TaskID))
		i++
	}
	if v.CompletedRequest != nil {
		fields[i] = fmt.Sprintf("CompletedRequest: %v", v.CompletedRequest)
		i++
	}

	return fmt.Sprintf("RespondQueryTaskCompletedRequest{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this RespondQueryTaskCompletedRequest match the
// provided RespondQueryTaskCompletedRequest.
//
// This function performs a deep comparison.
func (v *RespondQueryTaskCompletedRequest) Equals(rhs *RespondQueryTaskCompletedRequest) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.DomainUUID, rhs.DomainUUID) {
		return false
	}
	if !((v.TaskList == nil && rhs.TaskList == nil) || (v.TaskList != nil && rhs.TaskList != nil && v.TaskList.Equals(rhs.TaskList))) {
		return false
	}
	if !_String_EqualsPtr(v.TaskID, rhs.TaskID) {
		return false
	}
	if !((v.CompletedRequest == nil && rhs.CompletedRequest == nil) || (v.CompletedRequest != nil && rhs.CompletedRequest != nil && v.CompletedRequest.Equals(rhs.CompletedRequest))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of RespondQueryTaskCompletedRequest.
func (v *RespondQueryTaskCompletedRequest) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.DomainUUID != nil {
		enc.AddString("domainUUID", *v.DomainUUID)
	}
	if v.TaskList != nil {
		err = multierr.Append(err, enc.AddObject("taskList", v.TaskList))
	}
	if v.TaskID != nil {
		enc.AddString("taskID", *v.TaskID)
	}
	if v.CompletedRequest != nil {
		err = multierr.Append(err, enc.AddObject("completedRequest", v.CompletedRequest))
	}
	return err
}

// GetDomainUUID returns the value of DomainUUID if it is set or its
// zero value if it is unset.
func (v *RespondQueryTaskCompletedRequest) GetDomainUUID() (o string) {
	if v != nil && v.DomainUUID != nil {
		return *v.DomainUUID
	}

	return
}

// IsSetDomainUUID returns true if DomainUUID is not nil.
func (v *RespondQueryTaskCompletedRequest) IsSetDomainUUID() bool {
	return v != nil && v.DomainUUID != nil
}

// GetTaskList returns the value of TaskList if it is set or its
// zero value if it is unset.
func (v *RespondQueryTaskCompletedRequest) GetTaskList() (o *shared.TaskList) {
	if v != nil && v.TaskList != nil {
		return v.TaskList
	}

	return
}

// IsSetTaskList returns true if TaskList is not nil.
func (v *RespondQueryTaskCompletedRequest) IsSetTaskList() bool {
	return v != nil && v.TaskList != nil
}

// GetTaskID returns the value of TaskID if it is set or its
// zero value if it is unset.
func (v *RespondQueryTaskCompletedRequest) GetTaskID() (o string) {
	if v != nil && v.TaskID != nil {
		return *v.TaskID
	}

	return
}

// IsSetTaskID returns true if TaskID is not nil.
func (v *RespondQueryTaskCompletedRequest) IsSetTaskID() bool {
	return v != nil && v.TaskID != nil
}

// GetCompletedRequest returns the value of CompletedRequest if it is set or its
// zero value if it is unset.
func (v *RespondQueryTaskCompletedRequest) GetCompletedRequest() (o *shared.RespondQueryTaskCompletedRequest) {
	if v != nil && v.CompletedRequest != nil {
		return v.CompletedRequest
	}

	return
}

// IsSetCompletedRequest returns true if CompletedRequest is not nil.
func (v *RespondQueryTaskCompletedRequest) IsSetCompletedRequest() bool {
	return v != nil && v.CompletedRequest != nil
}

type TaskSource int32

const (
	TaskSourceHistory   TaskSource = 0
	TaskSourceDbBacklog TaskSource = 1
)

// TaskSource_Values returns all recognized values of TaskSource.
func TaskSource_Values() []TaskSource {
	return []TaskSource{
		TaskSourceHistory,
		TaskSourceDbBacklog,
	}
}

// UnmarshalText tries to decode TaskSource from a byte slice
// containing its name.
//
//	var v TaskSource
//	err := v.UnmarshalText([]byte("HISTORY"))
func (v *TaskSource) UnmarshalText(value []byte) error {
	switch s := string(value); s {
	case "HISTORY":
		*v = TaskSourceHistory
		return nil
	case "DB_BACKLOG":
		*v = TaskSourceDbBacklog
		return nil
	default:
		val, err := strconv.ParseInt(s, 10, 32)
		if err != nil {
			return fmt.Errorf("unknown enum value %q for %q: %v", s, "TaskSource", err)
		}
		*v = TaskSource(val)
		return nil
	}
}

// MarshalText encodes TaskSource to text.
//
// If the enum value is recognized, its name is returned.
// Otherwise, its integer value is returned.
//
// This implements the TextMarshaler interface.
func (v TaskSource) MarshalText() ([]byte, error) {
	switch int32(v) {
	case 0:
		return []byte("HISTORY"), nil
	case 1:
		return []byte("DB_BACKLOG"), nil
	}
	return []byte(strconv.FormatInt(int64(v), 10)), nil
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of TaskSource.
// Enums are logged as objects, where the value is logged with key "value", and
// if this value's name is known, the name is logged with key "name".
func (v TaskSource) MarshalLogObject(enc zapcore.ObjectEncoder) error {
	enc.AddInt32("value", int32(v))
	switch int32(v) {
	case 0:
		enc.AddString("name", "HISTORY")
	case 1:
		enc.AddString("name", "DB_BACKLOG")
	}
	return nil
}

// Ptr returns a pointer to this enum value.
func (v TaskSource) Ptr() *TaskSource {
	return &v
}

// Encode encodes TaskSource directly to bytes.
//
//	sWriter := BinaryStreamer.Writer(writer)
//
//	var v TaskSource
//	return v.Encode(sWriter)
func (v TaskSource) Encode(sw stream.Writer) error {
	return sw.WriteInt32(int32(v))
}

// ToWire translates TaskSource into a Thrift-level intermediate
// representation. This intermediate representation may be serialized
// into bytes using a ThriftRW protocol implementation.
//
// Enums are represented as 32-bit integers over the wire.
func (v TaskSource) ToWire() (wire.Value, error) {
	return wire.NewValueI32(int32(v)), nil
}

// FromWire deserializes TaskSource from its Thrift-level
// representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TI32)
//	if err != nil {
//	  return TaskSource(0), err
//	}
//
//	var v TaskSource
//	if err := v.FromWire(x); err != nil {
//	  return TaskSource(0), err
//	}
//	return v, nil
func (v *TaskSource) FromWire(w wire.Value) error {
	*v = (TaskSource)(w.GetI32())
	return nil
}

// Decode reads off the encoded TaskSource directly off of the wire.
//
//	sReader := BinaryStreamer.Reader(reader)
//
//	var v TaskSource
//	if err := v.Decode(sReader); err != nil {
//	  return TaskSource(0), err
//	}
//	return v, nil
func (v *TaskSource) Decode(sr stream.Reader) error {
	i, err := sr.ReadInt32()
	if err != nil {
		return err
	}
	*v = (TaskSource)(i)
	return nil
}

// String returns a readable string representation of TaskSource.
func (v TaskSource) String() string {
	w := int32(v)
	switch w {
	case 0:
		return "HISTORY"
	case 1:
		return "DB_BACKLOG"
	}
	return fmt.Sprintf("TaskSource(%d)", w)
}

// Equals returns true if this TaskSource value matches the provided
// value.
func (v TaskSource) Equals(rhs TaskSource) bool {
	return v == rhs
}

// MarshalJSON serializes TaskSource into JSON.
//
// If the enum value is recognized, its name is returned.
// Otherwise, its integer value is returned.
//
// This implements json.Marshaler.
func (v TaskSource) MarshalJSON() ([]byte, error) {
	switch int32(v) {
	case 0:
		return ([]byte)("\"HISTORY\""), nil
	case 1:
		return ([]byte)("\"DB_BACKLOG\""), nil
	}
	return ([]byte)(strconv.FormatInt(int64(v), 10)), nil
}

// UnmarshalJSON attempts to decode TaskSource from its JSON
// representation.
//
// This implementation supports both, numeric and string inputs. If a
// string is provided, it must be a known enum name.
//
// This implements json.Unmarshaler.
func (v *TaskSource) UnmarshalJSON(text []byte) error {
	d := json.NewDecoder(bytes.NewReader(text))
	d.UseNumber()
	t, err := d.Token()
	if err != nil {
		return err
	}

	switch w := t.(type) {
	case json.Number:
		x, err := w.Int64()
		if err != nil {
			return err
		}
		if x > math.MaxInt32 {
			return fmt.Errorf("enum overflow from JSON %q for %q", text, "TaskSource")
		}
		if x < math.MinInt32 {
			return fmt.Errorf("enum underflow from JSON %q for %q", text, "TaskSource")
		}
		*v = (TaskSource)(x)
		return nil
	case string:
		return v.UnmarshalText([]byte(w))
	default:
		return fmt.Errorf("invalid JSON value %q (%T) to unmarshal into %q", t, t, "TaskSource")
	}
}

// ThriftModule represents the IDL file used to generate this package.
var ThriftModule = &thriftreflect.ThriftModule{
	Name:     "matching",
	Package:  "github.com/uber/cadence/.gen/go/matching",
	FilePath: "matching.thrift",
	SHA1:     "e7db050ae64980b33e3f8ed3f6a3bba3d63174b3",
	Includes: []*thriftreflect.ThriftModule{
		shared.ThriftModule,
	},
	Raw: rawIDL,
}

const rawIDL = "// Copyright (c) 2017 Uber Technologies, Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\ninclude \"shared.thrift\"\n\nnamespace java com.uber.cadence.matching\n\n// TaskSource is the source from which a task was produced\nenum TaskSource {\n    HISTORY,    // Task produced by history service\n    DB_BACKLOG // Task produced from matching db backlog\n}\n\nstruct PollForDecisionTaskRequest {\n  10: optional string domainUUID\n  15: optional string pollerID\n  20: optional shared.PollForDecisionTaskRequest pollRequest\n  30: optional string forwardedFrom\n  40: optional string isolationGroup\n}\n\nstruct PollForDecisionTaskResponse {\n  10: optional binary taskToken\n  20: optional shared.WorkflowExecution workflowExecution\n  30: optional shared.WorkflowType workflowType\n  40: optional i64 (js.type = \"Long\") previousStartedEventId\n  50: optional i64 (js.type = \"Long\") startedEventId\n  51: optional i64 (js.type = \"Long\") attempt\n  60: optional i64 (js.type = \"Long\") nextEventId\n  65: optional i64 (js.type = \"Long\") backlogCountHint\n  70: optional bool stickyExecutionEnabled\n  80: optional shared.WorkflowQuery query\n  90: optional shared.TransientDecisionInfo decisionInfo\n  100: optional shared.TaskList WorkflowExecutionTaskList\n  110: optional i32 eventStoreVersion\n  120: optional binary branchToken\n  130: optional i64 (js.type = \"Long\") scheduledTimestamp\n  140: optional i64 (js.type = \"Long\") startedTimestamp\n  150: optional map<string, shared.WorkflowQuery> queries\n  160: optional i64 (js.type = \"Long\") totalHistoryBytes\n  170: optional shared.AutoConfigHint autoConfigHint\n}\n\nstruct PollForActivityTaskRequest {\n  10: optional string domainUUID\n  15: optional string pollerID\n  20: optional shared.PollForActivityTaskRequest pollRequest\n  30: optional string forwardedFrom\n  40: optional string isolationGroup\n}\n\nstruct AddDecisionTaskRequest {\n  10: optional string domainUUID\n  20: optional shared.WorkflowExecution execution\n  30: optional shared.TaskList taskList\n  40: optional i64 (js.type = \"Long\") scheduleId\n  50: optional i32 scheduleToStartTimeoutSeconds\n  59: optional TaskSource source\n  60: optional string forwardedFrom\n  70: optional map<string, string> partitionConfig\n}\n\nstruct AddActivityTaskRequest {\n  10: optional string domainUUID\n  20: optional shared.WorkflowExecution execution\n  30: optional string sourceDomainUUID\n  40: optional shared.TaskList taskList\n  50: optional i64 (js.type = \"Long\") scheduleId\n  60: optional i32 scheduleToStartTimeoutSeconds\n  69: optional TaskSource source\n  70: optional string forwardedFrom\n  80: optional ActivityTaskDispatchInfo activityTaskDispatchInfo\n  90: optional map<string, string> partitionConfig\n}\n\nstruct ActivityTaskDispatchInfo {\n   10: optional shared.HistoryEvent scheduledEvent\n   20: optional i64 (js.type = \"Long\") startedTimestamp\n   30: optional i64 (js.type = \"Long\") attempt\n   40: optional i64 (js.type = \"Long\") scheduledTimestampOfThisAttempt\n   50: optional i64 (js.type = \"Long\") scheduledTimestamp\n   60: optional binary heartbeatDetails\n   70: optional shared.WorkflowType workflowType\n   80: optional string workflowDomain\n}\n\nstruct QueryWorkflowRequest {\n  10: optional string domainUUID\n  20: optional shared.TaskList taskList\n  30: optional shared.QueryWorkflowRequest queryRequest\n  40: optional string forwardedFrom\n}\n\nstruct RespondQueryTaskCompletedRequest {\n  10: optional string domainUUID\n  20: optional shared.TaskList taskList\n  30: optional string taskID\n  40: optional shared.RespondQueryTaskCompletedRequest completedRequest\n}\n\nstruct CancelOutstandingPollRequest {\n  10: optional string domainUUID\n  20: optional i32 taskListType\n  30: optional shared.TaskList taskList\n  40: optional string pollerID\n}\n\nstruct DescribeTaskListRequest {\n  10: optional string domainUUID\n  20: optional shared.DescribeTaskListRequest descRequest\n}\n\nstruct ListTaskListPartitionsRequest {\n  10: optional string domain\n  20: optional shared.TaskList taskList\n}\n\n/**\n* MatchingService API is exposed to provide support for polling from long running applications.\n* Such applications are expected to have a worker which regularly polls for DecisionTask and ActivityTask.  For each\n* DecisionTask, application is expected to process the history of events for that session and respond back with next\n* decisions.  For each ActivityTask, application is expected to execute the actual logic for that task and respond back\n* with completion or failure.\n**/\nservice MatchingService {\n  /**\n  * PollForDecisionTask is called by frontend to process DecisionTask from a specific taskList.  A\n  * DecisionTask is dispatched to callers for active workflow executions, with pending decisions.\n  **/\n  PollForDecisionTaskResponse PollForDecisionTask(1: PollForDecisionTaskRequest pollRequest)\n    throws (\n      1: shared.BadRequestError badRequestError,\n      2: shared.InternalServiceError internalServiceError,\n      3: shared.LimitExceededError limitExceededError,\n      4: shared.ServiceBusyError serviceBusyError,\n    )\n\n  /**\n  * PollForActivityTask is called by frontend to process ActivityTask from a specific taskList.  ActivityTask\n  * is dispatched to callers whenever a ScheduleTask decision is made for a workflow execution.\n  **/\n  shared.PollForActivityTaskResponse PollForActivityTask(1: PollForActivityTaskRequest pollRequest)\n    throws (\n      1: shared.BadRequestError badRequestError,\n      2: shared.InternalServiceError internalServiceError,\n      3: shared.LimitExceededError limitExceededError,\n      4: shared.ServiceBusyError serviceBusyError,\n    )\n\n  /**\n  * AddDecisionTask is called by the history service when a decision task is scheduled, so that it can be dispatched\n  * by the MatchingEngine.\n  **/\n  void AddDecisionTask(1: AddDecisionTaskRequest addRequest)\n    throws (\n      1: shared.BadRequestError badRequestError,\n      2: shared.InternalServiceError internalServiceError,\n      3: shared.ServiceBusyError serviceBusyError,\n      4: shared.LimitExceededError limitExceededError,\n      5: shared.DomainNotActiveError domainNotActiveError,\n      6: shared.RemoteSyncMatchedError remoteSyncMatchedError,\n      7: shared.StickyWorkerUnavailableError stickyWorkerUnavailableError,\n      8: shared.TaskListNotOwnedByHostError taskListNotOwnedByHostError,\n    )\n\n  /**\n  * AddActivityTask is called by the history service when a decision task is scheduled, so that it can be dispatched\n  * by the MatchingEngine.\n  **/\n  void AddActivityTask(1: AddActivityTaskRequest addRequest)\n    throws (\n      1: shared.BadRequestError badRequestError,\n      2: shared.InternalServiceError internalServiceError,\n      3: shared.ServiceBusyError serviceBusyError,\n      4: shared.LimitExceededError limitExceededError,\n      5: shared.DomainNotActiveError domainNotActiveError,\n      6: shared.RemoteSyncMatchedError remoteSyncMatchedError,\n      7: shared.TaskListNotOwnedByHostError taskListNotOwnedByHostError,\n    )\n\n  /**\n  * QueryWorkflow is called by frontend to query a workflow.\n  **/\n  shared.QueryWorkflowResponse QueryWorkflow(1: QueryWorkflowRequest queryRequest)\n    throws (\n      1: shared.BadRequestError badRequestError,\n      2: shared.InternalServiceError internalServiceError,\n      3: shared.EntityNotExistsError entityNotExistError,\n      4: shared.QueryFailedError queryFailedError,\n      5: shared.LimitExceededError limitExceededError,\n      6: shared.ServiceBusyError serviceBusyError,\n      7: shared.StickyWorkerUnavailableError stickyWorkerUnavailableError,\n      8: shared.TaskListNotOwnedByHostError taskListNotOwnedByHostError,\n    )\n\n  /**\n  * RespondQueryTaskCompleted is called by frontend to respond query completed.\n  **/\n  void RespondQueryTaskCompleted(1: RespondQueryTaskCompletedRequest request)\n    throws (\n      1: shared.BadRequestError badRequestError,\n      2: shared.InternalServiceError internalServiceError,\n      3: shared.EntityNotExistsError entityNotExistError,\n      4: shared.LimitExceededError limitExceededError,\n      5: shared.ServiceBusyError serviceBusyError,\n    )\n\n  /**\n    * CancelOutstandingPoll is called by frontend to unblock long polls on matching for zombie pollers.\n    * Our rpc stack does not support context propagation, so when a client connection goes away frontend sees\n    * cancellation of context for that handler, but any corresponding calls (long-poll) to matching service does not\n    * see the cancellation propagated so it can unblock corresponding long-polls on its end.  This results is tasks\n    * being dispatched to zombie pollers in this situation.  This API is added so everytime frontend makes a long-poll\n    * api call to matching it passes in a pollerID and then calls this API when it detects client connection is closed\n    * to unblock long polls for this poller and prevent tasks being sent to these zombie pollers.\n    **/\n  void CancelOutstandingPoll(1: CancelOutstandingPollRequest request)\n    throws (\n      1: shared.BadRequestError badRequestError,\n      2: shared.InternalServiceError internalServiceError,\n      3: shared.ServiceBusyError serviceBusyError,\n      4: shared.TaskListNotOwnedByHostError taskListNotOwnedByHostError,\n    )\n\n  /**\n  * DescribeTaskList returns information about the target tasklist, right now this API returns the\n  * pollers which polled this tasklist in last few minutes.\n  **/\n  shared.DescribeTaskListResponse DescribeTaskList(1: DescribeTaskListRequest request)\n    throws (\n        1: shared.BadRequestError badRequestError,\n        2: shared.InternalServiceError internalServiceError,\n        3: shared.EntityNotExistsError entityNotExistError,\n        4: shared.ServiceBusyError serviceBusyError,\n        5: shared.TaskListNotOwnedByHostError taskListNotOwnedByHostError,\n      )\n\n  /**\n  * GetTaskListsByDomain returns the list of all the task lists for a domainName.\n  **/\n  shared.GetTaskListsByDomainResponse GetTaskListsByDomain(1: shared.GetTaskListsByDomainRequest request)\n    throws (\n        1: shared.BadRequestError badRequestError,\n        2: shared.InternalServiceError internalServiceError,\n        3: shared.EntityNotExistsError entityNotExistError,\n        4: shared.ServiceBusyError serviceBusyError,\n      )\n\n  /**\n  * ListTaskListPartitions returns a map of partitionKey and hostAddress for a taskList\n  **/\n  shared.ListTaskListPartitionsResponse ListTaskListPartitions(1: ListTaskListPartitionsRequest request)\n    throws (\n        1: shared.BadRequestError badRequestError,\n        2: shared.InternalServiceError internalServiceError,\n        4: shared.ServiceBusyError serviceBusyError,\n    )\n}\n"

// MatchingService_AddActivityTask_Args represents the arguments for the MatchingService.AddActivityTask function.
//
// The arguments for AddActivityTask are sent and received over the wire as this struct.
type MatchingService_AddActivityTask_Args struct {
	AddRequest *AddActivityTaskRequest `json:"addRequest,omitempty"`
}

// ToWire translates a MatchingService_AddActivityTask_Args struct into a Thrift-level intermediate
// representation. This intermediate representation may be serialized
// into bytes using a ThriftRW protocol implementation.
//
// An error is returned if the struct or any of its fields failed to
// validate.
//
//	x, err := v.ToWire()
//	if err != nil {
//	  return err
//	}
//
//	if err := binaryProtocol.Encode(x, writer); err != nil {
//	  return err
//	}
func (v *MatchingService_AddActivityTask_Args) ToWire() (wire.Value, error) {
	var (
		fields [1]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.AddRequest != nil {
		w, err = v.AddRequest.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 1, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

func _AddActivityTaskRequest_Read(w wire.Value) (*AddActivityTaskRequest, error) {
	var v AddActivityTaskRequest
	err := v.FromWire(w)
	return &v, err
}

// FromWire deserializes a MatchingService_AddActivityTask_Args struct from its Thrift-level
// representation. The Thrift-level representation may be obtained
// from a ThriftRW protocol implementation.
//
// An error is returned if we were unable to build a MatchingService_AddActivityTask_Args struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v MatchingService_AddActivityTask_Args
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *MatchingService_AddActivityTask_Args) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 1:
			if field.Value.Type() == wire.TStruct {
				v.AddRequest, err = _AddActivityTaskRequest_Read(field.Value)
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// Encode serializes a MatchingService_AddActivityTask_Args struct directly into bytes, without going
// through an intermediary type.
//
// An error is returned if a MatchingService_AddActivityTask_Args struct could not be encoded.
func (v *MatchingService_AddActivityTask_Args) Encode(sw stream.Writer) error {
	if err := sw.WriteStructBegin(); err != nil {
		return err
	}

	if v.AddRequest != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 1, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.AddRequest.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	return sw.WriteStructEnd()
}

func _AddActivityTaskRequest_Decode(sr stream.Reader) (*AddActivityTaskRequest, error) {
	var v AddActivityTaskRequest
	err := v.Decode(sr)
	return &v, err
}

// Decode deserializes a MatchingService_AddActivityTask_Args struct directly from its Thrift-level
// representation, without going through an intemediary type.
//
// An error is returned if a MatchingService_AddActivityTask_Args struct could not be generated from the wire
// representation.
func (v *MatchingService_AddActivityTask_Args) Decode(sr stream.Reader) error {

	if err := sr.ReadStructBegin(); err != nil {
		return err
	}

	fh, ok, err := sr.ReadFieldBegin()
	if err != nil {
		return err
	}

	for ok {
		switch {
		case fh.ID == 1 && fh.Type == wire.TStruct:
			v.AddRequest, err = _AddActivityTaskRequest_Decode(sr)
			if err != nil {
				return err
			}

		default:
			if err := sr.Skip(fh.Type); err != nil {
				return err
			}
		}

		if err := sr.ReadFieldEnd(); err != nil {
			return err
		}

		if fh, ok, err = sr.ReadFieldBegin(); err != nil {
			return err
		}
	}

	if err := sr.ReadStructEnd(); err != nil {
		return err
	}

	return nil
}

// String returns a readable string representation of a MatchingService_AddActivityTask_Args
// struct.
func (v *MatchingService_AddActivityTask_Args) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [1]string
	i := 0
	if v.AddRequest != nil {
		fields[i] = fmt.Sprintf("AddRequest: %v", v.AddRequest)
		i++
	}

	return fmt.Sprintf("MatchingService_AddActivityTask_Args{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this MatchingService_AddActivityTask_Args match the
// provided MatchingService_AddActivityTask_Args.
//
// This function performs a deep comparison.
func (v *MatchingService_AddActivityTask_Args) Equals(rhs *MatchingService_AddActivityTask_Args) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !((v.AddRequest == nil && rhs.AddRequest == nil) || (v.AddRequest != nil && rhs.AddRequest != nil && v.AddRequest.Equals(rhs.AddRequest))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of MatchingService_AddActivityTask_Args.
func (v *MatchingService_AddActivityTask_Args) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.AddRequest != nil {
		err = multierr.Append(err, enc.AddObject("addRequest", v.AddRequest))
	}
	return err
}

// GetAddRequest returns the value of AddRequest if it is set or its
// zero value if it is unset.
func (v *MatchingService_AddActivityTask_Args) GetAddRequest() (o *AddActivityTaskRequest) {
	if v != nil && v.AddRequest != nil {
		return v.AddRequest
	}

	return
}

// IsSetAddRequest returns true if AddRequest is not nil.
func (v *MatchingService_AddActivityTask_Args) IsSetAddRequest() bool {
	return v != nil && v.AddRequest != nil
}

// MethodName returns the name of the Thrift function as specified in
// the IDL, for which this struct represent the arguments.
//
// This will always be "AddActivityTask" for this struct.
func (v *MatchingService_AddActivityTask_Args) MethodName() string {
	return "AddActivityTask"
}

// EnvelopeType returns the kind of value inside this struct.
//
// This will always be Call for this struct.
func (v *MatchingService_AddActivityTask_Args) EnvelopeType() wire.EnvelopeType {
	return wire.Call
}

// MatchingService_AddActivityTask_Helper provides functions that aid in handling the
// parameters and return values of the MatchingService.AddActivityTask
// function.
var MatchingService_AddActivityTask_Helper = struct {
	// Args accepts the parameters of AddActivityTask in-order and returns
	// the arguments struct for the function.
	Args func(
		addRequest *AddActivityTaskRequest,
	) *MatchingService_AddActivityTask_Args

	// IsException returns true if the given error can be thrown
	// by AddActivityTask.
	//
	// An error can be thrown by AddActivityTask only if the
	// corresponding exception type was mentioned in the 'throws'
	// section for it in the Thrift file.
	IsException func(error) bool

	// WrapResponse returns the result struct for AddActivityTask
	// given the error returned by it. The provided error may
	// be nil if AddActivityTask did not fail.
	//
	// This allows mapping errors returned by AddActivityTask into a
	// serializable result struct. WrapResponse returns a
	// non-nil error if the provided error cannot be thrown by
	// AddActivityTask
	//
	//   err := AddActivityTask(args)
	//   result, err := MatchingService_AddActivityTask_Helper.WrapResponse(err)
	//   if err != nil {
	//     return fmt.Errorf("unexpected error from AddActivityTask: %v", err)
	//   }
	//   serialize(result)
	WrapResponse func(error) (*MatchingService_AddActivityTask_Result, error)

	// UnwrapResponse takes the result struct for AddActivityTask
	// and returns the erorr returned by it (if any).
	//
	// The error is non-nil only if AddActivityTask threw an
	// exception.
	//
	//   result := deserialize(bytes)
	//   err := MatchingService_AddActivityTask_Helper.UnwrapResponse(result)
	UnwrapResponse func(*MatchingService_AddActivityTask_Result) error
}{}

func init() {
	MatchingService_AddActivityTask_Helper.Args = func(
		addRequest *AddActivityTaskRequest,
	) *MatchingService_AddActivityTask_Args {
		return &MatchingService_AddActivityTask_Args{
			AddRequest: addRequest,
		}
	}

	MatchingService_AddActivityTask_Helper.IsException = func(err error) bool {
		switch err.(type) {
		case *shared.BadRequestError:
			return true
		case *shared.InternalServiceError:
			return true
		case *shared.ServiceBusyError:
			return true
		case *shared.LimitExceededError:
			return true
		case *shared.DomainNotActiveError:
			return true
		case *shared.RemoteSyncMatchedError:
			return true
		case *shared.TaskListNotOwnedByHostError:
			return true
		default:
			return false
		}
	}

	MatchingService_AddActivityTask_Helper.WrapResponse = func(err error) (*MatchingService_AddActivityTask_Result, error) {
		if err == nil {
			return &MatchingService_AddActivityTask_Result{}, nil
		}

		switch e := err.(type) {
		case *shared.BadRequestError:
			if e == nil {
				return nil, errors.New("WrapResponse received non-nil error type with nil value for MatchingService_AddActivityTask_Result.BadRequestError")
			}
			return &MatchingService_AddActivityTask_Result{BadRequestError: e}, nil
		case *shared.InternalServiceError:
			if e == nil {
				return nil, errors.New("WrapResponse received non-nil error type with nil value for MatchingService_AddActivityTask_Result.InternalServiceError")
			}
			return &MatchingService_AddActivityTask_Result{InternalServiceError: e}, nil
		case *shared.ServiceBusyError:
			if e == nil {
				return nil, errors.New("WrapResponse received non-nil error type with nil value for MatchingService_AddActivityTask_Result.ServiceBusyError")
			}
			return &MatchingService_AddActivityTask_Result{ServiceBusyError: e}, nil
		case *shared.LimitExceededError:
			if e == nil {
				return nil, errors.New("WrapResponse received non-nil error type with nil value for MatchingService_AddActivityTask_Result.LimitExceededError")
			}
			return &MatchingService_AddActivityTask_Result{LimitExceededError: e}, nil
		case *shared.DomainNotActiveError:
			if e == nil {
				return nil, errors.New("WrapResponse received non-nil error type with nil value for MatchingService_AddActivityTask_Result.DomainNotActiveError")
			}
			return &MatchingService_AddActivityTask_Result{DomainNotActiveError: e}, nil
		case *shared.RemoteSyncMatchedError:
			if e == nil {
				return nil, errors.New("WrapResponse received non-nil error type with nil value for MatchingService_AddActivityTask_Result.RemoteSyncMatchedError")
			}
			return &MatchingService_AddActivityTask_Result{RemoteSyncMatchedError: e}, nil
		case *shared.TaskListNotOwnedByHostError:
			if e == nil {
				return nil, errors.New("WrapResponse received non-nil error type with nil value for MatchingService_AddActivityTask_Result.TaskListNotOwnedByHostError")
			}
			return &MatchingService_AddActivityTask_Result{TaskListNotOwnedByHostError: e}, nil
		}

		return nil, err
	}
	MatchingService_AddActivityTask_Helper.UnwrapResponse = func(result *MatchingService_AddActivityTask_Result) (err error) {
		if result.BadRequestError != nil {
			err = result.BadRequestError
			return
		}
		if result.InternalServiceError != nil {
			err = result.InternalServiceError
			return
		}
		if result.ServiceBusyError != nil {
			err = result.ServiceBusyError
			return
		}
		if result.LimitExceededError != nil {
			err = result.LimitExceededError
			return
		}
		if result.DomainNotActiveError != nil {
			err = result.DomainNotActiveError
			return
		}
		if result.RemoteSyncMatchedError != nil {
			err = result.RemoteSyncMatchedError
			return
		}
		if result.TaskListNotOwnedByHostError != nil {
			err = result.TaskListNotOwnedByHostError
			return
		}
		return
	}

}

// MatchingService_AddActivityTask_Result represents the result of a MatchingService.AddActivityTask function call.
//
// The result of a AddActivityTask execution is sent and received over the wire as this struct.
type MatchingService_AddActivityTask_Result struct {
	BadRequestError             *shared.BadRequestError             `json:"badRequestError,omitempty"`
	InternalServiceError        *shared.InternalServiceError        `json:"internalServiceError,omitempty"`
	ServiceBusyError            *shared.ServiceBusyError            `json:"serviceBusyError,omitempty"`
	LimitExceededError          *shared.LimitExceededError          `json:"limitExceededError,omitempty"`
	DomainNotActiveError        *shared.DomainNotActiveError        `json:"domainNotActiveError,omitempty"`
	RemoteSyncMatchedError      *shared.RemoteSyncMatchedError      `json:"remoteSyncMatchedError,omitempty"`
	TaskListNotOwnedByHostError *shared.TaskListNotOwnedByHostError `json:"taskListNotOwnedByHostError,omitempty"`
}

// ToWire translates a MatchingService_AddActivityTask_Result struct into a Thrift-level intermediate
// representation. This intermediate representation may be serialized
// into bytes using a ThriftRW protocol implementation.
//
// An error is returned if the struct or any of its fields failed to
// validate.
//
//	x, err := v.ToWire()
//	if err != nil {
//	  return err
//	}
//
//	if err := binaryProtocol.Encode(x, writer); err != nil {
//	  return err
//	}
func (v *MatchingService_AddActivityTask_Result) ToWire() (wire.Value, error) {
	var (
		fields [7]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.BadRequestError != nil {
		w, err = v.BadRequestError.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 1, Value: w}
		i++
	}
	if v.InternalServiceError != nil {
		w, err = v.InternalServiceError.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 2, Value: w}
		i++
	}
	if v.ServiceBusyError != nil {
		w, err = v.ServiceBusyError.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 3, Value: w}
		i++
	}
	if v.LimitExceededError != nil {
		w, err = v.LimitExceededError.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 4, Value: w}
		i++
	}
	if v.DomainNotActiveError != nil {
		w, err = v.DomainNotActiveError.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 5, Value: w}
		i++
	}
	if v.RemoteSyncMatchedError != nil {
		w, err = v.RemoteSyncMatchedError.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 6, Value: w}
		i++
	}
	if v.TaskListNotOwnedByHostError != nil {
		w, err = v.TaskListNotOwnedByHostError.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 7, Value: w}
		i++
	}

	if i > 1 {
		return wire.Value{}, fmt.Errorf("MatchingService_AddActivityTask_Result should have at most one field: got %v fields", i)
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

func _BadRequestError_Read(w wire.Value) (*shared.BadRequestError, error) {
	var v shared.BadRequestError
	err := v.FromWire(w)
	return &v, err
}

func _InternalServiceError_Read(w wire.Value) (*shared.InternalServiceError, error) {
	var v shared.InternalServiceError
	err := v.FromWire(w)
	return &v, err
}

func _ServiceBusyError_Read(w wire.Value) (*shared.ServiceBusyError, error) {
	var v shared.ServiceBusyError
	err := v.FromWire(w)
	return &v, err
}

func _LimitExceededError_Read(w wire.Value) (*shared.LimitExceededError, error) {
	var v shared.LimitExceededError
	err := v.FromWire(w)
	return &v, err
}

func _DomainNotActiveError_Read(w wire.Value) (*shared.DomainNotActiveError, error) {
	var v shared.DomainNotActiveError
	err := v.FromWire(w)
	return &v, err
}

func _RemoteSyncMatchedError_Read(w wire.Value) (*shared.RemoteSyncMatchedError, error) {
	var v shared.RemoteSyncMatchedError
	err := v.FromWire(w)
	return &v, err
}

func _TaskListNotOwnedByHostError_Read(w wire.Value) (*shared.TaskListNotOwnedByHostError, error) {
	var v shared.TaskListNotOwnedByHostError
	err := v.FromWire(w)
	return &v, err
}

// FromWire deserializes a MatchingService_AddActivityTask_Result struct from its Thrift-level
// representation. The Thrift-level representation may be obtained
// from a ThriftRW protocol implementation.
//
// An error is returned if we were unable to build a MatchingService_AddActivityTask_Result struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v MatchingService_AddActivityTask_Result
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *MatchingService_AddActivityTask_Result) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 1:
			if field.Value.Type() == wire.TStruct {
				v.BadRequestError, err = _BadRequestError_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 2:
			if field.Value.Type() == wire.TStruct {
				v.InternalServiceError, err = _InternalServiceError_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 3:
			if field.Value.Type() == wire.TStruct {
				v.ServiceBusyError, err = _ServiceBusyError_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 4:
			if field.Value.Type() == wire.TStruct {
				v.LimitExceededError, err = _LimitExceededError_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 5:
			if field.Value.Type() == wire.TStruct {
				v.DomainNotActiveError, err = _DomainNotActiveError_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 6:
			if field.Value.Type() == wire.TStruct {
				v.RemoteSyncMatchedError, err = _RemoteSyncMatchedError_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 7:
			if field.Value.Type() == wire.TStruct {
				v.TaskListNotOwnedByHostError, err = _TaskListNotOwnedByHostError_Read(field.Value)
				if err != nil {
					return err
				}

			}
		}
	}

	count := 0
	if v.BadRequestError != nil {
		count++
	}
	if v.InternalServiceError != nil {
		count++
	}
	if v.ServiceBusyError != nil {
		count++
	}
	if v.LimitExceededError != nil {
		count++
	}
	if v.DomainNotActiveError != nil {
		count++
	}
	if v.RemoteSyncMatchedError != nil {
		count++
	}
	if v.TaskListNotOwnedByHostError != nil {
		count++
	}
	if count > 1 {
		return fmt.Errorf("MatchingService_AddActivityTask_Result should have at most one field: got %v fields", count)
	}

	return nil
}

// Encode serializes a MatchingService_AddActivityTask_Result struct directly into bytes, without going
// through an intermediary type.
//
// An error is returned if a MatchingService_AddActivityTask_Result struct could not be encoded.
func (v *MatchingService_AddActivityTask_Result) Encode(sw stream.Writer) error {
	if err := sw.WriteStructBegin(); err != nil {
		return err
	}

	if v.BadRequestError != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 1, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.BadRequestError.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.InternalServiceError != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 2, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.InternalServiceError.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.ServiceBusyError != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 3, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.ServiceBusyError.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.LimitExceededError != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 4, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.LimitExceededError.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.DomainNotActiveError != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 5, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.DomainNotActiveError.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.RemoteSyncMatchedError != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 6, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.RemoteSyncMatchedError.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.TaskListNotOwnedByHostError != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 7, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.TaskListNotOwnedByHostError.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	count := 0
	if v.BadRequestError != nil {
		count++
	}
	if v.InternalServiceError != nil {
		count++
	}
	if v.ServiceBusyError != nil {
		count++
	}
	if v.LimitExceededError != nil {
		count++
	}
	if v.DomainNotActiveError != nil {
		count++
	}
	if v.RemoteSyncMatchedError != nil {
		count++
	}
	if v.TaskListNotOwnedByHostError != nil {
		count++
	}

	if count > 1 {
		return fmt.Errorf("MatchingService_AddActivityTask_Result should have at most one field: got %v fields", count)
	}

	return sw.WriteStructEnd()
}

func _BadRequestError_Decode(sr stream.Reader) (*shared.BadRequestError, error) {
	var v shared.BadRequestError
	err := v.Decode(sr)
	return &v, err
}

func _InternalServiceError_Decode(sr stream.Reader) (*shared.InternalServiceError, error) {
	var v shared.InternalServiceError
	err := v.Decode(sr)
	return &v, err
}

func _ServiceBusyError_Decode(sr stream.Reader) (*shared.ServiceBusyError, error) {
	var v shared.ServiceBusyError
	err := v.Decode(sr)
	return &v, err
}

func _LimitExceededError_Decode(sr stream.Reader) (*shared.LimitExceededError, error) {
	var v shared.LimitExceededError
	err := v.Decode(sr)
	return &v, err
}

func _DomainNotActiveError_Decode(sr stream.Reader) (*shared.DomainNotActiveError, error) {
	var v shared.DomainNotActiveError
	err := v.Decode(sr)
	return &v, err
}

func _RemoteSyncMatchedError_Decode(sr stream.Reader) (*shared.RemoteSyncMatchedError, error) {
	var v shared.RemoteSyncMatchedError
	err := v.Decode(sr)
	return &v, err
}

func _TaskListNotOwnedByHostError_Decode(sr stream.Reader) (*shared.TaskListNotOwnedByHostError, error) {
	var v shared.TaskListNotOwnedByHostError
	err := v.Decode(sr)
	return &v, err
}

// Decode deserializes a MatchingService_AddActivityTask_Result struct directly from its Thrift-level
// representation, without going through an intemediary type.
//
// An error is returned if a MatchingService_AddActivityTask_Result struct could not be generated from the wire
// representation.
func (v *MatchingService_AddActivityTask_Result) Decode(sr stream.Reader) error {

	if err := sr.ReadStructBegin(); err != nil {
		return err
	}

	fh, ok, err := sr.ReadFieldBegin()
	if err != nil {
		return err
	}

	for ok {
		switch {
		case fh.ID == 1 && fh.Type == wire.TStruct:
			v.BadRequestError, err = _BadRequestError_Decode(sr)
			if err != nil {
				return err
			}

		case fh.ID == 2 && fh.Type == wire.TStruct:
			v.InternalServiceError, err = _InternalServiceError_Decode(sr)
			if err != nil {
				return err
			}

		case fh.ID == 3 && fh.Type == wire.TStruct:
			v.ServiceBusyError, err = _ServiceBusyError_Decode(sr)
			if err != nil {
				return err
			}

		case fh.ID == 4 && fh.Type == wire.TStruct:
			v.LimitExceededError, err = _LimitExceededError_Decode(sr)
			if err != nil {
				return err
			}

		case fh.ID == 5 && fh.Type == wire.TStruct:
			v.DomainNotActiveError, err = _DomainNotActiveError_Decode(sr)
			if err != nil {
				return err
			}

		case fh.ID == 6 && fh.Type == wire.TStruct:
			v.RemoteSyncMatchedError, err = _RemoteSyncMatchedError_Decode(sr)
			if err != nil {
				return err
			}

		case fh.ID == 7 && fh.Type == wire.TStruct:
			v.TaskListNotOwnedByHostError, err = _TaskListNotOwnedByHostError_Decode(sr)
			if err != nil {
				return err
			}

		default:
			if err := sr.Skip(fh.Type); err != nil {
				return err
			}
		}

		if err := sr.ReadFieldEnd(); err != nil {
			return err
		}

		if fh, ok, err = sr.ReadFieldBegin(); err != nil {
			return err
		}
	}

	if err := sr.ReadStructEnd(); err != nil {
		return err
	}

	count := 0
	if v.BadRequestError != nil {
		count++
	}
	if v.InternalServiceError != nil {
		count++
	}
	if v.ServiceBusyError != nil {
		count++
	}
	if v.LimitExceededError != nil {
		count++
	}
	if v.DomainNotActiveError != nil {
		count++
	}
	if v.RemoteSyncMatchedError != nil {
		count++
	}
	if v.TaskListNotOwnedByHostError != nil {
		count++
	}
	if count > 1 {
		return fmt.Errorf("MatchingService_AddActivityTask_Result should have at most one field: got %v fields", count)
	}

	return nil
}

// String returns a readable string representation of a MatchingService_AddActivityTask_Result
// struct.
func (v *MatchingService_AddActivityTask_Result) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [7]string
	i := 0
	if v.BadRequestError != nil {
		fields[i] = fmt.Sprintf("BadRequestError: %v", v.BadRequestError)
		i++
	}
	if v.InternalServiceError != nil {
		fields[i] = fmt.Sprintf("InternalServiceError: %v", v.InternalServiceError)
		i++
	}
	if v.ServiceBusyError != nil {
		fields[i] = fmt.Sprintf("ServiceBusyError: %v", v.ServiceBusyError)
		i++
	}
	if v.LimitExceededError != nil {
		fields[i] = fmt.Sprintf("LimitExceededError: %v", v.LimitExceededError)
		i++
	}
	if v.DomainNotActiveError != nil {
		fields[i] = fmt.Sprintf("DomainNotActiveError: %v", v.DomainNotActiveError)
		i++
	}
	if v.RemoteSyncMatchedError != nil {
		fields[i] = fmt.Sprintf("RemoteSyncMatchedError: %v", v.RemoteSyncMatchedError)
		i++
	}
	if v.TaskListNotOwnedByHostError != nil {
		fields[i] = fmt.Sprintf("TaskListNotOwnedByHostError: %v", v.TaskListNotOwnedByHostError)
		i++
	}

	return fmt.Sprintf("MatchingService_AddActivityTask_Result{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this MatchingService_AddActivityTask_Result match the
// provided MatchingService_AddActivityTask_Result.
//
// This function performs a deep comparison.
func (v *MatchingService_AddActivityTask_Result) Equals(rhs *MatchingService_AddActivityTask_Result) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !((v.BadRequestError == nil && rhs.BadRequestError == nil) || (v.BadRequestError != nil && rhs.BadRequestError != nil && v.BadRequestError.Equals(rhs.BadRequestError))) {
		return false
	}
	if !((v.InternalServiceError == nil && rhs.InternalServiceError == nil) || (v.InternalServiceError != nil && rhs.InternalServiceError != nil && v.InternalServiceError.Equals(rhs.InternalServiceError))) {
		return false
	}
	if !((v.ServiceBusyError == nil && rhs.ServiceBusyError == nil) || (v.ServiceBusyError != nil && rhs.ServiceBusyError != nil && v.ServiceBusyError.Equals(rhs.ServiceBusyError))) {
		return false
	}
	if !((v.LimitExceededError == nil && rhs.LimitExceededError == nil) || (v.LimitExceededError != nil && rhs.LimitExceededError != nil && v.LimitExceededError.Equals(rhs.LimitExceededError))) {
		return false
	}
	if !((v.DomainNotActiveError == nil && rhs.DomainNotActiveError == nil) || (v.DomainNotActiveError != nil && rhs.DomainNotActiveError != nil && v.DomainNotActiveError.Equals(rhs.DomainNotActiveError))) {
		return false
	}
	if !((v.RemoteSyncMatchedError == nil && rhs.RemoteSyncMatchedError == nil) || (v.RemoteSyncMatchedError != nil && rhs.RemoteSyncMatchedError != nil && v.RemoteSyncMatchedError.Equals(rhs.RemoteSyncMatchedError))) {
		return false
	}
	if !((v.TaskListNotOwnedByHostError == nil && rhs.TaskListNotOwnedByHostError == nil) || (v.TaskListNotOwnedByHostError != nil && rhs.TaskListNotOwnedByHostError != nil && v.TaskListNotOwnedByHostError.Equals(rhs.TaskListNotOwnedByHostError))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of MatchingService_AddActivityTask_Result.
func (v *MatchingService_AddActivityTask_Result) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.BadRequestError != nil {
		err = multierr.Append(err, enc.AddObject("badRequestError", v.BadRequestError))
	}
	if v.InternalServiceError != nil {
		err = multierr.Append(err, enc.AddObject("internalServiceError", v.InternalServiceError))
	}
	if v.ServiceBusyError != nil {
		err = multierr.Append(err, enc.AddObject("serviceBusyError", v.ServiceBusyError))
	}
	if v.LimitExceededError != nil {
		err = multierr.Append(err, enc.AddObject("limitExceededError", v.LimitExceededError))
	}
	if v.DomainNotActiveError != nil {
		err = multierr.Append(err, enc.AddObject("domainNotActiveError", v.DomainNotActiveError))
	}
	if v.RemoteSyncMatchedError != nil {
		err = multierr.Append(err, enc.AddObject("remoteSyncMatchedError", v.RemoteSyncMatchedError))
	}
	if v.TaskListNotOwnedByHostError != nil {
		err = multierr.Append(err, enc.AddObject("taskListNotOwnedByHostError", v.TaskListNotOwnedByHostError))
	}
	return err
}

// GetBadRequestError returns the value of BadRequestError if it is set or its
// zero value if it is unset.
func (v *MatchingService_AddActivityTask_Result) GetBadRequestError() (o *shared.BadRequestError) {
	if v != nil && v.BadRequestError != nil {
		return v.BadRequestError
	}

	return
}

// IsSetBadRequestError returns true if BadRequestError is not nil.
func (v *MatchingService_AddActivityTask_Result) IsSetBadRequestError() bool {
	return v != nil && v.BadRequestError != nil
}

// GetInternalServiceError returns the value of InternalServiceError if it is set or its
// zero value if it is unset.
func (v *MatchingService_AddActivityTask_Result) GetInternalServiceError() (o *shared.InternalServiceError) {
	if v != nil && v.InternalServiceError != nil {
		return v.InternalServiceError
	}

	return
}

// IsSetInternalServiceError returns true if InternalServiceError is not nil.
func (v *MatchingService_AddActivityTask_Result) IsSetInternalServiceError() bool {
	return v != nil && v.InternalServiceError != nil
}

// GetServiceBusyError returns the value of ServiceBusyError if it is set or its
// zero value if it is unset.
func (v *MatchingService_AddActivityTask_Result) GetServiceBusyError() (o *shared.ServiceBusyError) {
	if v != nil && v.ServiceBusyError != nil {
		return v.ServiceBusyError
	}

	return
}

// IsSetServiceBusyError returns true if ServiceBusyError is not nil.
func (v *MatchingService_AddActivityTask_Result) IsSetServiceBusyError() bool {
	return v != nil && v.ServiceBusyError != nil
}

// GetLimitExceededError returns the value of LimitExceededError if it is set or its
// zero value if it is unset.
func (v *MatchingService_AddActivityTask_Result) GetLimitExceededError() (o *shared.LimitExceededError) {
	if v != nil && v.LimitExceededError != nil {
		return v.LimitExceededError
	}

	return
}

// IsSetLimitExceededError returns true if LimitExceededError is not nil.
func (v *MatchingService_AddActivityTask_Result) IsSetLimitExceededError() bool {
	return v != nil && v.LimitExceededError != nil
}

// GetDomainNotActiveError returns the value of DomainNotActiveError if it is set or its
// zero value if it is unset.
func (v *MatchingService_AddActivityTask_Result) GetDomainNotActiveError() (o *shared.DomainNotActiveError) {
	if v != nil && v.DomainNotActiveError != nil {
		return v.DomainNotActiveError
	}

	return
}

// IsSetDomainNotActiveError returns true if DomainNotActiveError is not nil.
func (v *MatchingService_AddActivityTask_Result) IsSetDomainNotActiveError() bool {
	return v != nil && v.DomainNotActiveError != nil
}

// GetRemoteSyncMatchedError returns the value of RemoteSyncMatchedError if it is set or its
// zero value if it is unset.
func (v *MatchingService_AddActivityTask_Result) GetRemoteSyncMatchedError() (o *shared.RemoteSyncMatchedError) {
	if v != nil && v.RemoteSyncMatchedError != nil {
		return v.RemoteSyncMatchedError
	}

	return
}

// IsSetRemoteSyncMatchedError returns true if RemoteSyncMatchedError is not nil.
func (v *MatchingService_AddActivityTask_Result) IsSetRemoteSyncMatchedError() bool {
	return v != nil && v.RemoteSyncMatchedError != nil
}

// GetTaskListNotOwnedByHostError returns the value of TaskListNotOwnedByHostError if it is set or its
// zero value if it is unset.
func (v *MatchingService_AddActivityTask_Result) GetTaskListNotOwnedByHostError() (o *shared.TaskListNotOwnedByHostError) {
	if v != nil && v.TaskListNotOwnedByHostError != nil {
		return v.TaskListNotOwnedByHostError
	}

	return
}

// IsSetTaskListNotOwnedByHostError returns true if TaskListNotOwnedByHostError is not nil.
func (v *MatchingService_AddActivityTask_Result) IsSetTaskListNotOwnedByHostError() bool {
	return v != nil && v.TaskListNotOwnedByHostError != nil
}

// MethodName returns the name of the Thrift function as specified in
// the IDL, for which this struct represent the result.
//
// This will always be "AddActivityTask" for this struct.
func (v *MatchingService_AddActivityTask_Result) MethodName() string {
	return "AddActivityTask"
}

// EnvelopeType returns the kind of value inside this struct.
//
// This will always be Reply for this struct.
func (v *MatchingService_AddActivityTask_Result) EnvelopeType() wire.EnvelopeType {
	return wire.Reply
}

// MatchingService_AddDecisionTask_Args represents the arguments for the MatchingService.AddDecisionTask function.
//
// The arguments for AddDecisionTask are sent and received over the wire as this struct.
type MatchingService_AddDecisionTask_Args struct {
	AddRequest *AddDecisionTaskRequest `json:"addRequest,omitempty"`
}

// ToWire translates a MatchingService_AddDecisionTask_Args struct into a Thrift-level intermediate
// representation. This intermediate representation may be serialized
// into bytes using a ThriftRW protocol implementation.
//
// An error is returned if the struct or any of its fields failed to
// validate.
//
//	x, err := v.ToWire()
//	if err != nil {
//	  return err
//	}
//
//	if err := binaryProtocol.Encode(x, writer); err != nil {
//	  return err
//	}
func (v *MatchingService_AddDecisionTask_Args) ToWire() (wire.Value, error) {
	var (
		fields [1]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.AddRequest != nil {
		w, err = v.AddRequest.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 1, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

func _AddDecisionTaskRequest_Read(w wire.Value) (*AddDecisionTaskRequest, error) {
	var v AddDecisionTaskRequest
	err := v.FromWire(w)
	return &v, err
}

// FromWire deserializes a MatchingService_AddDecisionTask_Args struct from its Thrift-level
// representation. The Thrift-level representation may be obtained
// from a ThriftRW protocol implementation.
//
// An error is returned if we were unable to build a MatchingService_AddDecisionTask_Args struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v MatchingService_AddDecisionTask_Args
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *MatchingService_AddDecisionTask_Args) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 1:
			if field.Value.Type() == wire.TStruct {
				v.AddRequest, err = _AddDecisionTaskRequest_Read(field.Value)
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// Encode serializes a MatchingService_AddDecisionTask_Args struct directly into bytes, without going
// through an intermediary type.
//
// An error is returned if a MatchingService_AddDecisionTask_Args struct could not be encoded.
func (v *MatchingService_AddDecisionTask_Args) Encode(sw stream.Writer) error {
	if err := sw.WriteStructBegin(); err != nil {
		return err
	}

	if v.AddRequest != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 1, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.AddRequest.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	return sw.WriteStructEnd()
}

func _AddDecisionTaskRequest_Decode(sr stream.Reader) (*AddDecisionTaskRequest, error) {
	var v AddDecisionTaskRequest
	err := v.Decode(sr)
	return &v, err
}

// Decode deserializes a MatchingService_AddDecisionTask_Args struct directly from its Thrift-level
// representation, without going through an intemediary type.
//
// An error is returned if a MatchingService_AddDecisionTask_Args struct could not be generated from the wire
// representation.
func (v *MatchingService_AddDecisionTask_Args) Decode(sr stream.Reader) error {

	if err := sr.ReadStructBegin(); err != nil {
		return err
	}

	fh, ok, err := sr.ReadFieldBegin()
	if err != nil {
		return err
	}

	for ok {
		switch {
		case fh.ID == 1 && fh.Type == wire.TStruct:
			v.AddRequest, err = _AddDecisionTaskRequest_Decode(sr)
			if err != nil {
				return err
			}

		default:
			if err := sr.Skip(fh.Type); err != nil {
				return err
			}
		}

		if err := sr.ReadFieldEnd(); err != nil {
			return err
		}

		if fh, ok, err = sr.ReadFieldBegin(); err != nil {
			return err
		}
	}

	if err := sr.ReadStructEnd(); err != nil {
		return err
	}

	return nil
}

// String returns a readable string representation of a MatchingService_AddDecisionTask_Args
// struct.
func (v *MatchingService_AddDecisionTask_Args) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [1]string
	i := 0
	if v.AddRequest != nil {
		fields[i] = fmt.Sprintf("AddRequest: %v", v.AddRequest)
		i++
	}

	return fmt.Sprintf("MatchingService_AddDecisionTask_Args{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this MatchingService_AddDecisionTask_Args match the
// provided MatchingService_AddDecisionTask_Args.
//
// This function performs a deep comparison.
func (v *MatchingService_AddDecisionTask_Args) Equals(rhs *MatchingService_AddDecisionTask_Args) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !((v.AddRequest == nil && rhs.AddRequest == nil) || (v.AddRequest != nil && rhs.AddRequest != nil && v.AddRequest.Equals(rhs.AddRequest))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of MatchingService_AddDecisionTask_Args.
func (v *MatchingService_AddDecisionTask_Args) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.AddRequest != nil {
		err = multierr.Append(err, enc.AddObject("addRequest", v.AddRequest))
	}
	return err
}

// GetAddRequest returns the value of AddRequest if it is set or its
// zero value if it is unset.
func (v *MatchingService_AddDecisionTask_Args) GetAddRequest() (o *AddDecisionTaskRequest) {
	if v != nil && v.AddRequest != nil {
		return v.AddRequest
	}

	return
}

// IsSetAddRequest returns true if AddRequest is not nil.
func (v *MatchingService_AddDecisionTask_Args) IsSetAddRequest() bool {
	return v != nil && v.AddRequest != nil
}

// MethodName returns the name of the Thrift function as specified in
// the IDL, for which this struct represent the arguments.
//
// This will always be "AddDecisionTask" for this struct.
func (v *MatchingService_AddDecisionTask_Args) MethodName() string {
	return "AddDecisionTask"
}

// EnvelopeType returns the kind of value inside this struct.
//
// This will always be Call for this struct.
func (v *MatchingService_AddDecisionTask_Args) EnvelopeType() wire.EnvelopeType {
	return wire.Call
}

// MatchingService_AddDecisionTask_Helper provides functions that aid in handling the
// parameters and return values of the MatchingService.AddDecisionTask
// function.
var MatchingService_AddDecisionTask_Helper = struct {
	// Args accepts the parameters of AddDecisionTask in-order and returns
	// the arguments struct for the function.
	Args func(
		addRequest *AddDecisionTaskRequest,
	) *MatchingService_AddDecisionTask_Args

	// IsException returns true if the given error can be thrown
	// by AddDecisionTask.
	//
	// An error can be thrown by AddDecisionTask only if the
	// corresponding exception type was mentioned in the 'throws'
	// section for it in the Thrift file.
	IsException func(error) bool

	// WrapResponse returns the result struct for AddDecisionTask
	// given the error returned by it. The provided error may
	// be nil if AddDecisionTask did not fail.
	//
	// This allows mapping errors returned by AddDecisionTask into a
	// serializable result struct. WrapResponse returns a
	// non-nil error if the provided error cannot be thrown by
	// AddDecisionTask
	//
	//   err := AddDecisionTask(args)
	//   result, err := MatchingService_AddDecisionTask_Helper.WrapResponse(err)
	//   if err != nil {
	//     return fmt.Errorf("unexpected error from AddDecisionTask: %v", err)
	//   }
	//   serialize(result)
	WrapResponse func(error) (*MatchingService_AddDecisionTask_Result, error)

	// UnwrapResponse takes the result struct for AddDecisionTask
	// and returns the erorr returned by it (if any).
	//
	// The error is non-nil only if AddDecisionTask threw an
	// exception.
	//
	//   result := deserialize(bytes)
	//   err := MatchingService_AddDecisionTask_Helper.UnwrapResponse(result)
	UnwrapResponse func(*MatchingService_AddDecisionTask_Result) error
}{}

func init() {
	MatchingService_AddDecisionTask_Helper.Args = func(
		addRequest *AddDecisionTaskRequest,
	) *MatchingService_AddDecisionTask_Args {
		return &MatchingService_AddDecisionTask_Args{
			AddRequest: addRequest,
		}
	}

	MatchingService_AddDecisionTask_Helper.IsException = func(err error) bool {
		switch err.(type) {
		case *shared.BadRequestError:
			return true
		case *shared.InternalServiceError:
			return true
		case *shared.ServiceBusyError:
			return true
		case *shared.LimitExceededError:
			return true
		case *shared.DomainNotActiveError:
			return true
		case *shared.RemoteSyncMatchedError:
			return true
		case *shared.StickyWorkerUnavailableError:
			return true
		case *shared.TaskListNotOwnedByHostError:
			return true
		default:
			return false
		}
	}

	MatchingService_AddDecisionTask_Helper.WrapResponse = func(err error) (*MatchingService_AddDecisionTask_Result, error) {
		if err == nil {
			return &MatchingService_AddDecisionTask_Result{}, nil
		}

		switch e := err.(type) {
		case *shared.BadRequestError:
			if e == nil {
				return nil, errors.New("WrapResponse received non-nil error type with nil value for MatchingService_AddDecisionTask_Result.BadRequestError")
			}
			return &MatchingService_AddDecisionTask_Result{BadRequestError: e}, nil
		case *shared.InternalServiceError:
			if e == nil {
				return nil, errors.New("WrapResponse received non-nil error type with nil value for MatchingService_AddDecisionTask_Result.InternalServiceError")
			}
			return &MatchingService_AddDecisionTask_Result{InternalServiceError: e}, nil
		case *shared.ServiceBusyError:
			if e == nil {
				return nil, errors.New("WrapResponse received non-nil error type with nil value for MatchingService_AddDecisionTask_Result.ServiceBusyError")
			}
			return &MatchingService_AddDecisionTask_Result{ServiceBusyError: e}, nil
		case *shared.LimitExceededError:
			if e == nil {
				return nil, errors.New("WrapResponse received non-nil error type with nil value for MatchingService_AddDecisionTask_Result.LimitExceededError")
			}
			return &MatchingService_AddDecisionTask_Result{LimitExceededError: e}, nil
		case *shared.DomainNotActiveError:
			if e == nil {
				return nil, errors.New("WrapResponse received non-nil error type with nil value for MatchingService_AddDecisionTask_Result.DomainNotActiveError")
			}
			return &MatchingService_AddDecisionTask_Result{DomainNotActiveError: e}, nil
		case *shared.RemoteSyncMatchedError:
			if e == nil {
				return nil, errors.New("WrapResponse received non-nil error type with nil value for MatchingService_AddDecisionTask_Result.RemoteSyncMatchedError")
			}
			return &MatchingService_AddDecisionTask_Result{RemoteSyncMatchedError: e}, nil
		case *shared.StickyWorkerUnavailableError:
			if e == nil {
				return nil, errors.New("WrapResponse received non-nil error type with nil value for MatchingService_AddDecisionTask_Result.StickyWorkerUnavailableError")
			}
			return &MatchingService_AddDecisionTask_Result{StickyWorkerUnavailableError: e}, nil
		case *shared.TaskListNotOwnedByHostError:
			if e == nil {
				return nil, errors.New("WrapResponse received non-nil error type with nil value for MatchingService_AddDecisionTask_Result.TaskListNotOwnedByHostError")
			}
			return &MatchingService_AddDecisionTask_Result{TaskListNotOwnedByHostError: e}, nil
		}

		return nil, err
	}
	MatchingService_AddDecisionTask_Helper.UnwrapResponse = func(result *MatchingService_AddDecisionTask_Result) (err error) {
		if result.BadRequestError != nil {
			err = result.BadRequestError
			return
		}
		if result.InternalServiceError != nil {
			err = result.InternalServiceError
			return
		}
		if result.ServiceBusyError != nil {
			err = result.ServiceBusyError
			return
		}
		if result.LimitExceededError != nil {
			err = result.LimitExceededError
			return
		}
		if result.DomainNotActiveError != nil {
			err = result.DomainNotActiveError
			return
		}
		if result.RemoteSyncMatchedError != nil {
			err = result.RemoteSyncMatchedError
			return
		}
		if result.StickyWorkerUnavailableError != nil {
			err = result.StickyWorkerUnavailableError
			return
		}
		if result.TaskListNotOwnedByHostError != nil {
			err = result.TaskListNotOwnedByHostError
			return
		}
		return
	}

}

// MatchingService_AddDecisionTask_Result represents the result of a MatchingService.AddDecisionTask function call.
//
// The result of a AddDecisionTask execution is sent and received over the wire as this struct.
type MatchingService_AddDecisionTask_Result struct {
	BadRequestError              *shared.BadRequestError              `json:"badRequestError,omitempty"`
	InternalServiceError         *shared.InternalServiceError         `json:"internalServiceError,omitempty"`
	ServiceBusyError             *shared.ServiceBusyError             `json:"serviceBusyError,omitempty"`
	LimitExceededError           *shared.LimitExceededError           `json:"limitExceededError,omitempty"`
	DomainNotActiveError         *shared.DomainNotActiveError         `json:"domainNotActiveError,omitempty"`
	RemoteSyncMatchedError       *shared.RemoteSyncMatchedError       `json:"remoteSyncMatchedError,omitempty"`
	StickyWorkerUnavailableError *shared.StickyWorkerUnavailableError `json:"stickyWorkerUnavailableError,omitempty"`
	TaskListNotOwnedByHostError  *shared.TaskListNotOwnedByHostError  `json:"taskListNotOwnedByHostError,omitempty"`
}

// ToWire translates a MatchingService_AddDecisionTask_Result struct into a Thrift-level intermediate
// representation. This intermediate representation may be serialized
// into bytes using a ThriftRW protocol implementation.
//
// An error is returned if the struct or any of its fields failed to
// validate.
//
//	x, err := v.ToWire()
//	if err != nil {
//	  return err
//	}
//
//	if err := binaryProtocol.Encode(x, writer); err != nil {
//	  return err
//	}
func (v *MatchingService_AddDecisionTask_Result) ToWire() (wire.Value, error) {
	var (
		fields [8]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.BadRequestError != nil {
		w, err = v.BadRequestError.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 1, Value: w}
		i++
	}
	if v.InternalServiceError != nil {
		w, err = v.InternalServiceError.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 2, Value: w}
		i++
	}
	if v.ServiceBusyError != nil {
		w, err = v.ServiceBusyError.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 3, Value: w}
		i++
	}
	if v.LimitExceededError != nil {
		w, err = v.LimitExceededError.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 4, Value: w}
		i++
	}
	if v.DomainNotActiveError != nil {
		w, err = v.DomainNotActiveError.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 5, Value: w}
		i++
	}
	if v.RemoteSyncMatchedError != nil {
		w, err = v.RemoteSyncMatchedError.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 6, Value: w}
		i++
	}
	if v.StickyWorkerUnavailableError != nil {
		w, err = v.StickyWorkerUnavailableError.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 7, Value: w}
		i++
	}
	if v.TaskListNotOwnedByHostError != nil {
		w, err = v.TaskListNotOwnedByHostError.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 8, Value: w}
		i++
	}

	if i > 1 {
		return wire.Value{}, fmt.Errorf("MatchingService_AddDecisionTask_Result should have at most one field: got %v fields", i)
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

func _StickyWorkerUnavailableError_Read(w wire.Value) (*shared.StickyWorkerUnavailableError, error) {
	var v shared.StickyWorkerUnavailableError
	err := v.FromWire(w)
	return &v, err
}

// FromWire deserializes a MatchingService_AddDecisionTask_Result struct from its Thrift-level
// representation. The Thrift-level representation may be obtained
// from a ThriftRW protocol implementation.
//
// An error is returned if we were unable to build a MatchingService_AddDecisionTask_Result struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v MatchingService_AddDecisionTask_Result
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *MatchingService_AddDecisionTask_Result) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 1:
			if field.Value.Type() == wire.TStruct {
				v.BadRequestError, err = _BadRequestError_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 2:
			if field.Value.Type() == wire.TStruct {
				v.InternalServiceError, err = _InternalServiceError_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 3:
			if field.Value.Type() == wire.TStruct {
				v.ServiceBusyError, err = _ServiceBusyError_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 4:
			if field.Value.Type() == wire.TStruct {
				v.LimitExceededError, err = _LimitExceededError_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 5:
			if field.Value.Type() == wire.TStruct {
				v.DomainNotActiveError, err = _DomainNotActiveError_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 6:
			if field.Value.Type() == wire.TStruct {
				v.RemoteSyncMatchedError, err = _RemoteSyncMatchedError_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 7:
			if field.Value.Type() == wire.TStruct {
				v.StickyWorkerUnavailableError, err = _StickyWorkerUnavailableError_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 8:
			if field.Value.Type() == wire.TStruct {
				v.TaskListNotOwnedByHostError, err = _TaskListNotOwnedByHostError_Read(field.Value)
				if err != nil {
					return err
				}

			}
		}
	}

	count := 0
	if v.BadRequestError != nil {
		count++
	}
	if v.InternalServiceError != nil {
		count++
	}
	if v.ServiceBusyError != nil {
		count++
	}
	if v.LimitExceededError != nil {
		count++
	}
	if v.DomainNotActiveError != nil {
		count++
	}
	if v.RemoteSyncMatchedError != nil {
		count++
	}
	if v.StickyWorkerUnavailableError != nil {
		count++
	}
	if v.TaskListNotOwnedByHostError != nil {
		count++
	}
	if count > 1 {
		return fmt.Errorf("MatchingService_AddDecisionTask_Result should have at most one field: got %v fields", count)
	}

	return nil
}

// Encode serializes a MatchingService_AddDecisionTask_Result struct directly into bytes, without going
// through an intermediary type.
//
// An error is returned if a MatchingService_AddDecisionTask_Result struct could not be encoded.
func (v *MatchingService_AddDecisionTask_Result) Encode(sw stream.Writer) error {
	if err := sw.WriteStructBegin(); err != nil {
		return err
	}

	if v.BadRequestError != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 1, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.BadRequestError.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.InternalServiceError != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 2, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.InternalServiceError.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.ServiceBusyError != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 3, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.ServiceBusyError.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.LimitExceededError != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 4, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.LimitExceededError.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.DomainNotActiveError != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 5, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.DomainNotActiveError.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.RemoteSyncMatchedError != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 6, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.RemoteSyncMatchedError.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.StickyWorkerUnavailableError != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 7, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.StickyWorkerUnavailableError.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.TaskListNotOwnedByHostError != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 8, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.TaskListNotOwnedByHostError.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	count := 0
	if v.BadRequestError != nil {
		count++
	}
	if v.InternalServiceError != nil {
		count++
	}
	if v.ServiceBusyError != nil {
		count++
	}
	if v.LimitExceededError != nil {
		count++
	}
	if v.DomainNotActiveError != nil {
		count++
	}
	if v.RemoteSyncMatchedError != nil {
		count++
	}
	if v.StickyWorkerUnavailableError != nil {
		count++
	}
	if v.TaskListNotOwnedByHostError != nil {
		count++
	}

	if count > 1 {
		return fmt.Errorf("MatchingService_AddDecisionTask_Result should have at most one field: got %v fields", count)
	}

	return sw.WriteStructEnd()
}

func _StickyWorkerUnavailableError_Decode(sr stream.Reader) (*shared.StickyWorkerUnavailableError, error) {
	var v shared.StickyWorkerUnavailableError
	err := v.Decode(sr)
	return &v, err
}

// Decode deserializes a MatchingService_AddDecisionTask_Result struct directly from its Thrift-level
// representation, without going through an intemediary type.
//
// An error is returned if a MatchingService_AddDecisionTask_Result struct could not be generated from the wire
// representation.
func (v *MatchingService_AddDecisionTask_Result) Decode(sr stream.Reader) error {

	if err := sr.ReadStructBegin(); err != nil {
		return err
	}

	fh, ok, err := sr.ReadFieldBegin()
	if err != nil {
		return err
	}

	for ok {
		switch {
		case fh.ID == 1 && fh.Type == wire.TStruct:
			v.BadRequestError, err = _BadRequestError_Decode(sr)
			if err != nil {
				return err
			}

		case fh.ID == 2 && fh.Type == wire.TStruct:
			v.InternalServiceError, err = _InternalServiceError_Decode(sr)
			if err != nil {
				return err
			}

		case fh.ID == 3 && fh.Type == wire.TStruct:
			v.ServiceBusyError, err = _ServiceBusyError_Decode(sr)
			if err != nil {
				return err
			}

		case fh.ID == 4 && fh.Type == wire.TStruct:
			v.LimitExceededError, err = _LimitExceededError_Decode(sr)
			if err != nil {
				return err
			}

		case fh.ID == 5 && fh.Type == wire.TStruct:
			v.DomainNotActiveError, err = _DomainNotActiveError_Decode(sr)
			if err != nil {
				return err
			}

		case fh.ID == 6 && fh.Type == wire.TStruct:
			v.RemoteSyncMatchedError, err = _RemoteSyncMatchedError_Decode(sr)
			if err != nil {
				return err
			}

		case fh.ID == 7 && fh.Type == wire.TStruct:
			v.StickyWorkerUnavailableError, err = _StickyWorkerUnavailableError_Decode(sr)
			if err != nil {
				return err
			}

		case fh.ID == 8 && fh.Type == wire.TStruct:
			v.TaskListNotOwnedByHostError, err = _TaskListNotOwnedByHostError_Decode(sr)
			if err != nil {
				return err
			}

		default:
			if err := sr.Skip(fh.Type); err != nil {
				return err
			}
		}

		if err := sr.ReadFieldEnd(); err != nil {
			return err
		}

		if fh, ok, err = sr.ReadFieldBegin(); err != nil {
			return err
		}
	}

	if err := sr.ReadStructEnd(); err != nil {
		return err
	}

	count := 0
	if v.BadRequestError != nil {
		count++
	}
	if v.InternalServiceError != nil {
		count++
	}
	if v.ServiceBusyError != nil {
		count++
	}
	if v.LimitExceededError != nil {
		count++
	}
	if v.DomainNotActiveError != nil {
		count++
	}
	if v.RemoteSyncMatchedError != nil {
		count++
	}
	if v.StickyWorkerUnavailableError != nil {
		count++
	}
	if v.TaskListNotOwnedByHostError != nil {
		count++
	}
	if count > 1 {
		return fmt.Errorf("MatchingService_AddDecisionTask_Result should have at most one field: got %v fields", count)
	}

	return nil
}

// String returns a readable string representation of a MatchingService_AddDecisionTask_Result
// struct.
func (v *MatchingService_AddDecisionTask_Result) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [8]string
	i := 0
	if v.BadRequestError != nil {
		fields[i] = fmt.Sprintf("BadRequestError: %v", v.BadRequestError)
		i++
	}
	if v.InternalServiceError != nil {
		fields[i] = fmt.Sprintf("InternalServiceError: %v", v.InternalServiceError)
		i++
	}
	if v.ServiceBusyError != nil {
		fields[i] = fmt.Sprintf("ServiceBusyError: %v", v.ServiceBusyError)
		i++
	}
	if v.LimitExceededError != nil {
		fields[i] = fmt.Sprintf("LimitExceededError: %v", v.LimitExceededError)
		i++
	}
	if v.DomainNotActiveError != nil {
		fields[i] = fmt.Sprintf("DomainNotActiveError: %v", v.DomainNotActiveError)
		i++
	}
	if v.RemoteSyncMatchedError != nil {
		fields[i] = fmt.Sprintf("RemoteSyncMatchedError: %v", v.RemoteSyncMatchedError)
		i++
	}
	if v.StickyWorkerUnavailableError != nil {
		fields[i] = fmt.Sprintf("StickyWorkerUnavailableError: %v", v.StickyWorkerUnavailableError)
		i++
	}
	if v.TaskListNotOwnedByHostError != nil {
		fields[i] = fmt.Sprintf("TaskListNotOwnedByHostError: %v", v.TaskListNotOwnedByHostError)
		i++
	}

	return fmt.Sprintf("MatchingService_AddDecisionTask_Result{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this MatchingService_AddDecisionTask_Result match the
// provided MatchingService_AddDecisionTask_Result.
//
// This function performs a deep comparison.
func (v *MatchingService_AddDecisionTask_Result) Equals(rhs *MatchingService_AddDecisionTask_Result) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !((v.BadRequestError == nil && rhs.BadRequestError == nil) || (v.BadRequestError != nil && rhs.BadRequestError != nil && v.BadRequestError.Equals(rhs.BadRequestError))) {
		return false
	}
	if !((v.InternalServiceError == nil && rhs.InternalServiceError == nil) || (v.InternalServiceError != nil && rhs.InternalServiceError != nil && v.InternalServiceError.Equals(rhs.InternalServiceError))) {
		return false
	}
	if !((v.ServiceBusyError == nil && rhs.ServiceBusyError == nil) || (v.ServiceBusyError != nil && rhs.ServiceBusyError != nil && v.ServiceBusyError.Equals(rhs.ServiceBusyError))) {
		return false
	}
	if !((v.LimitExceededError == nil && rhs.LimitExceededError == nil) || (v.LimitExceededError != nil && rhs.LimitExceededError != nil && v.LimitExceededError.Equals(rhs.LimitExceededError))) {
		return false
	}
	if !((v.DomainNotActiveError == nil && rhs.DomainNotActiveError == nil) || (v.DomainNotActiveError != nil && rhs.DomainNotActiveError != nil && v.DomainNotActiveError.Equals(rhs.DomainNotActiveError))) {
		return false
	}
	if !((v.RemoteSyncMatchedError == nil && rhs.RemoteSyncMatchedError == nil) || (v.RemoteSyncMatchedError != nil && rhs.RemoteSyncMatchedError != nil && v.RemoteSyncMatchedError.Equals(rhs.RemoteSyncMatchedError))) {
		return false
	}
	if !((v.StickyWorkerUnavailableError == nil && rhs.StickyWorkerUnavailableError == nil) || (v.StickyWorkerUnavailableError != nil && rhs.StickyWorkerUnavailableError != nil && v.StickyWorkerUnavailableError.Equals(rhs.StickyWorkerUnavailableError))) {
		return false
	}
	if !((v.TaskListNotOwnedByHostError == nil && rhs.TaskListNotOwnedByHostError == nil) || (v.TaskListNotOwnedByHostError != nil && rhs.TaskListNotOwnedByHostError != nil && v.TaskListNotOwnedByHostError.Equals(rhs.TaskListNotOwnedByHostError))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of MatchingService_AddDecisionTask_Result.
func (v *MatchingService_AddDecisionTask_Result) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.BadRequestError != nil {
		err = multierr.Append(err, enc.AddObject("badRequestError", v.BadRequestError))
	}
	if v.InternalServiceError != nil {
		err = multierr.Append(err, enc.AddObject("internalServiceError", v.InternalServiceError))
	}
	if v.ServiceBusyError != nil {
		err = multierr.Append(err, enc.AddObject("serviceBusyError", v.ServiceBusyError))
	}
	if v.LimitExceededError != nil {
		err = multierr.Append(err, enc.AddObject("limitExceededError", v.LimitExceededError))
	}
	if v.DomainNotActiveError != nil {
		err = multierr.Append(err, enc.AddObject("domainNotActiveError", v.DomainNotActiveError))
	}
	if v.RemoteSyncMatchedError != nil {
		err = multierr.Append(err, enc.AddObject("remoteSyncMatchedError", v.RemoteSyncMatchedError))
	}
	if v.StickyWorkerUnavailableError != nil {
		err = multierr.Append(err, enc.AddObject("stickyWorkerUnavailableError", v.StickyWorkerUnavailableError))
	}
	if v.TaskListNotOwnedByHostError != nil {
		err = multierr.Append(err, enc.AddObject("taskListNotOwnedByHostError", v.TaskListNotOwnedByHostError))
	}
	return err
}

// GetBadRequestError returns the value of BadRequestError if it is set or its
// zero value if it is unset.
func (v *MatchingService_AddDecisionTask_Result) GetBadRequestError() (o *shared.BadRequestError) {
	if v != nil && v.BadRequestError != nil {
		return v.BadRequestError
	}

	return
}

// IsSetBadRequestError returns true if BadRequestError is not nil.
func (v *MatchingService_AddDecisionTask_Result) IsSetBadRequestError() bool {
	return v != nil && v.BadRequestError != nil
}

// GetInternalServiceError returns the value of InternalServiceError if it is set or its
// zero value if it is unset.
func (v *MatchingService_AddDecisionTask_Result) GetInternalServiceError() (o *shared.InternalServiceError) {
	if v != nil && v.InternalServiceError != nil {
		return v.InternalServiceError
	}

	return
}

// IsSetInternalServiceError returns true if InternalServiceError is not nil.
func (v *MatchingService_AddDecisionTask_Result) IsSetInternalServiceError() bool {
	return v != nil && v.InternalServiceError != nil
}

// GetServiceBusyError returns the value of ServiceBusyError if it is set or its
// zero value if it is unset.
func (v *MatchingService_AddDecisionTask_Result) GetServiceBusyError() (o *shared.ServiceBusyError) {
	if v != nil && v.ServiceBusyError != nil {
		return v.ServiceBusyError
	}

	return
}

// IsSetServiceBusyError returns true if ServiceBusyError is not nil.
func (v *MatchingService_AddDecisionTask_Result) IsSetServiceBusyError() bool {
	return v != nil && v.ServiceBusyError != nil
}

// GetLimitExceededError returns the value of LimitExceededError if it is set or its
// zero value if it is unset.
func (v *MatchingService_AddDecisionTask_Result) GetLimitExceededError() (o *shared.LimitExceededError) {
	if v != nil && v.LimitExceededError != nil {
		return v.LimitExceededError
	}

	return
}

// IsSetLimitExceededError returns true if LimitExceededError is not nil.
func (v *MatchingService_AddDecisionTask_Result) IsSetLimitExceededError() bool {
	return v != nil && v.LimitExceededError != nil
}

// GetDomainNotActiveError returns the value of DomainNotActiveError if it is set or its
// zero value if it is unset.
func (v *MatchingService_AddDecisionTask_Result) GetDomainNotActiveError() (o *shared.DomainNotActiveError) {
	if v != nil && v.DomainNotActiveError != nil {
		return v.DomainNotActiveError
	}

	return
}

// IsSetDomainNotActiveError returns true if DomainNotActiveError is not nil.
func (v *MatchingService_AddDecisionTask_Result) IsSetDomainNotActiveError() bool {
	return v != nil && v.DomainNotActiveError != nil
}

// GetRemoteSyncMatchedError returns the value of RemoteSyncMatchedError if it is set or its
// zero value if it is unset.
func (v *MatchingService_AddDecisionTask_Result) GetRemoteSyncMatchedError() (o *shared.RemoteSyncMatchedError) {
	if v != nil && v.RemoteSyncMatchedError != nil {
		return v.RemoteSyncMatchedError
	}

	return
}

// IsSetRemoteSyncMatchedError returns true if RemoteSyncMatchedError is not nil.
func (v *MatchingService_AddDecisionTask_Result) IsSetRemoteSyncMatchedError() bool {
	return v != nil && v.RemoteSyncMatchedError != nil
}

// GetStickyWorkerUnavailableError returns the value of StickyWorkerUnavailableError if it is set or its
// zero value if it is unset.
func (v *MatchingService_AddDecisionTask_Result) GetStickyWorkerUnavailableError() (o *shared.StickyWorkerUnavailableError) {
	if v != nil && v.StickyWorkerUnavailableError != nil {
		return v.StickyWorkerUnavailableError
	}

	return
}

// IsSetStickyWorkerUnavailableError returns true if StickyWorkerUnavailableError is not nil.
func (v *MatchingService_AddDecisionTask_Result) IsSetStickyWorkerUnavailableError() bool {
	return v != nil && v.StickyWorkerUnavailableError != nil
}

// GetTaskListNotOwnedByHostError returns the value of TaskListNotOwnedByHostError if it is set or its
// zero value if it is unset.
func (v *MatchingService_AddDecisionTask_Result) GetTaskListNotOwnedByHostError() (o *shared.TaskListNotOwnedByHostError) {
	if v != nil && v.TaskListNotOwnedByHostError != nil {
		return v.TaskListNotOwnedByHostError
	}

	return
}

// IsSetTaskListNotOwnedByHostError returns true if TaskListNotOwnedByHostError is not nil.
func (v *MatchingService_AddDecisionTask_Result) IsSetTaskListNotOwnedByHostError() bool {
	return v != nil && v.TaskListNotOwnedByHostError != nil
}

// MethodName returns the name of the Thrift function as specified in
// the IDL, for which this struct represent the result.
//
// This will always be "AddDecisionTask" for this struct.
func (v *MatchingService_AddDecisionTask_Result) MethodName() string {
	return "AddDecisionTask"
}

// EnvelopeType returns the kind of value inside this struct.
//
// This will always be Reply for this struct.
func (v *MatchingService_AddDecisionTask_Result) EnvelopeType() wire.EnvelopeType {
	return wire.Reply
}

// MatchingService_CancelOutstandingPoll_Args represents the arguments for the MatchingService.CancelOutstandingPoll function.
//
// The arguments for CancelOutstandingPoll are sent and received over the wire as this struct.
type MatchingService_CancelOutstandingPoll_Args struct {
	Request *CancelOutstandingPollRequest `json:"request,omitempty"`
}

// ToWire translates a MatchingService_CancelOutstandingPoll_Args struct into a Thrift-level intermediate
// representation. This intermediate representation may be serialized
// into bytes using a ThriftRW protocol implementation.
//
// An error is returned if the struct or any of its fields failed to
// validate.
//
//	x, err := v.ToWire()
//	if err != nil {
//	  return err
//	}
//
//	if err := binaryProtocol.Encode(x, writer); err != nil {
//	  return err
//	}
func (v *MatchingService_CancelOutstandingPoll_Args) ToWire() (wire.Value, error) {
	var (
		fields [1]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.Request != nil {
		w, err = v.Request.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 1, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

func _CancelOutstandingPollRequest_Read(w wire.Value) (*CancelOutstandingPollRequest, error) {
	var v CancelOutstandingPollRequest
	err := v.FromWire(w)
	return &v, err
}

// FromWire deserializes a MatchingService_CancelOutstandingPoll_Args struct from its Thrift-level
// representation. The Thrift-level representation may be obtained
// from a ThriftRW protocol implementation.
//
// An error is returned if we were unable to build a MatchingService_CancelOutstandingPoll_Args struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v MatchingService_CancelOutstandingPoll_Args
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *MatchingService_CancelOutstandingPoll_Args) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 1:
			if field.Value.Type() == wire.TStruct {
				v.Request, err = _CancelOutstandingPollRequest_Read(field.Value)
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// Encode serializes a MatchingService_CancelOutstandingPoll_Args struct directly into bytes, without going
// through an intermediary type.
//
// An error is returned if a MatchingService_CancelOutstandingPoll_Args struct could not be encoded.
func (v *MatchingService_CancelOutstandingPoll_Args) Encode(sw stream.Writer) error {
	if err := sw.WriteStructBegin(); err != nil {
		return err
	}

	if v.Request != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 1, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.Request.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	return sw.WriteStructEnd()
}

func _CancelOutstandingPollRequest_Decode(sr stream.Reader) (*CancelOutstandingPollRequest, error) {
	var v CancelOutstandingPollRequest
	err := v.Decode(sr)
	return &v, err
}

// Decode deserializes a MatchingService_CancelOutstandingPoll_Args struct directly from its Thrift-level
// representation, without going through an intemediary type.
//
// An error is returned if a MatchingService_CancelOutstandingPoll_Args struct could not be generated from the wire
// representation.
func (v *MatchingService_CancelOutstandingPoll_Args) Decode(sr stream.Reader) error {

	if err := sr.ReadStructBegin(); err != nil {
		return err
	}

	fh, ok, err := sr.ReadFieldBegin()
	if err != nil {
		return err
	}

	for ok {
		switch {
		case fh.ID == 1 && fh.Type == wire.TStruct:
			v.Request, err = _CancelOutstandingPollRequest_Decode(sr)
			if err != nil {
				return err
			}

		default:
			if err := sr.Skip(fh.Type); err != nil {
				return err
			}
		}

		if err := sr.ReadFieldEnd(); err != nil {
			return err
		}

		if fh, ok, err = sr.ReadFieldBegin(); err != nil {
			return err
		}
	}

	if err := sr.ReadStructEnd(); err != nil {
		return err
	}

	return nil
}

// String returns a readable string representation of a MatchingService_CancelOutstandingPoll_Args
// struct.
func (v *MatchingService_CancelOutstandingPoll_Args) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [1]string
	i := 0
	if v.Request != nil {
		fields[i] = fmt.Sprintf("Request: %v", v.Request)
		i++
	}

	return fmt.Sprintf("MatchingService_CancelOutstandingPoll_Args{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this MatchingService_CancelOutstandingPoll_Args match the
// provided MatchingService_CancelOutstandingPoll_Args.
//
// This function performs a deep comparison.
func (v *MatchingService_CancelOutstandingPoll_Args) Equals(rhs *MatchingService_CancelOutstandingPoll_Args) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !((v.Request == nil && rhs.Request == nil) || (v.Request != nil && rhs.Request != nil && v.Request.Equals(rhs.Request))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of MatchingService_CancelOutstandingPoll_Args.
func (v *MatchingService_CancelOutstandingPoll_Args) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Request != nil {
		err = multierr.Append(err, enc.AddObject("request", v.Request))
	}
	return err
}

// GetRequest returns the value of Request if it is set or its
// zero value if it is unset.
func (v *MatchingService_CancelOutstandingPoll_Args) GetRequest() (o *CancelOutstandingPollRequest) {
	if v != nil && v.Request != nil {
		return v.Request
	}

	return
}

// IsSetRequest returns true if Request is not nil.
func (v *MatchingService_CancelOutstandingPoll_Args) IsSetRequest() bool {
	return v != nil && v.Request != nil
}

// MethodName returns the name of the Thrift function as specified in
// the IDL, for which this struct represent the arguments.
//
// This will always be "CancelOutstandingPoll" for this struct.
func (v *MatchingService_CancelOutstandingPoll_Args) MethodName() string {
	return "CancelOutstandingPoll"
}

// EnvelopeType returns the kind of value inside this struct.
//
// This will always be Call for this struct.
func (v *MatchingService_CancelOutstandingPoll_Args) EnvelopeType() wire.EnvelopeType {
	return wire.Call
}

// MatchingService_CancelOutstandingPoll_Helper provides functions that aid in handling the
// parameters and return values of the MatchingService.CancelOutstandingPoll
// function.
var MatchingService_CancelOutstandingPoll_Helper = struct {
	// Args accepts the parameters of CancelOutstandingPoll in-order and returns
	// the arguments struct for the function.
	Args func(
		request *CancelOutstandingPollRequest,
	) *MatchingService_CancelOutstandingPoll_Args

	// IsException returns true if the given error can be thrown
	// by CancelOutstandingPoll.
	//
	// An error can be thrown by CancelOutstandingPoll only if the
	// corresponding exception type was mentioned in the 'throws'
	// section for it in the Thrift file.
	IsException func(error) bool

	// WrapResponse returns the result struct for CancelOutstandingPoll
	// given the error returned by it. The provided error may
	// be nil if CancelOutstandingPoll did not fail.
	//
	// This allows mapping errors returned by CancelOutstandingPoll into a
	// serializable result struct. WrapResponse returns a
	// non-nil error if the provided error cannot be thrown by
	// CancelOutstandingPoll
	//
	//   err := CancelOutstandingPoll(args)
	//   result, err := MatchingService_CancelOutstandingPoll_Helper.WrapResponse(err)
	//   if err != nil {
	//     return fmt.Errorf("unexpected error from CancelOutstandingPoll: %v", err)
	//   }
	//   serialize(result)
	WrapResponse func(error) (*MatchingService_CancelOutstandingPoll_Result, error)

	// UnwrapResponse takes the result struct for CancelOutstandingPoll
	// and returns the erorr returned by it (if any).
	//
	// The error is non-nil only if CancelOutstandingPoll threw an
	// exception.
	//
	//   result := deserialize(bytes)
	//   err := MatchingService_CancelOutstandingPoll_Helper.UnwrapResponse(result)
	UnwrapResponse func(*MatchingService_CancelOutstandingPoll_Result) error
}{}

func init() {
	MatchingService_CancelOutstandingPoll_Helper.Args = func(
		request *CancelOutstandingPollRequest,
	) *MatchingService_CancelOutstandingPoll_Args {
		return &MatchingService_CancelOutstandingPoll_Args{
			Request: request,
		}
	}

	MatchingService_CancelOutstandingPoll_Helper.IsException = func(err error) bool {
		switch err.(type) {
		case *shared.BadRequestError:
			return true
		case *shared.InternalServiceError:
			return true
		case *shared.ServiceBusyError:
			return true
		case *shared.TaskListNotOwnedByHostError:
			return true
		default:
			return false
		}
	}

	MatchingService_CancelOutstandingPoll_Helper.WrapResponse = func(err error) (*MatchingService_CancelOutstandingPoll_Result, error) {
		if err == nil {
			return &MatchingService_CancelOutstandingPoll_Result{}, nil
		}

		switch e := err.(type) {
		case *shared.BadRequestError:
			if e == nil {
				return nil, errors.New("WrapResponse received non-nil error type with nil value for MatchingService_CancelOutstandingPoll_Result.BadRequestError")
			}
			return &MatchingService_CancelOutstandingPoll_Result{BadRequestError: e}, nil
		case *shared.InternalServiceError:
			if e == nil {
				return nil, errors.New("WrapResponse received non-nil error type with nil value for MatchingService_CancelOutstandingPoll_Result.InternalServiceError")
			}
			return &MatchingService_CancelOutstandingPoll_Result{InternalServiceError: e}, nil
		case *shared.ServiceBusyError:
			if e == nil {
				return nil, errors.New("WrapResponse received non-nil error type with nil value for MatchingService_CancelOutstandingPoll_Result.ServiceBusyError")
			}
			return &MatchingService_CancelOutstandingPoll_Result{ServiceBusyError: e}, nil
		case *shared.TaskListNotOwnedByHostError:
			if e == nil {
				return nil, errors.New("WrapResponse received non-nil error type with nil value for MatchingService_CancelOutstandingPoll_Result.TaskListNotOwnedByHostError")
			}
			return &MatchingService_CancelOutstandingPoll_Result{TaskListNotOwnedByHostError: e}, nil
		}

		return nil, err
	}
	MatchingService_CancelOutstandingPoll_Helper.UnwrapResponse = func(result *MatchingService_CancelOutstandingPoll_Result) (err error) {
		if result.BadRequestError != nil {
			err = result.BadRequestError
			return
		}
		if result.InternalServiceError != nil {
			err = result.InternalServiceError
			return
		}
		if result.ServiceBusyError != nil {
			err = result.ServiceBusyError
			return
		}
		if result.TaskListNotOwnedByHostError != nil {
			err = result.TaskListNotOwnedByHostError
			return
		}
		return
	}

}

// MatchingService_CancelOutstandingPoll_Result represents the result of a MatchingService.CancelOutstandingPoll function call.
//
// The result of a CancelOutstandingPoll execution is sent and received over the wire as this struct.
type MatchingService_CancelOutstandingPoll_Result struct {
	BadRequestError             *shared.BadRequestError             `json:"badRequestError,omitempty"`
	InternalServiceError        *shared.InternalServiceError        `json:"internalServiceError,omitempty"`
	ServiceBusyError            *shared.ServiceBusyError            `json:"serviceBusyError,omitempty"`
	TaskListNotOwnedByHostError *shared.TaskListNotOwnedByHostError `json:"taskListNotOwnedByHostError,omitempty"`
}

// ToWire translates a MatchingService_CancelOutstandingPoll_Result struct into a Thrift-level intermediate
// representation. This intermediate representation may be serialized
// into bytes using a ThriftRW protocol implementation.
//
// An error is returned if the struct or any of its fields failed to
// validate.
//
//	x, err := v.ToWire()
//	if err != nil {
//	  return err
//	}
//
//	if err := binaryProtocol.Encode(x, writer); err != nil {
//	  return err
//	}
func (v *MatchingService_CancelOutstandingPoll_Result) ToWire() (wire.Value, error) {
	var (
		fields [4]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.BadRequestError != nil {
		w, err = v.BadRequestError.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 1, Value: w}
		i++
	}
	if v.InternalServiceError != nil {
		w, err = v.InternalServiceError.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 2, Value: w}
		i++
	}
	if v.ServiceBusyError != nil {
		w, err = v.ServiceBusyError.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 3, Value: w}
		i++
	}
	if v.TaskListNotOwnedByHostError != nil {
		w, err = v.TaskListNotOwnedByHostError.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 4, Value: w}
		i++
	}

	if i > 1 {
		return wire.Value{}, fmt.Errorf("MatchingService_CancelOutstandingPoll_Result should have at most one field: got %v fields", i)
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

// FromWire deserializes a MatchingService_CancelOutstandingPoll_Result struct from its Thrift-level
// representation. The Thrift-level representation may be obtained
// from a ThriftRW protocol implementation.
//
// An error is returned if we were unable to build a MatchingService_CancelOutstandingPoll_Result struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v MatchingService_CancelOutstandingPoll_Result
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *MatchingService_CancelOutstandingPoll_Result) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 1:
			if field.Value.Type() == wire.TStruct {
				v.BadRequestError, err = _BadRequestError_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 2:
			if field.Value.Type() == wire.TStruct {
				v.InternalServiceError, err = _InternalServiceError_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 3:
			if field.Value.Type() == wire.TStruct {
				v.ServiceBusyError, err = _ServiceBusyError_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 4:
			if field.Value.Type() == wire.TStruct {
				v.TaskListNotOwnedByHostError, err = _TaskListNotOwnedByHostError_Read(field.Value)
				if err != nil {
					return err
				}

			}
		}
	}

	count := 0
	if v.BadRequestError != nil {
		count++
	}
	if v.InternalServiceError != nil {
		count++
	}
	if v.ServiceBusyError != nil {
		count++
	}
	if v.TaskListNotOwnedByHostError != nil {
		count++
	}
	if count > 1 {
		return fmt.Errorf("MatchingService_CancelOutstandingPoll_Result should have at most one field: got %v fields", count)
	}

	return nil
}

// Encode serializes a MatchingService_CancelOutstandingPoll_Result struct directly into bytes, without going
// through an intermediary type.
//
// An error is returned if a MatchingService_CancelOutstandingPoll_Result struct could not be encoded.
func (v *MatchingService_CancelOutstandingPoll_Result) Encode(sw stream.Writer) error {
	if err := sw.WriteStructBegin(); err != nil {
		return err
	}

	if v.BadRequestError != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 1, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.BadRequestError.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.InternalServiceError != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 2, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.InternalServiceError.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.ServiceBusyError != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 3, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.ServiceBusyError.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.TaskListNotOwnedByHostError != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 4, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.TaskListNotOwnedByHostError.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	count := 0
	if v.BadRequestError != nil {
		count++
	}
	if v.InternalServiceError != nil {
		count++
	}
	if v.ServiceBusyError != nil {
		count++
	}
	if v.TaskListNotOwnedByHostError != nil {
		count++
	}

	if count > 1 {
		return fmt.Errorf("MatchingService_CancelOutstandingPoll_Result should have at most one field: got %v fields", count)
	}

	return sw.WriteStructEnd()
}

// Decode deserializes a MatchingService_CancelOutstandingPoll_Result struct directly from its Thrift-level
// representation, without going through an intemediary type.
//
// An error is returned if a MatchingService_CancelOutstandingPoll_Result struct could not be generated from the wire
// representation.
func (v *MatchingService_CancelOutstandingPoll_Result) Decode(sr stream.Reader) error {

	if err := sr.ReadStructBegin(); err != nil {
		return err
	}

	fh, ok, err := sr.ReadFieldBegin()
	if err != nil {
		return err
	}

	for ok {
		switch {
		case fh.ID == 1 && fh.Type == wire.TStruct:
			v.BadRequestError, err = _BadRequestError_Decode(sr)
			if err != nil {
				return err
			}

		case fh.ID == 2 && fh.Type == wire.TStruct:
			v.InternalServiceError, err = _InternalServiceError_Decode(sr)
			if err != nil {
				return err
			}

		case fh.ID == 3 && fh.Type == wire.TStruct:
			v.ServiceBusyError, err = _ServiceBusyError_Decode(sr)
			if err != nil {
				return err
			}

		case fh.ID == 4 && fh.Type == wire.TStruct:
			v.TaskListNotOwnedByHostError, err = _TaskListNotOwnedByHostError_Decode(sr)
			if err != nil {
				return err
			}

		default:
			if err := sr.Skip(fh.Type); err != nil {
				return err
			}
		}

		if err := sr.ReadFieldEnd(); err != nil {
			return err
		}

		if fh, ok, err = sr.ReadFieldBegin(); err != nil {
			return err
		}
	}

	if err := sr.ReadStructEnd(); err != nil {
		return err
	}

	count := 0
	if v.BadRequestError != nil {
		count++
	}
	if v.InternalServiceError != nil {
		count++
	}
	if v.ServiceBusyError != nil {
		count++
	}
	if v.TaskListNotOwnedByHostError != nil {
		count++
	}
	if count > 1 {
		return fmt.Errorf("MatchingService_CancelOutstandingPoll_Result should have at most one field: got %v fields", count)
	}

	return nil
}

// String returns a readable string representation of a MatchingService_CancelOutstandingPoll_Result
// struct.
func (v *MatchingService_CancelOutstandingPoll_Result) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [4]string
	i := 0
	if v.BadRequestError != nil {
		fields[i] = fmt.Sprintf("BadRequestError: %v", v.BadRequestError)
		i++
	}
	if v.InternalServiceError != nil {
		fields[i] = fmt.Sprintf("InternalServiceError: %v", v.InternalServiceError)
		i++
	}
	if v.ServiceBusyError != nil {
		fields[i] = fmt.Sprintf("ServiceBusyError: %v", v.ServiceBusyError)
		i++
	}
	if v.TaskListNotOwnedByHostError != nil {
		fields[i] = fmt.Sprintf("TaskListNotOwnedByHostError: %v", v.TaskListNotOwnedByHostError)
		i++
	}

	return fmt.Sprintf("MatchingService_CancelOutstandingPoll_Result{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this MatchingService_CancelOutstandingPoll_Result match the
// provided MatchingService_CancelOutstandingPoll_Result.
//
// This function performs a deep comparison.
func (v *MatchingService_CancelOutstandingPoll_Result) Equals(rhs *MatchingService_CancelOutstandingPoll_Result) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !((v.BadRequestError == nil && rhs.BadRequestError == nil) || (v.BadRequestError != nil && rhs.BadRequestError != nil && v.BadRequestError.Equals(rhs.BadRequestError))) {
		return false
	}
	if !((v.InternalServiceError == nil && rhs.InternalServiceError == nil) || (v.InternalServiceError != nil && rhs.InternalServiceError != nil && v.InternalServiceError.Equals(rhs.InternalServiceError))) {
		return false
	}
	if !((v.ServiceBusyError == nil && rhs.ServiceBusyError == nil) || (v.ServiceBusyError != nil && rhs.ServiceBusyError != nil && v.ServiceBusyError.Equals(rhs.ServiceBusyError))) {
		return false
	}
	if !((v.TaskListNotOwnedByHostError == nil && rhs.TaskListNotOwnedByHostError == nil) || (v.TaskListNotOwnedByHostError != nil && rhs.TaskListNotOwnedByHostError != nil && v.TaskListNotOwnedByHostError.Equals(rhs.TaskListNotOwnedByHostError))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of MatchingService_CancelOutstandingPoll_Result.
func (v *MatchingService_CancelOutstandingPoll_Result) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.BadRequestError != nil {
		err = multierr.Append(err, enc.AddObject("badRequestError", v.BadRequestError))
	}
	if v.InternalServiceError != nil {
		err = multierr.Append(err, enc.AddObject("internalServiceError", v.InternalServiceError))
	}
	if v.ServiceBusyError != nil {
		err = multierr.Append(err, enc.AddObject("serviceBusyError", v.ServiceBusyError))
	}
	if v.TaskListNotOwnedByHostError != nil {
		err = multierr.Append(err, enc.AddObject("taskListNotOwnedByHostError", v.TaskListNotOwnedByHostError))
	}
	return err
}

// GetBadRequestError returns the value of BadRequestError if it is set or its
// zero value if it is unset.
func (v *MatchingService_CancelOutstandingPoll_Result) GetBadRequestError() (o *shared.BadRequestError) {
	if v != nil && v.BadRequestError != nil {
		return v.BadRequestError
	}

	return
}

// IsSetBadRequestError returns true if BadRequestError is not nil.
func (v *MatchingService_CancelOutstandingPoll_Result) IsSetBadRequestError() bool {
	return v != nil && v.BadRequestError != nil
}

// GetInternalServiceError returns the value of InternalServiceError if it is set or its
// zero value if it is unset.
func (v *MatchingService_CancelOutstandingPoll_Result) GetInternalServiceError() (o *shared.InternalServiceError) {
	if v != nil && v.InternalServiceError != nil {
		return v.InternalServiceError
	}

	return
}

// IsSetInternalServiceError returns true if InternalServiceError is not nil.
func (v *MatchingService_CancelOutstandingPoll_Result) IsSetInternalServiceError() bool {
	return v != nil && v.InternalServiceError != nil
}

// GetServiceBusyError returns the value of ServiceBusyError if it is set or its
// zero value if it is unset.
func (v *MatchingService_CancelOutstandingPoll_Result) GetServiceBusyError() (o *shared.ServiceBusyError) {
	if v != nil && v.ServiceBusyError != nil {
		return v.ServiceBusyError
	}

	return
}

// IsSetServiceBusyError returns true if ServiceBusyError is not nil.
func (v *MatchingService_CancelOutstandingPoll_Result) IsSetServiceBusyError() bool {
	return v != nil && v.ServiceBusyError != nil
}

// GetTaskListNotOwnedByHostError returns the value of TaskListNotOwnedByHostError if it is set or its
// zero value if it is unset.
func (v *MatchingService_CancelOutstandingPoll_Result) GetTaskListNotOwnedByHostError() (o *shared.TaskListNotOwnedByHostError) {
	if v != nil && v.TaskListNotOwnedByHostError != nil {
		return v.TaskListNotOwnedByHostError
	}

	return
}

// IsSetTaskListNotOwnedByHostError returns true if TaskListNotOwnedByHostError is not nil.
func (v *MatchingService_CancelOutstandingPoll_Result) IsSetTaskListNotOwnedByHostError() bool {
	return v != nil && v.TaskListNotOwnedByHostError != nil
}

// MethodName returns the name of the Thrift function as specified in
// the IDL, for which this struct represent the result.
//
// This will always be "CancelOutstandingPoll" for this struct.
func (v *MatchingService_CancelOutstandingPoll_Result) MethodName() string {
	return "CancelOutstandingPoll"
}

// EnvelopeType returns the kind of value inside this struct.
//
// This will always be Reply for this struct.
func (v *MatchingService_CancelOutstandingPoll_Result) EnvelopeType() wire.EnvelopeType {
	return wire.Reply
}

// MatchingService_DescribeTaskList_Args represents the arguments for the MatchingService.DescribeTaskList function.
//
// The arguments for DescribeTaskList are sent and received over the wire as this struct.
type MatchingService_DescribeTaskList_Args struct {
	Request *DescribeTaskListRequest `json:"request,omitempty"`
}

// ToWire translates a MatchingService_DescribeTaskList_Args struct into a Thrift-level intermediate
// representation. This intermediate representation may be serialized
// into bytes using a ThriftRW protocol implementation.
//
// An error is returned if the struct or any of its fields failed to
// validate.
//
//	x, err := v.ToWire()
//	if err != nil {
//	  return err
//	}
//
//	if err := binaryProtocol.Encode(x, writer); err != nil {
//	  return err
//	}
func (v *MatchingService_DescribeTaskList_Args) ToWire() (wire.Value, error) {
	var (
		fields [1]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.Request != nil {
		w, err = v.Request.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 1, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

func _DescribeTaskListRequest_1_Read(w wire.Value) (*DescribeTaskListRequest, error) {
	var v DescribeTaskListRequest
	err := v.FromWire(w)
	return &v, err
}

// FromWire deserializes a MatchingService_DescribeTaskList_Args struct from its Thrift-level
// representation. The Thrift-level representation may be obtained
// from a ThriftRW protocol implementation.
//
// An error is returned if we were unable to build a MatchingService_DescribeTaskList_Args struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v MatchingService_DescribeTaskList_Args
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *MatchingService_DescribeTaskList_Args) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 1:
			if field.Value.Type() == wire.TStruct {
				v.Request, err = _DescribeTaskListRequest_1_Read(field.Value)
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// Encode serializes a MatchingService_DescribeTaskList_Args struct directly into bytes, without going
// through an intermediary type.
//
// An error is returned if a MatchingService_DescribeTaskList_Args struct could not be encoded.
func (v *MatchingService_DescribeTaskList_Args) Encode(sw stream.Writer) error {
	if err := sw.WriteStructBegin(); err != nil {
		return err
	}

	if v.Request != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 1, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.Request.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	return sw.WriteStructEnd()
}

func _DescribeTaskListRequest_1_Decode(sr stream.Reader) (*DescribeTaskListRequest, error) {
	var v DescribeTaskListRequest
	err := v.Decode(sr)
	return &v, err
}

// Decode deserializes a MatchingService_DescribeTaskList_Args struct directly from its Thrift-level
// representation, without going through an intemediary type.
//
// An error is returned if a MatchingService_DescribeTaskList_Args struct could not be generated from the wire
// representation.
func (v *MatchingService_DescribeTaskList_Args) Decode(sr stream.Reader) error {

	if err := sr.ReadStructBegin(); err != nil {
		return err
	}

	fh, ok, err := sr.ReadFieldBegin()
	if err != nil {
		return err
	}

	for ok {
		switch {
		case fh.ID == 1 && fh.Type == wire.TStruct:
			v.Request, err = _DescribeTaskListRequest_1_Decode(sr)
			if err != nil {
				return err
			}

		default:
			if err := sr.Skip(fh.Type); err != nil {
				return err
			}
		}

		if err := sr.ReadFieldEnd(); err != nil {
			return err
		}

		if fh, ok, err = sr.ReadFieldBegin(); err != nil {
			return err
		}
	}

	if err := sr.ReadStructEnd(); err != nil {
		return err
	}

	return nil
}

// String returns a readable string representation of a MatchingService_DescribeTaskList_Args
// struct.
func (v *MatchingService_DescribeTaskList_Args) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [1]string
	i := 0
	if v.Request != nil {
		fields[i] = fmt.Sprintf("Request: %v", v.Request)
		i++
	}

	return fmt.Sprintf("MatchingService_DescribeTaskList_Args{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this MatchingService_DescribeTaskList_Args match the
// provided MatchingService_DescribeTaskList_Args.
//
// This function performs a deep comparison.
func (v *MatchingService_DescribeTaskList_Args) Equals(rhs *MatchingService_DescribeTaskList_Args) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !((v.Request == nil && rhs.Request == nil) || (v.Request != nil && rhs.Request != nil && v.Request.Equals(rhs.Request))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of MatchingService_DescribeTaskList_Args.
func (v *MatchingService_DescribeTaskList_Args) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Request != nil {
		err = multierr.Append(err, enc.AddObject("request", v.Request))
	}
	return err
}

// GetRequest returns the value of Request if it is set or its
// zero value if it is unset.
func (v *MatchingService_DescribeTaskList_Args) GetRequest() (o *DescribeTaskListRequest) {
	if v != nil && v.Request != nil {
		return v.Request
	}

	return
}

// IsSetRequest returns true if Request is not nil.
func (v *MatchingService_DescribeTaskList_Args) IsSetRequest() bool {
	return v != nil && v.Request != nil
}

// MethodName returns the name of the Thrift function as specified in
// the IDL, for which this struct represent the arguments.
//
// This will always be "DescribeTaskList" for this struct.
func (v *MatchingService_DescribeTaskList_Args) MethodName() string {
	return "DescribeTaskList"
}

// EnvelopeType returns the kind of value inside this struct.
//
// This will always be Call for this struct.
func (v *MatchingService_DescribeTaskList_Args) EnvelopeType() wire.EnvelopeType {
	return wire.Call
}

// MatchingService_DescribeTaskList_Helper provides functions that aid in handling the
// parameters and return values of the MatchingService.DescribeTaskList
// function.
var MatchingService_DescribeTaskList_Helper = struct {
	// Args accepts the parameters of DescribeTaskList in-order and returns
	// the arguments struct for the function.
	Args func(
		request *DescribeTaskListRequest,
	) *MatchingService_DescribeTaskList_Args

	// IsException returns true if the given error can be thrown
	// by DescribeTaskList.
	//
	// An error can be thrown by DescribeTaskList only if the
	// corresponding exception type was mentioned in the 'throws'
	// section for it in the Thrift file.
	IsException func(error) bool

	// WrapResponse returns the result struct for DescribeTaskList
	// given its return value and error.
	//
	// This allows mapping values and errors returned by
	// DescribeTaskList into a serializable result struct.
	// WrapResponse returns a non-nil error if the provided
	// error cannot be thrown by DescribeTaskList
	//
	//   value, err := DescribeTaskList(args)
	//   result, err := MatchingService_DescribeTaskList_Helper.WrapResponse(value, err)
	//   if err != nil {
	//     return fmt.Errorf("unexpected error from DescribeTaskList: %v", err)
	//   }
	//   serialize(result)
	WrapResponse func(*shared.DescribeTaskListResponse, error) (*MatchingService_DescribeTaskList_Result, error)

	// UnwrapResponse takes the result struct for DescribeTaskList
	// and returns the value or error returned by it.
	//
	// The error is non-nil only if DescribeTaskList threw an
	// exception.
	//
	//   result := deserialize(bytes)
	//   value, err := MatchingService_DescribeTaskList_Helper.UnwrapResponse(result)
	UnwrapResponse func(*MatchingService_DescribeTaskList_Result) (*shared.DescribeTaskListResponse, error)
}{}

func init() {
	MatchingService_DescribeTaskList_Helper.Args = func(
		request *DescribeTaskListRequest,
	) *MatchingService_DescribeTaskList_Args {
		return &MatchingService_DescribeTaskList_Args{
			Request: request,
		}
	}

	MatchingService_DescribeTaskList_Helper.IsException = func(err error) bool {
		switch err.(type) {
		case *shared.BadRequestError:
			return true
		case *shared.InternalServiceError:
			return true
		case *shared.EntityNotExistsError:
			return true
		case *shared.ServiceBusyError:
			return true
		case *shared.TaskListNotOwnedByHostError:
			return true
		default:
			return false
		}
	}

	MatchingService_DescribeTaskList_Helper.WrapResponse = func(success *shared.DescribeTaskListResponse, err error) (*MatchingService_DescribeTaskList_Result, error) {
		if err == nil {
			return &MatchingService_DescribeTaskList_Result{Success: success}, nil
		}

		switch e := err.(type) {
		case *shared.BadRequestError:
			if e == nil {
				return nil, errors.New("WrapResponse received non-nil error type with nil value for MatchingService_DescribeTaskList_Result.BadRequestError")
			}
			return &MatchingService_DescribeTaskList_Result{BadRequestError: e}, nil
		case *shared.InternalServiceError:
			if e == nil {
				return nil, errors.New("WrapResponse received non-nil error type with nil value for MatchingService_DescribeTaskList_Result.InternalServiceError")
			}
			return &MatchingService_DescribeTaskList_Result{InternalServiceError: e}, nil
		case *shared.EntityNotExistsError:
			if e == nil {
				return nil, errors.New("WrapResponse received non-nil error type with nil value for MatchingService_DescribeTaskList_Result.EntityNotExistError")
			}
			return &MatchingService_DescribeTaskList_Result{EntityNotExistError: e}, nil
		case *shared.ServiceBusyError:
			if e == nil {
				return nil, errors.New("WrapResponse received non-nil error type with nil value for MatchingService_DescribeTaskList_Result.ServiceBusyError")
			}
			return &MatchingService_DescribeTaskList_Result{ServiceBusyError: e}, nil
		case *shared.TaskListNotOwnedByHostError:
			if e == nil {
				return nil, errors.New("WrapResponse received non-nil error type with nil value for MatchingService_DescribeTaskList_Result.TaskListNotOwnedByHostError")
			}
			return &MatchingService_DescribeTaskList_Result{TaskListNotOwnedByHostError: e}, nil
		}

		return nil, err
	}
	MatchingService_DescribeTaskList_Helper.UnwrapResponse = func(result *MatchingService_DescribeTaskList_Result) (success *shared.DescribeTaskListResponse, err error) {
		if result.BadRequestError != nil {
			err = result.BadRequestError
			return
		}
		if result.InternalServiceError != nil {
			err = result.InternalServiceError
			return
		}
		if result.EntityNotExistError != nil {
			err = result.EntityNotExistError
			return
		}
		if result.ServiceBusyError != nil {
			err = result.ServiceBusyError
			return
		}
		if result.TaskListNotOwnedByHostError != nil {
			err = result.TaskListNotOwnedByHostError
			return
		}

		if result.Success != nil {
			success = result.Success
			return
		}

		err = errors.New("expected a non-void result")
		return
	}

}

// MatchingService_DescribeTaskList_Result represents the result of a MatchingService.DescribeTaskList function call.
//
// The result of a DescribeTaskList execution is sent and received over the wire as this struct.
//
// Success is set only if the function did not throw an exception.
type MatchingService_DescribeTaskList_Result struct {
	// Value returned by DescribeTaskList after a successful execution.
	Success                     *shared.DescribeTaskListResponse    `json:"success,omitempty"`
	BadRequestError             *shared.BadRequestError             `json:"badRequestError,omitempty"`
	InternalServiceError        *shared.InternalServiceError        `json:"internalServiceError,omitempty"`
	EntityNotExistError         *shared.EntityNotExistsError        `json:"entityNotExistError,omitempty"`
	ServiceBusyError            *shared.ServiceBusyError            `json:"serviceBusyError,omitempty"`
	TaskListNotOwnedByHostError *shared.TaskListNotOwnedByHostError `json:"taskListNotOwnedByHostError,omitempty"`
}

// ToWire translates a MatchingService_DescribeTaskList_Result struct into a Thrift-level intermediate
// representation. This intermediate representation may be serialized
// into bytes using a ThriftRW protocol implementation.
//
// An error is returned if the struct or any of its fields failed to
// validate.
//
//	x, err := v.ToWire()
//	if err != nil {
//	  return err
//	}
//
//	if err := binaryProtocol.Encode(x, writer); err != nil {
//	  return err
//	}
func (v *MatchingService_DescribeTaskList_Result) ToWire() (wire.Value, error) {
	var (
		fields [6]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.Success != nil {
		w, err = v.Success.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 0, Value: w}
		i++
	}
	if v.BadRequestError != nil {
		w, err = v.BadRequestError.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 1, Value: w}
		i++
	}
	if v.InternalServiceError != nil {
		w, err = v.InternalServiceError.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 2, Value: w}
		i++
	}
	if v.EntityNotExistError != nil {
		w, err = v.EntityNotExistError.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 3, Value: w}
		i++
	}
	if v.ServiceBusyError != nil {
		w, err = v.ServiceBusyError.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 4, Value: w}
		i++
	}
	if v.TaskListNotOwnedByHostError != nil {
		w, err = v.TaskListNotOwnedByHostError.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 5, Value: w}
		i++
	}

	if i != 1 {
		return wire.Value{}, fmt.Errorf("MatchingService_DescribeTaskList_Result should have exactly one field: got %v fields", i)
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

func _DescribeTaskListResponse_Read(w wire.Value) (*shared.DescribeTaskListResponse, error) {
	var v shared.DescribeTaskListResponse
	err := v.FromWire(w)
	return &v, err
}

func _EntityNotExistsError_Read(w wire.Value) (*shared.EntityNotExistsError, error) {
	var v shared.EntityNotExistsError
	err := v.FromWire(w)
	return &v, err
}

// FromWire deserializes a MatchingService_DescribeTaskList_Result struct from its Thrift-level
// representation. The Thrift-level representation may be obtained
// from a ThriftRW protocol implementation.
//
// An error is returned if we were unable to build a MatchingService_DescribeTaskList_Result struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v MatchingService_DescribeTaskList_Result
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *MatchingService_DescribeTaskList_Result) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 0:
			if field.Value.Type() == wire.TStruct {
				v.Success, err = _DescribeTaskListResponse_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 1:
			if field.Value.Type() == wire.TStruct {
				v.BadRequestError, err = _BadRequestError_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 2:
			if field.Value.Type() == wire.TStruct {
				v.InternalServiceError, err = _InternalServiceError_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 3:
			if field.Value.Type() == wire.TStruct {
				v.EntityNotExistError, err = _EntityNotExistsError_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 4:
			if field.Value.Type() == wire.TStruct {
				v.ServiceBusyError, err = _ServiceBusyError_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 5:
			if field.Value.Type() == wire.TStruct {
				v.TaskListNotOwnedByHostError, err = _TaskListNotOwnedByHostError_Read(field.Value)
				if err != nil {
					return err
				}

			}
		}
	}

	count := 0
	if v.Success != nil {
		count++
	}
	if v.BadRequestError != nil {
		count++
	}
	if v.InternalServiceError != nil {
		count++
	}
	if v.EntityNotExistError != nil {
		count++
	}
	if v.ServiceBusyError != nil {
		count++
	}
	if v.TaskListNotOwnedByHostError != nil {
		count++
	}
	if count != 1 {
		return fmt.Errorf("MatchingService_DescribeTaskList_Result should have exactly one field: got %v fields", count)
	}

	return nil
}

// Encode serializes a MatchingService_DescribeTaskList_Result struct directly into bytes, without going
// through an intermediary type.
//
// An error is returned if a MatchingService_DescribeTaskList_Result struct could not be encoded.
func (v *MatchingService_DescribeTaskList_Result) Encode(sw stream.Writer) error {
	if err := sw.WriteStructBegin(); err != nil {
		return err
	}

	if v.Success != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 0, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.Success.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.BadRequestError != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 1, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.BadRequestError.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.InternalServiceError != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 2, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.InternalServiceError.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.EntityNotExistError != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 3, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.EntityNotExistError.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.ServiceBusyError != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 4, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.ServiceBusyError.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.TaskListNotOwnedByHostError != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 5, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.TaskListNotOwnedByHostError.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	count := 0
	if v.Success != nil {
		count++
	}
	if v.BadRequestError != nil {
		count++
	}
	if v.InternalServiceError != nil {
		count++
	}
	if v.EntityNotExistError != nil {
		count++
	}
	if v.ServiceBusyError != nil {
		count++
	}
	if v.TaskListNotOwnedByHostError != nil {
		count++
	}

	if count != 1 {
		return fmt.Errorf("MatchingService_DescribeTaskList_Result should have exactly one field: got %v fields", count)
	}

	return sw.WriteStructEnd()
}

func _DescribeTaskListResponse_Decode(sr stream.Reader) (*shared.DescribeTaskListResponse, error) {
	var v shared.DescribeTaskListResponse
	err := v.Decode(sr)
	return &v, err
}

func _EntityNotExistsError_Decode(sr stream.Reader) (*shared.EntityNotExistsError, error) {
	var v shared.EntityNotExistsError
	err := v.Decode(sr)
	return &v, err
}

// Decode deserializes a MatchingService_DescribeTaskList_Result struct directly from its Thrift-level
// representation, without going through an intemediary type.
//
// An error is returned if a MatchingService_DescribeTaskList_Result struct could not be generated from the wire
// representation.
func (v *MatchingService_DescribeTaskList_Result) Decode(sr stream.Reader) error {

	if err := sr.ReadStructBegin(); err != nil {
		return err
	}

	fh, ok, err := sr.ReadFieldBegin()
	if err != nil {
		return err
	}

	for ok {
		switch {
		case fh.ID == 0 && fh.Type == wire.TStruct:
			v.Success, err = _DescribeTaskListResponse_Decode(sr)
			if err != nil {
				return err
			}

		case fh.ID == 1 && fh.Type == wire.TStruct:
			v.BadRequestError, err = _BadRequestError_Decode(sr)
			if err != nil {
				return err
			}

		case fh.ID == 2 && fh.Type == wire.TStruct:
			v.InternalServiceError, err = _InternalServiceError_Decode(sr)
			if err != nil {
				return err
			}

		case fh.ID == 3 && fh.Type == wire.TStruct:
			v.EntityNotExistError, err = _EntityNotExistsError_Decode(sr)
			if err != nil {
				return err
			}

		case fh.ID == 4 && fh.Type == wire.TStruct:
			v.ServiceBusyError, err = _ServiceBusyError_Decode(sr)
			if err != nil {
				return err
			}

		case fh.ID == 5 && fh.Type == wire.TStruct:
			v.TaskListNotOwnedByHostError, err = _TaskListNotOwnedByHostError_Decode(sr)
			if err != nil {
				return err
			}

		default:
			if err := sr.Skip(fh.Type); err != nil {
				return err
			}
		}

		if err := sr.ReadFieldEnd(); err != nil {
			return err
		}

		if fh, ok, err = sr.ReadFieldBegin(); err != nil {
			return err
		}
	}

	if err := sr.ReadStructEnd(); err != nil {
		return err
	}

	count := 0
	if v.Success != nil {
		count++
	}
	if v.BadRequestError != nil {
		count++
	}
	if v.InternalServiceError != nil {
		count++
	}
	if v.EntityNotExistError != nil {
		count++
	}
	if v.ServiceBusyError != nil {
		count++
	}
	if v.TaskListNotOwnedByHostError != nil {
		count++
	}
	if count != 1 {
		return fmt.Errorf("MatchingService_DescribeTaskList_Result should have exactly one field: got %v fields", count)
	}

	return nil
}

// String returns a readable string representation of a MatchingService_DescribeTaskList_Result
// struct.
func (v *MatchingService_DescribeTaskList_Result) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [6]string
	i := 0
	if v.Success != nil {
		fields[i] = fmt.Sprintf("Success: %v", v.Success)
		i++
	}
	if v.BadRequestError != nil {
		fields[i] = fmt.Sprintf("BadRequestError: %v", v.BadRequestError)
		i++
	}
	if v.InternalServiceError != nil {
		fields[i] = fmt.Sprintf("InternalServiceError: %v", v.InternalServiceError)
		i++
	}
	if v.EntityNotExistError != nil {
		fields[i] = fmt.Sprintf("EntityNotExistError: %v", v.EntityNotExistError)
		i++
	}
	if v.ServiceBusyError != nil {
		fields[i] = fmt.Sprintf("ServiceBusyError: %v", v.ServiceBusyError)
		i++
	}
	if v.TaskListNotOwnedByHostError != nil {
		fields[i] = fmt.Sprintf("TaskListNotOwnedByHostError: %v", v.TaskListNotOwnedByHostError)
		i++
	}

	return fmt.Sprintf("MatchingService_DescribeTaskList_Result{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this MatchingService_DescribeTaskList_Result match the
// provided MatchingService_DescribeTaskList_Result.
//
// This function performs a deep comparison.
func (v *MatchingService_DescribeTaskList_Result) Equals(rhs *MatchingService_DescribeTaskList_Result) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !((v.Success == nil && rhs.Success == nil) || (v.Success != nil && rhs.Success != nil && v.Success.Equals(rhs.Success))) {
		return false
	}
	if !((v.BadRequestError == nil && rhs.BadRequestError == nil) || (v.BadRequestError != nil && rhs.BadRequestError != nil && v.BadRequestError.Equals(rhs.BadRequestError))) {
		return false
	}
	if !((v.InternalServiceError == nil && rhs.InternalServiceError == nil) || (v.InternalServiceError != nil && rhs.InternalServiceError != nil && v.InternalServiceError.Equals(rhs.InternalServiceError))) {
		return false
	}
	if !((v.EntityNotExistError == nil && rhs.EntityNotExistError == nil) || (v.EntityNotExistError != nil && rhs.EntityNotExistError != nil && v.EntityNotExistError.Equals(rhs.EntityNotExistError))) {
		return false
	}
	if !((v.ServiceBusyError == nil && rhs.ServiceBusyError == nil) || (v.ServiceBusyError != nil && rhs.ServiceBusyError != nil && v.ServiceBusyError.Equals(rhs.ServiceBusyError))) {
		return false
	}
	if !((v.TaskListNotOwnedByHostError == nil && rhs.TaskListNotOwnedByHostError == nil) || (v.TaskListNotOwnedByHostError != nil && rhs.TaskListNotOwnedByHostError != nil && v.TaskListNotOwnedByHostError.Equals(rhs.TaskListNotOwnedByHostError))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of MatchingService_DescribeTaskList_Result.
func (v *MatchingService_DescribeTaskList_Result) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Success != nil {
		err = multierr.Append(err, enc.AddObject("success", v.Success))
	}
	if v.BadRequestError != nil {
		err = multierr.Append(err, enc.AddObject("badRequestError", v.BadRequestError))
	}
	if v.InternalServiceError != nil {
		err = multierr.Append(err, enc.AddObject("internalServiceError", v.InternalServiceError))
	}
	if v.EntityNotExistError != nil {
		err = multierr.Append(err, enc.AddObject("entityNotExistError", v.EntityNotExistError))
	}
	if v.ServiceBusyError != nil {
		err = multierr.Append(err, enc.AddObject("serviceBusyError", v.ServiceBusyError))
	}
	if v.TaskListNotOwnedByHostError != nil {
		err = multierr.Append(err, enc.AddObject("taskListNotOwnedByHostError", v.TaskListNotOwnedByHostError))
	}
	return err
}

// GetSuccess returns the value of Success if it is set or its
// zero value if it is unset.
func (v *MatchingService_DescribeTaskList_Result) GetSuccess() (o *shared.DescribeTaskListResponse) {
	if v != nil && v.Success != nil {
		return v.Success
	}

	return
}

// IsSetSuccess returns true if Success is not nil.
func (v *MatchingService_DescribeTaskList_Result) IsSetSuccess() bool {
	return v != nil && v.Success != nil
}

// GetBadRequestError returns the value of BadRequestError if it is set or its
// zero value if it is unset.
func (v *MatchingService_DescribeTaskList_Result) GetBadRequestError() (o *shared.BadRequestError) {
	if v != nil && v.BadRequestError != nil {
		return v.BadRequestError
	}

	return
}

// IsSetBadRequestError returns true if BadRequestError is not nil.
func (v *MatchingService_DescribeTaskList_Result) IsSetBadRequestError() bool {
	return v != nil && v.BadRequestError != nil
}

// GetInternalServiceError returns the value of InternalServiceError if it is set or its
// zero value if it is unset.
func (v *MatchingService_DescribeTaskList_Result) GetInternalServiceError() (o *shared.InternalServiceError) {
	if v != nil && v.InternalServiceError != nil {
		return v.InternalServiceError
	}

	return
}

// IsSetInternalServiceError returns true if InternalServiceError is not nil.
func (v *MatchingService_DescribeTaskList_Result) IsSetInternalServiceError() bool {
	return v != nil && v.InternalServiceError != nil
}

// GetEntityNotExistError returns the value of EntityNotExistError if it is set or its
// zero value if it is unset.
func (v *MatchingService_DescribeTaskList_Result) GetEntityNotExistError() (o *shared.EntityNotExistsError) {
	if v != nil && v.EntityNotExistError != nil {
		return v.EntityNotExistError
	}

	return
}

// IsSetEntityNotExistError returns true if EntityNotExistError is not nil.
func (v *MatchingService_DescribeTaskList_Result) IsSetEntityNotExistError() bool {
	return v != nil && v.EntityNotExistError != nil
}

// GetServiceBusyError returns the value of ServiceBusyError if it is set or its
// zero value if it is unset.
func (v *MatchingService_DescribeTaskList_Result) GetServiceBusyError() (o *shared.ServiceBusyError) {
	if v != nil && v.ServiceBusyError != nil {
		return v.ServiceBusyError
	}

	return
}

// IsSetServiceBusyError returns true if ServiceBusyError is not nil.
func (v *MatchingService_DescribeTaskList_Result) IsSetServiceBusyError() bool {
	return v != nil && v.ServiceBusyError != nil
}

// GetTaskListNotOwnedByHostError returns the value of TaskListNotOwnedByHostError if it is set or its
// zero value if it is unset.
func (v *MatchingService_DescribeTaskList_Result) GetTaskListNotOwnedByHostError() (o *shared.TaskListNotOwnedByHostError) {
	if v != nil && v.TaskListNotOwnedByHostError != nil {
		return v.TaskListNotOwnedByHostError
	}

	return
}

// IsSetTaskListNotOwnedByHostError returns true if TaskListNotOwnedByHostError is not nil.
func (v *MatchingService_DescribeTaskList_Result) IsSetTaskListNotOwnedByHostError() bool {
	return v != nil && v.TaskListNotOwnedByHostError != nil
}

// MethodName returns the name of the Thrift function as specified in
// the IDL, for which this struct represent the result.
//
// This will always be "DescribeTaskList" for this struct.
func (v *MatchingService_DescribeTaskList_Result) MethodName() string {
	return "DescribeTaskList"
}

// EnvelopeType returns the kind of value inside this struct.
//
// This will always be Reply for this struct.
func (v *MatchingService_DescribeTaskList_Result) EnvelopeType() wire.EnvelopeType {
	return wire.Reply
}

// MatchingService_GetTaskListsByDomain_Args represents the arguments for the MatchingService.GetTaskListsByDomain function.
//
// The arguments for GetTaskListsByDomain are sent and received over the wire as this struct.
type MatchingService_GetTaskListsByDomain_Args struct {
	Request *shared.GetTaskListsByDomainRequest `json:"request,omitempty"`
}

// ToWire translates a MatchingService_GetTaskListsByDomain_Args struct into a Thrift-level intermediate
// representation. This intermediate representation may be serialized
// into bytes using a ThriftRW protocol implementation.
//
// An error is returned if the struct or any of its fields failed to
// validate.
//
//	x, err := v.ToWire()
//	if err != nil {
//	  return err
//	}
//
//	if err := binaryProtocol.Encode(x, writer); err != nil {
//	  return err
//	}
func (v *MatchingService_GetTaskListsByDomain_Args) ToWire() (wire.Value, error) {
	var (
		fields [1]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.Request != nil {
		w, err = v.Request.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 1, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

func _GetTaskListsByDomainRequest_Read(w wire.Value) (*shared.GetTaskListsByDomainRequest, error) {
	var v shared.GetTaskListsByDomainRequest
	err := v.FromWire(w)
	return &v, err
}

// FromWire deserializes a MatchingService_GetTaskListsByDomain_Args struct from its Thrift-level
// representation. The Thrift-level representation may be obtained
// from a ThriftRW protocol implementation.
//
// An error is returned if we were unable to build a MatchingService_GetTaskListsByDomain_Args struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v MatchingService_GetTaskListsByDomain_Args
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *MatchingService_GetTaskListsByDomain_Args) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 1:
			if field.Value.Type() == wire.TStruct {
				v.Request, err = _GetTaskListsByDomainRequest_Read(field.Value)
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// Encode serializes a MatchingService_GetTaskListsByDomain_Args struct directly into bytes, without going
// through an intermediary type.
//
// An error is returned if a MatchingService_GetTaskListsByDomain_Args struct could not be encoded.
func (v *MatchingService_GetTaskListsByDomain_Args) Encode(sw stream.Writer) error {
	if err := sw.WriteStructBegin(); err != nil {
		return err
	}

	if v.Request != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 1, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.Request.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	return sw.WriteStructEnd()
}

func _GetTaskListsByDomainRequest_Decode(sr stream.Reader) (*shared.GetTaskListsByDomainRequest, error) {
	var v shared.GetTaskListsByDomainRequest
	err := v.Decode(sr)
	return &v, err
}

// Decode deserializes a MatchingService_GetTaskListsByDomain_Args struct directly from its Thrift-level
// representation, without going through an intemediary type.
//
// An error is returned if a MatchingService_GetTaskListsByDomain_Args struct could not be generated from the wire
// representation.
func (v *MatchingService_GetTaskListsByDomain_Args) Decode(sr stream.Reader) error {

	if err := sr.ReadStructBegin(); err != nil {
		return err
	}

	fh, ok, err := sr.ReadFieldBegin()
	if err != nil {
		return err
	}

	for ok {
		switch {
		case fh.ID == 1 && fh.Type == wire.TStruct:
			v.Request, err = _GetTaskListsByDomainRequest_Decode(sr)
			if err != nil {
				return err
			}

		default:
			if err := sr.Skip(fh.Type); err != nil {
				return err
			}
		}

		if err := sr.ReadFieldEnd(); err != nil {
			return err
		}

		if fh, ok, err = sr.ReadFieldBegin(); err != nil {
			return err
		}
	}

	if err := sr.ReadStructEnd(); err != nil {
		return err
	}

	return nil
}

// String returns a readable string representation of a MatchingService_GetTaskListsByDomain_Args
// struct.
func (v *MatchingService_GetTaskListsByDomain_Args) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [1]string
	i := 0
	if v.Request != nil {
		fields[i] = fmt.Sprintf("Request: %v", v.Request)
		i++
	}

	return fmt.Sprintf("MatchingService_GetTaskListsByDomain_Args{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this MatchingService_GetTaskListsByDomain_Args match the
// provided MatchingService_GetTaskListsByDomain_Args.
//
// This function performs a deep comparison.
func (v *MatchingService_GetTaskListsByDomain_Args) Equals(rhs *MatchingService_GetTaskListsByDomain_Args) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !((v.Request == nil && rhs.Request == nil) || (v.Request != nil && rhs.Request != nil && v.Request.Equals(rhs.Request))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of MatchingService_GetTaskListsByDomain_Args.
func (v *MatchingService_GetTaskListsByDomain_Args) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Request != nil {
		err = multierr.Append(err, enc.AddObject("request", v.Request))
	}
	return err
}

// GetRequest returns the value of Request if it is set or its
// zero value if it is unset.
func (v *MatchingService_GetTaskListsByDomain_Args) GetRequest() (o *shared.GetTaskListsByDomainRequest) {
	if v != nil && v.Request != nil {
		return v.Request
	}

	return
}

// IsSetRequest returns true if Request is not nil.
func (v *MatchingService_GetTaskListsByDomain_Args) IsSetRequest() bool {
	return v != nil && v.Request != nil
}

// MethodName returns the name of the Thrift function as specified in
// the IDL, for which this struct represent the arguments.
//
// This will always be "GetTaskListsByDomain" for this struct.
func (v *MatchingService_GetTaskListsByDomain_Args) MethodName() string {
	return "GetTaskListsByDomain"
}

// EnvelopeType returns the kind of value inside this struct.
//
// This will always be Call for this struct.
func (v *MatchingService_GetTaskListsByDomain_Args) EnvelopeType() wire.EnvelopeType {
	return wire.Call
}

// MatchingService_GetTaskListsByDomain_Helper provides functions that aid in handling the
// parameters and return values of the MatchingService.GetTaskListsByDomain
// function.
var MatchingService_GetTaskListsByDomain_Helper = struct {
	// Args accepts the parameters of GetTaskListsByDomain in-order and returns
	// the arguments struct for the function.
	Args func(
		request *shared.GetTaskListsByDomainRequest,
	) *MatchingService_GetTaskListsByDomain_Args

	// IsException returns true if the given error can be thrown
	// by GetTaskListsByDomain.
	//
	// An error can be thrown by GetTaskListsByDomain only if the
	// corresponding exception type was mentioned in the 'throws'
	// section for it in the Thrift file.
	IsException func(error) bool

	// WrapResponse returns the result struct for GetTaskListsByDomain
	// given its return value and error.
	//
	// This allows mapping values and errors returned by
	// GetTaskListsByDomain into a serializable result struct.
	// WrapResponse returns a non-nil error if the provided
	// error cannot be thrown by GetTaskListsByDomain
	//
	//   value, err := GetTaskListsByDomain(args)
	//   result, err := MatchingService_GetTaskListsByDomain_Helper.WrapResponse(value, err)
	//   if err != nil {
	//     return fmt.Errorf("unexpected error from GetTaskListsByDomain: %v", err)
	//   }
	//   serialize(result)
	WrapResponse func(*shared.GetTaskListsByDomainResponse, error) (*MatchingService_GetTaskListsByDomain_Result, error)

	// UnwrapResponse takes the result struct for GetTaskListsByDomain
	// and returns the value or error returned by it.
	//
	// The error is non-nil only if GetTaskListsByDomain threw an
	// exception.
	//
	//   result := deserialize(bytes)
	//   value, err := MatchingService_GetTaskListsByDomain_Helper.UnwrapResponse(result)
	UnwrapResponse func(*MatchingService_GetTaskListsByDomain_Result) (*shared.GetTaskListsByDomainResponse, error)
}{}

func init() {
	MatchingService_GetTaskListsByDomain_Helper.Args = func(
		request *shared.GetTaskListsByDomainRequest,
	) *MatchingService_GetTaskListsByDomain_Args {
		return &MatchingService_GetTaskListsByDomain_Args{
			Request: request,
		}
	}

	MatchingService_GetTaskListsByDomain_Helper.IsException = func(err error) bool {
		switch err.(type) {
		case *shared.BadRequestError:
			return true
		case *shared.InternalServiceError:
			return true
		case *shared.EntityNotExistsError:
			return true
		case *shared.ServiceBusyError:
			return true
		default:
			return false
		}
	}

	MatchingService_GetTaskListsByDomain_Helper.WrapResponse = func(success *shared.GetTaskListsByDomainResponse, err error) (*MatchingService_GetTaskListsByDomain_Result, error) {
		if err == nil {
			return &MatchingService_GetTaskListsByDomain_Result{Success: success}, nil
		}

		switch e := err.(type) {
		case *shared.BadRequestError:
			if e == nil {
				return nil, errors.New("WrapResponse received non-nil error type with nil value for MatchingService_GetTaskListsByDomain_Result.BadRequestError")
			}
			return &MatchingService_GetTaskListsByDomain_Result{BadRequestError: e}, nil
		case *shared.InternalServiceError:
			if e == nil {
				return nil, errors.New("WrapResponse received non-nil error type with nil value for MatchingService_GetTaskListsByDomain_Result.InternalServiceError")
			}
			return &MatchingService_GetTaskListsByDomain_Result{InternalServiceError: e}, nil
		case *shared.EntityNotExistsError:
			if e == nil {
				return nil, errors.New("WrapResponse received non-nil error type with nil value for MatchingService_GetTaskListsByDomain_Result.EntityNotExistError")
			}
			return &MatchingService_GetTaskListsByDomain_Result{EntityNotExistError: e}, nil
		case *shared.ServiceBusyError:
			if e == nil {
				return nil, errors.New("WrapResponse received non-nil error type with nil value for MatchingService_GetTaskListsByDomain_Result.ServiceBusyError")
			}
			return &MatchingService_GetTaskListsByDomain_Result{ServiceBusyError: e}, nil
		}

		return nil, err
	}
	MatchingService_GetTaskListsByDomain_Helper.UnwrapResponse = func(result *MatchingService_GetTaskListsByDomain_Result) (success *shared.GetTaskListsByDomainResponse, err error) {
		if result.BadRequestError != nil {
			err = result.BadRequestError
			return
		}
		if result.InternalServiceError != nil {
			err = result.InternalServiceError
			return
		}
		if result.EntityNotExistError != nil {
			err = result.EntityNotExistError
			return
		}
		if result.ServiceBusyError != nil {
			err = result.ServiceBusyError
			return
		}

		if result.Success != nil {
			success = result.Success
			return
		}

		err = errors.New("expected a non-void result")
		return
	}

}

// MatchingService_GetTaskListsByDomain_Result represents the result of a MatchingService.GetTaskListsByDomain function call.
//
// The result of a GetTaskListsByDomain execution is sent and received over the wire as this struct.
//
// Success is set only if the function did not throw an exception.
type MatchingService_GetTaskListsByDomain_Result struct {
	// Value returned by GetTaskListsByDomain after a successful execution.
	Success              *shared.GetTaskListsByDomainResponse `json:"success,omitempty"`
	BadRequestError      *shared.BadRequestError              `json:"badRequestError,omitempty"`
	InternalServiceError *shared.InternalServiceError         `json:"internalServiceError,omitempty"`
	EntityNotExistError  *shared.EntityNotExistsError         `json:"entityNotExistError,omitempty"`
	ServiceBusyError     *shared.ServiceBusyError             `json:"serviceBusyError,omitempty"`
}

// ToWire translates a MatchingService_GetTaskListsByDomain_Result struct into a Thrift-level intermediate
// representation. This intermediate representation may be serialized
// into bytes using a ThriftRW protocol implementation.
//
// An error is returned if the struct or any of its fields failed to
// validate.
//
//	x, err := v.ToWire()
//	if err != nil {
//	  return err
//	}
//
//	if err := binaryProtocol.Encode(x, writer); err != nil {
//	  return err
//	}
func (v *MatchingService_GetTaskListsByDomain_Result) ToWire() (wire.Value, error) {
	var (
		fields [5]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.Success != nil {
		w, err = v.Success.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 0, Value: w}
		i++
	}
	if v.BadRequestError != nil {
		w, err = v.BadRequestError.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 1, Value: w}
		i++
	}
	if v.InternalServiceError != nil {
		w, err = v.InternalServiceError.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 2, Value: w}
		i++
	}
	if v.EntityNotExistError != nil {
		w, err = v.EntityNotExistError.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 3, Value: w}
		i++
	}
	if v.ServiceBusyError != nil {
		w, err = v.ServiceBusyError.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 4, Value: w}
		i++
	}

	if i != 1 {
		return wire.Value{}, fmt.Errorf("MatchingService_GetTaskListsByDomain_Result should have exactly one field: got %v fields", i)
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

func _GetTaskListsByDomainResponse_Read(w wire.Value) (*shared.GetTaskListsByDomainResponse, error) {
	var v shared.GetTaskListsByDomainResponse
	err := v.FromWire(w)
	return &v, err
}

// FromWire deserializes a MatchingService_GetTaskListsByDomain_Result struct from its Thrift-level
// representation. The Thrift-level representation may be obtained
// from a ThriftRW protocol implementation.
//
// An error is returned if we were unable to build a MatchingService_GetTaskListsByDomain_Result struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v MatchingService_GetTaskListsByDomain_Result
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *MatchingService_GetTaskListsByDomain_Result) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 0:
			if field.Value.Type() == wire.TStruct {
				v.Success, err = _GetTaskListsByDomainResponse_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 1:
			if field.Value.Type() == wire.TStruct {
				v.BadRequestError, err = _BadRequestError_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 2:
			if field.Value.Type() == wire.TStruct {
				v.InternalServiceError, err = _InternalServiceError_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 3:
			if field.Value.Type() == wire.TStruct {
				v.EntityNotExistError, err = _EntityNotExistsError_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 4:
			if field.Value.Type() == wire.TStruct {
				v.ServiceBusyError, err = _ServiceBusyError_Read(field.Value)
				if err != nil {
					return err
				}

			}
		}
	}

	count := 0
	if v.Success != nil {
		count++
	}
	if v.BadRequestError != nil {
		count++
	}
	if v.InternalServiceError != nil {
		count++
	}
	if v.EntityNotExistError != nil {
		count++
	}
	if v.ServiceBusyError != nil {
		count++
	}
	if count != 1 {
		return fmt.Errorf("MatchingService_GetTaskListsByDomain_Result should have exactly one field: got %v fields", count)
	}

	return nil
}

// Encode serializes a MatchingService_GetTaskListsByDomain_Result struct directly into bytes, without going
// through an intermediary type.
//
// An error is returned if a MatchingService_GetTaskListsByDomain_Result struct could not be encoded.
func (v *MatchingService_GetTaskListsByDomain_Result) Encode(sw stream.Writer) error {
	if err := sw.WriteStructBegin(); err != nil {
		return err
	}

	if v.Success != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 0, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.Success.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.BadRequestError != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 1, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.BadRequestError.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.InternalServiceError != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 2, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.InternalServiceError.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.EntityNotExistError != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 3, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.EntityNotExistError.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.ServiceBusyError != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 4, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.ServiceBusyError.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	count := 0
	if v.Success != nil {
		count++
	}
	if v.BadRequestError != nil {
		count++
	}
	if v.InternalServiceError != nil {
		count++
	}
	if v.EntityNotExistError != nil {
		count++
	}
	if v.ServiceBusyError != nil {
		count++
	}

	if count != 1 {
		return fmt.Errorf("MatchingService_GetTaskListsByDomain_Result should have exactly one field: got %v fields", count)
	}

	return sw.WriteStructEnd()
}

func _GetTaskListsByDomainResponse_Decode(sr stream.Reader) (*shared.GetTaskListsByDomainResponse, error) {
	var v shared.GetTaskListsByDomainResponse
	err := v.Decode(sr)
	return &v, err
}

// Decode deserializes a MatchingService_GetTaskListsByDomain_Result struct directly from its Thrift-level
// representation, without going through an intemediary type.
//
// An error is returned if a MatchingService_GetTaskListsByDomain_Result struct could not be generated from the wire
// representation.
func (v *MatchingService_GetTaskListsByDomain_Result) Decode(sr stream.Reader) error {

	if err := sr.ReadStructBegin(); err != nil {
		return err
	}

	fh, ok, err := sr.ReadFieldBegin()
	if err != nil {
		return err
	}

	for ok {
		switch {
		case fh.ID == 0 && fh.Type == wire.TStruct:
			v.Success, err = _GetTaskListsByDomainResponse_Decode(sr)
			if err != nil {
				return err
			}

		case fh.ID == 1 && fh.Type == wire.TStruct:
			v.BadRequestError, err = _BadRequestError_Decode(sr)
			if err != nil {
				return err
			}

		case fh.ID == 2 && fh.Type == wire.TStruct:
			v.InternalServiceError, err = _InternalServiceError_Decode(sr)
			if err != nil {
				return err
			}

		case fh.ID == 3 && fh.Type == wire.TStruct:
			v.EntityNotExistError, err = _EntityNotExistsError_Decode(sr)
			if err != nil {
				return err
			}

		case fh.ID == 4 && fh.Type == wire.TStruct:
			v.ServiceBusyError, err = _ServiceBusyError_Decode(sr)
			if err != nil {
				return err
			}

		default:
			if err := sr.Skip(fh.Type); err != nil {
				return err
			}
		}

		if err := sr.ReadFieldEnd(); err != nil {
			return err
		}

		if fh, ok, err = sr.ReadFieldBegin(); err != nil {
			return err
		}
	}

	if err := sr.ReadStructEnd(); err != nil {
		return err
	}

	count := 0
	if v.Success != nil {
		count++
	}
	if v.BadRequestError != nil {
		count++
	}
	if v.InternalServiceError != nil {
		count++
	}
	if v.EntityNotExistError != nil {
		count++
	}
	if v.ServiceBusyError != nil {
		count++
	}
	if count != 1 {
		return fmt.Errorf("MatchingService_GetTaskListsByDomain_Result should have exactly one field: got %v fields", count)
	}

	return nil
}

// String returns a readable string representation of a MatchingService_GetTaskListsByDomain_Result
// struct.
func (v *MatchingService_GetTaskListsByDomain_Result) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [5]string
	i := 0
	if v.Success != nil {
		fields[i] = fmt.Sprintf("Success: %v", v.Success)
		i++
	}
	if v.BadRequestError != nil {
		fields[i] = fmt.Sprintf("BadRequestError: %v", v.BadRequestError)
		i++
	}
	if v.InternalServiceError != nil {
		fields[i] = fmt.Sprintf("InternalServiceError: %v", v.InternalServiceError)
		i++
	}
	if v.EntityNotExistError != nil {
		fields[i] = fmt.Sprintf("EntityNotExistError: %v", v.EntityNotExistError)
		i++
	}
	if v.ServiceBusyError != nil {
		fields[i] = fmt.Sprintf("ServiceBusyError: %v", v.ServiceBusyError)
		i++
	}

	return fmt.Sprintf("MatchingService_GetTaskListsByDomain_Result{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this MatchingService_GetTaskListsByDomain_Result match the
// provided MatchingService_GetTaskListsByDomain_Result.
//
// This function performs a deep comparison.
func (v *MatchingService_GetTaskListsByDomain_Result) Equals(rhs *MatchingService_GetTaskListsByDomain_Result) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !((v.Success == nil && rhs.Success == nil) || (v.Success != nil && rhs.Success != nil && v.Success.Equals(rhs.Success))) {
		return false
	}
	if !((v.BadRequestError == nil && rhs.BadRequestError == nil) || (v.BadRequestError != nil && rhs.BadRequestError != nil && v.BadRequestError.Equals(rhs.BadRequestError))) {
		return false
	}
	if !((v.InternalServiceError == nil && rhs.InternalServiceError == nil) || (v.InternalServiceError != nil && rhs.InternalServiceError != nil && v.InternalServiceError.Equals(rhs.InternalServiceError))) {
		return false
	}
	if !((v.EntityNotExistError == nil && rhs.EntityNotExistError == nil) || (v.EntityNotExistError != nil && rhs.EntityNotExistError != nil && v.EntityNotExistError.Equals(rhs.EntityNotExistError))) {
		return false
	}
	if !((v.ServiceBusyError == nil && rhs.ServiceBusyError == nil) || (v.ServiceBusyError != nil && rhs.ServiceBusyError != nil && v.ServiceBusyError.Equals(rhs.ServiceBusyError))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of MatchingService_GetTaskListsByDomain_Result.
func (v *MatchingService_GetTaskListsByDomain_Result) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Success != nil {
		err = multierr.Append(err, enc.AddObject("success", v.Success))
	}
	if v.BadRequestError != nil {
		err = multierr.Append(err, enc.AddObject("badRequestError", v.BadRequestError))
	}
	if v.InternalServiceError != nil {
		err = multierr.Append(err, enc.AddObject("internalServiceError", v.InternalServiceError))
	}
	if v.EntityNotExistError != nil {
		err = multierr.Append(err, enc.AddObject("entityNotExistError", v.EntityNotExistError))
	}
	if v.ServiceBusyError != nil {
		err = multierr.Append(err, enc.AddObject("serviceBusyError", v.ServiceBusyError))
	}
	return err
}

// GetSuccess returns the value of Success if it is set or its
// zero value if it is unset.
func (v *MatchingService_GetTaskListsByDomain_Result) GetSuccess() (o *shared.GetTaskListsByDomainResponse) {
	if v != nil && v.Success != nil {
		return v.Success
	}

	return
}

// IsSetSuccess returns true if Success is not nil.
func (v *MatchingService_GetTaskListsByDomain_Result) IsSetSuccess() bool {
	return v != nil && v.Success != nil
}

// GetBadRequestError returns the value of BadRequestError if it is set or its
// zero value if it is unset.
func (v *MatchingService_GetTaskListsByDomain_Result) GetBadRequestError() (o *shared.BadRequestError) {
	if v != nil && v.BadRequestError != nil {
		return v.BadRequestError
	}

	return
}

// IsSetBadRequestError returns true if BadRequestError is not nil.
func (v *MatchingService_GetTaskListsByDomain_Result) IsSetBadRequestError() bool {
	return v != nil && v.BadRequestError != nil
}

// GetInternalServiceError returns the value of InternalServiceError if it is set or its
// zero value if it is unset.
func (v *MatchingService_GetTaskListsByDomain_Result) GetInternalServiceError() (o *shared.InternalServiceError) {
	if v != nil && v.InternalServiceError != nil {
		return v.InternalServiceError
	}

	return
}

// IsSetInternalServiceError returns true if InternalServiceError is not nil.
func (v *MatchingService_GetTaskListsByDomain_Result) IsSetInternalServiceError() bool {
	return v != nil && v.InternalServiceError != nil
}

// GetEntityNotExistError returns the value of EntityNotExistError if it is set or its
// zero value if it is unset.
func (v *MatchingService_GetTaskListsByDomain_Result) GetEntityNotExistError() (o *shared.EntityNotExistsError) {
	if v != nil && v.EntityNotExistError != nil {
		return v.EntityNotExistError
	}

	return
}

// IsSetEntityNotExistError returns true if EntityNotExistError is not nil.
func (v *MatchingService_GetTaskListsByDomain_Result) IsSetEntityNotExistError() bool {
	return v != nil && v.EntityNotExistError != nil
}

// GetServiceBusyError returns the value of ServiceBusyError if it is set or its
// zero value if it is unset.
func (v *MatchingService_GetTaskListsByDomain_Result) GetServiceBusyError() (o *shared.ServiceBusyError) {
	if v != nil && v.ServiceBusyError != nil {
		return v.ServiceBusyError
	}

	return
}

// IsSetServiceBusyError returns true if ServiceBusyError is not nil.
func (v *MatchingService_GetTaskListsByDomain_Result) IsSetServiceBusyError() bool {
	return v != nil && v.ServiceBusyError != nil
}

// MethodName returns the name of the Thrift function as specified in
// the IDL, for which this struct represent the result.
//
// This will always be "GetTaskListsByDomain" for this struct.
func (v *MatchingService_GetTaskListsByDomain_Result) MethodName() string {
	return "GetTaskListsByDomain"
}

// EnvelopeType returns the kind of value inside this struct.
//
// This will always be Reply for this struct.
func (v *MatchingService_GetTaskListsByDomain_Result) EnvelopeType() wire.EnvelopeType {
	return wire.Reply
}

// MatchingService_ListTaskListPartitions_Args represents the arguments for the MatchingService.ListTaskListPartitions function.
//
// The arguments for ListTaskListPartitions are sent and received over the wire as this struct.
type MatchingService_ListTaskListPartitions_Args struct {
	Request *ListTaskListPartitionsRequest `json:"request,omitempty"`
}

// ToWire translates a MatchingService_ListTaskListPartitions_Args struct into a Thrift-level intermediate
// representation. This intermediate representation may be serialized
// into bytes using a ThriftRW protocol implementation.
//
// An error is returned if the struct or any of its fields failed to
// validate.
//
//	x, err := v.ToWire()
//	if err != nil {
//	  return err
//	}
//
//	if err := binaryProtocol.Encode(x, writer); err != nil {
//	  return err
//	}
func (v *MatchingService_ListTaskListPartitions_Args) ToWire() (wire.Value, error) {
	var (
		fields [1]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.Request != nil {
		w, err = v.Request.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 1, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

func _ListTaskListPartitionsRequest_Read(w wire.Value) (*ListTaskListPartitionsRequest, error) {
	var v ListTaskListPartitionsRequest
	err := v.FromWire(w)
	return &v, err
}

// FromWire deserializes a MatchingService_ListTaskListPartitions_Args struct from its Thrift-level
// representation. The Thrift-level representation may be obtained
// from a ThriftRW protocol implementation.
//
// An error is returned if we were unable to build a MatchingService_ListTaskListPartitions_Args struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v MatchingService_ListTaskListPartitions_Args
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *MatchingService_ListTaskListPartitions_Args) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 1:
			if field.Value.Type() == wire.TStruct {
				v.Request, err = _ListTaskListPartitionsRequest_Read(field.Value)
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// Encode serializes a MatchingService_ListTaskListPartitions_Args struct directly into bytes, without going
// through an intermediary type.
//
// An error is returned if a MatchingService_ListTaskListPartitions_Args struct could not be encoded.
func (v *MatchingService_ListTaskListPartitions_Args) Encode(sw stream.Writer) error {
	if err := sw.WriteStructBegin(); err != nil {
		return err
	}

	if v.Request != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 1, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.Request.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	return sw.WriteStructEnd()
}

func _ListTaskListPartitionsRequest_Decode(sr stream.Reader) (*ListTaskListPartitionsRequest, error) {
	var v ListTaskListPartitionsRequest
	err := v.Decode(sr)
	return &v, err
}

// Decode deserializes a MatchingService_ListTaskListPartitions_Args struct directly from its Thrift-level
// representation, without going through an intemediary type.
//
// An error is returned if a MatchingService_ListTaskListPartitions_Args struct could not be generated from the wire
// representation.
func (v *MatchingService_ListTaskListPartitions_Args) Decode(sr stream.Reader) error {

	if err := sr.ReadStructBegin(); err != nil {
		return err
	}

	fh, ok, err := sr.ReadFieldBegin()
	if err != nil {
		return err
	}

	for ok {
		switch {
		case fh.ID == 1 && fh.Type == wire.TStruct:
			v.Request, err = _ListTaskListPartitionsRequest_Decode(sr)
			if err != nil {
				return err
			}

		default:
			if err := sr.Skip(fh.Type); err != nil {
				return err
			}
		}

		if err := sr.ReadFieldEnd(); err != nil {
			return err
		}

		if fh, ok, err = sr.ReadFieldBegin(); err != nil {
			return err
		}
	}

	if err := sr.ReadStructEnd(); err != nil {
		return err
	}

	return nil
}

// String returns a readable string representation of a MatchingService_ListTaskListPartitions_Args
// struct.
func (v *MatchingService_ListTaskListPartitions_Args) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [1]string
	i := 0
	if v.Request != nil {
		fields[i] = fmt.Sprintf("Request: %v", v.Request)
		i++
	}

	return fmt.Sprintf("MatchingService_ListTaskListPartitions_Args{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this MatchingService_ListTaskListPartitions_Args match the
// provided MatchingService_ListTaskListPartitions_Args.
//
// This function performs a deep comparison.
func (v *MatchingService_ListTaskListPartitions_Args) Equals(rhs *MatchingService_ListTaskListPartitions_Args) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !((v.Request == nil && rhs.Request == nil) || (v.Request != nil && rhs.Request != nil && v.Request.Equals(rhs.Request))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of MatchingService_ListTaskListPartitions_Args.
func (v *MatchingService_ListTaskListPartitions_Args) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Request != nil {
		err = multierr.Append(err, enc.AddObject("request", v.Request))
	}
	return err
}

// GetRequest returns the value of Request if it is set or its
// zero value if it is unset.
func (v *MatchingService_ListTaskListPartitions_Args) GetRequest() (o *ListTaskListPartitionsRequest) {
	if v != nil && v.Request != nil {
		return v.Request
	}

	return
}

// IsSetRequest returns true if Request is not nil.
func (v *MatchingService_ListTaskListPartitions_Args) IsSetRequest() bool {
	return v != nil && v.Request != nil
}

// MethodName returns the name of the Thrift function as specified in
// the IDL, for which this struct represent the arguments.
//
// This will always be "ListTaskListPartitions" for this struct.
func (v *MatchingService_ListTaskListPartitions_Args) MethodName() string {
	return "ListTaskListPartitions"
}

// EnvelopeType returns the kind of value inside this struct.
//
// This will always be Call for this struct.
func (v *MatchingService_ListTaskListPartitions_Args) EnvelopeType() wire.EnvelopeType {
	return wire.Call
}

// MatchingService_ListTaskListPartitions_Helper provides functions that aid in handling the
// parameters and return values of the MatchingService.ListTaskListPartitions
// function.
var MatchingService_ListTaskListPartitions_Helper = struct {
	// Args accepts the parameters of ListTaskListPartitions in-order and returns
	// the arguments struct for the function.
	Args func(
		request *ListTaskListPartitionsRequest,
	) *MatchingService_ListTaskListPartitions_Args

	// IsException returns true if the given error can be thrown
	// by ListTaskListPartitions.
	//
	// An error can be thrown by ListTaskListPartitions only if the
	// corresponding exception type was mentioned in the 'throws'
	// section for it in the Thrift file.
	IsException func(error) bool

	// WrapResponse returns the result struct for ListTaskListPartitions
	// given its return value and error.
	//
	// This allows mapping values and errors returned by
	// ListTaskListPartitions into a serializable result struct.
	// WrapResponse returns a non-nil error if the provided
	// error cannot be thrown by ListTaskListPartitions
	//
	//   value, err := ListTaskListPartitions(args)
	//   result, err := MatchingService_ListTaskListPartitions_Helper.WrapResponse(value, err)
	//   if err != nil {
	//     return fmt.Errorf("unexpected error from ListTaskListPartitions: %v", err)
	//   }
	//   serialize(result)
	WrapResponse func(*shared.ListTaskListPartitionsResponse, error) (*MatchingService_ListTaskListPartitions_Result, error)

	// UnwrapResponse takes the result struct for ListTaskListPartitions
	// and returns the value or error returned by it.
	//
	// The error is non-nil only if ListTaskListPartitions threw an
	// exception.
	//
	//   result := deserialize(bytes)
	//   value, err := MatchingService_ListTaskListPartitions_Helper.UnwrapResponse(result)
	UnwrapResponse func(*MatchingService_ListTaskListPartitions_Result) (*shared.ListTaskListPartitionsResponse, error)
}{}

func init() {
	MatchingService_ListTaskListPartitions_Helper.Args = func(
		request *ListTaskListPartitionsRequest,
	) *MatchingService_ListTaskListPartitions_Args {
		return &MatchingService_ListTaskListPartitions_Args{
			Request: request,
		}
	}

	MatchingService_ListTaskListPartitions_Helper.IsException = func(err error) bool {
		switch err.(type) {
		case *shared.BadRequestError:
			return true
		case *shared.InternalServiceError:
			return true
		case *shared.ServiceBusyError:
			return true
		default:
			return false
		}
	}

	MatchingService_ListTaskListPartitions_Helper.WrapResponse = func(success *shared.ListTaskListPartitionsResponse, err error) (*MatchingService_ListTaskListPartitions_Result, error) {
		if err == nil {
			return &MatchingService_ListTaskListPartitions_Result{Success: success}, nil
		}

		switch e := err.(type) {
		case *shared.BadRequestError:
			if e == nil {
				return nil, errors.New("WrapResponse received non-nil error type with nil value for MatchingService_ListTaskListPartitions_Result.BadRequestError")
			}
			return &MatchingService_ListTaskListPartitions_Result{BadRequestError: e}, nil
		case *shared.InternalServiceError:
			if e == nil {
				return nil, errors.New("WrapResponse received non-nil error type with nil value for MatchingService_ListTaskListPartitions_Result.InternalServiceError")
			}
			return &MatchingService_ListTaskListPartitions_Result{InternalServiceError: e}, nil
		case *shared.ServiceBusyError:
			if e == nil {
				return nil, errors.New("WrapResponse received non-nil error type with nil value for MatchingService_ListTaskListPartitions_Result.ServiceBusyError")
			}
			return &MatchingService_ListTaskListPartitions_Result{ServiceBusyError: e}, nil
		}

		return nil, err
	}
	MatchingService_ListTaskListPartitions_Helper.UnwrapResponse = func(result *MatchingService_ListTaskListPartitions_Result) (success *shared.ListTaskListPartitionsResponse, err error) {
		if result.BadRequestError != nil {
			err = result.BadRequestError
			return
		}
		if result.InternalServiceError != nil {
			err = result.InternalServiceError
			return
		}
		if result.ServiceBusyError != nil {
			err = result.ServiceBusyError
			return
		}

		if result.Success != nil {
			success = result.Success
			return
		}

		err = errors.New("expected a non-void result")
		return
	}

}

// MatchingService_ListTaskListPartitions_Result represents the result of a MatchingService.ListTaskListPartitions function call.
//
// The result of a ListTaskListPartitions execution is sent and received over the wire as this struct.
//
// Success is set only if the function did not throw an exception.
type MatchingService_ListTaskListPartitions_Result struct {
	// Value returned by ListTaskListPartitions after a successful execution.
	Success              *shared.ListTaskListPartitionsResponse `json:"success,omitempty"`
	BadRequestError      *shared.BadRequestError                `json:"badRequestError,omitempty"`
	InternalServiceError *shared.InternalServiceError           `json:"internalServiceError,omitempty"`
	ServiceBusyError     *shared.ServiceBusyError               `json:"serviceBusyError,omitempty"`
}

// ToWire translates a MatchingService_ListTaskListPartitions_Result struct into a Thrift-level intermediate
// representation. This intermediate representation may be serialized
// into bytes using a ThriftRW protocol implementation.
//
// An error is returned if the struct or any of its fields failed to
// validate.
//
//	x, err := v.ToWire()
//	if err != nil {
//	  return err
//	}
//
//	if err := binaryProtocol.Encode(x, writer); err != nil {
//	  return err
//	}
func (v *MatchingService_ListTaskListPartitions_Result) ToWire() (wire.Value, error) {
	var (
		fields [4]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.Success != nil {
		w, err = v.Success.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 0, Value: w}
		i++
	}
	if v.BadRequestError != nil {
		w, err = v.BadRequestError.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 1, Value: w}
		i++
	}
	if v.InternalServiceError != nil {
		w, err = v.InternalServiceError.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 2, Value: w}
		i++
	}
	if v.ServiceBusyError != nil {
		w, err = v.ServiceBusyError.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 4, Value: w}
		i++
	}

	if i != 1 {
		return wire.Value{}, fmt.Errorf("MatchingService_ListTaskListPartitions_Result should have exactly one field: got %v fields", i)
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

func _ListTaskListPartitionsResponse_Read(w wire.Value) (*shared.ListTaskListPartitionsResponse, error) {
	var v shared.ListTaskListPartitionsResponse
	err := v.FromWire(w)
	return &v, err
}

// FromWire deserializes a MatchingService_ListTaskListPartitions_Result struct from its Thrift-level
// representation. The Thrift-level representation may be obtained
// from a ThriftRW protocol implementation.
//
// An error is returned if we were unable to build a MatchingService_ListTaskListPartitions_Result struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v MatchingService_ListTaskListPartitions_Result
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *MatchingService_ListTaskListPartitions_Result) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 0:
			if field.Value.Type() == wire.TStruct {
				v.Success, err = _ListTaskListPartitionsResponse_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 1:
			if field.Value.Type() == wire.TStruct {
				v.BadRequestError, err = _BadRequestError_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 2:
			if field.Value.Type() == wire.TStruct {
				v.InternalServiceError, err = _InternalServiceError_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 4:
			if field.Value.Type() == wire.TStruct {
				v.ServiceBusyError, err = _ServiceBusyError_Read(field.Value)
				if err != nil {
					return err
				}

			}
		}
	}

	count := 0
	if v.Success != nil {
		count++
	}
	if v.BadRequestError != nil {
		count++
	}
	if v.InternalServiceError != nil {
		count++
	}
	if v.ServiceBusyError != nil {
		count++
	}
	if count != 1 {
		return fmt.Errorf("MatchingService_ListTaskListPartitions_Result should have exactly one field: got %v fields", count)
	}

	return nil
}

// Encode serializes a MatchingService_ListTaskListPartitions_Result struct directly into bytes, without going
// through an intermediary type.
//
// An error is returned if a MatchingService_ListTaskListPartitions_Result struct could not be encoded.
func (v *MatchingService_ListTaskListPartitions_Result) Encode(sw stream.Writer) error {
	if err := sw.WriteStructBegin(); err != nil {
		return err
	}

	if v.Success != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 0, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.Success.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.BadRequestError != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 1, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.BadRequestError.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.InternalServiceError != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 2, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.InternalServiceError.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.ServiceBusyError != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 4, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.ServiceBusyError.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	count := 0
	if v.Success != nil {
		count++
	}
	if v.BadRequestError != nil {
		count++
	}
	if v.InternalServiceError != nil {
		count++
	}
	if v.ServiceBusyError != nil {
		count++
	}

	if count != 1 {
		return fmt.Errorf("MatchingService_ListTaskListPartitions_Result should have exactly one field: got %v fields", count)
	}

	return sw.WriteStructEnd()
}

func _ListTaskListPartitionsResponse_Decode(sr stream.Reader) (*shared.ListTaskListPartitionsResponse, error) {
	var v shared.ListTaskListPartitionsResponse
	err := v.Decode(sr)
	return &v, err
}

// Decode deserializes a MatchingService_ListTaskListPartitions_Result struct directly from its Thrift-level
// representation, without going through an intemediary type.
//
// An error is returned if a MatchingService_ListTaskListPartitions_Result struct could not be generated from the wire
// representation.
func (v *MatchingService_ListTaskListPartitions_Result) Decode(sr stream.Reader) error {

	if err := sr.ReadStructBegin(); err != nil {
		return err
	}

	fh, ok, err := sr.ReadFieldBegin()
	if err != nil {
		return err
	}

	for ok {
		switch {
		case fh.ID == 0 && fh.Type == wire.TStruct:
			v.Success, err = _ListTaskListPartitionsResponse_Decode(sr)
			if err != nil {
				return err
			}

		case fh.ID == 1 && fh.Type == wire.TStruct:
			v.BadRequestError, err = _BadRequestError_Decode(sr)
			if err != nil {
				return err
			}

		case fh.ID == 2 && fh.Type == wire.TStruct:
			v.InternalServiceError, err = _InternalServiceError_Decode(sr)
			if err != nil {
				return err
			}

		case fh.ID == 4 && fh.Type == wire.TStruct:
			v.ServiceBusyError, err = _ServiceBusyError_Decode(sr)
			if err != nil {
				return err
			}

		default:
			if err := sr.Skip(fh.Type); err != nil {
				return err
			}
		}

		if err := sr.ReadFieldEnd(); err != nil {
			return err
		}

		if fh, ok, err = sr.ReadFieldBegin(); err != nil {
			return err
		}
	}

	if err := sr.ReadStructEnd(); err != nil {
		return err
	}

	count := 0
	if v.Success != nil {
		count++
	}
	if v.BadRequestError != nil {
		count++
	}
	if v.InternalServiceError != nil {
		count++
	}
	if v.ServiceBusyError != nil {
		count++
	}
	if count != 1 {
		return fmt.Errorf("MatchingService_ListTaskListPartitions_Result should have exactly one field: got %v fields", count)
	}

	return nil
}

// String returns a readable string representation of a MatchingService_ListTaskListPartitions_Result
// struct.
func (v *MatchingService_ListTaskListPartitions_Result) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [4]string
	i := 0
	if v.Success != nil {
		fields[i] = fmt.Sprintf("Success: %v", v.Success)
		i++
	}
	if v.BadRequestError != nil {
		fields[i] = fmt.Sprintf("BadRequestError: %v", v.BadRequestError)
		i++
	}
	if v.InternalServiceError != nil {
		fields[i] = fmt.Sprintf("InternalServiceError: %v", v.InternalServiceError)
		i++
	}
	if v.ServiceBusyError != nil {
		fields[i] = fmt.Sprintf("ServiceBusyError: %v", v.ServiceBusyError)
		i++
	}

	return fmt.Sprintf("MatchingService_ListTaskListPartitions_Result{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this MatchingService_ListTaskListPartitions_Result match the
// provided MatchingService_ListTaskListPartitions_Result.
//
// This function performs a deep comparison.
func (v *MatchingService_ListTaskListPartitions_Result) Equals(rhs *MatchingService_ListTaskListPartitions_Result) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !((v.Success == nil && rhs.Success == nil) || (v.Success != nil && rhs.Success != nil && v.Success.Equals(rhs.Success))) {
		return false
	}
	if !((v.BadRequestError == nil && rhs.BadRequestError == nil) || (v.BadRequestError != nil && rhs.BadRequestError != nil && v.BadRequestError.Equals(rhs.BadRequestError))) {
		return false
	}
	if !((v.InternalServiceError == nil && rhs.InternalServiceError == nil) || (v.InternalServiceError != nil && rhs.InternalServiceError != nil && v.InternalServiceError.Equals(rhs.InternalServiceError))) {
		return false
	}
	if !((v.ServiceBusyError == nil && rhs.ServiceBusyError == nil) || (v.ServiceBusyError != nil && rhs.ServiceBusyError != nil && v.ServiceBusyError.Equals(rhs.ServiceBusyError))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of MatchingService_ListTaskListPartitions_Result.
func (v *MatchingService_ListTaskListPartitions_Result) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Success != nil {
		err = multierr.Append(err, enc.AddObject("success", v.Success))
	}
	if v.BadRequestError != nil {
		err = multierr.Append(err, enc.AddObject("badRequestError", v.BadRequestError))
	}
	if v.InternalServiceError != nil {
		err = multierr.Append(err, enc.AddObject("internalServiceError", v.InternalServiceError))
	}
	if v.ServiceBusyError != nil {
		err = multierr.Append(err, enc.AddObject("serviceBusyError", v.ServiceBusyError))
	}
	return err
}

// GetSuccess returns the value of Success if it is set or its
// zero value if it is unset.
func (v *MatchingService_ListTaskListPartitions_Result) GetSuccess() (o *shared.ListTaskListPartitionsResponse) {
	if v != nil && v.Success != nil {
		return v.Success
	}

	return
}

// IsSetSuccess returns true if Success is not nil.
func (v *MatchingService_ListTaskListPartitions_Result) IsSetSuccess() bool {
	return v != nil && v.Success != nil
}

// GetBadRequestError returns the value of BadRequestError if it is set or its
// zero value if it is unset.
func (v *MatchingService_ListTaskListPartitions_Result) GetBadRequestError() (o *shared.BadRequestError) {
	if v != nil && v.BadRequestError != nil {
		return v.BadRequestError
	}

	return
}

// IsSetBadRequestError returns true if BadRequestError is not nil.
func (v *MatchingService_ListTaskListPartitions_Result) IsSetBadRequestError() bool {
	return v != nil && v.BadRequestError != nil
}

// GetInternalServiceError returns the value of InternalServiceError if it is set or its
// zero value if it is unset.
func (v *MatchingService_ListTaskListPartitions_Result) GetInternalServiceError() (o *shared.InternalServiceError) {
	if v != nil && v.InternalServiceError != nil {
		return v.InternalServiceError
	}

	return
}

// IsSetInternalServiceError returns true if InternalServiceError is not nil.
func (v *MatchingService_ListTaskListPartitions_Result) IsSetInternalServiceError() bool {
	return v != nil && v.InternalServiceError != nil
}

// GetServiceBusyError returns the value of ServiceBusyError if it is set or its
// zero value if it is unset.
func (v *MatchingService_ListTaskListPartitions_Result) GetServiceBusyError() (o *shared.ServiceBusyError) {
	if v != nil && v.ServiceBusyError != nil {
		return v.ServiceBusyError
	}

	return
}

// IsSetServiceBusyError returns true if ServiceBusyError is not nil.
func (v *MatchingService_ListTaskListPartitions_Result) IsSetServiceBusyError() bool {
	return v != nil && v.ServiceBusyError != nil
}

// MethodName returns the name of the Thrift function as specified in
// the IDL, for which this struct represent the result.
//
// This will always be "ListTaskListPartitions" for this struct.
func (v *MatchingService_ListTaskListPartitions_Result) MethodName() string {
	return "ListTaskListPartitions"
}

// EnvelopeType returns the kind of value inside this struct.
//
// This will always be Reply for this struct.
func (v *MatchingService_ListTaskListPartitions_Result) EnvelopeType() wire.EnvelopeType {
	return wire.Reply
}

// MatchingService_PollForActivityTask_Args represents the arguments for the MatchingService.PollForActivityTask function.
//
// The arguments for PollForActivityTask are sent and received over the wire as this struct.
type MatchingService_PollForActivityTask_Args struct {
	PollRequest *PollForActivityTaskRequest `json:"pollRequest,omitempty"`
}

// ToWire translates a MatchingService_PollForActivityTask_Args struct into a Thrift-level intermediate
// representation. This intermediate representation may be serialized
// into bytes using a ThriftRW protocol implementation.
//
// An error is returned if the struct or any of its fields failed to
// validate.
//
//	x, err := v.ToWire()
//	if err != nil {
//	  return err
//	}
//
//	if err := binaryProtocol.Encode(x, writer); err != nil {
//	  return err
//	}
func (v *MatchingService_PollForActivityTask_Args) ToWire() (wire.Value, error) {
	var (
		fields [1]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.PollRequest != nil {
		w, err = v.PollRequest.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 1, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

func _PollForActivityTaskRequest_1_Read(w wire.Value) (*PollForActivityTaskRequest, error) {
	var v PollForActivityTaskRequest
	err := v.FromWire(w)
	return &v, err
}

// FromWire deserializes a MatchingService_PollForActivityTask_Args struct from its Thrift-level
// representation. The Thrift-level representation may be obtained
// from a ThriftRW protocol implementation.
//
// An error is returned if we were unable to build a MatchingService_PollForActivityTask_Args struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v MatchingService_PollForActivityTask_Args
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *MatchingService_PollForActivityTask_Args) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 1:
			if field.Value.Type() == wire.TStruct {
				v.PollRequest, err = _PollForActivityTaskRequest_1_Read(field.Value)
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// Encode serializes a MatchingService_PollForActivityTask_Args struct directly into bytes, without going
// through an intermediary type.
//
// An error is returned if a MatchingService_PollForActivityTask_Args struct could not be encoded.
func (v *MatchingService_PollForActivityTask_Args) Encode(sw stream.Writer) error {
	if err := sw.WriteStructBegin(); err != nil {
		return err
	}

	if v.PollRequest != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 1, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.PollRequest.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	return sw.WriteStructEnd()
}

func _PollForActivityTaskRequest_1_Decode(sr stream.Reader) (*PollForActivityTaskRequest, error) {
	var v PollForActivityTaskRequest
	err := v.Decode(sr)
	return &v, err
}

// Decode deserializes a MatchingService_PollForActivityTask_Args struct directly from its Thrift-level
// representation, without going through an intemediary type.
//
// An error is returned if a MatchingService_PollForActivityTask_Args struct could not be generated from the wire
// representation.
func (v *MatchingService_PollForActivityTask_Args) Decode(sr stream.Reader) error {

	if err := sr.ReadStructBegin(); err != nil {
		return err
	}

	fh, ok, err := sr.ReadFieldBegin()
	if err != nil {
		return err
	}

	for ok {
		switch {
		case fh.ID == 1 && fh.Type == wire.TStruct:
			v.PollRequest, err = _PollForActivityTaskRequest_1_Decode(sr)
			if err != nil {
				return err
			}

		default:
			if err := sr.Skip(fh.Type); err != nil {
				return err
			}
		}

		if err := sr.ReadFieldEnd(); err != nil {
			return err
		}

		if fh, ok, err = sr.ReadFieldBegin(); err != nil {
			return err
		}
	}

	if err := sr.ReadStructEnd(); err != nil {
		return err
	}

	return nil
}

// String returns a readable string representation of a MatchingService_PollForActivityTask_Args
// struct.
func (v *MatchingService_PollForActivityTask_Args) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [1]string
	i := 0
	if v.PollRequest != nil {
		fields[i] = fmt.Sprintf("PollRequest: %v", v.PollRequest)
		i++
	}

	return fmt.Sprintf("MatchingService_PollForActivityTask_Args{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this MatchingService_PollForActivityTask_Args match the
// provided MatchingService_PollForActivityTask_Args.
//
// This function performs a deep comparison.
func (v *MatchingService_PollForActivityTask_Args) Equals(rhs *MatchingService_PollForActivityTask_Args) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !((v.PollRequest == nil && rhs.PollRequest == nil) || (v.PollRequest != nil && rhs.PollRequest != nil && v.PollRequest.Equals(rhs.PollRequest))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of MatchingService_PollForActivityTask_Args.
func (v *MatchingService_PollForActivityTask_Args) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.PollRequest != nil {
		err = multierr.Append(err, enc.AddObject("pollRequest", v.PollRequest))
	}
	return err
}

// GetPollRequest returns the value of PollRequest if it is set or its
// zero value if it is unset.
func (v *MatchingService_PollForActivityTask_Args) GetPollRequest() (o *PollForActivityTaskRequest) {
	if v != nil && v.PollRequest != nil {
		return v.PollRequest
	}

	return
}

// IsSetPollRequest returns true if PollRequest is not nil.
func (v *MatchingService_PollForActivityTask_Args) IsSetPollRequest() bool {
	return v != nil && v.PollRequest != nil
}

// MethodName returns the name of the Thrift function as specified in
// the IDL, for which this struct represent the arguments.
//
// This will always be "PollForActivityTask" for this struct.
func (v *MatchingService_PollForActivityTask_Args) MethodName() string {
	return "PollForActivityTask"
}

// EnvelopeType returns the kind of value inside this struct.
//
// This will always be Call for this struct.
func (v *MatchingService_PollForActivityTask_Args) EnvelopeType() wire.EnvelopeType {
	return wire.Call
}

// MatchingService_PollForActivityTask_Helper provides functions that aid in handling the
// parameters and return values of the MatchingService.PollForActivityTask
// function.
var MatchingService_PollForActivityTask_Helper = struct {
	// Args accepts the parameters of PollForActivityTask in-order and returns
	// the arguments struct for the function.
	Args func(
		pollRequest *PollForActivityTaskRequest,
	) *MatchingService_PollForActivityTask_Args

	// IsException returns true if the given error can be thrown
	// by PollForActivityTask.
	//
	// An error can be thrown by PollForActivityTask only if the
	// corresponding exception type was mentioned in the 'throws'
	// section for it in the Thrift file.
	IsException func(error) bool

	// WrapResponse returns the result struct for PollForActivityTask
	// given its return value and error.
	//
	// This allows mapping values and errors returned by
	// PollForActivityTask into a serializable result struct.
	// WrapResponse returns a non-nil error if the provided
	// error cannot be thrown by PollForActivityTask
	//
	//   value, err := PollForActivityTask(args)
	//   result, err := MatchingService_PollForActivityTask_Helper.WrapResponse(value, err)
	//   if err != nil {
	//     return fmt.Errorf("unexpected error from PollForActivityTask: %v", err)
	//   }
	//   serialize(result)
	WrapResponse func(*shared.PollForActivityTaskResponse, error) (*MatchingService_PollForActivityTask_Result, error)

	// UnwrapResponse takes the result struct for PollForActivityTask
	// and returns the value or error returned by it.
	//
	// The error is non-nil only if PollForActivityTask threw an
	// exception.
	//
	//   result := deserialize(bytes)
	//   value, err := MatchingService_PollForActivityTask_Helper.UnwrapResponse(result)
	UnwrapResponse func(*MatchingService_PollForActivityTask_Result) (*shared.PollForActivityTaskResponse, error)
}{}

func init() {
	MatchingService_PollForActivityTask_Helper.Args = func(
		pollRequest *PollForActivityTaskRequest,
	) *MatchingService_PollForActivityTask_Args {
		return &MatchingService_PollForActivityTask_Args{
			PollRequest: pollRequest,
		}
	}

	MatchingService_PollForActivityTask_Helper.IsException = func(err error) bool {
		switch err.(type) {
		case *shared.BadRequestError:
			return true
		case *shared.InternalServiceError:
			return true
		case *shared.LimitExceededError:
			return true
		case *shared.ServiceBusyError:
			return true
		default:
			return false
		}
	}

	MatchingService_PollForActivityTask_Helper.WrapResponse = func(success *shared.PollForActivityTaskResponse, err error) (*MatchingService_PollForActivityTask_Result, error) {
		if err == nil {
			return &MatchingService_PollForActivityTask_Result{Success: success}, nil
		}

		switch e := err.(type) {
		case *shared.BadRequestError:
			if e == nil {
				return nil, errors.New("WrapResponse received non-nil error type with nil value for MatchingService_PollForActivityTask_Result.BadRequestError")
			}
			return &MatchingService_PollForActivityTask_Result{BadRequestError: e}, nil
		case *shared.InternalServiceError:
			if e == nil {
				return nil, errors.New("WrapResponse received non-nil error type with nil value for MatchingService_PollForActivityTask_Result.InternalServiceError")
			}
			return &MatchingService_PollForActivityTask_Result{InternalServiceError: e}, nil
		case *shared.LimitExceededError:
			if e == nil {
				return nil, errors.New("WrapResponse received non-nil error type with nil value for MatchingService_PollForActivityTask_Result.LimitExceededError")
			}
			return &MatchingService_PollForActivityTask_Result{LimitExceededError: e}, nil
		case *shared.ServiceBusyError:
			if e == nil {
				return nil, errors.New("WrapResponse received non-nil error type with nil value for MatchingService_PollForActivityTask_Result.ServiceBusyError")
			}
			return &MatchingService_PollForActivityTask_Result{ServiceBusyError: e}, nil
		}

		return nil, err
	}
	MatchingService_PollForActivityTask_Helper.UnwrapResponse = func(result *MatchingService_PollForActivityTask_Result) (success *shared.PollForActivityTaskResponse, err error) {
		if result.BadRequestError != nil {
			err = result.BadRequestError
			return
		}
		if result.InternalServiceError != nil {
			err = result.InternalServiceError
			return
		}
		if result.LimitExceededError != nil {
			err = result.LimitExceededError
			return
		}
		if result.ServiceBusyError != nil {
			err = result.ServiceBusyError
			return
		}

		if result.Success != nil {
			success = result.Success
			return
		}

		err = errors.New("expected a non-void result")
		return
	}

}

// MatchingService_PollForActivityTask_Result represents the result of a MatchingService.PollForActivityTask function call.
//
// The result of a PollForActivityTask execution is sent and received over the wire as this struct.
//
// Success is set only if the function did not throw an exception.
type MatchingService_PollForActivityTask_Result struct {
	// Value returned by PollForActivityTask after a successful execution.
	Success              *shared.PollForActivityTaskResponse `json:"success,omitempty"`
	BadRequestError      *shared.BadRequestError             `json:"badRequestError,omitempty"`
	InternalServiceError *shared.InternalServiceError        `json:"internalServiceError,omitempty"`
	LimitExceededError   *shared.LimitExceededError          `json:"limitExceededError,omitempty"`
	ServiceBusyError     *shared.ServiceBusyError            `json:"serviceBusyError,omitempty"`
}

// ToWire translates a MatchingService_PollForActivityTask_Result struct into a Thrift-level intermediate
// representation. This intermediate representation may be serialized
// into bytes using a ThriftRW protocol implementation.
//
// An error is returned if the struct or any of its fields failed to
// validate.
//
//	x, err := v.ToWire()
//	if err != nil {
//	  return err
//	}
//
//	if err := binaryProtocol.Encode(x, writer); err != nil {
//	  return err
//	}
func (v *MatchingService_PollForActivityTask_Result) ToWire() (wire.Value, error) {
	var (
		fields [5]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.Success != nil {
		w, err = v.Success.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 0, Value: w}
		i++
	}
	if v.BadRequestError != nil {
		w, err = v.BadRequestError.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 1, Value: w}
		i++
	}
	if v.InternalServiceError != nil {
		w, err = v.InternalServiceError.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 2, Value: w}
		i++
	}
	if v.LimitExceededError != nil {
		w, err = v.LimitExceededError.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 3, Value: w}
		i++
	}
	if v.ServiceBusyError != nil {
		w, err = v.ServiceBusyError.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 4, Value: w}
		i++
	}

	if i != 1 {
		return wire.Value{}, fmt.Errorf("MatchingService_PollForActivityTask_Result should have exactly one field: got %v fields", i)
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

func _PollForActivityTaskResponse_Read(w wire.Value) (*shared.PollForActivityTaskResponse, error) {
	var v shared.PollForActivityTaskResponse
	err := v.FromWire(w)
	return &v, err
}

// FromWire deserializes a MatchingService_PollForActivityTask_Result struct from its Thrift-level
// representation. The Thrift-level representation may be obtained
// from a ThriftRW protocol implementation.
//
// An error is returned if we were unable to build a MatchingService_PollForActivityTask_Result struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v MatchingService_PollForActivityTask_Result
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *MatchingService_PollForActivityTask_Result) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 0:
			if field.Value.Type() == wire.TStruct {
				v.Success, err = _PollForActivityTaskResponse_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 1:
			if field.Value.Type() == wire.TStruct {
				v.BadRequestError, err = _BadRequestError_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 2:
			if field.Value.Type() == wire.TStruct {
				v.InternalServiceError, err = _InternalServiceError_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 3:
			if field.Value.Type() == wire.TStruct {
				v.LimitExceededError, err = _LimitExceededError_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 4:
			if field.Value.Type() == wire.TStruct {
				v.ServiceBusyError, err = _ServiceBusyError_Read(field.Value)
				if err != nil {
					return err
				}

			}
		}
	}

	count := 0
	if v.Success != nil {
		count++
	}
	if v.BadRequestError != nil {
		count++
	}
	if v.InternalServiceError != nil {
		count++
	}
	if v.LimitExceededError != nil {
		count++
	}
	if v.ServiceBusyError != nil {
		count++
	}
	if count != 1 {
		return fmt.Errorf("MatchingService_PollForActivityTask_Result should have exactly one field: got %v fields", count)
	}

	return nil
}

// Encode serializes a MatchingService_PollForActivityTask_Result struct directly into bytes, without going
// through an intermediary type.
//
// An error is returned if a MatchingService_PollForActivityTask_Result struct could not be encoded.
func (v *MatchingService_PollForActivityTask_Result) Encode(sw stream.Writer) error {
	if err := sw.WriteStructBegin(); err != nil {
		return err
	}

	if v.Success != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 0, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.Success.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.BadRequestError != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 1, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.BadRequestError.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.InternalServiceError != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 2, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.InternalServiceError.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.LimitExceededError != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 3, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.LimitExceededError.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.ServiceBusyError != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 4, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.ServiceBusyError.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	count := 0
	if v.Success != nil {
		count++
	}
	if v.BadRequestError != nil {
		count++
	}
	if v.InternalServiceError != nil {
		count++
	}
	if v.LimitExceededError != nil {
		count++
	}
	if v.ServiceBusyError != nil {
		count++
	}

	if count != 1 {
		return fmt.Errorf("MatchingService_PollForActivityTask_Result should have exactly one field: got %v fields", count)
	}

	return sw.WriteStructEnd()
}

func _PollForActivityTaskResponse_Decode(sr stream.Reader) (*shared.PollForActivityTaskResponse, error) {
	var v shared.PollForActivityTaskResponse
	err := v.Decode(sr)
	return &v, err
}

// Decode deserializes a MatchingService_PollForActivityTask_Result struct directly from its Thrift-level
// representation, without going through an intemediary type.
//
// An error is returned if a MatchingService_PollForActivityTask_Result struct could not be generated from the wire
// representation.
func (v *MatchingService_PollForActivityTask_Result) Decode(sr stream.Reader) error {

	if err := sr.ReadStructBegin(); err != nil {
		return err
	}

	fh, ok, err := sr.ReadFieldBegin()
	if err != nil {
		return err
	}

	for ok {
		switch {
		case fh.ID == 0 && fh.Type == wire.TStruct:
			v.Success, err = _PollForActivityTaskResponse_Decode(sr)
			if err != nil {
				return err
			}

		case fh.ID == 1 && fh.Type == wire.TStruct:
			v.BadRequestError, err = _BadRequestError_Decode(sr)
			if err != nil {
				return err
			}

		case fh.ID == 2 && fh.Type == wire.TStruct:
			v.InternalServiceError, err = _InternalServiceError_Decode(sr)
			if err != nil {
				return err
			}

		case fh.ID == 3 && fh.Type == wire.TStruct:
			v.LimitExceededError, err = _LimitExceededError_Decode(sr)
			if err != nil {
				return err
			}

		case fh.ID == 4 && fh.Type == wire.TStruct:
			v.ServiceBusyError, err = _ServiceBusyError_Decode(sr)
			if err != nil {
				return err
			}

		default:
			if err := sr.Skip(fh.Type); err != nil {
				return err
			}
		}

		if err := sr.ReadFieldEnd(); err != nil {
			return err
		}

		if fh, ok, err = sr.ReadFieldBegin(); err != nil {
			return err
		}
	}

	if err := sr.ReadStructEnd(); err != nil {
		return err
	}

	count := 0
	if v.Success != nil {
		count++
	}
	if v.BadRequestError != nil {
		count++
	}
	if v.InternalServiceError != nil {
		count++
	}
	if v.LimitExceededError != nil {
		count++
	}
	if v.ServiceBusyError != nil {
		count++
	}
	if count != 1 {
		return fmt.Errorf("MatchingService_PollForActivityTask_Result should have exactly one field: got %v fields", count)
	}

	return nil
}

// String returns a readable string representation of a MatchingService_PollForActivityTask_Result
// struct.
func (v *MatchingService_PollForActivityTask_Result) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [5]string
	i := 0
	if v.Success != nil {
		fields[i] = fmt.Sprintf("Success: %v", v.Success)
		i++
	}
	if v.BadRequestError != nil {
		fields[i] = fmt.Sprintf("BadRequestError: %v", v.BadRequestError)
		i++
	}
	if v.InternalServiceError != nil {
		fields[i] = fmt.Sprintf("InternalServiceError: %v", v.InternalServiceError)
		i++
	}
	if v.LimitExceededError != nil {
		fields[i] = fmt.Sprintf("LimitExceededError: %v", v.LimitExceededError)
		i++
	}
	if v.ServiceBusyError != nil {
		fields[i] = fmt.Sprintf("ServiceBusyError: %v", v.ServiceBusyError)
		i++
	}

	return fmt.Sprintf("MatchingService_PollForActivityTask_Result{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this MatchingService_PollForActivityTask_Result match the
// provided MatchingService_PollForActivityTask_Result.
//
// This function performs a deep comparison.
func (v *MatchingService_PollForActivityTask_Result) Equals(rhs *MatchingService_PollForActivityTask_Result) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !((v.Success == nil && rhs.Success == nil) || (v.Success != nil && rhs.Success != nil && v.Success.Equals(rhs.Success))) {
		return false
	}
	if !((v.BadRequestError == nil && rhs.BadRequestError == nil) || (v.BadRequestError != nil && rhs.BadRequestError != nil && v.BadRequestError.Equals(rhs.BadRequestError))) {
		return false
	}
	if !((v.InternalServiceError == nil && rhs.InternalServiceError == nil) || (v.InternalServiceError != nil && rhs.InternalServiceError != nil && v.InternalServiceError.Equals(rhs.InternalServiceError))) {
		return false
	}
	if !((v.LimitExceededError == nil && rhs.LimitExceededError == nil) || (v.LimitExceededError != nil && rhs.LimitExceededError != nil && v.LimitExceededError.Equals(rhs.LimitExceededError))) {
		return false
	}
	if !((v.ServiceBusyError == nil && rhs.ServiceBusyError == nil) || (v.ServiceBusyError != nil && rhs.ServiceBusyError != nil && v.ServiceBusyError.Equals(rhs.ServiceBusyError))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of MatchingService_PollForActivityTask_Result.
func (v *MatchingService_PollForActivityTask_Result) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Success != nil {
		err = multierr.Append(err, enc.AddObject("success", v.Success))
	}
	if v.BadRequestError != nil {
		err = multierr.Append(err, enc.AddObject("badRequestError", v.BadRequestError))
	}
	if v.InternalServiceError != nil {
		err = multierr.Append(err, enc.AddObject("internalServiceError", v.InternalServiceError))
	}
	if v.LimitExceededError != nil {
		err = multierr.Append(err, enc.AddObject("limitExceededError", v.LimitExceededError))
	}
	if v.ServiceBusyError != nil {
		err = multierr.Append(err, enc.AddObject("serviceBusyError", v.ServiceBusyError))
	}
	return err
}

// GetSuccess returns the value of Success if it is set or its
// zero value if it is unset.
func (v *MatchingService_PollForActivityTask_Result) GetSuccess() (o *shared.PollForActivityTaskResponse) {
	if v != nil && v.Success != nil {
		return v.Success
	}

	return
}

// IsSetSuccess returns true if Success is not nil.
func (v *MatchingService_PollForActivityTask_Result) IsSetSuccess() bool {
	return v != nil && v.Success != nil
}

// GetBadRequestError returns the value of BadRequestError if it is set or its
// zero value if it is unset.
func (v *MatchingService_PollForActivityTask_Result) GetBadRequestError() (o *shared.BadRequestError) {
	if v != nil && v.BadRequestError != nil {
		return v.BadRequestError
	}

	return
}

// IsSetBadRequestError returns true if BadRequestError is not nil.
func (v *MatchingService_PollForActivityTask_Result) IsSetBadRequestError() bool {
	return v != nil && v.BadRequestError != nil
}

// GetInternalServiceError returns the value of InternalServiceError if it is set or its
// zero value if it is unset.
func (v *MatchingService_PollForActivityTask_Result) GetInternalServiceError() (o *shared.InternalServiceError) {
	if v != nil && v.InternalServiceError != nil {
		return v.InternalServiceError
	}

	return
}

// IsSetInternalServiceError returns true if InternalServiceError is not nil.
func (v *MatchingService_PollForActivityTask_Result) IsSetInternalServiceError() bool {
	return v != nil && v.InternalServiceError != nil
}

// GetLimitExceededError returns the value of LimitExceededError if it is set or its
// zero value if it is unset.
func (v *MatchingService_PollForActivityTask_Result) GetLimitExceededError() (o *shared.LimitExceededError) {
	if v != nil && v.LimitExceededError != nil {
		return v.LimitExceededError
	}

	return
}

// IsSetLimitExceededError returns true if LimitExceededError is not nil.
func (v *MatchingService_PollForActivityTask_Result) IsSetLimitExceededError() bool {
	return v != nil && v.LimitExceededError != nil
}

// GetServiceBusyError returns the value of ServiceBusyError if it is set or its
// zero value if it is unset.
func (v *MatchingService_PollForActivityTask_Result) GetServiceBusyError() (o *shared.ServiceBusyError) {
	if v != nil && v.ServiceBusyError != nil {
		return v.ServiceBusyError
	}

	return
}

// IsSetServiceBusyError returns true if ServiceBusyError is not nil.
func (v *MatchingService_PollForActivityTask_Result) IsSetServiceBusyError() bool {
	return v != nil && v.ServiceBusyError != nil
}

// MethodName returns the name of the Thrift function as specified in
// the IDL, for which this struct represent the result.
//
// This will always be "PollForActivityTask" for this struct.
func (v *MatchingService_PollForActivityTask_Result) MethodName() string {
	return "PollForActivityTask"
}

// EnvelopeType returns the kind of value inside this struct.
//
// This will always be Reply for this struct.
func (v *MatchingService_PollForActivityTask_Result) EnvelopeType() wire.EnvelopeType {
	return wire.Reply
}

// MatchingService_PollForDecisionTask_Args represents the arguments for the MatchingService.PollForDecisionTask function.
//
// The arguments for PollForDecisionTask are sent and received over the wire as this struct.
type MatchingService_PollForDecisionTask_Args struct {
	PollRequest *PollForDecisionTaskRequest `json:"pollRequest,omitempty"`
}

// ToWire translates a MatchingService_PollForDecisionTask_Args struct into a Thrift-level intermediate
// representation. This intermediate representation may be serialized
// into bytes using a ThriftRW protocol implementation.
//
// An error is returned if the struct or any of its fields failed to
// validate.
//
//	x, err := v.ToWire()
//	if err != nil {
//	  return err
//	}
//
//	if err := binaryProtocol.Encode(x, writer); err != nil {
//	  return err
//	}
func (v *MatchingService_PollForDecisionTask_Args) ToWire() (wire.Value, error) {
	var (
		fields [1]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.PollRequest != nil {
		w, err = v.PollRequest.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 1, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

func _PollForDecisionTaskRequest_1_Read(w wire.Value) (*PollForDecisionTaskRequest, error) {
	var v PollForDecisionTaskRequest
	err := v.FromWire(w)
	return &v, err
}

// FromWire deserializes a MatchingService_PollForDecisionTask_Args struct from its Thrift-level
// representation. The Thrift-level representation may be obtained
// from a ThriftRW protocol implementation.
//
// An error is returned if we were unable to build a MatchingService_PollForDecisionTask_Args struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v MatchingService_PollForDecisionTask_Args
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *MatchingService_PollForDecisionTask_Args) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 1:
			if field.Value.Type() == wire.TStruct {
				v.PollRequest, err = _PollForDecisionTaskRequest_1_Read(field.Value)
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// Encode serializes a MatchingService_PollForDecisionTask_Args struct directly into bytes, without going
// through an intermediary type.
//
// An error is returned if a MatchingService_PollForDecisionTask_Args struct could not be encoded.
func (v *MatchingService_PollForDecisionTask_Args) Encode(sw stream.Writer) error {
	if err := sw.WriteStructBegin(); err != nil {
		return err
	}

	if v.PollRequest != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 1, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.PollRequest.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	return sw.WriteStructEnd()
}

func _PollForDecisionTaskRequest_1_Decode(sr stream.Reader) (*PollForDecisionTaskRequest, error) {
	var v PollForDecisionTaskRequest
	err := v.Decode(sr)
	return &v, err
}

// Decode deserializes a MatchingService_PollForDecisionTask_Args struct directly from its Thrift-level
// representation, without going through an intemediary type.
//
// An error is returned if a MatchingService_PollForDecisionTask_Args struct could not be generated from the wire
// representation.
func (v *MatchingService_PollForDecisionTask_Args) Decode(sr stream.Reader) error {

	if err := sr.ReadStructBegin(); err != nil {
		return err
	}

	fh, ok, err := sr.ReadFieldBegin()
	if err != nil {
		return err
	}

	for ok {
		switch {
		case fh.ID == 1 && fh.Type == wire.TStruct:
			v.PollRequest, err = _PollForDecisionTaskRequest_1_Decode(sr)
			if err != nil {
				return err
			}

		default:
			if err := sr.Skip(fh.Type); err != nil {
				return err
			}
		}

		if err := sr.ReadFieldEnd(); err != nil {
			return err
		}

		if fh, ok, err = sr.ReadFieldBegin(); err != nil {
			return err
		}
	}

	if err := sr.ReadStructEnd(); err != nil {
		return err
	}

	return nil
}

// String returns a readable string representation of a MatchingService_PollForDecisionTask_Args
// struct.
func (v *MatchingService_PollForDecisionTask_Args) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [1]string
	i := 0
	if v.PollRequest != nil {
		fields[i] = fmt.Sprintf("PollRequest: %v", v.PollRequest)
		i++
	}

	return fmt.Sprintf("MatchingService_PollForDecisionTask_Args{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this MatchingService_PollForDecisionTask_Args match the
// provided MatchingService_PollForDecisionTask_Args.
//
// This function performs a deep comparison.
func (v *MatchingService_PollForDecisionTask_Args) Equals(rhs *MatchingService_PollForDecisionTask_Args) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !((v.PollRequest == nil && rhs.PollRequest == nil) || (v.PollRequest != nil && rhs.PollRequest != nil && v.PollRequest.Equals(rhs.PollRequest))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of MatchingService_PollForDecisionTask_Args.
func (v *MatchingService_PollForDecisionTask_Args) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.PollRequest != nil {
		err = multierr.Append(err, enc.AddObject("pollRequest", v.PollRequest))
	}
	return err
}

// GetPollRequest returns the value of PollRequest if it is set or its
// zero value if it is unset.
func (v *MatchingService_PollForDecisionTask_Args) GetPollRequest() (o *PollForDecisionTaskRequest) {
	if v != nil && v.PollRequest != nil {
		return v.PollRequest
	}

	return
}

// IsSetPollRequest returns true if PollRequest is not nil.
func (v *MatchingService_PollForDecisionTask_Args) IsSetPollRequest() bool {
	return v != nil && v.PollRequest != nil
}

// MethodName returns the name of the Thrift function as specified in
// the IDL, for which this struct represent the arguments.
//
// This will always be "PollForDecisionTask" for this struct.
func (v *MatchingService_PollForDecisionTask_Args) MethodName() string {
	return "PollForDecisionTask"
}

// EnvelopeType returns the kind of value inside this struct.
//
// This will always be Call for this struct.
func (v *MatchingService_PollForDecisionTask_Args) EnvelopeType() wire.EnvelopeType {
	return wire.Call
}

// MatchingService_PollForDecisionTask_Helper provides functions that aid in handling the
// parameters and return values of the MatchingService.PollForDecisionTask
// function.
var MatchingService_PollForDecisionTask_Helper = struct {
	// Args accepts the parameters of PollForDecisionTask in-order and returns
	// the arguments struct for the function.
	Args func(
		pollRequest *PollForDecisionTaskRequest,
	) *MatchingService_PollForDecisionTask_Args

	// IsException returns true if the given error can be thrown
	// by PollForDecisionTask.
	//
	// An error can be thrown by PollForDecisionTask only if the
	// corresponding exception type was mentioned in the 'throws'
	// section for it in the Thrift file.
	IsException func(error) bool

	// WrapResponse returns the result struct for PollForDecisionTask
	// given its return value and error.
	//
	// This allows mapping values and errors returned by
	// PollForDecisionTask into a serializable result struct.
	// WrapResponse returns a non-nil error if the provided
	// error cannot be thrown by PollForDecisionTask
	//
	//   value, err := PollForDecisionTask(args)
	//   result, err := MatchingService_PollForDecisionTask_Helper.WrapResponse(value, err)
	//   if err != nil {
	//     return fmt.Errorf("unexpected error from PollForDecisionTask: %v", err)
	//   }
	//   serialize(result)
	WrapResponse func(*PollForDecisionTaskResponse, error) (*MatchingService_PollForDecisionTask_Result, error)

	// UnwrapResponse takes the result struct for PollForDecisionTask
	// and returns the value or error returned by it.
	//
	// The error is non-nil only if PollForDecisionTask threw an
	// exception.
	//
	//   result := deserialize(bytes)
	//   value, err := MatchingService_PollForDecisionTask_Helper.UnwrapResponse(result)
	UnwrapResponse func(*MatchingService_PollForDecisionTask_Result) (*PollForDecisionTaskResponse, error)
}{}

func init() {
	MatchingService_PollForDecisionTask_Helper.Args = func(
		pollRequest *PollForDecisionTaskRequest,
	) *MatchingService_PollForDecisionTask_Args {
		return &MatchingService_PollForDecisionTask_Args{
			PollRequest: pollRequest,
		}
	}

	MatchingService_PollForDecisionTask_Helper.IsException = func(err error) bool {
		switch err.(type) {
		case *shared.BadRequestError:
			return true
		case *shared.InternalServiceError:
			return true
		case *shared.LimitExceededError:
			return true
		case *shared.ServiceBusyError:
			return true
		default:
			return false
		}
	}

	MatchingService_PollForDecisionTask_Helper.WrapResponse = func(success *PollForDecisionTaskResponse, err error) (*MatchingService_PollForDecisionTask_Result, error) {
		if err == nil {
			return &MatchingService_PollForDecisionTask_Result{Success: success}, nil
		}

		switch e := err.(type) {
		case *shared.BadRequestError:
			if e == nil {
				return nil, errors.New("WrapResponse received non-nil error type with nil value for MatchingService_PollForDecisionTask_Result.BadRequestError")
			}
			return &MatchingService_PollForDecisionTask_Result{BadRequestError: e}, nil
		case *shared.InternalServiceError:
			if e == nil {
				return nil, errors.New("WrapResponse received non-nil error type with nil value for MatchingService_PollForDecisionTask_Result.InternalServiceError")
			}
			return &MatchingService_PollForDecisionTask_Result{InternalServiceError: e}, nil
		case *shared.LimitExceededError:
			if e == nil {
				return nil, errors.New("WrapResponse received non-nil error type with nil value for MatchingService_PollForDecisionTask_Result.LimitExceededError")
			}
			return &MatchingService_PollForDecisionTask_Result{LimitExceededError: e}, nil
		case *shared.ServiceBusyError:
			if e == nil {
				return nil, errors.New("WrapResponse received non-nil error type with nil value for MatchingService_PollForDecisionTask_Result.ServiceBusyError")
			}
			return &MatchingService_PollForDecisionTask_Result{ServiceBusyError: e}, nil
		}

		return nil, err
	}
	MatchingService_PollForDecisionTask_Helper.UnwrapResponse = func(result *MatchingService_PollForDecisionTask_Result) (success *PollForDecisionTaskResponse, err error) {
		if result.BadRequestError != nil {
			err = result.BadRequestError
			return
		}
		if result.InternalServiceError != nil {
			err = result.InternalServiceError
			return
		}
		if result.LimitExceededError != nil {
			err = result.LimitExceededError
			return
		}
		if result.ServiceBusyError != nil {
			err = result.ServiceBusyError
			return
		}

		if result.Success != nil {
			success = result.Success
			return
		}

		err = errors.New("expected a non-void result")
		return
	}

}

// MatchingService_PollForDecisionTask_Result represents the result of a MatchingService.PollForDecisionTask function call.
//
// The result of a PollForDecisionTask execution is sent and received over the wire as this struct.
//
// Success is set only if the function did not throw an exception.
type MatchingService_PollForDecisionTask_Result struct {
	// Value returned by PollForDecisionTask after a successful execution.
	Success              *PollForDecisionTaskResponse `json:"success,omitempty"`
	BadRequestError      *shared.BadRequestError      `json:"badRequestError,omitempty"`
	InternalServiceError *shared.InternalServiceError `json:"internalServiceError,omitempty"`
	LimitExceededError   *shared.LimitExceededError   `json:"limitExceededError,omitempty"`
	ServiceBusyError     *shared.ServiceBusyError     `json:"serviceBusyError,omitempty"`
}

// ToWire translates a MatchingService_PollForDecisionTask_Result struct into a Thrift-level intermediate
// representation. This intermediate representation may be serialized
// into bytes using a ThriftRW protocol implementation.
//
// An error is returned if the struct or any of its fields failed to
// validate.
//
//	x, err := v.ToWire()
//	if err != nil {
//	  return err
//	}
//
//	if err := binaryProtocol.Encode(x, writer); err != nil {
//	  return err
//	}
func (v *MatchingService_PollForDecisionTask_Result) ToWire() (wire.Value, error) {
	var (
		fields [5]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.Success != nil {
		w, err = v.Success.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 0, Value: w}
		i++
	}
	if v.BadRequestError != nil {
		w, err = v.BadRequestError.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 1, Value: w}
		i++
	}
	if v.InternalServiceError != nil {
		w, err = v.InternalServiceError.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 2, Value: w}
		i++
	}
	if v.LimitExceededError != nil {
		w, err = v.LimitExceededError.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 3, Value: w}
		i++
	}
	if v.ServiceBusyError != nil {
		w, err = v.ServiceBusyError.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 4, Value: w}
		i++
	}

	if i != 1 {
		return wire.Value{}, fmt.Errorf("MatchingService_PollForDecisionTask_Result should have exactly one field: got %v fields", i)
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

func _PollForDecisionTaskResponse_Read(w wire.Value) (*PollForDecisionTaskResponse, error) {
	var v PollForDecisionTaskResponse
	err := v.FromWire(w)
	return &v, err
}

// FromWire deserializes a MatchingService_PollForDecisionTask_Result struct from its Thrift-level
// representation. The Thrift-level representation may be obtained
// from a ThriftRW protocol implementation.
//
// An error is returned if we were unable to build a MatchingService_PollForDecisionTask_Result struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v MatchingService_PollForDecisionTask_Result
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *MatchingService_PollForDecisionTask_Result) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 0:
			if field.Value.Type() == wire.TStruct {
				v.Success, err = _PollForDecisionTaskResponse_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 1:
			if field.Value.Type() == wire.TStruct {
				v.BadRequestError, err = _BadRequestError_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 2:
			if field.Value.Type() == wire.TStruct {
				v.InternalServiceError, err = _InternalServiceError_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 3:
			if field.Value.Type() == wire.TStruct {
				v.LimitExceededError, err = _LimitExceededError_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 4:
			if field.Value.Type() == wire.TStruct {
				v.ServiceBusyError, err = _ServiceBusyError_Read(field.Value)
				if err != nil {
					return err
				}

			}
		}
	}

	count := 0
	if v.Success != nil {
		count++
	}
	if v.BadRequestError != nil {
		count++
	}
	if v.InternalServiceError != nil {
		count++
	}
	if v.LimitExceededError != nil {
		count++
	}
	if v.ServiceBusyError != nil {
		count++
	}
	if count != 1 {
		return fmt.Errorf("MatchingService_PollForDecisionTask_Result should have exactly one field: got %v fields", count)
	}

	return nil
}

// Encode serializes a MatchingService_PollForDecisionTask_Result struct directly into bytes, without going
// through an intermediary type.
//
// An error is returned if a MatchingService_PollForDecisionTask_Result struct could not be encoded.
func (v *MatchingService_PollForDecisionTask_Result) Encode(sw stream.Writer) error {
	if err := sw.WriteStructBegin(); err != nil {
		return err
	}

	if v.Success != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 0, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.Success.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.BadRequestError != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 1, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.BadRequestError.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.InternalServiceError != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 2, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.InternalServiceError.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.LimitExceededError != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 3, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.LimitExceededError.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.ServiceBusyError != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 4, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.ServiceBusyError.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	count := 0
	if v.Success != nil {
		count++
	}
	if v.BadRequestError != nil {
		count++
	}
	if v.InternalServiceError != nil {
		count++
	}
	if v.LimitExceededError != nil {
		count++
	}
	if v.ServiceBusyError != nil {
		count++
	}

	if count != 1 {
		return fmt.Errorf("MatchingService_PollForDecisionTask_Result should have exactly one field: got %v fields", count)
	}

	return sw.WriteStructEnd()
}

func _PollForDecisionTaskResponse_Decode(sr stream.Reader) (*PollForDecisionTaskResponse, error) {
	var v PollForDecisionTaskResponse
	err := v.Decode(sr)
	return &v, err
}

// Decode deserializes a MatchingService_PollForDecisionTask_Result struct directly from its Thrift-level
// representation, without going through an intemediary type.
//
// An error is returned if a MatchingService_PollForDecisionTask_Result struct could not be generated from the wire
// representation.
func (v *MatchingService_PollForDecisionTask_Result) Decode(sr stream.Reader) error {

	if err := sr.ReadStructBegin(); err != nil {
		return err
	}

	fh, ok, err := sr.ReadFieldBegin()
	if err != nil {
		return err
	}

	for ok {
		switch {
		case fh.ID == 0 && fh.Type == wire.TStruct:
			v.Success, err = _PollForDecisionTaskResponse_Decode(sr)
			if err != nil {
				return err
			}

		case fh.ID == 1 && fh.Type == wire.TStruct:
			v.BadRequestError, err = _BadRequestError_Decode(sr)
			if err != nil {
				return err
			}

		case fh.ID == 2 && fh.Type == wire.TStruct:
			v.InternalServiceError, err = _InternalServiceError_Decode(sr)
			if err != nil {
				return err
			}

		case fh.ID == 3 && fh.Type == wire.TStruct:
			v.LimitExceededError, err = _LimitExceededError_Decode(sr)
			if err != nil {
				return err
			}

		case fh.ID == 4 && fh.Type == wire.TStruct:
			v.ServiceBusyError, err = _ServiceBusyError_Decode(sr)
			if err != nil {
				return err
			}

		default:
			if err := sr.Skip(fh.Type); err != nil {
				return err
			}
		}

		if err := sr.ReadFieldEnd(); err != nil {
			return err
		}

		if fh, ok, err = sr.ReadFieldBegin(); err != nil {
			return err
		}
	}

	if err := sr.ReadStructEnd(); err != nil {
		return err
	}

	count := 0
	if v.Success != nil {
		count++
	}
	if v.BadRequestError != nil {
		count++
	}
	if v.InternalServiceError != nil {
		count++
	}
	if v.LimitExceededError != nil {
		count++
	}
	if v.ServiceBusyError != nil {
		count++
	}
	if count != 1 {
		return fmt.Errorf("MatchingService_PollForDecisionTask_Result should have exactly one field: got %v fields", count)
	}

	return nil
}

// String returns a readable string representation of a MatchingService_PollForDecisionTask_Result
// struct.
func (v *MatchingService_PollForDecisionTask_Result) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [5]string
	i := 0
	if v.Success != nil {
		fields[i] = fmt.Sprintf("Success: %v", v.Success)
		i++
	}
	if v.BadRequestError != nil {
		fields[i] = fmt.Sprintf("BadRequestError: %v", v.BadRequestError)
		i++
	}
	if v.InternalServiceError != nil {
		fields[i] = fmt.Sprintf("InternalServiceError: %v", v.InternalServiceError)
		i++
	}
	if v.LimitExceededError != nil {
		fields[i] = fmt.Sprintf("LimitExceededError: %v", v.LimitExceededError)
		i++
	}
	if v.ServiceBusyError != nil {
		fields[i] = fmt.Sprintf("ServiceBusyError: %v", v.ServiceBusyError)
		i++
	}

	return fmt.Sprintf("MatchingService_PollForDecisionTask_Result{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this MatchingService_PollForDecisionTask_Result match the
// provided MatchingService_PollForDecisionTask_Result.
//
// This function performs a deep comparison.
func (v *MatchingService_PollForDecisionTask_Result) Equals(rhs *MatchingService_PollForDecisionTask_Result) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !((v.Success == nil && rhs.Success == nil) || (v.Success != nil && rhs.Success != nil && v.Success.Equals(rhs.Success))) {
		return false
	}
	if !((v.BadRequestError == nil && rhs.BadRequestError == nil) || (v.BadRequestError != nil && rhs.BadRequestError != nil && v.BadRequestError.Equals(rhs.BadRequestError))) {
		return false
	}
	if !((v.InternalServiceError == nil && rhs.InternalServiceError == nil) || (v.InternalServiceError != nil && rhs.InternalServiceError != nil && v.InternalServiceError.Equals(rhs.InternalServiceError))) {
		return false
	}
	if !((v.LimitExceededError == nil && rhs.LimitExceededError == nil) || (v.LimitExceededError != nil && rhs.LimitExceededError != nil && v.LimitExceededError.Equals(rhs.LimitExceededError))) {
		return false
	}
	if !((v.ServiceBusyError == nil && rhs.ServiceBusyError == nil) || (v.ServiceBusyError != nil && rhs.ServiceBusyError != nil && v.ServiceBusyError.Equals(rhs.ServiceBusyError))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of MatchingService_PollForDecisionTask_Result.
func (v *MatchingService_PollForDecisionTask_Result) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Success != nil {
		err = multierr.Append(err, enc.AddObject("success", v.Success))
	}
	if v.BadRequestError != nil {
		err = multierr.Append(err, enc.AddObject("badRequestError", v.BadRequestError))
	}
	if v.InternalServiceError != nil {
		err = multierr.Append(err, enc.AddObject("internalServiceError", v.InternalServiceError))
	}
	if v.LimitExceededError != nil {
		err = multierr.Append(err, enc.AddObject("limitExceededError", v.LimitExceededError))
	}
	if v.ServiceBusyError != nil {
		err = multierr.Append(err, enc.AddObject("serviceBusyError", v.ServiceBusyError))
	}
	return err
}

// GetSuccess returns the value of Success if it is set or its
// zero value if it is unset.
func (v *MatchingService_PollForDecisionTask_Result) GetSuccess() (o *PollForDecisionTaskResponse) {
	if v != nil && v.Success != nil {
		return v.Success
	}

	return
}

// IsSetSuccess returns true if Success is not nil.
func (v *MatchingService_PollForDecisionTask_Result) IsSetSuccess() bool {
	return v != nil && v.Success != nil
}

// GetBadRequestError returns the value of BadRequestError if it is set or its
// zero value if it is unset.
func (v *MatchingService_PollForDecisionTask_Result) GetBadRequestError() (o *shared.BadRequestError) {
	if v != nil && v.BadRequestError != nil {
		return v.BadRequestError
	}

	return
}

// IsSetBadRequestError returns true if BadRequestError is not nil.
func (v *MatchingService_PollForDecisionTask_Result) IsSetBadRequestError() bool {
	return v != nil && v.BadRequestError != nil
}

// GetInternalServiceError returns the value of InternalServiceError if it is set or its
// zero value if it is unset.
func (v *MatchingService_PollForDecisionTask_Result) GetInternalServiceError() (o *shared.InternalServiceError) {
	if v != nil && v.InternalServiceError != nil {
		return v.InternalServiceError
	}

	return
}

// IsSetInternalServiceError returns true if InternalServiceError is not nil.
func (v *MatchingService_PollForDecisionTask_Result) IsSetInternalServiceError() bool {
	return v != nil && v.InternalServiceError != nil
}

// GetLimitExceededError returns the value of LimitExceededError if it is set or its
// zero value if it is unset.
func (v *MatchingService_PollForDecisionTask_Result) GetLimitExceededError() (o *shared.LimitExceededError) {
	if v != nil && v.LimitExceededError != nil {
		return v.LimitExceededError
	}

	return
}

// IsSetLimitExceededError returns true if LimitExceededError is not nil.
func (v *MatchingService_PollForDecisionTask_Result) IsSetLimitExceededError() bool {
	return v != nil && v.LimitExceededError != nil
}

// GetServiceBusyError returns the value of ServiceBusyError if it is set or its
// zero value if it is unset.
func (v *MatchingService_PollForDecisionTask_Result) GetServiceBusyError() (o *shared.ServiceBusyError) {
	if v != nil && v.ServiceBusyError != nil {
		return v.ServiceBusyError
	}

	return
}

// IsSetServiceBusyError returns true if ServiceBusyError is not nil.
func (v *MatchingService_PollForDecisionTask_Result) IsSetServiceBusyError() bool {
	return v != nil && v.ServiceBusyError != nil
}

// MethodName returns the name of the Thrift function as specified in
// the IDL, for which this struct represent the result.
//
// This will always be "PollForDecisionTask" for this struct.
func (v *MatchingService_PollForDecisionTask_Result) MethodName() string {
	return "PollForDecisionTask"
}

// EnvelopeType returns the kind of value inside this struct.
//
// This will always be Reply for this struct.
func (v *MatchingService_PollForDecisionTask_Result) EnvelopeType() wire.EnvelopeType {
	return wire.Reply
}

// MatchingService_QueryWorkflow_Args represents the arguments for the MatchingService.QueryWorkflow function.
//
// The arguments for QueryWorkflow are sent and received over the wire as this struct.
type MatchingService_QueryWorkflow_Args struct {
	QueryRequest *QueryWorkflowRequest `json:"queryRequest,omitempty"`
}

// ToWire translates a MatchingService_QueryWorkflow_Args struct into a Thrift-level intermediate
// representation. This intermediate representation may be serialized
// into bytes using a ThriftRW protocol implementation.
//
// An error is returned if the struct or any of its fields failed to
// validate.
//
//	x, err := v.ToWire()
//	if err != nil {
//	  return err
//	}
//
//	if err := binaryProtocol.Encode(x, writer); err != nil {
//	  return err
//	}
func (v *MatchingService_QueryWorkflow_Args) ToWire() (wire.Value, error) {
	var (
		fields [1]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.QueryRequest != nil {
		w, err = v.QueryRequest.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 1, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

func _QueryWorkflowRequest_1_Read(w wire.Value) (*QueryWorkflowRequest, error) {
	var v QueryWorkflowRequest
	err := v.FromWire(w)
	return &v, err
}

// FromWire deserializes a MatchingService_QueryWorkflow_Args struct from its Thrift-level
// representation. The Thrift-level representation may be obtained
// from a ThriftRW protocol implementation.
//
// An error is returned if we were unable to build a MatchingService_QueryWorkflow_Args struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v MatchingService_QueryWorkflow_Args
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *MatchingService_QueryWorkflow_Args) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 1:
			if field.Value.Type() == wire.TStruct {
				v.QueryRequest, err = _QueryWorkflowRequest_1_Read(field.Value)
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// Encode serializes a MatchingService_QueryWorkflow_Args struct directly into bytes, without going
// through an intermediary type.
//
// An error is returned if a MatchingService_QueryWorkflow_Args struct could not be encoded.
func (v *MatchingService_QueryWorkflow_Args) Encode(sw stream.Writer) error {
	if err := sw.WriteStructBegin(); err != nil {
		return err
	}

	if v.QueryRequest != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 1, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.QueryRequest.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	return sw.WriteStructEnd()
}

func _QueryWorkflowRequest_1_Decode(sr stream.Reader) (*QueryWorkflowRequest, error) {
	var v QueryWorkflowRequest
	err := v.Decode(sr)
	return &v, err
}

// Decode deserializes a MatchingService_QueryWorkflow_Args struct directly from its Thrift-level
// representation, without going through an intemediary type.
//
// An error is returned if a MatchingService_QueryWorkflow_Args struct could not be generated from the wire
// representation.
func (v *MatchingService_QueryWorkflow_Args) Decode(sr stream.Reader) error {

	if err := sr.ReadStructBegin(); err != nil {
		return err
	}

	fh, ok, err := sr.ReadFieldBegin()
	if err != nil {
		return err
	}

	for ok {
		switch {
		case fh.ID == 1 && fh.Type == wire.TStruct:
			v.QueryRequest, err = _QueryWorkflowRequest_1_Decode(sr)
			if err != nil {
				return err
			}

		default:
			if err := sr.Skip(fh.Type); err != nil {
				return err
			}
		}

		if err := sr.ReadFieldEnd(); err != nil {
			return err
		}

		if fh, ok, err = sr.ReadFieldBegin(); err != nil {
			return err
		}
	}

	if err := sr.ReadStructEnd(); err != nil {
		return err
	}

	return nil
}

// String returns a readable string representation of a MatchingService_QueryWorkflow_Args
// struct.
func (v *MatchingService_QueryWorkflow_Args) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [1]string
	i := 0
	if v.QueryRequest != nil {
		fields[i] = fmt.Sprintf("QueryRequest: %v", v.QueryRequest)
		i++
	}

	return fmt.Sprintf("MatchingService_QueryWorkflow_Args{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this MatchingService_QueryWorkflow_Args match the
// provided MatchingService_QueryWorkflow_Args.
//
// This function performs a deep comparison.
func (v *MatchingService_QueryWorkflow_Args) Equals(rhs *MatchingService_QueryWorkflow_Args) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !((v.QueryRequest == nil && rhs.QueryRequest == nil) || (v.QueryRequest != nil && rhs.QueryRequest != nil && v.QueryRequest.Equals(rhs.QueryRequest))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of MatchingService_QueryWorkflow_Args.
func (v *MatchingService_QueryWorkflow_Args) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.QueryRequest != nil {
		err = multierr.Append(err, enc.AddObject("queryRequest", v.QueryRequest))
	}
	return err
}

// GetQueryRequest returns the value of QueryRequest if it is set or its
// zero value if it is unset.
func (v *MatchingService_QueryWorkflow_Args) GetQueryRequest() (o *QueryWorkflowRequest) {
	if v != nil && v.QueryRequest != nil {
		return v.QueryRequest
	}

	return
}

// IsSetQueryRequest returns true if QueryRequest is not nil.
func (v *MatchingService_QueryWorkflow_Args) IsSetQueryRequest() bool {
	return v != nil && v.QueryRequest != nil
}

// MethodName returns the name of the Thrift function as specified in
// the IDL, for which this struct represent the arguments.
//
// This will always be "QueryWorkflow" for this struct.
func (v *MatchingService_QueryWorkflow_Args) MethodName() string {
	return "QueryWorkflow"
}

// EnvelopeType returns the kind of value inside this struct.
//
// This will always be Call for this struct.
func (v *MatchingService_QueryWorkflow_Args) EnvelopeType() wire.EnvelopeType {
	return wire.Call
}

// MatchingService_QueryWorkflow_Helper provides functions that aid in handling the
// parameters and return values of the MatchingService.QueryWorkflow
// function.
var MatchingService_QueryWorkflow_Helper = struct {
	// Args accepts the parameters of QueryWorkflow in-order and returns
	// the arguments struct for the function.
	Args func(
		queryRequest *QueryWorkflowRequest,
	) *MatchingService_QueryWorkflow_Args

	// IsException returns true if the given error can be thrown
	// by QueryWorkflow.
	//
	// An error can be thrown by QueryWorkflow only if the
	// corresponding exception type was mentioned in the 'throws'
	// section for it in the Thrift file.
	IsException func(error) bool

	// WrapResponse returns the result struct for QueryWorkflow
	// given its return value and error.
	//
	// This allows mapping values and errors returned by
	// QueryWorkflow into a serializable result struct.
	// WrapResponse returns a non-nil error if the provided
	// error cannot be thrown by QueryWorkflow
	//
	//   value, err := QueryWorkflow(args)
	//   result, err := MatchingService_QueryWorkflow_Helper.WrapResponse(value, err)
	//   if err != nil {
	//     return fmt.Errorf("unexpected error from QueryWorkflow: %v", err)
	//   }
	//   serialize(result)
	WrapResponse func(*shared.QueryWorkflowResponse, error) (*MatchingService_QueryWorkflow_Result, error)

	// UnwrapResponse takes the result struct for QueryWorkflow
	// and returns the value or error returned by it.
	//
	// The error is non-nil only if QueryWorkflow threw an
	// exception.
	//
	//   result := deserialize(bytes)
	//   value, err := MatchingService_QueryWorkflow_Helper.UnwrapResponse(result)
	UnwrapResponse func(*MatchingService_QueryWorkflow_Result) (*shared.QueryWorkflowResponse, error)
}{}

func init() {
	MatchingService_QueryWorkflow_Helper.Args = func(
		queryRequest *QueryWorkflowRequest,
	) *MatchingService_QueryWorkflow_Args {
		return &MatchingService_QueryWorkflow_Args{
			QueryRequest: queryRequest,
		}
	}

	MatchingService_QueryWorkflow_Helper.IsException = func(err error) bool {
		switch err.(type) {
		case *shared.BadRequestError:
			return true
		case *shared.InternalServiceError:
			return true
		case *shared.EntityNotExistsError:
			return true
		case *shared.QueryFailedError:
			return true
		case *shared.LimitExceededError:
			return true
		case *shared.ServiceBusyError:
			return true
		case *shared.StickyWorkerUnavailableError:
			return true
		case *shared.TaskListNotOwnedByHostError:
			return true
		default:
			return false
		}
	}

	MatchingService_QueryWorkflow_Helper.WrapResponse = func(success *shared.QueryWorkflowResponse, err error) (*MatchingService_QueryWorkflow_Result, error) {
		if err == nil {
			return &MatchingService_QueryWorkflow_Result{Success: success}, nil
		}

		switch e := err.(type) {
		case *shared.BadRequestError:
			if e == nil {
				return nil, errors.New("WrapResponse received non-nil error type with nil value for MatchingService_QueryWorkflow_Result.BadRequestError")
			}
			return &MatchingService_QueryWorkflow_Result{BadRequestError: e}, nil
		case *shared.InternalServiceError:
			if e == nil {
				return nil, errors.New("WrapResponse received non-nil error type with nil value for MatchingService_QueryWorkflow_Result.InternalServiceError")
			}
			return &MatchingService_QueryWorkflow_Result{InternalServiceError: e}, nil
		case *shared.EntityNotExistsError:
			if e == nil {
				return nil, errors.New("WrapResponse received non-nil error type with nil value for MatchingService_QueryWorkflow_Result.EntityNotExistError")
			}
			return &MatchingService_QueryWorkflow_Result{EntityNotExistError: e}, nil
		case *shared.QueryFailedError:
			if e == nil {
				return nil, errors.New("WrapResponse received non-nil error type with nil value for MatchingService_QueryWorkflow_Result.QueryFailedError")
			}
			return &MatchingService_QueryWorkflow_Result{QueryFailedError: e}, nil
		case *shared.LimitExceededError:
			if e == nil {
				return nil, errors.New("WrapResponse received non-nil error type with nil value for MatchingService_QueryWorkflow_Result.LimitExceededError")
			}
			return &MatchingService_QueryWorkflow_Result{LimitExceededError: e}, nil
		case *shared.ServiceBusyError:
			if e == nil {
				return nil, errors.New("WrapResponse received non-nil error type with nil value for MatchingService_QueryWorkflow_Result.ServiceBusyError")
			}
			return &MatchingService_QueryWorkflow_Result{ServiceBusyError: e}, nil
		case *shared.StickyWorkerUnavailableError:
			if e == nil {
				return nil, errors.New("WrapResponse received non-nil error type with nil value for MatchingService_QueryWorkflow_Result.StickyWorkerUnavailableError")
			}
			return &MatchingService_QueryWorkflow_Result{StickyWorkerUnavailableError: e}, nil
		case *shared.TaskListNotOwnedByHostError:
			if e == nil {
				return nil, errors.New("WrapResponse received non-nil error type with nil value for MatchingService_QueryWorkflow_Result.TaskListNotOwnedByHostError")
			}
			return &MatchingService_QueryWorkflow_Result{TaskListNotOwnedByHostError: e}, nil
		}

		return nil, err
	}
	MatchingService_QueryWorkflow_Helper.UnwrapResponse = func(result *MatchingService_QueryWorkflow_Result) (success *shared.QueryWorkflowResponse, err error) {
		if result.BadRequestError != nil {
			err = result.BadRequestError
			return
		}
		if result.InternalServiceError != nil {
			err = result.InternalServiceError
			return
		}
		if result.EntityNotExistError != nil {
			err = result.EntityNotExistError
			return
		}
		if result.QueryFailedError != nil {
			err = result.QueryFailedError
			return
		}
		if result.LimitExceededError != nil {
			err = result.LimitExceededError
			return
		}
		if result.ServiceBusyError != nil {
			err = result.ServiceBusyError
			return
		}
		if result.StickyWorkerUnavailableError != nil {
			err = result.StickyWorkerUnavailableError
			return
		}
		if result.TaskListNotOwnedByHostError != nil {
			err = result.TaskListNotOwnedByHostError
			return
		}

		if result.Success != nil {
			success = result.Success
			return
		}

		err = errors.New("expected a non-void result")
		return
	}

}

// MatchingService_QueryWorkflow_Result represents the result of a MatchingService.QueryWorkflow function call.
//
// The result of a QueryWorkflow execution is sent and received over the wire as this struct.
//
// Success is set only if the function did not throw an exception.
type MatchingService_QueryWorkflow_Result struct {
	// Value returned by QueryWorkflow after a successful execution.
	Success                      *shared.QueryWorkflowResponse        `json:"success,omitempty"`
	BadRequestError              *shared.BadRequestError              `json:"badRequestError,omitempty"`
	InternalServiceError         *shared.InternalServiceError         `json:"internalServiceError,omitempty"`
	EntityNotExistError          *shared.EntityNotExistsError         `json:"entityNotExistError,omitempty"`
	QueryFailedError             *shared.QueryFailedError             `json:"queryFailedError,omitempty"`
	LimitExceededError           *shared.LimitExceededError           `json:"limitExceededError,omitempty"`
	ServiceBusyError             *shared.ServiceBusyError             `json:"serviceBusyError,omitempty"`
	StickyWorkerUnavailableError *shared.StickyWorkerUnavailableError `json:"stickyWorkerUnavailableError,omitempty"`
	TaskListNotOwnedByHostError  *shared.TaskListNotOwnedByHostError  `json:"taskListNotOwnedByHostError,omitempty"`
}

// ToWire translates a MatchingService_QueryWorkflow_Result struct into a Thrift-level intermediate
// representation. This intermediate representation may be serialized
// into bytes using a ThriftRW protocol implementation.
//
// An error is returned if the struct or any of its fields failed to
// validate.
//
//	x, err := v.ToWire()
//	if err != nil {
//	  return err
//	}
//
//	if err := binaryProtocol.Encode(x, writer); err != nil {
//	  return err
//	}
func (v *MatchingService_QueryWorkflow_Result) ToWire() (wire.Value, error) {
	var (
		fields [9]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.Success != nil {
		w, err = v.Success.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 0, Value: w}
		i++
	}
	if v.BadRequestError != nil {
		w, err = v.BadRequestError.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 1, Value: w}
		i++
	}
	if v.InternalServiceError != nil {
		w, err = v.InternalServiceError.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 2, Value: w}
		i++
	}
	if v.EntityNotExistError != nil {
		w, err = v.EntityNotExistError.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 3, Value: w}
		i++
	}
	if v.QueryFailedError != nil {
		w, err = v.QueryFailedError.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 4, Value: w}
		i++
	}
	if v.LimitExceededError != nil {
		w, err = v.LimitExceededError.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 5, Value: w}
		i++
	}
	if v.ServiceBusyError != nil {
		w, err = v.ServiceBusyError.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 6, Value: w}
		i++
	}
	if v.StickyWorkerUnavailableError != nil {
		w, err = v.StickyWorkerUnavailableError.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 7, Value: w}
		i++
	}
	if v.TaskListNotOwnedByHostError != nil {
		w, err = v.TaskListNotOwnedByHostError.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 8, Value: w}
		i++
	}

	if i != 1 {
		return wire.Value{}, fmt.Errorf("MatchingService_QueryWorkflow_Result should have exactly one field: got %v fields", i)
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

func _QueryWorkflowResponse_Read(w wire.Value) (*shared.QueryWorkflowResponse, error) {
	var v shared.QueryWorkflowResponse
	err := v.FromWire(w)
	return &v, err
}

func _QueryFailedError_Read(w wire.Value) (*shared.QueryFailedError, error) {
	var v shared.QueryFailedError
	err := v.FromWire(w)
	return &v, err
}

// FromWire deserializes a MatchingService_QueryWorkflow_Result struct from its Thrift-level
// representation. The Thrift-level representation may be obtained
// from a ThriftRW protocol implementation.
//
// An error is returned if we were unable to build a MatchingService_QueryWorkflow_Result struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v MatchingService_QueryWorkflow_Result
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *MatchingService_QueryWorkflow_Result) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 0:
			if field.Value.Type() == wire.TStruct {
				v.Success, err = _QueryWorkflowResponse_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 1:
			if field.Value.Type() == wire.TStruct {
				v.BadRequestError, err = _BadRequestError_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 2:
			if field.Value.Type() == wire.TStruct {
				v.InternalServiceError, err = _InternalServiceError_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 3:
			if field.Value.Type() == wire.TStruct {
				v.EntityNotExistError, err = _EntityNotExistsError_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 4:
			if field.Value.Type() == wire.TStruct {
				v.QueryFailedError, err = _QueryFailedError_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 5:
			if field.Value.Type() == wire.TStruct {
				v.LimitExceededError, err = _LimitExceededError_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 6:
			if field.Value.Type() == wire.TStruct {
				v.ServiceBusyError, err = _ServiceBusyError_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 7:
			if field.Value.Type() == wire.TStruct {
				v.StickyWorkerUnavailableError, err = _StickyWorkerUnavailableError_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 8:
			if field.Value.Type() == wire.TStruct {
				v.TaskListNotOwnedByHostError, err = _TaskListNotOwnedByHostError_Read(field.Value)
				if err != nil {
					return err
				}

			}
		}
	}

	count := 0
	if v.Success != nil {
		count++
	}
	if v.BadRequestError != nil {
		count++
	}
	if v.InternalServiceError != nil {
		count++
	}
	if v.EntityNotExistError != nil {
		count++
	}
	if v.QueryFailedError != nil {
		count++
	}
	if v.LimitExceededError != nil {
		count++
	}
	if v.ServiceBusyError != nil {
		count++
	}
	if v.StickyWorkerUnavailableError != nil {
		count++
	}
	if v.TaskListNotOwnedByHostError != nil {
		count++
	}
	if count != 1 {
		return fmt.Errorf("MatchingService_QueryWorkflow_Result should have exactly one field: got %v fields", count)
	}

	return nil
}

// Encode serializes a MatchingService_QueryWorkflow_Result struct directly into bytes, without going
// through an intermediary type.
//
// An error is returned if a MatchingService_QueryWorkflow_Result struct could not be encoded.
func (v *MatchingService_QueryWorkflow_Result) Encode(sw stream.Writer) error {
	if err := sw.WriteStructBegin(); err != nil {
		return err
	}

	if v.Success != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 0, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.Success.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.BadRequestError != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 1, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.BadRequestError.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.InternalServiceError != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 2, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.InternalServiceError.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.EntityNotExistError != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 3, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.EntityNotExistError.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.QueryFailedError != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 4, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.QueryFailedError.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.LimitExceededError != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 5, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.LimitExceededError.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.ServiceBusyError != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 6, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.ServiceBusyError.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.StickyWorkerUnavailableError != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 7, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.StickyWorkerUnavailableError.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.TaskListNotOwnedByHostError != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 8, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.TaskListNotOwnedByHostError.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	count := 0
	if v.Success != nil {
		count++
	}
	if v.BadRequestError != nil {
		count++
	}
	if v.InternalServiceError != nil {
		count++
	}
	if v.EntityNotExistError != nil {
		count++
	}
	if v.QueryFailedError != nil {
		count++
	}
	if v.LimitExceededError != nil {
		count++
	}
	if v.ServiceBusyError != nil {
		count++
	}
	if v.StickyWorkerUnavailableError != nil {
		count++
	}
	if v.TaskListNotOwnedByHostError != nil {
		count++
	}

	if count != 1 {
		return fmt.Errorf("MatchingService_QueryWorkflow_Result should have exactly one field: got %v fields", count)
	}

	return sw.WriteStructEnd()
}

func _QueryWorkflowResponse_Decode(sr stream.Reader) (*shared.QueryWorkflowResponse, error) {
	var v shared.QueryWorkflowResponse
	err := v.Decode(sr)
	return &v, err
}

func _QueryFailedError_Decode(sr stream.Reader) (*shared.QueryFailedError, error) {
	var v shared.QueryFailedError
	err := v.Decode(sr)
	return &v, err
}

// Decode deserializes a MatchingService_QueryWorkflow_Result struct directly from its Thrift-level
// representation, without going through an intemediary type.
//
// An error is returned if a MatchingService_QueryWorkflow_Result struct could not be generated from the wire
// representation.
func (v *MatchingService_QueryWorkflow_Result) Decode(sr stream.Reader) error {

	if err := sr.ReadStructBegin(); err != nil {
		return err
	}

	fh, ok, err := sr.ReadFieldBegin()
	if err != nil {
		return err
	}

	for ok {
		switch {
		case fh.ID == 0 && fh.Type == wire.TStruct:
			v.Success, err = _QueryWorkflowResponse_Decode(sr)
			if err != nil {
				return err
			}

		case fh.ID == 1 && fh.Type == wire.TStruct:
			v.BadRequestError, err = _BadRequestError_Decode(sr)
			if err != nil {
				return err
			}

		case fh.ID == 2 && fh.Type == wire.TStruct:
			v.InternalServiceError, err = _InternalServiceError_Decode(sr)
			if err != nil {
				return err
			}

		case fh.ID == 3 && fh.Type == wire.TStruct:
			v.EntityNotExistError, err = _EntityNotExistsError_Decode(sr)
			if err != nil {
				return err
			}

		case fh.ID == 4 && fh.Type == wire.TStruct:
			v.QueryFailedError, err = _QueryFailedError_Decode(sr)
			if err != nil {
				return err
			}

		case fh.ID == 5 && fh.Type == wire.TStruct:
			v.LimitExceededError, err = _LimitExceededError_Decode(sr)
			if err != nil {
				return err
			}

		case fh.ID == 6 && fh.Type == wire.TStruct:
			v.ServiceBusyError, err = _ServiceBusyError_Decode(sr)
			if err != nil {
				return err
			}

		case fh.ID == 7 && fh.Type == wire.TStruct:
			v.StickyWorkerUnavailableError, err = _StickyWorkerUnavailableError_Decode(sr)
			if err != nil {
				return err
			}

		case fh.ID == 8 && fh.Type == wire.TStruct:
			v.TaskListNotOwnedByHostError, err = _TaskListNotOwnedByHostError_Decode(sr)
			if err != nil {
				return err
			}

		default:
			if err := sr.Skip(fh.Type); err != nil {
				return err
			}
		}

		if err := sr.ReadFieldEnd(); err != nil {
			return err
		}

		if fh, ok, err = sr.ReadFieldBegin(); err != nil {
			return err
		}
	}

	if err := sr.ReadStructEnd(); err != nil {
		return err
	}

	count := 0
	if v.Success != nil {
		count++
	}
	if v.BadRequestError != nil {
		count++
	}
	if v.InternalServiceError != nil {
		count++
	}
	if v.EntityNotExistError != nil {
		count++
	}
	if v.QueryFailedError != nil {
		count++
	}
	if v.LimitExceededError != nil {
		count++
	}
	if v.ServiceBusyError != nil {
		count++
	}
	if v.StickyWorkerUnavailableError != nil {
		count++
	}
	if v.TaskListNotOwnedByHostError != nil {
		count++
	}
	if count != 1 {
		return fmt.Errorf("MatchingService_QueryWorkflow_Result should have exactly one field: got %v fields", count)
	}

	return nil
}

// String returns a readable string representation of a MatchingService_QueryWorkflow_Result
// struct.
func (v *MatchingService_QueryWorkflow_Result) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [9]string
	i := 0
	if v.Success != nil {
		fields[i] = fmt.Sprintf("Success: %v", v.Success)
		i++
	}
	if v.BadRequestError != nil {
		fields[i] = fmt.Sprintf("BadRequestError: %v", v.BadRequestError)
		i++
	}
	if v.InternalServiceError != nil {
		fields[i] = fmt.Sprintf("InternalServiceError: %v", v.InternalServiceError)
		i++
	}
	if v.EntityNotExistError != nil {
		fields[i] = fmt.Sprintf("EntityNotExistError: %v", v.EntityNotExistError)
		i++
	}
	if v.QueryFailedError != nil {
		fields[i] = fmt.Sprintf("QueryFailedError: %v", v.QueryFailedError)
		i++
	}
	if v.LimitExceededError != nil {
		fields[i] = fmt.Sprintf("LimitExceededError: %v", v.LimitExceededError)
		i++
	}
	if v.ServiceBusyError != nil {
		fields[i] = fmt.Sprintf("ServiceBusyError: %v", v.ServiceBusyError)
		i++
	}
	if v.StickyWorkerUnavailableError != nil {
		fields[i] = fmt.Sprintf("StickyWorkerUnavailableError: %v", v.StickyWorkerUnavailableError)
		i++
	}
	if v.TaskListNotOwnedByHostError != nil {
		fields[i] = fmt.Sprintf("TaskListNotOwnedByHostError: %v", v.TaskListNotOwnedByHostError)
		i++
	}

	return fmt.Sprintf("MatchingService_QueryWorkflow_Result{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this MatchingService_QueryWorkflow_Result match the
// provided MatchingService_QueryWorkflow_Result.
//
// This function performs a deep comparison.
func (v *MatchingService_QueryWorkflow_Result) Equals(rhs *MatchingService_QueryWorkflow_Result) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !((v.Success == nil && rhs.Success == nil) || (v.Success != nil && rhs.Success != nil && v.Success.Equals(rhs.Success))) {
		return false
	}
	if !((v.BadRequestError == nil && rhs.BadRequestError == nil) || (v.BadRequestError != nil && rhs.BadRequestError != nil && v.BadRequestError.Equals(rhs.BadRequestError))) {
		return false
	}
	if !((v.InternalServiceError == nil && rhs.InternalServiceError == nil) || (v.InternalServiceError != nil && rhs.InternalServiceError != nil && v.InternalServiceError.Equals(rhs.InternalServiceError))) {
		return false
	}
	if !((v.EntityNotExistError == nil && rhs.EntityNotExistError == nil) || (v.EntityNotExistError != nil && rhs.EntityNotExistError != nil && v.EntityNotExistError.Equals(rhs.EntityNotExistError))) {
		return false
	}
	if !((v.QueryFailedError == nil && rhs.QueryFailedError == nil) || (v.QueryFailedError != nil && rhs.QueryFailedError != nil && v.QueryFailedError.Equals(rhs.QueryFailedError))) {
		return false
	}
	if !((v.LimitExceededError == nil && rhs.LimitExceededError == nil) || (v.LimitExceededError != nil && rhs.LimitExceededError != nil && v.LimitExceededError.Equals(rhs.LimitExceededError))) {
		return false
	}
	if !((v.ServiceBusyError == nil && rhs.ServiceBusyError == nil) || (v.ServiceBusyError != nil && rhs.ServiceBusyError != nil && v.ServiceBusyError.Equals(rhs.ServiceBusyError))) {
		return false
	}
	if !((v.StickyWorkerUnavailableError == nil && rhs.StickyWorkerUnavailableError == nil) || (v.StickyWorkerUnavailableError != nil && rhs.StickyWorkerUnavailableError != nil && v.StickyWorkerUnavailableError.Equals(rhs.StickyWorkerUnavailableError))) {
		return false
	}
	if !((v.TaskListNotOwnedByHostError == nil && rhs.TaskListNotOwnedByHostError == nil) || (v.TaskListNotOwnedByHostError != nil && rhs.TaskListNotOwnedByHostError != nil && v.TaskListNotOwnedByHostError.Equals(rhs.TaskListNotOwnedByHostError))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of MatchingService_QueryWorkflow_Result.
func (v *MatchingService_QueryWorkflow_Result) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Success != nil {
		err = multierr.Append(err, enc.AddObject("success", v.Success))
	}
	if v.BadRequestError != nil {
		err = multierr.Append(err, enc.AddObject("badRequestError", v.BadRequestError))
	}
	if v.InternalServiceError != nil {
		err = multierr.Append(err, enc.AddObject("internalServiceError", v.InternalServiceError))
	}
	if v.EntityNotExistError != nil {
		err = multierr.Append(err, enc.AddObject("entityNotExistError", v.EntityNotExistError))
	}
	if v.QueryFailedError != nil {
		err = multierr.Append(err, enc.AddObject("queryFailedError", v.QueryFailedError))
	}
	if v.LimitExceededError != nil {
		err = multierr.Append(err, enc.AddObject("limitExceededError", v.LimitExceededError))
	}
	if v.ServiceBusyError != nil {
		err = multierr.Append(err, enc.AddObject("serviceBusyError", v.ServiceBusyError))
	}
	if v.StickyWorkerUnavailableError != nil {
		err = multierr.Append(err, enc.AddObject("stickyWorkerUnavailableError", v.StickyWorkerUnavailableError))
	}
	if v.TaskListNotOwnedByHostError != nil {
		err = multierr.Append(err, enc.AddObject("taskListNotOwnedByHostError", v.TaskListNotOwnedByHostError))
	}
	return err
}

// GetSuccess returns the value of Success if it is set or its
// zero value if it is unset.
func (v *MatchingService_QueryWorkflow_Result) GetSuccess() (o *shared.QueryWorkflowResponse) {
	if v != nil && v.Success != nil {
		return v.Success
	}

	return
}

// IsSetSuccess returns true if Success is not nil.
func (v *MatchingService_QueryWorkflow_Result) IsSetSuccess() bool {
	return v != nil && v.Success != nil
}

// GetBadRequestError returns the value of BadRequestError if it is set or its
// zero value if it is unset.
func (v *MatchingService_QueryWorkflow_Result) GetBadRequestError() (o *shared.BadRequestError) {
	if v != nil && v.BadRequestError != nil {
		return v.BadRequestError
	}

	return
}

// IsSetBadRequestError returns true if BadRequestError is not nil.
func (v *MatchingService_QueryWorkflow_Result) IsSetBadRequestError() bool {
	return v != nil && v.BadRequestError != nil
}

// GetInternalServiceError returns the value of InternalServiceError if it is set or its
// zero value if it is unset.
func (v *MatchingService_QueryWorkflow_Result) GetInternalServiceError() (o *shared.InternalServiceError) {
	if v != nil && v.InternalServiceError != nil {
		return v.InternalServiceError
	}

	return
}

// IsSetInternalServiceError returns true if InternalServiceError is not nil.
func (v *MatchingService_QueryWorkflow_Result) IsSetInternalServiceError() bool {
	return v != nil && v.InternalServiceError != nil
}

// GetEntityNotExistError returns the value of EntityNotExistError if it is set or its
// zero value if it is unset.
func (v *MatchingService_QueryWorkflow_Result) GetEntityNotExistError() (o *shared.EntityNotExistsError) {
	if v != nil && v.EntityNotExistError != nil {
		return v.EntityNotExistError
	}

	return
}

// IsSetEntityNotExistError returns true if EntityNotExistError is not nil.
func (v *MatchingService_QueryWorkflow_Result) IsSetEntityNotExistError() bool {
	return v != nil && v.EntityNotExistError != nil
}

// GetQueryFailedError returns the value of QueryFailedError if it is set or its
// zero value if it is unset.
func (v *MatchingService_QueryWorkflow_Result) GetQueryFailedError() (o *shared.QueryFailedError) {
	if v != nil && v.QueryFailedError != nil {
		return v.QueryFailedError
	}

	return
}

// IsSetQueryFailedError returns true if QueryFailedError is not nil.
func (v *MatchingService_QueryWorkflow_Result) IsSetQueryFailedError() bool {
	return v != nil && v.QueryFailedError != nil
}

// GetLimitExceededError returns the value of LimitExceededError if it is set or its
// zero value if it is unset.
func (v *MatchingService_QueryWorkflow_Result) GetLimitExceededError() (o *shared.LimitExceededError) {
	if v != nil && v.LimitExceededError != nil {
		return v.LimitExceededError
	}

	return
}

// IsSetLimitExceededError returns true if LimitExceededError is not nil.
func (v *MatchingService_QueryWorkflow_Result) IsSetLimitExceededError() bool {
	return v != nil && v.LimitExceededError != nil
}

// GetServiceBusyError returns the value of ServiceBusyError if it is set or its
// zero value if it is unset.
func (v *MatchingService_QueryWorkflow_Result) GetServiceBusyError() (o *shared.ServiceBusyError) {
	if v != nil && v.ServiceBusyError != nil {
		return v.ServiceBusyError
	}

	return
}

// IsSetServiceBusyError returns true if ServiceBusyError is not nil.
func (v *MatchingService_QueryWorkflow_Result) IsSetServiceBusyError() bool {
	return v != nil && v.ServiceBusyError != nil
}

// GetStickyWorkerUnavailableError returns the value of StickyWorkerUnavailableError if it is set or its
// zero value if it is unset.
func (v *MatchingService_QueryWorkflow_Result) GetStickyWorkerUnavailableError() (o *shared.StickyWorkerUnavailableError) {
	if v != nil && v.StickyWorkerUnavailableError != nil {
		return v.StickyWorkerUnavailableError
	}

	return
}

// IsSetStickyWorkerUnavailableError returns true if StickyWorkerUnavailableError is not nil.
func (v *MatchingService_QueryWorkflow_Result) IsSetStickyWorkerUnavailableError() bool {
	return v != nil && v.StickyWorkerUnavailableError != nil
}

// GetTaskListNotOwnedByHostError returns the value of TaskListNotOwnedByHostError if it is set or its
// zero value if it is unset.
func (v *MatchingService_QueryWorkflow_Result) GetTaskListNotOwnedByHostError() (o *shared.TaskListNotOwnedByHostError) {
	if v != nil && v.TaskListNotOwnedByHostError != nil {
		return v.TaskListNotOwnedByHostError
	}

	return
}

// IsSetTaskListNotOwnedByHostError returns true if TaskListNotOwnedByHostError is not nil.
func (v *MatchingService_QueryWorkflow_Result) IsSetTaskListNotOwnedByHostError() bool {
	return v != nil && v.TaskListNotOwnedByHostError != nil
}

// MethodName returns the name of the Thrift function as specified in
// the IDL, for which this struct represent the result.
//
// This will always be "QueryWorkflow" for this struct.
func (v *MatchingService_QueryWorkflow_Result) MethodName() string {
	return "QueryWorkflow"
}

// EnvelopeType returns the kind of value inside this struct.
//
// This will always be Reply for this struct.
func (v *MatchingService_QueryWorkflow_Result) EnvelopeType() wire.EnvelopeType {
	return wire.Reply
}

// MatchingService_RespondQueryTaskCompleted_Args represents the arguments for the MatchingService.RespondQueryTaskCompleted function.
//
// The arguments for RespondQueryTaskCompleted are sent and received over the wire as this struct.
type MatchingService_RespondQueryTaskCompleted_Args struct {
	Request *RespondQueryTaskCompletedRequest `json:"request,omitempty"`
}

// ToWire translates a MatchingService_RespondQueryTaskCompleted_Args struct into a Thrift-level intermediate
// representation. This intermediate representation may be serialized
// into bytes using a ThriftRW protocol implementation.
//
// An error is returned if the struct or any of its fields failed to
// validate.
//
//	x, err := v.ToWire()
//	if err != nil {
//	  return err
//	}
//
//	if err := binaryProtocol.Encode(x, writer); err != nil {
//	  return err
//	}
func (v *MatchingService_RespondQueryTaskCompleted_Args) ToWire() (wire.Value, error) {
	var (
		fields [1]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.Request != nil {
		w, err = v.Request.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 1, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

func _RespondQueryTaskCompletedRequest_1_Read(w wire.Value) (*RespondQueryTaskCompletedRequest, error) {
	var v RespondQueryTaskCompletedRequest
	err := v.FromWire(w)
	return &v, err
}

// FromWire deserializes a MatchingService_RespondQueryTaskCompleted_Args struct from its Thrift-level
// representation. The Thrift-level representation may be obtained
// from a ThriftRW protocol implementation.
//
// An error is returned if we were unable to build a MatchingService_RespondQueryTaskCompleted_Args struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v MatchingService_RespondQueryTaskCompleted_Args
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *MatchingService_RespondQueryTaskCompleted_Args) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 1:
			if field.Value.Type() == wire.TStruct {
				v.Request, err = _RespondQueryTaskCompletedRequest_1_Read(field.Value)
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// Encode serializes a MatchingService_RespondQueryTaskCompleted_Args struct directly into bytes, without going
// through an intermediary type.
//
// An error is returned if a MatchingService_RespondQueryTaskCompleted_Args struct could not be encoded.
func (v *MatchingService_RespondQueryTaskCompleted_Args) Encode(sw stream.Writer) error {
	if err := sw.WriteStructBegin(); err != nil {
		return err
	}

	if v.Request != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 1, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.Request.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	return sw.WriteStructEnd()
}

func _RespondQueryTaskCompletedRequest_1_Decode(sr stream.Reader) (*RespondQueryTaskCompletedRequest, error) {
	var v RespondQueryTaskCompletedRequest
	err := v.Decode(sr)
	return &v, err
}

// Decode deserializes a MatchingService_RespondQueryTaskCompleted_Args struct directly from its Thrift-level
// representation, without going through an intemediary type.
//
// An error is returned if a MatchingService_RespondQueryTaskCompleted_Args struct could not be generated from the wire
// representation.
func (v *MatchingService_RespondQueryTaskCompleted_Args) Decode(sr stream.Reader) error {

	if err := sr.ReadStructBegin(); err != nil {
		return err
	}

	fh, ok, err := sr.ReadFieldBegin()
	if err != nil {
		return err
	}

	for ok {
		switch {
		case fh.ID == 1 && fh.Type == wire.TStruct:
			v.Request, err = _RespondQueryTaskCompletedRequest_1_Decode(sr)
			if err != nil {
				return err
			}

		default:
			if err := sr.Skip(fh.Type); err != nil {
				return err
			}
		}

		if err := sr.ReadFieldEnd(); err != nil {
			return err
		}

		if fh, ok, err = sr.ReadFieldBegin(); err != nil {
			return err
		}
	}

	if err := sr.ReadStructEnd(); err != nil {
		return err
	}

	return nil
}

// String returns a readable string representation of a MatchingService_RespondQueryTaskCompleted_Args
// struct.
func (v *MatchingService_RespondQueryTaskCompleted_Args) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [1]string
	i := 0
	if v.Request != nil {
		fields[i] = fmt.Sprintf("Request: %v", v.Request)
		i++
	}

	return fmt.Sprintf("MatchingService_RespondQueryTaskCompleted_Args{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this MatchingService_RespondQueryTaskCompleted_Args match the
// provided MatchingService_RespondQueryTaskCompleted_Args.
//
// This function performs a deep comparison.
func (v *MatchingService_RespondQueryTaskCompleted_Args) Equals(rhs *MatchingService_RespondQueryTaskCompleted_Args) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !((v.Request == nil && rhs.Request == nil) || (v.Request != nil && rhs.Request != nil && v.Request.Equals(rhs.Request))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of MatchingService_RespondQueryTaskCompleted_Args.
func (v *MatchingService_RespondQueryTaskCompleted_Args) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Request != nil {
		err = multierr.Append(err, enc.AddObject("request", v.Request))
	}
	return err
}

// GetRequest returns the value of Request if it is set or its
// zero value if it is unset.
func (v *MatchingService_RespondQueryTaskCompleted_Args) GetRequest() (o *RespondQueryTaskCompletedRequest) {
	if v != nil && v.Request != nil {
		return v.Request
	}

	return
}

// IsSetRequest returns true if Request is not nil.
func (v *MatchingService_RespondQueryTaskCompleted_Args) IsSetRequest() bool {
	return v != nil && v.Request != nil
}

// MethodName returns the name of the Thrift function as specified in
// the IDL, for which this struct represent the arguments.
//
// This will always be "RespondQueryTaskCompleted" for this struct.
func (v *MatchingService_RespondQueryTaskCompleted_Args) MethodName() string {
	return "RespondQueryTaskCompleted"
}

// EnvelopeType returns the kind of value inside this struct.
//
// This will always be Call for this struct.
func (v *MatchingService_RespondQueryTaskCompleted_Args) EnvelopeType() wire.EnvelopeType {
	return wire.Call
}

// MatchingService_RespondQueryTaskCompleted_Helper provides functions that aid in handling the
// parameters and return values of the MatchingService.RespondQueryTaskCompleted
// function.
var MatchingService_RespondQueryTaskCompleted_Helper = struct {
	// Args accepts the parameters of RespondQueryTaskCompleted in-order and returns
	// the arguments struct for the function.
	Args func(
		request *RespondQueryTaskCompletedRequest,
	) *MatchingService_RespondQueryTaskCompleted_Args

	// IsException returns true if the given error can be thrown
	// by RespondQueryTaskCompleted.
	//
	// An error can be thrown by RespondQueryTaskCompleted only if the
	// corresponding exception type was mentioned in the 'throws'
	// section for it in the Thrift file.
	IsException func(error) bool

	// WrapResponse returns the result struct for RespondQueryTaskCompleted
	// given the error returned by it. The provided error may
	// be nil if RespondQueryTaskCompleted did not fail.
	//
	// This allows mapping errors returned by RespondQueryTaskCompleted into a
	// serializable result struct. WrapResponse returns a
	// non-nil error if the provided error cannot be thrown by
	// RespondQueryTaskCompleted
	//
	//   err := RespondQueryTaskCompleted(args)
	//   result, err := MatchingService_RespondQueryTaskCompleted_Helper.WrapResponse(err)
	//   if err != nil {
	//     return fmt.Errorf("unexpected error from RespondQueryTaskCompleted: %v", err)
	//   }
	//   serialize(result)
	WrapResponse func(error) (*MatchingService_RespondQueryTaskCompleted_Result, error)

	// UnwrapResponse takes the result struct for RespondQueryTaskCompleted
	// and returns the erorr returned by it (if any).
	//
	// The error is non-nil only if RespondQueryTaskCompleted threw an
	// exception.
	//
	//   result := deserialize(bytes)
	//   err := MatchingService_RespondQueryTaskCompleted_Helper.UnwrapResponse(result)
	UnwrapResponse func(*MatchingService_RespondQueryTaskCompleted_Result) error
}{}

func init() {
	MatchingService_RespondQueryTaskCompleted_Helper.Args = func(
		request *RespondQueryTaskCompletedRequest,
	) *MatchingService_RespondQueryTaskCompleted_Args {
		return &MatchingService_RespondQueryTaskCompleted_Args{
			Request: request,
		}
	}

	MatchingService_RespondQueryTaskCompleted_Helper.IsException = func(err error) bool {
		switch err.(type) {
		case *shared.BadRequestError:
			return true
		case *shared.InternalServiceError:
			return true
		case *shared.EntityNotExistsError:
			return true
		case *shared.LimitExceededError:
			return true
		case *shared.ServiceBusyError:
			return true
		default:
			return false
		}
	}

	MatchingService_RespondQueryTaskCompleted_Helper.WrapResponse = func(err error) (*MatchingService_RespondQueryTaskCompleted_Result, error) {
		if err == nil {
			return &MatchingService_RespondQueryTaskCompleted_Result{}, nil
		}

		switch e := err.(type) {
		case *shared.BadRequestError:
			if e == nil {
				return nil, errors.New("WrapResponse received non-nil error type with nil value for MatchingService_RespondQueryTaskCompleted_Result.BadRequestError")
			}
			return &MatchingService_RespondQueryTaskCompleted_Result{BadRequestError: e}, nil
		case *shared.InternalServiceError:
			if e == nil {
				return nil, errors.New("WrapResponse received non-nil error type with nil value for MatchingService_RespondQueryTaskCompleted_Result.InternalServiceError")
			}
			return &MatchingService_RespondQueryTaskCompleted_Result{InternalServiceError: e}, nil
		case *shared.EntityNotExistsError:
			if e == nil {
				return nil, errors.New("WrapResponse received non-nil error type with nil value for MatchingService_RespondQueryTaskCompleted_Result.EntityNotExistError")
			}
			return &MatchingService_RespondQueryTaskCompleted_Result{EntityNotExistError: e}, nil
		case *shared.LimitExceededError:
			if e == nil {
				return nil, errors.New("WrapResponse received non-nil error type with nil value for MatchingService_RespondQueryTaskCompleted_Result.LimitExceededError")
			}
			return &MatchingService_RespondQueryTaskCompleted_Result{LimitExceededError: e}, nil
		case *shared.ServiceBusyError:
			if e == nil {
				return nil, errors.New("WrapResponse received non-nil error type with nil value for MatchingService_RespondQueryTaskCompleted_Result.ServiceBusyError")
			}
			return &MatchingService_RespondQueryTaskCompleted_Result{ServiceBusyError: e}, nil
		}

		return nil, err
	}
	MatchingService_RespondQueryTaskCompleted_Helper.UnwrapResponse = func(result *MatchingService_RespondQueryTaskCompleted_Result) (err error) {
		if result.BadRequestError != nil {
			err = result.BadRequestError
			return
		}
		if result.InternalServiceError != nil {
			err = result.InternalServiceError
			return
		}
		if result.EntityNotExistError != nil {
			err = result.EntityNotExistError
			return
		}
		if result.LimitExceededError != nil {
			err = result.LimitExceededError
			return
		}
		if result.ServiceBusyError != nil {
			err = result.ServiceBusyError
			return
		}
		return
	}

}

// MatchingService_RespondQueryTaskCompleted_Result represents the result of a MatchingService.RespondQueryTaskCompleted function call.
//
// The result of a RespondQueryTaskCompleted execution is sent and received over the wire as this struct.
type MatchingService_RespondQueryTaskCompleted_Result struct {
	BadRequestError      *shared.BadRequestError      `json:"badRequestError,omitempty"`
	InternalServiceError *shared.InternalServiceError `json:"internalServiceError,omitempty"`
	EntityNotExistError  *shared.EntityNotExistsError `json:"entityNotExistError,omitempty"`
	LimitExceededError   *shared.LimitExceededError   `json:"limitExceededError,omitempty"`
	ServiceBusyError     *shared.ServiceBusyError     `json:"serviceBusyError,omitempty"`
}

// ToWire translates a MatchingService_RespondQueryTaskCompleted_Result struct into a Thrift-level intermediate
// representation. This intermediate representation may be serialized
// into bytes using a ThriftRW protocol implementation.
//
// An error is returned if the struct or any of its fields failed to
// validate.
//
//	x, err := v.ToWire()
//	if err != nil {
//	  return err
//	}
//
//	if err := binaryProtocol.Encode(x, writer); err != nil {
//	  return err
//	}
func (v *MatchingService_RespondQueryTaskCompleted_Result) ToWire() (wire.Value, error) {
	var (
		fields [5]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.BadRequestError != nil {
		w, err = v.BadRequestError.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 1, Value: w}
		i++
	}
	if v.InternalServiceError != nil {
		w, err = v.InternalServiceError.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 2, Value: w}
		i++
	}
	if v.EntityNotExistError != nil {
		w, err = v.EntityNotExistError.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 3, Value: w}
		i++
	}
	if v.LimitExceededError != nil {
		w, err = v.LimitExceededError.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 4, Value: w}
		i++
	}
	if v.ServiceBusyError != nil {
		w, err = v.ServiceBusyError.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 5, Value: w}
		i++
	}

	if i > 1 {
		return wire.Value{}, fmt.Errorf("MatchingService_RespondQueryTaskCompleted_Result should have at most one field: got %v fields", i)
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

// FromWire deserializes a MatchingService_RespondQueryTaskCompleted_Result struct from its Thrift-level
// representation. The Thrift-level representation may be obtained
// from a ThriftRW protocol implementation.
//
// An error is returned if we were unable to build a MatchingService_RespondQueryTaskCompleted_Result struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v MatchingService_RespondQueryTaskCompleted_Result
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *MatchingService_RespondQueryTaskCompleted_Result) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 1:
			if field.Value.Type() == wire.TStruct {
				v.BadRequestError, err = _BadRequestError_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 2:
			if field.Value.Type() == wire.TStruct {
				v.InternalServiceError, err = _InternalServiceError_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 3:
			if field.Value.Type() == wire.TStruct {
				v.EntityNotExistError, err = _EntityNotExistsError_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 4:
			if field.Value.Type() == wire.TStruct {
				v.LimitExceededError, err = _LimitExceededError_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 5:
			if field.Value.Type() == wire.TStruct {
				v.ServiceBusyError, err = _ServiceBusyError_Read(field.Value)
				if err != nil {
					return err
				}

			}
		}
	}

	count := 0
	if v.BadRequestError != nil {
		count++
	}
	if v.InternalServiceError != nil {
		count++
	}
	if v.EntityNotExistError != nil {
		count++
	}
	if v.LimitExceededError != nil {
		count++
	}
	if v.ServiceBusyError != nil {
		count++
	}
	if count > 1 {
		return fmt.Errorf("MatchingService_RespondQueryTaskCompleted_Result should have at most one field: got %v fields", count)
	}

	return nil
}

// Encode serializes a MatchingService_RespondQueryTaskCompleted_Result struct directly into bytes, without going
// through an intermediary type.
//
// An error is returned if a MatchingService_RespondQueryTaskCompleted_Result struct could not be encoded.
func (v *MatchingService_RespondQueryTaskCompleted_Result) Encode(sw stream.Writer) error {
	if err := sw.WriteStructBegin(); err != nil {
		return err
	}

	if v.BadRequestError != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 1, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.BadRequestError.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.InternalServiceError != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 2, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.InternalServiceError.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.EntityNotExistError != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 3, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.EntityNotExistError.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.LimitExceededError != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 4, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.LimitExceededError.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	if v.ServiceBusyError != nil {
		if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 5, Type: wire.TStruct}); err != nil {
			return err
		}
		if err := v.ServiceBusyError.Encode(sw); err != nil {
			return err
		}
		if err := sw.WriteFieldEnd(); err != nil {
			return err
		}
	}

	count := 0
	if v.BadRequestError != nil {
		count++
	}
	if v.InternalServiceError != nil {
		count++
	}
	if v.EntityNotExistError != nil {
		count++
	}
	if v.LimitExceededError != nil {
		count++
	}
	if v.ServiceBusyError != nil {
		count++
	}

	if count > 1 {
		return fmt.Errorf("MatchingService_RespondQueryTaskCompleted_Result should have at most one field: got %v fields", count)
	}

	return sw.WriteStructEnd()
}

// Decode deserializes a MatchingService_RespondQueryTaskCompleted_Result struct directly from its Thrift-level
// representation, without going through an intemediary type.
//
// An error is returned if a MatchingService_RespondQueryTaskCompleted_Result struct could not be generated from the wire
// representation.
func (v *MatchingService_RespondQueryTaskCompleted_Result) Decode(sr stream.Reader) error {

	if err := sr.ReadStructBegin(); err != nil {
		return err
	}

	fh, ok, err := sr.ReadFieldBegin()
	if err != nil {
		return err
	}

	for ok {
		switch {
		case fh.ID == 1 && fh.Type == wire.TStruct:
			v.BadRequestError, err = _BadRequestError_Decode(sr)
			if err != nil {
				return err
			}

		case fh.ID == 2 && fh.Type == wire.TStruct:
			v.InternalServiceError, err = _InternalServiceError_Decode(sr)
			if err != nil {
				return err
			}

		case fh.ID == 3 && fh.Type == wire.TStruct:
			v.EntityNotExistError, err = _EntityNotExistsError_Decode(sr)
			if err != nil {
				return err
			}

		case fh.ID == 4 && fh.Type == wire.TStruct:
			v.LimitExceededError, err = _LimitExceededError_Decode(sr)
			if err != nil {
				return err
			}

		case fh.ID == 5 && fh.Type == wire.TStruct:
			v.ServiceBusyError, err = _ServiceBusyError_Decode(sr)
			if err != nil {
				return err
			}

		default:
			if err := sr.Skip(fh.Type); err != nil {
				return err
			}
		}

		if err := sr.ReadFieldEnd(); err != nil {
			return err
		}

		if fh, ok, err = sr.ReadFieldBegin(); err != nil {
			return err
		}
	}

	if err := sr.ReadStructEnd(); err != nil {
		return err
	}

	count := 0
	if v.BadRequestError != nil {
		count++
	}
	if v.InternalServiceError != nil {
		count++
	}
	if v.EntityNotExistError != nil {
		count++
	}
	if v.LimitExceededError != nil {
		count++
	}
	if v.ServiceBusyError != nil {
		count++
	}
	if count > 1 {
		return fmt.Errorf("MatchingService_RespondQueryTaskCompleted_Result should have at most one field: got %v fields", count)
	}

	return nil
}

// String returns a readable string representation of a MatchingService_RespondQueryTaskCompleted_Result
// struct.
func (v *MatchingService_RespondQueryTaskCompleted_Result) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [5]string
	i := 0
	if v.BadRequestError != nil {
		fields[i] = fmt.Sprintf("BadRequestError: %v", v.BadRequestError)
		i++
	}
	if v.InternalServiceError != nil {
		fields[i] = fmt.Sprintf("InternalServiceError: %v", v.InternalServiceError)
		i++
	}
	if v.EntityNotExistError != nil {
		fields[i] = fmt.Sprintf("EntityNotExistError: %v", v.EntityNotExistError)
		i++
	}
	if v.LimitExceededError != nil {
		fields[i] = fmt.Sprintf("LimitExceededError: %v", v.LimitExceededError)
		i++
	}
	if v.ServiceBusyError != nil {
		fields[i] = fmt.Sprintf("ServiceBusyError: %v", v.ServiceBusyError)
		i++
	}

	return fmt.Sprintf("MatchingService_RespondQueryTaskCompleted_Result{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this MatchingService_RespondQueryTaskCompleted_Result match the
// provided MatchingService_RespondQueryTaskCompleted_Result.
//
// This function performs a deep comparison.
func (v *MatchingService_RespondQueryTaskCompleted_Result) Equals(rhs *MatchingService_RespondQueryTaskCompleted_Result) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !((v.BadRequestError == nil && rhs.BadRequestError == nil) || (v.BadRequestError != nil && rhs.BadRequestError != nil && v.BadRequestError.Equals(rhs.BadRequestError))) {
		return false
	}
	if !((v.InternalServiceError == nil && rhs.InternalServiceError == nil) || (v.InternalServiceError != nil && rhs.InternalServiceError != nil && v.InternalServiceError.Equals(rhs.InternalServiceError))) {
		return false
	}
	if !((v.EntityNotExistError == nil && rhs.EntityNotExistError == nil) || (v.EntityNotExistError != nil && rhs.EntityNotExistError != nil && v.EntityNotExistError.Equals(rhs.EntityNotExistError))) {
		return false
	}
	if !((v.LimitExceededError == nil && rhs.LimitExceededError == nil) || (v.LimitExceededError != nil && rhs.LimitExceededError != nil && v.LimitExceededError.Equals(rhs.LimitExceededError))) {
		return false
	}
	if !((v.ServiceBusyError == nil && rhs.ServiceBusyError == nil) || (v.ServiceBusyError != nil && rhs.ServiceBusyError != nil && v.ServiceBusyError.Equals(rhs.ServiceBusyError))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of MatchingService_RespondQueryTaskCompleted_Result.
func (v *MatchingService_RespondQueryTaskCompleted_Result) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.BadRequestError != nil {
		err = multierr.Append(err, enc.AddObject("badRequestError", v.BadRequestError))
	}
	if v.InternalServiceError != nil {
		err = multierr.Append(err, enc.AddObject("internalServiceError", v.InternalServiceError))
	}
	if v.EntityNotExistError != nil {
		err = multierr.Append(err, enc.AddObject("entityNotExistError", v.EntityNotExistError))
	}
	if v.LimitExceededError != nil {
		err = multierr.Append(err, enc.AddObject("limitExceededError", v.LimitExceededError))
	}
	if v.ServiceBusyError != nil {
		err = multierr.Append(err, enc.AddObject("serviceBusyError", v.ServiceBusyError))
	}
	return err
}

// GetBadRequestError returns the value of BadRequestError if it is set or its
// zero value if it is unset.
func (v *MatchingService_RespondQueryTaskCompleted_Result) GetBadRequestError() (o *shared.BadRequestError) {
	if v != nil && v.BadRequestError != nil {
		return v.BadRequestError
	}

	return
}

// IsSetBadRequestError returns true if BadRequestError is not nil.
func (v *MatchingService_RespondQueryTaskCompleted_Result) IsSetBadRequestError() bool {
	return v != nil && v.BadRequestError != nil
}

// GetInternalServiceError returns the value of InternalServiceError if it is set or its
// zero value if it is unset.
func (v *MatchingService_RespondQueryTaskCompleted_Result) GetInternalServiceError() (o *shared.InternalServiceError) {
	if v != nil && v.InternalServiceError != nil {
		return v.InternalServiceError
	}

	return
}

// IsSetInternalServiceError returns true if InternalServiceError is not nil.
func (v *MatchingService_RespondQueryTaskCompleted_Result) IsSetInternalServiceError() bool {
	return v != nil && v.InternalServiceError != nil
}

// GetEntityNotExistError returns the value of EntityNotExistError if it is set or its
// zero value if it is unset.
func (v *MatchingService_RespondQueryTaskCompleted_Result) GetEntityNotExistError() (o *shared.EntityNotExistsError) {
	if v != nil && v.EntityNotExistError != nil {
		return v.EntityNotExistError
	}

	return
}

// IsSetEntityNotExistError returns true if EntityNotExistError is not nil.
func (v *MatchingService_RespondQueryTaskCompleted_Result) IsSetEntityNotExistError() bool {
	return v != nil && v.EntityNotExistError != nil
}

// GetLimitExceededError returns the value of LimitExceededError if it is set or its
// zero value if it is unset.
func (v *MatchingService_RespondQueryTaskCompleted_Result) GetLimitExceededError() (o *shared.LimitExceededError) {
	if v != nil && v.LimitExceededError != nil {
		return v.LimitExceededError
	}

	return
}

// IsSetLimitExceededError returns true if LimitExceededError is not nil.
func (v *MatchingService_RespondQueryTaskCompleted_Result) IsSetLimitExceededError() bool {
	return v != nil && v.LimitExceededError != nil
}

// GetServiceBusyError returns the value of ServiceBusyError if it is set or its
// zero value if it is unset.
func (v *MatchingService_RespondQueryTaskCompleted_Result) GetServiceBusyError() (o *shared.ServiceBusyError) {
	if v != nil && v.ServiceBusyError != nil {
		return v.ServiceBusyError
	}

	return
}

// IsSetServiceBusyError returns true if ServiceBusyError is not nil.
func (v *MatchingService_RespondQueryTaskCompleted_Result) IsSetServiceBusyError() bool {
	return v != nil && v.ServiceBusyError != nil
}

// MethodName returns the name of the Thrift function as specified in
// the IDL, for which this struct represent the result.
//
// This will always be "RespondQueryTaskCompleted" for this struct.
func (v *MatchingService_RespondQueryTaskCompleted_Result) MethodName() string {
	return "RespondQueryTaskCompleted"
}

// EnvelopeType returns the kind of value inside this struct.
//
// This will always be Reply for this struct.
func (v *MatchingService_RespondQueryTaskCompleted_Result) EnvelopeType() wire.EnvelopeType {
	return wire.Reply
}
