func (v *ActivityTaskCanceledEventAttributes) 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.Details, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}
			}
		case 20:
			if field.Value.Type() == wire.TI64 {
				var x int64
				x, err = field.Value.GetI64(), error(nil)
				v.LatestCancelRequestedEventId = &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.ScheduledEventId = &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.StartedEventId = &x
				if err != nil {
					return err
				}
			}
		case 50:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.Identity = &x
				if err != nil {
					return err
				}
			}
		}
	}
	return nil
}
FromWire deserializes a ActivityTaskCanceledEventAttributes 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 ActivityTaskCanceledEventAttributes struct
from the provided intermediate representation.

x, err := binaryProtocol.Decode(reader, wire.TStruct)
if err != nil {
return nil, err
}

var v ActivityTaskCanceledEventAttributes
if err := v.FromWire(x); err != nil {
return nil, err
}
return &v, nil
package shared
import (
	bytes "bytes"
	base64 "encoding/base64"
	json "encoding/json"
	errors "errors"
	fmt "fmt"
	multierr "go.uber.org/multierr"
	ptr "go.uber.org/thriftrw/ptr"
	thriftreflect "go.uber.org/thriftrw/thriftreflect"
	wire "go.uber.org/thriftrw/wire"
	zapcore "go.uber.org/zap/zapcore"
	math "math"
	strconv "strconv"
	strings "strings"
)
type AccessDeniedError struct {
	Message string `json:"message,required"`
}
func (v *AccessDeniedError) ToWire() (wire.Value, error) {
	var (
		fields [1]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)
	w, err = wire.NewValueString(v.Message), error(nil)
	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 (v *AccessDeniedError) FromWire(w wire.Value) error {
	var err error
	messageIsSet := false
	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 1:
			if field.Value.Type() == wire.TBinary {
				v.Message, err = field.Value.GetString(), error(nil)
				if err != nil {
					return err
				}
				messageIsSet = true
			}
		}
	}
	if !messageIsSet {
		return errors.New("field Message of AccessDeniedError is required")
	}
	return nil
}
func (v *AccessDeniedError) String() string {
	if v == nil {
		return "<nil>"
	}
	var fields [1]string
	i := 0
	fields[i] = fmt.Sprintf("Message: %v", v.Message)
	i++
	return fmt.Sprintf("AccessDeniedError{%v}", strings.Join(fields[:i], ", "))
}
func (*AccessDeniedError) ErrorName() string {
	return "AccessDeniedError"
}
func (v *AccessDeniedError) Equals(rhs *AccessDeniedError) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !(v.Message == rhs.Message) {
		return false
	}
	return true
}
func (v *AccessDeniedError) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	enc.AddString("message", v.Message)
	return err
}
func (v *AccessDeniedError) GetMessage() (o string) {
	if v != nil {
		o = v.Message
	}
	return
}
func (v *AccessDeniedError) Error() string {
	return v.String()
}
type ActivityLocalDispatchInfo struct {
	ActivityId                      *string `json:"activityId,omitempty"`
	ScheduledTimestamp              *int64  `json:"scheduledTimestamp,omitempty"`
	StartedTimestamp                *int64  `json:"startedTimestamp,omitempty"`
	ScheduledTimestampOfThisAttempt *int64  `json:"scheduledTimestampOfThisAttempt,omitempty"`
	TaskToken                       []byte  `json:"taskToken,omitempty"`
}
func (v *ActivityLocalDispatchInfo) ToWire() (wire.Value, error) {
	var (
		fields [5]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)
	if v.ActivityId != nil {
		w, err = wire.NewValueString(*(v.ActivityId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, 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: 20, 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: 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.TaskToken != nil {
		w, err = wire.NewValueBinary(v.TaskToken), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 50, Value: w}
		i++
	}
	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}
func (v *ActivityLocalDispatchInfo) 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.ActivityId = &x
				if err != nil {
					return err
				}
			}
		case 20:
			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 30:
			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 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.TBinary {
				v.TaskToken, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}
			}
		}
	}
	return nil
}
func (v *ActivityLocalDispatchInfo) String() string {
	if v == nil {
		return "<nil>"
	}
	var fields [5]string
	i := 0
	if v.ActivityId != nil {
		fields[i] = fmt.Sprintf("ActivityId: %v", *(v.ActivityId))
		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.ScheduledTimestampOfThisAttempt != nil {
		fields[i] = fmt.Sprintf("ScheduledTimestampOfThisAttempt: %v", *(v.ScheduledTimestampOfThisAttempt))
		i++
	}
	if v.TaskToken != nil {
		fields[i] = fmt.Sprintf("TaskToken: %v", v.TaskToken)
		i++
	}
	return fmt.Sprintf("ActivityLocalDispatchInfo{%v}", strings.Join(fields[:i], ", "))
}
func _String_EqualsPtr(lhs, rhs *string) bool {
	if lhs != nil && rhs != nil {
		x := *lhs
		y := *rhs
		return (x == y)
	}
	return lhs == nil && rhs == nil
}
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 (v *ActivityLocalDispatchInfo) Equals(rhs *ActivityLocalDispatchInfo) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.ActivityId, rhs.ActivityId) {
		return false
	}
	if !_I64_EqualsPtr(v.ScheduledTimestamp, rhs.ScheduledTimestamp) {
		return false
	}
	if !_I64_EqualsPtr(v.StartedTimestamp, rhs.StartedTimestamp) {
		return false
	}
	if !_I64_EqualsPtr(v.ScheduledTimestampOfThisAttempt, rhs.ScheduledTimestampOfThisAttempt) {
		return false
	}
	if !((v.TaskToken == nil && rhs.TaskToken == nil) || (v.TaskToken != nil && rhs.TaskToken != nil && bytes.Equal(v.TaskToken, rhs.TaskToken))) {
		return false
	}
	return true
}
func (v *ActivityLocalDispatchInfo) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.ActivityId != nil {
		enc.AddString("activityId", *v.ActivityId)
	}
	if v.ScheduledTimestamp != nil {
		enc.AddInt64("scheduledTimestamp", *v.ScheduledTimestamp)
	}
	if v.StartedTimestamp != nil {
		enc.AddInt64("startedTimestamp", *v.StartedTimestamp)
	}
	if v.ScheduledTimestampOfThisAttempt != nil {
		enc.AddInt64("scheduledTimestampOfThisAttempt", *v.ScheduledTimestampOfThisAttempt)
	}
	if v.TaskToken != nil {
		enc.AddString("taskToken", base64.StdEncoding.EncodeToString(v.TaskToken))
	}
	return err
}
func (v *ActivityLocalDispatchInfo) GetActivityId() (o string) {
	if v != nil && v.ActivityId != nil {
		return *v.ActivityId
	}
	return
}
func (v *ActivityLocalDispatchInfo) IsSetActivityId() bool {
	return v != nil && v.ActivityId != nil
}
func (v *ActivityLocalDispatchInfo) GetScheduledTimestamp() (o int64) {
	if v != nil && v.ScheduledTimestamp != nil {
		return *v.ScheduledTimestamp
	}
	return
}
func (v *ActivityLocalDispatchInfo) IsSetScheduledTimestamp() bool {
	return v != nil && v.ScheduledTimestamp != nil
}
func (v *ActivityLocalDispatchInfo) GetStartedTimestamp() (o int64) {
	if v != nil && v.StartedTimestamp != nil {
		return *v.StartedTimestamp
	}
	return
}
func (v *ActivityLocalDispatchInfo) IsSetStartedTimestamp() bool {
	return v != nil && v.StartedTimestamp != nil
}
func (v *ActivityLocalDispatchInfo) GetScheduledTimestampOfThisAttempt() (o int64) {
	if v != nil && v.ScheduledTimestampOfThisAttempt != nil {
		return *v.ScheduledTimestampOfThisAttempt
	}
	return
}
func (v *ActivityLocalDispatchInfo) IsSetScheduledTimestampOfThisAttempt() bool {
	return v != nil && v.ScheduledTimestampOfThisAttempt != nil
}
func (v *ActivityLocalDispatchInfo) GetTaskToken() (o []byte) {
	if v != nil && v.TaskToken != nil {
		return v.TaskToken
	}
	return
}
func (v *ActivityLocalDispatchInfo) IsSetTaskToken() bool {
	return v != nil && v.TaskToken != nil
}
type ActivityTaskCancelRequestedEventAttributes struct {
	ActivityId                   *string `json:"activityId,omitempty"`
	DecisionTaskCompletedEventId *int64  `json:"decisionTaskCompletedEventId,omitempty"`
}
func (v *ActivityTaskCancelRequestedEventAttributes) ToWire() (wire.Value, error) {
	var (
		fields [2]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)
	if v.ActivityId != nil {
		w, err = wire.NewValueString(*(v.ActivityId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.DecisionTaskCompletedEventId != nil {
		w, err = wire.NewValueI64(*(v.DecisionTaskCompletedEventId)), error(nil)
		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 (v *ActivityTaskCancelRequestedEventAttributes) 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.ActivityId = &x
				if err != nil {
					return err
				}
			}
		case 20:
			if field.Value.Type() == wire.TI64 {
				var x int64
				x, err = field.Value.GetI64(), error(nil)
				v.DecisionTaskCompletedEventId = &x
				if err != nil {
					return err
				}
			}
		}
	}
	return nil
}
func (v *ActivityTaskCancelRequestedEventAttributes) String() string {
	if v == nil {
		return "<nil>"
	}
	var fields [2]string
	i := 0
	if v.ActivityId != nil {
		fields[i] = fmt.Sprintf("ActivityId: %v", *(v.ActivityId))
		i++
	}
	if v.DecisionTaskCompletedEventId != nil {
		fields[i] = fmt.Sprintf("DecisionTaskCompletedEventId: %v", *(v.DecisionTaskCompletedEventId))
		i++
	}
	return fmt.Sprintf("ActivityTaskCancelRequestedEventAttributes{%v}", strings.Join(fields[:i], ", "))
}
func (v *ActivityTaskCancelRequestedEventAttributes) Equals(rhs *ActivityTaskCancelRequestedEventAttributes) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.ActivityId, rhs.ActivityId) {
		return false
	}
	if !_I64_EqualsPtr(v.DecisionTaskCompletedEventId, rhs.DecisionTaskCompletedEventId) {
		return false
	}
	return true
}
func (v *ActivityTaskCancelRequestedEventAttributes) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.ActivityId != nil {
		enc.AddString("activityId", *v.ActivityId)
	}
	if v.DecisionTaskCompletedEventId != nil {
		enc.AddInt64("decisionTaskCompletedEventId", *v.DecisionTaskCompletedEventId)
	}
	return err
}
func (v *ActivityTaskCancelRequestedEventAttributes) GetActivityId() (o string) {
	if v != nil && v.ActivityId != nil {
		return *v.ActivityId
	}
	return
}
func (v *ActivityTaskCancelRequestedEventAttributes) IsSetActivityId() bool {
	return v != nil && v.ActivityId != nil
}
func (v *ActivityTaskCancelRequestedEventAttributes) GetDecisionTaskCompletedEventId() (o int64) {
	if v != nil && v.DecisionTaskCompletedEventId != nil {
		return *v.DecisionTaskCompletedEventId
	}
	return
}
func (v *ActivityTaskCancelRequestedEventAttributes) IsSetDecisionTaskCompletedEventId() bool {
	return v != nil && v.DecisionTaskCompletedEventId != nil
}
type ActivityTaskCanceledEventAttributes struct {
	Details                      []byte  `json:"details,omitempty"`
	LatestCancelRequestedEventId *int64  `json:"latestCancelRequestedEventId,omitempty"`
	ScheduledEventId             *int64  `json:"scheduledEventId,omitempty"`
	StartedEventId               *int64  `json:"startedEventId,omitempty"`
	Identity                     *string `json:"identity,omitempty"`
}
func (v *ActivityTaskCanceledEventAttributes) ToWire() (wire.Value, error) {
	var (
		fields [5]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)
	if v.Details != nil {
		w, err = wire.NewValueBinary(v.Details), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.LatestCancelRequestedEventId != nil {
		w, err = wire.NewValueI64(*(v.LatestCancelRequestedEventId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.ScheduledEventId != nil {
		w, err = wire.NewValueI64(*(v.ScheduledEventId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, 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: 40, Value: w}
		i++
	}
	if v.Identity != nil {
		w, err = wire.NewValueString(*(v.Identity)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 50, Value: w}
		i++
	}
	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}