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

package shared

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

	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"
)

type AccessDeniedError struct {
	Message string `json:"message,required"`
}

// ToWire translates a AccessDeniedError 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 *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
}

// FromWire deserializes a AccessDeniedError 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 AccessDeniedError struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v AccessDeniedError
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, 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
}

// String returns a readable string representation of a AccessDeniedError
// struct.
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], ", "))
}

// ErrorName is the name of this type as defined in the Thrift
// file.
func (*AccessDeniedError) ErrorName() string {
	return "AccessDeniedError"
}

// Equals returns true if all the fields of this AccessDeniedError match the
// provided AccessDeniedError.
//
// This function performs a deep comparison.
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
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of AccessDeniedError.
func (v *AccessDeniedError) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	enc.AddString("message", v.Message)
	return err
}

// GetMessage returns the value of Message if it is set or its
// zero value if it is unset.
func (v *AccessDeniedError) GetMessage() (o string) {
	if v != nil {
		o = v.Message
	}
	return
}

func (v *AccessDeniedError) Error() string {
	return v.String()
}

type ActiveClusterInfo struct {
	ActiveClusterName *string `json:"activeClusterName,omitempty"`
	FailoverVersion   *int64  `json:"failoverVersion,omitempty"`
}

// ToWire translates a ActiveClusterInfo 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 *ActiveClusterInfo) ToWire() (wire.Value, error) {
	var (
		fields [2]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.ActiveClusterName != nil {
		w, err = wire.NewValueString(*(v.ActiveClusterName)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.FailoverVersion != nil {
		w, err = wire.NewValueI64(*(v.FailoverVersion)), 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
}

// FromWire deserializes a ActiveClusterInfo 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 ActiveClusterInfo struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v ActiveClusterInfo
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *ActiveClusterInfo) 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.ActiveClusterName = &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.FailoverVersion = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

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

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

	return fmt.Sprintf("ActiveClusterInfo{%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
}

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

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of ActiveClusterInfo.
func (v *ActiveClusterInfo) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.ActiveClusterName != nil {
		enc.AddString("activeClusterName", *v.ActiveClusterName)
	}
	if v.FailoverVersion != nil {
		enc.AddInt64("failoverVersion", *v.FailoverVersion)
	}
	return err
}

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

	return
}

// IsSetActiveClusterName returns true if ActiveClusterName is not nil.
func (v *ActiveClusterInfo) IsSetActiveClusterName() bool {
	return v != nil && v.ActiveClusterName != nil
}

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

	return
}

// IsSetFailoverVersion returns true if FailoverVersion is not nil.
func (v *ActiveClusterInfo) IsSetFailoverVersion() bool {
	return v != nil && v.FailoverVersion != nil
}

type ActiveClusterSelectionPolicy struct {
	Strategy           *ActiveClusterSelectionStrategy `json:"strategy,omitempty"`
	StickyRegion       *string                         `json:"stickyRegion,omitempty"`
	ExternalEntityType *string                         `json:"externalEntityType,omitempty"`
	ExternalEntityKey  *string                         `json:"externalEntityKey,omitempty"`
}

// ToWire translates a ActiveClusterSelectionPolicy 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 *ActiveClusterSelectionPolicy) ToWire() (wire.Value, error) {
	var (
		fields [4]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.Strategy != nil {
		w, err = v.Strategy.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.StickyRegion != nil {
		w, err = wire.NewValueString(*(v.StickyRegion)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.ExternalEntityType != nil {
		w, err = wire.NewValueString(*(v.ExternalEntityType)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.ExternalEntityKey != nil {
		w, err = wire.NewValueString(*(v.ExternalEntityKey)), 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 _ActiveClusterSelectionStrategy_Read(w wire.Value) (ActiveClusterSelectionStrategy, error) {
	var v ActiveClusterSelectionStrategy
	err := v.FromWire(w)
	return v, err
}

// FromWire deserializes a ActiveClusterSelectionPolicy 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 ActiveClusterSelectionPolicy struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v ActiveClusterSelectionPolicy
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *ActiveClusterSelectionPolicy) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			if field.Value.Type() == wire.TI32 {
				var x ActiveClusterSelectionStrategy
				x, err = _ActiveClusterSelectionStrategy_Read(field.Value)
				v.Strategy = &x
				if err != nil {
					return err
				}

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

			}
		case 30:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.ExternalEntityType = &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.ExternalEntityKey = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

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

	var fields [4]string
	i := 0
	if v.Strategy != nil {
		fields[i] = fmt.Sprintf("Strategy: %v", *(v.Strategy))
		i++
	}
	if v.StickyRegion != nil {
		fields[i] = fmt.Sprintf("StickyRegion: %v", *(v.StickyRegion))
		i++
	}
	if v.ExternalEntityType != nil {
		fields[i] = fmt.Sprintf("ExternalEntityType: %v", *(v.ExternalEntityType))
		i++
	}
	if v.ExternalEntityKey != nil {
		fields[i] = fmt.Sprintf("ExternalEntityKey: %v", *(v.ExternalEntityKey))
		i++
	}

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

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

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

// Equals returns true if all the fields of this ActiveClusterSelectionPolicy match the
// provided ActiveClusterSelectionPolicy.
//
// This function performs a deep comparison.
func (v *ActiveClusterSelectionPolicy) Equals(rhs *ActiveClusterSelectionPolicy) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_ActiveClusterSelectionStrategy_EqualsPtr(v.Strategy, rhs.Strategy) {
		return false
	}
	if !_String_EqualsPtr(v.StickyRegion, rhs.StickyRegion) {
		return false
	}
	if !_String_EqualsPtr(v.ExternalEntityType, rhs.ExternalEntityType) {
		return false
	}
	if !_String_EqualsPtr(v.ExternalEntityKey, rhs.ExternalEntityKey) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of ActiveClusterSelectionPolicy.
func (v *ActiveClusterSelectionPolicy) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Strategy != nil {
		err = multierr.Append(err, enc.AddObject("strategy", *v.Strategy))
	}
	if v.StickyRegion != nil {
		enc.AddString("stickyRegion", *v.StickyRegion)
	}
	if v.ExternalEntityType != nil {
		enc.AddString("externalEntityType", *v.ExternalEntityType)
	}
	if v.ExternalEntityKey != nil {
		enc.AddString("externalEntityKey", *v.ExternalEntityKey)
	}
	return err
}

// GetStrategy returns the value of Strategy if it is set or its
// zero value if it is unset.
func (v *ActiveClusterSelectionPolicy) GetStrategy() (o ActiveClusterSelectionStrategy) {
	if v != nil && v.Strategy != nil {
		return *v.Strategy
	}

	return
}

// IsSetStrategy returns true if Strategy is not nil.
func (v *ActiveClusterSelectionPolicy) IsSetStrategy() bool {
	return v != nil && v.Strategy != nil
}

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

	return
}

// IsSetStickyRegion returns true if StickyRegion is not nil.
func (v *ActiveClusterSelectionPolicy) IsSetStickyRegion() bool {
	return v != nil && v.StickyRegion != nil
}

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

	return
}

// IsSetExternalEntityType returns true if ExternalEntityType is not nil.
func (v *ActiveClusterSelectionPolicy) IsSetExternalEntityType() bool {
	return v != nil && v.ExternalEntityType != nil
}

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

	return
}

// IsSetExternalEntityKey returns true if ExternalEntityKey is not nil.
func (v *ActiveClusterSelectionPolicy) IsSetExternalEntityKey() bool {
	return v != nil && v.ExternalEntityKey != nil
}

type ActiveClusterSelectionStrategy int32

const (
	ActiveClusterSelectionStrategyRegionSticky   ActiveClusterSelectionStrategy = 0
	ActiveClusterSelectionStrategyExternalEntity ActiveClusterSelectionStrategy = 1
)

// ActiveClusterSelectionStrategy_Values returns all recognized values of ActiveClusterSelectionStrategy.
func ActiveClusterSelectionStrategy_Values() []ActiveClusterSelectionStrategy {
	return []ActiveClusterSelectionStrategy{
		ActiveClusterSelectionStrategyRegionSticky,
		ActiveClusterSelectionStrategyExternalEntity,
	}
}

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

// MarshalText encodes ActiveClusterSelectionStrategy 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 ActiveClusterSelectionStrategy) MarshalText() ([]byte, error) {
	switch int32(v) {
	case 0:
		return []byte("REGION_STICKY"), nil
	case 1:
		return []byte("EXTERNAL_ENTITY"), nil
	}
	return []byte(strconv.FormatInt(int64(v), 10)), nil
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of ActiveClusterSelectionStrategy.
// 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 ActiveClusterSelectionStrategy) MarshalLogObject(enc zapcore.ObjectEncoder) error {
	enc.AddInt32("value", int32(v))
	switch int32(v) {
	case 0:
		enc.AddString("name", "REGION_STICKY")
	case 1:
		enc.AddString("name", "EXTERNAL_ENTITY")
	}
	return nil
}

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

// ToWire translates ActiveClusterSelectionStrategy 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 ActiveClusterSelectionStrategy) ToWire() (wire.Value, error) {
	return wire.NewValueI32(int32(v)), nil
}

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

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

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

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

// UnmarshalJSON attempts to decode ActiveClusterSelectionStrategy 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 *ActiveClusterSelectionStrategy) 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, "ActiveClusterSelectionStrategy")
		}
		if x < math.MinInt32 {
			return fmt.Errorf("enum underflow from JSON %q for %q", text, "ActiveClusterSelectionStrategy")
		}
		*v = (ActiveClusterSelectionStrategy)(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, "ActiveClusterSelectionStrategy")
	}
}

type ActiveClusters struct {
	ActiveClustersByRegion map[string]*ActiveClusterInfo `json:"activeClustersByRegion,omitempty"`
}

type _Map_String_ActiveClusterInfo_MapItemList map[string]*ActiveClusterInfo

func (m _Map_String_ActiveClusterInfo_MapItemList) ForEach(f func(wire.MapItem) error) error {
	for k, v := range m {
		if v == nil {
			return fmt.Errorf("invalid [%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_ActiveClusterInfo_MapItemList) Size() int {
	return len(m)
}

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

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

func (_Map_String_ActiveClusterInfo_MapItemList) Close() {}

// ToWire translates a ActiveClusters 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 *ActiveClusters) ToWire() (wire.Value, error) {
	var (
		fields [1]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.ActiveClustersByRegion != nil {
		w, err = wire.NewValueMap(_Map_String_ActiveClusterInfo_MapItemList(v.ActiveClustersByRegion)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}

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

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

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

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

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

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

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

// FromWire deserializes a ActiveClusters 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 ActiveClusters struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v ActiveClusters
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *ActiveClusters) FromWire(w wire.Value) error {
	var err error

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

			}
		}
	}

	return nil
}

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

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

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

func _Map_String_ActiveClusterInfo_Equals(lhs, rhs map[string]*ActiveClusterInfo) 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 ActiveClusters match the
// provided ActiveClusters.
//
// This function performs a deep comparison.
func (v *ActiveClusters) Equals(rhs *ActiveClusters) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !((v.ActiveClustersByRegion == nil && rhs.ActiveClustersByRegion == nil) || (v.ActiveClustersByRegion != nil && rhs.ActiveClustersByRegion != nil && _Map_String_ActiveClusterInfo_Equals(v.ActiveClustersByRegion, rhs.ActiveClustersByRegion))) {
		return false
	}

	return true
}

type _Map_String_ActiveClusterInfo_Zapper map[string]*ActiveClusterInfo

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of _Map_String_ActiveClusterInfo_Zapper.
func (m _Map_String_ActiveClusterInfo_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 ActiveClusters.
func (v *ActiveClusters) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.ActiveClustersByRegion != nil {
		err = multierr.Append(err, enc.AddObject("activeClustersByRegion", (_Map_String_ActiveClusterInfo_Zapper)(v.ActiveClustersByRegion)))
	}
	return err
}

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

	return
}

// IsSetActiveClustersByRegion returns true if ActiveClustersByRegion is not nil.
func (v *ActiveClusters) IsSetActiveClustersByRegion() bool {
	return v != nil && v.ActiveClustersByRegion != nil
}

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"`
}

// ToWire translates a ActivityLocalDispatchInfo 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 *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
}

// FromWire deserializes a ActivityLocalDispatchInfo 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 ActivityLocalDispatchInfo struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v ActivityLocalDispatchInfo
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, 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
}

// String returns a readable string representation of a ActivityLocalDispatchInfo
// struct.
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], ", "))
}

// Equals returns true if all the fields of this ActivityLocalDispatchInfo match the
// provided ActivityLocalDispatchInfo.
//
// This function performs a deep comparison.
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
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of ActivityLocalDispatchInfo.
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
}

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

	return
}

// IsSetActivityId returns true if ActivityId is not nil.
func (v *ActivityLocalDispatchInfo) IsSetActivityId() bool {
	return v != nil && v.ActivityId != nil
}

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

	return
}

// IsSetScheduledTimestamp returns true if ScheduledTimestamp is not nil.
func (v *ActivityLocalDispatchInfo) 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 *ActivityLocalDispatchInfo) GetStartedTimestamp() (o int64) {
	if v != nil && v.StartedTimestamp != nil {
		return *v.StartedTimestamp
	}

	return
}

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

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

	return
}

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

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

	return
}

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

type ActivityTaskCancelRequestedEventAttributes struct {
	ActivityId                   *string `json:"activityId,omitempty"`
	DecisionTaskCompletedEventId *int64  `json:"decisionTaskCompletedEventId,omitempty"`
}

// ToWire translates a ActivityTaskCancelRequestedEventAttributes 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 *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
}

// FromWire deserializes a ActivityTaskCancelRequestedEventAttributes 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 ActivityTaskCancelRequestedEventAttributes struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v ActivityTaskCancelRequestedEventAttributes
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, 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
}

// String returns a readable string representation of a ActivityTaskCancelRequestedEventAttributes
// struct.
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], ", "))
}

// Equals returns true if all the fields of this ActivityTaskCancelRequestedEventAttributes match the
// provided ActivityTaskCancelRequestedEventAttributes.
//
// This function performs a deep comparison.
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
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of ActivityTaskCancelRequestedEventAttributes.
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
}

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

	return
}

// IsSetActivityId returns true if ActivityId is not nil.
func (v *ActivityTaskCancelRequestedEventAttributes) IsSetActivityId() bool {
	return v != nil && v.ActivityId != nil
}

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

	return
}

// IsSetDecisionTaskCompletedEventId returns true if DecisionTaskCompletedEventId is not nil.
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"`
}

// ToWire translates a ActivityTaskCanceledEventAttributes 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 *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
}

// 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
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
}

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

	var fields [5]string
	i := 0
	if v.Details != nil {
		fields[i] = fmt.Sprintf("Details: %v", v.Details)
		i++
	}
	if v.LatestCancelRequestedEventId != nil {
		fields[i] = fmt.Sprintf("LatestCancelRequestedEventId: %v", *(v.LatestCancelRequestedEventId))
		i++
	}
	if v.ScheduledEventId != nil {
		fields[i] = fmt.Sprintf("ScheduledEventId: %v", *(v.ScheduledEventId))
		i++
	}
	if v.StartedEventId != nil {
		fields[i] = fmt.Sprintf("StartedEventId: %v", *(v.StartedEventId))
		i++
	}
	if v.Identity != nil {
		fields[i] = fmt.Sprintf("Identity: %v", *(v.Identity))
		i++
	}

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

// Equals returns true if all the fields of this ActivityTaskCanceledEventAttributes match the
// provided ActivityTaskCanceledEventAttributes.
//
// This function performs a deep comparison.
func (v *ActivityTaskCanceledEventAttributes) Equals(rhs *ActivityTaskCanceledEventAttributes) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !((v.Details == nil && rhs.Details == nil) || (v.Details != nil && rhs.Details != nil && bytes.Equal(v.Details, rhs.Details))) {
		return false
	}
	if !_I64_EqualsPtr(v.LatestCancelRequestedEventId, rhs.LatestCancelRequestedEventId) {
		return false
	}
	if !_I64_EqualsPtr(v.ScheduledEventId, rhs.ScheduledEventId) {
		return false
	}
	if !_I64_EqualsPtr(v.StartedEventId, rhs.StartedEventId) {
		return false
	}
	if !_String_EqualsPtr(v.Identity, rhs.Identity) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of ActivityTaskCanceledEventAttributes.
func (v *ActivityTaskCanceledEventAttributes) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Details != nil {
		enc.AddString("details", base64.StdEncoding.EncodeToString(v.Details))
	}
	if v.LatestCancelRequestedEventId != nil {
		enc.AddInt64("latestCancelRequestedEventId", *v.LatestCancelRequestedEventId)
	}
	if v.ScheduledEventId != nil {
		enc.AddInt64("scheduledEventId", *v.ScheduledEventId)
	}
	if v.StartedEventId != nil {
		enc.AddInt64("startedEventId", *v.StartedEventId)
	}
	if v.Identity != nil {
		enc.AddString("identity", *v.Identity)
	}
	return err
}

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

	return
}

// IsSetDetails returns true if Details is not nil.
func (v *ActivityTaskCanceledEventAttributes) IsSetDetails() bool {
	return v != nil && v.Details != nil
}

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

	return
}

// IsSetLatestCancelRequestedEventId returns true if LatestCancelRequestedEventId is not nil.
func (v *ActivityTaskCanceledEventAttributes) IsSetLatestCancelRequestedEventId() bool {
	return v != nil && v.LatestCancelRequestedEventId != nil
}

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

	return
}

// IsSetScheduledEventId returns true if ScheduledEventId is not nil.
func (v *ActivityTaskCanceledEventAttributes) IsSetScheduledEventId() bool {
	return v != nil && v.ScheduledEventId != nil
}

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

	return
}

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

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

	return
}

// IsSetIdentity returns true if Identity is not nil.
func (v *ActivityTaskCanceledEventAttributes) IsSetIdentity() bool {
	return v != nil && v.Identity != nil
}

type ActivityTaskCompletedEventAttributes struct {
	Result           []byte  `json:"result,omitempty"`
	ScheduledEventId *int64  `json:"scheduledEventId,omitempty"`
	StartedEventId   *int64  `json:"startedEventId,omitempty"`
	Identity         *string `json:"identity,omitempty"`
}

// ToWire translates a ActivityTaskCompletedEventAttributes 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 *ActivityTaskCompletedEventAttributes) ToWire() (wire.Value, error) {
	var (
		fields [4]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.Result != nil {
		w, err = wire.NewValueBinary(v.Result), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, 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: 20, 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: 30, 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: 40, Value: w}
		i++
	}

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

// FromWire deserializes a ActivityTaskCompletedEventAttributes 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 ActivityTaskCompletedEventAttributes struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v ActivityTaskCompletedEventAttributes
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *ActivityTaskCompletedEventAttributes) 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.Result, 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.ScheduledEventId = &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.StartedEventId = &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.Identity = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

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

	var fields [4]string
	i := 0
	if v.Result != nil {
		fields[i] = fmt.Sprintf("Result: %v", v.Result)
		i++
	}
	if v.ScheduledEventId != nil {
		fields[i] = fmt.Sprintf("ScheduledEventId: %v", *(v.ScheduledEventId))
		i++
	}
	if v.StartedEventId != nil {
		fields[i] = fmt.Sprintf("StartedEventId: %v", *(v.StartedEventId))
		i++
	}
	if v.Identity != nil {
		fields[i] = fmt.Sprintf("Identity: %v", *(v.Identity))
		i++
	}

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

// Equals returns true if all the fields of this ActivityTaskCompletedEventAttributes match the
// provided ActivityTaskCompletedEventAttributes.
//
// This function performs a deep comparison.
func (v *ActivityTaskCompletedEventAttributes) Equals(rhs *ActivityTaskCompletedEventAttributes) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !((v.Result == nil && rhs.Result == nil) || (v.Result != nil && rhs.Result != nil && bytes.Equal(v.Result, rhs.Result))) {
		return false
	}
	if !_I64_EqualsPtr(v.ScheduledEventId, rhs.ScheduledEventId) {
		return false
	}
	if !_I64_EqualsPtr(v.StartedEventId, rhs.StartedEventId) {
		return false
	}
	if !_String_EqualsPtr(v.Identity, rhs.Identity) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of ActivityTaskCompletedEventAttributes.
func (v *ActivityTaskCompletedEventAttributes) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Result != nil {
		enc.AddString("result", base64.StdEncoding.EncodeToString(v.Result))
	}
	if v.ScheduledEventId != nil {
		enc.AddInt64("scheduledEventId", *v.ScheduledEventId)
	}
	if v.StartedEventId != nil {
		enc.AddInt64("startedEventId", *v.StartedEventId)
	}
	if v.Identity != nil {
		enc.AddString("identity", *v.Identity)
	}
	return err
}

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

	return
}

// IsSetResult returns true if Result is not nil.
func (v *ActivityTaskCompletedEventAttributes) IsSetResult() bool {
	return v != nil && v.Result != nil
}

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

	return
}

// IsSetScheduledEventId returns true if ScheduledEventId is not nil.
func (v *ActivityTaskCompletedEventAttributes) IsSetScheduledEventId() bool {
	return v != nil && v.ScheduledEventId != nil
}

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

	return
}

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

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

	return
}

// IsSetIdentity returns true if Identity is not nil.
func (v *ActivityTaskCompletedEventAttributes) IsSetIdentity() bool {
	return v != nil && v.Identity != nil
}

type ActivityTaskFailedEventAttributes struct {
	Reason           *string `json:"reason,omitempty"`
	Details          []byte  `json:"details,omitempty"`
	ScheduledEventId *int64  `json:"scheduledEventId,omitempty"`
	StartedEventId   *int64  `json:"startedEventId,omitempty"`
	Identity         *string `json:"identity,omitempty"`
}

// ToWire translates a ActivityTaskFailedEventAttributes 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 *ActivityTaskFailedEventAttributes) ToWire() (wire.Value, error) {
	var (
		fields [5]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.Reason != nil {
		w, err = wire.NewValueString(*(v.Reason)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.Details != nil {
		w, err = wire.NewValueBinary(v.Details), 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
}

// FromWire deserializes a ActivityTaskFailedEventAttributes 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 ActivityTaskFailedEventAttributes struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v ActivityTaskFailedEventAttributes
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *ActivityTaskFailedEventAttributes) 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.Reason = &x
				if err != nil {
					return err
				}

			}
		case 20:
			if field.Value.Type() == wire.TBinary {
				v.Details, err = field.Value.GetBinary(), error(nil)
				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
}

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

	var fields [5]string
	i := 0
	if v.Reason != nil {
		fields[i] = fmt.Sprintf("Reason: %v", *(v.Reason))
		i++
	}
	if v.Details != nil {
		fields[i] = fmt.Sprintf("Details: %v", v.Details)
		i++
	}
	if v.ScheduledEventId != nil {
		fields[i] = fmt.Sprintf("ScheduledEventId: %v", *(v.ScheduledEventId))
		i++
	}
	if v.StartedEventId != nil {
		fields[i] = fmt.Sprintf("StartedEventId: %v", *(v.StartedEventId))
		i++
	}
	if v.Identity != nil {
		fields[i] = fmt.Sprintf("Identity: %v", *(v.Identity))
		i++
	}

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

// Equals returns true if all the fields of this ActivityTaskFailedEventAttributes match the
// provided ActivityTaskFailedEventAttributes.
//
// This function performs a deep comparison.
func (v *ActivityTaskFailedEventAttributes) Equals(rhs *ActivityTaskFailedEventAttributes) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.Reason, rhs.Reason) {
		return false
	}
	if !((v.Details == nil && rhs.Details == nil) || (v.Details != nil && rhs.Details != nil && bytes.Equal(v.Details, rhs.Details))) {
		return false
	}
	if !_I64_EqualsPtr(v.ScheduledEventId, rhs.ScheduledEventId) {
		return false
	}
	if !_I64_EqualsPtr(v.StartedEventId, rhs.StartedEventId) {
		return false
	}
	if !_String_EqualsPtr(v.Identity, rhs.Identity) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of ActivityTaskFailedEventAttributes.
func (v *ActivityTaskFailedEventAttributes) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Reason != nil {
		enc.AddString("reason", *v.Reason)
	}
	if v.Details != nil {
		enc.AddString("details", base64.StdEncoding.EncodeToString(v.Details))
	}
	if v.ScheduledEventId != nil {
		enc.AddInt64("scheduledEventId", *v.ScheduledEventId)
	}
	if v.StartedEventId != nil {
		enc.AddInt64("startedEventId", *v.StartedEventId)
	}
	if v.Identity != nil {
		enc.AddString("identity", *v.Identity)
	}
	return err
}

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

	return
}

// IsSetReason returns true if Reason is not nil.
func (v *ActivityTaskFailedEventAttributes) IsSetReason() bool {
	return v != nil && v.Reason != nil
}

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

	return
}

// IsSetDetails returns true if Details is not nil.
func (v *ActivityTaskFailedEventAttributes) IsSetDetails() bool {
	return v != nil && v.Details != nil
}

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

	return
}

// IsSetScheduledEventId returns true if ScheduledEventId is not nil.
func (v *ActivityTaskFailedEventAttributes) IsSetScheduledEventId() bool {
	return v != nil && v.ScheduledEventId != nil
}

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

	return
}

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

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

	return
}

// IsSetIdentity returns true if Identity is not nil.
func (v *ActivityTaskFailedEventAttributes) IsSetIdentity() bool {
	return v != nil && v.Identity != nil
}

type ActivityTaskScheduledEventAttributes struct {
	ActivityId                    *string       `json:"activityId,omitempty"`
	ActivityType                  *ActivityType `json:"activityType,omitempty"`
	Domain                        *string       `json:"domain,omitempty"`
	TaskList                      *TaskList     `json:"taskList,omitempty"`
	Input                         []byte        `json:"input,omitempty"`
	ScheduleToCloseTimeoutSeconds *int32        `json:"scheduleToCloseTimeoutSeconds,omitempty"`
	ScheduleToStartTimeoutSeconds *int32        `json:"scheduleToStartTimeoutSeconds,omitempty"`
	StartToCloseTimeoutSeconds    *int32        `json:"startToCloseTimeoutSeconds,omitempty"`
	HeartbeatTimeoutSeconds       *int32        `json:"heartbeatTimeoutSeconds,omitempty"`
	DecisionTaskCompletedEventId  *int64        `json:"decisionTaskCompletedEventId,omitempty"`
	RetryPolicy                   *RetryPolicy  `json:"retryPolicy,omitempty"`
	Header                        *Header       `json:"header,omitempty"`
}

// ToWire translates a ActivityTaskScheduledEventAttributes 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 *ActivityTaskScheduledEventAttributes) ToWire() (wire.Value, error) {
	var (
		fields [12]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.ActivityType != nil {
		w, err = v.ActivityType.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.Domain != nil {
		w, err = wire.NewValueString(*(v.Domain)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 25, 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.Input != nil {
		w, err = wire.NewValueBinary(v.Input), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 40, Value: w}
		i++
	}
	if v.ScheduleToCloseTimeoutSeconds != nil {
		w, err = wire.NewValueI32(*(v.ScheduleToCloseTimeoutSeconds)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 45, 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.StartToCloseTimeoutSeconds != nil {
		w, err = wire.NewValueI32(*(v.StartToCloseTimeoutSeconds)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 55, Value: w}
		i++
	}
	if v.HeartbeatTimeoutSeconds != nil {
		w, err = wire.NewValueI32(*(v.HeartbeatTimeoutSeconds)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 60, 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: 90, Value: w}
		i++
	}
	if v.RetryPolicy != nil {
		w, err = v.RetryPolicy.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 110, Value: w}
		i++
	}
	if v.Header != nil {
		w, err = v.Header.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 120, Value: w}
		i++
	}

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

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

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

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

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

// FromWire deserializes a ActivityTaskScheduledEventAttributes 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 ActivityTaskScheduledEventAttributes struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v ActivityTaskScheduledEventAttributes
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *ActivityTaskScheduledEventAttributes) 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.TStruct {
				v.ActivityType, err = _ActivityType_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 25:
			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 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 {
				v.Input, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		case 45:
			if field.Value.Type() == wire.TI32 {
				var x int32
				x, err = field.Value.GetI32(), error(nil)
				v.ScheduleToCloseTimeoutSeconds = &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 55:
			if field.Value.Type() == wire.TI32 {
				var x int32
				x, err = field.Value.GetI32(), error(nil)
				v.StartToCloseTimeoutSeconds = &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.HeartbeatTimeoutSeconds = &x
				if err != nil {
					return err
				}

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

			}
		case 110:
			if field.Value.Type() == wire.TStruct {
				v.RetryPolicy, err = _RetryPolicy_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 120:
			if field.Value.Type() == wire.TStruct {
				v.Header, err = _Header_Read(field.Value)
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

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

	var fields [12]string
	i := 0
	if v.ActivityId != nil {
		fields[i] = fmt.Sprintf("ActivityId: %v", *(v.ActivityId))
		i++
	}
	if v.ActivityType != nil {
		fields[i] = fmt.Sprintf("ActivityType: %v", v.ActivityType)
		i++
	}
	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++
	}
	if v.Input != nil {
		fields[i] = fmt.Sprintf("Input: %v", v.Input)
		i++
	}
	if v.ScheduleToCloseTimeoutSeconds != nil {
		fields[i] = fmt.Sprintf("ScheduleToCloseTimeoutSeconds: %v", *(v.ScheduleToCloseTimeoutSeconds))
		i++
	}
	if v.ScheduleToStartTimeoutSeconds != nil {
		fields[i] = fmt.Sprintf("ScheduleToStartTimeoutSeconds: %v", *(v.ScheduleToStartTimeoutSeconds))
		i++
	}
	if v.StartToCloseTimeoutSeconds != nil {
		fields[i] = fmt.Sprintf("StartToCloseTimeoutSeconds: %v", *(v.StartToCloseTimeoutSeconds))
		i++
	}
	if v.HeartbeatTimeoutSeconds != nil {
		fields[i] = fmt.Sprintf("HeartbeatTimeoutSeconds: %v", *(v.HeartbeatTimeoutSeconds))
		i++
	}
	if v.DecisionTaskCompletedEventId != nil {
		fields[i] = fmt.Sprintf("DecisionTaskCompletedEventId: %v", *(v.DecisionTaskCompletedEventId))
		i++
	}
	if v.RetryPolicy != nil {
		fields[i] = fmt.Sprintf("RetryPolicy: %v", v.RetryPolicy)
		i++
	}
	if v.Header != nil {
		fields[i] = fmt.Sprintf("Header: %v", v.Header)
		i++
	}

	return fmt.Sprintf("ActivityTaskScheduledEventAttributes{%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
}

// Equals returns true if all the fields of this ActivityTaskScheduledEventAttributes match the
// provided ActivityTaskScheduledEventAttributes.
//
// This function performs a deep comparison.
func (v *ActivityTaskScheduledEventAttributes) Equals(rhs *ActivityTaskScheduledEventAttributes) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.ActivityId, rhs.ActivityId) {
		return false
	}
	if !((v.ActivityType == nil && rhs.ActivityType == nil) || (v.ActivityType != nil && rhs.ActivityType != nil && v.ActivityType.Equals(rhs.ActivityType))) {
		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
	}
	if !((v.Input == nil && rhs.Input == nil) || (v.Input != nil && rhs.Input != nil && bytes.Equal(v.Input, rhs.Input))) {
		return false
	}
	if !_I32_EqualsPtr(v.ScheduleToCloseTimeoutSeconds, rhs.ScheduleToCloseTimeoutSeconds) {
		return false
	}
	if !_I32_EqualsPtr(v.ScheduleToStartTimeoutSeconds, rhs.ScheduleToStartTimeoutSeconds) {
		return false
	}
	if !_I32_EqualsPtr(v.StartToCloseTimeoutSeconds, rhs.StartToCloseTimeoutSeconds) {
		return false
	}
	if !_I32_EqualsPtr(v.HeartbeatTimeoutSeconds, rhs.HeartbeatTimeoutSeconds) {
		return false
	}
	if !_I64_EqualsPtr(v.DecisionTaskCompletedEventId, rhs.DecisionTaskCompletedEventId) {
		return false
	}
	if !((v.RetryPolicy == nil && rhs.RetryPolicy == nil) || (v.RetryPolicy != nil && rhs.RetryPolicy != nil && v.RetryPolicy.Equals(rhs.RetryPolicy))) {
		return false
	}
	if !((v.Header == nil && rhs.Header == nil) || (v.Header != nil && rhs.Header != nil && v.Header.Equals(rhs.Header))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of ActivityTaskScheduledEventAttributes.
func (v *ActivityTaskScheduledEventAttributes) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.ActivityId != nil {
		enc.AddString("activityId", *v.ActivityId)
	}
	if v.ActivityType != nil {
		err = multierr.Append(err, enc.AddObject("activityType", v.ActivityType))
	}
	if v.Domain != nil {
		enc.AddString("domain", *v.Domain)
	}
	if v.TaskList != nil {
		err = multierr.Append(err, enc.AddObject("taskList", v.TaskList))
	}
	if v.Input != nil {
		enc.AddString("input", base64.StdEncoding.EncodeToString(v.Input))
	}
	if v.ScheduleToCloseTimeoutSeconds != nil {
		enc.AddInt32("scheduleToCloseTimeoutSeconds", *v.ScheduleToCloseTimeoutSeconds)
	}
	if v.ScheduleToStartTimeoutSeconds != nil {
		enc.AddInt32("scheduleToStartTimeoutSeconds", *v.ScheduleToStartTimeoutSeconds)
	}
	if v.StartToCloseTimeoutSeconds != nil {
		enc.AddInt32("startToCloseTimeoutSeconds", *v.StartToCloseTimeoutSeconds)
	}
	if v.HeartbeatTimeoutSeconds != nil {
		enc.AddInt32("heartbeatTimeoutSeconds", *v.HeartbeatTimeoutSeconds)
	}
	if v.DecisionTaskCompletedEventId != nil {
		enc.AddInt64("decisionTaskCompletedEventId", *v.DecisionTaskCompletedEventId)
	}
	if v.RetryPolicy != nil {
		err = multierr.Append(err, enc.AddObject("retryPolicy", v.RetryPolicy))
	}
	if v.Header != nil {
		err = multierr.Append(err, enc.AddObject("header", v.Header))
	}
	return err
}

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

	return
}

// IsSetActivityId returns true if ActivityId is not nil.
func (v *ActivityTaskScheduledEventAttributes) IsSetActivityId() bool {
	return v != nil && v.ActivityId != nil
}

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

	return
}

// IsSetActivityType returns true if ActivityType is not nil.
func (v *ActivityTaskScheduledEventAttributes) IsSetActivityType() bool {
	return v != nil && v.ActivityType != nil
}

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

	return
}

// IsSetDomain returns true if Domain is not nil.
func (v *ActivityTaskScheduledEventAttributes) 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 *ActivityTaskScheduledEventAttributes) GetTaskList() (o *TaskList) {
	if v != nil && v.TaskList != nil {
		return v.TaskList
	}

	return
}

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

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

	return
}

// IsSetInput returns true if Input is not nil.
func (v *ActivityTaskScheduledEventAttributes) IsSetInput() bool {
	return v != nil && v.Input != nil
}

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

	return
}

// IsSetScheduleToCloseTimeoutSeconds returns true if ScheduleToCloseTimeoutSeconds is not nil.
func (v *ActivityTaskScheduledEventAttributes) IsSetScheduleToCloseTimeoutSeconds() bool {
	return v != nil && v.ScheduleToCloseTimeoutSeconds != nil
}

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

	return
}

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

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

	return
}

// IsSetStartToCloseTimeoutSeconds returns true if StartToCloseTimeoutSeconds is not nil.
func (v *ActivityTaskScheduledEventAttributes) IsSetStartToCloseTimeoutSeconds() bool {
	return v != nil && v.StartToCloseTimeoutSeconds != nil
}

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

	return
}

// IsSetHeartbeatTimeoutSeconds returns true if HeartbeatTimeoutSeconds is not nil.
func (v *ActivityTaskScheduledEventAttributes) IsSetHeartbeatTimeoutSeconds() bool {
	return v != nil && v.HeartbeatTimeoutSeconds != nil
}

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

	return
}

// IsSetDecisionTaskCompletedEventId returns true if DecisionTaskCompletedEventId is not nil.
func (v *ActivityTaskScheduledEventAttributes) IsSetDecisionTaskCompletedEventId() bool {
	return v != nil && v.DecisionTaskCompletedEventId != nil
}

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

	return
}

// IsSetRetryPolicy returns true if RetryPolicy is not nil.
func (v *ActivityTaskScheduledEventAttributes) IsSetRetryPolicy() bool {
	return v != nil && v.RetryPolicy != nil
}

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

	return
}

// IsSetHeader returns true if Header is not nil.
func (v *ActivityTaskScheduledEventAttributes) IsSetHeader() bool {
	return v != nil && v.Header != nil
}

type ActivityTaskStartedEventAttributes struct {
	ScheduledEventId   *int64  `json:"scheduledEventId,omitempty"`
	Identity           *string `json:"identity,omitempty"`
	RequestId          *string `json:"requestId,omitempty"`
	Attempt            *int32  `json:"attempt,omitempty"`
	LastFailureReason  *string `json:"lastFailureReason,omitempty"`
	LastFailureDetails []byte  `json:"lastFailureDetails,omitempty"`
}

// ToWire translates a ActivityTaskStartedEventAttributes 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 *ActivityTaskStartedEventAttributes) ToWire() (wire.Value, error) {
	var (
		fields [6]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.ScheduledEventId != nil {
		w, err = wire.NewValueI64(*(v.ScheduledEventId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, 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: 20, Value: w}
		i++
	}
	if v.RequestId != nil {
		w, err = wire.NewValueString(*(v.RequestId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.Attempt != nil {
		w, err = wire.NewValueI32(*(v.Attempt)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 40, Value: w}
		i++
	}
	if v.LastFailureReason != nil {
		w, err = wire.NewValueString(*(v.LastFailureReason)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 50, Value: w}
		i++
	}
	if v.LastFailureDetails != nil {
		w, err = wire.NewValueBinary(v.LastFailureDetails), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 60, Value: w}
		i++
	}

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

// FromWire deserializes a ActivityTaskStartedEventAttributes 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 ActivityTaskStartedEventAttributes struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v ActivityTaskStartedEventAttributes
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *ActivityTaskStartedEventAttributes) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			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 20:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.Identity = &x
				if err != nil {
					return err
				}

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

			}
		case 40:
			if field.Value.Type() == wire.TI32 {
				var x int32
				x, err = field.Value.GetI32(), error(nil)
				v.Attempt = &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.LastFailureReason = &x
				if err != nil {
					return err
				}

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

			}
		}
	}

	return nil
}

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

	var fields [6]string
	i := 0
	if v.ScheduledEventId != nil {
		fields[i] = fmt.Sprintf("ScheduledEventId: %v", *(v.ScheduledEventId))
		i++
	}
	if v.Identity != nil {
		fields[i] = fmt.Sprintf("Identity: %v", *(v.Identity))
		i++
	}
	if v.RequestId != nil {
		fields[i] = fmt.Sprintf("RequestId: %v", *(v.RequestId))
		i++
	}
	if v.Attempt != nil {
		fields[i] = fmt.Sprintf("Attempt: %v", *(v.Attempt))
		i++
	}
	if v.LastFailureReason != nil {
		fields[i] = fmt.Sprintf("LastFailureReason: %v", *(v.LastFailureReason))
		i++
	}
	if v.LastFailureDetails != nil {
		fields[i] = fmt.Sprintf("LastFailureDetails: %v", v.LastFailureDetails)
		i++
	}

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

// Equals returns true if all the fields of this ActivityTaskStartedEventAttributes match the
// provided ActivityTaskStartedEventAttributes.
//
// This function performs a deep comparison.
func (v *ActivityTaskStartedEventAttributes) Equals(rhs *ActivityTaskStartedEventAttributes) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_I64_EqualsPtr(v.ScheduledEventId, rhs.ScheduledEventId) {
		return false
	}
	if !_String_EqualsPtr(v.Identity, rhs.Identity) {
		return false
	}
	if !_String_EqualsPtr(v.RequestId, rhs.RequestId) {
		return false
	}
	if !_I32_EqualsPtr(v.Attempt, rhs.Attempt) {
		return false
	}
	if !_String_EqualsPtr(v.LastFailureReason, rhs.LastFailureReason) {
		return false
	}
	if !((v.LastFailureDetails == nil && rhs.LastFailureDetails == nil) || (v.LastFailureDetails != nil && rhs.LastFailureDetails != nil && bytes.Equal(v.LastFailureDetails, rhs.LastFailureDetails))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of ActivityTaskStartedEventAttributes.
func (v *ActivityTaskStartedEventAttributes) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.ScheduledEventId != nil {
		enc.AddInt64("scheduledEventId", *v.ScheduledEventId)
	}
	if v.Identity != nil {
		enc.AddString("identity", *v.Identity)
	}
	if v.RequestId != nil {
		enc.AddString("requestId", *v.RequestId)
	}
	if v.Attempt != nil {
		enc.AddInt32("attempt", *v.Attempt)
	}
	if v.LastFailureReason != nil {
		enc.AddString("lastFailureReason", *v.LastFailureReason)
	}
	if v.LastFailureDetails != nil {
		enc.AddString("lastFailureDetails", base64.StdEncoding.EncodeToString(v.LastFailureDetails))
	}
	return err
}

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

	return
}

// IsSetScheduledEventId returns true if ScheduledEventId is not nil.
func (v *ActivityTaskStartedEventAttributes) IsSetScheduledEventId() bool {
	return v != nil && v.ScheduledEventId != nil
}

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

	return
}

// IsSetIdentity returns true if Identity is not nil.
func (v *ActivityTaskStartedEventAttributes) IsSetIdentity() bool {
	return v != nil && v.Identity != nil
}

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

	return
}

// IsSetRequestId returns true if RequestId is not nil.
func (v *ActivityTaskStartedEventAttributes) IsSetRequestId() bool {
	return v != nil && v.RequestId != nil
}

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

	return
}

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

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

	return
}

// IsSetLastFailureReason returns true if LastFailureReason is not nil.
func (v *ActivityTaskStartedEventAttributes) IsSetLastFailureReason() bool {
	return v != nil && v.LastFailureReason != nil
}

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

	return
}

// IsSetLastFailureDetails returns true if LastFailureDetails is not nil.
func (v *ActivityTaskStartedEventAttributes) IsSetLastFailureDetails() bool {
	return v != nil && v.LastFailureDetails != nil
}

type ActivityTaskTimedOutEventAttributes struct {
	Details            []byte       `json:"details,omitempty"`
	ScheduledEventId   *int64       `json:"scheduledEventId,omitempty"`
	StartedEventId     *int64       `json:"startedEventId,omitempty"`
	TimeoutType        *TimeoutType `json:"timeoutType,omitempty"`
	LastFailureReason  *string      `json:"lastFailureReason,omitempty"`
	LastFailureDetails []byte       `json:"lastFailureDetails,omitempty"`
}

// ToWire translates a ActivityTaskTimedOutEventAttributes 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 *ActivityTaskTimedOutEventAttributes) ToWire() (wire.Value, error) {
	var (
		fields [6]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: 5, 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: 10, 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: 20, Value: w}
		i++
	}
	if v.TimeoutType != nil {
		w, err = v.TimeoutType.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.LastFailureReason != nil {
		w, err = wire.NewValueString(*(v.LastFailureReason)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 40, Value: w}
		i++
	}
	if v.LastFailureDetails != nil {
		w, err = wire.NewValueBinary(v.LastFailureDetails), 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 _TimeoutType_Read(w wire.Value) (TimeoutType, error) {
	var v TimeoutType
	err := v.FromWire(w)
	return v, err
}

// FromWire deserializes a ActivityTaskTimedOutEventAttributes 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 ActivityTaskTimedOutEventAttributes struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v ActivityTaskTimedOutEventAttributes
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *ActivityTaskTimedOutEventAttributes) FromWire(w wire.Value) error {
	var err error

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

			}
		case 10:
			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 20:
			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 30:
			if field.Value.Type() == wire.TI32 {
				var x TimeoutType
				x, err = _TimeoutType_Read(field.Value)
				v.TimeoutType = &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.LastFailureReason = &x
				if err != nil {
					return err
				}

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

			}
		}
	}

	return nil
}

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

	var fields [6]string
	i := 0
	if v.Details != nil {
		fields[i] = fmt.Sprintf("Details: %v", v.Details)
		i++
	}
	if v.ScheduledEventId != nil {
		fields[i] = fmt.Sprintf("ScheduledEventId: %v", *(v.ScheduledEventId))
		i++
	}
	if v.StartedEventId != nil {
		fields[i] = fmt.Sprintf("StartedEventId: %v", *(v.StartedEventId))
		i++
	}
	if v.TimeoutType != nil {
		fields[i] = fmt.Sprintf("TimeoutType: %v", *(v.TimeoutType))
		i++
	}
	if v.LastFailureReason != nil {
		fields[i] = fmt.Sprintf("LastFailureReason: %v", *(v.LastFailureReason))
		i++
	}
	if v.LastFailureDetails != nil {
		fields[i] = fmt.Sprintf("LastFailureDetails: %v", v.LastFailureDetails)
		i++
	}

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

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

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

// Equals returns true if all the fields of this ActivityTaskTimedOutEventAttributes match the
// provided ActivityTaskTimedOutEventAttributes.
//
// This function performs a deep comparison.
func (v *ActivityTaskTimedOutEventAttributes) Equals(rhs *ActivityTaskTimedOutEventAttributes) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !((v.Details == nil && rhs.Details == nil) || (v.Details != nil && rhs.Details != nil && bytes.Equal(v.Details, rhs.Details))) {
		return false
	}
	if !_I64_EqualsPtr(v.ScheduledEventId, rhs.ScheduledEventId) {
		return false
	}
	if !_I64_EqualsPtr(v.StartedEventId, rhs.StartedEventId) {
		return false
	}
	if !_TimeoutType_EqualsPtr(v.TimeoutType, rhs.TimeoutType) {
		return false
	}
	if !_String_EqualsPtr(v.LastFailureReason, rhs.LastFailureReason) {
		return false
	}
	if !((v.LastFailureDetails == nil && rhs.LastFailureDetails == nil) || (v.LastFailureDetails != nil && rhs.LastFailureDetails != nil && bytes.Equal(v.LastFailureDetails, rhs.LastFailureDetails))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of ActivityTaskTimedOutEventAttributes.
func (v *ActivityTaskTimedOutEventAttributes) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Details != nil {
		enc.AddString("details", base64.StdEncoding.EncodeToString(v.Details))
	}
	if v.ScheduledEventId != nil {
		enc.AddInt64("scheduledEventId", *v.ScheduledEventId)
	}
	if v.StartedEventId != nil {
		enc.AddInt64("startedEventId", *v.StartedEventId)
	}
	if v.TimeoutType != nil {
		err = multierr.Append(err, enc.AddObject("timeoutType", *v.TimeoutType))
	}
	if v.LastFailureReason != nil {
		enc.AddString("lastFailureReason", *v.LastFailureReason)
	}
	if v.LastFailureDetails != nil {
		enc.AddString("lastFailureDetails", base64.StdEncoding.EncodeToString(v.LastFailureDetails))
	}
	return err
}

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

	return
}

// IsSetDetails returns true if Details is not nil.
func (v *ActivityTaskTimedOutEventAttributes) IsSetDetails() bool {
	return v != nil && v.Details != nil
}

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

	return
}

// IsSetScheduledEventId returns true if ScheduledEventId is not nil.
func (v *ActivityTaskTimedOutEventAttributes) IsSetScheduledEventId() bool {
	return v != nil && v.ScheduledEventId != nil
}

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

	return
}

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

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

	return
}

// IsSetTimeoutType returns true if TimeoutType is not nil.
func (v *ActivityTaskTimedOutEventAttributes) IsSetTimeoutType() bool {
	return v != nil && v.TimeoutType != nil
}

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

	return
}

// IsSetLastFailureReason returns true if LastFailureReason is not nil.
func (v *ActivityTaskTimedOutEventAttributes) IsSetLastFailureReason() bool {
	return v != nil && v.LastFailureReason != nil
}

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

	return
}

// IsSetLastFailureDetails returns true if LastFailureDetails is not nil.
func (v *ActivityTaskTimedOutEventAttributes) IsSetLastFailureDetails() bool {
	return v != nil && v.LastFailureDetails != nil
}

type ActivityType struct {
	Name *string `json:"name,omitempty"`
}

// ToWire translates a ActivityType 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 *ActivityType) ToWire() (wire.Value, error) {
	var (
		fields [1]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

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

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

// FromWire deserializes a ActivityType 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 ActivityType struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v ActivityType
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *ActivityType) 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.Name = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

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

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

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

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

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of ActivityType.
func (v *ActivityType) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Name != nil {
		enc.AddString("name", *v.Name)
	}
	return err
}

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

	return
}

// IsSetName returns true if Name is not nil.
func (v *ActivityType) IsSetName() bool {
	return v != nil && v.Name != nil
}

// Any is a logical duplicate of google.protobuf.Any.
//
// The intent of the type is the same, but it is not intended to be directly
// compatible with google.protobuf.Any or any Thrift equivalent - this blob is
// RPC-type agnostic by design (as the underlying data may be transported over
// proto or thrift), and the data-bytes may be in any encoding.
//
// This is intentionally different from DataBlob, which supports only a handful
// of known encodings so it can be interpreted everywhere.  Any supports literally
// any contents, and needs to be considered opaque until it is given to something
// that is expecting it.
//
// See ValueType to interpret the contents.
type Any struct {
	ValueType *string `json:"ValueType,omitempty"`
	Value     []byte  `json:"Value,omitempty"`
}

// ToWire translates a Any 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 *Any) ToWire() (wire.Value, error) {
	var (
		fields [2]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.ValueType != nil {
		w, err = wire.NewValueString(*(v.ValueType)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.Value != nil {
		w, err = wire.NewValueBinary(v.Value), 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
}

// FromWire deserializes a Any 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 Any struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v Any
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *Any) 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.ValueType = &x
				if err != nil {
					return err
				}

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

			}
		}
	}

	return nil
}

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

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

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

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

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of Any.
func (v *Any) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.ValueType != nil {
		enc.AddString("ValueType", *v.ValueType)
	}
	if v.Value != nil {
		enc.AddString("Value", base64.StdEncoding.EncodeToString(v.Value))
	}
	return err
}

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

	return
}

// IsSetValueType returns true if ValueType is not nil.
func (v *Any) IsSetValueType() bool {
	return v != nil && v.ValueType != nil
}

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

	return
}

// IsSetValue returns true if Value is not nil.
func (v *Any) IsSetValue() bool {
	return v != nil && v.Value != nil
}

type ApplyParentClosePolicyAttributes struct {
	ChildDomainID     *string            `json:"childDomainID,omitempty"`
	ChildWorkflowID   *string            `json:"childWorkflowID,omitempty"`
	ChildRunID        *string            `json:"childRunID,omitempty"`
	ParentClosePolicy *ParentClosePolicy `json:"parentClosePolicy,omitempty"`
}

// ToWire translates a ApplyParentClosePolicyAttributes 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 *ApplyParentClosePolicyAttributes) ToWire() (wire.Value, error) {
	var (
		fields [4]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.ChildDomainID != nil {
		w, err = wire.NewValueString(*(v.ChildDomainID)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.ChildWorkflowID != nil {
		w, err = wire.NewValueString(*(v.ChildWorkflowID)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.ChildRunID != nil {
		w, err = wire.NewValueString(*(v.ChildRunID)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.ParentClosePolicy != nil {
		w, err = v.ParentClosePolicy.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 _ParentClosePolicy_Read(w wire.Value) (ParentClosePolicy, error) {
	var v ParentClosePolicy
	err := v.FromWire(w)
	return v, err
}

// FromWire deserializes a ApplyParentClosePolicyAttributes 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 ApplyParentClosePolicyAttributes struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v ApplyParentClosePolicyAttributes
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *ApplyParentClosePolicyAttributes) 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.ChildDomainID = &x
				if err != nil {
					return err
				}

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

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

			}
		case 40:
			if field.Value.Type() == wire.TI32 {
				var x ParentClosePolicy
				x, err = _ParentClosePolicy_Read(field.Value)
				v.ParentClosePolicy = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

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

	var fields [4]string
	i := 0
	if v.ChildDomainID != nil {
		fields[i] = fmt.Sprintf("ChildDomainID: %v", *(v.ChildDomainID))
		i++
	}
	if v.ChildWorkflowID != nil {
		fields[i] = fmt.Sprintf("ChildWorkflowID: %v", *(v.ChildWorkflowID))
		i++
	}
	if v.ChildRunID != nil {
		fields[i] = fmt.Sprintf("ChildRunID: %v", *(v.ChildRunID))
		i++
	}
	if v.ParentClosePolicy != nil {
		fields[i] = fmt.Sprintf("ParentClosePolicy: %v", *(v.ParentClosePolicy))
		i++
	}

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

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

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

// Equals returns true if all the fields of this ApplyParentClosePolicyAttributes match the
// provided ApplyParentClosePolicyAttributes.
//
// This function performs a deep comparison.
func (v *ApplyParentClosePolicyAttributes) Equals(rhs *ApplyParentClosePolicyAttributes) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.ChildDomainID, rhs.ChildDomainID) {
		return false
	}
	if !_String_EqualsPtr(v.ChildWorkflowID, rhs.ChildWorkflowID) {
		return false
	}
	if !_String_EqualsPtr(v.ChildRunID, rhs.ChildRunID) {
		return false
	}
	if !_ParentClosePolicy_EqualsPtr(v.ParentClosePolicy, rhs.ParentClosePolicy) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of ApplyParentClosePolicyAttributes.
func (v *ApplyParentClosePolicyAttributes) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.ChildDomainID != nil {
		enc.AddString("childDomainID", *v.ChildDomainID)
	}
	if v.ChildWorkflowID != nil {
		enc.AddString("childWorkflowID", *v.ChildWorkflowID)
	}
	if v.ChildRunID != nil {
		enc.AddString("childRunID", *v.ChildRunID)
	}
	if v.ParentClosePolicy != nil {
		err = multierr.Append(err, enc.AddObject("parentClosePolicy", *v.ParentClosePolicy))
	}
	return err
}

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

	return
}

// IsSetChildDomainID returns true if ChildDomainID is not nil.
func (v *ApplyParentClosePolicyAttributes) IsSetChildDomainID() bool {
	return v != nil && v.ChildDomainID != nil
}

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

	return
}

// IsSetChildWorkflowID returns true if ChildWorkflowID is not nil.
func (v *ApplyParentClosePolicyAttributes) IsSetChildWorkflowID() bool {
	return v != nil && v.ChildWorkflowID != nil
}

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

	return
}

// IsSetChildRunID returns true if ChildRunID is not nil.
func (v *ApplyParentClosePolicyAttributes) IsSetChildRunID() bool {
	return v != nil && v.ChildRunID != nil
}

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

	return
}

// IsSetParentClosePolicy returns true if ParentClosePolicy is not nil.
func (v *ApplyParentClosePolicyAttributes) IsSetParentClosePolicy() bool {
	return v != nil && v.ParentClosePolicy != nil
}

type ApplyParentClosePolicyRequest struct {
	Child  *ApplyParentClosePolicyAttributes `json:"child,omitempty"`
	Status *ApplyParentClosePolicyStatus     `json:"status,omitempty"`
}

// ToWire translates a ApplyParentClosePolicyRequest 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 *ApplyParentClosePolicyRequest) ToWire() (wire.Value, error) {
	var (
		fields [2]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.Child != nil {
		w, err = v.Child.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.Status != nil {
		w, err = v.Status.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 _ApplyParentClosePolicyAttributes_Read(w wire.Value) (*ApplyParentClosePolicyAttributes, error) {
	var v ApplyParentClosePolicyAttributes
	err := v.FromWire(w)
	return &v, err
}

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

// FromWire deserializes a ApplyParentClosePolicyRequest 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 ApplyParentClosePolicyRequest struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v ApplyParentClosePolicyRequest
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *ApplyParentClosePolicyRequest) 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.Child, err = _ApplyParentClosePolicyAttributes_Read(field.Value)
				if err != nil {
					return err
				}

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

			}
		}
	}

	return nil
}

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

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

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

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

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of ApplyParentClosePolicyRequest.
func (v *ApplyParentClosePolicyRequest) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Child != nil {
		err = multierr.Append(err, enc.AddObject("child", v.Child))
	}
	if v.Status != nil {
		err = multierr.Append(err, enc.AddObject("status", v.Status))
	}
	return err
}

// GetChild returns the value of Child if it is set or its
// zero value if it is unset.
func (v *ApplyParentClosePolicyRequest) GetChild() (o *ApplyParentClosePolicyAttributes) {
	if v != nil && v.Child != nil {
		return v.Child
	}

	return
}

// IsSetChild returns true if Child is not nil.
func (v *ApplyParentClosePolicyRequest) IsSetChild() bool {
	return v != nil && v.Child != nil
}

// GetStatus returns the value of Status if it is set or its
// zero value if it is unset.
func (v *ApplyParentClosePolicyRequest) GetStatus() (o *ApplyParentClosePolicyStatus) {
	if v != nil && v.Status != nil {
		return v.Status
	}

	return
}

// IsSetStatus returns true if Status is not nil.
func (v *ApplyParentClosePolicyRequest) IsSetStatus() bool {
	return v != nil && v.Status != nil
}

type ApplyParentClosePolicyResult struct {
	Child       *ApplyParentClosePolicyAttributes `json:"child,omitempty"`
	FailedCause *CrossClusterTaskFailedCause      `json:"failedCause,omitempty"`
}

// ToWire translates a ApplyParentClosePolicyResult 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 *ApplyParentClosePolicyResult) ToWire() (wire.Value, error) {
	var (
		fields [2]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.Child != nil {
		w, err = v.Child.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.FailedCause != nil {
		w, err = v.FailedCause.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 _CrossClusterTaskFailedCause_Read(w wire.Value) (CrossClusterTaskFailedCause, error) {
	var v CrossClusterTaskFailedCause
	err := v.FromWire(w)
	return v, err
}

// FromWire deserializes a ApplyParentClosePolicyResult 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 ApplyParentClosePolicyResult struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v ApplyParentClosePolicyResult
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *ApplyParentClosePolicyResult) 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.Child, err = _ApplyParentClosePolicyAttributes_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 20:
			if field.Value.Type() == wire.TI32 {
				var x CrossClusterTaskFailedCause
				x, err = _CrossClusterTaskFailedCause_Read(field.Value)
				v.FailedCause = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

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

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

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

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

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

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

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of ApplyParentClosePolicyResult.
func (v *ApplyParentClosePolicyResult) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Child != nil {
		err = multierr.Append(err, enc.AddObject("child", v.Child))
	}
	if v.FailedCause != nil {
		err = multierr.Append(err, enc.AddObject("failedCause", *v.FailedCause))
	}
	return err
}

// GetChild returns the value of Child if it is set or its
// zero value if it is unset.
func (v *ApplyParentClosePolicyResult) GetChild() (o *ApplyParentClosePolicyAttributes) {
	if v != nil && v.Child != nil {
		return v.Child
	}

	return
}

// IsSetChild returns true if Child is not nil.
func (v *ApplyParentClosePolicyResult) IsSetChild() bool {
	return v != nil && v.Child != nil
}

// GetFailedCause returns the value of FailedCause if it is set or its
// zero value if it is unset.
func (v *ApplyParentClosePolicyResult) GetFailedCause() (o CrossClusterTaskFailedCause) {
	if v != nil && v.FailedCause != nil {
		return *v.FailedCause
	}

	return
}

// IsSetFailedCause returns true if FailedCause is not nil.
func (v *ApplyParentClosePolicyResult) IsSetFailedCause() bool {
	return v != nil && v.FailedCause != nil
}

type ApplyParentClosePolicyStatus struct {
	Completed   *bool                        `json:"completed,omitempty"`
	FailedCause *CrossClusterTaskFailedCause `json:"failedCause,omitempty"`
}

// ToWire translates a ApplyParentClosePolicyStatus 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 *ApplyParentClosePolicyStatus) ToWire() (wire.Value, error) {
	var (
		fields [2]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.Completed != nil {
		w, err = wire.NewValueBool(*(v.Completed)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.FailedCause != nil {
		w, err = v.FailedCause.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 ApplyParentClosePolicyStatus 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 ApplyParentClosePolicyStatus struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v ApplyParentClosePolicyStatus
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *ApplyParentClosePolicyStatus) FromWire(w wire.Value) error {
	var err error

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

			}
		case 20:
			if field.Value.Type() == wire.TI32 {
				var x CrossClusterTaskFailedCause
				x, err = _CrossClusterTaskFailedCause_Read(field.Value)
				v.FailedCause = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

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

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

	return fmt.Sprintf("ApplyParentClosePolicyStatus{%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
}

// Equals returns true if all the fields of this ApplyParentClosePolicyStatus match the
// provided ApplyParentClosePolicyStatus.
//
// This function performs a deep comparison.
func (v *ApplyParentClosePolicyStatus) Equals(rhs *ApplyParentClosePolicyStatus) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_Bool_EqualsPtr(v.Completed, rhs.Completed) {
		return false
	}
	if !_CrossClusterTaskFailedCause_EqualsPtr(v.FailedCause, rhs.FailedCause) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of ApplyParentClosePolicyStatus.
func (v *ApplyParentClosePolicyStatus) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Completed != nil {
		enc.AddBool("completed", *v.Completed)
	}
	if v.FailedCause != nil {
		err = multierr.Append(err, enc.AddObject("failedCause", *v.FailedCause))
	}
	return err
}

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

	return
}

// IsSetCompleted returns true if Completed is not nil.
func (v *ApplyParentClosePolicyStatus) IsSetCompleted() bool {
	return v != nil && v.Completed != nil
}

// GetFailedCause returns the value of FailedCause if it is set or its
// zero value if it is unset.
func (v *ApplyParentClosePolicyStatus) GetFailedCause() (o CrossClusterTaskFailedCause) {
	if v != nil && v.FailedCause != nil {
		return *v.FailedCause
	}

	return
}

// IsSetFailedCause returns true if FailedCause is not nil.
func (v *ApplyParentClosePolicyStatus) IsSetFailedCause() bool {
	return v != nil && v.FailedCause != nil
}

type ArchivalStatus int32

const (
	ArchivalStatusDisabled ArchivalStatus = 0
	ArchivalStatusEnabled  ArchivalStatus = 1
)

// ArchivalStatus_Values returns all recognized values of ArchivalStatus.
func ArchivalStatus_Values() []ArchivalStatus {
	return []ArchivalStatus{
		ArchivalStatusDisabled,
		ArchivalStatusEnabled,
	}
}

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

// MarshalText encodes ArchivalStatus 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 ArchivalStatus) MarshalText() ([]byte, error) {
	switch int32(v) {
	case 0:
		return []byte("DISABLED"), nil
	case 1:
		return []byte("ENABLED"), nil
	}
	return []byte(strconv.FormatInt(int64(v), 10)), nil
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of ArchivalStatus.
// 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 ArchivalStatus) MarshalLogObject(enc zapcore.ObjectEncoder) error {
	enc.AddInt32("value", int32(v))
	switch int32(v) {
	case 0:
		enc.AddString("name", "DISABLED")
	case 1:
		enc.AddString("name", "ENABLED")
	}
	return nil
}

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

// ToWire translates ArchivalStatus 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 ArchivalStatus) ToWire() (wire.Value, error) {
	return wire.NewValueI32(int32(v)), nil
}

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

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

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

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

// UnmarshalJSON attempts to decode ArchivalStatus 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 *ArchivalStatus) 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, "ArchivalStatus")
		}
		if x < math.MinInt32 {
			return fmt.Errorf("enum underflow from JSON %q for %q", text, "ArchivalStatus")
		}
		*v = (ArchivalStatus)(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, "ArchivalStatus")
	}
}

type AsyncWorkflowConfiguration struct {
	Enabled             *bool     `json:"enabled,omitempty"`
	PredefinedQueueName *string   `json:"predefinedQueueName,omitempty"`
	QueueType           *string   `json:"queueType,omitempty"`
	QueueConfig         *DataBlob `json:"queueConfig,omitempty"`
}

// ToWire translates a AsyncWorkflowConfiguration 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 *AsyncWorkflowConfiguration) ToWire() (wire.Value, error) {
	var (
		fields [4]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.Enabled != nil {
		w, err = wire.NewValueBool(*(v.Enabled)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.PredefinedQueueName != nil {
		w, err = wire.NewValueString(*(v.PredefinedQueueName)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.QueueType != nil {
		w, err = wire.NewValueString(*(v.QueueType)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.QueueConfig != nil {
		w, err = v.QueueConfig.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 _DataBlob_Read(w wire.Value) (*DataBlob, error) {
	var v DataBlob
	err := v.FromWire(w)
	return &v, err
}

// FromWire deserializes a AsyncWorkflowConfiguration 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 AsyncWorkflowConfiguration struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v AsyncWorkflowConfiguration
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *AsyncWorkflowConfiguration) FromWire(w wire.Value) error {
	var err error

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

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

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

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

			}
		}
	}

	return nil
}

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

	var fields [4]string
	i := 0
	if v.Enabled != nil {
		fields[i] = fmt.Sprintf("Enabled: %v", *(v.Enabled))
		i++
	}
	if v.PredefinedQueueName != nil {
		fields[i] = fmt.Sprintf("PredefinedQueueName: %v", *(v.PredefinedQueueName))
		i++
	}
	if v.QueueType != nil {
		fields[i] = fmt.Sprintf("QueueType: %v", *(v.QueueType))
		i++
	}
	if v.QueueConfig != nil {
		fields[i] = fmt.Sprintf("QueueConfig: %v", v.QueueConfig)
		i++
	}

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

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

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of AsyncWorkflowConfiguration.
func (v *AsyncWorkflowConfiguration) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Enabled != nil {
		enc.AddBool("enabled", *v.Enabled)
	}
	if v.PredefinedQueueName != nil {
		enc.AddString("predefinedQueueName", *v.PredefinedQueueName)
	}
	if v.QueueType != nil {
		enc.AddString("queueType", *v.QueueType)
	}
	if v.QueueConfig != nil {
		err = multierr.Append(err, enc.AddObject("queueConfig", v.QueueConfig))
	}
	return err
}

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

	return
}

// IsSetEnabled returns true if Enabled is not nil.
func (v *AsyncWorkflowConfiguration) IsSetEnabled() bool {
	return v != nil && v.Enabled != nil
}

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

	return
}

// IsSetPredefinedQueueName returns true if PredefinedQueueName is not nil.
func (v *AsyncWorkflowConfiguration) IsSetPredefinedQueueName() bool {
	return v != nil && v.PredefinedQueueName != nil
}

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

	return
}

// IsSetQueueType returns true if QueueType is not nil.
func (v *AsyncWorkflowConfiguration) IsSetQueueType() bool {
	return v != nil && v.QueueType != nil
}

// GetQueueConfig returns the value of QueueConfig if it is set or its
// zero value if it is unset.
func (v *AsyncWorkflowConfiguration) GetQueueConfig() (o *DataBlob) {
	if v != nil && v.QueueConfig != nil {
		return v.QueueConfig
	}

	return
}

// IsSetQueueConfig returns true if QueueConfig is not nil.
func (v *AsyncWorkflowConfiguration) IsSetQueueConfig() bool {
	return v != nil && v.QueueConfig != nil
}

type AutoConfigHint struct {
	EnableAutoConfig   *bool  `json:"enableAutoConfig,omitempty"`
	PollerWaitTimeInMs *int64 `json:"pollerWaitTimeInMs,omitempty"`
}

// ToWire translates a AutoConfigHint 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 *AutoConfigHint) ToWire() (wire.Value, error) {
	var (
		fields [2]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.EnableAutoConfig != nil {
		w, err = wire.NewValueBool(*(v.EnableAutoConfig)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.PollerWaitTimeInMs != nil {
		w, err = wire.NewValueI64(*(v.PollerWaitTimeInMs)), 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
}

// FromWire deserializes a AutoConfigHint 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 AutoConfigHint struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v AutoConfigHint
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *AutoConfigHint) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			if field.Value.Type() == wire.TBool {
				var x bool
				x, err = field.Value.GetBool(), error(nil)
				v.EnableAutoConfig = &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.PollerWaitTimeInMs = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

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

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

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

// Equals returns true if all the fields of this AutoConfigHint match the
// provided AutoConfigHint.
//
// This function performs a deep comparison.
func (v *AutoConfigHint) Equals(rhs *AutoConfigHint) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_Bool_EqualsPtr(v.EnableAutoConfig, rhs.EnableAutoConfig) {
		return false
	}
	if !_I64_EqualsPtr(v.PollerWaitTimeInMs, rhs.PollerWaitTimeInMs) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of AutoConfigHint.
func (v *AutoConfigHint) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.EnableAutoConfig != nil {
		enc.AddBool("enableAutoConfig", *v.EnableAutoConfig)
	}
	if v.PollerWaitTimeInMs != nil {
		enc.AddInt64("pollerWaitTimeInMs", *v.PollerWaitTimeInMs)
	}
	return err
}

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

	return
}

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

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

	return
}

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

type BadBinaries struct {
	Binaries map[string]*BadBinaryInfo `json:"binaries,omitempty"`
}

type _Map_String_BadBinaryInfo_MapItemList map[string]*BadBinaryInfo

func (m _Map_String_BadBinaryInfo_MapItemList) ForEach(f func(wire.MapItem) error) error {
	for k, v := range m {
		if v == nil {
			return fmt.Errorf("invalid [%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_BadBinaryInfo_MapItemList) Size() int {
	return len(m)
}

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

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

func (_Map_String_BadBinaryInfo_MapItemList) Close() {}

// ToWire translates a BadBinaries 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 *BadBinaries) ToWire() (wire.Value, error) {
	var (
		fields [1]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.Binaries != nil {
		w, err = wire.NewValueMap(_Map_String_BadBinaryInfo_MapItemList(v.Binaries)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}

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

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

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

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

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

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

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

// FromWire deserializes a BadBinaries 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 BadBinaries struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v BadBinaries
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *BadBinaries) FromWire(w wire.Value) error {
	var err error

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

			}
		}
	}

	return nil
}

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

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

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

func _Map_String_BadBinaryInfo_Equals(lhs, rhs map[string]*BadBinaryInfo) 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 BadBinaries match the
// provided BadBinaries.
//
// This function performs a deep comparison.
func (v *BadBinaries) Equals(rhs *BadBinaries) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !((v.Binaries == nil && rhs.Binaries == nil) || (v.Binaries != nil && rhs.Binaries != nil && _Map_String_BadBinaryInfo_Equals(v.Binaries, rhs.Binaries))) {
		return false
	}

	return true
}

type _Map_String_BadBinaryInfo_Zapper map[string]*BadBinaryInfo

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of _Map_String_BadBinaryInfo_Zapper.
func (m _Map_String_BadBinaryInfo_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 BadBinaries.
func (v *BadBinaries) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Binaries != nil {
		err = multierr.Append(err, enc.AddObject("binaries", (_Map_String_BadBinaryInfo_Zapper)(v.Binaries)))
	}
	return err
}

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

	return
}

// IsSetBinaries returns true if Binaries is not nil.
func (v *BadBinaries) IsSetBinaries() bool {
	return v != nil && v.Binaries != nil
}

type BadBinaryInfo struct {
	Reason          *string `json:"reason,omitempty"`
	Operator        *string `json:"operator,omitempty"`
	CreatedTimeNano *int64  `json:"createdTimeNano,omitempty"`
}

// ToWire translates a BadBinaryInfo 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 *BadBinaryInfo) ToWire() (wire.Value, error) {
	var (
		fields [3]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.Reason != nil {
		w, err = wire.NewValueString(*(v.Reason)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.Operator != nil {
		w, err = wire.NewValueString(*(v.Operator)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.CreatedTimeNano != nil {
		w, err = wire.NewValueI64(*(v.CreatedTimeNano)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}

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

// FromWire deserializes a BadBinaryInfo 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 BadBinaryInfo struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v BadBinaryInfo
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *BadBinaryInfo) 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.Reason = &x
				if err != nil {
					return err
				}

			}
		case 20:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.Operator = &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.CreatedTimeNano = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

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

	var fields [3]string
	i := 0
	if v.Reason != nil {
		fields[i] = fmt.Sprintf("Reason: %v", *(v.Reason))
		i++
	}
	if v.Operator != nil {
		fields[i] = fmt.Sprintf("Operator: %v", *(v.Operator))
		i++
	}
	if v.CreatedTimeNano != nil {
		fields[i] = fmt.Sprintf("CreatedTimeNano: %v", *(v.CreatedTimeNano))
		i++
	}

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

// Equals returns true if all the fields of this BadBinaryInfo match the
// provided BadBinaryInfo.
//
// This function performs a deep comparison.
func (v *BadBinaryInfo) Equals(rhs *BadBinaryInfo) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.Reason, rhs.Reason) {
		return false
	}
	if !_String_EqualsPtr(v.Operator, rhs.Operator) {
		return false
	}
	if !_I64_EqualsPtr(v.CreatedTimeNano, rhs.CreatedTimeNano) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of BadBinaryInfo.
func (v *BadBinaryInfo) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Reason != nil {
		enc.AddString("reason", *v.Reason)
	}
	if v.Operator != nil {
		enc.AddString("operator", *v.Operator)
	}
	if v.CreatedTimeNano != nil {
		enc.AddInt64("createdTimeNano", *v.CreatedTimeNano)
	}
	return err
}

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

	return
}

// IsSetReason returns true if Reason is not nil.
func (v *BadBinaryInfo) IsSetReason() bool {
	return v != nil && v.Reason != nil
}

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

	return
}

// IsSetOperator returns true if Operator is not nil.
func (v *BadBinaryInfo) IsSetOperator() bool {
	return v != nil && v.Operator != nil
}

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

	return
}

// IsSetCreatedTimeNano returns true if CreatedTimeNano is not nil.
func (v *BadBinaryInfo) IsSetCreatedTimeNano() bool {
	return v != nil && v.CreatedTimeNano != nil
}

type BadRequestError struct {
	Message string `json:"message,required"`
}

// ToWire translates a BadRequestError 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 *BadRequestError) 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
}

// FromWire deserializes a BadRequestError 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 BadRequestError struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v BadRequestError
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *BadRequestError) 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 BadRequestError is required")
	}

	return nil
}

// String returns a readable string representation of a BadRequestError
// struct.
func (v *BadRequestError) 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("BadRequestError{%v}", strings.Join(fields[:i], ", "))
}

// ErrorName is the name of this type as defined in the Thrift
// file.
func (*BadRequestError) ErrorName() string {
	return "BadRequestError"
}

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

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of BadRequestError.
func (v *BadRequestError) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	enc.AddString("message", v.Message)
	return err
}

// GetMessage returns the value of Message if it is set or its
// zero value if it is unset.
func (v *BadRequestError) GetMessage() (o string) {
	if v != nil {
		o = v.Message
	}
	return
}

func (v *BadRequestError) Error() string {
	return v.String()
}

type CancelExternalWorkflowExecutionFailedCause int32

const (
	CancelExternalWorkflowExecutionFailedCauseUnknownExternalWorkflowExecution CancelExternalWorkflowExecutionFailedCause = 0
	CancelExternalWorkflowExecutionFailedCauseWorkflowAlreadyCompleted         CancelExternalWorkflowExecutionFailedCause = 1
)

// CancelExternalWorkflowExecutionFailedCause_Values returns all recognized values of CancelExternalWorkflowExecutionFailedCause.
func CancelExternalWorkflowExecutionFailedCause_Values() []CancelExternalWorkflowExecutionFailedCause {
	return []CancelExternalWorkflowExecutionFailedCause{
		CancelExternalWorkflowExecutionFailedCauseUnknownExternalWorkflowExecution,
		CancelExternalWorkflowExecutionFailedCauseWorkflowAlreadyCompleted,
	}
}

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

// MarshalText encodes CancelExternalWorkflowExecutionFailedCause 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 CancelExternalWorkflowExecutionFailedCause) MarshalText() ([]byte, error) {
	switch int32(v) {
	case 0:
		return []byte("UNKNOWN_EXTERNAL_WORKFLOW_EXECUTION"), nil
	case 1:
		return []byte("WORKFLOW_ALREADY_COMPLETED"), nil
	}
	return []byte(strconv.FormatInt(int64(v), 10)), nil
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of CancelExternalWorkflowExecutionFailedCause.
// 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 CancelExternalWorkflowExecutionFailedCause) MarshalLogObject(enc zapcore.ObjectEncoder) error {
	enc.AddInt32("value", int32(v))
	switch int32(v) {
	case 0:
		enc.AddString("name", "UNKNOWN_EXTERNAL_WORKFLOW_EXECUTION")
	case 1:
		enc.AddString("name", "WORKFLOW_ALREADY_COMPLETED")
	}
	return nil
}

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

// ToWire translates CancelExternalWorkflowExecutionFailedCause 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 CancelExternalWorkflowExecutionFailedCause) ToWire() (wire.Value, error) {
	return wire.NewValueI32(int32(v)), nil
}

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

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

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

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

// UnmarshalJSON attempts to decode CancelExternalWorkflowExecutionFailedCause 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 *CancelExternalWorkflowExecutionFailedCause) 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, "CancelExternalWorkflowExecutionFailedCause")
		}
		if x < math.MinInt32 {
			return fmt.Errorf("enum underflow from JSON %q for %q", text, "CancelExternalWorkflowExecutionFailedCause")
		}
		*v = (CancelExternalWorkflowExecutionFailedCause)(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, "CancelExternalWorkflowExecutionFailedCause")
	}
}

type CancelTimerDecisionAttributes struct {
	TimerId *string `json:"timerId,omitempty"`
}

// ToWire translates a CancelTimerDecisionAttributes 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 *CancelTimerDecisionAttributes) ToWire() (wire.Value, error) {
	var (
		fields [1]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

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

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

// FromWire deserializes a CancelTimerDecisionAttributes 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 CancelTimerDecisionAttributes struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v CancelTimerDecisionAttributes
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *CancelTimerDecisionAttributes) 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.TimerId = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

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

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

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

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

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of CancelTimerDecisionAttributes.
func (v *CancelTimerDecisionAttributes) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.TimerId != nil {
		enc.AddString("timerId", *v.TimerId)
	}
	return err
}

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

	return
}

// IsSetTimerId returns true if TimerId is not nil.
func (v *CancelTimerDecisionAttributes) IsSetTimerId() bool {
	return v != nil && v.TimerId != nil
}

type CancelTimerFailedEventAttributes struct {
	TimerId                      *string `json:"timerId,omitempty"`
	Cause                        *string `json:"cause,omitempty"`
	DecisionTaskCompletedEventId *int64  `json:"decisionTaskCompletedEventId,omitempty"`
	Identity                     *string `json:"identity,omitempty"`
}

// ToWire translates a CancelTimerFailedEventAttributes 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 *CancelTimerFailedEventAttributes) ToWire() (wire.Value, error) {
	var (
		fields [4]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.TimerId != nil {
		w, err = wire.NewValueString(*(v.TimerId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.Cause != nil {
		w, err = wire.NewValueString(*(v.Cause)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, 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: 30, 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: 40, Value: w}
		i++
	}

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

// FromWire deserializes a CancelTimerFailedEventAttributes 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 CancelTimerFailedEventAttributes struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v CancelTimerFailedEventAttributes
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *CancelTimerFailedEventAttributes) 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.TimerId = &x
				if err != nil {
					return err
				}

			}
		case 20:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.Cause = &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.DecisionTaskCompletedEventId = &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.Identity = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

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

	var fields [4]string
	i := 0
	if v.TimerId != nil {
		fields[i] = fmt.Sprintf("TimerId: %v", *(v.TimerId))
		i++
	}
	if v.Cause != nil {
		fields[i] = fmt.Sprintf("Cause: %v", *(v.Cause))
		i++
	}
	if v.DecisionTaskCompletedEventId != nil {
		fields[i] = fmt.Sprintf("DecisionTaskCompletedEventId: %v", *(v.DecisionTaskCompletedEventId))
		i++
	}
	if v.Identity != nil {
		fields[i] = fmt.Sprintf("Identity: %v", *(v.Identity))
		i++
	}

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

// Equals returns true if all the fields of this CancelTimerFailedEventAttributes match the
// provided CancelTimerFailedEventAttributes.
//
// This function performs a deep comparison.
func (v *CancelTimerFailedEventAttributes) Equals(rhs *CancelTimerFailedEventAttributes) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.TimerId, rhs.TimerId) {
		return false
	}
	if !_String_EqualsPtr(v.Cause, rhs.Cause) {
		return false
	}
	if !_I64_EqualsPtr(v.DecisionTaskCompletedEventId, rhs.DecisionTaskCompletedEventId) {
		return false
	}
	if !_String_EqualsPtr(v.Identity, rhs.Identity) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of CancelTimerFailedEventAttributes.
func (v *CancelTimerFailedEventAttributes) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.TimerId != nil {
		enc.AddString("timerId", *v.TimerId)
	}
	if v.Cause != nil {
		enc.AddString("cause", *v.Cause)
	}
	if v.DecisionTaskCompletedEventId != nil {
		enc.AddInt64("decisionTaskCompletedEventId", *v.DecisionTaskCompletedEventId)
	}
	if v.Identity != nil {
		enc.AddString("identity", *v.Identity)
	}
	return err
}

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

	return
}

// IsSetTimerId returns true if TimerId is not nil.
func (v *CancelTimerFailedEventAttributes) IsSetTimerId() bool {
	return v != nil && v.TimerId != nil
}

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

	return
}

// IsSetCause returns true if Cause is not nil.
func (v *CancelTimerFailedEventAttributes) IsSetCause() bool {
	return v != nil && v.Cause != nil
}

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

	return
}

// IsSetDecisionTaskCompletedEventId returns true if DecisionTaskCompletedEventId is not nil.
func (v *CancelTimerFailedEventAttributes) IsSetDecisionTaskCompletedEventId() bool {
	return v != nil && v.DecisionTaskCompletedEventId != nil
}

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

	return
}

// IsSetIdentity returns true if Identity is not nil.
func (v *CancelTimerFailedEventAttributes) IsSetIdentity() bool {
	return v != nil && v.Identity != nil
}

type CancelWorkflowExecutionDecisionAttributes struct {
	Details []byte `json:"details,omitempty"`
}

// ToWire translates a CancelWorkflowExecutionDecisionAttributes 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 *CancelWorkflowExecutionDecisionAttributes) ToWire() (wire.Value, error) {
	var (
		fields [1]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++
	}

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

// FromWire deserializes a CancelWorkflowExecutionDecisionAttributes 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 CancelWorkflowExecutionDecisionAttributes struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v CancelWorkflowExecutionDecisionAttributes
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *CancelWorkflowExecutionDecisionAttributes) 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
				}

			}
		}
	}

	return nil
}

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

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

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

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

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of CancelWorkflowExecutionDecisionAttributes.
func (v *CancelWorkflowExecutionDecisionAttributes) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Details != nil {
		enc.AddString("details", base64.StdEncoding.EncodeToString(v.Details))
	}
	return err
}

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

	return
}

// IsSetDetails returns true if Details is not nil.
func (v *CancelWorkflowExecutionDecisionAttributes) IsSetDetails() bool {
	return v != nil && v.Details != nil
}

type CancellationAlreadyRequestedError struct {
	Message string `json:"message,required"`
}

// ToWire translates a CancellationAlreadyRequestedError 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 *CancellationAlreadyRequestedError) 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
}

// FromWire deserializes a CancellationAlreadyRequestedError 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 CancellationAlreadyRequestedError struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v CancellationAlreadyRequestedError
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *CancellationAlreadyRequestedError) 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 CancellationAlreadyRequestedError is required")
	}

	return nil
}

// String returns a readable string representation of a CancellationAlreadyRequestedError
// struct.
func (v *CancellationAlreadyRequestedError) 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("CancellationAlreadyRequestedError{%v}", strings.Join(fields[:i], ", "))
}

// ErrorName is the name of this type as defined in the Thrift
// file.
func (*CancellationAlreadyRequestedError) ErrorName() string {
	return "CancellationAlreadyRequestedError"
}

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

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of CancellationAlreadyRequestedError.
func (v *CancellationAlreadyRequestedError) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	enc.AddString("message", v.Message)
	return err
}

// GetMessage returns the value of Message if it is set or its
// zero value if it is unset.
func (v *CancellationAlreadyRequestedError) GetMessage() (o string) {
	if v != nil {
		o = v.Message
	}
	return
}

func (v *CancellationAlreadyRequestedError) Error() string {
	return v.String()
}

type ChildWorkflowExecutionCanceledEventAttributes struct {
	Details           []byte             `json:"details,omitempty"`
	Domain            *string            `json:"domain,omitempty"`
	WorkflowExecution *WorkflowExecution `json:"workflowExecution,omitempty"`
	WorkflowType      *WorkflowType      `json:"workflowType,omitempty"`
	InitiatedEventId  *int64             `json:"initiatedEventId,omitempty"`
	StartedEventId    *int64             `json:"startedEventId,omitempty"`
}

// ToWire translates a ChildWorkflowExecutionCanceledEventAttributes 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 *ChildWorkflowExecutionCanceledEventAttributes) ToWire() (wire.Value, error) {
	var (
		fields [6]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.Domain != nil {
		w, err = wire.NewValueString(*(v.Domain)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.WorkflowExecution != nil {
		w, err = v.WorkflowExecution.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.WorkflowType != nil {
		w, err = v.WorkflowType.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 40, Value: w}
		i++
	}
	if v.InitiatedEventId != nil {
		w, err = wire.NewValueI64(*(v.InitiatedEventId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 50, 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: 60, Value: w}
		i++
	}

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

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

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

// FromWire deserializes a ChildWorkflowExecutionCanceledEventAttributes 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 ChildWorkflowExecutionCanceledEventAttributes struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v ChildWorkflowExecutionCanceledEventAttributes
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *ChildWorkflowExecutionCanceledEventAttributes) 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.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.Domain = &x
				if err != nil {
					return err
				}

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

			}
		case 40:
			if field.Value.Type() == wire.TStruct {
				v.WorkflowType, err = _WorkflowType_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.InitiatedEventId = &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.StartedEventId = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

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

	var fields [6]string
	i := 0
	if v.Details != nil {
		fields[i] = fmt.Sprintf("Details: %v", v.Details)
		i++
	}
	if v.Domain != nil {
		fields[i] = fmt.Sprintf("Domain: %v", *(v.Domain))
		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.InitiatedEventId != nil {
		fields[i] = fmt.Sprintf("InitiatedEventId: %v", *(v.InitiatedEventId))
		i++
	}
	if v.StartedEventId != nil {
		fields[i] = fmt.Sprintf("StartedEventId: %v", *(v.StartedEventId))
		i++
	}

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

// Equals returns true if all the fields of this ChildWorkflowExecutionCanceledEventAttributes match the
// provided ChildWorkflowExecutionCanceledEventAttributes.
//
// This function performs a deep comparison.
func (v *ChildWorkflowExecutionCanceledEventAttributes) Equals(rhs *ChildWorkflowExecutionCanceledEventAttributes) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !((v.Details == nil && rhs.Details == nil) || (v.Details != nil && rhs.Details != nil && bytes.Equal(v.Details, rhs.Details))) {
		return false
	}
	if !_String_EqualsPtr(v.Domain, rhs.Domain) {
		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.InitiatedEventId, rhs.InitiatedEventId) {
		return false
	}
	if !_I64_EqualsPtr(v.StartedEventId, rhs.StartedEventId) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of ChildWorkflowExecutionCanceledEventAttributes.
func (v *ChildWorkflowExecutionCanceledEventAttributes) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Details != nil {
		enc.AddString("details", base64.StdEncoding.EncodeToString(v.Details))
	}
	if v.Domain != nil {
		enc.AddString("domain", *v.Domain)
	}
	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.InitiatedEventId != nil {
		enc.AddInt64("initiatedEventId", *v.InitiatedEventId)
	}
	if v.StartedEventId != nil {
		enc.AddInt64("startedEventId", *v.StartedEventId)
	}
	return err
}

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

	return
}

// IsSetDetails returns true if Details is not nil.
func (v *ChildWorkflowExecutionCanceledEventAttributes) IsSetDetails() bool {
	return v != nil && v.Details != nil
}

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

	return
}

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

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

	return
}

// IsSetWorkflowExecution returns true if WorkflowExecution is not nil.
func (v *ChildWorkflowExecutionCanceledEventAttributes) 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 *ChildWorkflowExecutionCanceledEventAttributes) GetWorkflowType() (o *WorkflowType) {
	if v != nil && v.WorkflowType != nil {
		return v.WorkflowType
	}

	return
}

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

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

	return
}

// IsSetInitiatedEventId returns true if InitiatedEventId is not nil.
func (v *ChildWorkflowExecutionCanceledEventAttributes) IsSetInitiatedEventId() bool {
	return v != nil && v.InitiatedEventId != nil
}

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

	return
}

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

type ChildWorkflowExecutionCompletedEventAttributes struct {
	Result            []byte             `json:"result,omitempty"`
	Domain            *string            `json:"domain,omitempty"`
	WorkflowExecution *WorkflowExecution `json:"workflowExecution,omitempty"`
	WorkflowType      *WorkflowType      `json:"workflowType,omitempty"`
	InitiatedEventId  *int64             `json:"initiatedEventId,omitempty"`
	StartedEventId    *int64             `json:"startedEventId,omitempty"`
}

// ToWire translates a ChildWorkflowExecutionCompletedEventAttributes 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 *ChildWorkflowExecutionCompletedEventAttributes) ToWire() (wire.Value, error) {
	var (
		fields [6]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.Result != nil {
		w, err = wire.NewValueBinary(v.Result), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.Domain != nil {
		w, err = wire.NewValueString(*(v.Domain)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.WorkflowExecution != nil {
		w, err = v.WorkflowExecution.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.WorkflowType != nil {
		w, err = v.WorkflowType.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 40, Value: w}
		i++
	}
	if v.InitiatedEventId != nil {
		w, err = wire.NewValueI64(*(v.InitiatedEventId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 50, 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: 60, Value: w}
		i++
	}

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

// FromWire deserializes a ChildWorkflowExecutionCompletedEventAttributes 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 ChildWorkflowExecutionCompletedEventAttributes struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v ChildWorkflowExecutionCompletedEventAttributes
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *ChildWorkflowExecutionCompletedEventAttributes) 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.Result, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		case 20:
			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 30:
			if field.Value.Type() == wire.TStruct {
				v.WorkflowExecution, err = _WorkflowExecution_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 40:
			if field.Value.Type() == wire.TStruct {
				v.WorkflowType, err = _WorkflowType_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.InitiatedEventId = &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.StartedEventId = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

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

	var fields [6]string
	i := 0
	if v.Result != nil {
		fields[i] = fmt.Sprintf("Result: %v", v.Result)
		i++
	}
	if v.Domain != nil {
		fields[i] = fmt.Sprintf("Domain: %v", *(v.Domain))
		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.InitiatedEventId != nil {
		fields[i] = fmt.Sprintf("InitiatedEventId: %v", *(v.InitiatedEventId))
		i++
	}
	if v.StartedEventId != nil {
		fields[i] = fmt.Sprintf("StartedEventId: %v", *(v.StartedEventId))
		i++
	}

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

// Equals returns true if all the fields of this ChildWorkflowExecutionCompletedEventAttributes match the
// provided ChildWorkflowExecutionCompletedEventAttributes.
//
// This function performs a deep comparison.
func (v *ChildWorkflowExecutionCompletedEventAttributes) Equals(rhs *ChildWorkflowExecutionCompletedEventAttributes) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !((v.Result == nil && rhs.Result == nil) || (v.Result != nil && rhs.Result != nil && bytes.Equal(v.Result, rhs.Result))) {
		return false
	}
	if !_String_EqualsPtr(v.Domain, rhs.Domain) {
		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.InitiatedEventId, rhs.InitiatedEventId) {
		return false
	}
	if !_I64_EqualsPtr(v.StartedEventId, rhs.StartedEventId) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of ChildWorkflowExecutionCompletedEventAttributes.
func (v *ChildWorkflowExecutionCompletedEventAttributes) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Result != nil {
		enc.AddString("result", base64.StdEncoding.EncodeToString(v.Result))
	}
	if v.Domain != nil {
		enc.AddString("domain", *v.Domain)
	}
	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.InitiatedEventId != nil {
		enc.AddInt64("initiatedEventId", *v.InitiatedEventId)
	}
	if v.StartedEventId != nil {
		enc.AddInt64("startedEventId", *v.StartedEventId)
	}
	return err
}

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

	return
}

// IsSetResult returns true if Result is not nil.
func (v *ChildWorkflowExecutionCompletedEventAttributes) IsSetResult() bool {
	return v != nil && v.Result != nil
}

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

	return
}

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

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

	return
}

// IsSetWorkflowExecution returns true if WorkflowExecution is not nil.
func (v *ChildWorkflowExecutionCompletedEventAttributes) 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 *ChildWorkflowExecutionCompletedEventAttributes) GetWorkflowType() (o *WorkflowType) {
	if v != nil && v.WorkflowType != nil {
		return v.WorkflowType
	}

	return
}

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

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

	return
}

// IsSetInitiatedEventId returns true if InitiatedEventId is not nil.
func (v *ChildWorkflowExecutionCompletedEventAttributes) IsSetInitiatedEventId() bool {
	return v != nil && v.InitiatedEventId != nil
}

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

	return
}

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

type ChildWorkflowExecutionFailedCause int32

const (
	ChildWorkflowExecutionFailedCauseWorkflowAlreadyRunning ChildWorkflowExecutionFailedCause = 0
)

// ChildWorkflowExecutionFailedCause_Values returns all recognized values of ChildWorkflowExecutionFailedCause.
func ChildWorkflowExecutionFailedCause_Values() []ChildWorkflowExecutionFailedCause {
	return []ChildWorkflowExecutionFailedCause{
		ChildWorkflowExecutionFailedCauseWorkflowAlreadyRunning,
	}
}

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

// MarshalText encodes ChildWorkflowExecutionFailedCause 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 ChildWorkflowExecutionFailedCause) MarshalText() ([]byte, error) {
	switch int32(v) {
	case 0:
		return []byte("WORKFLOW_ALREADY_RUNNING"), nil
	}
	return []byte(strconv.FormatInt(int64(v), 10)), nil
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of ChildWorkflowExecutionFailedCause.
// 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 ChildWorkflowExecutionFailedCause) MarshalLogObject(enc zapcore.ObjectEncoder) error {
	enc.AddInt32("value", int32(v))
	switch int32(v) {
	case 0:
		enc.AddString("name", "WORKFLOW_ALREADY_RUNNING")
	}
	return nil
}

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

// ToWire translates ChildWorkflowExecutionFailedCause 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 ChildWorkflowExecutionFailedCause) ToWire() (wire.Value, error) {
	return wire.NewValueI32(int32(v)), nil
}

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

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

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

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

// UnmarshalJSON attempts to decode ChildWorkflowExecutionFailedCause 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 *ChildWorkflowExecutionFailedCause) 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, "ChildWorkflowExecutionFailedCause")
		}
		if x < math.MinInt32 {
			return fmt.Errorf("enum underflow from JSON %q for %q", text, "ChildWorkflowExecutionFailedCause")
		}
		*v = (ChildWorkflowExecutionFailedCause)(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, "ChildWorkflowExecutionFailedCause")
	}
}

type ChildWorkflowExecutionFailedEventAttributes struct {
	Reason            *string            `json:"reason,omitempty"`
	Details           []byte             `json:"details,omitempty"`
	Domain            *string            `json:"domain,omitempty"`
	WorkflowExecution *WorkflowExecution `json:"workflowExecution,omitempty"`
	WorkflowType      *WorkflowType      `json:"workflowType,omitempty"`
	InitiatedEventId  *int64             `json:"initiatedEventId,omitempty"`
	StartedEventId    *int64             `json:"startedEventId,omitempty"`
}

// ToWire translates a ChildWorkflowExecutionFailedEventAttributes 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 *ChildWorkflowExecutionFailedEventAttributes) ToWire() (wire.Value, error) {
	var (
		fields [7]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.Reason != nil {
		w, err = wire.NewValueString(*(v.Reason)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.Details != nil {
		w, err = wire.NewValueBinary(v.Details), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.Domain != nil {
		w, err = wire.NewValueString(*(v.Domain)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.WorkflowExecution != nil {
		w, err = v.WorkflowExecution.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 40, Value: w}
		i++
	}
	if v.WorkflowType != nil {
		w, err = v.WorkflowType.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 50, Value: w}
		i++
	}
	if v.InitiatedEventId != nil {
		w, err = wire.NewValueI64(*(v.InitiatedEventId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 60, 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: 70, Value: w}
		i++
	}

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

// FromWire deserializes a ChildWorkflowExecutionFailedEventAttributes 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 ChildWorkflowExecutionFailedEventAttributes struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v ChildWorkflowExecutionFailedEventAttributes
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *ChildWorkflowExecutionFailedEventAttributes) 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.Reason = &x
				if err != nil {
					return err
				}

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

			}
		case 30:
			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 40:
			if field.Value.Type() == wire.TStruct {
				v.WorkflowExecution, err = _WorkflowExecution_Read(field.Value)
				if err != nil {
					return err
				}

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

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

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

			}
		}
	}

	return nil
}

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

	var fields [7]string
	i := 0
	if v.Reason != nil {
		fields[i] = fmt.Sprintf("Reason: %v", *(v.Reason))
		i++
	}
	if v.Details != nil {
		fields[i] = fmt.Sprintf("Details: %v", v.Details)
		i++
	}
	if v.Domain != nil {
		fields[i] = fmt.Sprintf("Domain: %v", *(v.Domain))
		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.InitiatedEventId != nil {
		fields[i] = fmt.Sprintf("InitiatedEventId: %v", *(v.InitiatedEventId))
		i++
	}
	if v.StartedEventId != nil {
		fields[i] = fmt.Sprintf("StartedEventId: %v", *(v.StartedEventId))
		i++
	}

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

// Equals returns true if all the fields of this ChildWorkflowExecutionFailedEventAttributes match the
// provided ChildWorkflowExecutionFailedEventAttributes.
//
// This function performs a deep comparison.
func (v *ChildWorkflowExecutionFailedEventAttributes) Equals(rhs *ChildWorkflowExecutionFailedEventAttributes) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.Reason, rhs.Reason) {
		return false
	}
	if !((v.Details == nil && rhs.Details == nil) || (v.Details != nil && rhs.Details != nil && bytes.Equal(v.Details, rhs.Details))) {
		return false
	}
	if !_String_EqualsPtr(v.Domain, rhs.Domain) {
		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.InitiatedEventId, rhs.InitiatedEventId) {
		return false
	}
	if !_I64_EqualsPtr(v.StartedEventId, rhs.StartedEventId) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of ChildWorkflowExecutionFailedEventAttributes.
func (v *ChildWorkflowExecutionFailedEventAttributes) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Reason != nil {
		enc.AddString("reason", *v.Reason)
	}
	if v.Details != nil {
		enc.AddString("details", base64.StdEncoding.EncodeToString(v.Details))
	}
	if v.Domain != nil {
		enc.AddString("domain", *v.Domain)
	}
	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.InitiatedEventId != nil {
		enc.AddInt64("initiatedEventId", *v.InitiatedEventId)
	}
	if v.StartedEventId != nil {
		enc.AddInt64("startedEventId", *v.StartedEventId)
	}
	return err
}

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

	return
}

// IsSetReason returns true if Reason is not nil.
func (v *ChildWorkflowExecutionFailedEventAttributes) IsSetReason() bool {
	return v != nil && v.Reason != nil
}

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

	return
}

// IsSetDetails returns true if Details is not nil.
func (v *ChildWorkflowExecutionFailedEventAttributes) IsSetDetails() bool {
	return v != nil && v.Details != nil
}

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

	return
}

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

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

	return
}

// IsSetWorkflowExecution returns true if WorkflowExecution is not nil.
func (v *ChildWorkflowExecutionFailedEventAttributes) 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 *ChildWorkflowExecutionFailedEventAttributes) GetWorkflowType() (o *WorkflowType) {
	if v != nil && v.WorkflowType != nil {
		return v.WorkflowType
	}

	return
}

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

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

	return
}

// IsSetInitiatedEventId returns true if InitiatedEventId is not nil.
func (v *ChildWorkflowExecutionFailedEventAttributes) IsSetInitiatedEventId() bool {
	return v != nil && v.InitiatedEventId != nil
}

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

	return
}

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

type ChildWorkflowExecutionStartedEventAttributes struct {
	Domain            *string            `json:"domain,omitempty"`
	InitiatedEventId  *int64             `json:"initiatedEventId,omitempty"`
	WorkflowExecution *WorkflowExecution `json:"workflowExecution,omitempty"`
	WorkflowType      *WorkflowType      `json:"workflowType,omitempty"`
	Header            *Header            `json:"header,omitempty"`
}

// ToWire translates a ChildWorkflowExecutionStartedEventAttributes 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 *ChildWorkflowExecutionStartedEventAttributes) ToWire() (wire.Value, error) {
	var (
		fields [5]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.InitiatedEventId != nil {
		w, err = wire.NewValueI64(*(v.InitiatedEventId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.WorkflowExecution != nil {
		w, err = v.WorkflowExecution.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.WorkflowType != nil {
		w, err = v.WorkflowType.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 40, Value: w}
		i++
	}
	if v.Header != nil {
		w, err = v.Header.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 50, Value: w}
		i++
	}

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

// FromWire deserializes a ChildWorkflowExecutionStartedEventAttributes 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 ChildWorkflowExecutionStartedEventAttributes struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v ChildWorkflowExecutionStartedEventAttributes
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *ChildWorkflowExecutionStartedEventAttributes) 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.TI64 {
				var x int64
				x, err = field.Value.GetI64(), error(nil)
				v.InitiatedEventId = &x
				if err != nil {
					return err
				}

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

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

			}
		case 50:
			if field.Value.Type() == wire.TStruct {
				v.Header, err = _Header_Read(field.Value)
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

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

	var fields [5]string
	i := 0
	if v.Domain != nil {
		fields[i] = fmt.Sprintf("Domain: %v", *(v.Domain))
		i++
	}
	if v.InitiatedEventId != nil {
		fields[i] = fmt.Sprintf("InitiatedEventId: %v", *(v.InitiatedEventId))
		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.Header != nil {
		fields[i] = fmt.Sprintf("Header: %v", v.Header)
		i++
	}

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

// Equals returns true if all the fields of this ChildWorkflowExecutionStartedEventAttributes match the
// provided ChildWorkflowExecutionStartedEventAttributes.
//
// This function performs a deep comparison.
func (v *ChildWorkflowExecutionStartedEventAttributes) Equals(rhs *ChildWorkflowExecutionStartedEventAttributes) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.Domain, rhs.Domain) {
		return false
	}
	if !_I64_EqualsPtr(v.InitiatedEventId, rhs.InitiatedEventId) {
		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 !((v.Header == nil && rhs.Header == nil) || (v.Header != nil && rhs.Header != nil && v.Header.Equals(rhs.Header))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of ChildWorkflowExecutionStartedEventAttributes.
func (v *ChildWorkflowExecutionStartedEventAttributes) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Domain != nil {
		enc.AddString("domain", *v.Domain)
	}
	if v.InitiatedEventId != nil {
		enc.AddInt64("initiatedEventId", *v.InitiatedEventId)
	}
	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.Header != nil {
		err = multierr.Append(err, enc.AddObject("header", v.Header))
	}
	return err
}

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

	return
}

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

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

	return
}

// IsSetInitiatedEventId returns true if InitiatedEventId is not nil.
func (v *ChildWorkflowExecutionStartedEventAttributes) IsSetInitiatedEventId() bool {
	return v != nil && v.InitiatedEventId != nil
}

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

	return
}

// IsSetWorkflowExecution returns true if WorkflowExecution is not nil.
func (v *ChildWorkflowExecutionStartedEventAttributes) 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 *ChildWorkflowExecutionStartedEventAttributes) GetWorkflowType() (o *WorkflowType) {
	if v != nil && v.WorkflowType != nil {
		return v.WorkflowType
	}

	return
}

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

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

	return
}

// IsSetHeader returns true if Header is not nil.
func (v *ChildWorkflowExecutionStartedEventAttributes) IsSetHeader() bool {
	return v != nil && v.Header != nil
}

type ChildWorkflowExecutionTerminatedEventAttributes struct {
	Domain            *string            `json:"domain,omitempty"`
	WorkflowExecution *WorkflowExecution `json:"workflowExecution,omitempty"`
	WorkflowType      *WorkflowType      `json:"workflowType,omitempty"`
	InitiatedEventId  *int64             `json:"initiatedEventId,omitempty"`
	StartedEventId    *int64             `json:"startedEventId,omitempty"`
}

// ToWire translates a ChildWorkflowExecutionTerminatedEventAttributes 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 *ChildWorkflowExecutionTerminatedEventAttributes) ToWire() (wire.Value, error) {
	var (
		fields [5]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.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.InitiatedEventId != nil {
		w, err = wire.NewValueI64(*(v.InitiatedEventId)), 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++
	}

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

// FromWire deserializes a ChildWorkflowExecutionTerminatedEventAttributes 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 ChildWorkflowExecutionTerminatedEventAttributes struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v ChildWorkflowExecutionTerminatedEventAttributes
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *ChildWorkflowExecutionTerminatedEventAttributes) 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.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.InitiatedEventId = &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
				}

			}
		}
	}

	return nil
}

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

	var fields [5]string
	i := 0
	if v.Domain != nil {
		fields[i] = fmt.Sprintf("Domain: %v", *(v.Domain))
		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.InitiatedEventId != nil {
		fields[i] = fmt.Sprintf("InitiatedEventId: %v", *(v.InitiatedEventId))
		i++
	}
	if v.StartedEventId != nil {
		fields[i] = fmt.Sprintf("StartedEventId: %v", *(v.StartedEventId))
		i++
	}

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

// Equals returns true if all the fields of this ChildWorkflowExecutionTerminatedEventAttributes match the
// provided ChildWorkflowExecutionTerminatedEventAttributes.
//
// This function performs a deep comparison.
func (v *ChildWorkflowExecutionTerminatedEventAttributes) Equals(rhs *ChildWorkflowExecutionTerminatedEventAttributes) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.Domain, rhs.Domain) {
		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.InitiatedEventId, rhs.InitiatedEventId) {
		return false
	}
	if !_I64_EqualsPtr(v.StartedEventId, rhs.StartedEventId) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of ChildWorkflowExecutionTerminatedEventAttributes.
func (v *ChildWorkflowExecutionTerminatedEventAttributes) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Domain != nil {
		enc.AddString("domain", *v.Domain)
	}
	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.InitiatedEventId != nil {
		enc.AddInt64("initiatedEventId", *v.InitiatedEventId)
	}
	if v.StartedEventId != nil {
		enc.AddInt64("startedEventId", *v.StartedEventId)
	}
	return err
}

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

	return
}

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

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

	return
}

// IsSetWorkflowExecution returns true if WorkflowExecution is not nil.
func (v *ChildWorkflowExecutionTerminatedEventAttributes) 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 *ChildWorkflowExecutionTerminatedEventAttributes) GetWorkflowType() (o *WorkflowType) {
	if v != nil && v.WorkflowType != nil {
		return v.WorkflowType
	}

	return
}

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

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

	return
}

// IsSetInitiatedEventId returns true if InitiatedEventId is not nil.
func (v *ChildWorkflowExecutionTerminatedEventAttributes) IsSetInitiatedEventId() bool {
	return v != nil && v.InitiatedEventId != nil
}

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

	return
}

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

type ChildWorkflowExecutionTimedOutEventAttributes struct {
	TimeoutType       *TimeoutType       `json:"timeoutType,omitempty"`
	Domain            *string            `json:"domain,omitempty"`
	WorkflowExecution *WorkflowExecution `json:"workflowExecution,omitempty"`
	WorkflowType      *WorkflowType      `json:"workflowType,omitempty"`
	InitiatedEventId  *int64             `json:"initiatedEventId,omitempty"`
	StartedEventId    *int64             `json:"startedEventId,omitempty"`
}

// ToWire translates a ChildWorkflowExecutionTimedOutEventAttributes 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 *ChildWorkflowExecutionTimedOutEventAttributes) ToWire() (wire.Value, error) {
	var (
		fields [6]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.TimeoutType != nil {
		w, err = v.TimeoutType.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.Domain != nil {
		w, err = wire.NewValueString(*(v.Domain)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.WorkflowExecution != nil {
		w, err = v.WorkflowExecution.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.WorkflowType != nil {
		w, err = v.WorkflowType.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 40, Value: w}
		i++
	}
	if v.InitiatedEventId != nil {
		w, err = wire.NewValueI64(*(v.InitiatedEventId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 50, 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: 60, Value: w}
		i++
	}

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

// FromWire deserializes a ChildWorkflowExecutionTimedOutEventAttributes 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 ChildWorkflowExecutionTimedOutEventAttributes struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v ChildWorkflowExecutionTimedOutEventAttributes
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *ChildWorkflowExecutionTimedOutEventAttributes) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			if field.Value.Type() == wire.TI32 {
				var x TimeoutType
				x, err = _TimeoutType_Read(field.Value)
				v.TimeoutType = &x
				if err != nil {
					return err
				}

			}
		case 20:
			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 30:
			if field.Value.Type() == wire.TStruct {
				v.WorkflowExecution, err = _WorkflowExecution_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 40:
			if field.Value.Type() == wire.TStruct {
				v.WorkflowType, err = _WorkflowType_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.InitiatedEventId = &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.StartedEventId = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

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

	var fields [6]string
	i := 0
	if v.TimeoutType != nil {
		fields[i] = fmt.Sprintf("TimeoutType: %v", *(v.TimeoutType))
		i++
	}
	if v.Domain != nil {
		fields[i] = fmt.Sprintf("Domain: %v", *(v.Domain))
		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.InitiatedEventId != nil {
		fields[i] = fmt.Sprintf("InitiatedEventId: %v", *(v.InitiatedEventId))
		i++
	}
	if v.StartedEventId != nil {
		fields[i] = fmt.Sprintf("StartedEventId: %v", *(v.StartedEventId))
		i++
	}

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

// Equals returns true if all the fields of this ChildWorkflowExecutionTimedOutEventAttributes match the
// provided ChildWorkflowExecutionTimedOutEventAttributes.
//
// This function performs a deep comparison.
func (v *ChildWorkflowExecutionTimedOutEventAttributes) Equals(rhs *ChildWorkflowExecutionTimedOutEventAttributes) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_TimeoutType_EqualsPtr(v.TimeoutType, rhs.TimeoutType) {
		return false
	}
	if !_String_EqualsPtr(v.Domain, rhs.Domain) {
		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.InitiatedEventId, rhs.InitiatedEventId) {
		return false
	}
	if !_I64_EqualsPtr(v.StartedEventId, rhs.StartedEventId) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of ChildWorkflowExecutionTimedOutEventAttributes.
func (v *ChildWorkflowExecutionTimedOutEventAttributes) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.TimeoutType != nil {
		err = multierr.Append(err, enc.AddObject("timeoutType", *v.TimeoutType))
	}
	if v.Domain != nil {
		enc.AddString("domain", *v.Domain)
	}
	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.InitiatedEventId != nil {
		enc.AddInt64("initiatedEventId", *v.InitiatedEventId)
	}
	if v.StartedEventId != nil {
		enc.AddInt64("startedEventId", *v.StartedEventId)
	}
	return err
}

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

	return
}

// IsSetTimeoutType returns true if TimeoutType is not nil.
func (v *ChildWorkflowExecutionTimedOutEventAttributes) IsSetTimeoutType() bool {
	return v != nil && v.TimeoutType != nil
}

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

	return
}

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

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

	return
}

// IsSetWorkflowExecution returns true if WorkflowExecution is not nil.
func (v *ChildWorkflowExecutionTimedOutEventAttributes) 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 *ChildWorkflowExecutionTimedOutEventAttributes) GetWorkflowType() (o *WorkflowType) {
	if v != nil && v.WorkflowType != nil {
		return v.WorkflowType
	}

	return
}

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

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

	return
}

// IsSetInitiatedEventId returns true if InitiatedEventId is not nil.
func (v *ChildWorkflowExecutionTimedOutEventAttributes) IsSetInitiatedEventId() bool {
	return v != nil && v.InitiatedEventId != nil
}

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

	return
}

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

type ClientVersionNotSupportedError struct {
	FeatureVersion    string `json:"featureVersion,required"`
	ClientImpl        string `json:"clientImpl,required"`
	SupportedVersions string `json:"supportedVersions,required"`
}

// ToWire translates a ClientVersionNotSupportedError 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 *ClientVersionNotSupportedError) ToWire() (wire.Value, error) {
	var (
		fields [3]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

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

	w, err = wire.NewValueString(v.ClientImpl), error(nil)
	if err != nil {
		return w, err
	}
	fields[i] = wire.Field{ID: 2, Value: w}
	i++

	w, err = wire.NewValueString(v.SupportedVersions), error(nil)
	if err != nil {
		return w, err
	}
	fields[i] = wire.Field{ID: 3, Value: w}
	i++

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

// FromWire deserializes a ClientVersionNotSupportedError 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 ClientVersionNotSupportedError struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v ClientVersionNotSupportedError
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *ClientVersionNotSupportedError) FromWire(w wire.Value) error {
	var err error

	featureVersionIsSet := false
	clientImplIsSet := false
	supportedVersionsIsSet := false

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 1:
			if field.Value.Type() == wire.TBinary {
				v.FeatureVersion, err = field.Value.GetString(), error(nil)
				if err != nil {
					return err
				}
				featureVersionIsSet = true
			}
		case 2:
			if field.Value.Type() == wire.TBinary {
				v.ClientImpl, err = field.Value.GetString(), error(nil)
				if err != nil {
					return err
				}
				clientImplIsSet = true
			}
		case 3:
			if field.Value.Type() == wire.TBinary {
				v.SupportedVersions, err = field.Value.GetString(), error(nil)
				if err != nil {
					return err
				}
				supportedVersionsIsSet = true
			}
		}
	}

	if !featureVersionIsSet {
		return errors.New("field FeatureVersion of ClientVersionNotSupportedError is required")
	}

	if !clientImplIsSet {
		return errors.New("field ClientImpl of ClientVersionNotSupportedError is required")
	}

	if !supportedVersionsIsSet {
		return errors.New("field SupportedVersions of ClientVersionNotSupportedError is required")
	}

	return nil
}

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

	var fields [3]string
	i := 0
	fields[i] = fmt.Sprintf("FeatureVersion: %v", v.FeatureVersion)
	i++
	fields[i] = fmt.Sprintf("ClientImpl: %v", v.ClientImpl)
	i++
	fields[i] = fmt.Sprintf("SupportedVersions: %v", v.SupportedVersions)
	i++

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

// ErrorName is the name of this type as defined in the Thrift
// file.
func (*ClientVersionNotSupportedError) ErrorName() string {
	return "ClientVersionNotSupportedError"
}

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

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of ClientVersionNotSupportedError.
func (v *ClientVersionNotSupportedError) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	enc.AddString("featureVersion", v.FeatureVersion)
	enc.AddString("clientImpl", v.ClientImpl)
	enc.AddString("supportedVersions", v.SupportedVersions)
	return err
}

// GetFeatureVersion returns the value of FeatureVersion if it is set or its
// zero value if it is unset.
func (v *ClientVersionNotSupportedError) GetFeatureVersion() (o string) {
	if v != nil {
		o = v.FeatureVersion
	}
	return
}

// GetClientImpl returns the value of ClientImpl if it is set or its
// zero value if it is unset.
func (v *ClientVersionNotSupportedError) GetClientImpl() (o string) {
	if v != nil {
		o = v.ClientImpl
	}
	return
}

// GetSupportedVersions returns the value of SupportedVersions if it is set or its
// zero value if it is unset.
func (v *ClientVersionNotSupportedError) GetSupportedVersions() (o string) {
	if v != nil {
		o = v.SupportedVersions
	}
	return
}

func (v *ClientVersionNotSupportedError) Error() string {
	return v.String()
}

type CloseShardRequest struct {
	ShardID *int32 `json:"shardID,omitempty"`
}

// ToWire translates a CloseShardRequest 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 *CloseShardRequest) ToWire() (wire.Value, error) {
	var (
		fields [1]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.ShardID != nil {
		w, err = wire.NewValueI32(*(v.ShardID)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}

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

// FromWire deserializes a CloseShardRequest 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 CloseShardRequest struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v CloseShardRequest
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *CloseShardRequest) FromWire(w wire.Value) error {
	var err error

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

			}
		}
	}

	return nil
}

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

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

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

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

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of CloseShardRequest.
func (v *CloseShardRequest) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.ShardID != nil {
		enc.AddInt32("shardID", *v.ShardID)
	}
	return err
}

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

	return
}

// IsSetShardID returns true if ShardID is not nil.
func (v *CloseShardRequest) IsSetShardID() bool {
	return v != nil && v.ShardID != nil
}

type ClusterInfo struct {
	SupportedClientVersions *SupportedClientVersions `json:"supportedClientVersions,omitempty"`
}

// ToWire translates a ClusterInfo 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 *ClusterInfo) ToWire() (wire.Value, error) {
	var (
		fields [1]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

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

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

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

// FromWire deserializes a ClusterInfo 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 ClusterInfo struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v ClusterInfo
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *ClusterInfo) 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.SupportedClientVersions, err = _SupportedClientVersions_Read(field.Value)
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

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

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

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

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

	return true
}

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

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

	return
}

// IsSetSupportedClientVersions returns true if SupportedClientVersions is not nil.
func (v *ClusterInfo) IsSetSupportedClientVersions() bool {
	return v != nil && v.SupportedClientVersions != nil
}

type ClusterReplicationConfiguration struct {
	ClusterName *string `json:"clusterName,omitempty"`
}

// ToWire translates a ClusterReplicationConfiguration 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 *ClusterReplicationConfiguration) ToWire() (wire.Value, error) {
	var (
		fields [1]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

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

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

// FromWire deserializes a ClusterReplicationConfiguration 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 ClusterReplicationConfiguration struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v ClusterReplicationConfiguration
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *ClusterReplicationConfiguration) 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.ClusterName = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

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

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

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

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

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of ClusterReplicationConfiguration.
func (v *ClusterReplicationConfiguration) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.ClusterName != nil {
		enc.AddString("clusterName", *v.ClusterName)
	}
	return err
}

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

	return
}

// IsSetClusterName returns true if ClusterName is not nil.
func (v *ClusterReplicationConfiguration) IsSetClusterName() bool {
	return v != nil && v.ClusterName != nil
}

type CompleteWorkflowExecutionDecisionAttributes struct {
	Result []byte `json:"result,omitempty"`
}

// ToWire translates a CompleteWorkflowExecutionDecisionAttributes 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 *CompleteWorkflowExecutionDecisionAttributes) ToWire() (wire.Value, error) {
	var (
		fields [1]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.Result != nil {
		w, err = wire.NewValueBinary(v.Result), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}

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

// FromWire deserializes a CompleteWorkflowExecutionDecisionAttributes 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 CompleteWorkflowExecutionDecisionAttributes struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v CompleteWorkflowExecutionDecisionAttributes
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *CompleteWorkflowExecutionDecisionAttributes) 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.Result, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

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

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

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

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

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of CompleteWorkflowExecutionDecisionAttributes.
func (v *CompleteWorkflowExecutionDecisionAttributes) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Result != nil {
		enc.AddString("result", base64.StdEncoding.EncodeToString(v.Result))
	}
	return err
}

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

	return
}

// IsSetResult returns true if Result is not nil.
func (v *CompleteWorkflowExecutionDecisionAttributes) IsSetResult() bool {
	return v != nil && v.Result != nil
}

type ContinueAsNewInitiator int32

const (
	ContinueAsNewInitiatorDecider      ContinueAsNewInitiator = 0
	ContinueAsNewInitiatorRetryPolicy  ContinueAsNewInitiator = 1
	ContinueAsNewInitiatorCronSchedule ContinueAsNewInitiator = 2
)

// ContinueAsNewInitiator_Values returns all recognized values of ContinueAsNewInitiator.
func ContinueAsNewInitiator_Values() []ContinueAsNewInitiator {
	return []ContinueAsNewInitiator{
		ContinueAsNewInitiatorDecider,
		ContinueAsNewInitiatorRetryPolicy,
		ContinueAsNewInitiatorCronSchedule,
	}
}

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

// MarshalText encodes ContinueAsNewInitiator 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 ContinueAsNewInitiator) MarshalText() ([]byte, error) {
	switch int32(v) {
	case 0:
		return []byte("Decider"), nil
	case 1:
		return []byte("RetryPolicy"), nil
	case 2:
		return []byte("CronSchedule"), nil
	}
	return []byte(strconv.FormatInt(int64(v), 10)), nil
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of ContinueAsNewInitiator.
// 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 ContinueAsNewInitiator) MarshalLogObject(enc zapcore.ObjectEncoder) error {
	enc.AddInt32("value", int32(v))
	switch int32(v) {
	case 0:
		enc.AddString("name", "Decider")
	case 1:
		enc.AddString("name", "RetryPolicy")
	case 2:
		enc.AddString("name", "CronSchedule")
	}
	return nil
}

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

// ToWire translates ContinueAsNewInitiator 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 ContinueAsNewInitiator) ToWire() (wire.Value, error) {
	return wire.NewValueI32(int32(v)), nil
}

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

// String returns a readable string representation of ContinueAsNewInitiator.
func (v ContinueAsNewInitiator) String() string {
	w := int32(v)
	switch w {
	case 0:
		return "Decider"
	case 1:
		return "RetryPolicy"
	case 2:
		return "CronSchedule"
	}
	return fmt.Sprintf("ContinueAsNewInitiator(%d)", w)
}

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

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

// UnmarshalJSON attempts to decode ContinueAsNewInitiator 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 *ContinueAsNewInitiator) 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, "ContinueAsNewInitiator")
		}
		if x < math.MinInt32 {
			return fmt.Errorf("enum underflow from JSON %q for %q", text, "ContinueAsNewInitiator")
		}
		*v = (ContinueAsNewInitiator)(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, "ContinueAsNewInitiator")
	}
}

type ContinueAsNewWorkflowExecutionDecisionAttributes struct {
	WorkflowType                        *WorkflowType                 `json:"workflowType,omitempty"`
	TaskList                            *TaskList                     `json:"taskList,omitempty"`
	Input                               []byte                        `json:"input,omitempty"`
	ExecutionStartToCloseTimeoutSeconds *int32                        `json:"executionStartToCloseTimeoutSeconds,omitempty"`
	TaskStartToCloseTimeoutSeconds      *int32                        `json:"taskStartToCloseTimeoutSeconds,omitempty"`
	BackoffStartIntervalInSeconds       *int32                        `json:"backoffStartIntervalInSeconds,omitempty"`
	RetryPolicy                         *RetryPolicy                  `json:"retryPolicy,omitempty"`
	Initiator                           *ContinueAsNewInitiator       `json:"initiator,omitempty"`
	FailureReason                       *string                       `json:"failureReason,omitempty"`
	FailureDetails                      []byte                        `json:"failureDetails,omitempty"`
	LastCompletionResult                []byte                        `json:"lastCompletionResult,omitempty"`
	CronSchedule                        *string                       `json:"cronSchedule,omitempty"`
	Header                              *Header                       `json:"header,omitempty"`
	Memo                                *Memo                         `json:"memo,omitempty"`
	SearchAttributes                    *SearchAttributes             `json:"searchAttributes,omitempty"`
	JitterStartSeconds                  *int32                        `json:"jitterStartSeconds,omitempty"`
	CronOverlapPolicy                   *CronOverlapPolicy            `json:"cronOverlapPolicy,omitempty"`
	ActiveClusterSelectionPolicy        *ActiveClusterSelectionPolicy `json:"activeClusterSelectionPolicy,omitempty"`
}

// ToWire translates a ContinueAsNewWorkflowExecutionDecisionAttributes 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 *ContinueAsNewWorkflowExecutionDecisionAttributes) ToWire() (wire.Value, error) {
	var (
		fields [18]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.WorkflowType != nil {
		w, err = v.WorkflowType.ToWire()
		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.Input != nil {
		w, err = wire.NewValueBinary(v.Input), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.ExecutionStartToCloseTimeoutSeconds != nil {
		w, err = wire.NewValueI32(*(v.ExecutionStartToCloseTimeoutSeconds)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 40, Value: w}
		i++
	}
	if v.TaskStartToCloseTimeoutSeconds != nil {
		w, err = wire.NewValueI32(*(v.TaskStartToCloseTimeoutSeconds)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 50, Value: w}
		i++
	}
	if v.BackoffStartIntervalInSeconds != nil {
		w, err = wire.NewValueI32(*(v.BackoffStartIntervalInSeconds)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 60, Value: w}
		i++
	}
	if v.RetryPolicy != nil {
		w, err = v.RetryPolicy.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 70, Value: w}
		i++
	}
	if v.Initiator != nil {
		w, err = v.Initiator.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 80, Value: w}
		i++
	}
	if v.FailureReason != nil {
		w, err = wire.NewValueString(*(v.FailureReason)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 90, Value: w}
		i++
	}
	if v.FailureDetails != nil {
		w, err = wire.NewValueBinary(v.FailureDetails), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 100, Value: w}
		i++
	}
	if v.LastCompletionResult != nil {
		w, err = wire.NewValueBinary(v.LastCompletionResult), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 110, Value: w}
		i++
	}
	if v.CronSchedule != nil {
		w, err = wire.NewValueString(*(v.CronSchedule)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 120, Value: w}
		i++
	}
	if v.Header != nil {
		w, err = v.Header.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 130, Value: w}
		i++
	}
	if v.Memo != nil {
		w, err = v.Memo.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 140, Value: w}
		i++
	}
	if v.SearchAttributes != nil {
		w, err = v.SearchAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 150, Value: w}
		i++
	}
	if v.JitterStartSeconds != nil {
		w, err = wire.NewValueI32(*(v.JitterStartSeconds)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 160, Value: w}
		i++
	}
	if v.CronOverlapPolicy != nil {
		w, err = v.CronOverlapPolicy.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 170, Value: w}
		i++
	}
	if v.ActiveClusterSelectionPolicy != nil {
		w, err = v.ActiveClusterSelectionPolicy.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 180, Value: w}
		i++
	}

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

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

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

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

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

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

// FromWire deserializes a ContinueAsNewWorkflowExecutionDecisionAttributes 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 ContinueAsNewWorkflowExecutionDecisionAttributes struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v ContinueAsNewWorkflowExecutionDecisionAttributes
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *ContinueAsNewWorkflowExecutionDecisionAttributes) 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.WorkflowType, err = _WorkflowType_Read(field.Value)
				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 {
				v.Input, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		case 40:
			if field.Value.Type() == wire.TI32 {
				var x int32
				x, err = field.Value.GetI32(), error(nil)
				v.ExecutionStartToCloseTimeoutSeconds = &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.TaskStartToCloseTimeoutSeconds = &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.BackoffStartIntervalInSeconds = &x
				if err != nil {
					return err
				}

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

			}
		case 80:
			if field.Value.Type() == wire.TI32 {
				var x ContinueAsNewInitiator
				x, err = _ContinueAsNewInitiator_Read(field.Value)
				v.Initiator = &x
				if err != nil {
					return err
				}

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

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

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

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

			}
		case 130:
			if field.Value.Type() == wire.TStruct {
				v.Header, err = _Header_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 140:
			if field.Value.Type() == wire.TStruct {
				v.Memo, err = _Memo_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 150:
			if field.Value.Type() == wire.TStruct {
				v.SearchAttributes, err = _SearchAttributes_Read(field.Value)
				if err != nil {
					return err
				}

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

			}
		case 170:
			if field.Value.Type() == wire.TI32 {
				var x CronOverlapPolicy
				x, err = _CronOverlapPolicy_Read(field.Value)
				v.CronOverlapPolicy = &x
				if err != nil {
					return err
				}

			}
		case 180:
			if field.Value.Type() == wire.TStruct {
				v.ActiveClusterSelectionPolicy, err = _ActiveClusterSelectionPolicy_Read(field.Value)
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

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

	var fields [18]string
	i := 0
	if v.WorkflowType != nil {
		fields[i] = fmt.Sprintf("WorkflowType: %v", v.WorkflowType)
		i++
	}
	if v.TaskList != nil {
		fields[i] = fmt.Sprintf("TaskList: %v", v.TaskList)
		i++
	}
	if v.Input != nil {
		fields[i] = fmt.Sprintf("Input: %v", v.Input)
		i++
	}
	if v.ExecutionStartToCloseTimeoutSeconds != nil {
		fields[i] = fmt.Sprintf("ExecutionStartToCloseTimeoutSeconds: %v", *(v.ExecutionStartToCloseTimeoutSeconds))
		i++
	}
	if v.TaskStartToCloseTimeoutSeconds != nil {
		fields[i] = fmt.Sprintf("TaskStartToCloseTimeoutSeconds: %v", *(v.TaskStartToCloseTimeoutSeconds))
		i++
	}
	if v.BackoffStartIntervalInSeconds != nil {
		fields[i] = fmt.Sprintf("BackoffStartIntervalInSeconds: %v", *(v.BackoffStartIntervalInSeconds))
		i++
	}
	if v.RetryPolicy != nil {
		fields[i] = fmt.Sprintf("RetryPolicy: %v", v.RetryPolicy)
		i++
	}
	if v.Initiator != nil {
		fields[i] = fmt.Sprintf("Initiator: %v", *(v.Initiator))
		i++
	}
	if v.FailureReason != nil {
		fields[i] = fmt.Sprintf("FailureReason: %v", *(v.FailureReason))
		i++
	}
	if v.FailureDetails != nil {
		fields[i] = fmt.Sprintf("FailureDetails: %v", v.FailureDetails)
		i++
	}
	if v.LastCompletionResult != nil {
		fields[i] = fmt.Sprintf("LastCompletionResult: %v", v.LastCompletionResult)
		i++
	}
	if v.CronSchedule != nil {
		fields[i] = fmt.Sprintf("CronSchedule: %v", *(v.CronSchedule))
		i++
	}
	if v.Header != nil {
		fields[i] = fmt.Sprintf("Header: %v", v.Header)
		i++
	}
	if v.Memo != nil {
		fields[i] = fmt.Sprintf("Memo: %v", v.Memo)
		i++
	}
	if v.SearchAttributes != nil {
		fields[i] = fmt.Sprintf("SearchAttributes: %v", v.SearchAttributes)
		i++
	}
	if v.JitterStartSeconds != nil {
		fields[i] = fmt.Sprintf("JitterStartSeconds: %v", *(v.JitterStartSeconds))
		i++
	}
	if v.CronOverlapPolicy != nil {
		fields[i] = fmt.Sprintf("CronOverlapPolicy: %v", *(v.CronOverlapPolicy))
		i++
	}
	if v.ActiveClusterSelectionPolicy != nil {
		fields[i] = fmt.Sprintf("ActiveClusterSelectionPolicy: %v", v.ActiveClusterSelectionPolicy)
		i++
	}

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

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

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

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

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

// Equals returns true if all the fields of this ContinueAsNewWorkflowExecutionDecisionAttributes match the
// provided ContinueAsNewWorkflowExecutionDecisionAttributes.
//
// This function performs a deep comparison.
func (v *ContinueAsNewWorkflowExecutionDecisionAttributes) Equals(rhs *ContinueAsNewWorkflowExecutionDecisionAttributes) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !((v.WorkflowType == nil && rhs.WorkflowType == nil) || (v.WorkflowType != nil && rhs.WorkflowType != nil && v.WorkflowType.Equals(rhs.WorkflowType))) {
		return false
	}
	if !((v.TaskList == nil && rhs.TaskList == nil) || (v.TaskList != nil && rhs.TaskList != nil && v.TaskList.Equals(rhs.TaskList))) {
		return false
	}
	if !((v.Input == nil && rhs.Input == nil) || (v.Input != nil && rhs.Input != nil && bytes.Equal(v.Input, rhs.Input))) {
		return false
	}
	if !_I32_EqualsPtr(v.ExecutionStartToCloseTimeoutSeconds, rhs.ExecutionStartToCloseTimeoutSeconds) {
		return false
	}
	if !_I32_EqualsPtr(v.TaskStartToCloseTimeoutSeconds, rhs.TaskStartToCloseTimeoutSeconds) {
		return false
	}
	if !_I32_EqualsPtr(v.BackoffStartIntervalInSeconds, rhs.BackoffStartIntervalInSeconds) {
		return false
	}
	if !((v.RetryPolicy == nil && rhs.RetryPolicy == nil) || (v.RetryPolicy != nil && rhs.RetryPolicy != nil && v.RetryPolicy.Equals(rhs.RetryPolicy))) {
		return false
	}
	if !_ContinueAsNewInitiator_EqualsPtr(v.Initiator, rhs.Initiator) {
		return false
	}
	if !_String_EqualsPtr(v.FailureReason, rhs.FailureReason) {
		return false
	}
	if !((v.FailureDetails == nil && rhs.FailureDetails == nil) || (v.FailureDetails != nil && rhs.FailureDetails != nil && bytes.Equal(v.FailureDetails, rhs.FailureDetails))) {
		return false
	}
	if !((v.LastCompletionResult == nil && rhs.LastCompletionResult == nil) || (v.LastCompletionResult != nil && rhs.LastCompletionResult != nil && bytes.Equal(v.LastCompletionResult, rhs.LastCompletionResult))) {
		return false
	}
	if !_String_EqualsPtr(v.CronSchedule, rhs.CronSchedule) {
		return false
	}
	if !((v.Header == nil && rhs.Header == nil) || (v.Header != nil && rhs.Header != nil && v.Header.Equals(rhs.Header))) {
		return false
	}
	if !((v.Memo == nil && rhs.Memo == nil) || (v.Memo != nil && rhs.Memo != nil && v.Memo.Equals(rhs.Memo))) {
		return false
	}
	if !((v.SearchAttributes == nil && rhs.SearchAttributes == nil) || (v.SearchAttributes != nil && rhs.SearchAttributes != nil && v.SearchAttributes.Equals(rhs.SearchAttributes))) {
		return false
	}
	if !_I32_EqualsPtr(v.JitterStartSeconds, rhs.JitterStartSeconds) {
		return false
	}
	if !_CronOverlapPolicy_EqualsPtr(v.CronOverlapPolicy, rhs.CronOverlapPolicy) {
		return false
	}
	if !((v.ActiveClusterSelectionPolicy == nil && rhs.ActiveClusterSelectionPolicy == nil) || (v.ActiveClusterSelectionPolicy != nil && rhs.ActiveClusterSelectionPolicy != nil && v.ActiveClusterSelectionPolicy.Equals(rhs.ActiveClusterSelectionPolicy))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of ContinueAsNewWorkflowExecutionDecisionAttributes.
func (v *ContinueAsNewWorkflowExecutionDecisionAttributes) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.WorkflowType != nil {
		err = multierr.Append(err, enc.AddObject("workflowType", v.WorkflowType))
	}
	if v.TaskList != nil {
		err = multierr.Append(err, enc.AddObject("taskList", v.TaskList))
	}
	if v.Input != nil {
		enc.AddString("input", base64.StdEncoding.EncodeToString(v.Input))
	}
	if v.ExecutionStartToCloseTimeoutSeconds != nil {
		enc.AddInt32("executionStartToCloseTimeoutSeconds", *v.ExecutionStartToCloseTimeoutSeconds)
	}
	if v.TaskStartToCloseTimeoutSeconds != nil {
		enc.AddInt32("taskStartToCloseTimeoutSeconds", *v.TaskStartToCloseTimeoutSeconds)
	}
	if v.BackoffStartIntervalInSeconds != nil {
		enc.AddInt32("backoffStartIntervalInSeconds", *v.BackoffStartIntervalInSeconds)
	}
	if v.RetryPolicy != nil {
		err = multierr.Append(err, enc.AddObject("retryPolicy", v.RetryPolicy))
	}
	if v.Initiator != nil {
		err = multierr.Append(err, enc.AddObject("initiator", *v.Initiator))
	}
	if v.FailureReason != nil {
		enc.AddString("failureReason", *v.FailureReason)
	}
	if v.FailureDetails != nil {
		enc.AddString("failureDetails", base64.StdEncoding.EncodeToString(v.FailureDetails))
	}
	if v.LastCompletionResult != nil {
		enc.AddString("lastCompletionResult", base64.StdEncoding.EncodeToString(v.LastCompletionResult))
	}
	if v.CronSchedule != nil {
		enc.AddString("cronSchedule", *v.CronSchedule)
	}
	if v.Header != nil {
		err = multierr.Append(err, enc.AddObject("header", v.Header))
	}
	if v.Memo != nil {
		err = multierr.Append(err, enc.AddObject("memo", v.Memo))
	}
	if v.SearchAttributes != nil {
		err = multierr.Append(err, enc.AddObject("searchAttributes", v.SearchAttributes))
	}
	if v.JitterStartSeconds != nil {
		enc.AddInt32("jitterStartSeconds", *v.JitterStartSeconds)
	}
	if v.CronOverlapPolicy != nil {
		err = multierr.Append(err, enc.AddObject("cronOverlapPolicy", *v.CronOverlapPolicy))
	}
	if v.ActiveClusterSelectionPolicy != nil {
		err = multierr.Append(err, enc.AddObject("activeClusterSelectionPolicy", v.ActiveClusterSelectionPolicy))
	}
	return err
}

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

	return
}

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

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

	return
}

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

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

	return
}

// IsSetInput returns true if Input is not nil.
func (v *ContinueAsNewWorkflowExecutionDecisionAttributes) IsSetInput() bool {
	return v != nil && v.Input != nil
}

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

	return
}

// IsSetExecutionStartToCloseTimeoutSeconds returns true if ExecutionStartToCloseTimeoutSeconds is not nil.
func (v *ContinueAsNewWorkflowExecutionDecisionAttributes) IsSetExecutionStartToCloseTimeoutSeconds() bool {
	return v != nil && v.ExecutionStartToCloseTimeoutSeconds != nil
}

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

	return
}

// IsSetTaskStartToCloseTimeoutSeconds returns true if TaskStartToCloseTimeoutSeconds is not nil.
func (v *ContinueAsNewWorkflowExecutionDecisionAttributes) IsSetTaskStartToCloseTimeoutSeconds() bool {
	return v != nil && v.TaskStartToCloseTimeoutSeconds != nil
}

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

	return
}

// IsSetBackoffStartIntervalInSeconds returns true if BackoffStartIntervalInSeconds is not nil.
func (v *ContinueAsNewWorkflowExecutionDecisionAttributes) IsSetBackoffStartIntervalInSeconds() bool {
	return v != nil && v.BackoffStartIntervalInSeconds != nil
}

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

	return
}

// IsSetRetryPolicy returns true if RetryPolicy is not nil.
func (v *ContinueAsNewWorkflowExecutionDecisionAttributes) IsSetRetryPolicy() bool {
	return v != nil && v.RetryPolicy != nil
}

// GetInitiator returns the value of Initiator if it is set or its
// zero value if it is unset.
func (v *ContinueAsNewWorkflowExecutionDecisionAttributes) GetInitiator() (o ContinueAsNewInitiator) {
	if v != nil && v.Initiator != nil {
		return *v.Initiator
	}

	return
}

// IsSetInitiator returns true if Initiator is not nil.
func (v *ContinueAsNewWorkflowExecutionDecisionAttributes) IsSetInitiator() bool {
	return v != nil && v.Initiator != nil
}

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

	return
}

// IsSetFailureReason returns true if FailureReason is not nil.
func (v *ContinueAsNewWorkflowExecutionDecisionAttributes) IsSetFailureReason() bool {
	return v != nil && v.FailureReason != nil
}

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

	return
}

// IsSetFailureDetails returns true if FailureDetails is not nil.
func (v *ContinueAsNewWorkflowExecutionDecisionAttributes) IsSetFailureDetails() bool {
	return v != nil && v.FailureDetails != nil
}

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

	return
}

// IsSetLastCompletionResult returns true if LastCompletionResult is not nil.
func (v *ContinueAsNewWorkflowExecutionDecisionAttributes) IsSetLastCompletionResult() bool {
	return v != nil && v.LastCompletionResult != nil
}

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

	return
}

// IsSetCronSchedule returns true if CronSchedule is not nil.
func (v *ContinueAsNewWorkflowExecutionDecisionAttributes) IsSetCronSchedule() bool {
	return v != nil && v.CronSchedule != nil
}

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

	return
}

// IsSetHeader returns true if Header is not nil.
func (v *ContinueAsNewWorkflowExecutionDecisionAttributes) IsSetHeader() bool {
	return v != nil && v.Header != nil
}

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

	return
}

// IsSetMemo returns true if Memo is not nil.
func (v *ContinueAsNewWorkflowExecutionDecisionAttributes) IsSetMemo() bool {
	return v != nil && v.Memo != nil
}

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

	return
}

// IsSetSearchAttributes returns true if SearchAttributes is not nil.
func (v *ContinueAsNewWorkflowExecutionDecisionAttributes) IsSetSearchAttributes() bool {
	return v != nil && v.SearchAttributes != nil
}

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

	return
}

// IsSetJitterStartSeconds returns true if JitterStartSeconds is not nil.
func (v *ContinueAsNewWorkflowExecutionDecisionAttributes) IsSetJitterStartSeconds() bool {
	return v != nil && v.JitterStartSeconds != nil
}

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

	return
}

// IsSetCronOverlapPolicy returns true if CronOverlapPolicy is not nil.
func (v *ContinueAsNewWorkflowExecutionDecisionAttributes) IsSetCronOverlapPolicy() bool {
	return v != nil && v.CronOverlapPolicy != nil
}

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

	return
}

// IsSetActiveClusterSelectionPolicy returns true if ActiveClusterSelectionPolicy is not nil.
func (v *ContinueAsNewWorkflowExecutionDecisionAttributes) IsSetActiveClusterSelectionPolicy() bool {
	return v != nil && v.ActiveClusterSelectionPolicy != nil
}

type CountWorkflowExecutionsRequest struct {
	Domain *string `json:"domain,omitempty"`
	Query  *string `json:"query,omitempty"`
}

// ToWire translates a CountWorkflowExecutionsRequest 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 *CountWorkflowExecutionsRequest) 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.Query != nil {
		w, err = wire.NewValueString(*(v.Query)), 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
}

// FromWire deserializes a CountWorkflowExecutionsRequest 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 CountWorkflowExecutionsRequest struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v CountWorkflowExecutionsRequest
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *CountWorkflowExecutionsRequest) 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.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.Query = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a CountWorkflowExecutionsRequest
// struct.
func (v *CountWorkflowExecutionsRequest) 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.Query != nil {
		fields[i] = fmt.Sprintf("Query: %v", *(v.Query))
		i++
	}

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

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

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of CountWorkflowExecutionsRequest.
func (v *CountWorkflowExecutionsRequest) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Domain != nil {
		enc.AddString("domain", *v.Domain)
	}
	if v.Query != nil {
		enc.AddString("query", *v.Query)
	}
	return err
}

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

	return
}

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

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

	return
}

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

type CountWorkflowExecutionsResponse struct {
	Count *int64 `json:"count,omitempty"`
}

// ToWire translates a CountWorkflowExecutionsResponse 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 *CountWorkflowExecutionsResponse) ToWire() (wire.Value, error) {
	var (
		fields [1]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.Count != nil {
		w, err = wire.NewValueI64(*(v.Count)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}

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

// FromWire deserializes a CountWorkflowExecutionsResponse 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 CountWorkflowExecutionsResponse struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v CountWorkflowExecutionsResponse
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *CountWorkflowExecutionsResponse) FromWire(w wire.Value) error {
	var err error

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

			}
		}
	}

	return nil
}

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

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

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

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

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of CountWorkflowExecutionsResponse.
func (v *CountWorkflowExecutionsResponse) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Count != nil {
		enc.AddInt64("count", *v.Count)
	}
	return err
}

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

	return
}

// IsSetCount returns true if Count is not nil.
func (v *CountWorkflowExecutionsResponse) IsSetCount() bool {
	return v != nil && v.Count != nil
}

type CronOverlapPolicy int32

const (
	CronOverlapPolicySkipped   CronOverlapPolicy = 0
	CronOverlapPolicyBufferone CronOverlapPolicy = 1
)

// CronOverlapPolicy_Values returns all recognized values of CronOverlapPolicy.
func CronOverlapPolicy_Values() []CronOverlapPolicy {
	return []CronOverlapPolicy{
		CronOverlapPolicySkipped,
		CronOverlapPolicyBufferone,
	}
}

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

// MarshalText encodes CronOverlapPolicy 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 CronOverlapPolicy) MarshalText() ([]byte, error) {
	switch int32(v) {
	case 0:
		return []byte("SKIPPED"), nil
	case 1:
		return []byte("BUFFERONE"), nil
	}
	return []byte(strconv.FormatInt(int64(v), 10)), nil
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of CronOverlapPolicy.
// 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 CronOverlapPolicy) MarshalLogObject(enc zapcore.ObjectEncoder) error {
	enc.AddInt32("value", int32(v))
	switch int32(v) {
	case 0:
		enc.AddString("name", "SKIPPED")
	case 1:
		enc.AddString("name", "BUFFERONE")
	}
	return nil
}

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

// ToWire translates CronOverlapPolicy 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 CronOverlapPolicy) ToWire() (wire.Value, error) {
	return wire.NewValueI32(int32(v)), nil
}

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

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

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

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

// UnmarshalJSON attempts to decode CronOverlapPolicy 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 *CronOverlapPolicy) 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, "CronOverlapPolicy")
		}
		if x < math.MinInt32 {
			return fmt.Errorf("enum underflow from JSON %q for %q", text, "CronOverlapPolicy")
		}
		*v = (CronOverlapPolicy)(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, "CronOverlapPolicy")
	}
}

type CrossClusterApplyParentClosePolicyRequestAttributes struct {
	Children []*ApplyParentClosePolicyRequest `json:"children,omitempty"`
}

type _List_ApplyParentClosePolicyRequest_ValueList []*ApplyParentClosePolicyRequest

func (v _List_ApplyParentClosePolicyRequest_ValueList) ForEach(f func(wire.Value) error) error {
	for i, x := range v {
		if x == nil {
			return fmt.Errorf("invalid [%v]: value is nil", i)
		}
		w, err := x.ToWire()
		if err != nil {
			return err
		}
		err = f(w)
		if err != nil {
			return err
		}
	}
	return nil
}

func (v _List_ApplyParentClosePolicyRequest_ValueList) Size() int {
	return len(v)
}

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

func (_List_ApplyParentClosePolicyRequest_ValueList) Close() {}

// ToWire translates a CrossClusterApplyParentClosePolicyRequestAttributes 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 *CrossClusterApplyParentClosePolicyRequestAttributes) ToWire() (wire.Value, error) {
	var (
		fields [1]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.Children != nil {
		w, err = wire.NewValueList(_List_ApplyParentClosePolicyRequest_ValueList(v.Children)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}

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

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

func _List_ApplyParentClosePolicyRequest_Read(l wire.ValueList) ([]*ApplyParentClosePolicyRequest, error) {
	if l.ValueType() != wire.TStruct {
		return nil, nil
	}

	o := make([]*ApplyParentClosePolicyRequest, 0, l.Size())
	err := l.ForEach(func(x wire.Value) error {
		i, err := _ApplyParentClosePolicyRequest_Read(x)
		if err != nil {
			return err
		}
		o = append(o, i)
		return nil
	})
	l.Close()
	return o, err
}

// FromWire deserializes a CrossClusterApplyParentClosePolicyRequestAttributes 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 CrossClusterApplyParentClosePolicyRequestAttributes struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v CrossClusterApplyParentClosePolicyRequestAttributes
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *CrossClusterApplyParentClosePolicyRequestAttributes) FromWire(w wire.Value) error {
	var err error

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

			}
		}
	}

	return nil
}

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

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

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

func _List_ApplyParentClosePolicyRequest_Equals(lhs, rhs []*ApplyParentClosePolicyRequest) bool {
	if len(lhs) != len(rhs) {
		return false
	}

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

	return true
}

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

	return true
}

type _List_ApplyParentClosePolicyRequest_Zapper []*ApplyParentClosePolicyRequest

// MarshalLogArray implements zapcore.ArrayMarshaler, enabling
// fast logging of _List_ApplyParentClosePolicyRequest_Zapper.
func (l _List_ApplyParentClosePolicyRequest_Zapper) MarshalLogArray(enc zapcore.ArrayEncoder) (err error) {
	for _, v := range l {
		err = multierr.Append(err, enc.AppendObject(v))
	}
	return err
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of CrossClusterApplyParentClosePolicyRequestAttributes.
func (v *CrossClusterApplyParentClosePolicyRequestAttributes) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Children != nil {
		err = multierr.Append(err, enc.AddArray("children", (_List_ApplyParentClosePolicyRequest_Zapper)(v.Children)))
	}
	return err
}

// GetChildren returns the value of Children if it is set or its
// zero value if it is unset.
func (v *CrossClusterApplyParentClosePolicyRequestAttributes) GetChildren() (o []*ApplyParentClosePolicyRequest) {
	if v != nil && v.Children != nil {
		return v.Children
	}

	return
}

// IsSetChildren returns true if Children is not nil.
func (v *CrossClusterApplyParentClosePolicyRequestAttributes) IsSetChildren() bool {
	return v != nil && v.Children != nil
}

type CrossClusterApplyParentClosePolicyResponseAttributes struct {
	ChildrenStatus []*ApplyParentClosePolicyResult `json:"childrenStatus,omitempty"`
}

type _List_ApplyParentClosePolicyResult_ValueList []*ApplyParentClosePolicyResult

func (v _List_ApplyParentClosePolicyResult_ValueList) ForEach(f func(wire.Value) error) error {
	for i, x := range v {
		if x == nil {
			return fmt.Errorf("invalid [%v]: value is nil", i)
		}
		w, err := x.ToWire()
		if err != nil {
			return err
		}
		err = f(w)
		if err != nil {
			return err
		}
	}
	return nil
}

func (v _List_ApplyParentClosePolicyResult_ValueList) Size() int {
	return len(v)
}

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

func (_List_ApplyParentClosePolicyResult_ValueList) Close() {}

// ToWire translates a CrossClusterApplyParentClosePolicyResponseAttributes 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 *CrossClusterApplyParentClosePolicyResponseAttributes) ToWire() (wire.Value, error) {
	var (
		fields [1]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.ChildrenStatus != nil {
		w, err = wire.NewValueList(_List_ApplyParentClosePolicyResult_ValueList(v.ChildrenStatus)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}

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

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

func _List_ApplyParentClosePolicyResult_Read(l wire.ValueList) ([]*ApplyParentClosePolicyResult, error) {
	if l.ValueType() != wire.TStruct {
		return nil, nil
	}

	o := make([]*ApplyParentClosePolicyResult, 0, l.Size())
	err := l.ForEach(func(x wire.Value) error {
		i, err := _ApplyParentClosePolicyResult_Read(x)
		if err != nil {
			return err
		}
		o = append(o, i)
		return nil
	})
	l.Close()
	return o, err
}

// FromWire deserializes a CrossClusterApplyParentClosePolicyResponseAttributes 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 CrossClusterApplyParentClosePolicyResponseAttributes struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v CrossClusterApplyParentClosePolicyResponseAttributes
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *CrossClusterApplyParentClosePolicyResponseAttributes) FromWire(w wire.Value) error {
	var err error

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

			}
		}
	}

	return nil
}

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

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

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

func _List_ApplyParentClosePolicyResult_Equals(lhs, rhs []*ApplyParentClosePolicyResult) bool {
	if len(lhs) != len(rhs) {
		return false
	}

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

	return true
}

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

	return true
}

type _List_ApplyParentClosePolicyResult_Zapper []*ApplyParentClosePolicyResult

// MarshalLogArray implements zapcore.ArrayMarshaler, enabling
// fast logging of _List_ApplyParentClosePolicyResult_Zapper.
func (l _List_ApplyParentClosePolicyResult_Zapper) MarshalLogArray(enc zapcore.ArrayEncoder) (err error) {
	for _, v := range l {
		err = multierr.Append(err, enc.AppendObject(v))
	}
	return err
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of CrossClusterApplyParentClosePolicyResponseAttributes.
func (v *CrossClusterApplyParentClosePolicyResponseAttributes) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.ChildrenStatus != nil {
		err = multierr.Append(err, enc.AddArray("childrenStatus", (_List_ApplyParentClosePolicyResult_Zapper)(v.ChildrenStatus)))
	}
	return err
}

// GetChildrenStatus returns the value of ChildrenStatus if it is set or its
// zero value if it is unset.
func (v *CrossClusterApplyParentClosePolicyResponseAttributes) GetChildrenStatus() (o []*ApplyParentClosePolicyResult) {
	if v != nil && v.ChildrenStatus != nil {
		return v.ChildrenStatus
	}

	return
}

// IsSetChildrenStatus returns true if ChildrenStatus is not nil.
func (v *CrossClusterApplyParentClosePolicyResponseAttributes) IsSetChildrenStatus() bool {
	return v != nil && v.ChildrenStatus != nil
}

type CrossClusterCancelExecutionRequestAttributes struct {
	TargetDomainID    *string `json:"targetDomainID,omitempty"`
	TargetWorkflowID  *string `json:"targetWorkflowID,omitempty"`
	TargetRunID       *string `json:"targetRunID,omitempty"`
	RequestID         *string `json:"requestID,omitempty"`
	InitiatedEventID  *int64  `json:"initiatedEventID,omitempty"`
	ChildWorkflowOnly *bool   `json:"childWorkflowOnly,omitempty"`
}

// ToWire translates a CrossClusterCancelExecutionRequestAttributes 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 *CrossClusterCancelExecutionRequestAttributes) ToWire() (wire.Value, error) {
	var (
		fields [6]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.TargetDomainID != nil {
		w, err = wire.NewValueString(*(v.TargetDomainID)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.TargetWorkflowID != nil {
		w, err = wire.NewValueString(*(v.TargetWorkflowID)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.TargetRunID != nil {
		w, err = wire.NewValueString(*(v.TargetRunID)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.RequestID != nil {
		w, err = wire.NewValueString(*(v.RequestID)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 40, Value: w}
		i++
	}
	if v.InitiatedEventID != nil {
		w, err = wire.NewValueI64(*(v.InitiatedEventID)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 50, Value: w}
		i++
	}
	if v.ChildWorkflowOnly != nil {
		w, err = wire.NewValueBool(*(v.ChildWorkflowOnly)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 60, Value: w}
		i++
	}

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

// FromWire deserializes a CrossClusterCancelExecutionRequestAttributes 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 CrossClusterCancelExecutionRequestAttributes struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v CrossClusterCancelExecutionRequestAttributes
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *CrossClusterCancelExecutionRequestAttributes) 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.TargetDomainID = &x
				if err != nil {
					return err
				}

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

			}
		case 30:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.TargetRunID = &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.RequestID = &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.InitiatedEventID = &x
				if err != nil {
					return err
				}

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

			}
		}
	}

	return nil
}

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

	var fields [6]string
	i := 0
	if v.TargetDomainID != nil {
		fields[i] = fmt.Sprintf("TargetDomainID: %v", *(v.TargetDomainID))
		i++
	}
	if v.TargetWorkflowID != nil {
		fields[i] = fmt.Sprintf("TargetWorkflowID: %v", *(v.TargetWorkflowID))
		i++
	}
	if v.TargetRunID != nil {
		fields[i] = fmt.Sprintf("TargetRunID: %v", *(v.TargetRunID))
		i++
	}
	if v.RequestID != nil {
		fields[i] = fmt.Sprintf("RequestID: %v", *(v.RequestID))
		i++
	}
	if v.InitiatedEventID != nil {
		fields[i] = fmt.Sprintf("InitiatedEventID: %v", *(v.InitiatedEventID))
		i++
	}
	if v.ChildWorkflowOnly != nil {
		fields[i] = fmt.Sprintf("ChildWorkflowOnly: %v", *(v.ChildWorkflowOnly))
		i++
	}

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

// Equals returns true if all the fields of this CrossClusterCancelExecutionRequestAttributes match the
// provided CrossClusterCancelExecutionRequestAttributes.
//
// This function performs a deep comparison.
func (v *CrossClusterCancelExecutionRequestAttributes) Equals(rhs *CrossClusterCancelExecutionRequestAttributes) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.TargetDomainID, rhs.TargetDomainID) {
		return false
	}
	if !_String_EqualsPtr(v.TargetWorkflowID, rhs.TargetWorkflowID) {
		return false
	}
	if !_String_EqualsPtr(v.TargetRunID, rhs.TargetRunID) {
		return false
	}
	if !_String_EqualsPtr(v.RequestID, rhs.RequestID) {
		return false
	}
	if !_I64_EqualsPtr(v.InitiatedEventID, rhs.InitiatedEventID) {
		return false
	}
	if !_Bool_EqualsPtr(v.ChildWorkflowOnly, rhs.ChildWorkflowOnly) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of CrossClusterCancelExecutionRequestAttributes.
func (v *CrossClusterCancelExecutionRequestAttributes) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.TargetDomainID != nil {
		enc.AddString("targetDomainID", *v.TargetDomainID)
	}
	if v.TargetWorkflowID != nil {
		enc.AddString("targetWorkflowID", *v.TargetWorkflowID)
	}
	if v.TargetRunID != nil {
		enc.AddString("targetRunID", *v.TargetRunID)
	}
	if v.RequestID != nil {
		enc.AddString("requestID", *v.RequestID)
	}
	if v.InitiatedEventID != nil {
		enc.AddInt64("initiatedEventID", *v.InitiatedEventID)
	}
	if v.ChildWorkflowOnly != nil {
		enc.AddBool("childWorkflowOnly", *v.ChildWorkflowOnly)
	}
	return err
}

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

	return
}

// IsSetTargetDomainID returns true if TargetDomainID is not nil.
func (v *CrossClusterCancelExecutionRequestAttributes) IsSetTargetDomainID() bool {
	return v != nil && v.TargetDomainID != nil
}

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

	return
}

// IsSetTargetWorkflowID returns true if TargetWorkflowID is not nil.
func (v *CrossClusterCancelExecutionRequestAttributes) IsSetTargetWorkflowID() bool {
	return v != nil && v.TargetWorkflowID != nil
}

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

	return
}

// IsSetTargetRunID returns true if TargetRunID is not nil.
func (v *CrossClusterCancelExecutionRequestAttributes) IsSetTargetRunID() bool {
	return v != nil && v.TargetRunID != nil
}

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

	return
}

// IsSetRequestID returns true if RequestID is not nil.
func (v *CrossClusterCancelExecutionRequestAttributes) IsSetRequestID() bool {
	return v != nil && v.RequestID != nil
}

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

	return
}

// IsSetInitiatedEventID returns true if InitiatedEventID is not nil.
func (v *CrossClusterCancelExecutionRequestAttributes) IsSetInitiatedEventID() bool {
	return v != nil && v.InitiatedEventID != nil
}

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

	return
}

// IsSetChildWorkflowOnly returns true if ChildWorkflowOnly is not nil.
func (v *CrossClusterCancelExecutionRequestAttributes) IsSetChildWorkflowOnly() bool {
	return v != nil && v.ChildWorkflowOnly != nil
}

type CrossClusterCancelExecutionResponseAttributes struct {
}

// ToWire translates a CrossClusterCancelExecutionResponseAttributes 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 *CrossClusterCancelExecutionResponseAttributes) ToWire() (wire.Value, error) {
	var (
		fields [0]wire.Field
		i      int = 0
	)

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

// FromWire deserializes a CrossClusterCancelExecutionResponseAttributes 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 CrossClusterCancelExecutionResponseAttributes struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v CrossClusterCancelExecutionResponseAttributes
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *CrossClusterCancelExecutionResponseAttributes) FromWire(w wire.Value) error {

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		}
	}

	return nil
}

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

	var fields [0]string
	i := 0

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

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

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of CrossClusterCancelExecutionResponseAttributes.
func (v *CrossClusterCancelExecutionResponseAttributes) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	return err
}

type CrossClusterRecordChildWorkflowExecutionCompleteRequestAttributes struct {
	TargetDomainID   *string       `json:"targetDomainID,omitempty"`
	TargetWorkflowID *string       `json:"targetWorkflowID,omitempty"`
	TargetRunID      *string       `json:"targetRunID,omitempty"`
	InitiatedEventID *int64        `json:"initiatedEventID,omitempty"`
	CompletionEvent  *HistoryEvent `json:"completionEvent,omitempty"`
}

// ToWire translates a CrossClusterRecordChildWorkflowExecutionCompleteRequestAttributes 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 *CrossClusterRecordChildWorkflowExecutionCompleteRequestAttributes) ToWire() (wire.Value, error) {
	var (
		fields [5]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.TargetDomainID != nil {
		w, err = wire.NewValueString(*(v.TargetDomainID)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.TargetWorkflowID != nil {
		w, err = wire.NewValueString(*(v.TargetWorkflowID)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.TargetRunID != nil {
		w, err = wire.NewValueString(*(v.TargetRunID)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.InitiatedEventID != nil {
		w, err = wire.NewValueI64(*(v.InitiatedEventID)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 40, Value: w}
		i++
	}
	if v.CompletionEvent != nil {
		w, err = v.CompletionEvent.ToWire()
		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 _HistoryEvent_Read(w wire.Value) (*HistoryEvent, error) {
	var v HistoryEvent
	err := v.FromWire(w)
	return &v, err
}

// FromWire deserializes a CrossClusterRecordChildWorkflowExecutionCompleteRequestAttributes 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 CrossClusterRecordChildWorkflowExecutionCompleteRequestAttributes struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v CrossClusterRecordChildWorkflowExecutionCompleteRequestAttributes
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *CrossClusterRecordChildWorkflowExecutionCompleteRequestAttributes) 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.TargetDomainID = &x
				if err != nil {
					return err
				}

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

			}
		case 30:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.TargetRunID = &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.InitiatedEventID = &x
				if err != nil {
					return err
				}

			}
		case 50:
			if field.Value.Type() == wire.TStruct {
				v.CompletionEvent, err = _HistoryEvent_Read(field.Value)
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

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

	var fields [5]string
	i := 0
	if v.TargetDomainID != nil {
		fields[i] = fmt.Sprintf("TargetDomainID: %v", *(v.TargetDomainID))
		i++
	}
	if v.TargetWorkflowID != nil {
		fields[i] = fmt.Sprintf("TargetWorkflowID: %v", *(v.TargetWorkflowID))
		i++
	}
	if v.TargetRunID != nil {
		fields[i] = fmt.Sprintf("TargetRunID: %v", *(v.TargetRunID))
		i++
	}
	if v.InitiatedEventID != nil {
		fields[i] = fmt.Sprintf("InitiatedEventID: %v", *(v.InitiatedEventID))
		i++
	}
	if v.CompletionEvent != nil {
		fields[i] = fmt.Sprintf("CompletionEvent: %v", v.CompletionEvent)
		i++
	}

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

// Equals returns true if all the fields of this CrossClusterRecordChildWorkflowExecutionCompleteRequestAttributes match the
// provided CrossClusterRecordChildWorkflowExecutionCompleteRequestAttributes.
//
// This function performs a deep comparison.
func (v *CrossClusterRecordChildWorkflowExecutionCompleteRequestAttributes) Equals(rhs *CrossClusterRecordChildWorkflowExecutionCompleteRequestAttributes) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.TargetDomainID, rhs.TargetDomainID) {
		return false
	}
	if !_String_EqualsPtr(v.TargetWorkflowID, rhs.TargetWorkflowID) {
		return false
	}
	if !_String_EqualsPtr(v.TargetRunID, rhs.TargetRunID) {
		return false
	}
	if !_I64_EqualsPtr(v.InitiatedEventID, rhs.InitiatedEventID) {
		return false
	}
	if !((v.CompletionEvent == nil && rhs.CompletionEvent == nil) || (v.CompletionEvent != nil && rhs.CompletionEvent != nil && v.CompletionEvent.Equals(rhs.CompletionEvent))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of CrossClusterRecordChildWorkflowExecutionCompleteRequestAttributes.
func (v *CrossClusterRecordChildWorkflowExecutionCompleteRequestAttributes) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.TargetDomainID != nil {
		enc.AddString("targetDomainID", *v.TargetDomainID)
	}
	if v.TargetWorkflowID != nil {
		enc.AddString("targetWorkflowID", *v.TargetWorkflowID)
	}
	if v.TargetRunID != nil {
		enc.AddString("targetRunID", *v.TargetRunID)
	}
	if v.InitiatedEventID != nil {
		enc.AddInt64("initiatedEventID", *v.InitiatedEventID)
	}
	if v.CompletionEvent != nil {
		err = multierr.Append(err, enc.AddObject("completionEvent", v.CompletionEvent))
	}
	return err
}

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

	return
}

// IsSetTargetDomainID returns true if TargetDomainID is not nil.
func (v *CrossClusterRecordChildWorkflowExecutionCompleteRequestAttributes) IsSetTargetDomainID() bool {
	return v != nil && v.TargetDomainID != nil
}

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

	return
}

// IsSetTargetWorkflowID returns true if TargetWorkflowID is not nil.
func (v *CrossClusterRecordChildWorkflowExecutionCompleteRequestAttributes) IsSetTargetWorkflowID() bool {
	return v != nil && v.TargetWorkflowID != nil
}

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

	return
}

// IsSetTargetRunID returns true if TargetRunID is not nil.
func (v *CrossClusterRecordChildWorkflowExecutionCompleteRequestAttributes) IsSetTargetRunID() bool {
	return v != nil && v.TargetRunID != nil
}

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

	return
}

// IsSetInitiatedEventID returns true if InitiatedEventID is not nil.
func (v *CrossClusterRecordChildWorkflowExecutionCompleteRequestAttributes) IsSetInitiatedEventID() bool {
	return v != nil && v.InitiatedEventID != nil
}

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

	return
}

// IsSetCompletionEvent returns true if CompletionEvent is not nil.
func (v *CrossClusterRecordChildWorkflowExecutionCompleteRequestAttributes) IsSetCompletionEvent() bool {
	return v != nil && v.CompletionEvent != nil
}

type CrossClusterRecordChildWorkflowExecutionCompleteResponseAttributes struct {
}

// ToWire translates a CrossClusterRecordChildWorkflowExecutionCompleteResponseAttributes 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 *CrossClusterRecordChildWorkflowExecutionCompleteResponseAttributes) ToWire() (wire.Value, error) {
	var (
		fields [0]wire.Field
		i      int = 0
	)

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

// FromWire deserializes a CrossClusterRecordChildWorkflowExecutionCompleteResponseAttributes 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 CrossClusterRecordChildWorkflowExecutionCompleteResponseAttributes struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v CrossClusterRecordChildWorkflowExecutionCompleteResponseAttributes
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *CrossClusterRecordChildWorkflowExecutionCompleteResponseAttributes) FromWire(w wire.Value) error {

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		}
	}

	return nil
}

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

	var fields [0]string
	i := 0

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

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

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of CrossClusterRecordChildWorkflowExecutionCompleteResponseAttributes.
func (v *CrossClusterRecordChildWorkflowExecutionCompleteResponseAttributes) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	return err
}

type CrossClusterSignalExecutionRequestAttributes struct {
	TargetDomainID    *string `json:"targetDomainID,omitempty"`
	TargetWorkflowID  *string `json:"targetWorkflowID,omitempty"`
	TargetRunID       *string `json:"targetRunID,omitempty"`
	RequestID         *string `json:"requestID,omitempty"`
	InitiatedEventID  *int64  `json:"initiatedEventID,omitempty"`
	ChildWorkflowOnly *bool   `json:"childWorkflowOnly,omitempty"`
	SignalName        *string `json:"signalName,omitempty"`
	SignalInput       []byte  `json:"signalInput,omitempty"`
	Control           []byte  `json:"control,omitempty"`
}

// ToWire translates a CrossClusterSignalExecutionRequestAttributes 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 *CrossClusterSignalExecutionRequestAttributes) ToWire() (wire.Value, error) {
	var (
		fields [9]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.TargetDomainID != nil {
		w, err = wire.NewValueString(*(v.TargetDomainID)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.TargetWorkflowID != nil {
		w, err = wire.NewValueString(*(v.TargetWorkflowID)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.TargetRunID != nil {
		w, err = wire.NewValueString(*(v.TargetRunID)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.RequestID != nil {
		w, err = wire.NewValueString(*(v.RequestID)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 40, Value: w}
		i++
	}
	if v.InitiatedEventID != nil {
		w, err = wire.NewValueI64(*(v.InitiatedEventID)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 50, Value: w}
		i++
	}
	if v.ChildWorkflowOnly != nil {
		w, err = wire.NewValueBool(*(v.ChildWorkflowOnly)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 60, Value: w}
		i++
	}
	if v.SignalName != nil {
		w, err = wire.NewValueString(*(v.SignalName)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 70, Value: w}
		i++
	}
	if v.SignalInput != nil {
		w, err = wire.NewValueBinary(v.SignalInput), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 80, Value: w}
		i++
	}
	if v.Control != nil {
		w, err = wire.NewValueBinary(v.Control), 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
}

// FromWire deserializes a CrossClusterSignalExecutionRequestAttributes 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 CrossClusterSignalExecutionRequestAttributes struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v CrossClusterSignalExecutionRequestAttributes
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *CrossClusterSignalExecutionRequestAttributes) 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.TargetDomainID = &x
				if err != nil {
					return err
				}

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

			}
		case 30:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.TargetRunID = &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.RequestID = &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.InitiatedEventID = &x
				if err != nil {
					return err
				}

			}
		case 60:
			if field.Value.Type() == wire.TBool {
				var x bool
				x, err = field.Value.GetBool(), error(nil)
				v.ChildWorkflowOnly = &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.SignalName = &x
				if err != nil {
					return err
				}

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

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

			}
		}
	}

	return nil
}

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

	var fields [9]string
	i := 0
	if v.TargetDomainID != nil {
		fields[i] = fmt.Sprintf("TargetDomainID: %v", *(v.TargetDomainID))
		i++
	}
	if v.TargetWorkflowID != nil {
		fields[i] = fmt.Sprintf("TargetWorkflowID: %v", *(v.TargetWorkflowID))
		i++
	}
	if v.TargetRunID != nil {
		fields[i] = fmt.Sprintf("TargetRunID: %v", *(v.TargetRunID))
		i++
	}
	if v.RequestID != nil {
		fields[i] = fmt.Sprintf("RequestID: %v", *(v.RequestID))
		i++
	}
	if v.InitiatedEventID != nil {
		fields[i] = fmt.Sprintf("InitiatedEventID: %v", *(v.InitiatedEventID))
		i++
	}
	if v.ChildWorkflowOnly != nil {
		fields[i] = fmt.Sprintf("ChildWorkflowOnly: %v", *(v.ChildWorkflowOnly))
		i++
	}
	if v.SignalName != nil {
		fields[i] = fmt.Sprintf("SignalName: %v", *(v.SignalName))
		i++
	}
	if v.SignalInput != nil {
		fields[i] = fmt.Sprintf("SignalInput: %v", v.SignalInput)
		i++
	}
	if v.Control != nil {
		fields[i] = fmt.Sprintf("Control: %v", v.Control)
		i++
	}

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

// Equals returns true if all the fields of this CrossClusterSignalExecutionRequestAttributes match the
// provided CrossClusterSignalExecutionRequestAttributes.
//
// This function performs a deep comparison.
func (v *CrossClusterSignalExecutionRequestAttributes) Equals(rhs *CrossClusterSignalExecutionRequestAttributes) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.TargetDomainID, rhs.TargetDomainID) {
		return false
	}
	if !_String_EqualsPtr(v.TargetWorkflowID, rhs.TargetWorkflowID) {
		return false
	}
	if !_String_EqualsPtr(v.TargetRunID, rhs.TargetRunID) {
		return false
	}
	if !_String_EqualsPtr(v.RequestID, rhs.RequestID) {
		return false
	}
	if !_I64_EqualsPtr(v.InitiatedEventID, rhs.InitiatedEventID) {
		return false
	}
	if !_Bool_EqualsPtr(v.ChildWorkflowOnly, rhs.ChildWorkflowOnly) {
		return false
	}
	if !_String_EqualsPtr(v.SignalName, rhs.SignalName) {
		return false
	}
	if !((v.SignalInput == nil && rhs.SignalInput == nil) || (v.SignalInput != nil && rhs.SignalInput != nil && bytes.Equal(v.SignalInput, rhs.SignalInput))) {
		return false
	}
	if !((v.Control == nil && rhs.Control == nil) || (v.Control != nil && rhs.Control != nil && bytes.Equal(v.Control, rhs.Control))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of CrossClusterSignalExecutionRequestAttributes.
func (v *CrossClusterSignalExecutionRequestAttributes) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.TargetDomainID != nil {
		enc.AddString("targetDomainID", *v.TargetDomainID)
	}
	if v.TargetWorkflowID != nil {
		enc.AddString("targetWorkflowID", *v.TargetWorkflowID)
	}
	if v.TargetRunID != nil {
		enc.AddString("targetRunID", *v.TargetRunID)
	}
	if v.RequestID != nil {
		enc.AddString("requestID", *v.RequestID)
	}
	if v.InitiatedEventID != nil {
		enc.AddInt64("initiatedEventID", *v.InitiatedEventID)
	}
	if v.ChildWorkflowOnly != nil {
		enc.AddBool("childWorkflowOnly", *v.ChildWorkflowOnly)
	}
	if v.SignalName != nil {
		enc.AddString("signalName", *v.SignalName)
	}
	if v.SignalInput != nil {
		enc.AddString("signalInput", base64.StdEncoding.EncodeToString(v.SignalInput))
	}
	if v.Control != nil {
		enc.AddString("control", base64.StdEncoding.EncodeToString(v.Control))
	}
	return err
}

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

	return
}

// IsSetTargetDomainID returns true if TargetDomainID is not nil.
func (v *CrossClusterSignalExecutionRequestAttributes) IsSetTargetDomainID() bool {
	return v != nil && v.TargetDomainID != nil
}

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

	return
}

// IsSetTargetWorkflowID returns true if TargetWorkflowID is not nil.
func (v *CrossClusterSignalExecutionRequestAttributes) IsSetTargetWorkflowID() bool {
	return v != nil && v.TargetWorkflowID != nil
}

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

	return
}

// IsSetTargetRunID returns true if TargetRunID is not nil.
func (v *CrossClusterSignalExecutionRequestAttributes) IsSetTargetRunID() bool {
	return v != nil && v.TargetRunID != nil
}

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

	return
}

// IsSetRequestID returns true if RequestID is not nil.
func (v *CrossClusterSignalExecutionRequestAttributes) IsSetRequestID() bool {
	return v != nil && v.RequestID != nil
}

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

	return
}

// IsSetInitiatedEventID returns true if InitiatedEventID is not nil.
func (v *CrossClusterSignalExecutionRequestAttributes) IsSetInitiatedEventID() bool {
	return v != nil && v.InitiatedEventID != nil
}

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

	return
}

// IsSetChildWorkflowOnly returns true if ChildWorkflowOnly is not nil.
func (v *CrossClusterSignalExecutionRequestAttributes) IsSetChildWorkflowOnly() bool {
	return v != nil && v.ChildWorkflowOnly != nil
}

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

	return
}

// IsSetSignalName returns true if SignalName is not nil.
func (v *CrossClusterSignalExecutionRequestAttributes) IsSetSignalName() bool {
	return v != nil && v.SignalName != nil
}

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

	return
}

// IsSetSignalInput returns true if SignalInput is not nil.
func (v *CrossClusterSignalExecutionRequestAttributes) IsSetSignalInput() bool {
	return v != nil && v.SignalInput != nil
}

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

	return
}

// IsSetControl returns true if Control is not nil.
func (v *CrossClusterSignalExecutionRequestAttributes) IsSetControl() bool {
	return v != nil && v.Control != nil
}

type CrossClusterSignalExecutionResponseAttributes struct {
}

// ToWire translates a CrossClusterSignalExecutionResponseAttributes 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 *CrossClusterSignalExecutionResponseAttributes) ToWire() (wire.Value, error) {
	var (
		fields [0]wire.Field
		i      int = 0
	)

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

// FromWire deserializes a CrossClusterSignalExecutionResponseAttributes 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 CrossClusterSignalExecutionResponseAttributes struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v CrossClusterSignalExecutionResponseAttributes
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *CrossClusterSignalExecutionResponseAttributes) FromWire(w wire.Value) error {

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		}
	}

	return nil
}

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

	var fields [0]string
	i := 0

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

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

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of CrossClusterSignalExecutionResponseAttributes.
func (v *CrossClusterSignalExecutionResponseAttributes) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	return err
}

type CrossClusterStartChildExecutionRequestAttributes struct {
	TargetDomainID           *string                                              `json:"targetDomainID,omitempty"`
	RequestID                *string                                              `json:"requestID,omitempty"`
	InitiatedEventID         *int64                                               `json:"initiatedEventID,omitempty"`
	InitiatedEventAttributes *StartChildWorkflowExecutionInitiatedEventAttributes `json:"initiatedEventAttributes,omitempty"`
	TargetRunID              *string                                              `json:"targetRunID,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 CrossClusterStartChildExecutionRequestAttributes 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 *CrossClusterStartChildExecutionRequestAttributes) ToWire() (wire.Value, error) {
	var (
		fields [6]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.TargetDomainID != nil {
		w, err = wire.NewValueString(*(v.TargetDomainID)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.RequestID != nil {
		w, err = wire.NewValueString(*(v.RequestID)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.InitiatedEventID != nil {
		w, err = wire.NewValueI64(*(v.InitiatedEventID)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.InitiatedEventAttributes != nil {
		w, err = v.InitiatedEventAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 40, Value: w}
		i++
	}
	if v.TargetRunID != nil {
		w, err = wire.NewValueString(*(v.TargetRunID)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 50, 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: 60, Value: w}
		i++
	}

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

func _StartChildWorkflowExecutionInitiatedEventAttributes_Read(w wire.Value) (*StartChildWorkflowExecutionInitiatedEventAttributes, error) {
	var v StartChildWorkflowExecutionInitiatedEventAttributes
	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 CrossClusterStartChildExecutionRequestAttributes 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 CrossClusterStartChildExecutionRequestAttributes struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v CrossClusterStartChildExecutionRequestAttributes
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *CrossClusterStartChildExecutionRequestAttributes) 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.TargetDomainID = &x
				if err != nil {
					return err
				}

			}
		case 20:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.RequestID = &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.InitiatedEventID = &x
				if err != nil {
					return err
				}

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

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

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

			}
		}
	}

	return nil
}

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

	var fields [6]string
	i := 0
	if v.TargetDomainID != nil {
		fields[i] = fmt.Sprintf("TargetDomainID: %v", *(v.TargetDomainID))
		i++
	}
	if v.RequestID != nil {
		fields[i] = fmt.Sprintf("RequestID: %v", *(v.RequestID))
		i++
	}
	if v.InitiatedEventID != nil {
		fields[i] = fmt.Sprintf("InitiatedEventID: %v", *(v.InitiatedEventID))
		i++
	}
	if v.InitiatedEventAttributes != nil {
		fields[i] = fmt.Sprintf("InitiatedEventAttributes: %v", v.InitiatedEventAttributes)
		i++
	}
	if v.TargetRunID != nil {
		fields[i] = fmt.Sprintf("TargetRunID: %v", *(v.TargetRunID))
		i++
	}
	if v.PartitionConfig != nil {
		fields[i] = fmt.Sprintf("PartitionConfig: %v", v.PartitionConfig)
		i++
	}

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

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 CrossClusterStartChildExecutionRequestAttributes match the
// provided CrossClusterStartChildExecutionRequestAttributes.
//
// This function performs a deep comparison.
func (v *CrossClusterStartChildExecutionRequestAttributes) Equals(rhs *CrossClusterStartChildExecutionRequestAttributes) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.TargetDomainID, rhs.TargetDomainID) {
		return false
	}
	if !_String_EqualsPtr(v.RequestID, rhs.RequestID) {
		return false
	}
	if !_I64_EqualsPtr(v.InitiatedEventID, rhs.InitiatedEventID) {
		return false
	}
	if !((v.InitiatedEventAttributes == nil && rhs.InitiatedEventAttributes == nil) || (v.InitiatedEventAttributes != nil && rhs.InitiatedEventAttributes != nil && v.InitiatedEventAttributes.Equals(rhs.InitiatedEventAttributes))) {
		return false
	}
	if !_String_EqualsPtr(v.TargetRunID, rhs.TargetRunID) {
		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 CrossClusterStartChildExecutionRequestAttributes.
func (v *CrossClusterStartChildExecutionRequestAttributes) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.TargetDomainID != nil {
		enc.AddString("targetDomainID", *v.TargetDomainID)
	}
	if v.RequestID != nil {
		enc.AddString("requestID", *v.RequestID)
	}
	if v.InitiatedEventID != nil {
		enc.AddInt64("initiatedEventID", *v.InitiatedEventID)
	}
	if v.InitiatedEventAttributes != nil {
		err = multierr.Append(err, enc.AddObject("initiatedEventAttributes", v.InitiatedEventAttributes))
	}
	if v.TargetRunID != nil {
		enc.AddString("targetRunID", *v.TargetRunID)
	}
	if v.PartitionConfig != nil {
		err = multierr.Append(err, enc.AddObject("partitionConfig", (_Map_String_String_Zapper)(v.PartitionConfig)))
	}
	return err
}

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

	return
}

// IsSetTargetDomainID returns true if TargetDomainID is not nil.
func (v *CrossClusterStartChildExecutionRequestAttributes) IsSetTargetDomainID() bool {
	return v != nil && v.TargetDomainID != nil
}

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

	return
}

// IsSetRequestID returns true if RequestID is not nil.
func (v *CrossClusterStartChildExecutionRequestAttributes) IsSetRequestID() bool {
	return v != nil && v.RequestID != nil
}

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

	return
}

// IsSetInitiatedEventID returns true if InitiatedEventID is not nil.
func (v *CrossClusterStartChildExecutionRequestAttributes) IsSetInitiatedEventID() bool {
	return v != nil && v.InitiatedEventID != nil
}

// GetInitiatedEventAttributes returns the value of InitiatedEventAttributes if it is set or its
// zero value if it is unset.
func (v *CrossClusterStartChildExecutionRequestAttributes) GetInitiatedEventAttributes() (o *StartChildWorkflowExecutionInitiatedEventAttributes) {
	if v != nil && v.InitiatedEventAttributes != nil {
		return v.InitiatedEventAttributes
	}

	return
}

// IsSetInitiatedEventAttributes returns true if InitiatedEventAttributes is not nil.
func (v *CrossClusterStartChildExecutionRequestAttributes) IsSetInitiatedEventAttributes() bool {
	return v != nil && v.InitiatedEventAttributes != nil
}

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

	return
}

// IsSetTargetRunID returns true if TargetRunID is not nil.
func (v *CrossClusterStartChildExecutionRequestAttributes) IsSetTargetRunID() bool {
	return v != nil && v.TargetRunID != nil
}

// GetPartitionConfig returns the value of PartitionConfig if it is set or its
// zero value if it is unset.
func (v *CrossClusterStartChildExecutionRequestAttributes) 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 *CrossClusterStartChildExecutionRequestAttributes) IsSetPartitionConfig() bool {
	return v != nil && v.PartitionConfig != nil
}

type CrossClusterStartChildExecutionResponseAttributes struct {
	RunID *string `json:"runID,omitempty"`
}

// ToWire translates a CrossClusterStartChildExecutionResponseAttributes 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 *CrossClusterStartChildExecutionResponseAttributes) ToWire() (wire.Value, error) {
	var (
		fields [1]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

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

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

// FromWire deserializes a CrossClusterStartChildExecutionResponseAttributes 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 CrossClusterStartChildExecutionResponseAttributes struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v CrossClusterStartChildExecutionResponseAttributes
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *CrossClusterStartChildExecutionResponseAttributes) 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.RunID = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

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

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

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

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

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of CrossClusterStartChildExecutionResponseAttributes.
func (v *CrossClusterStartChildExecutionResponseAttributes) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.RunID != nil {
		enc.AddString("runID", *v.RunID)
	}
	return err
}

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

	return
}

// IsSetRunID returns true if RunID is not nil.
func (v *CrossClusterStartChildExecutionResponseAttributes) IsSetRunID() bool {
	return v != nil && v.RunID != nil
}

type CrossClusterTaskFailedCause int32

const (
	CrossClusterTaskFailedCauseDomainNotActive          CrossClusterTaskFailedCause = 0
	CrossClusterTaskFailedCauseDomainNotExists          CrossClusterTaskFailedCause = 1
	CrossClusterTaskFailedCauseWorkflowAlreadyRunning   CrossClusterTaskFailedCause = 2
	CrossClusterTaskFailedCauseWorkflowNotExists        CrossClusterTaskFailedCause = 3
	CrossClusterTaskFailedCauseWorkflowAlreadyCompleted CrossClusterTaskFailedCause = 4
	CrossClusterTaskFailedCauseUncategorized            CrossClusterTaskFailedCause = 5
)

// CrossClusterTaskFailedCause_Values returns all recognized values of CrossClusterTaskFailedCause.
func CrossClusterTaskFailedCause_Values() []CrossClusterTaskFailedCause {
	return []CrossClusterTaskFailedCause{
		CrossClusterTaskFailedCauseDomainNotActive,
		CrossClusterTaskFailedCauseDomainNotExists,
		CrossClusterTaskFailedCauseWorkflowAlreadyRunning,
		CrossClusterTaskFailedCauseWorkflowNotExists,
		CrossClusterTaskFailedCauseWorkflowAlreadyCompleted,
		CrossClusterTaskFailedCauseUncategorized,
	}
}

// UnmarshalText tries to decode CrossClusterTaskFailedCause from a byte slice
// containing its name.
//
//	var v CrossClusterTaskFailedCause
//	err := v.UnmarshalText([]byte("DOMAIN_NOT_ACTIVE"))
func (v *CrossClusterTaskFailedCause) UnmarshalText(value []byte) error {
	switch s := string(value); s {
	case "DOMAIN_NOT_ACTIVE":
		*v = CrossClusterTaskFailedCauseDomainNotActive
		return nil
	case "DOMAIN_NOT_EXISTS":
		*v = CrossClusterTaskFailedCauseDomainNotExists
		return nil
	case "WORKFLOW_ALREADY_RUNNING":
		*v = CrossClusterTaskFailedCauseWorkflowAlreadyRunning
		return nil
	case "WORKFLOW_NOT_EXISTS":
		*v = CrossClusterTaskFailedCauseWorkflowNotExists
		return nil
	case "WORKFLOW_ALREADY_COMPLETED":
		*v = CrossClusterTaskFailedCauseWorkflowAlreadyCompleted
		return nil
	case "UNCATEGORIZED":
		*v = CrossClusterTaskFailedCauseUncategorized
		return nil
	default:
		val, err := strconv.ParseInt(s, 10, 32)
		if err != nil {
			return fmt.Errorf("unknown enum value %q for %q: %v", s, "CrossClusterTaskFailedCause", err)
		}
		*v = CrossClusterTaskFailedCause(val)
		return nil
	}
}

// MarshalText encodes CrossClusterTaskFailedCause 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 CrossClusterTaskFailedCause) MarshalText() ([]byte, error) {
	switch int32(v) {
	case 0:
		return []byte("DOMAIN_NOT_ACTIVE"), nil
	case 1:
		return []byte("DOMAIN_NOT_EXISTS"), nil
	case 2:
		return []byte("WORKFLOW_ALREADY_RUNNING"), nil
	case 3:
		return []byte("WORKFLOW_NOT_EXISTS"), nil
	case 4:
		return []byte("WORKFLOW_ALREADY_COMPLETED"), nil
	case 5:
		return []byte("UNCATEGORIZED"), nil
	}
	return []byte(strconv.FormatInt(int64(v), 10)), nil
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of CrossClusterTaskFailedCause.
// 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 CrossClusterTaskFailedCause) MarshalLogObject(enc zapcore.ObjectEncoder) error {
	enc.AddInt32("value", int32(v))
	switch int32(v) {
	case 0:
		enc.AddString("name", "DOMAIN_NOT_ACTIVE")
	case 1:
		enc.AddString("name", "DOMAIN_NOT_EXISTS")
	case 2:
		enc.AddString("name", "WORKFLOW_ALREADY_RUNNING")
	case 3:
		enc.AddString("name", "WORKFLOW_NOT_EXISTS")
	case 4:
		enc.AddString("name", "WORKFLOW_ALREADY_COMPLETED")
	case 5:
		enc.AddString("name", "UNCATEGORIZED")
	}
	return nil
}

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

// ToWire translates CrossClusterTaskFailedCause 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 CrossClusterTaskFailedCause) ToWire() (wire.Value, error) {
	return wire.NewValueI32(int32(v)), nil
}

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

// String returns a readable string representation of CrossClusterTaskFailedCause.
func (v CrossClusterTaskFailedCause) String() string {
	w := int32(v)
	switch w {
	case 0:
		return "DOMAIN_NOT_ACTIVE"
	case 1:
		return "DOMAIN_NOT_EXISTS"
	case 2:
		return "WORKFLOW_ALREADY_RUNNING"
	case 3:
		return "WORKFLOW_NOT_EXISTS"
	case 4:
		return "WORKFLOW_ALREADY_COMPLETED"
	case 5:
		return "UNCATEGORIZED"
	}
	return fmt.Sprintf("CrossClusterTaskFailedCause(%d)", w)
}

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

// MarshalJSON serializes CrossClusterTaskFailedCause into JSON.
//
// If the enum value is recognized, its name is returned. Otherwise,
// its integer value is returned.
//
// This implements json.Marshaler.
func (v CrossClusterTaskFailedCause) MarshalJSON() ([]byte, error) {
	switch int32(v) {
	case 0:
		return ([]byte)("\"DOMAIN_NOT_ACTIVE\""), nil
	case 1:
		return ([]byte)("\"DOMAIN_NOT_EXISTS\""), nil
	case 2:
		return ([]byte)("\"WORKFLOW_ALREADY_RUNNING\""), nil
	case 3:
		return ([]byte)("\"WORKFLOW_NOT_EXISTS\""), nil
	case 4:
		return ([]byte)("\"WORKFLOW_ALREADY_COMPLETED\""), nil
	case 5:
		return ([]byte)("\"UNCATEGORIZED\""), nil
	}
	return ([]byte)(strconv.FormatInt(int64(v), 10)), nil
}

// UnmarshalJSON attempts to decode CrossClusterTaskFailedCause 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 *CrossClusterTaskFailedCause) 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, "CrossClusterTaskFailedCause")
		}
		if x < math.MinInt32 {
			return fmt.Errorf("enum underflow from JSON %q for %q", text, "CrossClusterTaskFailedCause")
		}
		*v = (CrossClusterTaskFailedCause)(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, "CrossClusterTaskFailedCause")
	}
}

type CrossClusterTaskInfo struct {
	DomainID            *string               `json:"domainID,omitempty"`
	WorkflowID          *string               `json:"workflowID,omitempty"`
	RunID               *string               `json:"runID,omitempty"`
	TaskType            *CrossClusterTaskType `json:"taskType,omitempty"`
	TaskState           *int16                `json:"taskState,omitempty"`
	TaskID              *int64                `json:"taskID,omitempty"`
	VisibilityTimestamp *int64                `json:"visibilityTimestamp,omitempty"`
}

// ToWire translates a CrossClusterTaskInfo 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 *CrossClusterTaskInfo) ToWire() (wire.Value, error) {
	var (
		fields [7]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.DomainID != nil {
		w, err = wire.NewValueString(*(v.DomainID)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.WorkflowID != nil {
		w, err = wire.NewValueString(*(v.WorkflowID)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.RunID != nil {
		w, err = wire.NewValueString(*(v.RunID)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.TaskType != nil {
		w, err = v.TaskType.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 40, Value: w}
		i++
	}
	if v.TaskState != nil {
		w, err = wire.NewValueI16(*(v.TaskState)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 50, Value: w}
		i++
	}
	if v.TaskID != nil {
		w, err = wire.NewValueI64(*(v.TaskID)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 60, Value: w}
		i++
	}
	if v.VisibilityTimestamp != nil {
		w, err = wire.NewValueI64(*(v.VisibilityTimestamp)), 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
}

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

// FromWire deserializes a CrossClusterTaskInfo 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 CrossClusterTaskInfo struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v CrossClusterTaskInfo
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *CrossClusterTaskInfo) 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.DomainID = &x
				if err != nil {
					return err
				}

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

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

			}
		case 40:
			if field.Value.Type() == wire.TI32 {
				var x CrossClusterTaskType
				x, err = _CrossClusterTaskType_Read(field.Value)
				v.TaskType = &x
				if err != nil {
					return err
				}

			}
		case 50:
			if field.Value.Type() == wire.TI16 {
				var x int16
				x, err = field.Value.GetI16(), error(nil)
				v.TaskState = &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.TaskID = &x
				if err != nil {
					return err
				}

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

			}
		}
	}

	return nil
}

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

	var fields [7]string
	i := 0
	if v.DomainID != nil {
		fields[i] = fmt.Sprintf("DomainID: %v", *(v.DomainID))
		i++
	}
	if v.WorkflowID != nil {
		fields[i] = fmt.Sprintf("WorkflowID: %v", *(v.WorkflowID))
		i++
	}
	if v.RunID != nil {
		fields[i] = fmt.Sprintf("RunID: %v", *(v.RunID))
		i++
	}
	if v.TaskType != nil {
		fields[i] = fmt.Sprintf("TaskType: %v", *(v.TaskType))
		i++
	}
	if v.TaskState != nil {
		fields[i] = fmt.Sprintf("TaskState: %v", *(v.TaskState))
		i++
	}
	if v.TaskID != nil {
		fields[i] = fmt.Sprintf("TaskID: %v", *(v.TaskID))
		i++
	}
	if v.VisibilityTimestamp != nil {
		fields[i] = fmt.Sprintf("VisibilityTimestamp: %v", *(v.VisibilityTimestamp))
		i++
	}

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

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

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

func _I16_EqualsPtr(lhs, rhs *int16) 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 CrossClusterTaskInfo match the
// provided CrossClusterTaskInfo.
//
// This function performs a deep comparison.
func (v *CrossClusterTaskInfo) Equals(rhs *CrossClusterTaskInfo) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.DomainID, rhs.DomainID) {
		return false
	}
	if !_String_EqualsPtr(v.WorkflowID, rhs.WorkflowID) {
		return false
	}
	if !_String_EqualsPtr(v.RunID, rhs.RunID) {
		return false
	}
	if !_CrossClusterTaskType_EqualsPtr(v.TaskType, rhs.TaskType) {
		return false
	}
	if !_I16_EqualsPtr(v.TaskState, rhs.TaskState) {
		return false
	}
	if !_I64_EqualsPtr(v.TaskID, rhs.TaskID) {
		return false
	}
	if !_I64_EqualsPtr(v.VisibilityTimestamp, rhs.VisibilityTimestamp) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of CrossClusterTaskInfo.
func (v *CrossClusterTaskInfo) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.DomainID != nil {
		enc.AddString("domainID", *v.DomainID)
	}
	if v.WorkflowID != nil {
		enc.AddString("workflowID", *v.WorkflowID)
	}
	if v.RunID != nil {
		enc.AddString("runID", *v.RunID)
	}
	if v.TaskType != nil {
		err = multierr.Append(err, enc.AddObject("taskType", *v.TaskType))
	}
	if v.TaskState != nil {
		enc.AddInt16("taskState", *v.TaskState)
	}
	if v.TaskID != nil {
		enc.AddInt64("taskID", *v.TaskID)
	}
	if v.VisibilityTimestamp != nil {
		enc.AddInt64("visibilityTimestamp", *v.VisibilityTimestamp)
	}
	return err
}

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

	return
}

// IsSetDomainID returns true if DomainID is not nil.
func (v *CrossClusterTaskInfo) IsSetDomainID() bool {
	return v != nil && v.DomainID != nil
}

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

	return
}

// IsSetWorkflowID returns true if WorkflowID is not nil.
func (v *CrossClusterTaskInfo) IsSetWorkflowID() bool {
	return v != nil && v.WorkflowID != nil
}

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

	return
}

// IsSetRunID returns true if RunID is not nil.
func (v *CrossClusterTaskInfo) IsSetRunID() bool {
	return v != nil && v.RunID != nil
}

// GetTaskType returns the value of TaskType if it is set or its
// zero value if it is unset.
func (v *CrossClusterTaskInfo) GetTaskType() (o CrossClusterTaskType) {
	if v != nil && v.TaskType != nil {
		return *v.TaskType
	}

	return
}

// IsSetTaskType returns true if TaskType is not nil.
func (v *CrossClusterTaskInfo) IsSetTaskType() bool {
	return v != nil && v.TaskType != nil
}

// GetTaskState returns the value of TaskState if it is set or its
// zero value if it is unset.
func (v *CrossClusterTaskInfo) GetTaskState() (o int16) {
	if v != nil && v.TaskState != nil {
		return *v.TaskState
	}

	return
}

// IsSetTaskState returns true if TaskState is not nil.
func (v *CrossClusterTaskInfo) IsSetTaskState() bool {
	return v != nil && v.TaskState != nil
}

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

	return
}

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

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

	return
}

// IsSetVisibilityTimestamp returns true if VisibilityTimestamp is not nil.
func (v *CrossClusterTaskInfo) IsSetVisibilityTimestamp() bool {
	return v != nil && v.VisibilityTimestamp != nil
}

type CrossClusterTaskRequest struct {
	TaskInfo                                       *CrossClusterTaskInfo                                              `json:"taskInfo,omitempty"`
	StartChildExecutionAttributes                  *CrossClusterStartChildExecutionRequestAttributes                  `json:"startChildExecutionAttributes,omitempty"`
	CancelExecutionAttributes                      *CrossClusterCancelExecutionRequestAttributes                      `json:"cancelExecutionAttributes,omitempty"`
	SignalExecutionAttributes                      *CrossClusterSignalExecutionRequestAttributes                      `json:"signalExecutionAttributes,omitempty"`
	RecordChildWorkflowExecutionCompleteAttributes *CrossClusterRecordChildWorkflowExecutionCompleteRequestAttributes `json:"recordChildWorkflowExecutionCompleteAttributes,omitempty"`
	ApplyParentClosePolicyAttributes               *CrossClusterApplyParentClosePolicyRequestAttributes               `json:"applyParentClosePolicyAttributes,omitempty"`
}

// ToWire translates a CrossClusterTaskRequest 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 *CrossClusterTaskRequest) ToWire() (wire.Value, error) {
	var (
		fields [6]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.TaskInfo != nil {
		w, err = v.TaskInfo.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.StartChildExecutionAttributes != nil {
		w, err = v.StartChildExecutionAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.CancelExecutionAttributes != nil {
		w, err = v.CancelExecutionAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.SignalExecutionAttributes != nil {
		w, err = v.SignalExecutionAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 40, Value: w}
		i++
	}
	if v.RecordChildWorkflowExecutionCompleteAttributes != nil {
		w, err = v.RecordChildWorkflowExecutionCompleteAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 50, Value: w}
		i++
	}
	if v.ApplyParentClosePolicyAttributes != nil {
		w, err = v.ApplyParentClosePolicyAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 60, Value: w}
		i++
	}

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

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

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

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

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

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

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

// FromWire deserializes a CrossClusterTaskRequest 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 CrossClusterTaskRequest struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v CrossClusterTaskRequest
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *CrossClusterTaskRequest) 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.TaskInfo, err = _CrossClusterTaskInfo_Read(field.Value)
				if err != nil {
					return err
				}

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

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

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

			}
		case 50:
			if field.Value.Type() == wire.TStruct {
				v.RecordChildWorkflowExecutionCompleteAttributes, err = _CrossClusterRecordChildWorkflowExecutionCompleteRequestAttributes_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 60:
			if field.Value.Type() == wire.TStruct {
				v.ApplyParentClosePolicyAttributes, err = _CrossClusterApplyParentClosePolicyRequestAttributes_Read(field.Value)
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

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

	var fields [6]string
	i := 0
	if v.TaskInfo != nil {
		fields[i] = fmt.Sprintf("TaskInfo: %v", v.TaskInfo)
		i++
	}
	if v.StartChildExecutionAttributes != nil {
		fields[i] = fmt.Sprintf("StartChildExecutionAttributes: %v", v.StartChildExecutionAttributes)
		i++
	}
	if v.CancelExecutionAttributes != nil {
		fields[i] = fmt.Sprintf("CancelExecutionAttributes: %v", v.CancelExecutionAttributes)
		i++
	}
	if v.SignalExecutionAttributes != nil {
		fields[i] = fmt.Sprintf("SignalExecutionAttributes: %v", v.SignalExecutionAttributes)
		i++
	}
	if v.RecordChildWorkflowExecutionCompleteAttributes != nil {
		fields[i] = fmt.Sprintf("RecordChildWorkflowExecutionCompleteAttributes: %v", v.RecordChildWorkflowExecutionCompleteAttributes)
		i++
	}
	if v.ApplyParentClosePolicyAttributes != nil {
		fields[i] = fmt.Sprintf("ApplyParentClosePolicyAttributes: %v", v.ApplyParentClosePolicyAttributes)
		i++
	}

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

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

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of CrossClusterTaskRequest.
func (v *CrossClusterTaskRequest) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.TaskInfo != nil {
		err = multierr.Append(err, enc.AddObject("taskInfo", v.TaskInfo))
	}
	if v.StartChildExecutionAttributes != nil {
		err = multierr.Append(err, enc.AddObject("startChildExecutionAttributes", v.StartChildExecutionAttributes))
	}
	if v.CancelExecutionAttributes != nil {
		err = multierr.Append(err, enc.AddObject("cancelExecutionAttributes", v.CancelExecutionAttributes))
	}
	if v.SignalExecutionAttributes != nil {
		err = multierr.Append(err, enc.AddObject("signalExecutionAttributes", v.SignalExecutionAttributes))
	}
	if v.RecordChildWorkflowExecutionCompleteAttributes != nil {
		err = multierr.Append(err, enc.AddObject("recordChildWorkflowExecutionCompleteAttributes", v.RecordChildWorkflowExecutionCompleteAttributes))
	}
	if v.ApplyParentClosePolicyAttributes != nil {
		err = multierr.Append(err, enc.AddObject("applyParentClosePolicyAttributes", v.ApplyParentClosePolicyAttributes))
	}
	return err
}

// GetTaskInfo returns the value of TaskInfo if it is set or its
// zero value if it is unset.
func (v *CrossClusterTaskRequest) GetTaskInfo() (o *CrossClusterTaskInfo) {
	if v != nil && v.TaskInfo != nil {
		return v.TaskInfo
	}

	return
}

// IsSetTaskInfo returns true if TaskInfo is not nil.
func (v *CrossClusterTaskRequest) IsSetTaskInfo() bool {
	return v != nil && v.TaskInfo != nil
}

// GetStartChildExecutionAttributes returns the value of StartChildExecutionAttributes if it is set or its
// zero value if it is unset.
func (v *CrossClusterTaskRequest) GetStartChildExecutionAttributes() (o *CrossClusterStartChildExecutionRequestAttributes) {
	if v != nil && v.StartChildExecutionAttributes != nil {
		return v.StartChildExecutionAttributes
	}

	return
}

// IsSetStartChildExecutionAttributes returns true if StartChildExecutionAttributes is not nil.
func (v *CrossClusterTaskRequest) IsSetStartChildExecutionAttributes() bool {
	return v != nil && v.StartChildExecutionAttributes != nil
}

// GetCancelExecutionAttributes returns the value of CancelExecutionAttributes if it is set or its
// zero value if it is unset.
func (v *CrossClusterTaskRequest) GetCancelExecutionAttributes() (o *CrossClusterCancelExecutionRequestAttributes) {
	if v != nil && v.CancelExecutionAttributes != nil {
		return v.CancelExecutionAttributes
	}

	return
}

// IsSetCancelExecutionAttributes returns true if CancelExecutionAttributes is not nil.
func (v *CrossClusterTaskRequest) IsSetCancelExecutionAttributes() bool {
	return v != nil && v.CancelExecutionAttributes != nil
}

// GetSignalExecutionAttributes returns the value of SignalExecutionAttributes if it is set or its
// zero value if it is unset.
func (v *CrossClusterTaskRequest) GetSignalExecutionAttributes() (o *CrossClusterSignalExecutionRequestAttributes) {
	if v != nil && v.SignalExecutionAttributes != nil {
		return v.SignalExecutionAttributes
	}

	return
}

// IsSetSignalExecutionAttributes returns true if SignalExecutionAttributes is not nil.
func (v *CrossClusterTaskRequest) IsSetSignalExecutionAttributes() bool {
	return v != nil && v.SignalExecutionAttributes != nil
}

// GetRecordChildWorkflowExecutionCompleteAttributes returns the value of RecordChildWorkflowExecutionCompleteAttributes if it is set or its
// zero value if it is unset.
func (v *CrossClusterTaskRequest) GetRecordChildWorkflowExecutionCompleteAttributes() (o *CrossClusterRecordChildWorkflowExecutionCompleteRequestAttributes) {
	if v != nil && v.RecordChildWorkflowExecutionCompleteAttributes != nil {
		return v.RecordChildWorkflowExecutionCompleteAttributes
	}

	return
}

// IsSetRecordChildWorkflowExecutionCompleteAttributes returns true if RecordChildWorkflowExecutionCompleteAttributes is not nil.
func (v *CrossClusterTaskRequest) IsSetRecordChildWorkflowExecutionCompleteAttributes() bool {
	return v != nil && v.RecordChildWorkflowExecutionCompleteAttributes != nil
}

// GetApplyParentClosePolicyAttributes returns the value of ApplyParentClosePolicyAttributes if it is set or its
// zero value if it is unset.
func (v *CrossClusterTaskRequest) GetApplyParentClosePolicyAttributes() (o *CrossClusterApplyParentClosePolicyRequestAttributes) {
	if v != nil && v.ApplyParentClosePolicyAttributes != nil {
		return v.ApplyParentClosePolicyAttributes
	}

	return
}

// IsSetApplyParentClosePolicyAttributes returns true if ApplyParentClosePolicyAttributes is not nil.
func (v *CrossClusterTaskRequest) IsSetApplyParentClosePolicyAttributes() bool {
	return v != nil && v.ApplyParentClosePolicyAttributes != nil
}

type CrossClusterTaskResponse struct {
	TaskID                                         *int64                                                              `json:"taskID,omitempty"`
	TaskType                                       *CrossClusterTaskType                                               `json:"taskType,omitempty"`
	TaskState                                      *int16                                                              `json:"taskState,omitempty"`
	FailedCause                                    *CrossClusterTaskFailedCause                                        `json:"failedCause,omitempty"`
	StartChildExecutionAttributes                  *CrossClusterStartChildExecutionResponseAttributes                  `json:"startChildExecutionAttributes,omitempty"`
	CancelExecutionAttributes                      *CrossClusterCancelExecutionResponseAttributes                      `json:"cancelExecutionAttributes,omitempty"`
	SignalExecutionAttributes                      *CrossClusterSignalExecutionResponseAttributes                      `json:"signalExecutionAttributes,omitempty"`
	RecordChildWorkflowExecutionCompleteAttributes *CrossClusterRecordChildWorkflowExecutionCompleteResponseAttributes `json:"recordChildWorkflowExecutionCompleteAttributes,omitempty"`
	ApplyParentClosePolicyAttributes               *CrossClusterApplyParentClosePolicyResponseAttributes               `json:"applyParentClosePolicyAttributes,omitempty"`
}

// ToWire translates a CrossClusterTaskResponse 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 *CrossClusterTaskResponse) ToWire() (wire.Value, error) {
	var (
		fields [9]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.TaskID != nil {
		w, err = wire.NewValueI64(*(v.TaskID)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.TaskType != nil {
		w, err = v.TaskType.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.TaskState != nil {
		w, err = wire.NewValueI16(*(v.TaskState)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.FailedCause != nil {
		w, err = v.FailedCause.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 40, Value: w}
		i++
	}
	if v.StartChildExecutionAttributes != nil {
		w, err = v.StartChildExecutionAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 50, Value: w}
		i++
	}
	if v.CancelExecutionAttributes != nil {
		w, err = v.CancelExecutionAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 60, Value: w}
		i++
	}
	if v.SignalExecutionAttributes != nil {
		w, err = v.SignalExecutionAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 70, Value: w}
		i++
	}
	if v.RecordChildWorkflowExecutionCompleteAttributes != nil {
		w, err = v.RecordChildWorkflowExecutionCompleteAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 80, Value: w}
		i++
	}
	if v.ApplyParentClosePolicyAttributes != nil {
		w, err = v.ApplyParentClosePolicyAttributes.ToWire()
		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 _CrossClusterStartChildExecutionResponseAttributes_Read(w wire.Value) (*CrossClusterStartChildExecutionResponseAttributes, error) {
	var v CrossClusterStartChildExecutionResponseAttributes
	err := v.FromWire(w)
	return &v, err
}

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

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

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

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

// FromWire deserializes a CrossClusterTaskResponse 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 CrossClusterTaskResponse struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v CrossClusterTaskResponse
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *CrossClusterTaskResponse) FromWire(w wire.Value) error {
	var err error

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

			}
		case 20:
			if field.Value.Type() == wire.TI32 {
				var x CrossClusterTaskType
				x, err = _CrossClusterTaskType_Read(field.Value)
				v.TaskType = &x
				if err != nil {
					return err
				}

			}
		case 30:
			if field.Value.Type() == wire.TI16 {
				var x int16
				x, err = field.Value.GetI16(), error(nil)
				v.TaskState = &x
				if err != nil {
					return err
				}

			}
		case 40:
			if field.Value.Type() == wire.TI32 {
				var x CrossClusterTaskFailedCause
				x, err = _CrossClusterTaskFailedCause_Read(field.Value)
				v.FailedCause = &x
				if err != nil {
					return err
				}

			}
		case 50:
			if field.Value.Type() == wire.TStruct {
				v.StartChildExecutionAttributes, err = _CrossClusterStartChildExecutionResponseAttributes_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 60:
			if field.Value.Type() == wire.TStruct {
				v.CancelExecutionAttributes, err = _CrossClusterCancelExecutionResponseAttributes_Read(field.Value)
				if err != nil {
					return err
				}

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

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

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

			}
		}
	}

	return nil
}

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

	var fields [9]string
	i := 0
	if v.TaskID != nil {
		fields[i] = fmt.Sprintf("TaskID: %v", *(v.TaskID))
		i++
	}
	if v.TaskType != nil {
		fields[i] = fmt.Sprintf("TaskType: %v", *(v.TaskType))
		i++
	}
	if v.TaskState != nil {
		fields[i] = fmt.Sprintf("TaskState: %v", *(v.TaskState))
		i++
	}
	if v.FailedCause != nil {
		fields[i] = fmt.Sprintf("FailedCause: %v", *(v.FailedCause))
		i++
	}
	if v.StartChildExecutionAttributes != nil {
		fields[i] = fmt.Sprintf("StartChildExecutionAttributes: %v", v.StartChildExecutionAttributes)
		i++
	}
	if v.CancelExecutionAttributes != nil {
		fields[i] = fmt.Sprintf("CancelExecutionAttributes: %v", v.CancelExecutionAttributes)
		i++
	}
	if v.SignalExecutionAttributes != nil {
		fields[i] = fmt.Sprintf("SignalExecutionAttributes: %v", v.SignalExecutionAttributes)
		i++
	}
	if v.RecordChildWorkflowExecutionCompleteAttributes != nil {
		fields[i] = fmt.Sprintf("RecordChildWorkflowExecutionCompleteAttributes: %v", v.RecordChildWorkflowExecutionCompleteAttributes)
		i++
	}
	if v.ApplyParentClosePolicyAttributes != nil {
		fields[i] = fmt.Sprintf("ApplyParentClosePolicyAttributes: %v", v.ApplyParentClosePolicyAttributes)
		i++
	}

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

// Equals returns true if all the fields of this CrossClusterTaskResponse match the
// provided CrossClusterTaskResponse.
//
// This function performs a deep comparison.
func (v *CrossClusterTaskResponse) Equals(rhs *CrossClusterTaskResponse) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_I64_EqualsPtr(v.TaskID, rhs.TaskID) {
		return false
	}
	if !_CrossClusterTaskType_EqualsPtr(v.TaskType, rhs.TaskType) {
		return false
	}
	if !_I16_EqualsPtr(v.TaskState, rhs.TaskState) {
		return false
	}
	if !_CrossClusterTaskFailedCause_EqualsPtr(v.FailedCause, rhs.FailedCause) {
		return false
	}
	if !((v.StartChildExecutionAttributes == nil && rhs.StartChildExecutionAttributes == nil) || (v.StartChildExecutionAttributes != nil && rhs.StartChildExecutionAttributes != nil && v.StartChildExecutionAttributes.Equals(rhs.StartChildExecutionAttributes))) {
		return false
	}
	if !((v.CancelExecutionAttributes == nil && rhs.CancelExecutionAttributes == nil) || (v.CancelExecutionAttributes != nil && rhs.CancelExecutionAttributes != nil && v.CancelExecutionAttributes.Equals(rhs.CancelExecutionAttributes))) {
		return false
	}
	if !((v.SignalExecutionAttributes == nil && rhs.SignalExecutionAttributes == nil) || (v.SignalExecutionAttributes != nil && rhs.SignalExecutionAttributes != nil && v.SignalExecutionAttributes.Equals(rhs.SignalExecutionAttributes))) {
		return false
	}
	if !((v.RecordChildWorkflowExecutionCompleteAttributes == nil && rhs.RecordChildWorkflowExecutionCompleteAttributes == nil) || (v.RecordChildWorkflowExecutionCompleteAttributes != nil && rhs.RecordChildWorkflowExecutionCompleteAttributes != nil && v.RecordChildWorkflowExecutionCompleteAttributes.Equals(rhs.RecordChildWorkflowExecutionCompleteAttributes))) {
		return false
	}
	if !((v.ApplyParentClosePolicyAttributes == nil && rhs.ApplyParentClosePolicyAttributes == nil) || (v.ApplyParentClosePolicyAttributes != nil && rhs.ApplyParentClosePolicyAttributes != nil && v.ApplyParentClosePolicyAttributes.Equals(rhs.ApplyParentClosePolicyAttributes))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of CrossClusterTaskResponse.
func (v *CrossClusterTaskResponse) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.TaskID != nil {
		enc.AddInt64("taskID", *v.TaskID)
	}
	if v.TaskType != nil {
		err = multierr.Append(err, enc.AddObject("taskType", *v.TaskType))
	}
	if v.TaskState != nil {
		enc.AddInt16("taskState", *v.TaskState)
	}
	if v.FailedCause != nil {
		err = multierr.Append(err, enc.AddObject("failedCause", *v.FailedCause))
	}
	if v.StartChildExecutionAttributes != nil {
		err = multierr.Append(err, enc.AddObject("startChildExecutionAttributes", v.StartChildExecutionAttributes))
	}
	if v.CancelExecutionAttributes != nil {
		err = multierr.Append(err, enc.AddObject("cancelExecutionAttributes", v.CancelExecutionAttributes))
	}
	if v.SignalExecutionAttributes != nil {
		err = multierr.Append(err, enc.AddObject("signalExecutionAttributes", v.SignalExecutionAttributes))
	}
	if v.RecordChildWorkflowExecutionCompleteAttributes != nil {
		err = multierr.Append(err, enc.AddObject("recordChildWorkflowExecutionCompleteAttributes", v.RecordChildWorkflowExecutionCompleteAttributes))
	}
	if v.ApplyParentClosePolicyAttributes != nil {
		err = multierr.Append(err, enc.AddObject("applyParentClosePolicyAttributes", v.ApplyParentClosePolicyAttributes))
	}
	return err
}

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

	return
}

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

// GetTaskType returns the value of TaskType if it is set or its
// zero value if it is unset.
func (v *CrossClusterTaskResponse) GetTaskType() (o CrossClusterTaskType) {
	if v != nil && v.TaskType != nil {
		return *v.TaskType
	}

	return
}

// IsSetTaskType returns true if TaskType is not nil.
func (v *CrossClusterTaskResponse) IsSetTaskType() bool {
	return v != nil && v.TaskType != nil
}

// GetTaskState returns the value of TaskState if it is set or its
// zero value if it is unset.
func (v *CrossClusterTaskResponse) GetTaskState() (o int16) {
	if v != nil && v.TaskState != nil {
		return *v.TaskState
	}

	return
}

// IsSetTaskState returns true if TaskState is not nil.
func (v *CrossClusterTaskResponse) IsSetTaskState() bool {
	return v != nil && v.TaskState != nil
}

// GetFailedCause returns the value of FailedCause if it is set or its
// zero value if it is unset.
func (v *CrossClusterTaskResponse) GetFailedCause() (o CrossClusterTaskFailedCause) {
	if v != nil && v.FailedCause != nil {
		return *v.FailedCause
	}

	return
}

// IsSetFailedCause returns true if FailedCause is not nil.
func (v *CrossClusterTaskResponse) IsSetFailedCause() bool {
	return v != nil && v.FailedCause != nil
}

// GetStartChildExecutionAttributes returns the value of StartChildExecutionAttributes if it is set or its
// zero value if it is unset.
func (v *CrossClusterTaskResponse) GetStartChildExecutionAttributes() (o *CrossClusterStartChildExecutionResponseAttributes) {
	if v != nil && v.StartChildExecutionAttributes != nil {
		return v.StartChildExecutionAttributes
	}

	return
}

// IsSetStartChildExecutionAttributes returns true if StartChildExecutionAttributes is not nil.
func (v *CrossClusterTaskResponse) IsSetStartChildExecutionAttributes() bool {
	return v != nil && v.StartChildExecutionAttributes != nil
}

// GetCancelExecutionAttributes returns the value of CancelExecutionAttributes if it is set or its
// zero value if it is unset.
func (v *CrossClusterTaskResponse) GetCancelExecutionAttributes() (o *CrossClusterCancelExecutionResponseAttributes) {
	if v != nil && v.CancelExecutionAttributes != nil {
		return v.CancelExecutionAttributes
	}

	return
}

// IsSetCancelExecutionAttributes returns true if CancelExecutionAttributes is not nil.
func (v *CrossClusterTaskResponse) IsSetCancelExecutionAttributes() bool {
	return v != nil && v.CancelExecutionAttributes != nil
}

// GetSignalExecutionAttributes returns the value of SignalExecutionAttributes if it is set or its
// zero value if it is unset.
func (v *CrossClusterTaskResponse) GetSignalExecutionAttributes() (o *CrossClusterSignalExecutionResponseAttributes) {
	if v != nil && v.SignalExecutionAttributes != nil {
		return v.SignalExecutionAttributes
	}

	return
}

// IsSetSignalExecutionAttributes returns true if SignalExecutionAttributes is not nil.
func (v *CrossClusterTaskResponse) IsSetSignalExecutionAttributes() bool {
	return v != nil && v.SignalExecutionAttributes != nil
}

// GetRecordChildWorkflowExecutionCompleteAttributes returns the value of RecordChildWorkflowExecutionCompleteAttributes if it is set or its
// zero value if it is unset.
func (v *CrossClusterTaskResponse) GetRecordChildWorkflowExecutionCompleteAttributes() (o *CrossClusterRecordChildWorkflowExecutionCompleteResponseAttributes) {
	if v != nil && v.RecordChildWorkflowExecutionCompleteAttributes != nil {
		return v.RecordChildWorkflowExecutionCompleteAttributes
	}

	return
}

// IsSetRecordChildWorkflowExecutionCompleteAttributes returns true if RecordChildWorkflowExecutionCompleteAttributes is not nil.
func (v *CrossClusterTaskResponse) IsSetRecordChildWorkflowExecutionCompleteAttributes() bool {
	return v != nil && v.RecordChildWorkflowExecutionCompleteAttributes != nil
}

// GetApplyParentClosePolicyAttributes returns the value of ApplyParentClosePolicyAttributes if it is set or its
// zero value if it is unset.
func (v *CrossClusterTaskResponse) GetApplyParentClosePolicyAttributes() (o *CrossClusterApplyParentClosePolicyResponseAttributes) {
	if v != nil && v.ApplyParentClosePolicyAttributes != nil {
		return v.ApplyParentClosePolicyAttributes
	}

	return
}

// IsSetApplyParentClosePolicyAttributes returns true if ApplyParentClosePolicyAttributes is not nil.
func (v *CrossClusterTaskResponse) IsSetApplyParentClosePolicyAttributes() bool {
	return v != nil && v.ApplyParentClosePolicyAttributes != nil
}

type CrossClusterTaskType int32

const (
	CrossClusterTaskTypeStartChildExecution                  CrossClusterTaskType = 0
	CrossClusterTaskTypeCancelExecution                      CrossClusterTaskType = 1
	CrossClusterTaskTypeSignalExecution                      CrossClusterTaskType = 2
	CrossClusterTaskTypeRecordChildWorkflowExecutionComplete CrossClusterTaskType = 3
	CrossClusterTaskTypeApplyParentClosePolicy               CrossClusterTaskType = 4
)

// CrossClusterTaskType_Values returns all recognized values of CrossClusterTaskType.
func CrossClusterTaskType_Values() []CrossClusterTaskType {
	return []CrossClusterTaskType{
		CrossClusterTaskTypeStartChildExecution,
		CrossClusterTaskTypeCancelExecution,
		CrossClusterTaskTypeSignalExecution,
		CrossClusterTaskTypeRecordChildWorkflowExecutionComplete,
		CrossClusterTaskTypeApplyParentClosePolicy,
	}
}

// UnmarshalText tries to decode CrossClusterTaskType from a byte slice
// containing its name.
//
//	var v CrossClusterTaskType
//	err := v.UnmarshalText([]byte("StartChildExecution"))
func (v *CrossClusterTaskType) UnmarshalText(value []byte) error {
	switch s := string(value); s {
	case "StartChildExecution":
		*v = CrossClusterTaskTypeStartChildExecution
		return nil
	case "CancelExecution":
		*v = CrossClusterTaskTypeCancelExecution
		return nil
	case "SignalExecution":
		*v = CrossClusterTaskTypeSignalExecution
		return nil
	case "RecordChildWorkflowExecutionComplete":
		*v = CrossClusterTaskTypeRecordChildWorkflowExecutionComplete
		return nil
	case "ApplyParentClosePolicy":
		*v = CrossClusterTaskTypeApplyParentClosePolicy
		return nil
	default:
		val, err := strconv.ParseInt(s, 10, 32)
		if err != nil {
			return fmt.Errorf("unknown enum value %q for %q: %v", s, "CrossClusterTaskType", err)
		}
		*v = CrossClusterTaskType(val)
		return nil
	}
}

// MarshalText encodes CrossClusterTaskType 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 CrossClusterTaskType) MarshalText() ([]byte, error) {
	switch int32(v) {
	case 0:
		return []byte("StartChildExecution"), nil
	case 1:
		return []byte("CancelExecution"), nil
	case 2:
		return []byte("SignalExecution"), nil
	case 3:
		return []byte("RecordChildWorkflowExecutionComplete"), nil
	case 4:
		return []byte("ApplyParentClosePolicy"), nil
	}
	return []byte(strconv.FormatInt(int64(v), 10)), nil
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of CrossClusterTaskType.
// 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 CrossClusterTaskType) MarshalLogObject(enc zapcore.ObjectEncoder) error {
	enc.AddInt32("value", int32(v))
	switch int32(v) {
	case 0:
		enc.AddString("name", "StartChildExecution")
	case 1:
		enc.AddString("name", "CancelExecution")
	case 2:
		enc.AddString("name", "SignalExecution")
	case 3:
		enc.AddString("name", "RecordChildWorkflowExecutionComplete")
	case 4:
		enc.AddString("name", "ApplyParentClosePolicy")
	}
	return nil
}

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

// ToWire translates CrossClusterTaskType 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 CrossClusterTaskType) ToWire() (wire.Value, error) {
	return wire.NewValueI32(int32(v)), nil
}

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

// String returns a readable string representation of CrossClusterTaskType.
func (v CrossClusterTaskType) String() string {
	w := int32(v)
	switch w {
	case 0:
		return "StartChildExecution"
	case 1:
		return "CancelExecution"
	case 2:
		return "SignalExecution"
	case 3:
		return "RecordChildWorkflowExecutionComplete"
	case 4:
		return "ApplyParentClosePolicy"
	}
	return fmt.Sprintf("CrossClusterTaskType(%d)", w)
}

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

// MarshalJSON serializes CrossClusterTaskType into JSON.
//
// If the enum value is recognized, its name is returned. Otherwise,
// its integer value is returned.
//
// This implements json.Marshaler.
func (v CrossClusterTaskType) MarshalJSON() ([]byte, error) {
	switch int32(v) {
	case 0:
		return ([]byte)("\"StartChildExecution\""), nil
	case 1:
		return ([]byte)("\"CancelExecution\""), nil
	case 2:
		return ([]byte)("\"SignalExecution\""), nil
	case 3:
		return ([]byte)("\"RecordChildWorkflowExecutionComplete\""), nil
	case 4:
		return ([]byte)("\"ApplyParentClosePolicy\""), nil
	}
	return ([]byte)(strconv.FormatInt(int64(v), 10)), nil
}

// UnmarshalJSON attempts to decode CrossClusterTaskType 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 *CrossClusterTaskType) 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, "CrossClusterTaskType")
		}
		if x < math.MinInt32 {
			return fmt.Errorf("enum underflow from JSON %q for %q", text, "CrossClusterTaskType")
		}
		*v = (CrossClusterTaskType)(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, "CrossClusterTaskType")
	}
}

type CurrentBranchChangedError struct {
	Message            string `json:"message,required"`
	CurrentBranchToken []byte `json:"currentBranchToken,required"`
}

// ToWire translates a CurrentBranchChangedError 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 *CurrentBranchChangedError) ToWire() (wire.Value, error) {
	var (
		fields [2]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: 10, Value: w}
	i++
	if v.CurrentBranchToken == nil {
		return w, errors.New("field CurrentBranchToken of CurrentBranchChangedError is required")
	}
	w, err = wire.NewValueBinary(v.CurrentBranchToken), 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
}

// FromWire deserializes a CurrentBranchChangedError 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 CurrentBranchChangedError struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v CurrentBranchChangedError
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *CurrentBranchChangedError) FromWire(w wire.Value) error {
	var err error

	messageIsSet := false
	currentBranchTokenIsSet := false

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			if field.Value.Type() == wire.TBinary {
				v.Message, err = field.Value.GetString(), error(nil)
				if err != nil {
					return err
				}
				messageIsSet = true
			}
		case 20:
			if field.Value.Type() == wire.TBinary {
				v.CurrentBranchToken, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}
				currentBranchTokenIsSet = true
			}
		}
	}

	if !messageIsSet {
		return errors.New("field Message of CurrentBranchChangedError is required")
	}

	if !currentBranchTokenIsSet {
		return errors.New("field CurrentBranchToken of CurrentBranchChangedError is required")
	}

	return nil
}

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

	var fields [2]string
	i := 0
	fields[i] = fmt.Sprintf("Message: %v", v.Message)
	i++
	fields[i] = fmt.Sprintf("CurrentBranchToken: %v", v.CurrentBranchToken)
	i++

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

// ErrorName is the name of this type as defined in the Thrift
// file.
func (*CurrentBranchChangedError) ErrorName() string {
	return "CurrentBranchChangedError"
}

// Equals returns true if all the fields of this CurrentBranchChangedError match the
// provided CurrentBranchChangedError.
//
// This function performs a deep comparison.
func (v *CurrentBranchChangedError) Equals(rhs *CurrentBranchChangedError) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !(v.Message == rhs.Message) {
		return false
	}
	if !bytes.Equal(v.CurrentBranchToken, rhs.CurrentBranchToken) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of CurrentBranchChangedError.
func (v *CurrentBranchChangedError) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	enc.AddString("message", v.Message)
	enc.AddString("currentBranchToken", base64.StdEncoding.EncodeToString(v.CurrentBranchToken))
	return err
}

// GetMessage returns the value of Message if it is set or its
// zero value if it is unset.
func (v *CurrentBranchChangedError) GetMessage() (o string) {
	if v != nil {
		o = v.Message
	}
	return
}

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

// IsSetCurrentBranchToken returns true if CurrentBranchToken is not nil.
func (v *CurrentBranchChangedError) IsSetCurrentBranchToken() bool {
	return v != nil && v.CurrentBranchToken != nil
}

func (v *CurrentBranchChangedError) Error() string {
	return v.String()
}

type DataBlob struct {
	EncodingType *EncodingType `json:"EncodingType,omitempty"`
	Data         []byte        `json:"Data,omitempty"`
}

// ToWire translates a DataBlob 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 *DataBlob) ToWire() (wire.Value, error) {
	var (
		fields [2]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.EncodingType != nil {
		w, err = v.EncodingType.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.Data != nil {
		w, err = wire.NewValueBinary(v.Data), 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 _EncodingType_Read(w wire.Value) (EncodingType, error) {
	var v EncodingType
	err := v.FromWire(w)
	return v, err
}

// FromWire deserializes a DataBlob 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 DataBlob struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v DataBlob
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *DataBlob) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			if field.Value.Type() == wire.TI32 {
				var x EncodingType
				x, err = _EncodingType_Read(field.Value)
				v.EncodingType = &x
				if err != nil {
					return err
				}

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

			}
		}
	}

	return nil
}

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

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

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

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

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

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

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of DataBlob.
func (v *DataBlob) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.EncodingType != nil {
		err = multierr.Append(err, enc.AddObject("EncodingType", *v.EncodingType))
	}
	if v.Data != nil {
		enc.AddString("Data", base64.StdEncoding.EncodeToString(v.Data))
	}
	return err
}

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

	return
}

// IsSetEncodingType returns true if EncodingType is not nil.
func (v *DataBlob) IsSetEncodingType() bool {
	return v != nil && v.EncodingType != nil
}

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

	return
}

// IsSetData returns true if Data is not nil.
func (v *DataBlob) IsSetData() bool {
	return v != nil && v.Data != nil
}

type Decision struct {
	DecisionType                                             *DecisionType                                             `json:"decisionType,omitempty"`
	ScheduleActivityTaskDecisionAttributes                   *ScheduleActivityTaskDecisionAttributes                   `json:"scheduleActivityTaskDecisionAttributes,omitempty"`
	StartTimerDecisionAttributes                             *StartTimerDecisionAttributes                             `json:"startTimerDecisionAttributes,omitempty"`
	CompleteWorkflowExecutionDecisionAttributes              *CompleteWorkflowExecutionDecisionAttributes              `json:"completeWorkflowExecutionDecisionAttributes,omitempty"`
	FailWorkflowExecutionDecisionAttributes                  *FailWorkflowExecutionDecisionAttributes                  `json:"failWorkflowExecutionDecisionAttributes,omitempty"`
	RequestCancelActivityTaskDecisionAttributes              *RequestCancelActivityTaskDecisionAttributes              `json:"requestCancelActivityTaskDecisionAttributes,omitempty"`
	CancelTimerDecisionAttributes                            *CancelTimerDecisionAttributes                            `json:"cancelTimerDecisionAttributes,omitempty"`
	CancelWorkflowExecutionDecisionAttributes                *CancelWorkflowExecutionDecisionAttributes                `json:"cancelWorkflowExecutionDecisionAttributes,omitempty"`
	RequestCancelExternalWorkflowExecutionDecisionAttributes *RequestCancelExternalWorkflowExecutionDecisionAttributes `json:"requestCancelExternalWorkflowExecutionDecisionAttributes,omitempty"`
	RecordMarkerDecisionAttributes                           *RecordMarkerDecisionAttributes                           `json:"recordMarkerDecisionAttributes,omitempty"`
	ContinueAsNewWorkflowExecutionDecisionAttributes         *ContinueAsNewWorkflowExecutionDecisionAttributes         `json:"continueAsNewWorkflowExecutionDecisionAttributes,omitempty"`
	StartChildWorkflowExecutionDecisionAttributes            *StartChildWorkflowExecutionDecisionAttributes            `json:"startChildWorkflowExecutionDecisionAttributes,omitempty"`
	SignalExternalWorkflowExecutionDecisionAttributes        *SignalExternalWorkflowExecutionDecisionAttributes        `json:"signalExternalWorkflowExecutionDecisionAttributes,omitempty"`
	UpsertWorkflowSearchAttributesDecisionAttributes         *UpsertWorkflowSearchAttributesDecisionAttributes         `json:"upsertWorkflowSearchAttributesDecisionAttributes,omitempty"`
}

// ToWire translates a Decision 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 *Decision) ToWire() (wire.Value, error) {
	var (
		fields [14]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.DecisionType != nil {
		w, err = v.DecisionType.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.ScheduleActivityTaskDecisionAttributes != nil {
		w, err = v.ScheduleActivityTaskDecisionAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.StartTimerDecisionAttributes != nil {
		w, err = v.StartTimerDecisionAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 25, Value: w}
		i++
	}
	if v.CompleteWorkflowExecutionDecisionAttributes != nil {
		w, err = v.CompleteWorkflowExecutionDecisionAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.FailWorkflowExecutionDecisionAttributes != nil {
		w, err = v.FailWorkflowExecutionDecisionAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 35, Value: w}
		i++
	}
	if v.RequestCancelActivityTaskDecisionAttributes != nil {
		w, err = v.RequestCancelActivityTaskDecisionAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 40, Value: w}
		i++
	}
	if v.CancelTimerDecisionAttributes != nil {
		w, err = v.CancelTimerDecisionAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 50, Value: w}
		i++
	}
	if v.CancelWorkflowExecutionDecisionAttributes != nil {
		w, err = v.CancelWorkflowExecutionDecisionAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 60, Value: w}
		i++
	}
	if v.RequestCancelExternalWorkflowExecutionDecisionAttributes != nil {
		w, err = v.RequestCancelExternalWorkflowExecutionDecisionAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 70, Value: w}
		i++
	}
	if v.RecordMarkerDecisionAttributes != nil {
		w, err = v.RecordMarkerDecisionAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 80, Value: w}
		i++
	}
	if v.ContinueAsNewWorkflowExecutionDecisionAttributes != nil {
		w, err = v.ContinueAsNewWorkflowExecutionDecisionAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 90, Value: w}
		i++
	}
	if v.StartChildWorkflowExecutionDecisionAttributes != nil {
		w, err = v.StartChildWorkflowExecutionDecisionAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 100, Value: w}
		i++
	}
	if v.SignalExternalWorkflowExecutionDecisionAttributes != nil {
		w, err = v.SignalExternalWorkflowExecutionDecisionAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 110, Value: w}
		i++
	}
	if v.UpsertWorkflowSearchAttributesDecisionAttributes != nil {
		w, err = v.UpsertWorkflowSearchAttributesDecisionAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 120, Value: w}
		i++
	}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// FromWire deserializes a Decision 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 Decision struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v Decision
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *Decision) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			if field.Value.Type() == wire.TI32 {
				var x DecisionType
				x, err = _DecisionType_Read(field.Value)
				v.DecisionType = &x
				if err != nil {
					return err
				}

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

			}
		case 25:
			if field.Value.Type() == wire.TStruct {
				v.StartTimerDecisionAttributes, err = _StartTimerDecisionAttributes_Read(field.Value)
				if err != nil {
					return err
				}

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

			}
		case 35:
			if field.Value.Type() == wire.TStruct {
				v.FailWorkflowExecutionDecisionAttributes, err = _FailWorkflowExecutionDecisionAttributes_Read(field.Value)
				if err != nil {
					return err
				}

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

			}
		case 50:
			if field.Value.Type() == wire.TStruct {
				v.CancelTimerDecisionAttributes, err = _CancelTimerDecisionAttributes_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 60:
			if field.Value.Type() == wire.TStruct {
				v.CancelWorkflowExecutionDecisionAttributes, err = _CancelWorkflowExecutionDecisionAttributes_Read(field.Value)
				if err != nil {
					return err
				}

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

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

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

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

			}
		case 110:
			if field.Value.Type() == wire.TStruct {
				v.SignalExternalWorkflowExecutionDecisionAttributes, err = _SignalExternalWorkflowExecutionDecisionAttributes_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 120:
			if field.Value.Type() == wire.TStruct {
				v.UpsertWorkflowSearchAttributesDecisionAttributes, err = _UpsertWorkflowSearchAttributesDecisionAttributes_Read(field.Value)
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

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

	var fields [14]string
	i := 0
	if v.DecisionType != nil {
		fields[i] = fmt.Sprintf("DecisionType: %v", *(v.DecisionType))
		i++
	}
	if v.ScheduleActivityTaskDecisionAttributes != nil {
		fields[i] = fmt.Sprintf("ScheduleActivityTaskDecisionAttributes: %v", v.ScheduleActivityTaskDecisionAttributes)
		i++
	}
	if v.StartTimerDecisionAttributes != nil {
		fields[i] = fmt.Sprintf("StartTimerDecisionAttributes: %v", v.StartTimerDecisionAttributes)
		i++
	}
	if v.CompleteWorkflowExecutionDecisionAttributes != nil {
		fields[i] = fmt.Sprintf("CompleteWorkflowExecutionDecisionAttributes: %v", v.CompleteWorkflowExecutionDecisionAttributes)
		i++
	}
	if v.FailWorkflowExecutionDecisionAttributes != nil {
		fields[i] = fmt.Sprintf("FailWorkflowExecutionDecisionAttributes: %v", v.FailWorkflowExecutionDecisionAttributes)
		i++
	}
	if v.RequestCancelActivityTaskDecisionAttributes != nil {
		fields[i] = fmt.Sprintf("RequestCancelActivityTaskDecisionAttributes: %v", v.RequestCancelActivityTaskDecisionAttributes)
		i++
	}
	if v.CancelTimerDecisionAttributes != nil {
		fields[i] = fmt.Sprintf("CancelTimerDecisionAttributes: %v", v.CancelTimerDecisionAttributes)
		i++
	}
	if v.CancelWorkflowExecutionDecisionAttributes != nil {
		fields[i] = fmt.Sprintf("CancelWorkflowExecutionDecisionAttributes: %v", v.CancelWorkflowExecutionDecisionAttributes)
		i++
	}
	if v.RequestCancelExternalWorkflowExecutionDecisionAttributes != nil {
		fields[i] = fmt.Sprintf("RequestCancelExternalWorkflowExecutionDecisionAttributes: %v", v.RequestCancelExternalWorkflowExecutionDecisionAttributes)
		i++
	}
	if v.RecordMarkerDecisionAttributes != nil {
		fields[i] = fmt.Sprintf("RecordMarkerDecisionAttributes: %v", v.RecordMarkerDecisionAttributes)
		i++
	}
	if v.ContinueAsNewWorkflowExecutionDecisionAttributes != nil {
		fields[i] = fmt.Sprintf("ContinueAsNewWorkflowExecutionDecisionAttributes: %v", v.ContinueAsNewWorkflowExecutionDecisionAttributes)
		i++
	}
	if v.StartChildWorkflowExecutionDecisionAttributes != nil {
		fields[i] = fmt.Sprintf("StartChildWorkflowExecutionDecisionAttributes: %v", v.StartChildWorkflowExecutionDecisionAttributes)
		i++
	}
	if v.SignalExternalWorkflowExecutionDecisionAttributes != nil {
		fields[i] = fmt.Sprintf("SignalExternalWorkflowExecutionDecisionAttributes: %v", v.SignalExternalWorkflowExecutionDecisionAttributes)
		i++
	}
	if v.UpsertWorkflowSearchAttributesDecisionAttributes != nil {
		fields[i] = fmt.Sprintf("UpsertWorkflowSearchAttributesDecisionAttributes: %v", v.UpsertWorkflowSearchAttributesDecisionAttributes)
		i++
	}

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

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

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

// Equals returns true if all the fields of this Decision match the
// provided Decision.
//
// This function performs a deep comparison.
func (v *Decision) Equals(rhs *Decision) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_DecisionType_EqualsPtr(v.DecisionType, rhs.DecisionType) {
		return false
	}
	if !((v.ScheduleActivityTaskDecisionAttributes == nil && rhs.ScheduleActivityTaskDecisionAttributes == nil) || (v.ScheduleActivityTaskDecisionAttributes != nil && rhs.ScheduleActivityTaskDecisionAttributes != nil && v.ScheduleActivityTaskDecisionAttributes.Equals(rhs.ScheduleActivityTaskDecisionAttributes))) {
		return false
	}
	if !((v.StartTimerDecisionAttributes == nil && rhs.StartTimerDecisionAttributes == nil) || (v.StartTimerDecisionAttributes != nil && rhs.StartTimerDecisionAttributes != nil && v.StartTimerDecisionAttributes.Equals(rhs.StartTimerDecisionAttributes))) {
		return false
	}
	if !((v.CompleteWorkflowExecutionDecisionAttributes == nil && rhs.CompleteWorkflowExecutionDecisionAttributes == nil) || (v.CompleteWorkflowExecutionDecisionAttributes != nil && rhs.CompleteWorkflowExecutionDecisionAttributes != nil && v.CompleteWorkflowExecutionDecisionAttributes.Equals(rhs.CompleteWorkflowExecutionDecisionAttributes))) {
		return false
	}
	if !((v.FailWorkflowExecutionDecisionAttributes == nil && rhs.FailWorkflowExecutionDecisionAttributes == nil) || (v.FailWorkflowExecutionDecisionAttributes != nil && rhs.FailWorkflowExecutionDecisionAttributes != nil && v.FailWorkflowExecutionDecisionAttributes.Equals(rhs.FailWorkflowExecutionDecisionAttributes))) {
		return false
	}
	if !((v.RequestCancelActivityTaskDecisionAttributes == nil && rhs.RequestCancelActivityTaskDecisionAttributes == nil) || (v.RequestCancelActivityTaskDecisionAttributes != nil && rhs.RequestCancelActivityTaskDecisionAttributes != nil && v.RequestCancelActivityTaskDecisionAttributes.Equals(rhs.RequestCancelActivityTaskDecisionAttributes))) {
		return false
	}
	if !((v.CancelTimerDecisionAttributes == nil && rhs.CancelTimerDecisionAttributes == nil) || (v.CancelTimerDecisionAttributes != nil && rhs.CancelTimerDecisionAttributes != nil && v.CancelTimerDecisionAttributes.Equals(rhs.CancelTimerDecisionAttributes))) {
		return false
	}
	if !((v.CancelWorkflowExecutionDecisionAttributes == nil && rhs.CancelWorkflowExecutionDecisionAttributes == nil) || (v.CancelWorkflowExecutionDecisionAttributes != nil && rhs.CancelWorkflowExecutionDecisionAttributes != nil && v.CancelWorkflowExecutionDecisionAttributes.Equals(rhs.CancelWorkflowExecutionDecisionAttributes))) {
		return false
	}
	if !((v.RequestCancelExternalWorkflowExecutionDecisionAttributes == nil && rhs.RequestCancelExternalWorkflowExecutionDecisionAttributes == nil) || (v.RequestCancelExternalWorkflowExecutionDecisionAttributes != nil && rhs.RequestCancelExternalWorkflowExecutionDecisionAttributes != nil && v.RequestCancelExternalWorkflowExecutionDecisionAttributes.Equals(rhs.RequestCancelExternalWorkflowExecutionDecisionAttributes))) {
		return false
	}
	if !((v.RecordMarkerDecisionAttributes == nil && rhs.RecordMarkerDecisionAttributes == nil) || (v.RecordMarkerDecisionAttributes != nil && rhs.RecordMarkerDecisionAttributes != nil && v.RecordMarkerDecisionAttributes.Equals(rhs.RecordMarkerDecisionAttributes))) {
		return false
	}
	if !((v.ContinueAsNewWorkflowExecutionDecisionAttributes == nil && rhs.ContinueAsNewWorkflowExecutionDecisionAttributes == nil) || (v.ContinueAsNewWorkflowExecutionDecisionAttributes != nil && rhs.ContinueAsNewWorkflowExecutionDecisionAttributes != nil && v.ContinueAsNewWorkflowExecutionDecisionAttributes.Equals(rhs.ContinueAsNewWorkflowExecutionDecisionAttributes))) {
		return false
	}
	if !((v.StartChildWorkflowExecutionDecisionAttributes == nil && rhs.StartChildWorkflowExecutionDecisionAttributes == nil) || (v.StartChildWorkflowExecutionDecisionAttributes != nil && rhs.StartChildWorkflowExecutionDecisionAttributes != nil && v.StartChildWorkflowExecutionDecisionAttributes.Equals(rhs.StartChildWorkflowExecutionDecisionAttributes))) {
		return false
	}
	if !((v.SignalExternalWorkflowExecutionDecisionAttributes == nil && rhs.SignalExternalWorkflowExecutionDecisionAttributes == nil) || (v.SignalExternalWorkflowExecutionDecisionAttributes != nil && rhs.SignalExternalWorkflowExecutionDecisionAttributes != nil && v.SignalExternalWorkflowExecutionDecisionAttributes.Equals(rhs.SignalExternalWorkflowExecutionDecisionAttributes))) {
		return false
	}
	if !((v.UpsertWorkflowSearchAttributesDecisionAttributes == nil && rhs.UpsertWorkflowSearchAttributesDecisionAttributes == nil) || (v.UpsertWorkflowSearchAttributesDecisionAttributes != nil && rhs.UpsertWorkflowSearchAttributesDecisionAttributes != nil && v.UpsertWorkflowSearchAttributesDecisionAttributes.Equals(rhs.UpsertWorkflowSearchAttributesDecisionAttributes))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of Decision.
func (v *Decision) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.DecisionType != nil {
		err = multierr.Append(err, enc.AddObject("decisionType", *v.DecisionType))
	}
	if v.ScheduleActivityTaskDecisionAttributes != nil {
		err = multierr.Append(err, enc.AddObject("scheduleActivityTaskDecisionAttributes", v.ScheduleActivityTaskDecisionAttributes))
	}
	if v.StartTimerDecisionAttributes != nil {
		err = multierr.Append(err, enc.AddObject("startTimerDecisionAttributes", v.StartTimerDecisionAttributes))
	}
	if v.CompleteWorkflowExecutionDecisionAttributes != nil {
		err = multierr.Append(err, enc.AddObject("completeWorkflowExecutionDecisionAttributes", v.CompleteWorkflowExecutionDecisionAttributes))
	}
	if v.FailWorkflowExecutionDecisionAttributes != nil {
		err = multierr.Append(err, enc.AddObject("failWorkflowExecutionDecisionAttributes", v.FailWorkflowExecutionDecisionAttributes))
	}
	if v.RequestCancelActivityTaskDecisionAttributes != nil {
		err = multierr.Append(err, enc.AddObject("requestCancelActivityTaskDecisionAttributes", v.RequestCancelActivityTaskDecisionAttributes))
	}
	if v.CancelTimerDecisionAttributes != nil {
		err = multierr.Append(err, enc.AddObject("cancelTimerDecisionAttributes", v.CancelTimerDecisionAttributes))
	}
	if v.CancelWorkflowExecutionDecisionAttributes != nil {
		err = multierr.Append(err, enc.AddObject("cancelWorkflowExecutionDecisionAttributes", v.CancelWorkflowExecutionDecisionAttributes))
	}
	if v.RequestCancelExternalWorkflowExecutionDecisionAttributes != nil {
		err = multierr.Append(err, enc.AddObject("requestCancelExternalWorkflowExecutionDecisionAttributes", v.RequestCancelExternalWorkflowExecutionDecisionAttributes))
	}
	if v.RecordMarkerDecisionAttributes != nil {
		err = multierr.Append(err, enc.AddObject("recordMarkerDecisionAttributes", v.RecordMarkerDecisionAttributes))
	}
	if v.ContinueAsNewWorkflowExecutionDecisionAttributes != nil {
		err = multierr.Append(err, enc.AddObject("continueAsNewWorkflowExecutionDecisionAttributes", v.ContinueAsNewWorkflowExecutionDecisionAttributes))
	}
	if v.StartChildWorkflowExecutionDecisionAttributes != nil {
		err = multierr.Append(err, enc.AddObject("startChildWorkflowExecutionDecisionAttributes", v.StartChildWorkflowExecutionDecisionAttributes))
	}
	if v.SignalExternalWorkflowExecutionDecisionAttributes != nil {
		err = multierr.Append(err, enc.AddObject("signalExternalWorkflowExecutionDecisionAttributes", v.SignalExternalWorkflowExecutionDecisionAttributes))
	}
	if v.UpsertWorkflowSearchAttributesDecisionAttributes != nil {
		err = multierr.Append(err, enc.AddObject("upsertWorkflowSearchAttributesDecisionAttributes", v.UpsertWorkflowSearchAttributesDecisionAttributes))
	}
	return err
}

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

	return
}

// IsSetDecisionType returns true if DecisionType is not nil.
func (v *Decision) IsSetDecisionType() bool {
	return v != nil && v.DecisionType != nil
}

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

	return
}

// IsSetScheduleActivityTaskDecisionAttributes returns true if ScheduleActivityTaskDecisionAttributes is not nil.
func (v *Decision) IsSetScheduleActivityTaskDecisionAttributes() bool {
	return v != nil && v.ScheduleActivityTaskDecisionAttributes != nil
}

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

	return
}

// IsSetStartTimerDecisionAttributes returns true if StartTimerDecisionAttributes is not nil.
func (v *Decision) IsSetStartTimerDecisionAttributes() bool {
	return v != nil && v.StartTimerDecisionAttributes != nil
}

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

	return
}

// IsSetCompleteWorkflowExecutionDecisionAttributes returns true if CompleteWorkflowExecutionDecisionAttributes is not nil.
func (v *Decision) IsSetCompleteWorkflowExecutionDecisionAttributes() bool {
	return v != nil && v.CompleteWorkflowExecutionDecisionAttributes != nil
}

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

	return
}

// IsSetFailWorkflowExecutionDecisionAttributes returns true if FailWorkflowExecutionDecisionAttributes is not nil.
func (v *Decision) IsSetFailWorkflowExecutionDecisionAttributes() bool {
	return v != nil && v.FailWorkflowExecutionDecisionAttributes != nil
}

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

	return
}

// IsSetRequestCancelActivityTaskDecisionAttributes returns true if RequestCancelActivityTaskDecisionAttributes is not nil.
func (v *Decision) IsSetRequestCancelActivityTaskDecisionAttributes() bool {
	return v != nil && v.RequestCancelActivityTaskDecisionAttributes != nil
}

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

	return
}

// IsSetCancelTimerDecisionAttributes returns true if CancelTimerDecisionAttributes is not nil.
func (v *Decision) IsSetCancelTimerDecisionAttributes() bool {
	return v != nil && v.CancelTimerDecisionAttributes != nil
}

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

	return
}

// IsSetCancelWorkflowExecutionDecisionAttributes returns true if CancelWorkflowExecutionDecisionAttributes is not nil.
func (v *Decision) IsSetCancelWorkflowExecutionDecisionAttributes() bool {
	return v != nil && v.CancelWorkflowExecutionDecisionAttributes != nil
}

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

	return
}

// IsSetRequestCancelExternalWorkflowExecutionDecisionAttributes returns true if RequestCancelExternalWorkflowExecutionDecisionAttributes is not nil.
func (v *Decision) IsSetRequestCancelExternalWorkflowExecutionDecisionAttributes() bool {
	return v != nil && v.RequestCancelExternalWorkflowExecutionDecisionAttributes != nil
}

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

	return
}

// IsSetRecordMarkerDecisionAttributes returns true if RecordMarkerDecisionAttributes is not nil.
func (v *Decision) IsSetRecordMarkerDecisionAttributes() bool {
	return v != nil && v.RecordMarkerDecisionAttributes != nil
}

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

	return
}

// IsSetContinueAsNewWorkflowExecutionDecisionAttributes returns true if ContinueAsNewWorkflowExecutionDecisionAttributes is not nil.
func (v *Decision) IsSetContinueAsNewWorkflowExecutionDecisionAttributes() bool {
	return v != nil && v.ContinueAsNewWorkflowExecutionDecisionAttributes != nil
}

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

	return
}

// IsSetStartChildWorkflowExecutionDecisionAttributes returns true if StartChildWorkflowExecutionDecisionAttributes is not nil.
func (v *Decision) IsSetStartChildWorkflowExecutionDecisionAttributes() bool {
	return v != nil && v.StartChildWorkflowExecutionDecisionAttributes != nil
}

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

	return
}

// IsSetSignalExternalWorkflowExecutionDecisionAttributes returns true if SignalExternalWorkflowExecutionDecisionAttributes is not nil.
func (v *Decision) IsSetSignalExternalWorkflowExecutionDecisionAttributes() bool {
	return v != nil && v.SignalExternalWorkflowExecutionDecisionAttributes != nil
}

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

	return
}

// IsSetUpsertWorkflowSearchAttributesDecisionAttributes returns true if UpsertWorkflowSearchAttributesDecisionAttributes is not nil.
func (v *Decision) IsSetUpsertWorkflowSearchAttributesDecisionAttributes() bool {
	return v != nil && v.UpsertWorkflowSearchAttributesDecisionAttributes != nil
}

type DecisionTaskCompletedEventAttributes struct {
	ExecutionContext []byte  `json:"executionContext,omitempty"`
	ScheduledEventId *int64  `json:"scheduledEventId,omitempty"`
	StartedEventId   *int64  `json:"startedEventId,omitempty"`
	Identity         *string `json:"identity,omitempty"`
	BinaryChecksum   *string `json:"binaryChecksum,omitempty"`
}

// ToWire translates a DecisionTaskCompletedEventAttributes 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 *DecisionTaskCompletedEventAttributes) ToWire() (wire.Value, error) {
	var (
		fields [5]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.ExecutionContext != nil {
		w, err = wire.NewValueBinary(v.ExecutionContext), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, 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: 20, 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: 30, 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: 40, Value: w}
		i++
	}
	if v.BinaryChecksum != nil {
		w, err = wire.NewValueString(*(v.BinaryChecksum)), 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
}

// FromWire deserializes a DecisionTaskCompletedEventAttributes 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 DecisionTaskCompletedEventAttributes struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v DecisionTaskCompletedEventAttributes
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *DecisionTaskCompletedEventAttributes) 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.ExecutionContext, 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.ScheduledEventId = &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.StartedEventId = &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.Identity = &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.BinaryChecksum = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

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

	var fields [5]string
	i := 0
	if v.ExecutionContext != nil {
		fields[i] = fmt.Sprintf("ExecutionContext: %v", v.ExecutionContext)
		i++
	}
	if v.ScheduledEventId != nil {
		fields[i] = fmt.Sprintf("ScheduledEventId: %v", *(v.ScheduledEventId))
		i++
	}
	if v.StartedEventId != nil {
		fields[i] = fmt.Sprintf("StartedEventId: %v", *(v.StartedEventId))
		i++
	}
	if v.Identity != nil {
		fields[i] = fmt.Sprintf("Identity: %v", *(v.Identity))
		i++
	}
	if v.BinaryChecksum != nil {
		fields[i] = fmt.Sprintf("BinaryChecksum: %v", *(v.BinaryChecksum))
		i++
	}

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

// Equals returns true if all the fields of this DecisionTaskCompletedEventAttributes match the
// provided DecisionTaskCompletedEventAttributes.
//
// This function performs a deep comparison.
func (v *DecisionTaskCompletedEventAttributes) Equals(rhs *DecisionTaskCompletedEventAttributes) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !((v.ExecutionContext == nil && rhs.ExecutionContext == nil) || (v.ExecutionContext != nil && rhs.ExecutionContext != nil && bytes.Equal(v.ExecutionContext, rhs.ExecutionContext))) {
		return false
	}
	if !_I64_EqualsPtr(v.ScheduledEventId, rhs.ScheduledEventId) {
		return false
	}
	if !_I64_EqualsPtr(v.StartedEventId, rhs.StartedEventId) {
		return false
	}
	if !_String_EqualsPtr(v.Identity, rhs.Identity) {
		return false
	}
	if !_String_EqualsPtr(v.BinaryChecksum, rhs.BinaryChecksum) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of DecisionTaskCompletedEventAttributes.
func (v *DecisionTaskCompletedEventAttributes) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.ExecutionContext != nil {
		enc.AddString("executionContext", base64.StdEncoding.EncodeToString(v.ExecutionContext))
	}
	if v.ScheduledEventId != nil {
		enc.AddInt64("scheduledEventId", *v.ScheduledEventId)
	}
	if v.StartedEventId != nil {
		enc.AddInt64("startedEventId", *v.StartedEventId)
	}
	if v.Identity != nil {
		enc.AddString("identity", *v.Identity)
	}
	if v.BinaryChecksum != nil {
		enc.AddString("binaryChecksum", *v.BinaryChecksum)
	}
	return err
}

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

	return
}

// IsSetExecutionContext returns true if ExecutionContext is not nil.
func (v *DecisionTaskCompletedEventAttributes) IsSetExecutionContext() bool {
	return v != nil && v.ExecutionContext != nil
}

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

	return
}

// IsSetScheduledEventId returns true if ScheduledEventId is not nil.
func (v *DecisionTaskCompletedEventAttributes) IsSetScheduledEventId() bool {
	return v != nil && v.ScheduledEventId != nil
}

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

	return
}

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

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

	return
}

// IsSetIdentity returns true if Identity is not nil.
func (v *DecisionTaskCompletedEventAttributes) IsSetIdentity() bool {
	return v != nil && v.Identity != nil
}

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

	return
}

// IsSetBinaryChecksum returns true if BinaryChecksum is not nil.
func (v *DecisionTaskCompletedEventAttributes) IsSetBinaryChecksum() bool {
	return v != nil && v.BinaryChecksum != nil
}

type DecisionTaskFailedCause int32

const (
	DecisionTaskFailedCauseUnhandledDecision                                   DecisionTaskFailedCause = 0
	DecisionTaskFailedCauseBadScheduleActivityAttributes                       DecisionTaskFailedCause = 1
	DecisionTaskFailedCauseBadRequestCancelActivityAttributes                  DecisionTaskFailedCause = 2
	DecisionTaskFailedCauseBadStartTimerAttributes                             DecisionTaskFailedCause = 3
	DecisionTaskFailedCauseBadCancelTimerAttributes                            DecisionTaskFailedCause = 4
	DecisionTaskFailedCauseBadRecordMarkerAttributes                           DecisionTaskFailedCause = 5
	DecisionTaskFailedCauseBadCompleteWorkflowExecutionAttributes              DecisionTaskFailedCause = 6
	DecisionTaskFailedCauseBadFailWorkflowExecutionAttributes                  DecisionTaskFailedCause = 7
	DecisionTaskFailedCauseBadCancelWorkflowExecutionAttributes                DecisionTaskFailedCause = 8
	DecisionTaskFailedCauseBadRequestCancelExternalWorkflowExecutionAttributes DecisionTaskFailedCause = 9
	DecisionTaskFailedCauseBadContinueAsNewAttributes                          DecisionTaskFailedCause = 10
	DecisionTaskFailedCauseStartTimerDuplicateID                               DecisionTaskFailedCause = 11
	DecisionTaskFailedCauseResetStickyTasklist                                 DecisionTaskFailedCause = 12
	DecisionTaskFailedCauseWorkflowWorkerUnhandledFailure                      DecisionTaskFailedCause = 13
	DecisionTaskFailedCauseBadSignalWorkflowExecutionAttributes                DecisionTaskFailedCause = 14
	DecisionTaskFailedCauseBadStartChildExecutionAttributes                    DecisionTaskFailedCause = 15
	DecisionTaskFailedCauseForceCloseDecision                                  DecisionTaskFailedCause = 16
	DecisionTaskFailedCauseFailoverCloseDecision                               DecisionTaskFailedCause = 17
	DecisionTaskFailedCauseBadSignalInputSize                                  DecisionTaskFailedCause = 18
	DecisionTaskFailedCauseResetWorkflow                                       DecisionTaskFailedCause = 19
	DecisionTaskFailedCauseBadBinary                                           DecisionTaskFailedCause = 20
	DecisionTaskFailedCauseScheduleActivityDuplicateID                         DecisionTaskFailedCause = 21
	DecisionTaskFailedCauseBadSearchAttributes                                 DecisionTaskFailedCause = 22
)

// DecisionTaskFailedCause_Values returns all recognized values of DecisionTaskFailedCause.
func DecisionTaskFailedCause_Values() []DecisionTaskFailedCause {
	return []DecisionTaskFailedCause{
		DecisionTaskFailedCauseUnhandledDecision,
		DecisionTaskFailedCauseBadScheduleActivityAttributes,
		DecisionTaskFailedCauseBadRequestCancelActivityAttributes,
		DecisionTaskFailedCauseBadStartTimerAttributes,
		DecisionTaskFailedCauseBadCancelTimerAttributes,
		DecisionTaskFailedCauseBadRecordMarkerAttributes,
		DecisionTaskFailedCauseBadCompleteWorkflowExecutionAttributes,
		DecisionTaskFailedCauseBadFailWorkflowExecutionAttributes,
		DecisionTaskFailedCauseBadCancelWorkflowExecutionAttributes,
		DecisionTaskFailedCauseBadRequestCancelExternalWorkflowExecutionAttributes,
		DecisionTaskFailedCauseBadContinueAsNewAttributes,
		DecisionTaskFailedCauseStartTimerDuplicateID,
		DecisionTaskFailedCauseResetStickyTasklist,
		DecisionTaskFailedCauseWorkflowWorkerUnhandledFailure,
		DecisionTaskFailedCauseBadSignalWorkflowExecutionAttributes,
		DecisionTaskFailedCauseBadStartChildExecutionAttributes,
		DecisionTaskFailedCauseForceCloseDecision,
		DecisionTaskFailedCauseFailoverCloseDecision,
		DecisionTaskFailedCauseBadSignalInputSize,
		DecisionTaskFailedCauseResetWorkflow,
		DecisionTaskFailedCauseBadBinary,
		DecisionTaskFailedCauseScheduleActivityDuplicateID,
		DecisionTaskFailedCauseBadSearchAttributes,
	}
}

// UnmarshalText tries to decode DecisionTaskFailedCause from a byte slice
// containing its name.
//
//	var v DecisionTaskFailedCause
//	err := v.UnmarshalText([]byte("UNHANDLED_DECISION"))
func (v *DecisionTaskFailedCause) UnmarshalText(value []byte) error {
	switch s := string(value); s {
	case "UNHANDLED_DECISION":
		*v = DecisionTaskFailedCauseUnhandledDecision
		return nil
	case "BAD_SCHEDULE_ACTIVITY_ATTRIBUTES":
		*v = DecisionTaskFailedCauseBadScheduleActivityAttributes
		return nil
	case "BAD_REQUEST_CANCEL_ACTIVITY_ATTRIBUTES":
		*v = DecisionTaskFailedCauseBadRequestCancelActivityAttributes
		return nil
	case "BAD_START_TIMER_ATTRIBUTES":
		*v = DecisionTaskFailedCauseBadStartTimerAttributes
		return nil
	case "BAD_CANCEL_TIMER_ATTRIBUTES":
		*v = DecisionTaskFailedCauseBadCancelTimerAttributes
		return nil
	case "BAD_RECORD_MARKER_ATTRIBUTES":
		*v = DecisionTaskFailedCauseBadRecordMarkerAttributes
		return nil
	case "BAD_COMPLETE_WORKFLOW_EXECUTION_ATTRIBUTES":
		*v = DecisionTaskFailedCauseBadCompleteWorkflowExecutionAttributes
		return nil
	case "BAD_FAIL_WORKFLOW_EXECUTION_ATTRIBUTES":
		*v = DecisionTaskFailedCauseBadFailWorkflowExecutionAttributes
		return nil
	case "BAD_CANCEL_WORKFLOW_EXECUTION_ATTRIBUTES":
		*v = DecisionTaskFailedCauseBadCancelWorkflowExecutionAttributes
		return nil
	case "BAD_REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_ATTRIBUTES":
		*v = DecisionTaskFailedCauseBadRequestCancelExternalWorkflowExecutionAttributes
		return nil
	case "BAD_CONTINUE_AS_NEW_ATTRIBUTES":
		*v = DecisionTaskFailedCauseBadContinueAsNewAttributes
		return nil
	case "START_TIMER_DUPLICATE_ID":
		*v = DecisionTaskFailedCauseStartTimerDuplicateID
		return nil
	case "RESET_STICKY_TASKLIST":
		*v = DecisionTaskFailedCauseResetStickyTasklist
		return nil
	case "WORKFLOW_WORKER_UNHANDLED_FAILURE":
		*v = DecisionTaskFailedCauseWorkflowWorkerUnhandledFailure
		return nil
	case "BAD_SIGNAL_WORKFLOW_EXECUTION_ATTRIBUTES":
		*v = DecisionTaskFailedCauseBadSignalWorkflowExecutionAttributes
		return nil
	case "BAD_START_CHILD_EXECUTION_ATTRIBUTES":
		*v = DecisionTaskFailedCauseBadStartChildExecutionAttributes
		return nil
	case "FORCE_CLOSE_DECISION":
		*v = DecisionTaskFailedCauseForceCloseDecision
		return nil
	case "FAILOVER_CLOSE_DECISION":
		*v = DecisionTaskFailedCauseFailoverCloseDecision
		return nil
	case "BAD_SIGNAL_INPUT_SIZE":
		*v = DecisionTaskFailedCauseBadSignalInputSize
		return nil
	case "RESET_WORKFLOW":
		*v = DecisionTaskFailedCauseResetWorkflow
		return nil
	case "BAD_BINARY":
		*v = DecisionTaskFailedCauseBadBinary
		return nil
	case "SCHEDULE_ACTIVITY_DUPLICATE_ID":
		*v = DecisionTaskFailedCauseScheduleActivityDuplicateID
		return nil
	case "BAD_SEARCH_ATTRIBUTES":
		*v = DecisionTaskFailedCauseBadSearchAttributes
		return nil
	default:
		val, err := strconv.ParseInt(s, 10, 32)
		if err != nil {
			return fmt.Errorf("unknown enum value %q for %q: %v", s, "DecisionTaskFailedCause", err)
		}
		*v = DecisionTaskFailedCause(val)
		return nil
	}
}

// MarshalText encodes DecisionTaskFailedCause 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 DecisionTaskFailedCause) MarshalText() ([]byte, error) {
	switch int32(v) {
	case 0:
		return []byte("UNHANDLED_DECISION"), nil
	case 1:
		return []byte("BAD_SCHEDULE_ACTIVITY_ATTRIBUTES"), nil
	case 2:
		return []byte("BAD_REQUEST_CANCEL_ACTIVITY_ATTRIBUTES"), nil
	case 3:
		return []byte("BAD_START_TIMER_ATTRIBUTES"), nil
	case 4:
		return []byte("BAD_CANCEL_TIMER_ATTRIBUTES"), nil
	case 5:
		return []byte("BAD_RECORD_MARKER_ATTRIBUTES"), nil
	case 6:
		return []byte("BAD_COMPLETE_WORKFLOW_EXECUTION_ATTRIBUTES"), nil
	case 7:
		return []byte("BAD_FAIL_WORKFLOW_EXECUTION_ATTRIBUTES"), nil
	case 8:
		return []byte("BAD_CANCEL_WORKFLOW_EXECUTION_ATTRIBUTES"), nil
	case 9:
		return []byte("BAD_REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_ATTRIBUTES"), nil
	case 10:
		return []byte("BAD_CONTINUE_AS_NEW_ATTRIBUTES"), nil
	case 11:
		return []byte("START_TIMER_DUPLICATE_ID"), nil
	case 12:
		return []byte("RESET_STICKY_TASKLIST"), nil
	case 13:
		return []byte("WORKFLOW_WORKER_UNHANDLED_FAILURE"), nil
	case 14:
		return []byte("BAD_SIGNAL_WORKFLOW_EXECUTION_ATTRIBUTES"), nil
	case 15:
		return []byte("BAD_START_CHILD_EXECUTION_ATTRIBUTES"), nil
	case 16:
		return []byte("FORCE_CLOSE_DECISION"), nil
	case 17:
		return []byte("FAILOVER_CLOSE_DECISION"), nil
	case 18:
		return []byte("BAD_SIGNAL_INPUT_SIZE"), nil
	case 19:
		return []byte("RESET_WORKFLOW"), nil
	case 20:
		return []byte("BAD_BINARY"), nil
	case 21:
		return []byte("SCHEDULE_ACTIVITY_DUPLICATE_ID"), nil
	case 22:
		return []byte("BAD_SEARCH_ATTRIBUTES"), nil
	}
	return []byte(strconv.FormatInt(int64(v), 10)), nil
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of DecisionTaskFailedCause.
// 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 DecisionTaskFailedCause) MarshalLogObject(enc zapcore.ObjectEncoder) error {
	enc.AddInt32("value", int32(v))
	switch int32(v) {
	case 0:
		enc.AddString("name", "UNHANDLED_DECISION")
	case 1:
		enc.AddString("name", "BAD_SCHEDULE_ACTIVITY_ATTRIBUTES")
	case 2:
		enc.AddString("name", "BAD_REQUEST_CANCEL_ACTIVITY_ATTRIBUTES")
	case 3:
		enc.AddString("name", "BAD_START_TIMER_ATTRIBUTES")
	case 4:
		enc.AddString("name", "BAD_CANCEL_TIMER_ATTRIBUTES")
	case 5:
		enc.AddString("name", "BAD_RECORD_MARKER_ATTRIBUTES")
	case 6:
		enc.AddString("name", "BAD_COMPLETE_WORKFLOW_EXECUTION_ATTRIBUTES")
	case 7:
		enc.AddString("name", "BAD_FAIL_WORKFLOW_EXECUTION_ATTRIBUTES")
	case 8:
		enc.AddString("name", "BAD_CANCEL_WORKFLOW_EXECUTION_ATTRIBUTES")
	case 9:
		enc.AddString("name", "BAD_REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_ATTRIBUTES")
	case 10:
		enc.AddString("name", "BAD_CONTINUE_AS_NEW_ATTRIBUTES")
	case 11:
		enc.AddString("name", "START_TIMER_DUPLICATE_ID")
	case 12:
		enc.AddString("name", "RESET_STICKY_TASKLIST")
	case 13:
		enc.AddString("name", "WORKFLOW_WORKER_UNHANDLED_FAILURE")
	case 14:
		enc.AddString("name", "BAD_SIGNAL_WORKFLOW_EXECUTION_ATTRIBUTES")
	case 15:
		enc.AddString("name", "BAD_START_CHILD_EXECUTION_ATTRIBUTES")
	case 16:
		enc.AddString("name", "FORCE_CLOSE_DECISION")
	case 17:
		enc.AddString("name", "FAILOVER_CLOSE_DECISION")
	case 18:
		enc.AddString("name", "BAD_SIGNAL_INPUT_SIZE")
	case 19:
		enc.AddString("name", "RESET_WORKFLOW")
	case 20:
		enc.AddString("name", "BAD_BINARY")
	case 21:
		enc.AddString("name", "SCHEDULE_ACTIVITY_DUPLICATE_ID")
	case 22:
		enc.AddString("name", "BAD_SEARCH_ATTRIBUTES")
	}
	return nil
}

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

// ToWire translates DecisionTaskFailedCause 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 DecisionTaskFailedCause) ToWire() (wire.Value, error) {
	return wire.NewValueI32(int32(v)), nil
}

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

// String returns a readable string representation of DecisionTaskFailedCause.
func (v DecisionTaskFailedCause) String() string {
	w := int32(v)
	switch w {
	case 0:
		return "UNHANDLED_DECISION"
	case 1:
		return "BAD_SCHEDULE_ACTIVITY_ATTRIBUTES"
	case 2:
		return "BAD_REQUEST_CANCEL_ACTIVITY_ATTRIBUTES"
	case 3:
		return "BAD_START_TIMER_ATTRIBUTES"
	case 4:
		return "BAD_CANCEL_TIMER_ATTRIBUTES"
	case 5:
		return "BAD_RECORD_MARKER_ATTRIBUTES"
	case 6:
		return "BAD_COMPLETE_WORKFLOW_EXECUTION_ATTRIBUTES"
	case 7:
		return "BAD_FAIL_WORKFLOW_EXECUTION_ATTRIBUTES"
	case 8:
		return "BAD_CANCEL_WORKFLOW_EXECUTION_ATTRIBUTES"
	case 9:
		return "BAD_REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_ATTRIBUTES"
	case 10:
		return "BAD_CONTINUE_AS_NEW_ATTRIBUTES"
	case 11:
		return "START_TIMER_DUPLICATE_ID"
	case 12:
		return "RESET_STICKY_TASKLIST"
	case 13:
		return "WORKFLOW_WORKER_UNHANDLED_FAILURE"
	case 14:
		return "BAD_SIGNAL_WORKFLOW_EXECUTION_ATTRIBUTES"
	case 15:
		return "BAD_START_CHILD_EXECUTION_ATTRIBUTES"
	case 16:
		return "FORCE_CLOSE_DECISION"
	case 17:
		return "FAILOVER_CLOSE_DECISION"
	case 18:
		return "BAD_SIGNAL_INPUT_SIZE"
	case 19:
		return "RESET_WORKFLOW"
	case 20:
		return "BAD_BINARY"
	case 21:
		return "SCHEDULE_ACTIVITY_DUPLICATE_ID"
	case 22:
		return "BAD_SEARCH_ATTRIBUTES"
	}
	return fmt.Sprintf("DecisionTaskFailedCause(%d)", w)
}

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

// MarshalJSON serializes DecisionTaskFailedCause into JSON.
//
// If the enum value is recognized, its name is returned. Otherwise,
// its integer value is returned.
//
// This implements json.Marshaler.
func (v DecisionTaskFailedCause) MarshalJSON() ([]byte, error) {
	switch int32(v) {
	case 0:
		return ([]byte)("\"UNHANDLED_DECISION\""), nil
	case 1:
		return ([]byte)("\"BAD_SCHEDULE_ACTIVITY_ATTRIBUTES\""), nil
	case 2:
		return ([]byte)("\"BAD_REQUEST_CANCEL_ACTIVITY_ATTRIBUTES\""), nil
	case 3:
		return ([]byte)("\"BAD_START_TIMER_ATTRIBUTES\""), nil
	case 4:
		return ([]byte)("\"BAD_CANCEL_TIMER_ATTRIBUTES\""), nil
	case 5:
		return ([]byte)("\"BAD_RECORD_MARKER_ATTRIBUTES\""), nil
	case 6:
		return ([]byte)("\"BAD_COMPLETE_WORKFLOW_EXECUTION_ATTRIBUTES\""), nil
	case 7:
		return ([]byte)("\"BAD_FAIL_WORKFLOW_EXECUTION_ATTRIBUTES\""), nil
	case 8:
		return ([]byte)("\"BAD_CANCEL_WORKFLOW_EXECUTION_ATTRIBUTES\""), nil
	case 9:
		return ([]byte)("\"BAD_REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_ATTRIBUTES\""), nil
	case 10:
		return ([]byte)("\"BAD_CONTINUE_AS_NEW_ATTRIBUTES\""), nil
	case 11:
		return ([]byte)("\"START_TIMER_DUPLICATE_ID\""), nil
	case 12:
		return ([]byte)("\"RESET_STICKY_TASKLIST\""), nil
	case 13:
		return ([]byte)("\"WORKFLOW_WORKER_UNHANDLED_FAILURE\""), nil
	case 14:
		return ([]byte)("\"BAD_SIGNAL_WORKFLOW_EXECUTION_ATTRIBUTES\""), nil
	case 15:
		return ([]byte)("\"BAD_START_CHILD_EXECUTION_ATTRIBUTES\""), nil
	case 16:
		return ([]byte)("\"FORCE_CLOSE_DECISION\""), nil
	case 17:
		return ([]byte)("\"FAILOVER_CLOSE_DECISION\""), nil
	case 18:
		return ([]byte)("\"BAD_SIGNAL_INPUT_SIZE\""), nil
	case 19:
		return ([]byte)("\"RESET_WORKFLOW\""), nil
	case 20:
		return ([]byte)("\"BAD_BINARY\""), nil
	case 21:
		return ([]byte)("\"SCHEDULE_ACTIVITY_DUPLICATE_ID\""), nil
	case 22:
		return ([]byte)("\"BAD_SEARCH_ATTRIBUTES\""), nil
	}
	return ([]byte)(strconv.FormatInt(int64(v), 10)), nil
}

// UnmarshalJSON attempts to decode DecisionTaskFailedCause 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 *DecisionTaskFailedCause) 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, "DecisionTaskFailedCause")
		}
		if x < math.MinInt32 {
			return fmt.Errorf("enum underflow from JSON %q for %q", text, "DecisionTaskFailedCause")
		}
		*v = (DecisionTaskFailedCause)(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, "DecisionTaskFailedCause")
	}
}

type DecisionTaskFailedEventAttributes struct {
	ScheduledEventId *int64                   `json:"scheduledEventId,omitempty"`
	StartedEventId   *int64                   `json:"startedEventId,omitempty"`
	Cause            *DecisionTaskFailedCause `json:"cause,omitempty"`
	Details          []byte                   `json:"details,omitempty"`
	Identity         *string                  `json:"identity,omitempty"`
	Reason           *string                  `json:"reason,omitempty"`
	BaseRunId        *string                  `json:"baseRunId,omitempty"`
	NewRunId         *string                  `json:"newRunId,omitempty"`
	ForkEventVersion *int64                   `json:"forkEventVersion,omitempty"`
	BinaryChecksum   *string                  `json:"binaryChecksum,omitempty"`
	RequestId        *string                  `json:"requestId,omitempty"`
}

// ToWire translates a DecisionTaskFailedEventAttributes 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 *DecisionTaskFailedEventAttributes) ToWire() (wire.Value, error) {
	var (
		fields [11]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.ScheduledEventId != nil {
		w, err = wire.NewValueI64(*(v.ScheduledEventId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, 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: 20, Value: w}
		i++
	}
	if v.Cause != nil {
		w, err = v.Cause.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.Details != nil {
		w, err = wire.NewValueBinary(v.Details), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 35, 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: 40, Value: w}
		i++
	}
	if v.Reason != nil {
		w, err = wire.NewValueString(*(v.Reason)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 50, Value: w}
		i++
	}
	if v.BaseRunId != nil {
		w, err = wire.NewValueString(*(v.BaseRunId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 60, Value: w}
		i++
	}
	if v.NewRunId != nil {
		w, err = wire.NewValueString(*(v.NewRunId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 70, Value: w}
		i++
	}
	if v.ForkEventVersion != nil {
		w, err = wire.NewValueI64(*(v.ForkEventVersion)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 80, Value: w}
		i++
	}
	if v.BinaryChecksum != nil {
		w, err = wire.NewValueString(*(v.BinaryChecksum)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 90, Value: w}
		i++
	}
	if v.RequestId != nil {
		w, err = wire.NewValueString(*(v.RequestId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 100, Value: w}
		i++
	}

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

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

// FromWire deserializes a DecisionTaskFailedEventAttributes 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 DecisionTaskFailedEventAttributes struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v DecisionTaskFailedEventAttributes
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *DecisionTaskFailedEventAttributes) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			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 20:
			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 30:
			if field.Value.Type() == wire.TI32 {
				var x DecisionTaskFailedCause
				x, err = _DecisionTaskFailedCause_Read(field.Value)
				v.Cause = &x
				if err != nil {
					return err
				}

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

			}
		case 40:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.Identity = &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.Reason = &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.BaseRunId = &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.NewRunId = &x
				if err != nil {
					return err
				}

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

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

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

			}
		}
	}

	return nil
}

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

	var fields [11]string
	i := 0
	if v.ScheduledEventId != nil {
		fields[i] = fmt.Sprintf("ScheduledEventId: %v", *(v.ScheduledEventId))
		i++
	}
	if v.StartedEventId != nil {
		fields[i] = fmt.Sprintf("StartedEventId: %v", *(v.StartedEventId))
		i++
	}
	if v.Cause != nil {
		fields[i] = fmt.Sprintf("Cause: %v", *(v.Cause))
		i++
	}
	if v.Details != nil {
		fields[i] = fmt.Sprintf("Details: %v", v.Details)
		i++
	}
	if v.Identity != nil {
		fields[i] = fmt.Sprintf("Identity: %v", *(v.Identity))
		i++
	}
	if v.Reason != nil {
		fields[i] = fmt.Sprintf("Reason: %v", *(v.Reason))
		i++
	}
	if v.BaseRunId != nil {
		fields[i] = fmt.Sprintf("BaseRunId: %v", *(v.BaseRunId))
		i++
	}
	if v.NewRunId != nil {
		fields[i] = fmt.Sprintf("NewRunId: %v", *(v.NewRunId))
		i++
	}
	if v.ForkEventVersion != nil {
		fields[i] = fmt.Sprintf("ForkEventVersion: %v", *(v.ForkEventVersion))
		i++
	}
	if v.BinaryChecksum != nil {
		fields[i] = fmt.Sprintf("BinaryChecksum: %v", *(v.BinaryChecksum))
		i++
	}
	if v.RequestId != nil {
		fields[i] = fmt.Sprintf("RequestId: %v", *(v.RequestId))
		i++
	}

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

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

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

// Equals returns true if all the fields of this DecisionTaskFailedEventAttributes match the
// provided DecisionTaskFailedEventAttributes.
//
// This function performs a deep comparison.
func (v *DecisionTaskFailedEventAttributes) Equals(rhs *DecisionTaskFailedEventAttributes) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_I64_EqualsPtr(v.ScheduledEventId, rhs.ScheduledEventId) {
		return false
	}
	if !_I64_EqualsPtr(v.StartedEventId, rhs.StartedEventId) {
		return false
	}
	if !_DecisionTaskFailedCause_EqualsPtr(v.Cause, rhs.Cause) {
		return false
	}
	if !((v.Details == nil && rhs.Details == nil) || (v.Details != nil && rhs.Details != nil && bytes.Equal(v.Details, rhs.Details))) {
		return false
	}
	if !_String_EqualsPtr(v.Identity, rhs.Identity) {
		return false
	}
	if !_String_EqualsPtr(v.Reason, rhs.Reason) {
		return false
	}
	if !_String_EqualsPtr(v.BaseRunId, rhs.BaseRunId) {
		return false
	}
	if !_String_EqualsPtr(v.NewRunId, rhs.NewRunId) {
		return false
	}
	if !_I64_EqualsPtr(v.ForkEventVersion, rhs.ForkEventVersion) {
		return false
	}
	if !_String_EqualsPtr(v.BinaryChecksum, rhs.BinaryChecksum) {
		return false
	}
	if !_String_EqualsPtr(v.RequestId, rhs.RequestId) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of DecisionTaskFailedEventAttributes.
func (v *DecisionTaskFailedEventAttributes) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.ScheduledEventId != nil {
		enc.AddInt64("scheduledEventId", *v.ScheduledEventId)
	}
	if v.StartedEventId != nil {
		enc.AddInt64("startedEventId", *v.StartedEventId)
	}
	if v.Cause != nil {
		err = multierr.Append(err, enc.AddObject("cause", *v.Cause))
	}
	if v.Details != nil {
		enc.AddString("details", base64.StdEncoding.EncodeToString(v.Details))
	}
	if v.Identity != nil {
		enc.AddString("identity", *v.Identity)
	}
	if v.Reason != nil {
		enc.AddString("reason", *v.Reason)
	}
	if v.BaseRunId != nil {
		enc.AddString("baseRunId", *v.BaseRunId)
	}
	if v.NewRunId != nil {
		enc.AddString("newRunId", *v.NewRunId)
	}
	if v.ForkEventVersion != nil {
		enc.AddInt64("forkEventVersion", *v.ForkEventVersion)
	}
	if v.BinaryChecksum != nil {
		enc.AddString("binaryChecksum", *v.BinaryChecksum)
	}
	if v.RequestId != nil {
		enc.AddString("requestId", *v.RequestId)
	}
	return err
}

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

	return
}

// IsSetScheduledEventId returns true if ScheduledEventId is not nil.
func (v *DecisionTaskFailedEventAttributes) IsSetScheduledEventId() bool {
	return v != nil && v.ScheduledEventId != nil
}

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

	return
}

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

// GetCause returns the value of Cause if it is set or its
// zero value if it is unset.
func (v *DecisionTaskFailedEventAttributes) GetCause() (o DecisionTaskFailedCause) {
	if v != nil && v.Cause != nil {
		return *v.Cause
	}

	return
}

// IsSetCause returns true if Cause is not nil.
func (v *DecisionTaskFailedEventAttributes) IsSetCause() bool {
	return v != nil && v.Cause != nil
}

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

	return
}

// IsSetDetails returns true if Details is not nil.
func (v *DecisionTaskFailedEventAttributes) IsSetDetails() bool {
	return v != nil && v.Details != nil
}

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

	return
}

// IsSetIdentity returns true if Identity is not nil.
func (v *DecisionTaskFailedEventAttributes) IsSetIdentity() bool {
	return v != nil && v.Identity != nil
}

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

	return
}

// IsSetReason returns true if Reason is not nil.
func (v *DecisionTaskFailedEventAttributes) IsSetReason() bool {
	return v != nil && v.Reason != nil
}

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

	return
}

// IsSetBaseRunId returns true if BaseRunId is not nil.
func (v *DecisionTaskFailedEventAttributes) IsSetBaseRunId() bool {
	return v != nil && v.BaseRunId != nil
}

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

	return
}

// IsSetNewRunId returns true if NewRunId is not nil.
func (v *DecisionTaskFailedEventAttributes) IsSetNewRunId() bool {
	return v != nil && v.NewRunId != nil
}

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

	return
}

// IsSetForkEventVersion returns true if ForkEventVersion is not nil.
func (v *DecisionTaskFailedEventAttributes) IsSetForkEventVersion() bool {
	return v != nil && v.ForkEventVersion != nil
}

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

	return
}

// IsSetBinaryChecksum returns true if BinaryChecksum is not nil.
func (v *DecisionTaskFailedEventAttributes) IsSetBinaryChecksum() bool {
	return v != nil && v.BinaryChecksum != nil
}

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

	return
}

// IsSetRequestId returns true if RequestId is not nil.
func (v *DecisionTaskFailedEventAttributes) IsSetRequestId() bool {
	return v != nil && v.RequestId != nil
}

type DecisionTaskScheduledEventAttributes struct {
	TaskList                   *TaskList `json:"taskList,omitempty"`
	StartToCloseTimeoutSeconds *int32    `json:"startToCloseTimeoutSeconds,omitempty"`
	Attempt                    *int64    `json:"attempt,omitempty"`
}

// ToWire translates a DecisionTaskScheduledEventAttributes 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 *DecisionTaskScheduledEventAttributes) ToWire() (wire.Value, error) {
	var (
		fields [3]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.TaskList != nil {
		w, err = v.TaskList.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.StartToCloseTimeoutSeconds != nil {
		w, err = wire.NewValueI32(*(v.StartToCloseTimeoutSeconds)), 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++
	}

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

// FromWire deserializes a DecisionTaskScheduledEventAttributes 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 DecisionTaskScheduledEventAttributes struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v DecisionTaskScheduledEventAttributes
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *DecisionTaskScheduledEventAttributes) 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.TaskList, err = _TaskList_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 20:
			if field.Value.Type() == wire.TI32 {
				var x int32
				x, err = field.Value.GetI32(), error(nil)
				v.StartToCloseTimeoutSeconds = &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
				}

			}
		}
	}

	return nil
}

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

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

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

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

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of DecisionTaskScheduledEventAttributes.
func (v *DecisionTaskScheduledEventAttributes) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.TaskList != nil {
		err = multierr.Append(err, enc.AddObject("taskList", v.TaskList))
	}
	if v.StartToCloseTimeoutSeconds != nil {
		enc.AddInt32("startToCloseTimeoutSeconds", *v.StartToCloseTimeoutSeconds)
	}
	if v.Attempt != nil {
		enc.AddInt64("attempt", *v.Attempt)
	}
	return err
}

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

	return
}

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

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

	return
}

// IsSetStartToCloseTimeoutSeconds returns true if StartToCloseTimeoutSeconds is not nil.
func (v *DecisionTaskScheduledEventAttributes) IsSetStartToCloseTimeoutSeconds() bool {
	return v != nil && v.StartToCloseTimeoutSeconds != nil
}

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

	return
}

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

type DecisionTaskStartedEventAttributes struct {
	ScheduledEventId *int64  `json:"scheduledEventId,omitempty"`
	Identity         *string `json:"identity,omitempty"`
	RequestId        *string `json:"requestId,omitempty"`
}

// ToWire translates a DecisionTaskStartedEventAttributes 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 *DecisionTaskStartedEventAttributes) ToWire() (wire.Value, error) {
	var (
		fields [3]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.ScheduledEventId != nil {
		w, err = wire.NewValueI64(*(v.ScheduledEventId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, 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: 20, Value: w}
		i++
	}
	if v.RequestId != nil {
		w, err = wire.NewValueString(*(v.RequestId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}

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

// FromWire deserializes a DecisionTaskStartedEventAttributes 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 DecisionTaskStartedEventAttributes struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v DecisionTaskStartedEventAttributes
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *DecisionTaskStartedEventAttributes) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			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 20:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.Identity = &x
				if err != nil {
					return err
				}

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

			}
		}
	}

	return nil
}

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

	var fields [3]string
	i := 0
	if v.ScheduledEventId != nil {
		fields[i] = fmt.Sprintf("ScheduledEventId: %v", *(v.ScheduledEventId))
		i++
	}
	if v.Identity != nil {
		fields[i] = fmt.Sprintf("Identity: %v", *(v.Identity))
		i++
	}
	if v.RequestId != nil {
		fields[i] = fmt.Sprintf("RequestId: %v", *(v.RequestId))
		i++
	}

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

// Equals returns true if all the fields of this DecisionTaskStartedEventAttributes match the
// provided DecisionTaskStartedEventAttributes.
//
// This function performs a deep comparison.
func (v *DecisionTaskStartedEventAttributes) Equals(rhs *DecisionTaskStartedEventAttributes) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_I64_EqualsPtr(v.ScheduledEventId, rhs.ScheduledEventId) {
		return false
	}
	if !_String_EqualsPtr(v.Identity, rhs.Identity) {
		return false
	}
	if !_String_EqualsPtr(v.RequestId, rhs.RequestId) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of DecisionTaskStartedEventAttributes.
func (v *DecisionTaskStartedEventAttributes) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.ScheduledEventId != nil {
		enc.AddInt64("scheduledEventId", *v.ScheduledEventId)
	}
	if v.Identity != nil {
		enc.AddString("identity", *v.Identity)
	}
	if v.RequestId != nil {
		enc.AddString("requestId", *v.RequestId)
	}
	return err
}

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

	return
}

// IsSetScheduledEventId returns true if ScheduledEventId is not nil.
func (v *DecisionTaskStartedEventAttributes) IsSetScheduledEventId() bool {
	return v != nil && v.ScheduledEventId != nil
}

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

	return
}

// IsSetIdentity returns true if Identity is not nil.
func (v *DecisionTaskStartedEventAttributes) IsSetIdentity() bool {
	return v != nil && v.Identity != nil
}

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

	return
}

// IsSetRequestId returns true if RequestId is not nil.
func (v *DecisionTaskStartedEventAttributes) IsSetRequestId() bool {
	return v != nil && v.RequestId != nil
}

type DecisionTaskTimedOutCause int32

const (
	DecisionTaskTimedOutCauseTimeout DecisionTaskTimedOutCause = 0
	DecisionTaskTimedOutCauseReset   DecisionTaskTimedOutCause = 1
)

// DecisionTaskTimedOutCause_Values returns all recognized values of DecisionTaskTimedOutCause.
func DecisionTaskTimedOutCause_Values() []DecisionTaskTimedOutCause {
	return []DecisionTaskTimedOutCause{
		DecisionTaskTimedOutCauseTimeout,
		DecisionTaskTimedOutCauseReset,
	}
}

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

// MarshalText encodes DecisionTaskTimedOutCause 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 DecisionTaskTimedOutCause) MarshalText() ([]byte, error) {
	switch int32(v) {
	case 0:
		return []byte("TIMEOUT"), nil
	case 1:
		return []byte("RESET"), nil
	}
	return []byte(strconv.FormatInt(int64(v), 10)), nil
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of DecisionTaskTimedOutCause.
// 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 DecisionTaskTimedOutCause) MarshalLogObject(enc zapcore.ObjectEncoder) error {
	enc.AddInt32("value", int32(v))
	switch int32(v) {
	case 0:
		enc.AddString("name", "TIMEOUT")
	case 1:
		enc.AddString("name", "RESET")
	}
	return nil
}

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

// ToWire translates DecisionTaskTimedOutCause 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 DecisionTaskTimedOutCause) ToWire() (wire.Value, error) {
	return wire.NewValueI32(int32(v)), nil
}

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

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

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

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

// UnmarshalJSON attempts to decode DecisionTaskTimedOutCause 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 *DecisionTaskTimedOutCause) 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, "DecisionTaskTimedOutCause")
		}
		if x < math.MinInt32 {
			return fmt.Errorf("enum underflow from JSON %q for %q", text, "DecisionTaskTimedOutCause")
		}
		*v = (DecisionTaskTimedOutCause)(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, "DecisionTaskTimedOutCause")
	}
}

type DecisionTaskTimedOutEventAttributes struct {
	ScheduledEventId *int64                     `json:"scheduledEventId,omitempty"`
	StartedEventId   *int64                     `json:"startedEventId,omitempty"`
	TimeoutType      *TimeoutType               `json:"timeoutType,omitempty"`
	BaseRunId        *string                    `json:"baseRunId,omitempty"`
	NewRunId         *string                    `json:"newRunId,omitempty"`
	ForkEventVersion *int64                     `json:"forkEventVersion,omitempty"`
	Reason           *string                    `json:"reason,omitempty"`
	Cause            *DecisionTaskTimedOutCause `json:"cause,omitempty"`
	RequestId        *string                    `json:"requestId,omitempty"`
}

// ToWire translates a DecisionTaskTimedOutEventAttributes 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 *DecisionTaskTimedOutEventAttributes) ToWire() (wire.Value, error) {
	var (
		fields [9]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.ScheduledEventId != nil {
		w, err = wire.NewValueI64(*(v.ScheduledEventId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, 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: 20, Value: w}
		i++
	}
	if v.TimeoutType != nil {
		w, err = v.TimeoutType.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.BaseRunId != nil {
		w, err = wire.NewValueString(*(v.BaseRunId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 40, Value: w}
		i++
	}
	if v.NewRunId != nil {
		w, err = wire.NewValueString(*(v.NewRunId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 50, Value: w}
		i++
	}
	if v.ForkEventVersion != nil {
		w, err = wire.NewValueI64(*(v.ForkEventVersion)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 60, Value: w}
		i++
	}
	if v.Reason != nil {
		w, err = wire.NewValueString(*(v.Reason)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 70, Value: w}
		i++
	}
	if v.Cause != nil {
		w, err = v.Cause.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 80, Value: w}
		i++
	}
	if v.RequestId != nil {
		w, err = wire.NewValueString(*(v.RequestId)), 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 _DecisionTaskTimedOutCause_Read(w wire.Value) (DecisionTaskTimedOutCause, error) {
	var v DecisionTaskTimedOutCause
	err := v.FromWire(w)
	return v, err
}

// FromWire deserializes a DecisionTaskTimedOutEventAttributes 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 DecisionTaskTimedOutEventAttributes struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v DecisionTaskTimedOutEventAttributes
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *DecisionTaskTimedOutEventAttributes) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			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 20:
			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 30:
			if field.Value.Type() == wire.TI32 {
				var x TimeoutType
				x, err = _TimeoutType_Read(field.Value)
				v.TimeoutType = &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.BaseRunId = &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.NewRunId = &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.ForkEventVersion = &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.Reason = &x
				if err != nil {
					return err
				}

			}
		case 80:
			if field.Value.Type() == wire.TI32 {
				var x DecisionTaskTimedOutCause
				x, err = _DecisionTaskTimedOutCause_Read(field.Value)
				v.Cause = &x
				if err != nil {
					return err
				}

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

			}
		}
	}

	return nil
}

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

	var fields [9]string
	i := 0
	if v.ScheduledEventId != nil {
		fields[i] = fmt.Sprintf("ScheduledEventId: %v", *(v.ScheduledEventId))
		i++
	}
	if v.StartedEventId != nil {
		fields[i] = fmt.Sprintf("StartedEventId: %v", *(v.StartedEventId))
		i++
	}
	if v.TimeoutType != nil {
		fields[i] = fmt.Sprintf("TimeoutType: %v", *(v.TimeoutType))
		i++
	}
	if v.BaseRunId != nil {
		fields[i] = fmt.Sprintf("BaseRunId: %v", *(v.BaseRunId))
		i++
	}
	if v.NewRunId != nil {
		fields[i] = fmt.Sprintf("NewRunId: %v", *(v.NewRunId))
		i++
	}
	if v.ForkEventVersion != nil {
		fields[i] = fmt.Sprintf("ForkEventVersion: %v", *(v.ForkEventVersion))
		i++
	}
	if v.Reason != nil {
		fields[i] = fmt.Sprintf("Reason: %v", *(v.Reason))
		i++
	}
	if v.Cause != nil {
		fields[i] = fmt.Sprintf("Cause: %v", *(v.Cause))
		i++
	}
	if v.RequestId != nil {
		fields[i] = fmt.Sprintf("RequestId: %v", *(v.RequestId))
		i++
	}

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

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

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

// Equals returns true if all the fields of this DecisionTaskTimedOutEventAttributes match the
// provided DecisionTaskTimedOutEventAttributes.
//
// This function performs a deep comparison.
func (v *DecisionTaskTimedOutEventAttributes) Equals(rhs *DecisionTaskTimedOutEventAttributes) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_I64_EqualsPtr(v.ScheduledEventId, rhs.ScheduledEventId) {
		return false
	}
	if !_I64_EqualsPtr(v.StartedEventId, rhs.StartedEventId) {
		return false
	}
	if !_TimeoutType_EqualsPtr(v.TimeoutType, rhs.TimeoutType) {
		return false
	}
	if !_String_EqualsPtr(v.BaseRunId, rhs.BaseRunId) {
		return false
	}
	if !_String_EqualsPtr(v.NewRunId, rhs.NewRunId) {
		return false
	}
	if !_I64_EqualsPtr(v.ForkEventVersion, rhs.ForkEventVersion) {
		return false
	}
	if !_String_EqualsPtr(v.Reason, rhs.Reason) {
		return false
	}
	if !_DecisionTaskTimedOutCause_EqualsPtr(v.Cause, rhs.Cause) {
		return false
	}
	if !_String_EqualsPtr(v.RequestId, rhs.RequestId) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of DecisionTaskTimedOutEventAttributes.
func (v *DecisionTaskTimedOutEventAttributes) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.ScheduledEventId != nil {
		enc.AddInt64("scheduledEventId", *v.ScheduledEventId)
	}
	if v.StartedEventId != nil {
		enc.AddInt64("startedEventId", *v.StartedEventId)
	}
	if v.TimeoutType != nil {
		err = multierr.Append(err, enc.AddObject("timeoutType", *v.TimeoutType))
	}
	if v.BaseRunId != nil {
		enc.AddString("baseRunId", *v.BaseRunId)
	}
	if v.NewRunId != nil {
		enc.AddString("newRunId", *v.NewRunId)
	}
	if v.ForkEventVersion != nil {
		enc.AddInt64("forkEventVersion", *v.ForkEventVersion)
	}
	if v.Reason != nil {
		enc.AddString("reason", *v.Reason)
	}
	if v.Cause != nil {
		err = multierr.Append(err, enc.AddObject("cause", *v.Cause))
	}
	if v.RequestId != nil {
		enc.AddString("requestId", *v.RequestId)
	}
	return err
}

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

	return
}

// IsSetScheduledEventId returns true if ScheduledEventId is not nil.
func (v *DecisionTaskTimedOutEventAttributes) IsSetScheduledEventId() bool {
	return v != nil && v.ScheduledEventId != nil
}

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

	return
}

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

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

	return
}

// IsSetTimeoutType returns true if TimeoutType is not nil.
func (v *DecisionTaskTimedOutEventAttributes) IsSetTimeoutType() bool {
	return v != nil && v.TimeoutType != nil
}

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

	return
}

// IsSetBaseRunId returns true if BaseRunId is not nil.
func (v *DecisionTaskTimedOutEventAttributes) IsSetBaseRunId() bool {
	return v != nil && v.BaseRunId != nil
}

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

	return
}

// IsSetNewRunId returns true if NewRunId is not nil.
func (v *DecisionTaskTimedOutEventAttributes) IsSetNewRunId() bool {
	return v != nil && v.NewRunId != nil
}

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

	return
}

// IsSetForkEventVersion returns true if ForkEventVersion is not nil.
func (v *DecisionTaskTimedOutEventAttributes) IsSetForkEventVersion() bool {
	return v != nil && v.ForkEventVersion != nil
}

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

	return
}

// IsSetReason returns true if Reason is not nil.
func (v *DecisionTaskTimedOutEventAttributes) IsSetReason() bool {
	return v != nil && v.Reason != nil
}

// GetCause returns the value of Cause if it is set or its
// zero value if it is unset.
func (v *DecisionTaskTimedOutEventAttributes) GetCause() (o DecisionTaskTimedOutCause) {
	if v != nil && v.Cause != nil {
		return *v.Cause
	}

	return
}

// IsSetCause returns true if Cause is not nil.
func (v *DecisionTaskTimedOutEventAttributes) IsSetCause() bool {
	return v != nil && v.Cause != nil
}

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

	return
}

// IsSetRequestId returns true if RequestId is not nil.
func (v *DecisionTaskTimedOutEventAttributes) IsSetRequestId() bool {
	return v != nil && v.RequestId != nil
}

type DecisionType int32

const (
	DecisionTypeScheduleActivityTask                   DecisionType = 0
	DecisionTypeRequestCancelActivityTask              DecisionType = 1
	DecisionTypeStartTimer                             DecisionType = 2
	DecisionTypeCompleteWorkflowExecution              DecisionType = 3
	DecisionTypeFailWorkflowExecution                  DecisionType = 4
	DecisionTypeCancelTimer                            DecisionType = 5
	DecisionTypeCancelWorkflowExecution                DecisionType = 6
	DecisionTypeRequestCancelExternalWorkflowExecution DecisionType = 7
	DecisionTypeRecordMarker                           DecisionType = 8
	DecisionTypeContinueAsNewWorkflowExecution         DecisionType = 9
	DecisionTypeStartChildWorkflowExecution            DecisionType = 10
	DecisionTypeSignalExternalWorkflowExecution        DecisionType = 11
	DecisionTypeUpsertWorkflowSearchAttributes         DecisionType = 12
)

// DecisionType_Values returns all recognized values of DecisionType.
func DecisionType_Values() []DecisionType {
	return []DecisionType{
		DecisionTypeScheduleActivityTask,
		DecisionTypeRequestCancelActivityTask,
		DecisionTypeStartTimer,
		DecisionTypeCompleteWorkflowExecution,
		DecisionTypeFailWorkflowExecution,
		DecisionTypeCancelTimer,
		DecisionTypeCancelWorkflowExecution,
		DecisionTypeRequestCancelExternalWorkflowExecution,
		DecisionTypeRecordMarker,
		DecisionTypeContinueAsNewWorkflowExecution,
		DecisionTypeStartChildWorkflowExecution,
		DecisionTypeSignalExternalWorkflowExecution,
		DecisionTypeUpsertWorkflowSearchAttributes,
	}
}

// UnmarshalText tries to decode DecisionType from a byte slice
// containing its name.
//
//	var v DecisionType
//	err := v.UnmarshalText([]byte("ScheduleActivityTask"))
func (v *DecisionType) UnmarshalText(value []byte) error {
	switch s := string(value); s {
	case "ScheduleActivityTask":
		*v = DecisionTypeScheduleActivityTask
		return nil
	case "RequestCancelActivityTask":
		*v = DecisionTypeRequestCancelActivityTask
		return nil
	case "StartTimer":
		*v = DecisionTypeStartTimer
		return nil
	case "CompleteWorkflowExecution":
		*v = DecisionTypeCompleteWorkflowExecution
		return nil
	case "FailWorkflowExecution":
		*v = DecisionTypeFailWorkflowExecution
		return nil
	case "CancelTimer":
		*v = DecisionTypeCancelTimer
		return nil
	case "CancelWorkflowExecution":
		*v = DecisionTypeCancelWorkflowExecution
		return nil
	case "RequestCancelExternalWorkflowExecution":
		*v = DecisionTypeRequestCancelExternalWorkflowExecution
		return nil
	case "RecordMarker":
		*v = DecisionTypeRecordMarker
		return nil
	case "ContinueAsNewWorkflowExecution":
		*v = DecisionTypeContinueAsNewWorkflowExecution
		return nil
	case "StartChildWorkflowExecution":
		*v = DecisionTypeStartChildWorkflowExecution
		return nil
	case "SignalExternalWorkflowExecution":
		*v = DecisionTypeSignalExternalWorkflowExecution
		return nil
	case "UpsertWorkflowSearchAttributes":
		*v = DecisionTypeUpsertWorkflowSearchAttributes
		return nil
	default:
		val, err := strconv.ParseInt(s, 10, 32)
		if err != nil {
			return fmt.Errorf("unknown enum value %q for %q: %v", s, "DecisionType", err)
		}
		*v = DecisionType(val)
		return nil
	}
}

// MarshalText encodes DecisionType 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 DecisionType) MarshalText() ([]byte, error) {
	switch int32(v) {
	case 0:
		return []byte("ScheduleActivityTask"), nil
	case 1:
		return []byte("RequestCancelActivityTask"), nil
	case 2:
		return []byte("StartTimer"), nil
	case 3:
		return []byte("CompleteWorkflowExecution"), nil
	case 4:
		return []byte("FailWorkflowExecution"), nil
	case 5:
		return []byte("CancelTimer"), nil
	case 6:
		return []byte("CancelWorkflowExecution"), nil
	case 7:
		return []byte("RequestCancelExternalWorkflowExecution"), nil
	case 8:
		return []byte("RecordMarker"), nil
	case 9:
		return []byte("ContinueAsNewWorkflowExecution"), nil
	case 10:
		return []byte("StartChildWorkflowExecution"), nil
	case 11:
		return []byte("SignalExternalWorkflowExecution"), nil
	case 12:
		return []byte("UpsertWorkflowSearchAttributes"), nil
	}
	return []byte(strconv.FormatInt(int64(v), 10)), nil
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of DecisionType.
// 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 DecisionType) MarshalLogObject(enc zapcore.ObjectEncoder) error {
	enc.AddInt32("value", int32(v))
	switch int32(v) {
	case 0:
		enc.AddString("name", "ScheduleActivityTask")
	case 1:
		enc.AddString("name", "RequestCancelActivityTask")
	case 2:
		enc.AddString("name", "StartTimer")
	case 3:
		enc.AddString("name", "CompleteWorkflowExecution")
	case 4:
		enc.AddString("name", "FailWorkflowExecution")
	case 5:
		enc.AddString("name", "CancelTimer")
	case 6:
		enc.AddString("name", "CancelWorkflowExecution")
	case 7:
		enc.AddString("name", "RequestCancelExternalWorkflowExecution")
	case 8:
		enc.AddString("name", "RecordMarker")
	case 9:
		enc.AddString("name", "ContinueAsNewWorkflowExecution")
	case 10:
		enc.AddString("name", "StartChildWorkflowExecution")
	case 11:
		enc.AddString("name", "SignalExternalWorkflowExecution")
	case 12:
		enc.AddString("name", "UpsertWorkflowSearchAttributes")
	}
	return nil
}

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

// ToWire translates DecisionType 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 DecisionType) ToWire() (wire.Value, error) {
	return wire.NewValueI32(int32(v)), nil
}

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

// String returns a readable string representation of DecisionType.
func (v DecisionType) String() string {
	w := int32(v)
	switch w {
	case 0:
		return "ScheduleActivityTask"
	case 1:
		return "RequestCancelActivityTask"
	case 2:
		return "StartTimer"
	case 3:
		return "CompleteWorkflowExecution"
	case 4:
		return "FailWorkflowExecution"
	case 5:
		return "CancelTimer"
	case 6:
		return "CancelWorkflowExecution"
	case 7:
		return "RequestCancelExternalWorkflowExecution"
	case 8:
		return "RecordMarker"
	case 9:
		return "ContinueAsNewWorkflowExecution"
	case 10:
		return "StartChildWorkflowExecution"
	case 11:
		return "SignalExternalWorkflowExecution"
	case 12:
		return "UpsertWorkflowSearchAttributes"
	}
	return fmt.Sprintf("DecisionType(%d)", w)
}

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

// MarshalJSON serializes DecisionType into JSON.
//
// If the enum value is recognized, its name is returned. Otherwise,
// its integer value is returned.
//
// This implements json.Marshaler.
func (v DecisionType) MarshalJSON() ([]byte, error) {
	switch int32(v) {
	case 0:
		return ([]byte)("\"ScheduleActivityTask\""), nil
	case 1:
		return ([]byte)("\"RequestCancelActivityTask\""), nil
	case 2:
		return ([]byte)("\"StartTimer\""), nil
	case 3:
		return ([]byte)("\"CompleteWorkflowExecution\""), nil
	case 4:
		return ([]byte)("\"FailWorkflowExecution\""), nil
	case 5:
		return ([]byte)("\"CancelTimer\""), nil
	case 6:
		return ([]byte)("\"CancelWorkflowExecution\""), nil
	case 7:
		return ([]byte)("\"RequestCancelExternalWorkflowExecution\""), nil
	case 8:
		return ([]byte)("\"RecordMarker\""), nil
	case 9:
		return ([]byte)("\"ContinueAsNewWorkflowExecution\""), nil
	case 10:
		return ([]byte)("\"StartChildWorkflowExecution\""), nil
	case 11:
		return ([]byte)("\"SignalExternalWorkflowExecution\""), nil
	case 12:
		return ([]byte)("\"UpsertWorkflowSearchAttributes\""), nil
	}
	return ([]byte)(strconv.FormatInt(int64(v), 10)), nil
}

// UnmarshalJSON attempts to decode DecisionType 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 *DecisionType) 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, "DecisionType")
		}
		if x < math.MinInt32 {
			return fmt.Errorf("enum underflow from JSON %q for %q", text, "DecisionType")
		}
		*v = (DecisionType)(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, "DecisionType")
	}
}

type DeleteDomainRequest struct {
	Name          *string `json:"name,omitempty"`
	SecurityToken *string `json:"securityToken,omitempty"`
}

// ToWire translates a DeleteDomainRequest 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 *DeleteDomainRequest) ToWire() (wire.Value, error) {
	var (
		fields [2]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.Name != nil {
		w, err = wire.NewValueString(*(v.Name)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.SecurityToken != nil {
		w, err = wire.NewValueString(*(v.SecurityToken)), 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
}

// FromWire deserializes a DeleteDomainRequest 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 DeleteDomainRequest struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v DeleteDomainRequest
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *DeleteDomainRequest) 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.Name = &x
				if err != nil {
					return err
				}

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

			}
		}
	}

	return nil
}

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

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

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

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

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of DeleteDomainRequest.
func (v *DeleteDomainRequest) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Name != nil {
		enc.AddString("name", *v.Name)
	}
	if v.SecurityToken != nil {
		enc.AddString("securityToken", *v.SecurityToken)
	}
	return err
}

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

	return
}

// IsSetName returns true if Name is not nil.
func (v *DeleteDomainRequest) IsSetName() bool {
	return v != nil && v.Name != nil
}

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

	return
}

// IsSetSecurityToken returns true if SecurityToken is not nil.
func (v *DeleteDomainRequest) IsSetSecurityToken() bool {
	return v != nil && v.SecurityToken != nil
}

type DeprecateDomainRequest struct {
	Name          *string `json:"name,omitempty"`
	SecurityToken *string `json:"securityToken,omitempty"`
}

// ToWire translates a DeprecateDomainRequest 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 *DeprecateDomainRequest) ToWire() (wire.Value, error) {
	var (
		fields [2]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.Name != nil {
		w, err = wire.NewValueString(*(v.Name)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.SecurityToken != nil {
		w, err = wire.NewValueString(*(v.SecurityToken)), 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
}

// FromWire deserializes a DeprecateDomainRequest 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 DeprecateDomainRequest struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v DeprecateDomainRequest
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *DeprecateDomainRequest) 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.Name = &x
				if err != nil {
					return err
				}

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

			}
		}
	}

	return nil
}

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

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

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

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

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of DeprecateDomainRequest.
func (v *DeprecateDomainRequest) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Name != nil {
		enc.AddString("name", *v.Name)
	}
	if v.SecurityToken != nil {
		enc.AddString("securityToken", *v.SecurityToken)
	}
	return err
}

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

	return
}

// IsSetName returns true if Name is not nil.
func (v *DeprecateDomainRequest) IsSetName() bool {
	return v != nil && v.Name != nil
}

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

	return
}

// IsSetSecurityToken returns true if SecurityToken is not nil.
func (v *DeprecateDomainRequest) IsSetSecurityToken() bool {
	return v != nil && v.SecurityToken != nil
}

type DescribeDomainRequest struct {
	Name *string `json:"name,omitempty"`
	UUID *string `json:"uuid,omitempty"`
}

// ToWire translates a DescribeDomainRequest 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 *DescribeDomainRequest) ToWire() (wire.Value, error) {
	var (
		fields [2]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.Name != nil {
		w, err = wire.NewValueString(*(v.Name)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.UUID != nil {
		w, err = wire.NewValueString(*(v.UUID)), 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
}

// FromWire deserializes a DescribeDomainRequest 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 DescribeDomainRequest struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v DescribeDomainRequest
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *DescribeDomainRequest) 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.Name = &x
				if err != nil {
					return err
				}

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

			}
		}
	}

	return nil
}

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

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

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

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

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of DescribeDomainRequest.
func (v *DescribeDomainRequest) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Name != nil {
		enc.AddString("name", *v.Name)
	}
	if v.UUID != nil {
		enc.AddString("uuid", *v.UUID)
	}
	return err
}

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

	return
}

// IsSetName returns true if Name is not nil.
func (v *DescribeDomainRequest) IsSetName() bool {
	return v != nil && v.Name != nil
}

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

	return
}

// IsSetUUID returns true if UUID is not nil.
func (v *DescribeDomainRequest) IsSetUUID() bool {
	return v != nil && v.UUID != nil
}

type DescribeDomainResponse struct {
	DomainInfo               *DomainInfo                     `json:"domainInfo,omitempty"`
	Configuration            *DomainConfiguration            `json:"configuration,omitempty"`
	ReplicationConfiguration *DomainReplicationConfiguration `json:"replicationConfiguration,omitempty"`
	FailoverVersion          *int64                          `json:"failoverVersion,omitempty"`
	IsGlobalDomain           *bool                           `json:"isGlobalDomain,omitempty"`
	FailoverInfo             *FailoverInfo                   `json:"failoverInfo,omitempty"`
}

// ToWire translates a DescribeDomainResponse 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 *DescribeDomainResponse) ToWire() (wire.Value, error) {
	var (
		fields [6]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.DomainInfo != nil {
		w, err = v.DomainInfo.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.Configuration != nil {
		w, err = v.Configuration.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.ReplicationConfiguration != nil {
		w, err = v.ReplicationConfiguration.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.FailoverVersion != nil {
		w, err = wire.NewValueI64(*(v.FailoverVersion)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 40, Value: w}
		i++
	}
	if v.IsGlobalDomain != nil {
		w, err = wire.NewValueBool(*(v.IsGlobalDomain)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 50, Value: w}
		i++
	}
	if v.FailoverInfo != nil {
		w, err = v.FailoverInfo.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 60, Value: w}
		i++
	}

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

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

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

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

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

// FromWire deserializes a DescribeDomainResponse 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 DescribeDomainResponse struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v DescribeDomainResponse
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *DescribeDomainResponse) 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.DomainInfo, err = _DomainInfo_Read(field.Value)
				if err != nil {
					return err
				}

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

			}
		case 30:
			if field.Value.Type() == wire.TStruct {
				v.ReplicationConfiguration, err = _DomainReplicationConfiguration_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.FailoverVersion = &x
				if err != nil {
					return err
				}

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

			}
		case 60:
			if field.Value.Type() == wire.TStruct {
				v.FailoverInfo, err = _FailoverInfo_Read(field.Value)
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

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

	var fields [6]string
	i := 0
	if v.DomainInfo != nil {
		fields[i] = fmt.Sprintf("DomainInfo: %v", v.DomainInfo)
		i++
	}
	if v.Configuration != nil {
		fields[i] = fmt.Sprintf("Configuration: %v", v.Configuration)
		i++
	}
	if v.ReplicationConfiguration != nil {
		fields[i] = fmt.Sprintf("ReplicationConfiguration: %v", v.ReplicationConfiguration)
		i++
	}
	if v.FailoverVersion != nil {
		fields[i] = fmt.Sprintf("FailoverVersion: %v", *(v.FailoverVersion))
		i++
	}
	if v.IsGlobalDomain != nil {
		fields[i] = fmt.Sprintf("IsGlobalDomain: %v", *(v.IsGlobalDomain))
		i++
	}
	if v.FailoverInfo != nil {
		fields[i] = fmt.Sprintf("FailoverInfo: %v", v.FailoverInfo)
		i++
	}

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

// Equals returns true if all the fields of this DescribeDomainResponse match the
// provided DescribeDomainResponse.
//
// This function performs a deep comparison.
func (v *DescribeDomainResponse) Equals(rhs *DescribeDomainResponse) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !((v.DomainInfo == nil && rhs.DomainInfo == nil) || (v.DomainInfo != nil && rhs.DomainInfo != nil && v.DomainInfo.Equals(rhs.DomainInfo))) {
		return false
	}
	if !((v.Configuration == nil && rhs.Configuration == nil) || (v.Configuration != nil && rhs.Configuration != nil && v.Configuration.Equals(rhs.Configuration))) {
		return false
	}
	if !((v.ReplicationConfiguration == nil && rhs.ReplicationConfiguration == nil) || (v.ReplicationConfiguration != nil && rhs.ReplicationConfiguration != nil && v.ReplicationConfiguration.Equals(rhs.ReplicationConfiguration))) {
		return false
	}
	if !_I64_EqualsPtr(v.FailoverVersion, rhs.FailoverVersion) {
		return false
	}
	if !_Bool_EqualsPtr(v.IsGlobalDomain, rhs.IsGlobalDomain) {
		return false
	}
	if !((v.FailoverInfo == nil && rhs.FailoverInfo == nil) || (v.FailoverInfo != nil && rhs.FailoverInfo != nil && v.FailoverInfo.Equals(rhs.FailoverInfo))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of DescribeDomainResponse.
func (v *DescribeDomainResponse) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.DomainInfo != nil {
		err = multierr.Append(err, enc.AddObject("domainInfo", v.DomainInfo))
	}
	if v.Configuration != nil {
		err = multierr.Append(err, enc.AddObject("configuration", v.Configuration))
	}
	if v.ReplicationConfiguration != nil {
		err = multierr.Append(err, enc.AddObject("replicationConfiguration", v.ReplicationConfiguration))
	}
	if v.FailoverVersion != nil {
		enc.AddInt64("failoverVersion", *v.FailoverVersion)
	}
	if v.IsGlobalDomain != nil {
		enc.AddBool("isGlobalDomain", *v.IsGlobalDomain)
	}
	if v.FailoverInfo != nil {
		err = multierr.Append(err, enc.AddObject("failoverInfo", v.FailoverInfo))
	}
	return err
}

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

	return
}

// IsSetDomainInfo returns true if DomainInfo is not nil.
func (v *DescribeDomainResponse) IsSetDomainInfo() bool {
	return v != nil && v.DomainInfo != nil
}

// GetConfiguration returns the value of Configuration if it is set or its
// zero value if it is unset.
func (v *DescribeDomainResponse) GetConfiguration() (o *DomainConfiguration) {
	if v != nil && v.Configuration != nil {
		return v.Configuration
	}

	return
}

// IsSetConfiguration returns true if Configuration is not nil.
func (v *DescribeDomainResponse) IsSetConfiguration() bool {
	return v != nil && v.Configuration != nil
}

// GetReplicationConfiguration returns the value of ReplicationConfiguration if it is set or its
// zero value if it is unset.
func (v *DescribeDomainResponse) GetReplicationConfiguration() (o *DomainReplicationConfiguration) {
	if v != nil && v.ReplicationConfiguration != nil {
		return v.ReplicationConfiguration
	}

	return
}

// IsSetReplicationConfiguration returns true if ReplicationConfiguration is not nil.
func (v *DescribeDomainResponse) IsSetReplicationConfiguration() bool {
	return v != nil && v.ReplicationConfiguration != nil
}

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

	return
}

// IsSetFailoverVersion returns true if FailoverVersion is not nil.
func (v *DescribeDomainResponse) IsSetFailoverVersion() bool {
	return v != nil && v.FailoverVersion != nil
}

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

	return
}

// IsSetIsGlobalDomain returns true if IsGlobalDomain is not nil.
func (v *DescribeDomainResponse) IsSetIsGlobalDomain() bool {
	return v != nil && v.IsGlobalDomain != nil
}

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

	return
}

// IsSetFailoverInfo returns true if FailoverInfo is not nil.
func (v *DescribeDomainResponse) IsSetFailoverInfo() bool {
	return v != nil && v.FailoverInfo != nil
}

type DescribeHistoryHostRequest struct {
	HostAddress      *string            `json:"hostAddress,omitempty"`
	ShardIdForHost   *int32             `json:"shardIdForHost,omitempty"`
	ExecutionForHost *WorkflowExecution `json:"executionForHost,omitempty"`
}

// ToWire translates a DescribeHistoryHostRequest 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 *DescribeHistoryHostRequest) ToWire() (wire.Value, error) {
	var (
		fields [3]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

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

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

// FromWire deserializes a DescribeHistoryHostRequest 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 DescribeHistoryHostRequest struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v DescribeHistoryHostRequest
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *DescribeHistoryHostRequest) 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.HostAddress = &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.ShardIdForHost = &x
				if err != nil {
					return err
				}

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

			}
		}
	}

	return nil
}

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

	var fields [3]string
	i := 0
	if v.HostAddress != nil {
		fields[i] = fmt.Sprintf("HostAddress: %v", *(v.HostAddress))
		i++
	}
	if v.ShardIdForHost != nil {
		fields[i] = fmt.Sprintf("ShardIdForHost: %v", *(v.ShardIdForHost))
		i++
	}
	if v.ExecutionForHost != nil {
		fields[i] = fmt.Sprintf("ExecutionForHost: %v", v.ExecutionForHost)
		i++
	}

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

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

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of DescribeHistoryHostRequest.
func (v *DescribeHistoryHostRequest) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.HostAddress != nil {
		enc.AddString("hostAddress", *v.HostAddress)
	}
	if v.ShardIdForHost != nil {
		enc.AddInt32("shardIdForHost", *v.ShardIdForHost)
	}
	if v.ExecutionForHost != nil {
		err = multierr.Append(err, enc.AddObject("executionForHost", v.ExecutionForHost))
	}
	return err
}

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

	return
}

// IsSetHostAddress returns true if HostAddress is not nil.
func (v *DescribeHistoryHostRequest) IsSetHostAddress() bool {
	return v != nil && v.HostAddress != nil
}

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

	return
}

// IsSetShardIdForHost returns true if ShardIdForHost is not nil.
func (v *DescribeHistoryHostRequest) IsSetShardIdForHost() bool {
	return v != nil && v.ShardIdForHost != nil
}

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

	return
}

// IsSetExecutionForHost returns true if ExecutionForHost is not nil.
func (v *DescribeHistoryHostRequest) IsSetExecutionForHost() bool {
	return v != nil && v.ExecutionForHost != nil
}

type DescribeHistoryHostResponse struct {
	NumberOfShards        *int32           `json:"numberOfShards,omitempty"`
	ShardIDs              []int32          `json:"shardIDs,omitempty"`
	DomainCache           *DomainCacheInfo `json:"domainCache,omitempty"`
	ShardControllerStatus *string          `json:"shardControllerStatus,omitempty"`
	Address               *string          `json:"address,omitempty"`
}

type _List_I32_ValueList []int32

func (v _List_I32_ValueList) ForEach(f func(wire.Value) error) error {
	for _, x := range v {
		w, err := wire.NewValueI32(x), error(nil)
		if err != nil {
			return err
		}
		err = f(w)
		if err != nil {
			return err
		}
	}
	return nil
}

func (v _List_I32_ValueList) Size() int {
	return len(v)
}

func (_List_I32_ValueList) ValueType() wire.Type {
	return wire.TI32
}

func (_List_I32_ValueList) Close() {}

// ToWire translates a DescribeHistoryHostResponse 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 *DescribeHistoryHostResponse) ToWire() (wire.Value, error) {
	var (
		fields [5]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.NumberOfShards != nil {
		w, err = wire.NewValueI32(*(v.NumberOfShards)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.ShardIDs != nil {
		w, err = wire.NewValueList(_List_I32_ValueList(v.ShardIDs)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.DomainCache != nil {
		w, err = v.DomainCache.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.ShardControllerStatus != nil {
		w, err = wire.NewValueString(*(v.ShardControllerStatus)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 40, Value: w}
		i++
	}
	if v.Address != nil {
		w, err = wire.NewValueString(*(v.Address)), 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 _List_I32_Read(l wire.ValueList) ([]int32, error) {
	if l.ValueType() != wire.TI32 {
		return nil, nil
	}

	o := make([]int32, 0, l.Size())
	err := l.ForEach(func(x wire.Value) error {
		i, err := x.GetI32(), error(nil)
		if err != nil {
			return err
		}
		o = append(o, i)
		return nil
	})
	l.Close()
	return o, err
}

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

// FromWire deserializes a DescribeHistoryHostResponse 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 DescribeHistoryHostResponse struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v DescribeHistoryHostResponse
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *DescribeHistoryHostResponse) FromWire(w wire.Value) error {
	var err error

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

			}
		case 20:
			if field.Value.Type() == wire.TList {
				v.ShardIDs, err = _List_I32_Read(field.Value.GetList())
				if err != nil {
					return err
				}

			}
		case 30:
			if field.Value.Type() == wire.TStruct {
				v.DomainCache, err = _DomainCacheInfo_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.ShardControllerStatus = &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.Address = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

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

	var fields [5]string
	i := 0
	if v.NumberOfShards != nil {
		fields[i] = fmt.Sprintf("NumberOfShards: %v", *(v.NumberOfShards))
		i++
	}
	if v.ShardIDs != nil {
		fields[i] = fmt.Sprintf("ShardIDs: %v", v.ShardIDs)
		i++
	}
	if v.DomainCache != nil {
		fields[i] = fmt.Sprintf("DomainCache: %v", v.DomainCache)
		i++
	}
	if v.ShardControllerStatus != nil {
		fields[i] = fmt.Sprintf("ShardControllerStatus: %v", *(v.ShardControllerStatus))
		i++
	}
	if v.Address != nil {
		fields[i] = fmt.Sprintf("Address: %v", *(v.Address))
		i++
	}

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

func _List_I32_Equals(lhs, rhs []int32) bool {
	if len(lhs) != len(rhs) {
		return false
	}

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

	return true
}

// Equals returns true if all the fields of this DescribeHistoryHostResponse match the
// provided DescribeHistoryHostResponse.
//
// This function performs a deep comparison.
func (v *DescribeHistoryHostResponse) Equals(rhs *DescribeHistoryHostResponse) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_I32_EqualsPtr(v.NumberOfShards, rhs.NumberOfShards) {
		return false
	}
	if !((v.ShardIDs == nil && rhs.ShardIDs == nil) || (v.ShardIDs != nil && rhs.ShardIDs != nil && _List_I32_Equals(v.ShardIDs, rhs.ShardIDs))) {
		return false
	}
	if !((v.DomainCache == nil && rhs.DomainCache == nil) || (v.DomainCache != nil && rhs.DomainCache != nil && v.DomainCache.Equals(rhs.DomainCache))) {
		return false
	}
	if !_String_EqualsPtr(v.ShardControllerStatus, rhs.ShardControllerStatus) {
		return false
	}
	if !_String_EqualsPtr(v.Address, rhs.Address) {
		return false
	}

	return true
}

type _List_I32_Zapper []int32

// MarshalLogArray implements zapcore.ArrayMarshaler, enabling
// fast logging of _List_I32_Zapper.
func (l _List_I32_Zapper) MarshalLogArray(enc zapcore.ArrayEncoder) (err error) {
	for _, v := range l {
		enc.AppendInt32(v)
	}
	return err
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of DescribeHistoryHostResponse.
func (v *DescribeHistoryHostResponse) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.NumberOfShards != nil {
		enc.AddInt32("numberOfShards", *v.NumberOfShards)
	}
	if v.ShardIDs != nil {
		err = multierr.Append(err, enc.AddArray("shardIDs", (_List_I32_Zapper)(v.ShardIDs)))
	}
	if v.DomainCache != nil {
		err = multierr.Append(err, enc.AddObject("domainCache", v.DomainCache))
	}
	if v.ShardControllerStatus != nil {
		enc.AddString("shardControllerStatus", *v.ShardControllerStatus)
	}
	if v.Address != nil {
		enc.AddString("address", *v.Address)
	}
	return err
}

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

	return
}

// IsSetNumberOfShards returns true if NumberOfShards is not nil.
func (v *DescribeHistoryHostResponse) IsSetNumberOfShards() bool {
	return v != nil && v.NumberOfShards != nil
}

// GetShardIDs returns the value of ShardIDs if it is set or its
// zero value if it is unset.
func (v *DescribeHistoryHostResponse) GetShardIDs() (o []int32) {
	if v != nil && v.ShardIDs != nil {
		return v.ShardIDs
	}

	return
}

// IsSetShardIDs returns true if ShardIDs is not nil.
func (v *DescribeHistoryHostResponse) IsSetShardIDs() bool {
	return v != nil && v.ShardIDs != nil
}

// GetDomainCache returns the value of DomainCache if it is set or its
// zero value if it is unset.
func (v *DescribeHistoryHostResponse) GetDomainCache() (o *DomainCacheInfo) {
	if v != nil && v.DomainCache != nil {
		return v.DomainCache
	}

	return
}

// IsSetDomainCache returns true if DomainCache is not nil.
func (v *DescribeHistoryHostResponse) IsSetDomainCache() bool {
	return v != nil && v.DomainCache != nil
}

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

	return
}

// IsSetShardControllerStatus returns true if ShardControllerStatus is not nil.
func (v *DescribeHistoryHostResponse) IsSetShardControllerStatus() bool {
	return v != nil && v.ShardControllerStatus != nil
}

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

	return
}

// IsSetAddress returns true if Address is not nil.
func (v *DescribeHistoryHostResponse) IsSetAddress() bool {
	return v != nil && v.Address != nil
}

type DescribeQueueRequest struct {
	ShardID     *int32  `json:"shardID,omitempty"`
	ClusterName *string `json:"clusterName,omitempty"`
	Type        *int32  `json:"type,omitempty"`
}

// ToWire translates a DescribeQueueRequest 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 *DescribeQueueRequest) ToWire() (wire.Value, error) {
	var (
		fields [3]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.ShardID != nil {
		w, err = wire.NewValueI32(*(v.ShardID)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.ClusterName != nil {
		w, err = wire.NewValueString(*(v.ClusterName)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.Type != nil {
		w, err = wire.NewValueI32(*(v.Type)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}

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

// FromWire deserializes a DescribeQueueRequest 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 DescribeQueueRequest struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v DescribeQueueRequest
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *DescribeQueueRequest) FromWire(w wire.Value) error {
	var err error

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

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

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

			}
		}
	}

	return nil
}

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

	var fields [3]string
	i := 0
	if v.ShardID != nil {
		fields[i] = fmt.Sprintf("ShardID: %v", *(v.ShardID))
		i++
	}
	if v.ClusterName != nil {
		fields[i] = fmt.Sprintf("ClusterName: %v", *(v.ClusterName))
		i++
	}
	if v.Type != nil {
		fields[i] = fmt.Sprintf("Type: %v", *(v.Type))
		i++
	}

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

// Equals returns true if all the fields of this DescribeQueueRequest match the
// provided DescribeQueueRequest.
//
// This function performs a deep comparison.
func (v *DescribeQueueRequest) Equals(rhs *DescribeQueueRequest) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_I32_EqualsPtr(v.ShardID, rhs.ShardID) {
		return false
	}
	if !_String_EqualsPtr(v.ClusterName, rhs.ClusterName) {
		return false
	}
	if !_I32_EqualsPtr(v.Type, rhs.Type) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of DescribeQueueRequest.
func (v *DescribeQueueRequest) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.ShardID != nil {
		enc.AddInt32("shardID", *v.ShardID)
	}
	if v.ClusterName != nil {
		enc.AddString("clusterName", *v.ClusterName)
	}
	if v.Type != nil {
		enc.AddInt32("type", *v.Type)
	}
	return err
}

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

	return
}

// IsSetShardID returns true if ShardID is not nil.
func (v *DescribeQueueRequest) IsSetShardID() bool {
	return v != nil && v.ShardID != nil
}

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

	return
}

// IsSetClusterName returns true if ClusterName is not nil.
func (v *DescribeQueueRequest) IsSetClusterName() bool {
	return v != nil && v.ClusterName != nil
}

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

	return
}

// IsSetType returns true if Type is not nil.
func (v *DescribeQueueRequest) IsSetType() bool {
	return v != nil && v.Type != nil
}

type DescribeQueueResponse struct {
	ProcessingQueueStates []string `json:"processingQueueStates,omitempty"`
}

type _List_String_ValueList []string

func (v _List_String_ValueList) ForEach(f func(wire.Value) error) error {
	for _, x := range v {
		w, err := wire.NewValueString(x), error(nil)
		if err != nil {
			return err
		}
		err = f(w)
		if err != nil {
			return err
		}
	}
	return nil
}

func (v _List_String_ValueList) Size() int {
	return len(v)
}

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

func (_List_String_ValueList) Close() {}

// ToWire translates a DescribeQueueResponse 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 *DescribeQueueResponse) ToWire() (wire.Value, error) {
	var (
		fields [1]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.ProcessingQueueStates != nil {
		w, err = wire.NewValueList(_List_String_ValueList(v.ProcessingQueueStates)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}

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

func _List_String_Read(l wire.ValueList) ([]string, error) {
	if l.ValueType() != wire.TBinary {
		return nil, nil
	}

	o := make([]string, 0, l.Size())
	err := l.ForEach(func(x wire.Value) error {
		i, err := x.GetString(), error(nil)
		if err != nil {
			return err
		}
		o = append(o, i)
		return nil
	})
	l.Close()
	return o, err
}

// FromWire deserializes a DescribeQueueResponse 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 DescribeQueueResponse struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v DescribeQueueResponse
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *DescribeQueueResponse) FromWire(w wire.Value) error {
	var err error

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

			}
		}
	}

	return nil
}

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

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

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

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

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

	return true
}

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

	return true
}

type _List_String_Zapper []string

// MarshalLogArray implements zapcore.ArrayMarshaler, enabling
// fast logging of _List_String_Zapper.
func (l _List_String_Zapper) MarshalLogArray(enc zapcore.ArrayEncoder) (err error) {
	for _, v := range l {
		enc.AppendString(v)
	}
	return err
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of DescribeQueueResponse.
func (v *DescribeQueueResponse) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.ProcessingQueueStates != nil {
		err = multierr.Append(err, enc.AddArray("processingQueueStates", (_List_String_Zapper)(v.ProcessingQueueStates)))
	}
	return err
}

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

	return
}

// IsSetProcessingQueueStates returns true if ProcessingQueueStates is not nil.
func (v *DescribeQueueResponse) IsSetProcessingQueueStates() bool {
	return v != nil && v.ProcessingQueueStates != nil
}

type DescribeShardDistributionRequest struct {
	PageSize *int32 `json:"pageSize,omitempty"`
	PageID   *int32 `json:"pageID,omitempty"`
}

// ToWire translates a DescribeShardDistributionRequest 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 *DescribeShardDistributionRequest) ToWire() (wire.Value, error) {
	var (
		fields [2]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.PageSize != nil {
		w, err = wire.NewValueI32(*(v.PageSize)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.PageID != nil {
		w, err = wire.NewValueI32(*(v.PageID)), 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
}

// FromWire deserializes a DescribeShardDistributionRequest 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 DescribeShardDistributionRequest struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v DescribeShardDistributionRequest
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *DescribeShardDistributionRequest) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			if field.Value.Type() == wire.TI32 {
				var x int32
				x, err = field.Value.GetI32(), error(nil)
				v.PageSize = &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.PageID = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

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

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

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

// Equals returns true if all the fields of this DescribeShardDistributionRequest match the
// provided DescribeShardDistributionRequest.
//
// This function performs a deep comparison.
func (v *DescribeShardDistributionRequest) Equals(rhs *DescribeShardDistributionRequest) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_I32_EqualsPtr(v.PageSize, rhs.PageSize) {
		return false
	}
	if !_I32_EqualsPtr(v.PageID, rhs.PageID) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of DescribeShardDistributionRequest.
func (v *DescribeShardDistributionRequest) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.PageSize != nil {
		enc.AddInt32("pageSize", *v.PageSize)
	}
	if v.PageID != nil {
		enc.AddInt32("pageID", *v.PageID)
	}
	return err
}

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

	return
}

// IsSetPageSize returns true if PageSize is not nil.
func (v *DescribeShardDistributionRequest) IsSetPageSize() bool {
	return v != nil && v.PageSize != nil
}

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

	return
}

// IsSetPageID returns true if PageID is not nil.
func (v *DescribeShardDistributionRequest) IsSetPageID() bool {
	return v != nil && v.PageID != nil
}

type DescribeShardDistributionResponse struct {
	NumberOfShards *int32           `json:"numberOfShards,omitempty"`
	Shards         map[int32]string `json:"shards,omitempty"`
}

type _Map_I32_String_MapItemList map[int32]string

func (m _Map_I32_String_MapItemList) ForEach(f func(wire.MapItem) error) error {
	for k, v := range m {
		kw, err := wire.NewValueI32(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_I32_String_MapItemList) Size() int {
	return len(m)
}

func (_Map_I32_String_MapItemList) KeyType() wire.Type {
	return wire.TI32
}

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

func (_Map_I32_String_MapItemList) Close() {}

// ToWire translates a DescribeShardDistributionResponse 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 *DescribeShardDistributionResponse) ToWire() (wire.Value, error) {
	var (
		fields [2]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.NumberOfShards != nil {
		w, err = wire.NewValueI32(*(v.NumberOfShards)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.Shards != nil {
		w, err = wire.NewValueMap(_Map_I32_String_MapItemList(v.Shards)), 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 _Map_I32_String_Read(m wire.MapItemList) (map[int32]string, error) {
	if m.KeyType() != wire.TI32 {
		return nil, nil
	}

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

	o := make(map[int32]string, m.Size())
	err := m.ForEach(func(x wire.MapItem) error {
		k, err := x.Key.GetI32(), 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 DescribeShardDistributionResponse 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 DescribeShardDistributionResponse struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v DescribeShardDistributionResponse
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *DescribeShardDistributionResponse) FromWire(w wire.Value) error {
	var err error

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

			}
		case 20:
			if field.Value.Type() == wire.TMap {
				v.Shards, err = _Map_I32_String_Read(field.Value.GetMap())
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

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

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

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

func _Map_I32_String_Equals(lhs, rhs map[int32]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 DescribeShardDistributionResponse match the
// provided DescribeShardDistributionResponse.
//
// This function performs a deep comparison.
func (v *DescribeShardDistributionResponse) Equals(rhs *DescribeShardDistributionResponse) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_I32_EqualsPtr(v.NumberOfShards, rhs.NumberOfShards) {
		return false
	}
	if !((v.Shards == nil && rhs.Shards == nil) || (v.Shards != nil && rhs.Shards != nil && _Map_I32_String_Equals(v.Shards, rhs.Shards))) {
		return false
	}

	return true
}

type _Map_I32_String_Item_Zapper struct {
	Key   int32
	Value string
}

// MarshalLogArray implements zapcore.ArrayMarshaler, enabling
// fast logging of _Map_I32_String_Item_Zapper.
func (v _Map_I32_String_Item_Zapper) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	enc.AddInt32("key", v.Key)
	enc.AddString("value", v.Value)
	return err
}

type _Map_I32_String_Zapper map[int32]string

// MarshalLogArray implements zapcore.ArrayMarshaler, enabling
// fast logging of _Map_I32_String_Zapper.
func (m _Map_I32_String_Zapper) MarshalLogArray(enc zapcore.ArrayEncoder) (err error) {
	for k, v := range m {
		err = multierr.Append(err, enc.AppendObject(_Map_I32_String_Item_Zapper{Key: k, Value: v}))
	}
	return err
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of DescribeShardDistributionResponse.
func (v *DescribeShardDistributionResponse) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.NumberOfShards != nil {
		enc.AddInt32("numberOfShards", *v.NumberOfShards)
	}
	if v.Shards != nil {
		err = multierr.Append(err, enc.AddArray("shards", (_Map_I32_String_Zapper)(v.Shards)))
	}
	return err
}

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

	return
}

// IsSetNumberOfShards returns true if NumberOfShards is not nil.
func (v *DescribeShardDistributionResponse) IsSetNumberOfShards() bool {
	return v != nil && v.NumberOfShards != nil
}

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

	return
}

// IsSetShards returns true if Shards is not nil.
func (v *DescribeShardDistributionResponse) IsSetShards() bool {
	return v != nil && v.Shards != nil
}

type DescribeTaskListRequest struct {
	Domain                *string       `json:"domain,omitempty"`
	TaskList              *TaskList     `json:"taskList,omitempty"`
	TaskListType          *TaskListType `json:"taskListType,omitempty"`
	IncludeTaskListStatus *bool         `json:"includeTaskListStatus,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 [4]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++
	}
	if v.TaskListType != nil {
		w, err = v.TaskListType.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.IncludeTaskListStatus != nil {
		w, err = wire.NewValueBool(*(v.IncludeTaskListStatus)), 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 _TaskListType_Read(w wire.Value) (TaskListType, error) {
	var v TaskListType
	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.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
				}

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

			}
		case 40:
			if field.Value.Type() == wire.TBool {
				var x bool
				x, err = field.Value.GetBool(), error(nil)
				v.IncludeTaskListStatus = &x
				if 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 [4]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++
	}
	if v.TaskListType != nil {
		fields[i] = fmt.Sprintf("TaskListType: %v", *(v.TaskListType))
		i++
	}
	if v.IncludeTaskListStatus != nil {
		fields[i] = fmt.Sprintf("IncludeTaskListStatus: %v", *(v.IncludeTaskListStatus))
		i++
	}

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

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

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

// 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.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
	}
	if !_TaskListType_EqualsPtr(v.TaskListType, rhs.TaskListType) {
		return false
	}
	if !_Bool_EqualsPtr(v.IncludeTaskListStatus, rhs.IncludeTaskListStatus) {
		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.Domain != nil {
		enc.AddString("domain", *v.Domain)
	}
	if v.TaskList != nil {
		err = multierr.Append(err, enc.AddObject("taskList", v.TaskList))
	}
	if v.TaskListType != nil {
		err = multierr.Append(err, enc.AddObject("taskListType", *v.TaskListType))
	}
	if v.IncludeTaskListStatus != nil {
		enc.AddBool("includeTaskListStatus", *v.IncludeTaskListStatus)
	}
	return err
}

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

	return
}

// IsSetDomain returns true if Domain is not nil.
func (v *DescribeTaskListRequest) 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 *DescribeTaskListRequest) GetTaskList() (o *TaskList) {
	if v != nil && v.TaskList != nil {
		return v.TaskList
	}

	return
}

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

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

	return
}

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

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

	return
}

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

type DescribeTaskListResponse struct {
	Pollers        []*PollerInfo   `json:"pollers,omitempty"`
	TaskListStatus *TaskListStatus `json:"taskListStatus,omitempty"`
	TaskList       *TaskList       `json:"taskList,omitempty"`
}

type _List_PollerInfo_ValueList []*PollerInfo

func (v _List_PollerInfo_ValueList) ForEach(f func(wire.Value) error) error {
	for i, x := range v {
		if x == nil {
			return fmt.Errorf("invalid [%v]: value is nil", i)
		}
		w, err := x.ToWire()
		if err != nil {
			return err
		}
		err = f(w)
		if err != nil {
			return err
		}
	}
	return nil
}

func (v _List_PollerInfo_ValueList) Size() int {
	return len(v)
}

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

func (_List_PollerInfo_ValueList) Close() {}

// ToWire translates a DescribeTaskListResponse 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 *DescribeTaskListResponse) ToWire() (wire.Value, error) {
	var (
		fields [3]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.Pollers != nil {
		w, err = wire.NewValueList(_List_PollerInfo_ValueList(v.Pollers)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.TaskListStatus != nil {
		w, err = v.TaskListStatus.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++
	}

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

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

func _List_PollerInfo_Read(l wire.ValueList) ([]*PollerInfo, error) {
	if l.ValueType() != wire.TStruct {
		return nil, nil
	}

	o := make([]*PollerInfo, 0, l.Size())
	err := l.ForEach(func(x wire.Value) error {
		i, err := _PollerInfo_Read(x)
		if err != nil {
			return err
		}
		o = append(o, i)
		return nil
	})
	l.Close()
	return o, err
}

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

// FromWire deserializes a DescribeTaskListResponse 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 DescribeTaskListResponse struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v DescribeTaskListResponse
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *DescribeTaskListResponse) FromWire(w wire.Value) error {
	var err error

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

			}
		case 20:
			if field.Value.Type() == wire.TStruct {
				v.TaskListStatus, err = _TaskListStatus_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
				}

			}
		}
	}

	return nil
}

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

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

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

func _List_PollerInfo_Equals(lhs, rhs []*PollerInfo) bool {
	if len(lhs) != len(rhs) {
		return false
	}

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

	return true
}

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

	return true
}

type _List_PollerInfo_Zapper []*PollerInfo

// MarshalLogArray implements zapcore.ArrayMarshaler, enabling
// fast logging of _List_PollerInfo_Zapper.
func (l _List_PollerInfo_Zapper) MarshalLogArray(enc zapcore.ArrayEncoder) (err error) {
	for _, v := range l {
		err = multierr.Append(err, enc.AppendObject(v))
	}
	return err
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of DescribeTaskListResponse.
func (v *DescribeTaskListResponse) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Pollers != nil {
		err = multierr.Append(err, enc.AddArray("pollers", (_List_PollerInfo_Zapper)(v.Pollers)))
	}
	if v.TaskListStatus != nil {
		err = multierr.Append(err, enc.AddObject("taskListStatus", v.TaskListStatus))
	}
	if v.TaskList != nil {
		err = multierr.Append(err, enc.AddObject("taskList", v.TaskList))
	}
	return err
}

// GetPollers returns the value of Pollers if it is set or its
// zero value if it is unset.
func (v *DescribeTaskListResponse) GetPollers() (o []*PollerInfo) {
	if v != nil && v.Pollers != nil {
		return v.Pollers
	}

	return
}

// IsSetPollers returns true if Pollers is not nil.
func (v *DescribeTaskListResponse) IsSetPollers() bool {
	return v != nil && v.Pollers != nil
}

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

	return
}

// IsSetTaskListStatus returns true if TaskListStatus is not nil.
func (v *DescribeTaskListResponse) IsSetTaskListStatus() bool {
	return v != nil && v.TaskListStatus != nil
}

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

	return
}

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

type DescribeWorkflowExecutionRequest struct {
	Domain                *string                `json:"domain,omitempty"`
	Execution             *WorkflowExecution     `json:"execution,omitempty"`
	QueryConsistencyLevel *QueryConsistencyLevel `json:"queryConsistencyLevel,omitempty"`
}

// ToWire translates a DescribeWorkflowExecutionRequest 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 *DescribeWorkflowExecutionRequest) ToWire() (wire.Value, error) {
	var (
		fields [3]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.Execution != nil {
		w, err = v.Execution.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.QueryConsistencyLevel != nil {
		w, err = v.QueryConsistencyLevel.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}

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

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

// FromWire deserializes a DescribeWorkflowExecutionRequest 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 DescribeWorkflowExecutionRequest struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v DescribeWorkflowExecutionRequest
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *DescribeWorkflowExecutionRequest) 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.Execution, err = _WorkflowExecution_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 30:
			if field.Value.Type() == wire.TI32 {
				var x QueryConsistencyLevel
				x, err = _QueryConsistencyLevel_Read(field.Value)
				v.QueryConsistencyLevel = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

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

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

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

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

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

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

	return true
}

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

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

	return
}

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

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

	return
}

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

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

	return
}

// IsSetQueryConsistencyLevel returns true if QueryConsistencyLevel is not nil.
func (v *DescribeWorkflowExecutionRequest) IsSetQueryConsistencyLevel() bool {
	return v != nil && v.QueryConsistencyLevel != nil
}

type DescribeWorkflowExecutionResponse struct {
	ExecutionConfiguration *WorkflowExecutionConfiguration `json:"executionConfiguration,omitempty"`
	WorkflowExecutionInfo  *WorkflowExecutionInfo          `json:"workflowExecutionInfo,omitempty"`
	PendingActivities      []*PendingActivityInfo          `json:"pendingActivities,omitempty"`
	PendingChildren        []*PendingChildExecutionInfo    `json:"pendingChildren,omitempty"`
	PendingDecision        *PendingDecisionInfo            `json:"pendingDecision,omitempty"`
}

type _List_PendingActivityInfo_ValueList []*PendingActivityInfo

func (v _List_PendingActivityInfo_ValueList) ForEach(f func(wire.Value) error) error {
	for i, x := range v {
		if x == nil {
			return fmt.Errorf("invalid [%v]: value is nil", i)
		}
		w, err := x.ToWire()
		if err != nil {
			return err
		}
		err = f(w)
		if err != nil {
			return err
		}
	}
	return nil
}

func (v _List_PendingActivityInfo_ValueList) Size() int {
	return len(v)
}

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

func (_List_PendingActivityInfo_ValueList) Close() {}

type _List_PendingChildExecutionInfo_ValueList []*PendingChildExecutionInfo

func (v _List_PendingChildExecutionInfo_ValueList) ForEach(f func(wire.Value) error) error {
	for i, x := range v {
		if x == nil {
			return fmt.Errorf("invalid [%v]: value is nil", i)
		}
		w, err := x.ToWire()
		if err != nil {
			return err
		}
		err = f(w)
		if err != nil {
			return err
		}
	}
	return nil
}

func (v _List_PendingChildExecutionInfo_ValueList) Size() int {
	return len(v)
}

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

func (_List_PendingChildExecutionInfo_ValueList) Close() {}

// ToWire translates a DescribeWorkflowExecutionResponse 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 *DescribeWorkflowExecutionResponse) ToWire() (wire.Value, error) {
	var (
		fields [5]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.ExecutionConfiguration != nil {
		w, err = v.ExecutionConfiguration.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.WorkflowExecutionInfo != nil {
		w, err = v.WorkflowExecutionInfo.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.PendingActivities != nil {
		w, err = wire.NewValueList(_List_PendingActivityInfo_ValueList(v.PendingActivities)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.PendingChildren != nil {
		w, err = wire.NewValueList(_List_PendingChildExecutionInfo_ValueList(v.PendingChildren)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 40, Value: w}
		i++
	}
	if v.PendingDecision != nil {
		w, err = v.PendingDecision.ToWire()
		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 _WorkflowExecutionConfiguration_Read(w wire.Value) (*WorkflowExecutionConfiguration, error) {
	var v WorkflowExecutionConfiguration
	err := v.FromWire(w)
	return &v, err
}

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

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

func _List_PendingActivityInfo_Read(l wire.ValueList) ([]*PendingActivityInfo, error) {
	if l.ValueType() != wire.TStruct {
		return nil, nil
	}

	o := make([]*PendingActivityInfo, 0, l.Size())
	err := l.ForEach(func(x wire.Value) error {
		i, err := _PendingActivityInfo_Read(x)
		if err != nil {
			return err
		}
		o = append(o, i)
		return nil
	})
	l.Close()
	return o, err
}

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

func _List_PendingChildExecutionInfo_Read(l wire.ValueList) ([]*PendingChildExecutionInfo, error) {
	if l.ValueType() != wire.TStruct {
		return nil, nil
	}

	o := make([]*PendingChildExecutionInfo, 0, l.Size())
	err := l.ForEach(func(x wire.Value) error {
		i, err := _PendingChildExecutionInfo_Read(x)
		if err != nil {
			return err
		}
		o = append(o, i)
		return nil
	})
	l.Close()
	return o, err
}

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

// FromWire deserializes a DescribeWorkflowExecutionResponse 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 DescribeWorkflowExecutionResponse struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v DescribeWorkflowExecutionResponse
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *DescribeWorkflowExecutionResponse) 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.ExecutionConfiguration, err = _WorkflowExecutionConfiguration_Read(field.Value)
				if err != nil {
					return err
				}

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

			}
		case 30:
			if field.Value.Type() == wire.TList {
				v.PendingActivities, err = _List_PendingActivityInfo_Read(field.Value.GetList())
				if err != nil {
					return err
				}

			}
		case 40:
			if field.Value.Type() == wire.TList {
				v.PendingChildren, err = _List_PendingChildExecutionInfo_Read(field.Value.GetList())
				if err != nil {
					return err
				}

			}
		case 50:
			if field.Value.Type() == wire.TStruct {
				v.PendingDecision, err = _PendingDecisionInfo_Read(field.Value)
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

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

	var fields [5]string
	i := 0
	if v.ExecutionConfiguration != nil {
		fields[i] = fmt.Sprintf("ExecutionConfiguration: %v", v.ExecutionConfiguration)
		i++
	}
	if v.WorkflowExecutionInfo != nil {
		fields[i] = fmt.Sprintf("WorkflowExecutionInfo: %v", v.WorkflowExecutionInfo)
		i++
	}
	if v.PendingActivities != nil {
		fields[i] = fmt.Sprintf("PendingActivities: %v", v.PendingActivities)
		i++
	}
	if v.PendingChildren != nil {
		fields[i] = fmt.Sprintf("PendingChildren: %v", v.PendingChildren)
		i++
	}
	if v.PendingDecision != nil {
		fields[i] = fmt.Sprintf("PendingDecision: %v", v.PendingDecision)
		i++
	}

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

func _List_PendingActivityInfo_Equals(lhs, rhs []*PendingActivityInfo) bool {
	if len(lhs) != len(rhs) {
		return false
	}

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

	return true
}

func _List_PendingChildExecutionInfo_Equals(lhs, rhs []*PendingChildExecutionInfo) bool {
	if len(lhs) != len(rhs) {
		return false
	}

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

	return true
}

// Equals returns true if all the fields of this DescribeWorkflowExecutionResponse match the
// provided DescribeWorkflowExecutionResponse.
//
// This function performs a deep comparison.
func (v *DescribeWorkflowExecutionResponse) Equals(rhs *DescribeWorkflowExecutionResponse) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !((v.ExecutionConfiguration == nil && rhs.ExecutionConfiguration == nil) || (v.ExecutionConfiguration != nil && rhs.ExecutionConfiguration != nil && v.ExecutionConfiguration.Equals(rhs.ExecutionConfiguration))) {
		return false
	}
	if !((v.WorkflowExecutionInfo == nil && rhs.WorkflowExecutionInfo == nil) || (v.WorkflowExecutionInfo != nil && rhs.WorkflowExecutionInfo != nil && v.WorkflowExecutionInfo.Equals(rhs.WorkflowExecutionInfo))) {
		return false
	}
	if !((v.PendingActivities == nil && rhs.PendingActivities == nil) || (v.PendingActivities != nil && rhs.PendingActivities != nil && _List_PendingActivityInfo_Equals(v.PendingActivities, rhs.PendingActivities))) {
		return false
	}
	if !((v.PendingChildren == nil && rhs.PendingChildren == nil) || (v.PendingChildren != nil && rhs.PendingChildren != nil && _List_PendingChildExecutionInfo_Equals(v.PendingChildren, rhs.PendingChildren))) {
		return false
	}
	if !((v.PendingDecision == nil && rhs.PendingDecision == nil) || (v.PendingDecision != nil && rhs.PendingDecision != nil && v.PendingDecision.Equals(rhs.PendingDecision))) {
		return false
	}

	return true
}

type _List_PendingActivityInfo_Zapper []*PendingActivityInfo

// MarshalLogArray implements zapcore.ArrayMarshaler, enabling
// fast logging of _List_PendingActivityInfo_Zapper.
func (l _List_PendingActivityInfo_Zapper) MarshalLogArray(enc zapcore.ArrayEncoder) (err error) {
	for _, v := range l {
		err = multierr.Append(err, enc.AppendObject(v))
	}
	return err
}

type _List_PendingChildExecutionInfo_Zapper []*PendingChildExecutionInfo

// MarshalLogArray implements zapcore.ArrayMarshaler, enabling
// fast logging of _List_PendingChildExecutionInfo_Zapper.
func (l _List_PendingChildExecutionInfo_Zapper) MarshalLogArray(enc zapcore.ArrayEncoder) (err error) {
	for _, v := range l {
		err = multierr.Append(err, enc.AppendObject(v))
	}
	return err
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of DescribeWorkflowExecutionResponse.
func (v *DescribeWorkflowExecutionResponse) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.ExecutionConfiguration != nil {
		err = multierr.Append(err, enc.AddObject("executionConfiguration", v.ExecutionConfiguration))
	}
	if v.WorkflowExecutionInfo != nil {
		err = multierr.Append(err, enc.AddObject("workflowExecutionInfo", v.WorkflowExecutionInfo))
	}
	if v.PendingActivities != nil {
		err = multierr.Append(err, enc.AddArray("pendingActivities", (_List_PendingActivityInfo_Zapper)(v.PendingActivities)))
	}
	if v.PendingChildren != nil {
		err = multierr.Append(err, enc.AddArray("pendingChildren", (_List_PendingChildExecutionInfo_Zapper)(v.PendingChildren)))
	}
	if v.PendingDecision != nil {
		err = multierr.Append(err, enc.AddObject("pendingDecision", v.PendingDecision))
	}
	return err
}

// GetExecutionConfiguration returns the value of ExecutionConfiguration if it is set or its
// zero value if it is unset.
func (v *DescribeWorkflowExecutionResponse) GetExecutionConfiguration() (o *WorkflowExecutionConfiguration) {
	if v != nil && v.ExecutionConfiguration != nil {
		return v.ExecutionConfiguration
	}

	return
}

// IsSetExecutionConfiguration returns true if ExecutionConfiguration is not nil.
func (v *DescribeWorkflowExecutionResponse) IsSetExecutionConfiguration() bool {
	return v != nil && v.ExecutionConfiguration != nil
}

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

	return
}

// IsSetWorkflowExecutionInfo returns true if WorkflowExecutionInfo is not nil.
func (v *DescribeWorkflowExecutionResponse) IsSetWorkflowExecutionInfo() bool {
	return v != nil && v.WorkflowExecutionInfo != nil
}

// GetPendingActivities returns the value of PendingActivities if it is set or its
// zero value if it is unset.
func (v *DescribeWorkflowExecutionResponse) GetPendingActivities() (o []*PendingActivityInfo) {
	if v != nil && v.PendingActivities != nil {
		return v.PendingActivities
	}

	return
}

// IsSetPendingActivities returns true if PendingActivities is not nil.
func (v *DescribeWorkflowExecutionResponse) IsSetPendingActivities() bool {
	return v != nil && v.PendingActivities != nil
}

// GetPendingChildren returns the value of PendingChildren if it is set or its
// zero value if it is unset.
func (v *DescribeWorkflowExecutionResponse) GetPendingChildren() (o []*PendingChildExecutionInfo) {
	if v != nil && v.PendingChildren != nil {
		return v.PendingChildren
	}

	return
}

// IsSetPendingChildren returns true if PendingChildren is not nil.
func (v *DescribeWorkflowExecutionResponse) IsSetPendingChildren() bool {
	return v != nil && v.PendingChildren != nil
}

// GetPendingDecision returns the value of PendingDecision if it is set or its
// zero value if it is unset.
func (v *DescribeWorkflowExecutionResponse) GetPendingDecision() (o *PendingDecisionInfo) {
	if v != nil && v.PendingDecision != nil {
		return v.PendingDecision
	}

	return
}

// IsSetPendingDecision returns true if PendingDecision is not nil.
func (v *DescribeWorkflowExecutionResponse) IsSetPendingDecision() bool {
	return v != nil && v.PendingDecision != nil
}

type DiagnoseWorkflowExecutionRequest struct {
	Domain            *string            `json:"domain,omitempty"`
	WorkflowExecution *WorkflowExecution `json:"workflowExecution,omitempty"`
	Identity          *string            `json:"identity,omitempty"`
}

// ToWire translates a DiagnoseWorkflowExecutionRequest 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 *DiagnoseWorkflowExecutionRequest) ToWire() (wire.Value, error) {
	var (
		fields [3]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.WorkflowExecution != nil {
		w, err = v.WorkflowExecution.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, 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: 30, Value: w}
		i++
	}

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

// FromWire deserializes a DiagnoseWorkflowExecutionRequest 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 DiagnoseWorkflowExecutionRequest struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v DiagnoseWorkflowExecutionRequest
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *DiagnoseWorkflowExecutionRequest) 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.WorkflowExecution, 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.Identity = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

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

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

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

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

	return true
}

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

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

	return
}

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

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

	return
}

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

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

	return
}

// IsSetIdentity returns true if Identity is not nil.
func (v *DiagnoseWorkflowExecutionRequest) IsSetIdentity() bool {
	return v != nil && v.Identity != nil
}

type DiagnoseWorkflowExecutionResponse struct {
	Domain                      *string            `json:"domain,omitempty"`
	DiagnosticWorkflowExecution *WorkflowExecution `json:"diagnosticWorkflowExecution,omitempty"`
}

// ToWire translates a DiagnoseWorkflowExecutionResponse 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 *DiagnoseWorkflowExecutionResponse) 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.DiagnosticWorkflowExecution != nil {
		w, err = v.DiagnosticWorkflowExecution.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 DiagnoseWorkflowExecutionResponse 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 DiagnoseWorkflowExecutionResponse struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v DiagnoseWorkflowExecutionResponse
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *DiagnoseWorkflowExecutionResponse) 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.DiagnosticWorkflowExecution, err = _WorkflowExecution_Read(field.Value)
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a DiagnoseWorkflowExecutionResponse
// struct.
func (v *DiagnoseWorkflowExecutionResponse) 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.DiagnosticWorkflowExecution != nil {
		fields[i] = fmt.Sprintf("DiagnosticWorkflowExecution: %v", v.DiagnosticWorkflowExecution)
		i++
	}

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

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

	return true
}

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

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

	return
}

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

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

	return
}

// IsSetDiagnosticWorkflowExecution returns true if DiagnosticWorkflowExecution is not nil.
func (v *DiagnoseWorkflowExecutionResponse) IsSetDiagnosticWorkflowExecution() bool {
	return v != nil && v.DiagnosticWorkflowExecution != nil
}

type DomainAlreadyExistsError struct {
	Message string `json:"message,required"`
}

// ToWire translates a DomainAlreadyExistsError 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 *DomainAlreadyExistsError) 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
}

// FromWire deserializes a DomainAlreadyExistsError 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 DomainAlreadyExistsError struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v DomainAlreadyExistsError
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *DomainAlreadyExistsError) 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 DomainAlreadyExistsError is required")
	}

	return nil
}

// String returns a readable string representation of a DomainAlreadyExistsError
// struct.
func (v *DomainAlreadyExistsError) 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("DomainAlreadyExistsError{%v}", strings.Join(fields[:i], ", "))
}

// ErrorName is the name of this type as defined in the Thrift
// file.
func (*DomainAlreadyExistsError) ErrorName() string {
	return "DomainAlreadyExistsError"
}

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

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of DomainAlreadyExistsError.
func (v *DomainAlreadyExistsError) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	enc.AddString("message", v.Message)
	return err
}

// GetMessage returns the value of Message if it is set or its
// zero value if it is unset.
func (v *DomainAlreadyExistsError) GetMessage() (o string) {
	if v != nil {
		o = v.Message
	}
	return
}

func (v *DomainAlreadyExistsError) Error() string {
	return v.String()
}

type DomainCacheInfo struct {
	NumOfItemsInCacheByID   *int64 `json:"numOfItemsInCacheByID,omitempty"`
	NumOfItemsInCacheByName *int64 `json:"numOfItemsInCacheByName,omitempty"`
}

// ToWire translates a DomainCacheInfo 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 *DomainCacheInfo) ToWire() (wire.Value, error) {
	var (
		fields [2]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.NumOfItemsInCacheByID != nil {
		w, err = wire.NewValueI64(*(v.NumOfItemsInCacheByID)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.NumOfItemsInCacheByName != nil {
		w, err = wire.NewValueI64(*(v.NumOfItemsInCacheByName)), 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
}

// FromWire deserializes a DomainCacheInfo 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 DomainCacheInfo struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v DomainCacheInfo
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *DomainCacheInfo) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			if field.Value.Type() == wire.TI64 {
				var x int64
				x, err = field.Value.GetI64(), error(nil)
				v.NumOfItemsInCacheByID = &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.NumOfItemsInCacheByName = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

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

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

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

// Equals returns true if all the fields of this DomainCacheInfo match the
// provided DomainCacheInfo.
//
// This function performs a deep comparison.
func (v *DomainCacheInfo) Equals(rhs *DomainCacheInfo) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_I64_EqualsPtr(v.NumOfItemsInCacheByID, rhs.NumOfItemsInCacheByID) {
		return false
	}
	if !_I64_EqualsPtr(v.NumOfItemsInCacheByName, rhs.NumOfItemsInCacheByName) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of DomainCacheInfo.
func (v *DomainCacheInfo) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.NumOfItemsInCacheByID != nil {
		enc.AddInt64("numOfItemsInCacheByID", *v.NumOfItemsInCacheByID)
	}
	if v.NumOfItemsInCacheByName != nil {
		enc.AddInt64("numOfItemsInCacheByName", *v.NumOfItemsInCacheByName)
	}
	return err
}

// GetNumOfItemsInCacheByID returns the value of NumOfItemsInCacheByID if it is set or its
// zero value if it is unset.
func (v *DomainCacheInfo) GetNumOfItemsInCacheByID() (o int64) {
	if v != nil && v.NumOfItemsInCacheByID != nil {
		return *v.NumOfItemsInCacheByID
	}

	return
}

// IsSetNumOfItemsInCacheByID returns true if NumOfItemsInCacheByID is not nil.
func (v *DomainCacheInfo) IsSetNumOfItemsInCacheByID() bool {
	return v != nil && v.NumOfItemsInCacheByID != nil
}

// GetNumOfItemsInCacheByName returns the value of NumOfItemsInCacheByName if it is set or its
// zero value if it is unset.
func (v *DomainCacheInfo) GetNumOfItemsInCacheByName() (o int64) {
	if v != nil && v.NumOfItemsInCacheByName != nil {
		return *v.NumOfItemsInCacheByName
	}

	return
}

// IsSetNumOfItemsInCacheByName returns true if NumOfItemsInCacheByName is not nil.
func (v *DomainCacheInfo) IsSetNumOfItemsInCacheByName() bool {
	return v != nil && v.NumOfItemsInCacheByName != nil
}

type DomainConfiguration struct {
	WorkflowExecutionRetentionPeriodInDays *int32                       `json:"workflowExecutionRetentionPeriodInDays,omitempty"`
	EmitMetric                             *bool                        `json:"emitMetric,omitempty"`
	Isolationgroups                        *IsolationGroupConfiguration `json:"isolationgroups,omitempty"`
	BadBinaries                            *BadBinaries                 `json:"badBinaries,omitempty"`
	HistoryArchivalStatus                  *ArchivalStatus              `json:"historyArchivalStatus,omitempty"`
	HistoryArchivalURI                     *string                      `json:"historyArchivalURI,omitempty"`
	VisibilityArchivalStatus               *ArchivalStatus              `json:"visibilityArchivalStatus,omitempty"`
	VisibilityArchivalURI                  *string                      `json:"visibilityArchivalURI,omitempty"`
	AsyncWorkflowConfiguration             *AsyncWorkflowConfiguration  `json:"AsyncWorkflowConfiguration,omitempty"`
}

// ToWire translates a DomainConfiguration 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 *DomainConfiguration) ToWire() (wire.Value, error) {
	var (
		fields [9]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.WorkflowExecutionRetentionPeriodInDays != nil {
		w, err = wire.NewValueI32(*(v.WorkflowExecutionRetentionPeriodInDays)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.EmitMetric != nil {
		w, err = wire.NewValueBool(*(v.EmitMetric)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.Isolationgroups != nil {
		w, err = v.Isolationgroups.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 60, Value: w}
		i++
	}
	if v.BadBinaries != nil {
		w, err = v.BadBinaries.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 70, Value: w}
		i++
	}
	if v.HistoryArchivalStatus != nil {
		w, err = v.HistoryArchivalStatus.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 80, Value: w}
		i++
	}
	if v.HistoryArchivalURI != nil {
		w, err = wire.NewValueString(*(v.HistoryArchivalURI)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 90, Value: w}
		i++
	}
	if v.VisibilityArchivalStatus != nil {
		w, err = v.VisibilityArchivalStatus.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 100, Value: w}
		i++
	}
	if v.VisibilityArchivalURI != nil {
		w, err = wire.NewValueString(*(v.VisibilityArchivalURI)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 110, Value: w}
		i++
	}
	if v.AsyncWorkflowConfiguration != nil {
		w, err = v.AsyncWorkflowConfiguration.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 120, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

func _IsolationGroupConfiguration_Read(w wire.Value) (*IsolationGroupConfiguration, error) {
	var v IsolationGroupConfiguration
	err := v.FromWire(w)
	return &v, err
}

func _BadBinaries_Read(w wire.Value) (*BadBinaries, error) {
	var v BadBinaries
	err := v.FromWire(w)
	return &v, err
}

func _ArchivalStatus_Read(w wire.Value) (ArchivalStatus, error) {
	var v ArchivalStatus
	err := v.FromWire(w)
	return v, err
}

func _AsyncWorkflowConfiguration_Read(w wire.Value) (*AsyncWorkflowConfiguration, error) {
	var v AsyncWorkflowConfiguration
	err := v.FromWire(w)
	return &v, err
}

// FromWire deserializes a DomainConfiguration 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 DomainConfiguration struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v DomainConfiguration
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *DomainConfiguration) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			if field.Value.Type() == wire.TI32 {
				var x int32
				x, err = field.Value.GetI32(), error(nil)
				v.WorkflowExecutionRetentionPeriodInDays = &x
				if err != nil {
					return err
				}

			}
		case 20:
			if field.Value.Type() == wire.TBool {
				var x bool
				x, err = field.Value.GetBool(), error(nil)
				v.EmitMetric = &x
				if err != nil {
					return err
				}

			}
		case 60:
			if field.Value.Type() == wire.TStruct {
				v.Isolationgroups, err = _IsolationGroupConfiguration_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 70:
			if field.Value.Type() == wire.TStruct {
				v.BadBinaries, err = _BadBinaries_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 80:
			if field.Value.Type() == wire.TI32 {
				var x ArchivalStatus
				x, err = _ArchivalStatus_Read(field.Value)
				v.HistoryArchivalStatus = &x
				if err != nil {
					return err
				}

			}
		case 90:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.HistoryArchivalURI = &x
				if err != nil {
					return err
				}

			}
		case 100:
			if field.Value.Type() == wire.TI32 {
				var x ArchivalStatus
				x, err = _ArchivalStatus_Read(field.Value)
				v.VisibilityArchivalStatus = &x
				if err != nil {
					return err
				}

			}
		case 110:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.VisibilityArchivalURI = &x
				if err != nil {
					return err
				}

			}
		case 120:
			if field.Value.Type() == wire.TStruct {
				v.AsyncWorkflowConfiguration, err = _AsyncWorkflowConfiguration_Read(field.Value)
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a DomainConfiguration
// struct.
func (v *DomainConfiguration) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [9]string
	i := 0
	if v.WorkflowExecutionRetentionPeriodInDays != nil {
		fields[i] = fmt.Sprintf("WorkflowExecutionRetentionPeriodInDays: %v", *(v.WorkflowExecutionRetentionPeriodInDays))
		i++
	}
	if v.EmitMetric != nil {
		fields[i] = fmt.Sprintf("EmitMetric: %v", *(v.EmitMetric))
		i++
	}
	if v.Isolationgroups != nil {
		fields[i] = fmt.Sprintf("Isolationgroups: %v", v.Isolationgroups)
		i++
	}
	if v.BadBinaries != nil {
		fields[i] = fmt.Sprintf("BadBinaries: %v", v.BadBinaries)
		i++
	}
	if v.HistoryArchivalStatus != nil {
		fields[i] = fmt.Sprintf("HistoryArchivalStatus: %v", *(v.HistoryArchivalStatus))
		i++
	}
	if v.HistoryArchivalURI != nil {
		fields[i] = fmt.Sprintf("HistoryArchivalURI: %v", *(v.HistoryArchivalURI))
		i++
	}
	if v.VisibilityArchivalStatus != nil {
		fields[i] = fmt.Sprintf("VisibilityArchivalStatus: %v", *(v.VisibilityArchivalStatus))
		i++
	}
	if v.VisibilityArchivalURI != nil {
		fields[i] = fmt.Sprintf("VisibilityArchivalURI: %v", *(v.VisibilityArchivalURI))
		i++
	}
	if v.AsyncWorkflowConfiguration != nil {
		fields[i] = fmt.Sprintf("AsyncWorkflowConfiguration: %v", v.AsyncWorkflowConfiguration)
		i++
	}

	return fmt.Sprintf("DomainConfiguration{%v}", strings.Join(fields[:i], ", "))
}

func _ArchivalStatus_EqualsPtr(lhs, rhs *ArchivalStatus) bool {
	if lhs != nil && rhs != nil {

		x := *lhs
		y := *rhs
		return x.Equals(y)
	}
	return lhs == nil && rhs == nil
}

// Equals returns true if all the fields of this DomainConfiguration match the
// provided DomainConfiguration.
//
// This function performs a deep comparison.
func (v *DomainConfiguration) Equals(rhs *DomainConfiguration) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_I32_EqualsPtr(v.WorkflowExecutionRetentionPeriodInDays, rhs.WorkflowExecutionRetentionPeriodInDays) {
		return false
	}
	if !_Bool_EqualsPtr(v.EmitMetric, rhs.EmitMetric) {
		return false
	}
	if !((v.Isolationgroups == nil && rhs.Isolationgroups == nil) || (v.Isolationgroups != nil && rhs.Isolationgroups != nil && v.Isolationgroups.Equals(rhs.Isolationgroups))) {
		return false
	}
	if !((v.BadBinaries == nil && rhs.BadBinaries == nil) || (v.BadBinaries != nil && rhs.BadBinaries != nil && v.BadBinaries.Equals(rhs.BadBinaries))) {
		return false
	}
	if !_ArchivalStatus_EqualsPtr(v.HistoryArchivalStatus, rhs.HistoryArchivalStatus) {
		return false
	}
	if !_String_EqualsPtr(v.HistoryArchivalURI, rhs.HistoryArchivalURI) {
		return false
	}
	if !_ArchivalStatus_EqualsPtr(v.VisibilityArchivalStatus, rhs.VisibilityArchivalStatus) {
		return false
	}
	if !_String_EqualsPtr(v.VisibilityArchivalURI, rhs.VisibilityArchivalURI) {
		return false
	}
	if !((v.AsyncWorkflowConfiguration == nil && rhs.AsyncWorkflowConfiguration == nil) || (v.AsyncWorkflowConfiguration != nil && rhs.AsyncWorkflowConfiguration != nil && v.AsyncWorkflowConfiguration.Equals(rhs.AsyncWorkflowConfiguration))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of DomainConfiguration.
func (v *DomainConfiguration) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.WorkflowExecutionRetentionPeriodInDays != nil {
		enc.AddInt32("workflowExecutionRetentionPeriodInDays", *v.WorkflowExecutionRetentionPeriodInDays)
	}
	if v.EmitMetric != nil {
		enc.AddBool("emitMetric", *v.EmitMetric)
	}
	if v.Isolationgroups != nil {
		err = multierr.Append(err, enc.AddObject("isolationgroups", v.Isolationgroups))
	}
	if v.BadBinaries != nil {
		err = multierr.Append(err, enc.AddObject("badBinaries", v.BadBinaries))
	}
	if v.HistoryArchivalStatus != nil {
		err = multierr.Append(err, enc.AddObject("historyArchivalStatus", *v.HistoryArchivalStatus))
	}
	if v.HistoryArchivalURI != nil {
		enc.AddString("historyArchivalURI", *v.HistoryArchivalURI)
	}
	if v.VisibilityArchivalStatus != nil {
		err = multierr.Append(err, enc.AddObject("visibilityArchivalStatus", *v.VisibilityArchivalStatus))
	}
	if v.VisibilityArchivalURI != nil {
		enc.AddString("visibilityArchivalURI", *v.VisibilityArchivalURI)
	}
	if v.AsyncWorkflowConfiguration != nil {
		err = multierr.Append(err, enc.AddObject("AsyncWorkflowConfiguration", v.AsyncWorkflowConfiguration))
	}
	return err
}

// GetWorkflowExecutionRetentionPeriodInDays returns the value of WorkflowExecutionRetentionPeriodInDays if it is set or its
// zero value if it is unset.
func (v *DomainConfiguration) GetWorkflowExecutionRetentionPeriodInDays() (o int32) {
	if v != nil && v.WorkflowExecutionRetentionPeriodInDays != nil {
		return *v.WorkflowExecutionRetentionPeriodInDays
	}

	return
}

// IsSetWorkflowExecutionRetentionPeriodInDays returns true if WorkflowExecutionRetentionPeriodInDays is not nil.
func (v *DomainConfiguration) IsSetWorkflowExecutionRetentionPeriodInDays() bool {
	return v != nil && v.WorkflowExecutionRetentionPeriodInDays != nil
}

// GetEmitMetric returns the value of EmitMetric if it is set or its
// zero value if it is unset.
func (v *DomainConfiguration) GetEmitMetric() (o bool) {
	if v != nil && v.EmitMetric != nil {
		return *v.EmitMetric
	}

	return
}

// IsSetEmitMetric returns true if EmitMetric is not nil.
func (v *DomainConfiguration) IsSetEmitMetric() bool {
	return v != nil && v.EmitMetric != nil
}

// GetIsolationgroups returns the value of Isolationgroups if it is set or its
// zero value if it is unset.
func (v *DomainConfiguration) GetIsolationgroups() (o *IsolationGroupConfiguration) {
	if v != nil && v.Isolationgroups != nil {
		return v.Isolationgroups
	}

	return
}

// IsSetIsolationgroups returns true if Isolationgroups is not nil.
func (v *DomainConfiguration) IsSetIsolationgroups() bool {
	return v != nil && v.Isolationgroups != nil
}

// GetBadBinaries returns the value of BadBinaries if it is set or its
// zero value if it is unset.
func (v *DomainConfiguration) GetBadBinaries() (o *BadBinaries) {
	if v != nil && v.BadBinaries != nil {
		return v.BadBinaries
	}

	return
}

// IsSetBadBinaries returns true if BadBinaries is not nil.
func (v *DomainConfiguration) IsSetBadBinaries() bool {
	return v != nil && v.BadBinaries != nil
}

// GetHistoryArchivalStatus returns the value of HistoryArchivalStatus if it is set or its
// zero value if it is unset.
func (v *DomainConfiguration) GetHistoryArchivalStatus() (o ArchivalStatus) {
	if v != nil && v.HistoryArchivalStatus != nil {
		return *v.HistoryArchivalStatus
	}

	return
}

// IsSetHistoryArchivalStatus returns true if HistoryArchivalStatus is not nil.
func (v *DomainConfiguration) IsSetHistoryArchivalStatus() bool {
	return v != nil && v.HistoryArchivalStatus != nil
}

// GetHistoryArchivalURI returns the value of HistoryArchivalURI if it is set or its
// zero value if it is unset.
func (v *DomainConfiguration) GetHistoryArchivalURI() (o string) {
	if v != nil && v.HistoryArchivalURI != nil {
		return *v.HistoryArchivalURI
	}

	return
}

// IsSetHistoryArchivalURI returns true if HistoryArchivalURI is not nil.
func (v *DomainConfiguration) IsSetHistoryArchivalURI() bool {
	return v != nil && v.HistoryArchivalURI != nil
}

// GetVisibilityArchivalStatus returns the value of VisibilityArchivalStatus if it is set or its
// zero value if it is unset.
func (v *DomainConfiguration) GetVisibilityArchivalStatus() (o ArchivalStatus) {
	if v != nil && v.VisibilityArchivalStatus != nil {
		return *v.VisibilityArchivalStatus
	}

	return
}

// IsSetVisibilityArchivalStatus returns true if VisibilityArchivalStatus is not nil.
func (v *DomainConfiguration) IsSetVisibilityArchivalStatus() bool {
	return v != nil && v.VisibilityArchivalStatus != nil
}

// GetVisibilityArchivalURI returns the value of VisibilityArchivalURI if it is set or its
// zero value if it is unset.
func (v *DomainConfiguration) GetVisibilityArchivalURI() (o string) {
	if v != nil && v.VisibilityArchivalURI != nil {
		return *v.VisibilityArchivalURI
	}

	return
}

// IsSetVisibilityArchivalURI returns true if VisibilityArchivalURI is not nil.
func (v *DomainConfiguration) IsSetVisibilityArchivalURI() bool {
	return v != nil && v.VisibilityArchivalURI != nil
}

// GetAsyncWorkflowConfiguration returns the value of AsyncWorkflowConfiguration if it is set or its
// zero value if it is unset.
func (v *DomainConfiguration) GetAsyncWorkflowConfiguration() (o *AsyncWorkflowConfiguration) {
	if v != nil && v.AsyncWorkflowConfiguration != nil {
		return v.AsyncWorkflowConfiguration
	}

	return
}

// IsSetAsyncWorkflowConfiguration returns true if AsyncWorkflowConfiguration is not nil.
func (v *DomainConfiguration) IsSetAsyncWorkflowConfiguration() bool {
	return v != nil && v.AsyncWorkflowConfiguration != nil
}

type DomainInfo struct {
	Name        *string           `json:"name,omitempty"`
	Status      *DomainStatus     `json:"status,omitempty"`
	Description *string           `json:"description,omitempty"`
	OwnerEmail  *string           `json:"ownerEmail,omitempty"`
	Data        map[string]string `json:"data,omitempty"`
	UUID        *string           `json:"uuid,omitempty"`
}

// ToWire translates a DomainInfo 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 *DomainInfo) ToWire() (wire.Value, error) {
	var (
		fields [6]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.Name != nil {
		w, err = wire.NewValueString(*(v.Name)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.Status != nil {
		w, err = v.Status.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.Description != nil {
		w, err = wire.NewValueString(*(v.Description)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.OwnerEmail != nil {
		w, err = wire.NewValueString(*(v.OwnerEmail)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 40, Value: w}
		i++
	}
	if v.Data != nil {
		w, err = wire.NewValueMap(_Map_String_String_MapItemList(v.Data)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 50, Value: w}
		i++
	}
	if v.UUID != nil {
		w, err = wire.NewValueString(*(v.UUID)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 60, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

func _DomainStatus_Read(w wire.Value) (DomainStatus, error) {
	var v DomainStatus
	err := v.FromWire(w)
	return v, err
}

// FromWire deserializes a DomainInfo 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 DomainInfo struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v DomainInfo
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *DomainInfo) 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.Name = &x
				if err != nil {
					return err
				}

			}
		case 20:
			if field.Value.Type() == wire.TI32 {
				var x DomainStatus
				x, err = _DomainStatus_Read(field.Value)
				v.Status = &x
				if err != nil {
					return err
				}

			}
		case 30:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.Description = &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.OwnerEmail = &x
				if err != nil {
					return err
				}

			}
		case 50:
			if field.Value.Type() == wire.TMap {
				v.Data, err = _Map_String_String_Read(field.Value.GetMap())
				if err != nil {
					return err
				}

			}
		case 60:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.UUID = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a DomainInfo
// struct.
func (v *DomainInfo) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [6]string
	i := 0
	if v.Name != nil {
		fields[i] = fmt.Sprintf("Name: %v", *(v.Name))
		i++
	}
	if v.Status != nil {
		fields[i] = fmt.Sprintf("Status: %v", *(v.Status))
		i++
	}
	if v.Description != nil {
		fields[i] = fmt.Sprintf("Description: %v", *(v.Description))
		i++
	}
	if v.OwnerEmail != nil {
		fields[i] = fmt.Sprintf("OwnerEmail: %v", *(v.OwnerEmail))
		i++
	}
	if v.Data != nil {
		fields[i] = fmt.Sprintf("Data: %v", v.Data)
		i++
	}
	if v.UUID != nil {
		fields[i] = fmt.Sprintf("UUID: %v", *(v.UUID))
		i++
	}

	return fmt.Sprintf("DomainInfo{%v}", strings.Join(fields[:i], ", "))
}

func _DomainStatus_EqualsPtr(lhs, rhs *DomainStatus) bool {
	if lhs != nil && rhs != nil {

		x := *lhs
		y := *rhs
		return x.Equals(y)
	}
	return lhs == nil && rhs == nil
}

// Equals returns true if all the fields of this DomainInfo match the
// provided DomainInfo.
//
// This function performs a deep comparison.
func (v *DomainInfo) Equals(rhs *DomainInfo) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.Name, rhs.Name) {
		return false
	}
	if !_DomainStatus_EqualsPtr(v.Status, rhs.Status) {
		return false
	}
	if !_String_EqualsPtr(v.Description, rhs.Description) {
		return false
	}
	if !_String_EqualsPtr(v.OwnerEmail, rhs.OwnerEmail) {
		return false
	}
	if !((v.Data == nil && rhs.Data == nil) || (v.Data != nil && rhs.Data != nil && _Map_String_String_Equals(v.Data, rhs.Data))) {
		return false
	}
	if !_String_EqualsPtr(v.UUID, rhs.UUID) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of DomainInfo.
func (v *DomainInfo) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Name != nil {
		enc.AddString("name", *v.Name)
	}
	if v.Status != nil {
		err = multierr.Append(err, enc.AddObject("status", *v.Status))
	}
	if v.Description != nil {
		enc.AddString("description", *v.Description)
	}
	if v.OwnerEmail != nil {
		enc.AddString("ownerEmail", *v.OwnerEmail)
	}
	if v.Data != nil {
		err = multierr.Append(err, enc.AddObject("data", (_Map_String_String_Zapper)(v.Data)))
	}
	if v.UUID != nil {
		enc.AddString("uuid", *v.UUID)
	}
	return err
}

// GetName returns the value of Name if it is set or its
// zero value if it is unset.
func (v *DomainInfo) GetName() (o string) {
	if v != nil && v.Name != nil {
		return *v.Name
	}

	return
}

// IsSetName returns true if Name is not nil.
func (v *DomainInfo) IsSetName() bool {
	return v != nil && v.Name != nil
}

// GetStatus returns the value of Status if it is set or its
// zero value if it is unset.
func (v *DomainInfo) GetStatus() (o DomainStatus) {
	if v != nil && v.Status != nil {
		return *v.Status
	}

	return
}

// IsSetStatus returns true if Status is not nil.
func (v *DomainInfo) IsSetStatus() bool {
	return v != nil && v.Status != nil
}

// GetDescription returns the value of Description if it is set or its
// zero value if it is unset.
func (v *DomainInfo) GetDescription() (o string) {
	if v != nil && v.Description != nil {
		return *v.Description
	}

	return
}

// IsSetDescription returns true if Description is not nil.
func (v *DomainInfo) IsSetDescription() bool {
	return v != nil && v.Description != nil
}

// GetOwnerEmail returns the value of OwnerEmail if it is set or its
// zero value if it is unset.
func (v *DomainInfo) GetOwnerEmail() (o string) {
	if v != nil && v.OwnerEmail != nil {
		return *v.OwnerEmail
	}

	return
}

// IsSetOwnerEmail returns true if OwnerEmail is not nil.
func (v *DomainInfo) IsSetOwnerEmail() bool {
	return v != nil && v.OwnerEmail != nil
}

// GetData returns the value of Data if it is set or its
// zero value if it is unset.
func (v *DomainInfo) GetData() (o map[string]string) {
	if v != nil && v.Data != nil {
		return v.Data
	}

	return
}

// IsSetData returns true if Data is not nil.
func (v *DomainInfo) IsSetData() bool {
	return v != nil && v.Data != nil
}

// GetUUID returns the value of UUID if it is set or its
// zero value if it is unset.
func (v *DomainInfo) GetUUID() (o string) {
	if v != nil && v.UUID != nil {
		return *v.UUID
	}

	return
}

// IsSetUUID returns true if UUID is not nil.
func (v *DomainInfo) IsSetUUID() bool {
	return v != nil && v.UUID != nil
}

type DomainNotActiveError struct {
	Message        string   `json:"message,required"`
	DomainName     string   `json:"domainName,required"`
	CurrentCluster string   `json:"currentCluster,required"`
	ActiveCluster  string   `json:"activeCluster,required"`
	ActiveClusters []string `json:"activeClusters,required"`
}

// ToWire translates a DomainNotActiveError 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 *DomainNotActiveError) ToWire() (wire.Value, error) {
	var (
		fields [5]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++

	w, err = wire.NewValueString(v.DomainName), error(nil)
	if err != nil {
		return w, err
	}
	fields[i] = wire.Field{ID: 2, Value: w}
	i++

	w, err = wire.NewValueString(v.CurrentCluster), error(nil)
	if err != nil {
		return w, err
	}
	fields[i] = wire.Field{ID: 3, Value: w}
	i++

	w, err = wire.NewValueString(v.ActiveCluster), error(nil)
	if err != nil {
		return w, err
	}
	fields[i] = wire.Field{ID: 4, Value: w}
	i++

	w, err = wire.NewValueList(_List_String_ValueList(v.ActiveClusters)), error(nil)
	if err != nil {
		return w, err
	}
	fields[i] = wire.Field{ID: 5, Value: w}
	i++

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

// FromWire deserializes a DomainNotActiveError 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 DomainNotActiveError struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v DomainNotActiveError
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *DomainNotActiveError) FromWire(w wire.Value) error {
	var err error

	messageIsSet := false
	domainNameIsSet := false
	currentClusterIsSet := false
	activeClusterIsSet := false
	activeClustersIsSet := 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
			}
		case 2:
			if field.Value.Type() == wire.TBinary {
				v.DomainName, err = field.Value.GetString(), error(nil)
				if err != nil {
					return err
				}
				domainNameIsSet = true
			}
		case 3:
			if field.Value.Type() == wire.TBinary {
				v.CurrentCluster, err = field.Value.GetString(), error(nil)
				if err != nil {
					return err
				}
				currentClusterIsSet = true
			}
		case 4:
			if field.Value.Type() == wire.TBinary {
				v.ActiveCluster, err = field.Value.GetString(), error(nil)
				if err != nil {
					return err
				}
				activeClusterIsSet = true
			}
		case 5:
			if field.Value.Type() == wire.TList {
				v.ActiveClusters, err = _List_String_Read(field.Value.GetList())
				if err != nil {
					return err
				}
				activeClustersIsSet = true
			}
		}
	}

	if !messageIsSet {
		return errors.New("field Message of DomainNotActiveError is required")
	}

	if !domainNameIsSet {
		return errors.New("field DomainName of DomainNotActiveError is required")
	}

	if !currentClusterIsSet {
		return errors.New("field CurrentCluster of DomainNotActiveError is required")
	}

	if !activeClusterIsSet {
		return errors.New("field ActiveCluster of DomainNotActiveError is required")
	}

	if !activeClustersIsSet {
		return errors.New("field ActiveClusters of DomainNotActiveError is required")
	}

	return nil
}

// String returns a readable string representation of a DomainNotActiveError
// struct.
func (v *DomainNotActiveError) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [5]string
	i := 0
	fields[i] = fmt.Sprintf("Message: %v", v.Message)
	i++
	fields[i] = fmt.Sprintf("DomainName: %v", v.DomainName)
	i++
	fields[i] = fmt.Sprintf("CurrentCluster: %v", v.CurrentCluster)
	i++
	fields[i] = fmt.Sprintf("ActiveCluster: %v", v.ActiveCluster)
	i++
	fields[i] = fmt.Sprintf("ActiveClusters: %v", v.ActiveClusters)
	i++

	return fmt.Sprintf("DomainNotActiveError{%v}", strings.Join(fields[:i], ", "))
}

// ErrorName is the name of this type as defined in the Thrift
// file.
func (*DomainNotActiveError) ErrorName() string {
	return "DomainNotActiveError"
}

// Equals returns true if all the fields of this DomainNotActiveError match the
// provided DomainNotActiveError.
//
// This function performs a deep comparison.
func (v *DomainNotActiveError) Equals(rhs *DomainNotActiveError) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !(v.Message == rhs.Message) {
		return false
	}
	if !(v.DomainName == rhs.DomainName) {
		return false
	}
	if !(v.CurrentCluster == rhs.CurrentCluster) {
		return false
	}
	if !(v.ActiveCluster == rhs.ActiveCluster) {
		return false
	}
	if !_List_String_Equals(v.ActiveClusters, rhs.ActiveClusters) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of DomainNotActiveError.
func (v *DomainNotActiveError) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	enc.AddString("message", v.Message)
	enc.AddString("domainName", v.DomainName)
	enc.AddString("currentCluster", v.CurrentCluster)
	enc.AddString("activeCluster", v.ActiveCluster)
	err = multierr.Append(err, enc.AddArray("activeClusters", (_List_String_Zapper)(v.ActiveClusters)))
	return err
}

// GetMessage returns the value of Message if it is set or its
// zero value if it is unset.
func (v *DomainNotActiveError) GetMessage() (o string) {
	if v != nil {
		o = v.Message
	}
	return
}

// GetDomainName returns the value of DomainName if it is set or its
// zero value if it is unset.
func (v *DomainNotActiveError) GetDomainName() (o string) {
	if v != nil {
		o = v.DomainName
	}
	return
}

// GetCurrentCluster returns the value of CurrentCluster if it is set or its
// zero value if it is unset.
func (v *DomainNotActiveError) GetCurrentCluster() (o string) {
	if v != nil {
		o = v.CurrentCluster
	}
	return
}

// GetActiveCluster returns the value of ActiveCluster if it is set or its
// zero value if it is unset.
func (v *DomainNotActiveError) GetActiveCluster() (o string) {
	if v != nil {
		o = v.ActiveCluster
	}
	return
}

// GetActiveClusters returns the value of ActiveClusters if it is set or its
// zero value if it is unset.
func (v *DomainNotActiveError) GetActiveClusters() (o []string) {
	if v != nil {
		o = v.ActiveClusters
	}
	return
}

// IsSetActiveClusters returns true if ActiveClusters is not nil.
func (v *DomainNotActiveError) IsSetActiveClusters() bool {
	return v != nil && v.ActiveClusters != nil
}

func (v *DomainNotActiveError) Error() string {
	return v.String()
}

type DomainReplicationConfiguration struct {
	ActiveClusterName *string                            `json:"activeClusterName,omitempty"`
	Clusters          []*ClusterReplicationConfiguration `json:"clusters,omitempty"`
	ActiveClusters    *ActiveClusters                    `json:"activeClusters,omitempty"`
}

type _List_ClusterReplicationConfiguration_ValueList []*ClusterReplicationConfiguration

func (v _List_ClusterReplicationConfiguration_ValueList) ForEach(f func(wire.Value) error) error {
	for i, x := range v {
		if x == nil {
			return fmt.Errorf("invalid [%v]: value is nil", i)
		}
		w, err := x.ToWire()
		if err != nil {
			return err
		}
		err = f(w)
		if err != nil {
			return err
		}
	}
	return nil
}

func (v _List_ClusterReplicationConfiguration_ValueList) Size() int {
	return len(v)
}

func (_List_ClusterReplicationConfiguration_ValueList) ValueType() wire.Type {
	return wire.TStruct
}

func (_List_ClusterReplicationConfiguration_ValueList) Close() {}

// ToWire translates a DomainReplicationConfiguration 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 *DomainReplicationConfiguration) ToWire() (wire.Value, error) {
	var (
		fields [3]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.ActiveClusterName != nil {
		w, err = wire.NewValueString(*(v.ActiveClusterName)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.Clusters != nil {
		w, err = wire.NewValueList(_List_ClusterReplicationConfiguration_ValueList(v.Clusters)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.ActiveClusters != nil {
		w, err = v.ActiveClusters.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

func _ClusterReplicationConfiguration_Read(w wire.Value) (*ClusterReplicationConfiguration, error) {
	var v ClusterReplicationConfiguration
	err := v.FromWire(w)
	return &v, err
}

func _List_ClusterReplicationConfiguration_Read(l wire.ValueList) ([]*ClusterReplicationConfiguration, error) {
	if l.ValueType() != wire.TStruct {
		return nil, nil
	}

	o := make([]*ClusterReplicationConfiguration, 0, l.Size())
	err := l.ForEach(func(x wire.Value) error {
		i, err := _ClusterReplicationConfiguration_Read(x)
		if err != nil {
			return err
		}
		o = append(o, i)
		return nil
	})
	l.Close()
	return o, err
}

func _ActiveClusters_Read(w wire.Value) (*ActiveClusters, error) {
	var v ActiveClusters
	err := v.FromWire(w)
	return &v, err
}

// FromWire deserializes a DomainReplicationConfiguration 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 DomainReplicationConfiguration struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v DomainReplicationConfiguration
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *DomainReplicationConfiguration) 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.ActiveClusterName = &x
				if err != nil {
					return err
				}

			}
		case 20:
			if field.Value.Type() == wire.TList {
				v.Clusters, err = _List_ClusterReplicationConfiguration_Read(field.Value.GetList())
				if err != nil {
					return err
				}

			}
		case 30:
			if field.Value.Type() == wire.TStruct {
				v.ActiveClusters, err = _ActiveClusters_Read(field.Value)
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a DomainReplicationConfiguration
// struct.
func (v *DomainReplicationConfiguration) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [3]string
	i := 0
	if v.ActiveClusterName != nil {
		fields[i] = fmt.Sprintf("ActiveClusterName: %v", *(v.ActiveClusterName))
		i++
	}
	if v.Clusters != nil {
		fields[i] = fmt.Sprintf("Clusters: %v", v.Clusters)
		i++
	}
	if v.ActiveClusters != nil {
		fields[i] = fmt.Sprintf("ActiveClusters: %v", v.ActiveClusters)
		i++
	}

	return fmt.Sprintf("DomainReplicationConfiguration{%v}", strings.Join(fields[:i], ", "))
}

func _List_ClusterReplicationConfiguration_Equals(lhs, rhs []*ClusterReplicationConfiguration) bool {
	if len(lhs) != len(rhs) {
		return false
	}

	for i, lv := range lhs {
		rv := rhs[i]
		if !lv.Equals(rv) {
			return false
		}
	}

	return true
}

// Equals returns true if all the fields of this DomainReplicationConfiguration match the
// provided DomainReplicationConfiguration.
//
// This function performs a deep comparison.
func (v *DomainReplicationConfiguration) Equals(rhs *DomainReplicationConfiguration) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.ActiveClusterName, rhs.ActiveClusterName) {
		return false
	}
	if !((v.Clusters == nil && rhs.Clusters == nil) || (v.Clusters != nil && rhs.Clusters != nil && _List_ClusterReplicationConfiguration_Equals(v.Clusters, rhs.Clusters))) {
		return false
	}
	if !((v.ActiveClusters == nil && rhs.ActiveClusters == nil) || (v.ActiveClusters != nil && rhs.ActiveClusters != nil && v.ActiveClusters.Equals(rhs.ActiveClusters))) {
		return false
	}

	return true
}

type _List_ClusterReplicationConfiguration_Zapper []*ClusterReplicationConfiguration

// MarshalLogArray implements zapcore.ArrayMarshaler, enabling
// fast logging of _List_ClusterReplicationConfiguration_Zapper.
func (l _List_ClusterReplicationConfiguration_Zapper) MarshalLogArray(enc zapcore.ArrayEncoder) (err error) {
	for _, v := range l {
		err = multierr.Append(err, enc.AppendObject(v))
	}
	return err
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of DomainReplicationConfiguration.
func (v *DomainReplicationConfiguration) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.ActiveClusterName != nil {
		enc.AddString("activeClusterName", *v.ActiveClusterName)
	}
	if v.Clusters != nil {
		err = multierr.Append(err, enc.AddArray("clusters", (_List_ClusterReplicationConfiguration_Zapper)(v.Clusters)))
	}
	if v.ActiveClusters != nil {
		err = multierr.Append(err, enc.AddObject("activeClusters", v.ActiveClusters))
	}
	return err
}

// GetActiveClusterName returns the value of ActiveClusterName if it is set or its
// zero value if it is unset.
func (v *DomainReplicationConfiguration) GetActiveClusterName() (o string) {
	if v != nil && v.ActiveClusterName != nil {
		return *v.ActiveClusterName
	}

	return
}

// IsSetActiveClusterName returns true if ActiveClusterName is not nil.
func (v *DomainReplicationConfiguration) IsSetActiveClusterName() bool {
	return v != nil && v.ActiveClusterName != nil
}

// GetClusters returns the value of Clusters if it is set or its
// zero value if it is unset.
func (v *DomainReplicationConfiguration) GetClusters() (o []*ClusterReplicationConfiguration) {
	if v != nil && v.Clusters != nil {
		return v.Clusters
	}

	return
}

// IsSetClusters returns true if Clusters is not nil.
func (v *DomainReplicationConfiguration) IsSetClusters() bool {
	return v != nil && v.Clusters != nil
}

// GetActiveClusters returns the value of ActiveClusters if it is set or its
// zero value if it is unset.
func (v *DomainReplicationConfiguration) GetActiveClusters() (o *ActiveClusters) {
	if v != nil && v.ActiveClusters != nil {
		return v.ActiveClusters
	}

	return
}

// IsSetActiveClusters returns true if ActiveClusters is not nil.
func (v *DomainReplicationConfiguration) IsSetActiveClusters() bool {
	return v != nil && v.ActiveClusters != nil
}

type DomainStatus int32

const (
	DomainStatusRegistered DomainStatus = 0
	DomainStatusDeprecated DomainStatus = 1
	DomainStatusDeleted    DomainStatus = 2
)

// DomainStatus_Values returns all recognized values of DomainStatus.
func DomainStatus_Values() []DomainStatus {
	return []DomainStatus{
		DomainStatusRegistered,
		DomainStatusDeprecated,
		DomainStatusDeleted,
	}
}

// UnmarshalText tries to decode DomainStatus from a byte slice
// containing its name.
//
//	var v DomainStatus
//	err := v.UnmarshalText([]byte("REGISTERED"))
func (v *DomainStatus) UnmarshalText(value []byte) error {
	switch s := string(value); s {
	case "REGISTERED":
		*v = DomainStatusRegistered
		return nil
	case "DEPRECATED":
		*v = DomainStatusDeprecated
		return nil
	case "DELETED":
		*v = DomainStatusDeleted
		return nil
	default:
		val, err := strconv.ParseInt(s, 10, 32)
		if err != nil {
			return fmt.Errorf("unknown enum value %q for %q: %v", s, "DomainStatus", err)
		}
		*v = DomainStatus(val)
		return nil
	}
}

// MarshalText encodes DomainStatus 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 DomainStatus) MarshalText() ([]byte, error) {
	switch int32(v) {
	case 0:
		return []byte("REGISTERED"), nil
	case 1:
		return []byte("DEPRECATED"), nil
	case 2:
		return []byte("DELETED"), nil
	}
	return []byte(strconv.FormatInt(int64(v), 10)), nil
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of DomainStatus.
// 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 DomainStatus) MarshalLogObject(enc zapcore.ObjectEncoder) error {
	enc.AddInt32("value", int32(v))
	switch int32(v) {
	case 0:
		enc.AddString("name", "REGISTERED")
	case 1:
		enc.AddString("name", "DEPRECATED")
	case 2:
		enc.AddString("name", "DELETED")
	}
	return nil
}

// Ptr returns a pointer to this enum value.
func (v DomainStatus) Ptr() *DomainStatus {
	return &v
}

// ToWire translates DomainStatus 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 DomainStatus) ToWire() (wire.Value, error) {
	return wire.NewValueI32(int32(v)), nil
}

// FromWire deserializes DomainStatus from its Thrift-level
// representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TI32)
//	if err != nil {
//	  return DomainStatus(0), err
//	}
//
//	var v DomainStatus
//	if err := v.FromWire(x); err != nil {
//	  return DomainStatus(0), err
//	}
//	return v, nil
func (v *DomainStatus) FromWire(w wire.Value) error {
	*v = (DomainStatus)(w.GetI32())
	return nil
}

// String returns a readable string representation of DomainStatus.
func (v DomainStatus) String() string {
	w := int32(v)
	switch w {
	case 0:
		return "REGISTERED"
	case 1:
		return "DEPRECATED"
	case 2:
		return "DELETED"
	}
	return fmt.Sprintf("DomainStatus(%d)", w)
}

// Equals returns true if this DomainStatus value matches the provided
// value.
func (v DomainStatus) Equals(rhs DomainStatus) bool {
	return v == rhs
}

// MarshalJSON serializes DomainStatus into JSON.
//
// If the enum value is recognized, its name is returned. Otherwise,
// its integer value is returned.
//
// This implements json.Marshaler.
func (v DomainStatus) MarshalJSON() ([]byte, error) {
	switch int32(v) {
	case 0:
		return ([]byte)("\"REGISTERED\""), nil
	case 1:
		return ([]byte)("\"DEPRECATED\""), nil
	case 2:
		return ([]byte)("\"DELETED\""), nil
	}
	return ([]byte)(strconv.FormatInt(int64(v), 10)), nil
}

// UnmarshalJSON attempts to decode DomainStatus 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 *DomainStatus) 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, "DomainStatus")
		}
		if x < math.MinInt32 {
			return fmt.Errorf("enum underflow from JSON %q for %q", text, "DomainStatus")
		}
		*v = (DomainStatus)(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, "DomainStatus")
	}
}

type EncodingType int32

const (
	EncodingTypeThriftRW EncodingType = 0
	EncodingTypeJSON     EncodingType = 1
)

// EncodingType_Values returns all recognized values of EncodingType.
func EncodingType_Values() []EncodingType {
	return []EncodingType{
		EncodingTypeThriftRW,
		EncodingTypeJSON,
	}
}

// UnmarshalText tries to decode EncodingType from a byte slice
// containing its name.
//
//	var v EncodingType
//	err := v.UnmarshalText([]byte("ThriftRW"))
func (v *EncodingType) UnmarshalText(value []byte) error {
	switch s := string(value); s {
	case "ThriftRW":
		*v = EncodingTypeThriftRW
		return nil
	case "JSON":
		*v = EncodingTypeJSON
		return nil
	default:
		val, err := strconv.ParseInt(s, 10, 32)
		if err != nil {
			return fmt.Errorf("unknown enum value %q for %q: %v", s, "EncodingType", err)
		}
		*v = EncodingType(val)
		return nil
	}
}

// MarshalText encodes EncodingType 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 EncodingType) MarshalText() ([]byte, error) {
	switch int32(v) {
	case 0:
		return []byte("ThriftRW"), nil
	case 1:
		return []byte("JSON"), nil
	}
	return []byte(strconv.FormatInt(int64(v), 10)), nil
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of EncodingType.
// 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 EncodingType) MarshalLogObject(enc zapcore.ObjectEncoder) error {
	enc.AddInt32("value", int32(v))
	switch int32(v) {
	case 0:
		enc.AddString("name", "ThriftRW")
	case 1:
		enc.AddString("name", "JSON")
	}
	return nil
}

// Ptr returns a pointer to this enum value.
func (v EncodingType) Ptr() *EncodingType {
	return &v
}

// ToWire translates EncodingType 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 EncodingType) ToWire() (wire.Value, error) {
	return wire.NewValueI32(int32(v)), nil
}

// FromWire deserializes EncodingType from its Thrift-level
// representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TI32)
//	if err != nil {
//	  return EncodingType(0), err
//	}
//
//	var v EncodingType
//	if err := v.FromWire(x); err != nil {
//	  return EncodingType(0), err
//	}
//	return v, nil
func (v *EncodingType) FromWire(w wire.Value) error {
	*v = (EncodingType)(w.GetI32())
	return nil
}

// String returns a readable string representation of EncodingType.
func (v EncodingType) String() string {
	w := int32(v)
	switch w {
	case 0:
		return "ThriftRW"
	case 1:
		return "JSON"
	}
	return fmt.Sprintf("EncodingType(%d)", w)
}

// Equals returns true if this EncodingType value matches the provided
// value.
func (v EncodingType) Equals(rhs EncodingType) bool {
	return v == rhs
}

// MarshalJSON serializes EncodingType into JSON.
//
// If the enum value is recognized, its name is returned. Otherwise,
// its integer value is returned.
//
// This implements json.Marshaler.
func (v EncodingType) MarshalJSON() ([]byte, error) {
	switch int32(v) {
	case 0:
		return ([]byte)("\"ThriftRW\""), nil
	case 1:
		return ([]byte)("\"JSON\""), nil
	}
	return ([]byte)(strconv.FormatInt(int64(v), 10)), nil
}

// UnmarshalJSON attempts to decode EncodingType 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 *EncodingType) 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, "EncodingType")
		}
		if x < math.MinInt32 {
			return fmt.Errorf("enum underflow from JSON %q for %q", text, "EncodingType")
		}
		*v = (EncodingType)(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, "EncodingType")
	}
}

type EntityNotExistsError struct {
	Message        string   `json:"message,required"`
	CurrentCluster *string  `json:"currentCluster,omitempty"`
	ActiveCluster  *string  `json:"activeCluster,omitempty"`
	ActiveClusters []string `json:"activeClusters,required"`
}

// ToWire translates a EntityNotExistsError 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 *EntityNotExistsError) ToWire() (wire.Value, error) {
	var (
		fields [4]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++
	if v.CurrentCluster != nil {
		w, err = wire.NewValueString(*(v.CurrentCluster)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 2, Value: w}
		i++
	}
	if v.ActiveCluster != nil {
		w, err = wire.NewValueString(*(v.ActiveCluster)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 3, Value: w}
		i++
	}

	w, err = wire.NewValueList(_List_String_ValueList(v.ActiveClusters)), error(nil)
	if err != nil {
		return w, err
	}
	fields[i] = wire.Field{ID: 4, Value: w}
	i++

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

// FromWire deserializes a EntityNotExistsError 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 EntityNotExistsError struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v EntityNotExistsError
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *EntityNotExistsError) FromWire(w wire.Value) error {
	var err error

	messageIsSet := false

	activeClustersIsSet := 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
			}
		case 2:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.CurrentCluster = &x
				if err != nil {
					return err
				}

			}
		case 3:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.ActiveCluster = &x
				if err != nil {
					return err
				}

			}
		case 4:
			if field.Value.Type() == wire.TList {
				v.ActiveClusters, err = _List_String_Read(field.Value.GetList())
				if err != nil {
					return err
				}
				activeClustersIsSet = true
			}
		}
	}

	if !messageIsSet {
		return errors.New("field Message of EntityNotExistsError is required")
	}

	if !activeClustersIsSet {
		return errors.New("field ActiveClusters of EntityNotExistsError is required")
	}

	return nil
}

// String returns a readable string representation of a EntityNotExistsError
// struct.
func (v *EntityNotExistsError) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [4]string
	i := 0
	fields[i] = fmt.Sprintf("Message: %v", v.Message)
	i++
	if v.CurrentCluster != nil {
		fields[i] = fmt.Sprintf("CurrentCluster: %v", *(v.CurrentCluster))
		i++
	}
	if v.ActiveCluster != nil {
		fields[i] = fmt.Sprintf("ActiveCluster: %v", *(v.ActiveCluster))
		i++
	}
	fields[i] = fmt.Sprintf("ActiveClusters: %v", v.ActiveClusters)
	i++

	return fmt.Sprintf("EntityNotExistsError{%v}", strings.Join(fields[:i], ", "))
}

// ErrorName is the name of this type as defined in the Thrift
// file.
func (*EntityNotExistsError) ErrorName() string {
	return "EntityNotExistsError"
}

// Equals returns true if all the fields of this EntityNotExistsError match the
// provided EntityNotExistsError.
//
// This function performs a deep comparison.
func (v *EntityNotExistsError) Equals(rhs *EntityNotExistsError) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !(v.Message == rhs.Message) {
		return false
	}
	if !_String_EqualsPtr(v.CurrentCluster, rhs.CurrentCluster) {
		return false
	}
	if !_String_EqualsPtr(v.ActiveCluster, rhs.ActiveCluster) {
		return false
	}
	if !_List_String_Equals(v.ActiveClusters, rhs.ActiveClusters) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of EntityNotExistsError.
func (v *EntityNotExistsError) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	enc.AddString("message", v.Message)
	if v.CurrentCluster != nil {
		enc.AddString("currentCluster", *v.CurrentCluster)
	}
	if v.ActiveCluster != nil {
		enc.AddString("activeCluster", *v.ActiveCluster)
	}
	err = multierr.Append(err, enc.AddArray("activeClusters", (_List_String_Zapper)(v.ActiveClusters)))
	return err
}

// GetMessage returns the value of Message if it is set or its
// zero value if it is unset.
func (v *EntityNotExistsError) GetMessage() (o string) {
	if v != nil {
		o = v.Message
	}
	return
}

// GetCurrentCluster returns the value of CurrentCluster if it is set or its
// zero value if it is unset.
func (v *EntityNotExistsError) GetCurrentCluster() (o string) {
	if v != nil && v.CurrentCluster != nil {
		return *v.CurrentCluster
	}

	return
}

// IsSetCurrentCluster returns true if CurrentCluster is not nil.
func (v *EntityNotExistsError) IsSetCurrentCluster() bool {
	return v != nil && v.CurrentCluster != nil
}

// GetActiveCluster returns the value of ActiveCluster if it is set or its
// zero value if it is unset.
func (v *EntityNotExistsError) GetActiveCluster() (o string) {
	if v != nil && v.ActiveCluster != nil {
		return *v.ActiveCluster
	}

	return
}

// IsSetActiveCluster returns true if ActiveCluster is not nil.
func (v *EntityNotExistsError) IsSetActiveCluster() bool {
	return v != nil && v.ActiveCluster != nil
}

// GetActiveClusters returns the value of ActiveClusters if it is set or its
// zero value if it is unset.
func (v *EntityNotExistsError) GetActiveClusters() (o []string) {
	if v != nil {
		o = v.ActiveClusters
	}
	return
}

// IsSetActiveClusters returns true if ActiveClusters is not nil.
func (v *EntityNotExistsError) IsSetActiveClusters() bool {
	return v != nil && v.ActiveClusters != nil
}

func (v *EntityNotExistsError) Error() string {
	return v.String()
}

type EventType int32

const (
	EventTypeWorkflowExecutionStarted                        EventType = 0
	EventTypeWorkflowExecutionCompleted                      EventType = 1
	EventTypeWorkflowExecutionFailed                         EventType = 2
	EventTypeWorkflowExecutionTimedOut                       EventType = 3
	EventTypeDecisionTaskScheduled                           EventType = 4
	EventTypeDecisionTaskStarted                             EventType = 5
	EventTypeDecisionTaskCompleted                           EventType = 6
	EventTypeDecisionTaskTimedOut                            EventType = 7
	EventTypeDecisionTaskFailed                              EventType = 8
	EventTypeActivityTaskScheduled                           EventType = 9
	EventTypeActivityTaskStarted                             EventType = 10
	EventTypeActivityTaskCompleted                           EventType = 11
	EventTypeActivityTaskFailed                              EventType = 12
	EventTypeActivityTaskTimedOut                            EventType = 13
	EventTypeActivityTaskCancelRequested                     EventType = 14
	EventTypeRequestCancelActivityTaskFailed                 EventType = 15
	EventTypeActivityTaskCanceled                            EventType = 16
	EventTypeTimerStarted                                    EventType = 17
	EventTypeTimerFired                                      EventType = 18
	EventTypeCancelTimerFailed                               EventType = 19
	EventTypeTimerCanceled                                   EventType = 20
	EventTypeWorkflowExecutionCancelRequested                EventType = 21
	EventTypeWorkflowExecutionCanceled                       EventType = 22
	EventTypeRequestCancelExternalWorkflowExecutionInitiated EventType = 23
	EventTypeRequestCancelExternalWorkflowExecutionFailed    EventType = 24
	EventTypeExternalWorkflowExecutionCancelRequested        EventType = 25
	EventTypeMarkerRecorded                                  EventType = 26
	EventTypeWorkflowExecutionSignaled                       EventType = 27
	EventTypeWorkflowExecutionTerminated                     EventType = 28
	EventTypeWorkflowExecutionContinuedAsNew                 EventType = 29
	EventTypeStartChildWorkflowExecutionInitiated            EventType = 30
	EventTypeStartChildWorkflowExecutionFailed               EventType = 31
	EventTypeChildWorkflowExecutionStarted                   EventType = 32
	EventTypeChildWorkflowExecutionCompleted                 EventType = 33
	EventTypeChildWorkflowExecutionFailed                    EventType = 34
	EventTypeChildWorkflowExecutionCanceled                  EventType = 35
	EventTypeChildWorkflowExecutionTimedOut                  EventType = 36
	EventTypeChildWorkflowExecutionTerminated                EventType = 37
	EventTypeSignalExternalWorkflowExecutionInitiated        EventType = 38
	EventTypeSignalExternalWorkflowExecutionFailed           EventType = 39
	EventTypeExternalWorkflowExecutionSignaled               EventType = 40
	EventTypeUpsertWorkflowSearchAttributes                  EventType = 41
)

// EventType_Values returns all recognized values of EventType.
func EventType_Values() []EventType {
	return []EventType{
		EventTypeWorkflowExecutionStarted,
		EventTypeWorkflowExecutionCompleted,
		EventTypeWorkflowExecutionFailed,
		EventTypeWorkflowExecutionTimedOut,
		EventTypeDecisionTaskScheduled,
		EventTypeDecisionTaskStarted,
		EventTypeDecisionTaskCompleted,
		EventTypeDecisionTaskTimedOut,
		EventTypeDecisionTaskFailed,
		EventTypeActivityTaskScheduled,
		EventTypeActivityTaskStarted,
		EventTypeActivityTaskCompleted,
		EventTypeActivityTaskFailed,
		EventTypeActivityTaskTimedOut,
		EventTypeActivityTaskCancelRequested,
		EventTypeRequestCancelActivityTaskFailed,
		EventTypeActivityTaskCanceled,
		EventTypeTimerStarted,
		EventTypeTimerFired,
		EventTypeCancelTimerFailed,
		EventTypeTimerCanceled,
		EventTypeWorkflowExecutionCancelRequested,
		EventTypeWorkflowExecutionCanceled,
		EventTypeRequestCancelExternalWorkflowExecutionInitiated,
		EventTypeRequestCancelExternalWorkflowExecutionFailed,
		EventTypeExternalWorkflowExecutionCancelRequested,
		EventTypeMarkerRecorded,
		EventTypeWorkflowExecutionSignaled,
		EventTypeWorkflowExecutionTerminated,
		EventTypeWorkflowExecutionContinuedAsNew,
		EventTypeStartChildWorkflowExecutionInitiated,
		EventTypeStartChildWorkflowExecutionFailed,
		EventTypeChildWorkflowExecutionStarted,
		EventTypeChildWorkflowExecutionCompleted,
		EventTypeChildWorkflowExecutionFailed,
		EventTypeChildWorkflowExecutionCanceled,
		EventTypeChildWorkflowExecutionTimedOut,
		EventTypeChildWorkflowExecutionTerminated,
		EventTypeSignalExternalWorkflowExecutionInitiated,
		EventTypeSignalExternalWorkflowExecutionFailed,
		EventTypeExternalWorkflowExecutionSignaled,
		EventTypeUpsertWorkflowSearchAttributes,
	}
}

// UnmarshalText tries to decode EventType from a byte slice
// containing its name.
//
//	var v EventType
//	err := v.UnmarshalText([]byte("WorkflowExecutionStarted"))
func (v *EventType) UnmarshalText(value []byte) error {
	switch s := string(value); s {
	case "WorkflowExecutionStarted":
		*v = EventTypeWorkflowExecutionStarted
		return nil
	case "WorkflowExecutionCompleted":
		*v = EventTypeWorkflowExecutionCompleted
		return nil
	case "WorkflowExecutionFailed":
		*v = EventTypeWorkflowExecutionFailed
		return nil
	case "WorkflowExecutionTimedOut":
		*v = EventTypeWorkflowExecutionTimedOut
		return nil
	case "DecisionTaskScheduled":
		*v = EventTypeDecisionTaskScheduled
		return nil
	case "DecisionTaskStarted":
		*v = EventTypeDecisionTaskStarted
		return nil
	case "DecisionTaskCompleted":
		*v = EventTypeDecisionTaskCompleted
		return nil
	case "DecisionTaskTimedOut":
		*v = EventTypeDecisionTaskTimedOut
		return nil
	case "DecisionTaskFailed":
		*v = EventTypeDecisionTaskFailed
		return nil
	case "ActivityTaskScheduled":
		*v = EventTypeActivityTaskScheduled
		return nil
	case "ActivityTaskStarted":
		*v = EventTypeActivityTaskStarted
		return nil
	case "ActivityTaskCompleted":
		*v = EventTypeActivityTaskCompleted
		return nil
	case "ActivityTaskFailed":
		*v = EventTypeActivityTaskFailed
		return nil
	case "ActivityTaskTimedOut":
		*v = EventTypeActivityTaskTimedOut
		return nil
	case "ActivityTaskCancelRequested":
		*v = EventTypeActivityTaskCancelRequested
		return nil
	case "RequestCancelActivityTaskFailed":
		*v = EventTypeRequestCancelActivityTaskFailed
		return nil
	case "ActivityTaskCanceled":
		*v = EventTypeActivityTaskCanceled
		return nil
	case "TimerStarted":
		*v = EventTypeTimerStarted
		return nil
	case "TimerFired":
		*v = EventTypeTimerFired
		return nil
	case "CancelTimerFailed":
		*v = EventTypeCancelTimerFailed
		return nil
	case "TimerCanceled":
		*v = EventTypeTimerCanceled
		return nil
	case "WorkflowExecutionCancelRequested":
		*v = EventTypeWorkflowExecutionCancelRequested
		return nil
	case "WorkflowExecutionCanceled":
		*v = EventTypeWorkflowExecutionCanceled
		return nil
	case "RequestCancelExternalWorkflowExecutionInitiated":
		*v = EventTypeRequestCancelExternalWorkflowExecutionInitiated
		return nil
	case "RequestCancelExternalWorkflowExecutionFailed":
		*v = EventTypeRequestCancelExternalWorkflowExecutionFailed
		return nil
	case "ExternalWorkflowExecutionCancelRequested":
		*v = EventTypeExternalWorkflowExecutionCancelRequested
		return nil
	case "MarkerRecorded":
		*v = EventTypeMarkerRecorded
		return nil
	case "WorkflowExecutionSignaled":
		*v = EventTypeWorkflowExecutionSignaled
		return nil
	case "WorkflowExecutionTerminated":
		*v = EventTypeWorkflowExecutionTerminated
		return nil
	case "WorkflowExecutionContinuedAsNew":
		*v = EventTypeWorkflowExecutionContinuedAsNew
		return nil
	case "StartChildWorkflowExecutionInitiated":
		*v = EventTypeStartChildWorkflowExecutionInitiated
		return nil
	case "StartChildWorkflowExecutionFailed":
		*v = EventTypeStartChildWorkflowExecutionFailed
		return nil
	case "ChildWorkflowExecutionStarted":
		*v = EventTypeChildWorkflowExecutionStarted
		return nil
	case "ChildWorkflowExecutionCompleted":
		*v = EventTypeChildWorkflowExecutionCompleted
		return nil
	case "ChildWorkflowExecutionFailed":
		*v = EventTypeChildWorkflowExecutionFailed
		return nil
	case "ChildWorkflowExecutionCanceled":
		*v = EventTypeChildWorkflowExecutionCanceled
		return nil
	case "ChildWorkflowExecutionTimedOut":
		*v = EventTypeChildWorkflowExecutionTimedOut
		return nil
	case "ChildWorkflowExecutionTerminated":
		*v = EventTypeChildWorkflowExecutionTerminated
		return nil
	case "SignalExternalWorkflowExecutionInitiated":
		*v = EventTypeSignalExternalWorkflowExecutionInitiated
		return nil
	case "SignalExternalWorkflowExecutionFailed":
		*v = EventTypeSignalExternalWorkflowExecutionFailed
		return nil
	case "ExternalWorkflowExecutionSignaled":
		*v = EventTypeExternalWorkflowExecutionSignaled
		return nil
	case "UpsertWorkflowSearchAttributes":
		*v = EventTypeUpsertWorkflowSearchAttributes
		return nil
	default:
		val, err := strconv.ParseInt(s, 10, 32)
		if err != nil {
			return fmt.Errorf("unknown enum value %q for %q: %v", s, "EventType", err)
		}
		*v = EventType(val)
		return nil
	}
}

// MarshalText encodes EventType 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 EventType) MarshalText() ([]byte, error) {
	switch int32(v) {
	case 0:
		return []byte("WorkflowExecutionStarted"), nil
	case 1:
		return []byte("WorkflowExecutionCompleted"), nil
	case 2:
		return []byte("WorkflowExecutionFailed"), nil
	case 3:
		return []byte("WorkflowExecutionTimedOut"), nil
	case 4:
		return []byte("DecisionTaskScheduled"), nil
	case 5:
		return []byte("DecisionTaskStarted"), nil
	case 6:
		return []byte("DecisionTaskCompleted"), nil
	case 7:
		return []byte("DecisionTaskTimedOut"), nil
	case 8:
		return []byte("DecisionTaskFailed"), nil
	case 9:
		return []byte("ActivityTaskScheduled"), nil
	case 10:
		return []byte("ActivityTaskStarted"), nil
	case 11:
		return []byte("ActivityTaskCompleted"), nil
	case 12:
		return []byte("ActivityTaskFailed"), nil
	case 13:
		return []byte("ActivityTaskTimedOut"), nil
	case 14:
		return []byte("ActivityTaskCancelRequested"), nil
	case 15:
		return []byte("RequestCancelActivityTaskFailed"), nil
	case 16:
		return []byte("ActivityTaskCanceled"), nil
	case 17:
		return []byte("TimerStarted"), nil
	case 18:
		return []byte("TimerFired"), nil
	case 19:
		return []byte("CancelTimerFailed"), nil
	case 20:
		return []byte("TimerCanceled"), nil
	case 21:
		return []byte("WorkflowExecutionCancelRequested"), nil
	case 22:
		return []byte("WorkflowExecutionCanceled"), nil
	case 23:
		return []byte("RequestCancelExternalWorkflowExecutionInitiated"), nil
	case 24:
		return []byte("RequestCancelExternalWorkflowExecutionFailed"), nil
	case 25:
		return []byte("ExternalWorkflowExecutionCancelRequested"), nil
	case 26:
		return []byte("MarkerRecorded"), nil
	case 27:
		return []byte("WorkflowExecutionSignaled"), nil
	case 28:
		return []byte("WorkflowExecutionTerminated"), nil
	case 29:
		return []byte("WorkflowExecutionContinuedAsNew"), nil
	case 30:
		return []byte("StartChildWorkflowExecutionInitiated"), nil
	case 31:
		return []byte("StartChildWorkflowExecutionFailed"), nil
	case 32:
		return []byte("ChildWorkflowExecutionStarted"), nil
	case 33:
		return []byte("ChildWorkflowExecutionCompleted"), nil
	case 34:
		return []byte("ChildWorkflowExecutionFailed"), nil
	case 35:
		return []byte("ChildWorkflowExecutionCanceled"), nil
	case 36:
		return []byte("ChildWorkflowExecutionTimedOut"), nil
	case 37:
		return []byte("ChildWorkflowExecutionTerminated"), nil
	case 38:
		return []byte("SignalExternalWorkflowExecutionInitiated"), nil
	case 39:
		return []byte("SignalExternalWorkflowExecutionFailed"), nil
	case 40:
		return []byte("ExternalWorkflowExecutionSignaled"), nil
	case 41:
		return []byte("UpsertWorkflowSearchAttributes"), nil
	}
	return []byte(strconv.FormatInt(int64(v), 10)), nil
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of EventType.
// 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 EventType) MarshalLogObject(enc zapcore.ObjectEncoder) error {
	enc.AddInt32("value", int32(v))
	switch int32(v) {
	case 0:
		enc.AddString("name", "WorkflowExecutionStarted")
	case 1:
		enc.AddString("name", "WorkflowExecutionCompleted")
	case 2:
		enc.AddString("name", "WorkflowExecutionFailed")
	case 3:
		enc.AddString("name", "WorkflowExecutionTimedOut")
	case 4:
		enc.AddString("name", "DecisionTaskScheduled")
	case 5:
		enc.AddString("name", "DecisionTaskStarted")
	case 6:
		enc.AddString("name", "DecisionTaskCompleted")
	case 7:
		enc.AddString("name", "DecisionTaskTimedOut")
	case 8:
		enc.AddString("name", "DecisionTaskFailed")
	case 9:
		enc.AddString("name", "ActivityTaskScheduled")
	case 10:
		enc.AddString("name", "ActivityTaskStarted")
	case 11:
		enc.AddString("name", "ActivityTaskCompleted")
	case 12:
		enc.AddString("name", "ActivityTaskFailed")
	case 13:
		enc.AddString("name", "ActivityTaskTimedOut")
	case 14:
		enc.AddString("name", "ActivityTaskCancelRequested")
	case 15:
		enc.AddString("name", "RequestCancelActivityTaskFailed")
	case 16:
		enc.AddString("name", "ActivityTaskCanceled")
	case 17:
		enc.AddString("name", "TimerStarted")
	case 18:
		enc.AddString("name", "TimerFired")
	case 19:
		enc.AddString("name", "CancelTimerFailed")
	case 20:
		enc.AddString("name", "TimerCanceled")
	case 21:
		enc.AddString("name", "WorkflowExecutionCancelRequested")
	case 22:
		enc.AddString("name", "WorkflowExecutionCanceled")
	case 23:
		enc.AddString("name", "RequestCancelExternalWorkflowExecutionInitiated")
	case 24:
		enc.AddString("name", "RequestCancelExternalWorkflowExecutionFailed")
	case 25:
		enc.AddString("name", "ExternalWorkflowExecutionCancelRequested")
	case 26:
		enc.AddString("name", "MarkerRecorded")
	case 27:
		enc.AddString("name", "WorkflowExecutionSignaled")
	case 28:
		enc.AddString("name", "WorkflowExecutionTerminated")
	case 29:
		enc.AddString("name", "WorkflowExecutionContinuedAsNew")
	case 30:
		enc.AddString("name", "StartChildWorkflowExecutionInitiated")
	case 31:
		enc.AddString("name", "StartChildWorkflowExecutionFailed")
	case 32:
		enc.AddString("name", "ChildWorkflowExecutionStarted")
	case 33:
		enc.AddString("name", "ChildWorkflowExecutionCompleted")
	case 34:
		enc.AddString("name", "ChildWorkflowExecutionFailed")
	case 35:
		enc.AddString("name", "ChildWorkflowExecutionCanceled")
	case 36:
		enc.AddString("name", "ChildWorkflowExecutionTimedOut")
	case 37:
		enc.AddString("name", "ChildWorkflowExecutionTerminated")
	case 38:
		enc.AddString("name", "SignalExternalWorkflowExecutionInitiated")
	case 39:
		enc.AddString("name", "SignalExternalWorkflowExecutionFailed")
	case 40:
		enc.AddString("name", "ExternalWorkflowExecutionSignaled")
	case 41:
		enc.AddString("name", "UpsertWorkflowSearchAttributes")
	}
	return nil
}

// Ptr returns a pointer to this enum value.
func (v EventType) Ptr() *EventType {
	return &v
}

// ToWire translates EventType 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 EventType) ToWire() (wire.Value, error) {
	return wire.NewValueI32(int32(v)), nil
}

// FromWire deserializes EventType from its Thrift-level
// representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TI32)
//	if err != nil {
//	  return EventType(0), err
//	}
//
//	var v EventType
//	if err := v.FromWire(x); err != nil {
//	  return EventType(0), err
//	}
//	return v, nil
func (v *EventType) FromWire(w wire.Value) error {
	*v = (EventType)(w.GetI32())
	return nil
}

// String returns a readable string representation of EventType.
func (v EventType) String() string {
	w := int32(v)
	switch w {
	case 0:
		return "WorkflowExecutionStarted"
	case 1:
		return "WorkflowExecutionCompleted"
	case 2:
		return "WorkflowExecutionFailed"
	case 3:
		return "WorkflowExecutionTimedOut"
	case 4:
		return "DecisionTaskScheduled"
	case 5:
		return "DecisionTaskStarted"
	case 6:
		return "DecisionTaskCompleted"
	case 7:
		return "DecisionTaskTimedOut"
	case 8:
		return "DecisionTaskFailed"
	case 9:
		return "ActivityTaskScheduled"
	case 10:
		return "ActivityTaskStarted"
	case 11:
		return "ActivityTaskCompleted"
	case 12:
		return "ActivityTaskFailed"
	case 13:
		return "ActivityTaskTimedOut"
	case 14:
		return "ActivityTaskCancelRequested"
	case 15:
		return "RequestCancelActivityTaskFailed"
	case 16:
		return "ActivityTaskCanceled"
	case 17:
		return "TimerStarted"
	case 18:
		return "TimerFired"
	case 19:
		return "CancelTimerFailed"
	case 20:
		return "TimerCanceled"
	case 21:
		return "WorkflowExecutionCancelRequested"
	case 22:
		return "WorkflowExecutionCanceled"
	case 23:
		return "RequestCancelExternalWorkflowExecutionInitiated"
	case 24:
		return "RequestCancelExternalWorkflowExecutionFailed"
	case 25:
		return "ExternalWorkflowExecutionCancelRequested"
	case 26:
		return "MarkerRecorded"
	case 27:
		return "WorkflowExecutionSignaled"
	case 28:
		return "WorkflowExecutionTerminated"
	case 29:
		return "WorkflowExecutionContinuedAsNew"
	case 30:
		return "StartChildWorkflowExecutionInitiated"
	case 31:
		return "StartChildWorkflowExecutionFailed"
	case 32:
		return "ChildWorkflowExecutionStarted"
	case 33:
		return "ChildWorkflowExecutionCompleted"
	case 34:
		return "ChildWorkflowExecutionFailed"
	case 35:
		return "ChildWorkflowExecutionCanceled"
	case 36:
		return "ChildWorkflowExecutionTimedOut"
	case 37:
		return "ChildWorkflowExecutionTerminated"
	case 38:
		return "SignalExternalWorkflowExecutionInitiated"
	case 39:
		return "SignalExternalWorkflowExecutionFailed"
	case 40:
		return "ExternalWorkflowExecutionSignaled"
	case 41:
		return "UpsertWorkflowSearchAttributes"
	}
	return fmt.Sprintf("EventType(%d)", w)
}

// Equals returns true if this EventType value matches the provided
// value.
func (v EventType) Equals(rhs EventType) bool {
	return v == rhs
}

// MarshalJSON serializes EventType into JSON.
//
// If the enum value is recognized, its name is returned. Otherwise,
// its integer value is returned.
//
// This implements json.Marshaler.
func (v EventType) MarshalJSON() ([]byte, error) {
	switch int32(v) {
	case 0:
		return ([]byte)("\"WorkflowExecutionStarted\""), nil
	case 1:
		return ([]byte)("\"WorkflowExecutionCompleted\""), nil
	case 2:
		return ([]byte)("\"WorkflowExecutionFailed\""), nil
	case 3:
		return ([]byte)("\"WorkflowExecutionTimedOut\""), nil
	case 4:
		return ([]byte)("\"DecisionTaskScheduled\""), nil
	case 5:
		return ([]byte)("\"DecisionTaskStarted\""), nil
	case 6:
		return ([]byte)("\"DecisionTaskCompleted\""), nil
	case 7:
		return ([]byte)("\"DecisionTaskTimedOut\""), nil
	case 8:
		return ([]byte)("\"DecisionTaskFailed\""), nil
	case 9:
		return ([]byte)("\"ActivityTaskScheduled\""), nil
	case 10:
		return ([]byte)("\"ActivityTaskStarted\""), nil
	case 11:
		return ([]byte)("\"ActivityTaskCompleted\""), nil
	case 12:
		return ([]byte)("\"ActivityTaskFailed\""), nil
	case 13:
		return ([]byte)("\"ActivityTaskTimedOut\""), nil
	case 14:
		return ([]byte)("\"ActivityTaskCancelRequested\""), nil
	case 15:
		return ([]byte)("\"RequestCancelActivityTaskFailed\""), nil
	case 16:
		return ([]byte)("\"ActivityTaskCanceled\""), nil
	case 17:
		return ([]byte)("\"TimerStarted\""), nil
	case 18:
		return ([]byte)("\"TimerFired\""), nil
	case 19:
		return ([]byte)("\"CancelTimerFailed\""), nil
	case 20:
		return ([]byte)("\"TimerCanceled\""), nil
	case 21:
		return ([]byte)("\"WorkflowExecutionCancelRequested\""), nil
	case 22:
		return ([]byte)("\"WorkflowExecutionCanceled\""), nil
	case 23:
		return ([]byte)("\"RequestCancelExternalWorkflowExecutionInitiated\""), nil
	case 24:
		return ([]byte)("\"RequestCancelExternalWorkflowExecutionFailed\""), nil
	case 25:
		return ([]byte)("\"ExternalWorkflowExecutionCancelRequested\""), nil
	case 26:
		return ([]byte)("\"MarkerRecorded\""), nil
	case 27:
		return ([]byte)("\"WorkflowExecutionSignaled\""), nil
	case 28:
		return ([]byte)("\"WorkflowExecutionTerminated\""), nil
	case 29:
		return ([]byte)("\"WorkflowExecutionContinuedAsNew\""), nil
	case 30:
		return ([]byte)("\"StartChildWorkflowExecutionInitiated\""), nil
	case 31:
		return ([]byte)("\"StartChildWorkflowExecutionFailed\""), nil
	case 32:
		return ([]byte)("\"ChildWorkflowExecutionStarted\""), nil
	case 33:
		return ([]byte)("\"ChildWorkflowExecutionCompleted\""), nil
	case 34:
		return ([]byte)("\"ChildWorkflowExecutionFailed\""), nil
	case 35:
		return ([]byte)("\"ChildWorkflowExecutionCanceled\""), nil
	case 36:
		return ([]byte)("\"ChildWorkflowExecutionTimedOut\""), nil
	case 37:
		return ([]byte)("\"ChildWorkflowExecutionTerminated\""), nil
	case 38:
		return ([]byte)("\"SignalExternalWorkflowExecutionInitiated\""), nil
	case 39:
		return ([]byte)("\"SignalExternalWorkflowExecutionFailed\""), nil
	case 40:
		return ([]byte)("\"ExternalWorkflowExecutionSignaled\""), nil
	case 41:
		return ([]byte)("\"UpsertWorkflowSearchAttributes\""), nil
	}
	return ([]byte)(strconv.FormatInt(int64(v), 10)), nil
}

// UnmarshalJSON attempts to decode EventType 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 *EventType) 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, "EventType")
		}
		if x < math.MinInt32 {
			return fmt.Errorf("enum underflow from JSON %q for %q", text, "EventType")
		}
		*v = (EventType)(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, "EventType")
	}
}

type ExternalWorkflowExecutionCancelRequestedEventAttributes struct {
	InitiatedEventId  *int64             `json:"initiatedEventId,omitempty"`
	Domain            *string            `json:"domain,omitempty"`
	WorkflowExecution *WorkflowExecution `json:"workflowExecution,omitempty"`
}

// ToWire translates a ExternalWorkflowExecutionCancelRequestedEventAttributes 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 *ExternalWorkflowExecutionCancelRequestedEventAttributes) ToWire() (wire.Value, error) {
	var (
		fields [3]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.InitiatedEventId != nil {
		w, err = wire.NewValueI64(*(v.InitiatedEventId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.Domain != nil {
		w, err = wire.NewValueString(*(v.Domain)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.WorkflowExecution != nil {
		w, err = v.WorkflowExecution.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

// FromWire deserializes a ExternalWorkflowExecutionCancelRequestedEventAttributes 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 ExternalWorkflowExecutionCancelRequestedEventAttributes struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v ExternalWorkflowExecutionCancelRequestedEventAttributes
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *ExternalWorkflowExecutionCancelRequestedEventAttributes) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			if field.Value.Type() == wire.TI64 {
				var x int64
				x, err = field.Value.GetI64(), error(nil)
				v.InitiatedEventId = &x
				if err != nil {
					return err
				}

			}
		case 20:
			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 30:
			if field.Value.Type() == wire.TStruct {
				v.WorkflowExecution, err = _WorkflowExecution_Read(field.Value)
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a ExternalWorkflowExecutionCancelRequestedEventAttributes
// struct.
func (v *ExternalWorkflowExecutionCancelRequestedEventAttributes) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [3]string
	i := 0
	if v.InitiatedEventId != nil {
		fields[i] = fmt.Sprintf("InitiatedEventId: %v", *(v.InitiatedEventId))
		i++
	}
	if v.Domain != nil {
		fields[i] = fmt.Sprintf("Domain: %v", *(v.Domain))
		i++
	}
	if v.WorkflowExecution != nil {
		fields[i] = fmt.Sprintf("WorkflowExecution: %v", v.WorkflowExecution)
		i++
	}

	return fmt.Sprintf("ExternalWorkflowExecutionCancelRequestedEventAttributes{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this ExternalWorkflowExecutionCancelRequestedEventAttributes match the
// provided ExternalWorkflowExecutionCancelRequestedEventAttributes.
//
// This function performs a deep comparison.
func (v *ExternalWorkflowExecutionCancelRequestedEventAttributes) Equals(rhs *ExternalWorkflowExecutionCancelRequestedEventAttributes) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_I64_EqualsPtr(v.InitiatedEventId, rhs.InitiatedEventId) {
		return false
	}
	if !_String_EqualsPtr(v.Domain, rhs.Domain) {
		return false
	}
	if !((v.WorkflowExecution == nil && rhs.WorkflowExecution == nil) || (v.WorkflowExecution != nil && rhs.WorkflowExecution != nil && v.WorkflowExecution.Equals(rhs.WorkflowExecution))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of ExternalWorkflowExecutionCancelRequestedEventAttributes.
func (v *ExternalWorkflowExecutionCancelRequestedEventAttributes) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.InitiatedEventId != nil {
		enc.AddInt64("initiatedEventId", *v.InitiatedEventId)
	}
	if v.Domain != nil {
		enc.AddString("domain", *v.Domain)
	}
	if v.WorkflowExecution != nil {
		err = multierr.Append(err, enc.AddObject("workflowExecution", v.WorkflowExecution))
	}
	return err
}

// GetInitiatedEventId returns the value of InitiatedEventId if it is set or its
// zero value if it is unset.
func (v *ExternalWorkflowExecutionCancelRequestedEventAttributes) GetInitiatedEventId() (o int64) {
	if v != nil && v.InitiatedEventId != nil {
		return *v.InitiatedEventId
	}

	return
}

// IsSetInitiatedEventId returns true if InitiatedEventId is not nil.
func (v *ExternalWorkflowExecutionCancelRequestedEventAttributes) IsSetInitiatedEventId() bool {
	return v != nil && v.InitiatedEventId != nil
}

// GetDomain returns the value of Domain if it is set or its
// zero value if it is unset.
func (v *ExternalWorkflowExecutionCancelRequestedEventAttributes) GetDomain() (o string) {
	if v != nil && v.Domain != nil {
		return *v.Domain
	}

	return
}

// IsSetDomain returns true if Domain is not nil.
func (v *ExternalWorkflowExecutionCancelRequestedEventAttributes) IsSetDomain() bool {
	return v != nil && v.Domain != nil
}

// GetWorkflowExecution returns the value of WorkflowExecution if it is set or its
// zero value if it is unset.
func (v *ExternalWorkflowExecutionCancelRequestedEventAttributes) GetWorkflowExecution() (o *WorkflowExecution) {
	if v != nil && v.WorkflowExecution != nil {
		return v.WorkflowExecution
	}

	return
}

// IsSetWorkflowExecution returns true if WorkflowExecution is not nil.
func (v *ExternalWorkflowExecutionCancelRequestedEventAttributes) IsSetWorkflowExecution() bool {
	return v != nil && v.WorkflowExecution != nil
}

type ExternalWorkflowExecutionSignaledEventAttributes struct {
	InitiatedEventId  *int64             `json:"initiatedEventId,omitempty"`
	Domain            *string            `json:"domain,omitempty"`
	WorkflowExecution *WorkflowExecution `json:"workflowExecution,omitempty"`
	Control           []byte             `json:"control,omitempty"`
}

// ToWire translates a ExternalWorkflowExecutionSignaledEventAttributes 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 *ExternalWorkflowExecutionSignaledEventAttributes) ToWire() (wire.Value, error) {
	var (
		fields [4]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.InitiatedEventId != nil {
		w, err = wire.NewValueI64(*(v.InitiatedEventId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.Domain != nil {
		w, err = wire.NewValueString(*(v.Domain)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.WorkflowExecution != nil {
		w, err = v.WorkflowExecution.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.Control != nil {
		w, err = wire.NewValueBinary(v.Control), 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 ExternalWorkflowExecutionSignaledEventAttributes 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 ExternalWorkflowExecutionSignaledEventAttributes struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v ExternalWorkflowExecutionSignaledEventAttributes
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *ExternalWorkflowExecutionSignaledEventAttributes) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			if field.Value.Type() == wire.TI64 {
				var x int64
				x, err = field.Value.GetI64(), error(nil)
				v.InitiatedEventId = &x
				if err != nil {
					return err
				}

			}
		case 20:
			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 30:
			if field.Value.Type() == wire.TStruct {
				v.WorkflowExecution, err = _WorkflowExecution_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 40:
			if field.Value.Type() == wire.TBinary {
				v.Control, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a ExternalWorkflowExecutionSignaledEventAttributes
// struct.
func (v *ExternalWorkflowExecutionSignaledEventAttributes) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [4]string
	i := 0
	if v.InitiatedEventId != nil {
		fields[i] = fmt.Sprintf("InitiatedEventId: %v", *(v.InitiatedEventId))
		i++
	}
	if v.Domain != nil {
		fields[i] = fmt.Sprintf("Domain: %v", *(v.Domain))
		i++
	}
	if v.WorkflowExecution != nil {
		fields[i] = fmt.Sprintf("WorkflowExecution: %v", v.WorkflowExecution)
		i++
	}
	if v.Control != nil {
		fields[i] = fmt.Sprintf("Control: %v", v.Control)
		i++
	}

	return fmt.Sprintf("ExternalWorkflowExecutionSignaledEventAttributes{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this ExternalWorkflowExecutionSignaledEventAttributes match the
// provided ExternalWorkflowExecutionSignaledEventAttributes.
//
// This function performs a deep comparison.
func (v *ExternalWorkflowExecutionSignaledEventAttributes) Equals(rhs *ExternalWorkflowExecutionSignaledEventAttributes) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_I64_EqualsPtr(v.InitiatedEventId, rhs.InitiatedEventId) {
		return false
	}
	if !_String_EqualsPtr(v.Domain, rhs.Domain) {
		return false
	}
	if !((v.WorkflowExecution == nil && rhs.WorkflowExecution == nil) || (v.WorkflowExecution != nil && rhs.WorkflowExecution != nil && v.WorkflowExecution.Equals(rhs.WorkflowExecution))) {
		return false
	}
	if !((v.Control == nil && rhs.Control == nil) || (v.Control != nil && rhs.Control != nil && bytes.Equal(v.Control, rhs.Control))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of ExternalWorkflowExecutionSignaledEventAttributes.
func (v *ExternalWorkflowExecutionSignaledEventAttributes) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.InitiatedEventId != nil {
		enc.AddInt64("initiatedEventId", *v.InitiatedEventId)
	}
	if v.Domain != nil {
		enc.AddString("domain", *v.Domain)
	}
	if v.WorkflowExecution != nil {
		err = multierr.Append(err, enc.AddObject("workflowExecution", v.WorkflowExecution))
	}
	if v.Control != nil {
		enc.AddString("control", base64.StdEncoding.EncodeToString(v.Control))
	}
	return err
}

// GetInitiatedEventId returns the value of InitiatedEventId if it is set or its
// zero value if it is unset.
func (v *ExternalWorkflowExecutionSignaledEventAttributes) GetInitiatedEventId() (o int64) {
	if v != nil && v.InitiatedEventId != nil {
		return *v.InitiatedEventId
	}

	return
}

// IsSetInitiatedEventId returns true if InitiatedEventId is not nil.
func (v *ExternalWorkflowExecutionSignaledEventAttributes) IsSetInitiatedEventId() bool {
	return v != nil && v.InitiatedEventId != nil
}

// GetDomain returns the value of Domain if it is set or its
// zero value if it is unset.
func (v *ExternalWorkflowExecutionSignaledEventAttributes) GetDomain() (o string) {
	if v != nil && v.Domain != nil {
		return *v.Domain
	}

	return
}

// IsSetDomain returns true if Domain is not nil.
func (v *ExternalWorkflowExecutionSignaledEventAttributes) IsSetDomain() bool {
	return v != nil && v.Domain != nil
}

// GetWorkflowExecution returns the value of WorkflowExecution if it is set or its
// zero value if it is unset.
func (v *ExternalWorkflowExecutionSignaledEventAttributes) GetWorkflowExecution() (o *WorkflowExecution) {
	if v != nil && v.WorkflowExecution != nil {
		return v.WorkflowExecution
	}

	return
}

// IsSetWorkflowExecution returns true if WorkflowExecution is not nil.
func (v *ExternalWorkflowExecutionSignaledEventAttributes) IsSetWorkflowExecution() bool {
	return v != nil && v.WorkflowExecution != nil
}

// GetControl returns the value of Control if it is set or its
// zero value if it is unset.
func (v *ExternalWorkflowExecutionSignaledEventAttributes) GetControl() (o []byte) {
	if v != nil && v.Control != nil {
		return v.Control
	}

	return
}

// IsSetControl returns true if Control is not nil.
func (v *ExternalWorkflowExecutionSignaledEventAttributes) IsSetControl() bool {
	return v != nil && v.Control != nil
}

type FailWorkflowExecutionDecisionAttributes struct {
	Reason  *string `json:"reason,omitempty"`
	Details []byte  `json:"details,omitempty"`
}

// ToWire translates a FailWorkflowExecutionDecisionAttributes 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 *FailWorkflowExecutionDecisionAttributes) ToWire() (wire.Value, error) {
	var (
		fields [2]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.Reason != nil {
		w, err = wire.NewValueString(*(v.Reason)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.Details != nil {
		w, err = wire.NewValueBinary(v.Details), 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
}

// FromWire deserializes a FailWorkflowExecutionDecisionAttributes 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 FailWorkflowExecutionDecisionAttributes struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v FailWorkflowExecutionDecisionAttributes
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *FailWorkflowExecutionDecisionAttributes) 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.Reason = &x
				if err != nil {
					return err
				}

			}
		case 20:
			if field.Value.Type() == wire.TBinary {
				v.Details, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a FailWorkflowExecutionDecisionAttributes
// struct.
func (v *FailWorkflowExecutionDecisionAttributes) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [2]string
	i := 0
	if v.Reason != nil {
		fields[i] = fmt.Sprintf("Reason: %v", *(v.Reason))
		i++
	}
	if v.Details != nil {
		fields[i] = fmt.Sprintf("Details: %v", v.Details)
		i++
	}

	return fmt.Sprintf("FailWorkflowExecutionDecisionAttributes{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this FailWorkflowExecutionDecisionAttributes match the
// provided FailWorkflowExecutionDecisionAttributes.
//
// This function performs a deep comparison.
func (v *FailWorkflowExecutionDecisionAttributes) Equals(rhs *FailWorkflowExecutionDecisionAttributes) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.Reason, rhs.Reason) {
		return false
	}
	if !((v.Details == nil && rhs.Details == nil) || (v.Details != nil && rhs.Details != nil && bytes.Equal(v.Details, rhs.Details))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of FailWorkflowExecutionDecisionAttributes.
func (v *FailWorkflowExecutionDecisionAttributes) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Reason != nil {
		enc.AddString("reason", *v.Reason)
	}
	if v.Details != nil {
		enc.AddString("details", base64.StdEncoding.EncodeToString(v.Details))
	}
	return err
}

// GetReason returns the value of Reason if it is set or its
// zero value if it is unset.
func (v *FailWorkflowExecutionDecisionAttributes) GetReason() (o string) {
	if v != nil && v.Reason != nil {
		return *v.Reason
	}

	return
}

// IsSetReason returns true if Reason is not nil.
func (v *FailWorkflowExecutionDecisionAttributes) IsSetReason() bool {
	return v != nil && v.Reason != nil
}

// GetDetails returns the value of Details if it is set or its
// zero value if it is unset.
func (v *FailWorkflowExecutionDecisionAttributes) GetDetails() (o []byte) {
	if v != nil && v.Details != nil {
		return v.Details
	}

	return
}

// IsSetDetails returns true if Details is not nil.
func (v *FailWorkflowExecutionDecisionAttributes) IsSetDetails() bool {
	return v != nil && v.Details != nil
}

type FailoverInfo struct {
	FailoverVersion         *int64  `json:"failoverVersion,omitempty"`
	FailoverStartTimestamp  *int64  `json:"failoverStartTimestamp,omitempty"`
	FailoverExpireTimestamp *int64  `json:"failoverExpireTimestamp,omitempty"`
	CompletedShardCount     *int32  `json:"completedShardCount,omitempty"`
	PendingShards           []int32 `json:"pendingShards,omitempty"`
}

// ToWire translates a FailoverInfo 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 *FailoverInfo) ToWire() (wire.Value, error) {
	var (
		fields [5]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.FailoverVersion != nil {
		w, err = wire.NewValueI64(*(v.FailoverVersion)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.FailoverStartTimestamp != nil {
		w, err = wire.NewValueI64(*(v.FailoverStartTimestamp)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.FailoverExpireTimestamp != nil {
		w, err = wire.NewValueI64(*(v.FailoverExpireTimestamp)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.CompletedShardCount != nil {
		w, err = wire.NewValueI32(*(v.CompletedShardCount)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 40, Value: w}
		i++
	}
	if v.PendingShards != nil {
		w, err = wire.NewValueList(_List_I32_ValueList(v.PendingShards)), 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
}

// FromWire deserializes a FailoverInfo 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 FailoverInfo struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v FailoverInfo
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *FailoverInfo) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			if field.Value.Type() == wire.TI64 {
				var x int64
				x, err = field.Value.GetI64(), error(nil)
				v.FailoverVersion = &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.FailoverStartTimestamp = &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.FailoverExpireTimestamp = &x
				if err != nil {
					return err
				}

			}
		case 40:
			if field.Value.Type() == wire.TI32 {
				var x int32
				x, err = field.Value.GetI32(), error(nil)
				v.CompletedShardCount = &x
				if err != nil {
					return err
				}

			}
		case 50:
			if field.Value.Type() == wire.TList {
				v.PendingShards, err = _List_I32_Read(field.Value.GetList())
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a FailoverInfo
// struct.
func (v *FailoverInfo) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [5]string
	i := 0
	if v.FailoverVersion != nil {
		fields[i] = fmt.Sprintf("FailoverVersion: %v", *(v.FailoverVersion))
		i++
	}
	if v.FailoverStartTimestamp != nil {
		fields[i] = fmt.Sprintf("FailoverStartTimestamp: %v", *(v.FailoverStartTimestamp))
		i++
	}
	if v.FailoverExpireTimestamp != nil {
		fields[i] = fmt.Sprintf("FailoverExpireTimestamp: %v", *(v.FailoverExpireTimestamp))
		i++
	}
	if v.CompletedShardCount != nil {
		fields[i] = fmt.Sprintf("CompletedShardCount: %v", *(v.CompletedShardCount))
		i++
	}
	if v.PendingShards != nil {
		fields[i] = fmt.Sprintf("PendingShards: %v", v.PendingShards)
		i++
	}

	return fmt.Sprintf("FailoverInfo{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this FailoverInfo match the
// provided FailoverInfo.
//
// This function performs a deep comparison.
func (v *FailoverInfo) Equals(rhs *FailoverInfo) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_I64_EqualsPtr(v.FailoverVersion, rhs.FailoverVersion) {
		return false
	}
	if !_I64_EqualsPtr(v.FailoverStartTimestamp, rhs.FailoverStartTimestamp) {
		return false
	}
	if !_I64_EqualsPtr(v.FailoverExpireTimestamp, rhs.FailoverExpireTimestamp) {
		return false
	}
	if !_I32_EqualsPtr(v.CompletedShardCount, rhs.CompletedShardCount) {
		return false
	}
	if !((v.PendingShards == nil && rhs.PendingShards == nil) || (v.PendingShards != nil && rhs.PendingShards != nil && _List_I32_Equals(v.PendingShards, rhs.PendingShards))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of FailoverInfo.
func (v *FailoverInfo) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.FailoverVersion != nil {
		enc.AddInt64("failoverVersion", *v.FailoverVersion)
	}
	if v.FailoverStartTimestamp != nil {
		enc.AddInt64("failoverStartTimestamp", *v.FailoverStartTimestamp)
	}
	if v.FailoverExpireTimestamp != nil {
		enc.AddInt64("failoverExpireTimestamp", *v.FailoverExpireTimestamp)
	}
	if v.CompletedShardCount != nil {
		enc.AddInt32("completedShardCount", *v.CompletedShardCount)
	}
	if v.PendingShards != nil {
		err = multierr.Append(err, enc.AddArray("pendingShards", (_List_I32_Zapper)(v.PendingShards)))
	}
	return err
}

// GetFailoverVersion returns the value of FailoverVersion if it is set or its
// zero value if it is unset.
func (v *FailoverInfo) GetFailoverVersion() (o int64) {
	if v != nil && v.FailoverVersion != nil {
		return *v.FailoverVersion
	}

	return
}

// IsSetFailoverVersion returns true if FailoverVersion is not nil.
func (v *FailoverInfo) IsSetFailoverVersion() bool {
	return v != nil && v.FailoverVersion != nil
}

// GetFailoverStartTimestamp returns the value of FailoverStartTimestamp if it is set or its
// zero value if it is unset.
func (v *FailoverInfo) GetFailoverStartTimestamp() (o int64) {
	if v != nil && v.FailoverStartTimestamp != nil {
		return *v.FailoverStartTimestamp
	}

	return
}

// IsSetFailoverStartTimestamp returns true if FailoverStartTimestamp is not nil.
func (v *FailoverInfo) IsSetFailoverStartTimestamp() bool {
	return v != nil && v.FailoverStartTimestamp != nil
}

// GetFailoverExpireTimestamp returns the value of FailoverExpireTimestamp if it is set or its
// zero value if it is unset.
func (v *FailoverInfo) GetFailoverExpireTimestamp() (o int64) {
	if v != nil && v.FailoverExpireTimestamp != nil {
		return *v.FailoverExpireTimestamp
	}

	return
}

// IsSetFailoverExpireTimestamp returns true if FailoverExpireTimestamp is not nil.
func (v *FailoverInfo) IsSetFailoverExpireTimestamp() bool {
	return v != nil && v.FailoverExpireTimestamp != nil
}

// GetCompletedShardCount returns the value of CompletedShardCount if it is set or its
// zero value if it is unset.
func (v *FailoverInfo) GetCompletedShardCount() (o int32) {
	if v != nil && v.CompletedShardCount != nil {
		return *v.CompletedShardCount
	}

	return
}

// IsSetCompletedShardCount returns true if CompletedShardCount is not nil.
func (v *FailoverInfo) IsSetCompletedShardCount() bool {
	return v != nil && v.CompletedShardCount != nil
}

// GetPendingShards returns the value of PendingShards if it is set or its
// zero value if it is unset.
func (v *FailoverInfo) GetPendingShards() (o []int32) {
	if v != nil && v.PendingShards != nil {
		return v.PendingShards
	}

	return
}

// IsSetPendingShards returns true if PendingShards is not nil.
func (v *FailoverInfo) IsSetPendingShards() bool {
	return v != nil && v.PendingShards != nil
}

type FeatureFlags struct {
	WorkflowExecutionAlreadyCompletedErrorEnabled *bool `json:"WorkflowExecutionAlreadyCompletedErrorEnabled,omitempty"`
}

// ToWire translates a FeatureFlags 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 *FeatureFlags) ToWire() (wire.Value, error) {
	var (
		fields [1]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.WorkflowExecutionAlreadyCompletedErrorEnabled != nil {
		w, err = wire.NewValueBool(*(v.WorkflowExecutionAlreadyCompletedErrorEnabled)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

// FromWire deserializes a FeatureFlags 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 FeatureFlags struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v FeatureFlags
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *FeatureFlags) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			if field.Value.Type() == wire.TBool {
				var x bool
				x, err = field.Value.GetBool(), error(nil)
				v.WorkflowExecutionAlreadyCompletedErrorEnabled = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a FeatureFlags
// struct.
func (v *FeatureFlags) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [1]string
	i := 0
	if v.WorkflowExecutionAlreadyCompletedErrorEnabled != nil {
		fields[i] = fmt.Sprintf("WorkflowExecutionAlreadyCompletedErrorEnabled: %v", *(v.WorkflowExecutionAlreadyCompletedErrorEnabled))
		i++
	}

	return fmt.Sprintf("FeatureFlags{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this FeatureFlags match the
// provided FeatureFlags.
//
// This function performs a deep comparison.
func (v *FeatureFlags) Equals(rhs *FeatureFlags) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_Bool_EqualsPtr(v.WorkflowExecutionAlreadyCompletedErrorEnabled, rhs.WorkflowExecutionAlreadyCompletedErrorEnabled) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of FeatureFlags.
func (v *FeatureFlags) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.WorkflowExecutionAlreadyCompletedErrorEnabled != nil {
		enc.AddBool("WorkflowExecutionAlreadyCompletedErrorEnabled", *v.WorkflowExecutionAlreadyCompletedErrorEnabled)
	}
	return err
}

// GetWorkflowExecutionAlreadyCompletedErrorEnabled returns the value of WorkflowExecutionAlreadyCompletedErrorEnabled if it is set or its
// zero value if it is unset.
func (v *FeatureFlags) GetWorkflowExecutionAlreadyCompletedErrorEnabled() (o bool) {
	if v != nil && v.WorkflowExecutionAlreadyCompletedErrorEnabled != nil {
		return *v.WorkflowExecutionAlreadyCompletedErrorEnabled
	}

	return
}

// IsSetWorkflowExecutionAlreadyCompletedErrorEnabled returns true if WorkflowExecutionAlreadyCompletedErrorEnabled is not nil.
func (v *FeatureFlags) IsSetWorkflowExecutionAlreadyCompletedErrorEnabled() bool {
	return v != nil && v.WorkflowExecutionAlreadyCompletedErrorEnabled != nil
}

type FeatureNotEnabledError struct {
	FeatureFlag string `json:"featureFlag,required"`
}

// ToWire translates a FeatureNotEnabledError 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 *FeatureNotEnabledError) ToWire() (wire.Value, error) {
	var (
		fields [1]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	w, err = wire.NewValueString(v.FeatureFlag), 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
}

// FromWire deserializes a FeatureNotEnabledError 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 FeatureNotEnabledError struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v FeatureNotEnabledError
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *FeatureNotEnabledError) FromWire(w wire.Value) error {
	var err error

	featureFlagIsSet := false

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 1:
			if field.Value.Type() == wire.TBinary {
				v.FeatureFlag, err = field.Value.GetString(), error(nil)
				if err != nil {
					return err
				}
				featureFlagIsSet = true
			}
		}
	}

	if !featureFlagIsSet {
		return errors.New("field FeatureFlag of FeatureNotEnabledError is required")
	}

	return nil
}

// String returns a readable string representation of a FeatureNotEnabledError
// struct.
func (v *FeatureNotEnabledError) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [1]string
	i := 0
	fields[i] = fmt.Sprintf("FeatureFlag: %v", v.FeatureFlag)
	i++

	return fmt.Sprintf("FeatureNotEnabledError{%v}", strings.Join(fields[:i], ", "))
}

// ErrorName is the name of this type as defined in the Thrift
// file.
func (*FeatureNotEnabledError) ErrorName() string {
	return "FeatureNotEnabledError"
}

// Equals returns true if all the fields of this FeatureNotEnabledError match the
// provided FeatureNotEnabledError.
//
// This function performs a deep comparison.
func (v *FeatureNotEnabledError) Equals(rhs *FeatureNotEnabledError) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !(v.FeatureFlag == rhs.FeatureFlag) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of FeatureNotEnabledError.
func (v *FeatureNotEnabledError) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	enc.AddString("featureFlag", v.FeatureFlag)
	return err
}

// GetFeatureFlag returns the value of FeatureFlag if it is set or its
// zero value if it is unset.
func (v *FeatureNotEnabledError) GetFeatureFlag() (o string) {
	if v != nil {
		o = v.FeatureFlag
	}
	return
}

func (v *FeatureNotEnabledError) Error() string {
	return v.String()
}

type GetCrossClusterTasksRequest struct {
	ShardIDs      []int32 `json:"shardIDs,omitempty"`
	TargetCluster *string `json:"targetCluster,omitempty"`
}

// ToWire translates a GetCrossClusterTasksRequest 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 *GetCrossClusterTasksRequest) ToWire() (wire.Value, error) {
	var (
		fields [2]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.ShardIDs != nil {
		w, err = wire.NewValueList(_List_I32_ValueList(v.ShardIDs)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.TargetCluster != nil {
		w, err = wire.NewValueString(*(v.TargetCluster)), 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
}

// FromWire deserializes a GetCrossClusterTasksRequest 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 GetCrossClusterTasksRequest struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v GetCrossClusterTasksRequest
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *GetCrossClusterTasksRequest) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			if field.Value.Type() == wire.TList {
				v.ShardIDs, err = _List_I32_Read(field.Value.GetList())
				if err != nil {
					return err
				}

			}
		case 20:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.TargetCluster = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a GetCrossClusterTasksRequest
// struct.
func (v *GetCrossClusterTasksRequest) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [2]string
	i := 0
	if v.ShardIDs != nil {
		fields[i] = fmt.Sprintf("ShardIDs: %v", v.ShardIDs)
		i++
	}
	if v.TargetCluster != nil {
		fields[i] = fmt.Sprintf("TargetCluster: %v", *(v.TargetCluster))
		i++
	}

	return fmt.Sprintf("GetCrossClusterTasksRequest{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this GetCrossClusterTasksRequest match the
// provided GetCrossClusterTasksRequest.
//
// This function performs a deep comparison.
func (v *GetCrossClusterTasksRequest) Equals(rhs *GetCrossClusterTasksRequest) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !((v.ShardIDs == nil && rhs.ShardIDs == nil) || (v.ShardIDs != nil && rhs.ShardIDs != nil && _List_I32_Equals(v.ShardIDs, rhs.ShardIDs))) {
		return false
	}
	if !_String_EqualsPtr(v.TargetCluster, rhs.TargetCluster) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of GetCrossClusterTasksRequest.
func (v *GetCrossClusterTasksRequest) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.ShardIDs != nil {
		err = multierr.Append(err, enc.AddArray("shardIDs", (_List_I32_Zapper)(v.ShardIDs)))
	}
	if v.TargetCluster != nil {
		enc.AddString("targetCluster", *v.TargetCluster)
	}
	return err
}

// GetShardIDs returns the value of ShardIDs if it is set or its
// zero value if it is unset.
func (v *GetCrossClusterTasksRequest) GetShardIDs() (o []int32) {
	if v != nil && v.ShardIDs != nil {
		return v.ShardIDs
	}

	return
}

// IsSetShardIDs returns true if ShardIDs is not nil.
func (v *GetCrossClusterTasksRequest) IsSetShardIDs() bool {
	return v != nil && v.ShardIDs != nil
}

// GetTargetCluster returns the value of TargetCluster if it is set or its
// zero value if it is unset.
func (v *GetCrossClusterTasksRequest) GetTargetCluster() (o string) {
	if v != nil && v.TargetCluster != nil {
		return *v.TargetCluster
	}

	return
}

// IsSetTargetCluster returns true if TargetCluster is not nil.
func (v *GetCrossClusterTasksRequest) IsSetTargetCluster() bool {
	return v != nil && v.TargetCluster != nil
}

type GetCrossClusterTasksResponse struct {
	TasksByShard       map[int32][]*CrossClusterTaskRequest `json:"tasksByShard,omitempty"`
	FailedCauseByShard map[int32]GetTaskFailedCause         `json:"failedCauseByShard,omitempty"`
}

type _List_CrossClusterTaskRequest_ValueList []*CrossClusterTaskRequest

func (v _List_CrossClusterTaskRequest_ValueList) ForEach(f func(wire.Value) error) error {
	for i, x := range v {
		if x == nil {
			return fmt.Errorf("invalid [%v]: value is nil", i)
		}
		w, err := x.ToWire()
		if err != nil {
			return err
		}
		err = f(w)
		if err != nil {
			return err
		}
	}
	return nil
}

func (v _List_CrossClusterTaskRequest_ValueList) Size() int {
	return len(v)
}

func (_List_CrossClusterTaskRequest_ValueList) ValueType() wire.Type {
	return wire.TStruct
}

func (_List_CrossClusterTaskRequest_ValueList) Close() {}

type _Map_I32_List_CrossClusterTaskRequest_MapItemList map[int32][]*CrossClusterTaskRequest

func (m _Map_I32_List_CrossClusterTaskRequest_MapItemList) ForEach(f func(wire.MapItem) error) error {
	for k, v := range m {
		if v == nil {
			return fmt.Errorf("invalid [%v]: value is nil", k)
		}
		kw, err := wire.NewValueI32(k), error(nil)
		if err != nil {
			return err
		}

		vw, err := wire.NewValueList(_List_CrossClusterTaskRequest_ValueList(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_I32_List_CrossClusterTaskRequest_MapItemList) Size() int {
	return len(m)
}

func (_Map_I32_List_CrossClusterTaskRequest_MapItemList) KeyType() wire.Type {
	return wire.TI32
}

func (_Map_I32_List_CrossClusterTaskRequest_MapItemList) ValueType() wire.Type {
	return wire.TList
}

func (_Map_I32_List_CrossClusterTaskRequest_MapItemList) Close() {}

type _Map_I32_GetTaskFailedCause_MapItemList map[int32]GetTaskFailedCause

func (m _Map_I32_GetTaskFailedCause_MapItemList) ForEach(f func(wire.MapItem) error) error {
	for k, v := range m {
		kw, err := wire.NewValueI32(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_I32_GetTaskFailedCause_MapItemList) Size() int {
	return len(m)
}

func (_Map_I32_GetTaskFailedCause_MapItemList) KeyType() wire.Type {
	return wire.TI32
}

func (_Map_I32_GetTaskFailedCause_MapItemList) ValueType() wire.Type {
	return wire.TI32
}

func (_Map_I32_GetTaskFailedCause_MapItemList) Close() {}

// ToWire translates a GetCrossClusterTasksResponse 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 *GetCrossClusterTasksResponse) ToWire() (wire.Value, error) {
	var (
		fields [2]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.TasksByShard != nil {
		w, err = wire.NewValueMap(_Map_I32_List_CrossClusterTaskRequest_MapItemList(v.TasksByShard)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.FailedCauseByShard != nil {
		w, err = wire.NewValueMap(_Map_I32_GetTaskFailedCause_MapItemList(v.FailedCauseByShard)), 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 _CrossClusterTaskRequest_Read(w wire.Value) (*CrossClusterTaskRequest, error) {
	var v CrossClusterTaskRequest
	err := v.FromWire(w)
	return &v, err
}

func _List_CrossClusterTaskRequest_Read(l wire.ValueList) ([]*CrossClusterTaskRequest, error) {
	if l.ValueType() != wire.TStruct {
		return nil, nil
	}

	o := make([]*CrossClusterTaskRequest, 0, l.Size())
	err := l.ForEach(func(x wire.Value) error {
		i, err := _CrossClusterTaskRequest_Read(x)
		if err != nil {
			return err
		}
		o = append(o, i)
		return nil
	})
	l.Close()
	return o, err
}

func _Map_I32_List_CrossClusterTaskRequest_Read(m wire.MapItemList) (map[int32][]*CrossClusterTaskRequest, error) {
	if m.KeyType() != wire.TI32 {
		return nil, nil
	}

	if m.ValueType() != wire.TList {
		return nil, nil
	}

	o := make(map[int32][]*CrossClusterTaskRequest, m.Size())
	err := m.ForEach(func(x wire.MapItem) error {
		k, err := x.Key.GetI32(), error(nil)
		if err != nil {
			return err
		}

		v, err := _List_CrossClusterTaskRequest_Read(x.Value.GetList())
		if err != nil {
			return err
		}

		o[k] = v
		return nil
	})
	m.Close()
	return o, err
}

func _GetTaskFailedCause_Read(w wire.Value) (GetTaskFailedCause, error) {
	var v GetTaskFailedCause
	err := v.FromWire(w)
	return v, err
}

func _Map_I32_GetTaskFailedCause_Read(m wire.MapItemList) (map[int32]GetTaskFailedCause, error) {
	if m.KeyType() != wire.TI32 {
		return nil, nil
	}

	if m.ValueType() != wire.TI32 {
		return nil, nil
	}

	o := make(map[int32]GetTaskFailedCause, m.Size())
	err := m.ForEach(func(x wire.MapItem) error {
		k, err := x.Key.GetI32(), error(nil)
		if err != nil {
			return err
		}

		v, err := _GetTaskFailedCause_Read(x.Value)
		if err != nil {
			return err
		}

		o[k] = v
		return nil
	})
	m.Close()
	return o, err
}

// FromWire deserializes a GetCrossClusterTasksResponse 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 GetCrossClusterTasksResponse struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v GetCrossClusterTasksResponse
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *GetCrossClusterTasksResponse) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			if field.Value.Type() == wire.TMap {
				v.TasksByShard, err = _Map_I32_List_CrossClusterTaskRequest_Read(field.Value.GetMap())
				if err != nil {
					return err
				}

			}
		case 20:
			if field.Value.Type() == wire.TMap {
				v.FailedCauseByShard, err = _Map_I32_GetTaskFailedCause_Read(field.Value.GetMap())
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a GetCrossClusterTasksResponse
// struct.
func (v *GetCrossClusterTasksResponse) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [2]string
	i := 0
	if v.TasksByShard != nil {
		fields[i] = fmt.Sprintf("TasksByShard: %v", v.TasksByShard)
		i++
	}
	if v.FailedCauseByShard != nil {
		fields[i] = fmt.Sprintf("FailedCauseByShard: %v", v.FailedCauseByShard)
		i++
	}

	return fmt.Sprintf("GetCrossClusterTasksResponse{%v}", strings.Join(fields[:i], ", "))
}

func _List_CrossClusterTaskRequest_Equals(lhs, rhs []*CrossClusterTaskRequest) bool {
	if len(lhs) != len(rhs) {
		return false
	}

	for i, lv := range lhs {
		rv := rhs[i]
		if !lv.Equals(rv) {
			return false
		}
	}

	return true
}

func _Map_I32_List_CrossClusterTaskRequest_Equals(lhs, rhs map[int32][]*CrossClusterTaskRequest) bool {
	if len(lhs) != len(rhs) {
		return false
	}

	for lk, lv := range lhs {
		rv, ok := rhs[lk]
		if !ok {
			return false
		}
		if !_List_CrossClusterTaskRequest_Equals(lv, rv) {
			return false
		}
	}
	return true
}

func _Map_I32_GetTaskFailedCause_Equals(lhs, rhs map[int32]GetTaskFailedCause) 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 GetCrossClusterTasksResponse match the
// provided GetCrossClusterTasksResponse.
//
// This function performs a deep comparison.
func (v *GetCrossClusterTasksResponse) Equals(rhs *GetCrossClusterTasksResponse) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !((v.TasksByShard == nil && rhs.TasksByShard == nil) || (v.TasksByShard != nil && rhs.TasksByShard != nil && _Map_I32_List_CrossClusterTaskRequest_Equals(v.TasksByShard, rhs.TasksByShard))) {
		return false
	}
	if !((v.FailedCauseByShard == nil && rhs.FailedCauseByShard == nil) || (v.FailedCauseByShard != nil && rhs.FailedCauseByShard != nil && _Map_I32_GetTaskFailedCause_Equals(v.FailedCauseByShard, rhs.FailedCauseByShard))) {
		return false
	}

	return true
}

type _List_CrossClusterTaskRequest_Zapper []*CrossClusterTaskRequest

// MarshalLogArray implements zapcore.ArrayMarshaler, enabling
// fast logging of _List_CrossClusterTaskRequest_Zapper.
func (l _List_CrossClusterTaskRequest_Zapper) MarshalLogArray(enc zapcore.ArrayEncoder) (err error) {
	for _, v := range l {
		err = multierr.Append(err, enc.AppendObject(v))
	}
	return err
}

type _Map_I32_List_CrossClusterTaskRequest_Item_Zapper struct {
	Key   int32
	Value []*CrossClusterTaskRequest
}

// MarshalLogArray implements zapcore.ArrayMarshaler, enabling
// fast logging of _Map_I32_List_CrossClusterTaskRequest_Item_Zapper.
func (v _Map_I32_List_CrossClusterTaskRequest_Item_Zapper) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	enc.AddInt32("key", v.Key)
	err = multierr.Append(err, enc.AddArray("value", (_List_CrossClusterTaskRequest_Zapper)(v.Value)))
	return err
}

type _Map_I32_List_CrossClusterTaskRequest_Zapper map[int32][]*CrossClusterTaskRequest

// MarshalLogArray implements zapcore.ArrayMarshaler, enabling
// fast logging of _Map_I32_List_CrossClusterTaskRequest_Zapper.
func (m _Map_I32_List_CrossClusterTaskRequest_Zapper) MarshalLogArray(enc zapcore.ArrayEncoder) (err error) {
	for k, v := range m {
		err = multierr.Append(err, enc.AppendObject(_Map_I32_List_CrossClusterTaskRequest_Item_Zapper{Key: k, Value: v}))
	}
	return err
}

type _Map_I32_GetTaskFailedCause_Item_Zapper struct {
	Key   int32
	Value GetTaskFailedCause
}

// MarshalLogArray implements zapcore.ArrayMarshaler, enabling
// fast logging of _Map_I32_GetTaskFailedCause_Item_Zapper.
func (v _Map_I32_GetTaskFailedCause_Item_Zapper) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	enc.AddInt32("key", v.Key)
	err = multierr.Append(err, enc.AddObject("value", v.Value))
	return err
}

type _Map_I32_GetTaskFailedCause_Zapper map[int32]GetTaskFailedCause

// MarshalLogArray implements zapcore.ArrayMarshaler, enabling
// fast logging of _Map_I32_GetTaskFailedCause_Zapper.
func (m _Map_I32_GetTaskFailedCause_Zapper) MarshalLogArray(enc zapcore.ArrayEncoder) (err error) {
	for k, v := range m {
		err = multierr.Append(err, enc.AppendObject(_Map_I32_GetTaskFailedCause_Item_Zapper{Key: k, Value: v}))
	}
	return err
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of GetCrossClusterTasksResponse.
func (v *GetCrossClusterTasksResponse) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.TasksByShard != nil {
		err = multierr.Append(err, enc.AddArray("tasksByShard", (_Map_I32_List_CrossClusterTaskRequest_Zapper)(v.TasksByShard)))
	}
	if v.FailedCauseByShard != nil {
		err = multierr.Append(err, enc.AddArray("failedCauseByShard", (_Map_I32_GetTaskFailedCause_Zapper)(v.FailedCauseByShard)))
	}
	return err
}

// GetTasksByShard returns the value of TasksByShard if it is set or its
// zero value if it is unset.
func (v *GetCrossClusterTasksResponse) GetTasksByShard() (o map[int32][]*CrossClusterTaskRequest) {
	if v != nil && v.TasksByShard != nil {
		return v.TasksByShard
	}

	return
}

// IsSetTasksByShard returns true if TasksByShard is not nil.
func (v *GetCrossClusterTasksResponse) IsSetTasksByShard() bool {
	return v != nil && v.TasksByShard != nil
}

// GetFailedCauseByShard returns the value of FailedCauseByShard if it is set or its
// zero value if it is unset.
func (v *GetCrossClusterTasksResponse) GetFailedCauseByShard() (o map[int32]GetTaskFailedCause) {
	if v != nil && v.FailedCauseByShard != nil {
		return v.FailedCauseByShard
	}

	return
}

// IsSetFailedCauseByShard returns true if FailedCauseByShard is not nil.
func (v *GetCrossClusterTasksResponse) IsSetFailedCauseByShard() bool {
	return v != nil && v.FailedCauseByShard != nil
}

type GetSearchAttributesResponse struct {
	Keys map[string]IndexedValueType `json:"keys,omitempty"`
}

type _Map_String_IndexedValueType_MapItemList map[string]IndexedValueType

func (m _Map_String_IndexedValueType_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 := 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_IndexedValueType_MapItemList) Size() int {
	return len(m)
}

func (_Map_String_IndexedValueType_MapItemList) KeyType() wire.Type {
	return wire.TBinary
}

func (_Map_String_IndexedValueType_MapItemList) ValueType() wire.Type {
	return wire.TI32
}

func (_Map_String_IndexedValueType_MapItemList) Close() {}

// ToWire translates a GetSearchAttributesResponse 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 *GetSearchAttributesResponse) ToWire() (wire.Value, error) {
	var (
		fields [1]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.Keys != nil {
		w, err = wire.NewValueMap(_Map_String_IndexedValueType_MapItemList(v.Keys)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

func _IndexedValueType_Read(w wire.Value) (IndexedValueType, error) {
	var v IndexedValueType
	err := v.FromWire(w)
	return v, err
}

func _Map_String_IndexedValueType_Read(m wire.MapItemList) (map[string]IndexedValueType, error) {
	if m.KeyType() != wire.TBinary {
		return nil, nil
	}

	if m.ValueType() != wire.TI32 {
		return nil, nil
	}

	o := make(map[string]IndexedValueType, m.Size())
	err := m.ForEach(func(x wire.MapItem) error {
		k, err := x.Key.GetString(), error(nil)
		if err != nil {
			return err
		}

		v, err := _IndexedValueType_Read(x.Value)
		if err != nil {
			return err
		}

		o[k] = v
		return nil
	})
	m.Close()
	return o, err
}

// FromWire deserializes a GetSearchAttributesResponse 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 GetSearchAttributesResponse struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v GetSearchAttributesResponse
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *GetSearchAttributesResponse) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			if field.Value.Type() == wire.TMap {
				v.Keys, err = _Map_String_IndexedValueType_Read(field.Value.GetMap())
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a GetSearchAttributesResponse
// struct.
func (v *GetSearchAttributesResponse) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [1]string
	i := 0
	if v.Keys != nil {
		fields[i] = fmt.Sprintf("Keys: %v", v.Keys)
		i++
	}

	return fmt.Sprintf("GetSearchAttributesResponse{%v}", strings.Join(fields[:i], ", "))
}

func _Map_String_IndexedValueType_Equals(lhs, rhs map[string]IndexedValueType) 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 GetSearchAttributesResponse match the
// provided GetSearchAttributesResponse.
//
// This function performs a deep comparison.
func (v *GetSearchAttributesResponse) Equals(rhs *GetSearchAttributesResponse) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !((v.Keys == nil && rhs.Keys == nil) || (v.Keys != nil && rhs.Keys != nil && _Map_String_IndexedValueType_Equals(v.Keys, rhs.Keys))) {
		return false
	}

	return true
}

type _Map_String_IndexedValueType_Zapper map[string]IndexedValueType

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of _Map_String_IndexedValueType_Zapper.
func (m _Map_String_IndexedValueType_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 GetSearchAttributesResponse.
func (v *GetSearchAttributesResponse) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Keys != nil {
		err = multierr.Append(err, enc.AddObject("keys", (_Map_String_IndexedValueType_Zapper)(v.Keys)))
	}
	return err
}

// GetKeys returns the value of Keys if it is set or its
// zero value if it is unset.
func (v *GetSearchAttributesResponse) GetKeys() (o map[string]IndexedValueType) {
	if v != nil && v.Keys != nil {
		return v.Keys
	}

	return
}

// IsSetKeys returns true if Keys is not nil.
func (v *GetSearchAttributesResponse) IsSetKeys() bool {
	return v != nil && v.Keys != nil
}

type GetTaskFailedCause int32

const (
	GetTaskFailedCauseServiceBusy        GetTaskFailedCause = 0
	GetTaskFailedCauseTimeout            GetTaskFailedCause = 1
	GetTaskFailedCauseShardOwnershipLost GetTaskFailedCause = 2
	GetTaskFailedCauseUncategorized      GetTaskFailedCause = 3
)

// GetTaskFailedCause_Values returns all recognized values of GetTaskFailedCause.
func GetTaskFailedCause_Values() []GetTaskFailedCause {
	return []GetTaskFailedCause{
		GetTaskFailedCauseServiceBusy,
		GetTaskFailedCauseTimeout,
		GetTaskFailedCauseShardOwnershipLost,
		GetTaskFailedCauseUncategorized,
	}
}

// UnmarshalText tries to decode GetTaskFailedCause from a byte slice
// containing its name.
//
//	var v GetTaskFailedCause
//	err := v.UnmarshalText([]byte("SERVICE_BUSY"))
func (v *GetTaskFailedCause) UnmarshalText(value []byte) error {
	switch s := string(value); s {
	case "SERVICE_BUSY":
		*v = GetTaskFailedCauseServiceBusy
		return nil
	case "TIMEOUT":
		*v = GetTaskFailedCauseTimeout
		return nil
	case "SHARD_OWNERSHIP_LOST":
		*v = GetTaskFailedCauseShardOwnershipLost
		return nil
	case "UNCATEGORIZED":
		*v = GetTaskFailedCauseUncategorized
		return nil
	default:
		val, err := strconv.ParseInt(s, 10, 32)
		if err != nil {
			return fmt.Errorf("unknown enum value %q for %q: %v", s, "GetTaskFailedCause", err)
		}
		*v = GetTaskFailedCause(val)
		return nil
	}
}

// MarshalText encodes GetTaskFailedCause 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 GetTaskFailedCause) MarshalText() ([]byte, error) {
	switch int32(v) {
	case 0:
		return []byte("SERVICE_BUSY"), nil
	case 1:
		return []byte("TIMEOUT"), nil
	case 2:
		return []byte("SHARD_OWNERSHIP_LOST"), nil
	case 3:
		return []byte("UNCATEGORIZED"), nil
	}
	return []byte(strconv.FormatInt(int64(v), 10)), nil
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of GetTaskFailedCause.
// 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 GetTaskFailedCause) MarshalLogObject(enc zapcore.ObjectEncoder) error {
	enc.AddInt32("value", int32(v))
	switch int32(v) {
	case 0:
		enc.AddString("name", "SERVICE_BUSY")
	case 1:
		enc.AddString("name", "TIMEOUT")
	case 2:
		enc.AddString("name", "SHARD_OWNERSHIP_LOST")
	case 3:
		enc.AddString("name", "UNCATEGORIZED")
	}
	return nil
}

// Ptr returns a pointer to this enum value.
func (v GetTaskFailedCause) Ptr() *GetTaskFailedCause {
	return &v
}

// ToWire translates GetTaskFailedCause 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 GetTaskFailedCause) ToWire() (wire.Value, error) {
	return wire.NewValueI32(int32(v)), nil
}

// FromWire deserializes GetTaskFailedCause from its Thrift-level
// representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TI32)
//	if err != nil {
//	  return GetTaskFailedCause(0), err
//	}
//
//	var v GetTaskFailedCause
//	if err := v.FromWire(x); err != nil {
//	  return GetTaskFailedCause(0), err
//	}
//	return v, nil
func (v *GetTaskFailedCause) FromWire(w wire.Value) error {
	*v = (GetTaskFailedCause)(w.GetI32())
	return nil
}

// String returns a readable string representation of GetTaskFailedCause.
func (v GetTaskFailedCause) String() string {
	w := int32(v)
	switch w {
	case 0:
		return "SERVICE_BUSY"
	case 1:
		return "TIMEOUT"
	case 2:
		return "SHARD_OWNERSHIP_LOST"
	case 3:
		return "UNCATEGORIZED"
	}
	return fmt.Sprintf("GetTaskFailedCause(%d)", w)
}

// Equals returns true if this GetTaskFailedCause value matches the provided
// value.
func (v GetTaskFailedCause) Equals(rhs GetTaskFailedCause) bool {
	return v == rhs
}

// MarshalJSON serializes GetTaskFailedCause into JSON.
//
// If the enum value is recognized, its name is returned. Otherwise,
// its integer value is returned.
//
// This implements json.Marshaler.
func (v GetTaskFailedCause) MarshalJSON() ([]byte, error) {
	switch int32(v) {
	case 0:
		return ([]byte)("\"SERVICE_BUSY\""), nil
	case 1:
		return ([]byte)("\"TIMEOUT\""), nil
	case 2:
		return ([]byte)("\"SHARD_OWNERSHIP_LOST\""), nil
	case 3:
		return ([]byte)("\"UNCATEGORIZED\""), nil
	}
	return ([]byte)(strconv.FormatInt(int64(v), 10)), nil
}

// UnmarshalJSON attempts to decode GetTaskFailedCause 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 *GetTaskFailedCause) 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, "GetTaskFailedCause")
		}
		if x < math.MinInt32 {
			return fmt.Errorf("enum underflow from JSON %q for %q", text, "GetTaskFailedCause")
		}
		*v = (GetTaskFailedCause)(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, "GetTaskFailedCause")
	}
}

type GetTaskListsByDomainRequest struct {
	DomainName *string `json:"domainName,omitempty"`
}

// ToWire translates a GetTaskListsByDomainRequest 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 *GetTaskListsByDomainRequest) ToWire() (wire.Value, error) {
	var (
		fields [1]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.DomainName != nil {
		w, err = wire.NewValueString(*(v.DomainName)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

// FromWire deserializes a GetTaskListsByDomainRequest 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 GetTaskListsByDomainRequest struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v GetTaskListsByDomainRequest
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *GetTaskListsByDomainRequest) 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.DomainName = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a GetTaskListsByDomainRequest
// struct.
func (v *GetTaskListsByDomainRequest) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [1]string
	i := 0
	if v.DomainName != nil {
		fields[i] = fmt.Sprintf("DomainName: %v", *(v.DomainName))
		i++
	}

	return fmt.Sprintf("GetTaskListsByDomainRequest{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this GetTaskListsByDomainRequest match the
// provided GetTaskListsByDomainRequest.
//
// This function performs a deep comparison.
func (v *GetTaskListsByDomainRequest) Equals(rhs *GetTaskListsByDomainRequest) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.DomainName, rhs.DomainName) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of GetTaskListsByDomainRequest.
func (v *GetTaskListsByDomainRequest) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.DomainName != nil {
		enc.AddString("domainName", *v.DomainName)
	}
	return err
}

// GetDomainName returns the value of DomainName if it is set or its
// zero value if it is unset.
func (v *GetTaskListsByDomainRequest) GetDomainName() (o string) {
	if v != nil && v.DomainName != nil {
		return *v.DomainName
	}

	return
}

// IsSetDomainName returns true if DomainName is not nil.
func (v *GetTaskListsByDomainRequest) IsSetDomainName() bool {
	return v != nil && v.DomainName != nil
}

type GetTaskListsByDomainResponse struct {
	DecisionTaskListMap map[string]*DescribeTaskListResponse `json:"decisionTaskListMap,omitempty"`
	ActivityTaskListMap map[string]*DescribeTaskListResponse `json:"activityTaskListMap,omitempty"`
}

type _Map_String_DescribeTaskListResponse_MapItemList map[string]*DescribeTaskListResponse

func (m _Map_String_DescribeTaskListResponse_MapItemList) ForEach(f func(wire.MapItem) error) error {
	for k, v := range m {
		if v == nil {
			return fmt.Errorf("invalid [%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_DescribeTaskListResponse_MapItemList) Size() int {
	return len(m)
}

func (_Map_String_DescribeTaskListResponse_MapItemList) KeyType() wire.Type {
	return wire.TBinary
}

func (_Map_String_DescribeTaskListResponse_MapItemList) ValueType() wire.Type {
	return wire.TStruct
}

func (_Map_String_DescribeTaskListResponse_MapItemList) Close() {}

// ToWire translates a GetTaskListsByDomainResponse 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 *GetTaskListsByDomainResponse) ToWire() (wire.Value, error) {
	var (
		fields [2]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.DecisionTaskListMap != nil {
		w, err = wire.NewValueMap(_Map_String_DescribeTaskListResponse_MapItemList(v.DecisionTaskListMap)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.ActivityTaskListMap != nil {
		w, err = wire.NewValueMap(_Map_String_DescribeTaskListResponse_MapItemList(v.ActivityTaskListMap)), 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 _DescribeTaskListResponse_Read(w wire.Value) (*DescribeTaskListResponse, error) {
	var v DescribeTaskListResponse
	err := v.FromWire(w)
	return &v, err
}

func _Map_String_DescribeTaskListResponse_Read(m wire.MapItemList) (map[string]*DescribeTaskListResponse, error) {
	if m.KeyType() != wire.TBinary {
		return nil, nil
	}

	if m.ValueType() != wire.TStruct {
		return nil, nil
	}

	o := make(map[string]*DescribeTaskListResponse, m.Size())
	err := m.ForEach(func(x wire.MapItem) error {
		k, err := x.Key.GetString(), error(nil)
		if err != nil {
			return err
		}

		v, err := _DescribeTaskListResponse_Read(x.Value)
		if err != nil {
			return err
		}

		o[k] = v
		return nil
	})
	m.Close()
	return o, err
}

// FromWire deserializes a GetTaskListsByDomainResponse 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 GetTaskListsByDomainResponse struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v GetTaskListsByDomainResponse
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *GetTaskListsByDomainResponse) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			if field.Value.Type() == wire.TMap {
				v.DecisionTaskListMap, err = _Map_String_DescribeTaskListResponse_Read(field.Value.GetMap())
				if err != nil {
					return err
				}

			}
		case 20:
			if field.Value.Type() == wire.TMap {
				v.ActivityTaskListMap, err = _Map_String_DescribeTaskListResponse_Read(field.Value.GetMap())
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a GetTaskListsByDomainResponse
// struct.
func (v *GetTaskListsByDomainResponse) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [2]string
	i := 0
	if v.DecisionTaskListMap != nil {
		fields[i] = fmt.Sprintf("DecisionTaskListMap: %v", v.DecisionTaskListMap)
		i++
	}
	if v.ActivityTaskListMap != nil {
		fields[i] = fmt.Sprintf("ActivityTaskListMap: %v", v.ActivityTaskListMap)
		i++
	}

	return fmt.Sprintf("GetTaskListsByDomainResponse{%v}", strings.Join(fields[:i], ", "))
}

func _Map_String_DescribeTaskListResponse_Equals(lhs, rhs map[string]*DescribeTaskListResponse) 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 GetTaskListsByDomainResponse match the
// provided GetTaskListsByDomainResponse.
//
// This function performs a deep comparison.
func (v *GetTaskListsByDomainResponse) Equals(rhs *GetTaskListsByDomainResponse) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !((v.DecisionTaskListMap == nil && rhs.DecisionTaskListMap == nil) || (v.DecisionTaskListMap != nil && rhs.DecisionTaskListMap != nil && _Map_String_DescribeTaskListResponse_Equals(v.DecisionTaskListMap, rhs.DecisionTaskListMap))) {
		return false
	}
	if !((v.ActivityTaskListMap == nil && rhs.ActivityTaskListMap == nil) || (v.ActivityTaskListMap != nil && rhs.ActivityTaskListMap != nil && _Map_String_DescribeTaskListResponse_Equals(v.ActivityTaskListMap, rhs.ActivityTaskListMap))) {
		return false
	}

	return true
}

type _Map_String_DescribeTaskListResponse_Zapper map[string]*DescribeTaskListResponse

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of _Map_String_DescribeTaskListResponse_Zapper.
func (m _Map_String_DescribeTaskListResponse_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 GetTaskListsByDomainResponse.
func (v *GetTaskListsByDomainResponse) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.DecisionTaskListMap != nil {
		err = multierr.Append(err, enc.AddObject("decisionTaskListMap", (_Map_String_DescribeTaskListResponse_Zapper)(v.DecisionTaskListMap)))
	}
	if v.ActivityTaskListMap != nil {
		err = multierr.Append(err, enc.AddObject("activityTaskListMap", (_Map_String_DescribeTaskListResponse_Zapper)(v.ActivityTaskListMap)))
	}
	return err
}

// GetDecisionTaskListMap returns the value of DecisionTaskListMap if it is set or its
// zero value if it is unset.
func (v *GetTaskListsByDomainResponse) GetDecisionTaskListMap() (o map[string]*DescribeTaskListResponse) {
	if v != nil && v.DecisionTaskListMap != nil {
		return v.DecisionTaskListMap
	}

	return
}

// IsSetDecisionTaskListMap returns true if DecisionTaskListMap is not nil.
func (v *GetTaskListsByDomainResponse) IsSetDecisionTaskListMap() bool {
	return v != nil && v.DecisionTaskListMap != nil
}

// GetActivityTaskListMap returns the value of ActivityTaskListMap if it is set or its
// zero value if it is unset.
func (v *GetTaskListsByDomainResponse) GetActivityTaskListMap() (o map[string]*DescribeTaskListResponse) {
	if v != nil && v.ActivityTaskListMap != nil {
		return v.ActivityTaskListMap
	}

	return
}

// IsSetActivityTaskListMap returns true if ActivityTaskListMap is not nil.
func (v *GetTaskListsByDomainResponse) IsSetActivityTaskListMap() bool {
	return v != nil && v.ActivityTaskListMap != nil
}

type GetWorkflowExecutionHistoryRequest struct {
	Domain                 *string                 `json:"domain,omitempty"`
	Execution              *WorkflowExecution      `json:"execution,omitempty"`
	MaximumPageSize        *int32                  `json:"maximumPageSize,omitempty"`
	NextPageToken          []byte                  `json:"nextPageToken,omitempty"`
	WaitForNewEvent        *bool                   `json:"waitForNewEvent,omitempty"`
	HistoryEventFilterType *HistoryEventFilterType `json:"HistoryEventFilterType,omitempty"`
	SkipArchival           *bool                   `json:"skipArchival,omitempty"`
	QueryConsistencyLevel  *QueryConsistencyLevel  `json:"queryConsistencyLevel,omitempty"`
}

// ToWire translates a GetWorkflowExecutionHistoryRequest 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 *GetWorkflowExecutionHistoryRequest) ToWire() (wire.Value, error) {
	var (
		fields [8]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.Execution != nil {
		w, err = v.Execution.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.MaximumPageSize != nil {
		w, err = wire.NewValueI32(*(v.MaximumPageSize)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.NextPageToken != nil {
		w, err = wire.NewValueBinary(v.NextPageToken), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 40, Value: w}
		i++
	}
	if v.WaitForNewEvent != nil {
		w, err = wire.NewValueBool(*(v.WaitForNewEvent)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 50, Value: w}
		i++
	}
	if v.HistoryEventFilterType != nil {
		w, err = v.HistoryEventFilterType.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 60, Value: w}
		i++
	}
	if v.SkipArchival != nil {
		w, err = wire.NewValueBool(*(v.SkipArchival)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 70, Value: w}
		i++
	}
	if v.QueryConsistencyLevel != nil {
		w, err = v.QueryConsistencyLevel.ToWire()
		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 _HistoryEventFilterType_Read(w wire.Value) (HistoryEventFilterType, error) {
	var v HistoryEventFilterType
	err := v.FromWire(w)
	return v, err
}

// FromWire deserializes a GetWorkflowExecutionHistoryRequest 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 GetWorkflowExecutionHistoryRequest struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v GetWorkflowExecutionHistoryRequest
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *GetWorkflowExecutionHistoryRequest) 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.Execution, err = _WorkflowExecution_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 30:
			if field.Value.Type() == wire.TI32 {
				var x int32
				x, err = field.Value.GetI32(), error(nil)
				v.MaximumPageSize = &x
				if err != nil {
					return err
				}

			}
		case 40:
			if field.Value.Type() == wire.TBinary {
				v.NextPageToken, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		case 50:
			if field.Value.Type() == wire.TBool {
				var x bool
				x, err = field.Value.GetBool(), error(nil)
				v.WaitForNewEvent = &x
				if err != nil {
					return err
				}

			}
		case 60:
			if field.Value.Type() == wire.TI32 {
				var x HistoryEventFilterType
				x, err = _HistoryEventFilterType_Read(field.Value)
				v.HistoryEventFilterType = &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.SkipArchival = &x
				if err != nil {
					return err
				}

			}
		case 80:
			if field.Value.Type() == wire.TI32 {
				var x QueryConsistencyLevel
				x, err = _QueryConsistencyLevel_Read(field.Value)
				v.QueryConsistencyLevel = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a GetWorkflowExecutionHistoryRequest
// struct.
func (v *GetWorkflowExecutionHistoryRequest) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [8]string
	i := 0
	if v.Domain != nil {
		fields[i] = fmt.Sprintf("Domain: %v", *(v.Domain))
		i++
	}
	if v.Execution != nil {
		fields[i] = fmt.Sprintf("Execution: %v", v.Execution)
		i++
	}
	if v.MaximumPageSize != nil {
		fields[i] = fmt.Sprintf("MaximumPageSize: %v", *(v.MaximumPageSize))
		i++
	}
	if v.NextPageToken != nil {
		fields[i] = fmt.Sprintf("NextPageToken: %v", v.NextPageToken)
		i++
	}
	if v.WaitForNewEvent != nil {
		fields[i] = fmt.Sprintf("WaitForNewEvent: %v", *(v.WaitForNewEvent))
		i++
	}
	if v.HistoryEventFilterType != nil {
		fields[i] = fmt.Sprintf("HistoryEventFilterType: %v", *(v.HistoryEventFilterType))
		i++
	}
	if v.SkipArchival != nil {
		fields[i] = fmt.Sprintf("SkipArchival: %v", *(v.SkipArchival))
		i++
	}
	if v.QueryConsistencyLevel != nil {
		fields[i] = fmt.Sprintf("QueryConsistencyLevel: %v", *(v.QueryConsistencyLevel))
		i++
	}

	return fmt.Sprintf("GetWorkflowExecutionHistoryRequest{%v}", strings.Join(fields[:i], ", "))
}

func _HistoryEventFilterType_EqualsPtr(lhs, rhs *HistoryEventFilterType) bool {
	if lhs != nil && rhs != nil {

		x := *lhs
		y := *rhs
		return x.Equals(y)
	}
	return lhs == nil && rhs == nil
}

// Equals returns true if all the fields of this GetWorkflowExecutionHistoryRequest match the
// provided GetWorkflowExecutionHistoryRequest.
//
// This function performs a deep comparison.
func (v *GetWorkflowExecutionHistoryRequest) Equals(rhs *GetWorkflowExecutionHistoryRequest) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.Domain, rhs.Domain) {
		return false
	}
	if !((v.Execution == nil && rhs.Execution == nil) || (v.Execution != nil && rhs.Execution != nil && v.Execution.Equals(rhs.Execution))) {
		return false
	}
	if !_I32_EqualsPtr(v.MaximumPageSize, rhs.MaximumPageSize) {
		return false
	}
	if !((v.NextPageToken == nil && rhs.NextPageToken == nil) || (v.NextPageToken != nil && rhs.NextPageToken != nil && bytes.Equal(v.NextPageToken, rhs.NextPageToken))) {
		return false
	}
	if !_Bool_EqualsPtr(v.WaitForNewEvent, rhs.WaitForNewEvent) {
		return false
	}
	if !_HistoryEventFilterType_EqualsPtr(v.HistoryEventFilterType, rhs.HistoryEventFilterType) {
		return false
	}
	if !_Bool_EqualsPtr(v.SkipArchival, rhs.SkipArchival) {
		return false
	}
	if !_QueryConsistencyLevel_EqualsPtr(v.QueryConsistencyLevel, rhs.QueryConsistencyLevel) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of GetWorkflowExecutionHistoryRequest.
func (v *GetWorkflowExecutionHistoryRequest) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Domain != nil {
		enc.AddString("domain", *v.Domain)
	}
	if v.Execution != nil {
		err = multierr.Append(err, enc.AddObject("execution", v.Execution))
	}
	if v.MaximumPageSize != nil {
		enc.AddInt32("maximumPageSize", *v.MaximumPageSize)
	}
	if v.NextPageToken != nil {
		enc.AddString("nextPageToken", base64.StdEncoding.EncodeToString(v.NextPageToken))
	}
	if v.WaitForNewEvent != nil {
		enc.AddBool("waitForNewEvent", *v.WaitForNewEvent)
	}
	if v.HistoryEventFilterType != nil {
		err = multierr.Append(err, enc.AddObject("HistoryEventFilterType", *v.HistoryEventFilterType))
	}
	if v.SkipArchival != nil {
		enc.AddBool("skipArchival", *v.SkipArchival)
	}
	if v.QueryConsistencyLevel != nil {
		err = multierr.Append(err, enc.AddObject("queryConsistencyLevel", *v.QueryConsistencyLevel))
	}
	return err
}

// GetDomain returns the value of Domain if it is set or its
// zero value if it is unset.
func (v *GetWorkflowExecutionHistoryRequest) GetDomain() (o string) {
	if v != nil && v.Domain != nil {
		return *v.Domain
	}

	return
}

// IsSetDomain returns true if Domain is not nil.
func (v *GetWorkflowExecutionHistoryRequest) IsSetDomain() bool {
	return v != nil && v.Domain != nil
}

// GetExecution returns the value of Execution if it is set or its
// zero value if it is unset.
func (v *GetWorkflowExecutionHistoryRequest) GetExecution() (o *WorkflowExecution) {
	if v != nil && v.Execution != nil {
		return v.Execution
	}

	return
}

// IsSetExecution returns true if Execution is not nil.
func (v *GetWorkflowExecutionHistoryRequest) IsSetExecution() bool {
	return v != nil && v.Execution != nil
}

// GetMaximumPageSize returns the value of MaximumPageSize if it is set or its
// zero value if it is unset.
func (v *GetWorkflowExecutionHistoryRequest) GetMaximumPageSize() (o int32) {
	if v != nil && v.MaximumPageSize != nil {
		return *v.MaximumPageSize
	}

	return
}

// IsSetMaximumPageSize returns true if MaximumPageSize is not nil.
func (v *GetWorkflowExecutionHistoryRequest) IsSetMaximumPageSize() bool {
	return v != nil && v.MaximumPageSize != nil
}

// GetNextPageToken returns the value of NextPageToken if it is set or its
// zero value if it is unset.
func (v *GetWorkflowExecutionHistoryRequest) GetNextPageToken() (o []byte) {
	if v != nil && v.NextPageToken != nil {
		return v.NextPageToken
	}

	return
}

// IsSetNextPageToken returns true if NextPageToken is not nil.
func (v *GetWorkflowExecutionHistoryRequest) IsSetNextPageToken() bool {
	return v != nil && v.NextPageToken != nil
}

// GetWaitForNewEvent returns the value of WaitForNewEvent if it is set or its
// zero value if it is unset.
func (v *GetWorkflowExecutionHistoryRequest) GetWaitForNewEvent() (o bool) {
	if v != nil && v.WaitForNewEvent != nil {
		return *v.WaitForNewEvent
	}

	return
}

// IsSetWaitForNewEvent returns true if WaitForNewEvent is not nil.
func (v *GetWorkflowExecutionHistoryRequest) IsSetWaitForNewEvent() bool {
	return v != nil && v.WaitForNewEvent != nil
}

// GetHistoryEventFilterType returns the value of HistoryEventFilterType if it is set or its
// zero value if it is unset.
func (v *GetWorkflowExecutionHistoryRequest) GetHistoryEventFilterType() (o HistoryEventFilterType) {
	if v != nil && v.HistoryEventFilterType != nil {
		return *v.HistoryEventFilterType
	}

	return
}

// IsSetHistoryEventFilterType returns true if HistoryEventFilterType is not nil.
func (v *GetWorkflowExecutionHistoryRequest) IsSetHistoryEventFilterType() bool {
	return v != nil && v.HistoryEventFilterType != nil
}

// GetSkipArchival returns the value of SkipArchival if it is set or its
// zero value if it is unset.
func (v *GetWorkflowExecutionHistoryRequest) GetSkipArchival() (o bool) {
	if v != nil && v.SkipArchival != nil {
		return *v.SkipArchival
	}

	return
}

// IsSetSkipArchival returns true if SkipArchival is not nil.
func (v *GetWorkflowExecutionHistoryRequest) IsSetSkipArchival() bool {
	return v != nil && v.SkipArchival != nil
}

// GetQueryConsistencyLevel returns the value of QueryConsistencyLevel if it is set or its
// zero value if it is unset.
func (v *GetWorkflowExecutionHistoryRequest) GetQueryConsistencyLevel() (o QueryConsistencyLevel) {
	if v != nil && v.QueryConsistencyLevel != nil {
		return *v.QueryConsistencyLevel
	}

	return
}

// IsSetQueryConsistencyLevel returns true if QueryConsistencyLevel is not nil.
func (v *GetWorkflowExecutionHistoryRequest) IsSetQueryConsistencyLevel() bool {
	return v != nil && v.QueryConsistencyLevel != nil
}

type GetWorkflowExecutionHistoryResponse struct {
	History       *History    `json:"history,omitempty"`
	RawHistory    []*DataBlob `json:"rawHistory,omitempty"`
	NextPageToken []byte      `json:"nextPageToken,omitempty"`
	Archived      *bool       `json:"archived,omitempty"`
}

type _List_DataBlob_ValueList []*DataBlob

func (v _List_DataBlob_ValueList) ForEach(f func(wire.Value) error) error {
	for i, x := range v {
		if x == nil {
			return fmt.Errorf("invalid [%v]: value is nil", i)
		}
		w, err := x.ToWire()
		if err != nil {
			return err
		}
		err = f(w)
		if err != nil {
			return err
		}
	}
	return nil
}

func (v _List_DataBlob_ValueList) Size() int {
	return len(v)
}

func (_List_DataBlob_ValueList) ValueType() wire.Type {
	return wire.TStruct
}

func (_List_DataBlob_ValueList) Close() {}

// ToWire translates a GetWorkflowExecutionHistoryResponse 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 *GetWorkflowExecutionHistoryResponse) ToWire() (wire.Value, error) {
	var (
		fields [4]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.History != nil {
		w, err = v.History.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.RawHistory != nil {
		w, err = wire.NewValueList(_List_DataBlob_ValueList(v.RawHistory)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 11, Value: w}
		i++
	}
	if v.NextPageToken != nil {
		w, err = wire.NewValueBinary(v.NextPageToken), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.Archived != nil {
		w, err = wire.NewValueBool(*(v.Archived)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

func _History_Read(w wire.Value) (*History, error) {
	var v History
	err := v.FromWire(w)
	return &v, err
}

func _List_DataBlob_Read(l wire.ValueList) ([]*DataBlob, error) {
	if l.ValueType() != wire.TStruct {
		return nil, nil
	}

	o := make([]*DataBlob, 0, l.Size())
	err := l.ForEach(func(x wire.Value) error {
		i, err := _DataBlob_Read(x)
		if err != nil {
			return err
		}
		o = append(o, i)
		return nil
	})
	l.Close()
	return o, err
}

// FromWire deserializes a GetWorkflowExecutionHistoryResponse 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 GetWorkflowExecutionHistoryResponse struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v GetWorkflowExecutionHistoryResponse
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *GetWorkflowExecutionHistoryResponse) 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.History, err = _History_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 11:
			if field.Value.Type() == wire.TList {
				v.RawHistory, err = _List_DataBlob_Read(field.Value.GetList())
				if err != nil {
					return err
				}

			}
		case 20:
			if field.Value.Type() == wire.TBinary {
				v.NextPageToken, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		case 30:
			if field.Value.Type() == wire.TBool {
				var x bool
				x, err = field.Value.GetBool(), error(nil)
				v.Archived = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a GetWorkflowExecutionHistoryResponse
// struct.
func (v *GetWorkflowExecutionHistoryResponse) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [4]string
	i := 0
	if v.History != nil {
		fields[i] = fmt.Sprintf("History: %v", v.History)
		i++
	}
	if v.RawHistory != nil {
		fields[i] = fmt.Sprintf("RawHistory: %v", v.RawHistory)
		i++
	}
	if v.NextPageToken != nil {
		fields[i] = fmt.Sprintf("NextPageToken: %v", v.NextPageToken)
		i++
	}
	if v.Archived != nil {
		fields[i] = fmt.Sprintf("Archived: %v", *(v.Archived))
		i++
	}

	return fmt.Sprintf("GetWorkflowExecutionHistoryResponse{%v}", strings.Join(fields[:i], ", "))
}

func _List_DataBlob_Equals(lhs, rhs []*DataBlob) bool {
	if len(lhs) != len(rhs) {
		return false
	}

	for i, lv := range lhs {
		rv := rhs[i]
		if !lv.Equals(rv) {
			return false
		}
	}

	return true
}

// Equals returns true if all the fields of this GetWorkflowExecutionHistoryResponse match the
// provided GetWorkflowExecutionHistoryResponse.
//
// This function performs a deep comparison.
func (v *GetWorkflowExecutionHistoryResponse) Equals(rhs *GetWorkflowExecutionHistoryResponse) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !((v.History == nil && rhs.History == nil) || (v.History != nil && rhs.History != nil && v.History.Equals(rhs.History))) {
		return false
	}
	if !((v.RawHistory == nil && rhs.RawHistory == nil) || (v.RawHistory != nil && rhs.RawHistory != nil && _List_DataBlob_Equals(v.RawHistory, rhs.RawHistory))) {
		return false
	}
	if !((v.NextPageToken == nil && rhs.NextPageToken == nil) || (v.NextPageToken != nil && rhs.NextPageToken != nil && bytes.Equal(v.NextPageToken, rhs.NextPageToken))) {
		return false
	}
	if !_Bool_EqualsPtr(v.Archived, rhs.Archived) {
		return false
	}

	return true
}

type _List_DataBlob_Zapper []*DataBlob

// MarshalLogArray implements zapcore.ArrayMarshaler, enabling
// fast logging of _List_DataBlob_Zapper.
func (l _List_DataBlob_Zapper) MarshalLogArray(enc zapcore.ArrayEncoder) (err error) {
	for _, v := range l {
		err = multierr.Append(err, enc.AppendObject(v))
	}
	return err
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of GetWorkflowExecutionHistoryResponse.
func (v *GetWorkflowExecutionHistoryResponse) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.History != nil {
		err = multierr.Append(err, enc.AddObject("history", v.History))
	}
	if v.RawHistory != nil {
		err = multierr.Append(err, enc.AddArray("rawHistory", (_List_DataBlob_Zapper)(v.RawHistory)))
	}
	if v.NextPageToken != nil {
		enc.AddString("nextPageToken", base64.StdEncoding.EncodeToString(v.NextPageToken))
	}
	if v.Archived != nil {
		enc.AddBool("archived", *v.Archived)
	}
	return err
}

// GetHistory returns the value of History if it is set or its
// zero value if it is unset.
func (v *GetWorkflowExecutionHistoryResponse) GetHistory() (o *History) {
	if v != nil && v.History != nil {
		return v.History
	}

	return
}

// IsSetHistory returns true if History is not nil.
func (v *GetWorkflowExecutionHistoryResponse) IsSetHistory() bool {
	return v != nil && v.History != nil
}

// GetRawHistory returns the value of RawHistory if it is set or its
// zero value if it is unset.
func (v *GetWorkflowExecutionHistoryResponse) GetRawHistory() (o []*DataBlob) {
	if v != nil && v.RawHistory != nil {
		return v.RawHistory
	}

	return
}

// IsSetRawHistory returns true if RawHistory is not nil.
func (v *GetWorkflowExecutionHistoryResponse) IsSetRawHistory() bool {
	return v != nil && v.RawHistory != nil
}

// GetNextPageToken returns the value of NextPageToken if it is set or its
// zero value if it is unset.
func (v *GetWorkflowExecutionHistoryResponse) GetNextPageToken() (o []byte) {
	if v != nil && v.NextPageToken != nil {
		return v.NextPageToken
	}

	return
}

// IsSetNextPageToken returns true if NextPageToken is not nil.
func (v *GetWorkflowExecutionHistoryResponse) IsSetNextPageToken() bool {
	return v != nil && v.NextPageToken != nil
}

// GetArchived returns the value of Archived if it is set or its
// zero value if it is unset.
func (v *GetWorkflowExecutionHistoryResponse) GetArchived() (o bool) {
	if v != nil && v.Archived != nil {
		return *v.Archived
	}

	return
}

// IsSetArchived returns true if Archived is not nil.
func (v *GetWorkflowExecutionHistoryResponse) IsSetArchived() bool {
	return v != nil && v.Archived != nil
}

type Header struct {
	Fields map[string][]byte `json:"fields,omitempty"`
}

type _Map_String_Binary_MapItemList map[string][]byte

func (m _Map_String_Binary_MapItemList) ForEach(f func(wire.MapItem) error) error {
	for k, v := range m {
		if v == nil {
			return fmt.Errorf("invalid [%v]: value is nil", k)
		}
		kw, err := wire.NewValueString(k), error(nil)
		if err != nil {
			return err
		}

		vw, err := wire.NewValueBinary(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_Binary_MapItemList) Size() int {
	return len(m)
}

func (_Map_String_Binary_MapItemList) KeyType() wire.Type {
	return wire.TBinary
}

func (_Map_String_Binary_MapItemList) ValueType() wire.Type {
	return wire.TBinary
}

func (_Map_String_Binary_MapItemList) Close() {}

// ToWire translates a Header 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 *Header) ToWire() (wire.Value, error) {
	var (
		fields [1]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.Fields != nil {
		w, err = wire.NewValueMap(_Map_String_Binary_MapItemList(v.Fields)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

func _Map_String_Binary_Read(m wire.MapItemList) (map[string][]byte, error) {
	if m.KeyType() != wire.TBinary {
		return nil, nil
	}

	if m.ValueType() != wire.TBinary {
		return nil, nil
	}

	o := make(map[string][]byte, 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.GetBinary(), error(nil)
		if err != nil {
			return err
		}

		o[k] = v
		return nil
	})
	m.Close()
	return o, err
}

// FromWire deserializes a Header 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 Header struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v Header
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *Header) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			if field.Value.Type() == wire.TMap {
				v.Fields, err = _Map_String_Binary_Read(field.Value.GetMap())
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a Header
// struct.
func (v *Header) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [1]string
	i := 0
	if v.Fields != nil {
		fields[i] = fmt.Sprintf("Fields: %v", v.Fields)
		i++
	}

	return fmt.Sprintf("Header{%v}", strings.Join(fields[:i], ", "))
}

func _Map_String_Binary_Equals(lhs, rhs map[string][]byte) bool {
	if len(lhs) != len(rhs) {
		return false
	}

	for lk, lv := range lhs {
		rv, ok := rhs[lk]
		if !ok {
			return false
		}
		if !bytes.Equal(lv, rv) {
			return false
		}
	}
	return true
}

// Equals returns true if all the fields of this Header match the
// provided Header.
//
// This function performs a deep comparison.
func (v *Header) Equals(rhs *Header) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !((v.Fields == nil && rhs.Fields == nil) || (v.Fields != nil && rhs.Fields != nil && _Map_String_Binary_Equals(v.Fields, rhs.Fields))) {
		return false
	}

	return true
}

type _Map_String_Binary_Zapper map[string][]byte

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of _Map_String_Binary_Zapper.
func (m _Map_String_Binary_Zapper) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	for k, v := range m {
		enc.AddString((string)(k), base64.StdEncoding.EncodeToString(v))
	}
	return err
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of Header.
func (v *Header) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Fields != nil {
		err = multierr.Append(err, enc.AddObject("fields", (_Map_String_Binary_Zapper)(v.Fields)))
	}
	return err
}

// GetFields returns the value of Fields if it is set or its
// zero value if it is unset.
func (v *Header) GetFields() (o map[string][]byte) {
	if v != nil && v.Fields != nil {
		return v.Fields
	}

	return
}

// IsSetFields returns true if Fields is not nil.
func (v *Header) IsSetFields() bool {
	return v != nil && v.Fields != nil
}

type History struct {
	Events []*HistoryEvent `json:"events,omitempty"`
}

type _List_HistoryEvent_ValueList []*HistoryEvent

func (v _List_HistoryEvent_ValueList) ForEach(f func(wire.Value) error) error {
	for i, x := range v {
		if x == nil {
			return fmt.Errorf("invalid [%v]: value is nil", i)
		}
		w, err := x.ToWire()
		if err != nil {
			return err
		}
		err = f(w)
		if err != nil {
			return err
		}
	}
	return nil
}

func (v _List_HistoryEvent_ValueList) Size() int {
	return len(v)
}

func (_List_HistoryEvent_ValueList) ValueType() wire.Type {
	return wire.TStruct
}

func (_List_HistoryEvent_ValueList) Close() {}

// ToWire translates a History 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 *History) ToWire() (wire.Value, error) {
	var (
		fields [1]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.Events != nil {
		w, err = wire.NewValueList(_List_HistoryEvent_ValueList(v.Events)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

func _List_HistoryEvent_Read(l wire.ValueList) ([]*HistoryEvent, error) {
	if l.ValueType() != wire.TStruct {
		return nil, nil
	}

	o := make([]*HistoryEvent, 0, l.Size())
	err := l.ForEach(func(x wire.Value) error {
		i, err := _HistoryEvent_Read(x)
		if err != nil {
			return err
		}
		o = append(o, i)
		return nil
	})
	l.Close()
	return o, err
}

// FromWire deserializes a History 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 History struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v History
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *History) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			if field.Value.Type() == wire.TList {
				v.Events, err = _List_HistoryEvent_Read(field.Value.GetList())
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a History
// struct.
func (v *History) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [1]string
	i := 0
	if v.Events != nil {
		fields[i] = fmt.Sprintf("Events: %v", v.Events)
		i++
	}

	return fmt.Sprintf("History{%v}", strings.Join(fields[:i], ", "))
}

func _List_HistoryEvent_Equals(lhs, rhs []*HistoryEvent) bool {
	if len(lhs) != len(rhs) {
		return false
	}

	for i, lv := range lhs {
		rv := rhs[i]
		if !lv.Equals(rv) {
			return false
		}
	}

	return true
}

// Equals returns true if all the fields of this History match the
// provided History.
//
// This function performs a deep comparison.
func (v *History) Equals(rhs *History) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !((v.Events == nil && rhs.Events == nil) || (v.Events != nil && rhs.Events != nil && _List_HistoryEvent_Equals(v.Events, rhs.Events))) {
		return false
	}

	return true
}

type _List_HistoryEvent_Zapper []*HistoryEvent

// MarshalLogArray implements zapcore.ArrayMarshaler, enabling
// fast logging of _List_HistoryEvent_Zapper.
func (l _List_HistoryEvent_Zapper) MarshalLogArray(enc zapcore.ArrayEncoder) (err error) {
	for _, v := range l {
		err = multierr.Append(err, enc.AppendObject(v))
	}
	return err
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of History.
func (v *History) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Events != nil {
		err = multierr.Append(err, enc.AddArray("events", (_List_HistoryEvent_Zapper)(v.Events)))
	}
	return err
}

// GetEvents returns the value of Events if it is set or its
// zero value if it is unset.
func (v *History) GetEvents() (o []*HistoryEvent) {
	if v != nil && v.Events != nil {
		return v.Events
	}

	return
}

// IsSetEvents returns true if Events is not nil.
func (v *History) IsSetEvents() bool {
	return v != nil && v.Events != nil
}

type HistoryBranch struct {
	TreeID    *string               `json:"treeID,omitempty"`
	BranchID  *string               `json:"branchID,omitempty"`
	Ancestors []*HistoryBranchRange `json:"ancestors,omitempty"`
}

type _List_HistoryBranchRange_ValueList []*HistoryBranchRange

func (v _List_HistoryBranchRange_ValueList) ForEach(f func(wire.Value) error) error {
	for i, x := range v {
		if x == nil {
			return fmt.Errorf("invalid [%v]: value is nil", i)
		}
		w, err := x.ToWire()
		if err != nil {
			return err
		}
		err = f(w)
		if err != nil {
			return err
		}
	}
	return nil
}

func (v _List_HistoryBranchRange_ValueList) Size() int {
	return len(v)
}

func (_List_HistoryBranchRange_ValueList) ValueType() wire.Type {
	return wire.TStruct
}

func (_List_HistoryBranchRange_ValueList) Close() {}

// ToWire translates a HistoryBranch 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 *HistoryBranch) ToWire() (wire.Value, error) {
	var (
		fields [3]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.TreeID != nil {
		w, err = wire.NewValueString(*(v.TreeID)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.BranchID != nil {
		w, err = wire.NewValueString(*(v.BranchID)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.Ancestors != nil {
		w, err = wire.NewValueList(_List_HistoryBranchRange_ValueList(v.Ancestors)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

func _HistoryBranchRange_Read(w wire.Value) (*HistoryBranchRange, error) {
	var v HistoryBranchRange
	err := v.FromWire(w)
	return &v, err
}

func _List_HistoryBranchRange_Read(l wire.ValueList) ([]*HistoryBranchRange, error) {
	if l.ValueType() != wire.TStruct {
		return nil, nil
	}

	o := make([]*HistoryBranchRange, 0, l.Size())
	err := l.ForEach(func(x wire.Value) error {
		i, err := _HistoryBranchRange_Read(x)
		if err != nil {
			return err
		}
		o = append(o, i)
		return nil
	})
	l.Close()
	return o, err
}

// FromWire deserializes a HistoryBranch 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 HistoryBranch struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v HistoryBranch
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *HistoryBranch) 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.TreeID = &x
				if err != nil {
					return err
				}

			}
		case 20:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.BranchID = &x
				if err != nil {
					return err
				}

			}
		case 30:
			if field.Value.Type() == wire.TList {
				v.Ancestors, err = _List_HistoryBranchRange_Read(field.Value.GetList())
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a HistoryBranch
// struct.
func (v *HistoryBranch) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [3]string
	i := 0
	if v.TreeID != nil {
		fields[i] = fmt.Sprintf("TreeID: %v", *(v.TreeID))
		i++
	}
	if v.BranchID != nil {
		fields[i] = fmt.Sprintf("BranchID: %v", *(v.BranchID))
		i++
	}
	if v.Ancestors != nil {
		fields[i] = fmt.Sprintf("Ancestors: %v", v.Ancestors)
		i++
	}

	return fmt.Sprintf("HistoryBranch{%v}", strings.Join(fields[:i], ", "))
}

func _List_HistoryBranchRange_Equals(lhs, rhs []*HistoryBranchRange) bool {
	if len(lhs) != len(rhs) {
		return false
	}

	for i, lv := range lhs {
		rv := rhs[i]
		if !lv.Equals(rv) {
			return false
		}
	}

	return true
}

// Equals returns true if all the fields of this HistoryBranch match the
// provided HistoryBranch.
//
// This function performs a deep comparison.
func (v *HistoryBranch) Equals(rhs *HistoryBranch) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.TreeID, rhs.TreeID) {
		return false
	}
	if !_String_EqualsPtr(v.BranchID, rhs.BranchID) {
		return false
	}
	if !((v.Ancestors == nil && rhs.Ancestors == nil) || (v.Ancestors != nil && rhs.Ancestors != nil && _List_HistoryBranchRange_Equals(v.Ancestors, rhs.Ancestors))) {
		return false
	}

	return true
}

type _List_HistoryBranchRange_Zapper []*HistoryBranchRange

// MarshalLogArray implements zapcore.ArrayMarshaler, enabling
// fast logging of _List_HistoryBranchRange_Zapper.
func (l _List_HistoryBranchRange_Zapper) MarshalLogArray(enc zapcore.ArrayEncoder) (err error) {
	for _, v := range l {
		err = multierr.Append(err, enc.AppendObject(v))
	}
	return err
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of HistoryBranch.
func (v *HistoryBranch) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.TreeID != nil {
		enc.AddString("treeID", *v.TreeID)
	}
	if v.BranchID != nil {
		enc.AddString("branchID", *v.BranchID)
	}
	if v.Ancestors != nil {
		err = multierr.Append(err, enc.AddArray("ancestors", (_List_HistoryBranchRange_Zapper)(v.Ancestors)))
	}
	return err
}

// GetTreeID returns the value of TreeID if it is set or its
// zero value if it is unset.
func (v *HistoryBranch) GetTreeID() (o string) {
	if v != nil && v.TreeID != nil {
		return *v.TreeID
	}

	return
}

// IsSetTreeID returns true if TreeID is not nil.
func (v *HistoryBranch) IsSetTreeID() bool {
	return v != nil && v.TreeID != nil
}

// GetBranchID returns the value of BranchID if it is set or its
// zero value if it is unset.
func (v *HistoryBranch) GetBranchID() (o string) {
	if v != nil && v.BranchID != nil {
		return *v.BranchID
	}

	return
}

// IsSetBranchID returns true if BranchID is not nil.
func (v *HistoryBranch) IsSetBranchID() bool {
	return v != nil && v.BranchID != nil
}

// GetAncestors returns the value of Ancestors if it is set or its
// zero value if it is unset.
func (v *HistoryBranch) GetAncestors() (o []*HistoryBranchRange) {
	if v != nil && v.Ancestors != nil {
		return v.Ancestors
	}

	return
}

// IsSetAncestors returns true if Ancestors is not nil.
func (v *HistoryBranch) IsSetAncestors() bool {
	return v != nil && v.Ancestors != nil
}

type HistoryBranchRange struct {
	BranchID    *string `json:"branchID,omitempty"`
	BeginNodeID *int64  `json:"beginNodeID,omitempty"`
	EndNodeID   *int64  `json:"endNodeID,omitempty"`
}

// ToWire translates a HistoryBranchRange 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 *HistoryBranchRange) ToWire() (wire.Value, error) {
	var (
		fields [3]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.BranchID != nil {
		w, err = wire.NewValueString(*(v.BranchID)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.BeginNodeID != nil {
		w, err = wire.NewValueI64(*(v.BeginNodeID)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.EndNodeID != nil {
		w, err = wire.NewValueI64(*(v.EndNodeID)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

// FromWire deserializes a HistoryBranchRange 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 HistoryBranchRange struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v HistoryBranchRange
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *HistoryBranchRange) 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.BranchID = &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.BeginNodeID = &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.EndNodeID = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a HistoryBranchRange
// struct.
func (v *HistoryBranchRange) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [3]string
	i := 0
	if v.BranchID != nil {
		fields[i] = fmt.Sprintf("BranchID: %v", *(v.BranchID))
		i++
	}
	if v.BeginNodeID != nil {
		fields[i] = fmt.Sprintf("BeginNodeID: %v", *(v.BeginNodeID))
		i++
	}
	if v.EndNodeID != nil {
		fields[i] = fmt.Sprintf("EndNodeID: %v", *(v.EndNodeID))
		i++
	}

	return fmt.Sprintf("HistoryBranchRange{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this HistoryBranchRange match the
// provided HistoryBranchRange.
//
// This function performs a deep comparison.
func (v *HistoryBranchRange) Equals(rhs *HistoryBranchRange) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.BranchID, rhs.BranchID) {
		return false
	}
	if !_I64_EqualsPtr(v.BeginNodeID, rhs.BeginNodeID) {
		return false
	}
	if !_I64_EqualsPtr(v.EndNodeID, rhs.EndNodeID) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of HistoryBranchRange.
func (v *HistoryBranchRange) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.BranchID != nil {
		enc.AddString("branchID", *v.BranchID)
	}
	if v.BeginNodeID != nil {
		enc.AddInt64("beginNodeID", *v.BeginNodeID)
	}
	if v.EndNodeID != nil {
		enc.AddInt64("endNodeID", *v.EndNodeID)
	}
	return err
}

// GetBranchID returns the value of BranchID if it is set or its
// zero value if it is unset.
func (v *HistoryBranchRange) GetBranchID() (o string) {
	if v != nil && v.BranchID != nil {
		return *v.BranchID
	}

	return
}

// IsSetBranchID returns true if BranchID is not nil.
func (v *HistoryBranchRange) IsSetBranchID() bool {
	return v != nil && v.BranchID != nil
}

// GetBeginNodeID returns the value of BeginNodeID if it is set or its
// zero value if it is unset.
func (v *HistoryBranchRange) GetBeginNodeID() (o int64) {
	if v != nil && v.BeginNodeID != nil {
		return *v.BeginNodeID
	}

	return
}

// IsSetBeginNodeID returns true if BeginNodeID is not nil.
func (v *HistoryBranchRange) IsSetBeginNodeID() bool {
	return v != nil && v.BeginNodeID != nil
}

// GetEndNodeID returns the value of EndNodeID if it is set or its
// zero value if it is unset.
func (v *HistoryBranchRange) GetEndNodeID() (o int64) {
	if v != nil && v.EndNodeID != nil {
		return *v.EndNodeID
	}

	return
}

// IsSetEndNodeID returns true if EndNodeID is not nil.
func (v *HistoryBranchRange) IsSetEndNodeID() bool {
	return v != nil && v.EndNodeID != nil
}

type HistoryEvent struct {
	EventId                                                        *int64                                                          `json:"eventId,omitempty"`
	Timestamp                                                      *int64                                                          `json:"timestamp,omitempty"`
	EventType                                                      *EventType                                                      `json:"eventType,omitempty"`
	Version                                                        *int64                                                          `json:"version,omitempty"`
	TaskId                                                         *int64                                                          `json:"taskId,omitempty"`
	WorkflowExecutionStartedEventAttributes                        *WorkflowExecutionStartedEventAttributes                        `json:"workflowExecutionStartedEventAttributes,omitempty"`
	WorkflowExecutionCompletedEventAttributes                      *WorkflowExecutionCompletedEventAttributes                      `json:"workflowExecutionCompletedEventAttributes,omitempty"`
	WorkflowExecutionFailedEventAttributes                         *WorkflowExecutionFailedEventAttributes                         `json:"workflowExecutionFailedEventAttributes,omitempty"`
	WorkflowExecutionTimedOutEventAttributes                       *WorkflowExecutionTimedOutEventAttributes                       `json:"workflowExecutionTimedOutEventAttributes,omitempty"`
	DecisionTaskScheduledEventAttributes                           *DecisionTaskScheduledEventAttributes                           `json:"decisionTaskScheduledEventAttributes,omitempty"`
	DecisionTaskStartedEventAttributes                             *DecisionTaskStartedEventAttributes                             `json:"decisionTaskStartedEventAttributes,omitempty"`
	DecisionTaskCompletedEventAttributes                           *DecisionTaskCompletedEventAttributes                           `json:"decisionTaskCompletedEventAttributes,omitempty"`
	DecisionTaskTimedOutEventAttributes                            *DecisionTaskTimedOutEventAttributes                            `json:"decisionTaskTimedOutEventAttributes,omitempty"`
	DecisionTaskFailedEventAttributes                              *DecisionTaskFailedEventAttributes                              `json:"decisionTaskFailedEventAttributes,omitempty"`
	ActivityTaskScheduledEventAttributes                           *ActivityTaskScheduledEventAttributes                           `json:"activityTaskScheduledEventAttributes,omitempty"`
	ActivityTaskStartedEventAttributes                             *ActivityTaskStartedEventAttributes                             `json:"activityTaskStartedEventAttributes,omitempty"`
	ActivityTaskCompletedEventAttributes                           *ActivityTaskCompletedEventAttributes                           `json:"activityTaskCompletedEventAttributes,omitempty"`
	ActivityTaskFailedEventAttributes                              *ActivityTaskFailedEventAttributes                              `json:"activityTaskFailedEventAttributes,omitempty"`
	ActivityTaskTimedOutEventAttributes                            *ActivityTaskTimedOutEventAttributes                            `json:"activityTaskTimedOutEventAttributes,omitempty"`
	TimerStartedEventAttributes                                    *TimerStartedEventAttributes                                    `json:"timerStartedEventAttributes,omitempty"`
	TimerFiredEventAttributes                                      *TimerFiredEventAttributes                                      `json:"timerFiredEventAttributes,omitempty"`
	ActivityTaskCancelRequestedEventAttributes                     *ActivityTaskCancelRequestedEventAttributes                     `json:"activityTaskCancelRequestedEventAttributes,omitempty"`
	RequestCancelActivityTaskFailedEventAttributes                 *RequestCancelActivityTaskFailedEventAttributes                 `json:"requestCancelActivityTaskFailedEventAttributes,omitempty"`
	ActivityTaskCanceledEventAttributes                            *ActivityTaskCanceledEventAttributes                            `json:"activityTaskCanceledEventAttributes,omitempty"`
	TimerCanceledEventAttributes                                   *TimerCanceledEventAttributes                                   `json:"timerCanceledEventAttributes,omitempty"`
	CancelTimerFailedEventAttributes                               *CancelTimerFailedEventAttributes                               `json:"cancelTimerFailedEventAttributes,omitempty"`
	MarkerRecordedEventAttributes                                  *MarkerRecordedEventAttributes                                  `json:"markerRecordedEventAttributes,omitempty"`
	WorkflowExecutionSignaledEventAttributes                       *WorkflowExecutionSignaledEventAttributes                       `json:"workflowExecutionSignaledEventAttributes,omitempty"`
	WorkflowExecutionTerminatedEventAttributes                     *WorkflowExecutionTerminatedEventAttributes                     `json:"workflowExecutionTerminatedEventAttributes,omitempty"`
	WorkflowExecutionCancelRequestedEventAttributes                *WorkflowExecutionCancelRequestedEventAttributes                `json:"workflowExecutionCancelRequestedEventAttributes,omitempty"`
	WorkflowExecutionCanceledEventAttributes                       *WorkflowExecutionCanceledEventAttributes                       `json:"workflowExecutionCanceledEventAttributes,omitempty"`
	RequestCancelExternalWorkflowExecutionInitiatedEventAttributes *RequestCancelExternalWorkflowExecutionInitiatedEventAttributes `json:"requestCancelExternalWorkflowExecutionInitiatedEventAttributes,omitempty"`
	RequestCancelExternalWorkflowExecutionFailedEventAttributes    *RequestCancelExternalWorkflowExecutionFailedEventAttributes    `json:"requestCancelExternalWorkflowExecutionFailedEventAttributes,omitempty"`
	ExternalWorkflowExecutionCancelRequestedEventAttributes        *ExternalWorkflowExecutionCancelRequestedEventAttributes        `json:"externalWorkflowExecutionCancelRequestedEventAttributes,omitempty"`
	WorkflowExecutionContinuedAsNewEventAttributes                 *WorkflowExecutionContinuedAsNewEventAttributes                 `json:"workflowExecutionContinuedAsNewEventAttributes,omitempty"`
	StartChildWorkflowExecutionInitiatedEventAttributes            *StartChildWorkflowExecutionInitiatedEventAttributes            `json:"startChildWorkflowExecutionInitiatedEventAttributes,omitempty"`
	StartChildWorkflowExecutionFailedEventAttributes               *StartChildWorkflowExecutionFailedEventAttributes               `json:"startChildWorkflowExecutionFailedEventAttributes,omitempty"`
	ChildWorkflowExecutionStartedEventAttributes                   *ChildWorkflowExecutionStartedEventAttributes                   `json:"childWorkflowExecutionStartedEventAttributes,omitempty"`
	ChildWorkflowExecutionCompletedEventAttributes                 *ChildWorkflowExecutionCompletedEventAttributes                 `json:"childWorkflowExecutionCompletedEventAttributes,omitempty"`
	ChildWorkflowExecutionFailedEventAttributes                    *ChildWorkflowExecutionFailedEventAttributes                    `json:"childWorkflowExecutionFailedEventAttributes,omitempty"`
	ChildWorkflowExecutionCanceledEventAttributes                  *ChildWorkflowExecutionCanceledEventAttributes                  `json:"childWorkflowExecutionCanceledEventAttributes,omitempty"`
	ChildWorkflowExecutionTimedOutEventAttributes                  *ChildWorkflowExecutionTimedOutEventAttributes                  `json:"childWorkflowExecutionTimedOutEventAttributes,omitempty"`
	ChildWorkflowExecutionTerminatedEventAttributes                *ChildWorkflowExecutionTerminatedEventAttributes                `json:"childWorkflowExecutionTerminatedEventAttributes,omitempty"`
	SignalExternalWorkflowExecutionInitiatedEventAttributes        *SignalExternalWorkflowExecutionInitiatedEventAttributes        `json:"signalExternalWorkflowExecutionInitiatedEventAttributes,omitempty"`
	SignalExternalWorkflowExecutionFailedEventAttributes           *SignalExternalWorkflowExecutionFailedEventAttributes           `json:"signalExternalWorkflowExecutionFailedEventAttributes,omitempty"`
	ExternalWorkflowExecutionSignaledEventAttributes               *ExternalWorkflowExecutionSignaledEventAttributes               `json:"externalWorkflowExecutionSignaledEventAttributes,omitempty"`
	UpsertWorkflowSearchAttributesEventAttributes                  *UpsertWorkflowSearchAttributesEventAttributes                  `json:"upsertWorkflowSearchAttributesEventAttributes,omitempty"`
}

// ToWire translates a HistoryEvent 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 *HistoryEvent) ToWire() (wire.Value, error) {
	var (
		fields [47]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.EventId != nil {
		w, err = wire.NewValueI64(*(v.EventId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.Timestamp != nil {
		w, err = wire.NewValueI64(*(v.Timestamp)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.EventType != nil {
		w, err = v.EventType.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.Version != nil {
		w, err = wire.NewValueI64(*(v.Version)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 35, Value: w}
		i++
	}
	if v.TaskId != nil {
		w, err = wire.NewValueI64(*(v.TaskId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 36, Value: w}
		i++
	}
	if v.WorkflowExecutionStartedEventAttributes != nil {
		w, err = v.WorkflowExecutionStartedEventAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 40, Value: w}
		i++
	}
	if v.WorkflowExecutionCompletedEventAttributes != nil {
		w, err = v.WorkflowExecutionCompletedEventAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 50, Value: w}
		i++
	}
	if v.WorkflowExecutionFailedEventAttributes != nil {
		w, err = v.WorkflowExecutionFailedEventAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 60, Value: w}
		i++
	}
	if v.WorkflowExecutionTimedOutEventAttributes != nil {
		w, err = v.WorkflowExecutionTimedOutEventAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 70, Value: w}
		i++
	}
	if v.DecisionTaskScheduledEventAttributes != nil {
		w, err = v.DecisionTaskScheduledEventAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 80, Value: w}
		i++
	}
	if v.DecisionTaskStartedEventAttributes != nil {
		w, err = v.DecisionTaskStartedEventAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 90, Value: w}
		i++
	}
	if v.DecisionTaskCompletedEventAttributes != nil {
		w, err = v.DecisionTaskCompletedEventAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 100, Value: w}
		i++
	}
	if v.DecisionTaskTimedOutEventAttributes != nil {
		w, err = v.DecisionTaskTimedOutEventAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 110, Value: w}
		i++
	}
	if v.DecisionTaskFailedEventAttributes != nil {
		w, err = v.DecisionTaskFailedEventAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 120, Value: w}
		i++
	}
	if v.ActivityTaskScheduledEventAttributes != nil {
		w, err = v.ActivityTaskScheduledEventAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 130, Value: w}
		i++
	}
	if v.ActivityTaskStartedEventAttributes != nil {
		w, err = v.ActivityTaskStartedEventAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 140, Value: w}
		i++
	}
	if v.ActivityTaskCompletedEventAttributes != nil {
		w, err = v.ActivityTaskCompletedEventAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 150, Value: w}
		i++
	}
	if v.ActivityTaskFailedEventAttributes != nil {
		w, err = v.ActivityTaskFailedEventAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 160, Value: w}
		i++
	}
	if v.ActivityTaskTimedOutEventAttributes != nil {
		w, err = v.ActivityTaskTimedOutEventAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 170, Value: w}
		i++
	}
	if v.TimerStartedEventAttributes != nil {
		w, err = v.TimerStartedEventAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 180, Value: w}
		i++
	}
	if v.TimerFiredEventAttributes != nil {
		w, err = v.TimerFiredEventAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 190, Value: w}
		i++
	}
	if v.ActivityTaskCancelRequestedEventAttributes != nil {
		w, err = v.ActivityTaskCancelRequestedEventAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 200, Value: w}
		i++
	}
	if v.RequestCancelActivityTaskFailedEventAttributes != nil {
		w, err = v.RequestCancelActivityTaskFailedEventAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 210, Value: w}
		i++
	}
	if v.ActivityTaskCanceledEventAttributes != nil {
		w, err = v.ActivityTaskCanceledEventAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 220, Value: w}
		i++
	}
	if v.TimerCanceledEventAttributes != nil {
		w, err = v.TimerCanceledEventAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 230, Value: w}
		i++
	}
	if v.CancelTimerFailedEventAttributes != nil {
		w, err = v.CancelTimerFailedEventAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 240, Value: w}
		i++
	}
	if v.MarkerRecordedEventAttributes != nil {
		w, err = v.MarkerRecordedEventAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 250, Value: w}
		i++
	}
	if v.WorkflowExecutionSignaledEventAttributes != nil {
		w, err = v.WorkflowExecutionSignaledEventAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 260, Value: w}
		i++
	}
	if v.WorkflowExecutionTerminatedEventAttributes != nil {
		w, err = v.WorkflowExecutionTerminatedEventAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 270, Value: w}
		i++
	}
	if v.WorkflowExecutionCancelRequestedEventAttributes != nil {
		w, err = v.WorkflowExecutionCancelRequestedEventAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 280, Value: w}
		i++
	}
	if v.WorkflowExecutionCanceledEventAttributes != nil {
		w, err = v.WorkflowExecutionCanceledEventAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 290, Value: w}
		i++
	}
	if v.RequestCancelExternalWorkflowExecutionInitiatedEventAttributes != nil {
		w, err = v.RequestCancelExternalWorkflowExecutionInitiatedEventAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 300, Value: w}
		i++
	}
	if v.RequestCancelExternalWorkflowExecutionFailedEventAttributes != nil {
		w, err = v.RequestCancelExternalWorkflowExecutionFailedEventAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 310, Value: w}
		i++
	}
	if v.ExternalWorkflowExecutionCancelRequestedEventAttributes != nil {
		w, err = v.ExternalWorkflowExecutionCancelRequestedEventAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 320, Value: w}
		i++
	}
	if v.WorkflowExecutionContinuedAsNewEventAttributes != nil {
		w, err = v.WorkflowExecutionContinuedAsNewEventAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 330, Value: w}
		i++
	}
	if v.StartChildWorkflowExecutionInitiatedEventAttributes != nil {
		w, err = v.StartChildWorkflowExecutionInitiatedEventAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 340, Value: w}
		i++
	}
	if v.StartChildWorkflowExecutionFailedEventAttributes != nil {
		w, err = v.StartChildWorkflowExecutionFailedEventAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 350, Value: w}
		i++
	}
	if v.ChildWorkflowExecutionStartedEventAttributes != nil {
		w, err = v.ChildWorkflowExecutionStartedEventAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 360, Value: w}
		i++
	}
	if v.ChildWorkflowExecutionCompletedEventAttributes != nil {
		w, err = v.ChildWorkflowExecutionCompletedEventAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 370, Value: w}
		i++
	}
	if v.ChildWorkflowExecutionFailedEventAttributes != nil {
		w, err = v.ChildWorkflowExecutionFailedEventAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 380, Value: w}
		i++
	}
	if v.ChildWorkflowExecutionCanceledEventAttributes != nil {
		w, err = v.ChildWorkflowExecutionCanceledEventAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 390, Value: w}
		i++
	}
	if v.ChildWorkflowExecutionTimedOutEventAttributes != nil {
		w, err = v.ChildWorkflowExecutionTimedOutEventAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 400, Value: w}
		i++
	}
	if v.ChildWorkflowExecutionTerminatedEventAttributes != nil {
		w, err = v.ChildWorkflowExecutionTerminatedEventAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 410, Value: w}
		i++
	}
	if v.SignalExternalWorkflowExecutionInitiatedEventAttributes != nil {
		w, err = v.SignalExternalWorkflowExecutionInitiatedEventAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 420, Value: w}
		i++
	}
	if v.SignalExternalWorkflowExecutionFailedEventAttributes != nil {
		w, err = v.SignalExternalWorkflowExecutionFailedEventAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 430, Value: w}
		i++
	}
	if v.ExternalWorkflowExecutionSignaledEventAttributes != nil {
		w, err = v.ExternalWorkflowExecutionSignaledEventAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 440, Value: w}
		i++
	}
	if v.UpsertWorkflowSearchAttributesEventAttributes != nil {
		w, err = v.UpsertWorkflowSearchAttributesEventAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 450, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

func _EventType_Read(w wire.Value) (EventType, error) {
	var v EventType
	err := v.FromWire(w)
	return v, err
}

func _WorkflowExecutionStartedEventAttributes_Read(w wire.Value) (*WorkflowExecutionStartedEventAttributes, error) {
	var v WorkflowExecutionStartedEventAttributes
	err := v.FromWire(w)
	return &v, err
}

func _WorkflowExecutionCompletedEventAttributes_Read(w wire.Value) (*WorkflowExecutionCompletedEventAttributes, error) {
	var v WorkflowExecutionCompletedEventAttributes
	err := v.FromWire(w)
	return &v, err
}

func _WorkflowExecutionFailedEventAttributes_Read(w wire.Value) (*WorkflowExecutionFailedEventAttributes, error) {
	var v WorkflowExecutionFailedEventAttributes
	err := v.FromWire(w)
	return &v, err
}

func _WorkflowExecutionTimedOutEventAttributes_Read(w wire.Value) (*WorkflowExecutionTimedOutEventAttributes, error) {
	var v WorkflowExecutionTimedOutEventAttributes
	err := v.FromWire(w)
	return &v, err
}

func _DecisionTaskScheduledEventAttributes_Read(w wire.Value) (*DecisionTaskScheduledEventAttributes, error) {
	var v DecisionTaskScheduledEventAttributes
	err := v.FromWire(w)
	return &v, err
}

func _DecisionTaskStartedEventAttributes_Read(w wire.Value) (*DecisionTaskStartedEventAttributes, error) {
	var v DecisionTaskStartedEventAttributes
	err := v.FromWire(w)
	return &v, err
}

func _DecisionTaskCompletedEventAttributes_Read(w wire.Value) (*DecisionTaskCompletedEventAttributes, error) {
	var v DecisionTaskCompletedEventAttributes
	err := v.FromWire(w)
	return &v, err
}

func _DecisionTaskTimedOutEventAttributes_Read(w wire.Value) (*DecisionTaskTimedOutEventAttributes, error) {
	var v DecisionTaskTimedOutEventAttributes
	err := v.FromWire(w)
	return &v, err
}

func _DecisionTaskFailedEventAttributes_Read(w wire.Value) (*DecisionTaskFailedEventAttributes, error) {
	var v DecisionTaskFailedEventAttributes
	err := v.FromWire(w)
	return &v, err
}

func _ActivityTaskScheduledEventAttributes_Read(w wire.Value) (*ActivityTaskScheduledEventAttributes, error) {
	var v ActivityTaskScheduledEventAttributes
	err := v.FromWire(w)
	return &v, err
}

func _ActivityTaskStartedEventAttributes_Read(w wire.Value) (*ActivityTaskStartedEventAttributes, error) {
	var v ActivityTaskStartedEventAttributes
	err := v.FromWire(w)
	return &v, err
}

func _ActivityTaskCompletedEventAttributes_Read(w wire.Value) (*ActivityTaskCompletedEventAttributes, error) {
	var v ActivityTaskCompletedEventAttributes
	err := v.FromWire(w)
	return &v, err
}

func _ActivityTaskFailedEventAttributes_Read(w wire.Value) (*ActivityTaskFailedEventAttributes, error) {
	var v ActivityTaskFailedEventAttributes
	err := v.FromWire(w)
	return &v, err
}

func _ActivityTaskTimedOutEventAttributes_Read(w wire.Value) (*ActivityTaskTimedOutEventAttributes, error) {
	var v ActivityTaskTimedOutEventAttributes
	err := v.FromWire(w)
	return &v, err
}

func _TimerStartedEventAttributes_Read(w wire.Value) (*TimerStartedEventAttributes, error) {
	var v TimerStartedEventAttributes
	err := v.FromWire(w)
	return &v, err
}

func _TimerFiredEventAttributes_Read(w wire.Value) (*TimerFiredEventAttributes, error) {
	var v TimerFiredEventAttributes
	err := v.FromWire(w)
	return &v, err
}

func _ActivityTaskCancelRequestedEventAttributes_Read(w wire.Value) (*ActivityTaskCancelRequestedEventAttributes, error) {
	var v ActivityTaskCancelRequestedEventAttributes
	err := v.FromWire(w)
	return &v, err
}

func _RequestCancelActivityTaskFailedEventAttributes_Read(w wire.Value) (*RequestCancelActivityTaskFailedEventAttributes, error) {
	var v RequestCancelActivityTaskFailedEventAttributes
	err := v.FromWire(w)
	return &v, err
}

func _ActivityTaskCanceledEventAttributes_Read(w wire.Value) (*ActivityTaskCanceledEventAttributes, error) {
	var v ActivityTaskCanceledEventAttributes
	err := v.FromWire(w)
	return &v, err
}

func _TimerCanceledEventAttributes_Read(w wire.Value) (*TimerCanceledEventAttributes, error) {
	var v TimerCanceledEventAttributes
	err := v.FromWire(w)
	return &v, err
}

func _CancelTimerFailedEventAttributes_Read(w wire.Value) (*CancelTimerFailedEventAttributes, error) {
	var v CancelTimerFailedEventAttributes
	err := v.FromWire(w)
	return &v, err
}

func _MarkerRecordedEventAttributes_Read(w wire.Value) (*MarkerRecordedEventAttributes, error) {
	var v MarkerRecordedEventAttributes
	err := v.FromWire(w)
	return &v, err
}

func _WorkflowExecutionSignaledEventAttributes_Read(w wire.Value) (*WorkflowExecutionSignaledEventAttributes, error) {
	var v WorkflowExecutionSignaledEventAttributes
	err := v.FromWire(w)
	return &v, err
}

func _WorkflowExecutionTerminatedEventAttributes_Read(w wire.Value) (*WorkflowExecutionTerminatedEventAttributes, error) {
	var v WorkflowExecutionTerminatedEventAttributes
	err := v.FromWire(w)
	return &v, err
}

func _WorkflowExecutionCancelRequestedEventAttributes_Read(w wire.Value) (*WorkflowExecutionCancelRequestedEventAttributes, error) {
	var v WorkflowExecutionCancelRequestedEventAttributes
	err := v.FromWire(w)
	return &v, err
}

func _WorkflowExecutionCanceledEventAttributes_Read(w wire.Value) (*WorkflowExecutionCanceledEventAttributes, error) {
	var v WorkflowExecutionCanceledEventAttributes
	err := v.FromWire(w)
	return &v, err
}

func _RequestCancelExternalWorkflowExecutionInitiatedEventAttributes_Read(w wire.Value) (*RequestCancelExternalWorkflowExecutionInitiatedEventAttributes, error) {
	var v RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
	err := v.FromWire(w)
	return &v, err
}

func _RequestCancelExternalWorkflowExecutionFailedEventAttributes_Read(w wire.Value) (*RequestCancelExternalWorkflowExecutionFailedEventAttributes, error) {
	var v RequestCancelExternalWorkflowExecutionFailedEventAttributes
	err := v.FromWire(w)
	return &v, err
}

func _ExternalWorkflowExecutionCancelRequestedEventAttributes_Read(w wire.Value) (*ExternalWorkflowExecutionCancelRequestedEventAttributes, error) {
	var v ExternalWorkflowExecutionCancelRequestedEventAttributes
	err := v.FromWire(w)
	return &v, err
}

func _WorkflowExecutionContinuedAsNewEventAttributes_Read(w wire.Value) (*WorkflowExecutionContinuedAsNewEventAttributes, error) {
	var v WorkflowExecutionContinuedAsNewEventAttributes
	err := v.FromWire(w)
	return &v, err
}

func _StartChildWorkflowExecutionFailedEventAttributes_Read(w wire.Value) (*StartChildWorkflowExecutionFailedEventAttributes, error) {
	var v StartChildWorkflowExecutionFailedEventAttributes
	err := v.FromWire(w)
	return &v, err
}

func _ChildWorkflowExecutionStartedEventAttributes_Read(w wire.Value) (*ChildWorkflowExecutionStartedEventAttributes, error) {
	var v ChildWorkflowExecutionStartedEventAttributes
	err := v.FromWire(w)
	return &v, err
}

func _ChildWorkflowExecutionCompletedEventAttributes_Read(w wire.Value) (*ChildWorkflowExecutionCompletedEventAttributes, error) {
	var v ChildWorkflowExecutionCompletedEventAttributes
	err := v.FromWire(w)
	return &v, err
}

func _ChildWorkflowExecutionFailedEventAttributes_Read(w wire.Value) (*ChildWorkflowExecutionFailedEventAttributes, error) {
	var v ChildWorkflowExecutionFailedEventAttributes
	err := v.FromWire(w)
	return &v, err
}

func _ChildWorkflowExecutionCanceledEventAttributes_Read(w wire.Value) (*ChildWorkflowExecutionCanceledEventAttributes, error) {
	var v ChildWorkflowExecutionCanceledEventAttributes
	err := v.FromWire(w)
	return &v, err
}

func _ChildWorkflowExecutionTimedOutEventAttributes_Read(w wire.Value) (*ChildWorkflowExecutionTimedOutEventAttributes, error) {
	var v ChildWorkflowExecutionTimedOutEventAttributes
	err := v.FromWire(w)
	return &v, err
}

func _ChildWorkflowExecutionTerminatedEventAttributes_Read(w wire.Value) (*ChildWorkflowExecutionTerminatedEventAttributes, error) {
	var v ChildWorkflowExecutionTerminatedEventAttributes
	err := v.FromWire(w)
	return &v, err
}

func _SignalExternalWorkflowExecutionInitiatedEventAttributes_Read(w wire.Value) (*SignalExternalWorkflowExecutionInitiatedEventAttributes, error) {
	var v SignalExternalWorkflowExecutionInitiatedEventAttributes
	err := v.FromWire(w)
	return &v, err
}

func _SignalExternalWorkflowExecutionFailedEventAttributes_Read(w wire.Value) (*SignalExternalWorkflowExecutionFailedEventAttributes, error) {
	var v SignalExternalWorkflowExecutionFailedEventAttributes
	err := v.FromWire(w)
	return &v, err
}

func _ExternalWorkflowExecutionSignaledEventAttributes_Read(w wire.Value) (*ExternalWorkflowExecutionSignaledEventAttributes, error) {
	var v ExternalWorkflowExecutionSignaledEventAttributes
	err := v.FromWire(w)
	return &v, err
}

func _UpsertWorkflowSearchAttributesEventAttributes_Read(w wire.Value) (*UpsertWorkflowSearchAttributesEventAttributes, error) {
	var v UpsertWorkflowSearchAttributesEventAttributes
	err := v.FromWire(w)
	return &v, err
}

// FromWire deserializes a HistoryEvent 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 HistoryEvent struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v HistoryEvent
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *HistoryEvent) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			if field.Value.Type() == wire.TI64 {
				var x int64
				x, err = field.Value.GetI64(), error(nil)
				v.EventId = &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.Timestamp = &x
				if err != nil {
					return err
				}

			}
		case 30:
			if field.Value.Type() == wire.TI32 {
				var x EventType
				x, err = _EventType_Read(field.Value)
				v.EventType = &x
				if err != nil {
					return err
				}

			}
		case 35:
			if field.Value.Type() == wire.TI64 {
				var x int64
				x, err = field.Value.GetI64(), error(nil)
				v.Version = &x
				if err != nil {
					return err
				}

			}
		case 36:
			if field.Value.Type() == wire.TI64 {
				var x int64
				x, err = field.Value.GetI64(), error(nil)
				v.TaskId = &x
				if err != nil {
					return err
				}

			}
		case 40:
			if field.Value.Type() == wire.TStruct {
				v.WorkflowExecutionStartedEventAttributes, err = _WorkflowExecutionStartedEventAttributes_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 50:
			if field.Value.Type() == wire.TStruct {
				v.WorkflowExecutionCompletedEventAttributes, err = _WorkflowExecutionCompletedEventAttributes_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 60:
			if field.Value.Type() == wire.TStruct {
				v.WorkflowExecutionFailedEventAttributes, err = _WorkflowExecutionFailedEventAttributes_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 70:
			if field.Value.Type() == wire.TStruct {
				v.WorkflowExecutionTimedOutEventAttributes, err = _WorkflowExecutionTimedOutEventAttributes_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 80:
			if field.Value.Type() == wire.TStruct {
				v.DecisionTaskScheduledEventAttributes, err = _DecisionTaskScheduledEventAttributes_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 90:
			if field.Value.Type() == wire.TStruct {
				v.DecisionTaskStartedEventAttributes, err = _DecisionTaskStartedEventAttributes_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 100:
			if field.Value.Type() == wire.TStruct {
				v.DecisionTaskCompletedEventAttributes, err = _DecisionTaskCompletedEventAttributes_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 110:
			if field.Value.Type() == wire.TStruct {
				v.DecisionTaskTimedOutEventAttributes, err = _DecisionTaskTimedOutEventAttributes_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 120:
			if field.Value.Type() == wire.TStruct {
				v.DecisionTaskFailedEventAttributes, err = _DecisionTaskFailedEventAttributes_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 130:
			if field.Value.Type() == wire.TStruct {
				v.ActivityTaskScheduledEventAttributes, err = _ActivityTaskScheduledEventAttributes_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 140:
			if field.Value.Type() == wire.TStruct {
				v.ActivityTaskStartedEventAttributes, err = _ActivityTaskStartedEventAttributes_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 150:
			if field.Value.Type() == wire.TStruct {
				v.ActivityTaskCompletedEventAttributes, err = _ActivityTaskCompletedEventAttributes_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 160:
			if field.Value.Type() == wire.TStruct {
				v.ActivityTaskFailedEventAttributes, err = _ActivityTaskFailedEventAttributes_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 170:
			if field.Value.Type() == wire.TStruct {
				v.ActivityTaskTimedOutEventAttributes, err = _ActivityTaskTimedOutEventAttributes_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 180:
			if field.Value.Type() == wire.TStruct {
				v.TimerStartedEventAttributes, err = _TimerStartedEventAttributes_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 190:
			if field.Value.Type() == wire.TStruct {
				v.TimerFiredEventAttributes, err = _TimerFiredEventAttributes_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 200:
			if field.Value.Type() == wire.TStruct {
				v.ActivityTaskCancelRequestedEventAttributes, err = _ActivityTaskCancelRequestedEventAttributes_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 210:
			if field.Value.Type() == wire.TStruct {
				v.RequestCancelActivityTaskFailedEventAttributes, err = _RequestCancelActivityTaskFailedEventAttributes_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 220:
			if field.Value.Type() == wire.TStruct {
				v.ActivityTaskCanceledEventAttributes, err = _ActivityTaskCanceledEventAttributes_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 230:
			if field.Value.Type() == wire.TStruct {
				v.TimerCanceledEventAttributes, err = _TimerCanceledEventAttributes_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 240:
			if field.Value.Type() == wire.TStruct {
				v.CancelTimerFailedEventAttributes, err = _CancelTimerFailedEventAttributes_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 250:
			if field.Value.Type() == wire.TStruct {
				v.MarkerRecordedEventAttributes, err = _MarkerRecordedEventAttributes_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 260:
			if field.Value.Type() == wire.TStruct {
				v.WorkflowExecutionSignaledEventAttributes, err = _WorkflowExecutionSignaledEventAttributes_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 270:
			if field.Value.Type() == wire.TStruct {
				v.WorkflowExecutionTerminatedEventAttributes, err = _WorkflowExecutionTerminatedEventAttributes_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 280:
			if field.Value.Type() == wire.TStruct {
				v.WorkflowExecutionCancelRequestedEventAttributes, err = _WorkflowExecutionCancelRequestedEventAttributes_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 290:
			if field.Value.Type() == wire.TStruct {
				v.WorkflowExecutionCanceledEventAttributes, err = _WorkflowExecutionCanceledEventAttributes_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 300:
			if field.Value.Type() == wire.TStruct {
				v.RequestCancelExternalWorkflowExecutionInitiatedEventAttributes, err = _RequestCancelExternalWorkflowExecutionInitiatedEventAttributes_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 310:
			if field.Value.Type() == wire.TStruct {
				v.RequestCancelExternalWorkflowExecutionFailedEventAttributes, err = _RequestCancelExternalWorkflowExecutionFailedEventAttributes_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 320:
			if field.Value.Type() == wire.TStruct {
				v.ExternalWorkflowExecutionCancelRequestedEventAttributes, err = _ExternalWorkflowExecutionCancelRequestedEventAttributes_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 330:
			if field.Value.Type() == wire.TStruct {
				v.WorkflowExecutionContinuedAsNewEventAttributes, err = _WorkflowExecutionContinuedAsNewEventAttributes_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 340:
			if field.Value.Type() == wire.TStruct {
				v.StartChildWorkflowExecutionInitiatedEventAttributes, err = _StartChildWorkflowExecutionInitiatedEventAttributes_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 350:
			if field.Value.Type() == wire.TStruct {
				v.StartChildWorkflowExecutionFailedEventAttributes, err = _StartChildWorkflowExecutionFailedEventAttributes_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 360:
			if field.Value.Type() == wire.TStruct {
				v.ChildWorkflowExecutionStartedEventAttributes, err = _ChildWorkflowExecutionStartedEventAttributes_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 370:
			if field.Value.Type() == wire.TStruct {
				v.ChildWorkflowExecutionCompletedEventAttributes, err = _ChildWorkflowExecutionCompletedEventAttributes_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 380:
			if field.Value.Type() == wire.TStruct {
				v.ChildWorkflowExecutionFailedEventAttributes, err = _ChildWorkflowExecutionFailedEventAttributes_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 390:
			if field.Value.Type() == wire.TStruct {
				v.ChildWorkflowExecutionCanceledEventAttributes, err = _ChildWorkflowExecutionCanceledEventAttributes_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 400:
			if field.Value.Type() == wire.TStruct {
				v.ChildWorkflowExecutionTimedOutEventAttributes, err = _ChildWorkflowExecutionTimedOutEventAttributes_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 410:
			if field.Value.Type() == wire.TStruct {
				v.ChildWorkflowExecutionTerminatedEventAttributes, err = _ChildWorkflowExecutionTerminatedEventAttributes_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 420:
			if field.Value.Type() == wire.TStruct {
				v.SignalExternalWorkflowExecutionInitiatedEventAttributes, err = _SignalExternalWorkflowExecutionInitiatedEventAttributes_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 430:
			if field.Value.Type() == wire.TStruct {
				v.SignalExternalWorkflowExecutionFailedEventAttributes, err = _SignalExternalWorkflowExecutionFailedEventAttributes_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 440:
			if field.Value.Type() == wire.TStruct {
				v.ExternalWorkflowExecutionSignaledEventAttributes, err = _ExternalWorkflowExecutionSignaledEventAttributes_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 450:
			if field.Value.Type() == wire.TStruct {
				v.UpsertWorkflowSearchAttributesEventAttributes, err = _UpsertWorkflowSearchAttributesEventAttributes_Read(field.Value)
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a HistoryEvent
// struct.
func (v *HistoryEvent) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [47]string
	i := 0
	if v.EventId != nil {
		fields[i] = fmt.Sprintf("EventId: %v", *(v.EventId))
		i++
	}
	if v.Timestamp != nil {
		fields[i] = fmt.Sprintf("Timestamp: %v", *(v.Timestamp))
		i++
	}
	if v.EventType != nil {
		fields[i] = fmt.Sprintf("EventType: %v", *(v.EventType))
		i++
	}
	if v.Version != nil {
		fields[i] = fmt.Sprintf("Version: %v", *(v.Version))
		i++
	}
	if v.TaskId != nil {
		fields[i] = fmt.Sprintf("TaskId: %v", *(v.TaskId))
		i++
	}
	if v.WorkflowExecutionStartedEventAttributes != nil {
		fields[i] = fmt.Sprintf("WorkflowExecutionStartedEventAttributes: %v", v.WorkflowExecutionStartedEventAttributes)
		i++
	}
	if v.WorkflowExecutionCompletedEventAttributes != nil {
		fields[i] = fmt.Sprintf("WorkflowExecutionCompletedEventAttributes: %v", v.WorkflowExecutionCompletedEventAttributes)
		i++
	}
	if v.WorkflowExecutionFailedEventAttributes != nil {
		fields[i] = fmt.Sprintf("WorkflowExecutionFailedEventAttributes: %v", v.WorkflowExecutionFailedEventAttributes)
		i++
	}
	if v.WorkflowExecutionTimedOutEventAttributes != nil {
		fields[i] = fmt.Sprintf("WorkflowExecutionTimedOutEventAttributes: %v", v.WorkflowExecutionTimedOutEventAttributes)
		i++
	}
	if v.DecisionTaskScheduledEventAttributes != nil {
		fields[i] = fmt.Sprintf("DecisionTaskScheduledEventAttributes: %v", v.DecisionTaskScheduledEventAttributes)
		i++
	}
	if v.DecisionTaskStartedEventAttributes != nil {
		fields[i] = fmt.Sprintf("DecisionTaskStartedEventAttributes: %v", v.DecisionTaskStartedEventAttributes)
		i++
	}
	if v.DecisionTaskCompletedEventAttributes != nil {
		fields[i] = fmt.Sprintf("DecisionTaskCompletedEventAttributes: %v", v.DecisionTaskCompletedEventAttributes)
		i++
	}
	if v.DecisionTaskTimedOutEventAttributes != nil {
		fields[i] = fmt.Sprintf("DecisionTaskTimedOutEventAttributes: %v", v.DecisionTaskTimedOutEventAttributes)
		i++
	}
	if v.DecisionTaskFailedEventAttributes != nil {
		fields[i] = fmt.Sprintf("DecisionTaskFailedEventAttributes: %v", v.DecisionTaskFailedEventAttributes)
		i++
	}
	if v.ActivityTaskScheduledEventAttributes != nil {
		fields[i] = fmt.Sprintf("ActivityTaskScheduledEventAttributes: %v", v.ActivityTaskScheduledEventAttributes)
		i++
	}
	if v.ActivityTaskStartedEventAttributes != nil {
		fields[i] = fmt.Sprintf("ActivityTaskStartedEventAttributes: %v", v.ActivityTaskStartedEventAttributes)
		i++
	}
	if v.ActivityTaskCompletedEventAttributes != nil {
		fields[i] = fmt.Sprintf("ActivityTaskCompletedEventAttributes: %v", v.ActivityTaskCompletedEventAttributes)
		i++
	}
	if v.ActivityTaskFailedEventAttributes != nil {
		fields[i] = fmt.Sprintf("ActivityTaskFailedEventAttributes: %v", v.ActivityTaskFailedEventAttributes)
		i++
	}
	if v.ActivityTaskTimedOutEventAttributes != nil {
		fields[i] = fmt.Sprintf("ActivityTaskTimedOutEventAttributes: %v", v.ActivityTaskTimedOutEventAttributes)
		i++
	}
	if v.TimerStartedEventAttributes != nil {
		fields[i] = fmt.Sprintf("TimerStartedEventAttributes: %v", v.TimerStartedEventAttributes)
		i++
	}
	if v.TimerFiredEventAttributes != nil {
		fields[i] = fmt.Sprintf("TimerFiredEventAttributes: %v", v.TimerFiredEventAttributes)
		i++
	}
	if v.ActivityTaskCancelRequestedEventAttributes != nil {
		fields[i] = fmt.Sprintf("ActivityTaskCancelRequestedEventAttributes: %v", v.ActivityTaskCancelRequestedEventAttributes)
		i++
	}
	if v.RequestCancelActivityTaskFailedEventAttributes != nil {
		fields[i] = fmt.Sprintf("RequestCancelActivityTaskFailedEventAttributes: %v", v.RequestCancelActivityTaskFailedEventAttributes)
		i++
	}
	if v.ActivityTaskCanceledEventAttributes != nil {
		fields[i] = fmt.Sprintf("ActivityTaskCanceledEventAttributes: %v", v.ActivityTaskCanceledEventAttributes)
		i++
	}
	if v.TimerCanceledEventAttributes != nil {
		fields[i] = fmt.Sprintf("TimerCanceledEventAttributes: %v", v.TimerCanceledEventAttributes)
		i++
	}
	if v.CancelTimerFailedEventAttributes != nil {
		fields[i] = fmt.Sprintf("CancelTimerFailedEventAttributes: %v", v.CancelTimerFailedEventAttributes)
		i++
	}
	if v.MarkerRecordedEventAttributes != nil {
		fields[i] = fmt.Sprintf("MarkerRecordedEventAttributes: %v", v.MarkerRecordedEventAttributes)
		i++
	}
	if v.WorkflowExecutionSignaledEventAttributes != nil {
		fields[i] = fmt.Sprintf("WorkflowExecutionSignaledEventAttributes: %v", v.WorkflowExecutionSignaledEventAttributes)
		i++
	}
	if v.WorkflowExecutionTerminatedEventAttributes != nil {
		fields[i] = fmt.Sprintf("WorkflowExecutionTerminatedEventAttributes: %v", v.WorkflowExecutionTerminatedEventAttributes)
		i++
	}
	if v.WorkflowExecutionCancelRequestedEventAttributes != nil {
		fields[i] = fmt.Sprintf("WorkflowExecutionCancelRequestedEventAttributes: %v", v.WorkflowExecutionCancelRequestedEventAttributes)
		i++
	}
	if v.WorkflowExecutionCanceledEventAttributes != nil {
		fields[i] = fmt.Sprintf("WorkflowExecutionCanceledEventAttributes: %v", v.WorkflowExecutionCanceledEventAttributes)
		i++
	}
	if v.RequestCancelExternalWorkflowExecutionInitiatedEventAttributes != nil {
		fields[i] = fmt.Sprintf("RequestCancelExternalWorkflowExecutionInitiatedEventAttributes: %v", v.RequestCancelExternalWorkflowExecutionInitiatedEventAttributes)
		i++
	}
	if v.RequestCancelExternalWorkflowExecutionFailedEventAttributes != nil {
		fields[i] = fmt.Sprintf("RequestCancelExternalWorkflowExecutionFailedEventAttributes: %v", v.RequestCancelExternalWorkflowExecutionFailedEventAttributes)
		i++
	}
	if v.ExternalWorkflowExecutionCancelRequestedEventAttributes != nil {
		fields[i] = fmt.Sprintf("ExternalWorkflowExecutionCancelRequestedEventAttributes: %v", v.ExternalWorkflowExecutionCancelRequestedEventAttributes)
		i++
	}
	if v.WorkflowExecutionContinuedAsNewEventAttributes != nil {
		fields[i] = fmt.Sprintf("WorkflowExecutionContinuedAsNewEventAttributes: %v", v.WorkflowExecutionContinuedAsNewEventAttributes)
		i++
	}
	if v.StartChildWorkflowExecutionInitiatedEventAttributes != nil {
		fields[i] = fmt.Sprintf("StartChildWorkflowExecutionInitiatedEventAttributes: %v", v.StartChildWorkflowExecutionInitiatedEventAttributes)
		i++
	}
	if v.StartChildWorkflowExecutionFailedEventAttributes != nil {
		fields[i] = fmt.Sprintf("StartChildWorkflowExecutionFailedEventAttributes: %v", v.StartChildWorkflowExecutionFailedEventAttributes)
		i++
	}
	if v.ChildWorkflowExecutionStartedEventAttributes != nil {
		fields[i] = fmt.Sprintf("ChildWorkflowExecutionStartedEventAttributes: %v", v.ChildWorkflowExecutionStartedEventAttributes)
		i++
	}
	if v.ChildWorkflowExecutionCompletedEventAttributes != nil {
		fields[i] = fmt.Sprintf("ChildWorkflowExecutionCompletedEventAttributes: %v", v.ChildWorkflowExecutionCompletedEventAttributes)
		i++
	}
	if v.ChildWorkflowExecutionFailedEventAttributes != nil {
		fields[i] = fmt.Sprintf("ChildWorkflowExecutionFailedEventAttributes: %v", v.ChildWorkflowExecutionFailedEventAttributes)
		i++
	}
	if v.ChildWorkflowExecutionCanceledEventAttributes != nil {
		fields[i] = fmt.Sprintf("ChildWorkflowExecutionCanceledEventAttributes: %v", v.ChildWorkflowExecutionCanceledEventAttributes)
		i++
	}
	if v.ChildWorkflowExecutionTimedOutEventAttributes != nil {
		fields[i] = fmt.Sprintf("ChildWorkflowExecutionTimedOutEventAttributes: %v", v.ChildWorkflowExecutionTimedOutEventAttributes)
		i++
	}
	if v.ChildWorkflowExecutionTerminatedEventAttributes != nil {
		fields[i] = fmt.Sprintf("ChildWorkflowExecutionTerminatedEventAttributes: %v", v.ChildWorkflowExecutionTerminatedEventAttributes)
		i++
	}
	if v.SignalExternalWorkflowExecutionInitiatedEventAttributes != nil {
		fields[i] = fmt.Sprintf("SignalExternalWorkflowExecutionInitiatedEventAttributes: %v", v.SignalExternalWorkflowExecutionInitiatedEventAttributes)
		i++
	}
	if v.SignalExternalWorkflowExecutionFailedEventAttributes != nil {
		fields[i] = fmt.Sprintf("SignalExternalWorkflowExecutionFailedEventAttributes: %v", v.SignalExternalWorkflowExecutionFailedEventAttributes)
		i++
	}
	if v.ExternalWorkflowExecutionSignaledEventAttributes != nil {
		fields[i] = fmt.Sprintf("ExternalWorkflowExecutionSignaledEventAttributes: %v", v.ExternalWorkflowExecutionSignaledEventAttributes)
		i++
	}
	if v.UpsertWorkflowSearchAttributesEventAttributes != nil {
		fields[i] = fmt.Sprintf("UpsertWorkflowSearchAttributesEventAttributes: %v", v.UpsertWorkflowSearchAttributesEventAttributes)
		i++
	}

	return fmt.Sprintf("HistoryEvent{%v}", strings.Join(fields[:i], ", "))
}

func _EventType_EqualsPtr(lhs, rhs *EventType) bool {
	if lhs != nil && rhs != nil {

		x := *lhs
		y := *rhs
		return x.Equals(y)
	}
	return lhs == nil && rhs == nil
}

// Equals returns true if all the fields of this HistoryEvent match the
// provided HistoryEvent.
//
// This function performs a deep comparison.
func (v *HistoryEvent) Equals(rhs *HistoryEvent) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_I64_EqualsPtr(v.EventId, rhs.EventId) {
		return false
	}
	if !_I64_EqualsPtr(v.Timestamp, rhs.Timestamp) {
		return false
	}
	if !_EventType_EqualsPtr(v.EventType, rhs.EventType) {
		return false
	}
	if !_I64_EqualsPtr(v.Version, rhs.Version) {
		return false
	}
	if !_I64_EqualsPtr(v.TaskId, rhs.TaskId) {
		return false
	}
	if !((v.WorkflowExecutionStartedEventAttributes == nil && rhs.WorkflowExecutionStartedEventAttributes == nil) || (v.WorkflowExecutionStartedEventAttributes != nil && rhs.WorkflowExecutionStartedEventAttributes != nil && v.WorkflowExecutionStartedEventAttributes.Equals(rhs.WorkflowExecutionStartedEventAttributes))) {
		return false
	}
	if !((v.WorkflowExecutionCompletedEventAttributes == nil && rhs.WorkflowExecutionCompletedEventAttributes == nil) || (v.WorkflowExecutionCompletedEventAttributes != nil && rhs.WorkflowExecutionCompletedEventAttributes != nil && v.WorkflowExecutionCompletedEventAttributes.Equals(rhs.WorkflowExecutionCompletedEventAttributes))) {
		return false
	}
	if !((v.WorkflowExecutionFailedEventAttributes == nil && rhs.WorkflowExecutionFailedEventAttributes == nil) || (v.WorkflowExecutionFailedEventAttributes != nil && rhs.WorkflowExecutionFailedEventAttributes != nil && v.WorkflowExecutionFailedEventAttributes.Equals(rhs.WorkflowExecutionFailedEventAttributes))) {
		return false
	}
	if !((v.WorkflowExecutionTimedOutEventAttributes == nil && rhs.WorkflowExecutionTimedOutEventAttributes == nil) || (v.WorkflowExecutionTimedOutEventAttributes != nil && rhs.WorkflowExecutionTimedOutEventAttributes != nil && v.WorkflowExecutionTimedOutEventAttributes.Equals(rhs.WorkflowExecutionTimedOutEventAttributes))) {
		return false
	}
	if !((v.DecisionTaskScheduledEventAttributes == nil && rhs.DecisionTaskScheduledEventAttributes == nil) || (v.DecisionTaskScheduledEventAttributes != nil && rhs.DecisionTaskScheduledEventAttributes != nil && v.DecisionTaskScheduledEventAttributes.Equals(rhs.DecisionTaskScheduledEventAttributes))) {
		return false
	}
	if !((v.DecisionTaskStartedEventAttributes == nil && rhs.DecisionTaskStartedEventAttributes == nil) || (v.DecisionTaskStartedEventAttributes != nil && rhs.DecisionTaskStartedEventAttributes != nil && v.DecisionTaskStartedEventAttributes.Equals(rhs.DecisionTaskStartedEventAttributes))) {
		return false
	}
	if !((v.DecisionTaskCompletedEventAttributes == nil && rhs.DecisionTaskCompletedEventAttributes == nil) || (v.DecisionTaskCompletedEventAttributes != nil && rhs.DecisionTaskCompletedEventAttributes != nil && v.DecisionTaskCompletedEventAttributes.Equals(rhs.DecisionTaskCompletedEventAttributes))) {
		return false
	}
	if !((v.DecisionTaskTimedOutEventAttributes == nil && rhs.DecisionTaskTimedOutEventAttributes == nil) || (v.DecisionTaskTimedOutEventAttributes != nil && rhs.DecisionTaskTimedOutEventAttributes != nil && v.DecisionTaskTimedOutEventAttributes.Equals(rhs.DecisionTaskTimedOutEventAttributes))) {
		return false
	}
	if !((v.DecisionTaskFailedEventAttributes == nil && rhs.DecisionTaskFailedEventAttributes == nil) || (v.DecisionTaskFailedEventAttributes != nil && rhs.DecisionTaskFailedEventAttributes != nil && v.DecisionTaskFailedEventAttributes.Equals(rhs.DecisionTaskFailedEventAttributes))) {
		return false
	}
	if !((v.ActivityTaskScheduledEventAttributes == nil && rhs.ActivityTaskScheduledEventAttributes == nil) || (v.ActivityTaskScheduledEventAttributes != nil && rhs.ActivityTaskScheduledEventAttributes != nil && v.ActivityTaskScheduledEventAttributes.Equals(rhs.ActivityTaskScheduledEventAttributes))) {
		return false
	}
	if !((v.ActivityTaskStartedEventAttributes == nil && rhs.ActivityTaskStartedEventAttributes == nil) || (v.ActivityTaskStartedEventAttributes != nil && rhs.ActivityTaskStartedEventAttributes != nil && v.ActivityTaskStartedEventAttributes.Equals(rhs.ActivityTaskStartedEventAttributes))) {
		return false
	}
	if !((v.ActivityTaskCompletedEventAttributes == nil && rhs.ActivityTaskCompletedEventAttributes == nil) || (v.ActivityTaskCompletedEventAttributes != nil && rhs.ActivityTaskCompletedEventAttributes != nil && v.ActivityTaskCompletedEventAttributes.Equals(rhs.ActivityTaskCompletedEventAttributes))) {
		return false
	}
	if !((v.ActivityTaskFailedEventAttributes == nil && rhs.ActivityTaskFailedEventAttributes == nil) || (v.ActivityTaskFailedEventAttributes != nil && rhs.ActivityTaskFailedEventAttributes != nil && v.ActivityTaskFailedEventAttributes.Equals(rhs.ActivityTaskFailedEventAttributes))) {
		return false
	}
	if !((v.ActivityTaskTimedOutEventAttributes == nil && rhs.ActivityTaskTimedOutEventAttributes == nil) || (v.ActivityTaskTimedOutEventAttributes != nil && rhs.ActivityTaskTimedOutEventAttributes != nil && v.ActivityTaskTimedOutEventAttributes.Equals(rhs.ActivityTaskTimedOutEventAttributes))) {
		return false
	}
	if !((v.TimerStartedEventAttributes == nil && rhs.TimerStartedEventAttributes == nil) || (v.TimerStartedEventAttributes != nil && rhs.TimerStartedEventAttributes != nil && v.TimerStartedEventAttributes.Equals(rhs.TimerStartedEventAttributes))) {
		return false
	}
	if !((v.TimerFiredEventAttributes == nil && rhs.TimerFiredEventAttributes == nil) || (v.TimerFiredEventAttributes != nil && rhs.TimerFiredEventAttributes != nil && v.TimerFiredEventAttributes.Equals(rhs.TimerFiredEventAttributes))) {
		return false
	}
	if !((v.ActivityTaskCancelRequestedEventAttributes == nil && rhs.ActivityTaskCancelRequestedEventAttributes == nil) || (v.ActivityTaskCancelRequestedEventAttributes != nil && rhs.ActivityTaskCancelRequestedEventAttributes != nil && v.ActivityTaskCancelRequestedEventAttributes.Equals(rhs.ActivityTaskCancelRequestedEventAttributes))) {
		return false
	}
	if !((v.RequestCancelActivityTaskFailedEventAttributes == nil && rhs.RequestCancelActivityTaskFailedEventAttributes == nil) || (v.RequestCancelActivityTaskFailedEventAttributes != nil && rhs.RequestCancelActivityTaskFailedEventAttributes != nil && v.RequestCancelActivityTaskFailedEventAttributes.Equals(rhs.RequestCancelActivityTaskFailedEventAttributes))) {
		return false
	}
	if !((v.ActivityTaskCanceledEventAttributes == nil && rhs.ActivityTaskCanceledEventAttributes == nil) || (v.ActivityTaskCanceledEventAttributes != nil && rhs.ActivityTaskCanceledEventAttributes != nil && v.ActivityTaskCanceledEventAttributes.Equals(rhs.ActivityTaskCanceledEventAttributes))) {
		return false
	}
	if !((v.TimerCanceledEventAttributes == nil && rhs.TimerCanceledEventAttributes == nil) || (v.TimerCanceledEventAttributes != nil && rhs.TimerCanceledEventAttributes != nil && v.TimerCanceledEventAttributes.Equals(rhs.TimerCanceledEventAttributes))) {
		return false
	}
	if !((v.CancelTimerFailedEventAttributes == nil && rhs.CancelTimerFailedEventAttributes == nil) || (v.CancelTimerFailedEventAttributes != nil && rhs.CancelTimerFailedEventAttributes != nil && v.CancelTimerFailedEventAttributes.Equals(rhs.CancelTimerFailedEventAttributes))) {
		return false
	}
	if !((v.MarkerRecordedEventAttributes == nil && rhs.MarkerRecordedEventAttributes == nil) || (v.MarkerRecordedEventAttributes != nil && rhs.MarkerRecordedEventAttributes != nil && v.MarkerRecordedEventAttributes.Equals(rhs.MarkerRecordedEventAttributes))) {
		return false
	}
	if !((v.WorkflowExecutionSignaledEventAttributes == nil && rhs.WorkflowExecutionSignaledEventAttributes == nil) || (v.WorkflowExecutionSignaledEventAttributes != nil && rhs.WorkflowExecutionSignaledEventAttributes != nil && v.WorkflowExecutionSignaledEventAttributes.Equals(rhs.WorkflowExecutionSignaledEventAttributes))) {
		return false
	}
	if !((v.WorkflowExecutionTerminatedEventAttributes == nil && rhs.WorkflowExecutionTerminatedEventAttributes == nil) || (v.WorkflowExecutionTerminatedEventAttributes != nil && rhs.WorkflowExecutionTerminatedEventAttributes != nil && v.WorkflowExecutionTerminatedEventAttributes.Equals(rhs.WorkflowExecutionTerminatedEventAttributes))) {
		return false
	}
	if !((v.WorkflowExecutionCancelRequestedEventAttributes == nil && rhs.WorkflowExecutionCancelRequestedEventAttributes == nil) || (v.WorkflowExecutionCancelRequestedEventAttributes != nil && rhs.WorkflowExecutionCancelRequestedEventAttributes != nil && v.WorkflowExecutionCancelRequestedEventAttributes.Equals(rhs.WorkflowExecutionCancelRequestedEventAttributes))) {
		return false
	}
	if !((v.WorkflowExecutionCanceledEventAttributes == nil && rhs.WorkflowExecutionCanceledEventAttributes == nil) || (v.WorkflowExecutionCanceledEventAttributes != nil && rhs.WorkflowExecutionCanceledEventAttributes != nil && v.WorkflowExecutionCanceledEventAttributes.Equals(rhs.WorkflowExecutionCanceledEventAttributes))) {
		return false
	}
	if !((v.RequestCancelExternalWorkflowExecutionInitiatedEventAttributes == nil && rhs.RequestCancelExternalWorkflowExecutionInitiatedEventAttributes == nil) || (v.RequestCancelExternalWorkflowExecutionInitiatedEventAttributes != nil && rhs.RequestCancelExternalWorkflowExecutionInitiatedEventAttributes != nil && v.RequestCancelExternalWorkflowExecutionInitiatedEventAttributes.Equals(rhs.RequestCancelExternalWorkflowExecutionInitiatedEventAttributes))) {
		return false
	}
	if !((v.RequestCancelExternalWorkflowExecutionFailedEventAttributes == nil && rhs.RequestCancelExternalWorkflowExecutionFailedEventAttributes == nil) || (v.RequestCancelExternalWorkflowExecutionFailedEventAttributes != nil && rhs.RequestCancelExternalWorkflowExecutionFailedEventAttributes != nil && v.RequestCancelExternalWorkflowExecutionFailedEventAttributes.Equals(rhs.RequestCancelExternalWorkflowExecutionFailedEventAttributes))) {
		return false
	}
	if !((v.ExternalWorkflowExecutionCancelRequestedEventAttributes == nil && rhs.ExternalWorkflowExecutionCancelRequestedEventAttributes == nil) || (v.ExternalWorkflowExecutionCancelRequestedEventAttributes != nil && rhs.ExternalWorkflowExecutionCancelRequestedEventAttributes != nil && v.ExternalWorkflowExecutionCancelRequestedEventAttributes.Equals(rhs.ExternalWorkflowExecutionCancelRequestedEventAttributes))) {
		return false
	}
	if !((v.WorkflowExecutionContinuedAsNewEventAttributes == nil && rhs.WorkflowExecutionContinuedAsNewEventAttributes == nil) || (v.WorkflowExecutionContinuedAsNewEventAttributes != nil && rhs.WorkflowExecutionContinuedAsNewEventAttributes != nil && v.WorkflowExecutionContinuedAsNewEventAttributes.Equals(rhs.WorkflowExecutionContinuedAsNewEventAttributes))) {
		return false
	}
	if !((v.StartChildWorkflowExecutionInitiatedEventAttributes == nil && rhs.StartChildWorkflowExecutionInitiatedEventAttributes == nil) || (v.StartChildWorkflowExecutionInitiatedEventAttributes != nil && rhs.StartChildWorkflowExecutionInitiatedEventAttributes != nil && v.StartChildWorkflowExecutionInitiatedEventAttributes.Equals(rhs.StartChildWorkflowExecutionInitiatedEventAttributes))) {
		return false
	}
	if !((v.StartChildWorkflowExecutionFailedEventAttributes == nil && rhs.StartChildWorkflowExecutionFailedEventAttributes == nil) || (v.StartChildWorkflowExecutionFailedEventAttributes != nil && rhs.StartChildWorkflowExecutionFailedEventAttributes != nil && v.StartChildWorkflowExecutionFailedEventAttributes.Equals(rhs.StartChildWorkflowExecutionFailedEventAttributes))) {
		return false
	}
	if !((v.ChildWorkflowExecutionStartedEventAttributes == nil && rhs.ChildWorkflowExecutionStartedEventAttributes == nil) || (v.ChildWorkflowExecutionStartedEventAttributes != nil && rhs.ChildWorkflowExecutionStartedEventAttributes != nil && v.ChildWorkflowExecutionStartedEventAttributes.Equals(rhs.ChildWorkflowExecutionStartedEventAttributes))) {
		return false
	}
	if !((v.ChildWorkflowExecutionCompletedEventAttributes == nil && rhs.ChildWorkflowExecutionCompletedEventAttributes == nil) || (v.ChildWorkflowExecutionCompletedEventAttributes != nil && rhs.ChildWorkflowExecutionCompletedEventAttributes != nil && v.ChildWorkflowExecutionCompletedEventAttributes.Equals(rhs.ChildWorkflowExecutionCompletedEventAttributes))) {
		return false
	}
	if !((v.ChildWorkflowExecutionFailedEventAttributes == nil && rhs.ChildWorkflowExecutionFailedEventAttributes == nil) || (v.ChildWorkflowExecutionFailedEventAttributes != nil && rhs.ChildWorkflowExecutionFailedEventAttributes != nil && v.ChildWorkflowExecutionFailedEventAttributes.Equals(rhs.ChildWorkflowExecutionFailedEventAttributes))) {
		return false
	}
	if !((v.ChildWorkflowExecutionCanceledEventAttributes == nil && rhs.ChildWorkflowExecutionCanceledEventAttributes == nil) || (v.ChildWorkflowExecutionCanceledEventAttributes != nil && rhs.ChildWorkflowExecutionCanceledEventAttributes != nil && v.ChildWorkflowExecutionCanceledEventAttributes.Equals(rhs.ChildWorkflowExecutionCanceledEventAttributes))) {
		return false
	}
	if !((v.ChildWorkflowExecutionTimedOutEventAttributes == nil && rhs.ChildWorkflowExecutionTimedOutEventAttributes == nil) || (v.ChildWorkflowExecutionTimedOutEventAttributes != nil && rhs.ChildWorkflowExecutionTimedOutEventAttributes != nil && v.ChildWorkflowExecutionTimedOutEventAttributes.Equals(rhs.ChildWorkflowExecutionTimedOutEventAttributes))) {
		return false
	}
	if !((v.ChildWorkflowExecutionTerminatedEventAttributes == nil && rhs.ChildWorkflowExecutionTerminatedEventAttributes == nil) || (v.ChildWorkflowExecutionTerminatedEventAttributes != nil && rhs.ChildWorkflowExecutionTerminatedEventAttributes != nil && v.ChildWorkflowExecutionTerminatedEventAttributes.Equals(rhs.ChildWorkflowExecutionTerminatedEventAttributes))) {
		return false
	}
	if !((v.SignalExternalWorkflowExecutionInitiatedEventAttributes == nil && rhs.SignalExternalWorkflowExecutionInitiatedEventAttributes == nil) || (v.SignalExternalWorkflowExecutionInitiatedEventAttributes != nil && rhs.SignalExternalWorkflowExecutionInitiatedEventAttributes != nil && v.SignalExternalWorkflowExecutionInitiatedEventAttributes.Equals(rhs.SignalExternalWorkflowExecutionInitiatedEventAttributes))) {
		return false
	}
	if !((v.SignalExternalWorkflowExecutionFailedEventAttributes == nil && rhs.SignalExternalWorkflowExecutionFailedEventAttributes == nil) || (v.SignalExternalWorkflowExecutionFailedEventAttributes != nil && rhs.SignalExternalWorkflowExecutionFailedEventAttributes != nil && v.SignalExternalWorkflowExecutionFailedEventAttributes.Equals(rhs.SignalExternalWorkflowExecutionFailedEventAttributes))) {
		return false
	}
	if !((v.ExternalWorkflowExecutionSignaledEventAttributes == nil && rhs.ExternalWorkflowExecutionSignaledEventAttributes == nil) || (v.ExternalWorkflowExecutionSignaledEventAttributes != nil && rhs.ExternalWorkflowExecutionSignaledEventAttributes != nil && v.ExternalWorkflowExecutionSignaledEventAttributes.Equals(rhs.ExternalWorkflowExecutionSignaledEventAttributes))) {
		return false
	}
	if !((v.UpsertWorkflowSearchAttributesEventAttributes == nil && rhs.UpsertWorkflowSearchAttributesEventAttributes == nil) || (v.UpsertWorkflowSearchAttributesEventAttributes != nil && rhs.UpsertWorkflowSearchAttributesEventAttributes != nil && v.UpsertWorkflowSearchAttributesEventAttributes.Equals(rhs.UpsertWorkflowSearchAttributesEventAttributes))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of HistoryEvent.
func (v *HistoryEvent) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.EventId != nil {
		enc.AddInt64("eventId", *v.EventId)
	}
	if v.Timestamp != nil {
		enc.AddInt64("timestamp", *v.Timestamp)
	}
	if v.EventType != nil {
		err = multierr.Append(err, enc.AddObject("eventType", *v.EventType))
	}
	if v.Version != nil {
		enc.AddInt64("version", *v.Version)
	}
	if v.TaskId != nil {
		enc.AddInt64("taskId", *v.TaskId)
	}
	if v.WorkflowExecutionStartedEventAttributes != nil {
		err = multierr.Append(err, enc.AddObject("workflowExecutionStartedEventAttributes", v.WorkflowExecutionStartedEventAttributes))
	}
	if v.WorkflowExecutionCompletedEventAttributes != nil {
		err = multierr.Append(err, enc.AddObject("workflowExecutionCompletedEventAttributes", v.WorkflowExecutionCompletedEventAttributes))
	}
	if v.WorkflowExecutionFailedEventAttributes != nil {
		err = multierr.Append(err, enc.AddObject("workflowExecutionFailedEventAttributes", v.WorkflowExecutionFailedEventAttributes))
	}
	if v.WorkflowExecutionTimedOutEventAttributes != nil {
		err = multierr.Append(err, enc.AddObject("workflowExecutionTimedOutEventAttributes", v.WorkflowExecutionTimedOutEventAttributes))
	}
	if v.DecisionTaskScheduledEventAttributes != nil {
		err = multierr.Append(err, enc.AddObject("decisionTaskScheduledEventAttributes", v.DecisionTaskScheduledEventAttributes))
	}
	if v.DecisionTaskStartedEventAttributes != nil {
		err = multierr.Append(err, enc.AddObject("decisionTaskStartedEventAttributes", v.DecisionTaskStartedEventAttributes))
	}
	if v.DecisionTaskCompletedEventAttributes != nil {
		err = multierr.Append(err, enc.AddObject("decisionTaskCompletedEventAttributes", v.DecisionTaskCompletedEventAttributes))
	}
	if v.DecisionTaskTimedOutEventAttributes != nil {
		err = multierr.Append(err, enc.AddObject("decisionTaskTimedOutEventAttributes", v.DecisionTaskTimedOutEventAttributes))
	}
	if v.DecisionTaskFailedEventAttributes != nil {
		err = multierr.Append(err, enc.AddObject("decisionTaskFailedEventAttributes", v.DecisionTaskFailedEventAttributes))
	}
	if v.ActivityTaskScheduledEventAttributes != nil {
		err = multierr.Append(err, enc.AddObject("activityTaskScheduledEventAttributes", v.ActivityTaskScheduledEventAttributes))
	}
	if v.ActivityTaskStartedEventAttributes != nil {
		err = multierr.Append(err, enc.AddObject("activityTaskStartedEventAttributes", v.ActivityTaskStartedEventAttributes))
	}
	if v.ActivityTaskCompletedEventAttributes != nil {
		err = multierr.Append(err, enc.AddObject("activityTaskCompletedEventAttributes", v.ActivityTaskCompletedEventAttributes))
	}
	if v.ActivityTaskFailedEventAttributes != nil {
		err = multierr.Append(err, enc.AddObject("activityTaskFailedEventAttributes", v.ActivityTaskFailedEventAttributes))
	}
	if v.ActivityTaskTimedOutEventAttributes != nil {
		err = multierr.Append(err, enc.AddObject("activityTaskTimedOutEventAttributes", v.ActivityTaskTimedOutEventAttributes))
	}
	if v.TimerStartedEventAttributes != nil {
		err = multierr.Append(err, enc.AddObject("timerStartedEventAttributes", v.TimerStartedEventAttributes))
	}
	if v.TimerFiredEventAttributes != nil {
		err = multierr.Append(err, enc.AddObject("timerFiredEventAttributes", v.TimerFiredEventAttributes))
	}
	if v.ActivityTaskCancelRequestedEventAttributes != nil {
		err = multierr.Append(err, enc.AddObject("activityTaskCancelRequestedEventAttributes", v.ActivityTaskCancelRequestedEventAttributes))
	}
	if v.RequestCancelActivityTaskFailedEventAttributes != nil {
		err = multierr.Append(err, enc.AddObject("requestCancelActivityTaskFailedEventAttributes", v.RequestCancelActivityTaskFailedEventAttributes))
	}
	if v.ActivityTaskCanceledEventAttributes != nil {
		err = multierr.Append(err, enc.AddObject("activityTaskCanceledEventAttributes", v.ActivityTaskCanceledEventAttributes))
	}
	if v.TimerCanceledEventAttributes != nil {
		err = multierr.Append(err, enc.AddObject("timerCanceledEventAttributes", v.TimerCanceledEventAttributes))
	}
	if v.CancelTimerFailedEventAttributes != nil {
		err = multierr.Append(err, enc.AddObject("cancelTimerFailedEventAttributes", v.CancelTimerFailedEventAttributes))
	}
	if v.MarkerRecordedEventAttributes != nil {
		err = multierr.Append(err, enc.AddObject("markerRecordedEventAttributes", v.MarkerRecordedEventAttributes))
	}
	if v.WorkflowExecutionSignaledEventAttributes != nil {
		err = multierr.Append(err, enc.AddObject("workflowExecutionSignaledEventAttributes", v.WorkflowExecutionSignaledEventAttributes))
	}
	if v.WorkflowExecutionTerminatedEventAttributes != nil {
		err = multierr.Append(err, enc.AddObject("workflowExecutionTerminatedEventAttributes", v.WorkflowExecutionTerminatedEventAttributes))
	}
	if v.WorkflowExecutionCancelRequestedEventAttributes != nil {
		err = multierr.Append(err, enc.AddObject("workflowExecutionCancelRequestedEventAttributes", v.WorkflowExecutionCancelRequestedEventAttributes))
	}
	if v.WorkflowExecutionCanceledEventAttributes != nil {
		err = multierr.Append(err, enc.AddObject("workflowExecutionCanceledEventAttributes", v.WorkflowExecutionCanceledEventAttributes))
	}
	if v.RequestCancelExternalWorkflowExecutionInitiatedEventAttributes != nil {
		err = multierr.Append(err, enc.AddObject("requestCancelExternalWorkflowExecutionInitiatedEventAttributes", v.RequestCancelExternalWorkflowExecutionInitiatedEventAttributes))
	}
	if v.RequestCancelExternalWorkflowExecutionFailedEventAttributes != nil {
		err = multierr.Append(err, enc.AddObject("requestCancelExternalWorkflowExecutionFailedEventAttributes", v.RequestCancelExternalWorkflowExecutionFailedEventAttributes))
	}
	if v.ExternalWorkflowExecutionCancelRequestedEventAttributes != nil {
		err = multierr.Append(err, enc.AddObject("externalWorkflowExecutionCancelRequestedEventAttributes", v.ExternalWorkflowExecutionCancelRequestedEventAttributes))
	}
	if v.WorkflowExecutionContinuedAsNewEventAttributes != nil {
		err = multierr.Append(err, enc.AddObject("workflowExecutionContinuedAsNewEventAttributes", v.WorkflowExecutionContinuedAsNewEventAttributes))
	}
	if v.StartChildWorkflowExecutionInitiatedEventAttributes != nil {
		err = multierr.Append(err, enc.AddObject("startChildWorkflowExecutionInitiatedEventAttributes", v.StartChildWorkflowExecutionInitiatedEventAttributes))
	}
	if v.StartChildWorkflowExecutionFailedEventAttributes != nil {
		err = multierr.Append(err, enc.AddObject("startChildWorkflowExecutionFailedEventAttributes", v.StartChildWorkflowExecutionFailedEventAttributes))
	}
	if v.ChildWorkflowExecutionStartedEventAttributes != nil {
		err = multierr.Append(err, enc.AddObject("childWorkflowExecutionStartedEventAttributes", v.ChildWorkflowExecutionStartedEventAttributes))
	}
	if v.ChildWorkflowExecutionCompletedEventAttributes != nil {
		err = multierr.Append(err, enc.AddObject("childWorkflowExecutionCompletedEventAttributes", v.ChildWorkflowExecutionCompletedEventAttributes))
	}
	if v.ChildWorkflowExecutionFailedEventAttributes != nil {
		err = multierr.Append(err, enc.AddObject("childWorkflowExecutionFailedEventAttributes", v.ChildWorkflowExecutionFailedEventAttributes))
	}
	if v.ChildWorkflowExecutionCanceledEventAttributes != nil {
		err = multierr.Append(err, enc.AddObject("childWorkflowExecutionCanceledEventAttributes", v.ChildWorkflowExecutionCanceledEventAttributes))
	}
	if v.ChildWorkflowExecutionTimedOutEventAttributes != nil {
		err = multierr.Append(err, enc.AddObject("childWorkflowExecutionTimedOutEventAttributes", v.ChildWorkflowExecutionTimedOutEventAttributes))
	}
	if v.ChildWorkflowExecutionTerminatedEventAttributes != nil {
		err = multierr.Append(err, enc.AddObject("childWorkflowExecutionTerminatedEventAttributes", v.ChildWorkflowExecutionTerminatedEventAttributes))
	}
	if v.SignalExternalWorkflowExecutionInitiatedEventAttributes != nil {
		err = multierr.Append(err, enc.AddObject("signalExternalWorkflowExecutionInitiatedEventAttributes", v.SignalExternalWorkflowExecutionInitiatedEventAttributes))
	}
	if v.SignalExternalWorkflowExecutionFailedEventAttributes != nil {
		err = multierr.Append(err, enc.AddObject("signalExternalWorkflowExecutionFailedEventAttributes", v.SignalExternalWorkflowExecutionFailedEventAttributes))
	}
	if v.ExternalWorkflowExecutionSignaledEventAttributes != nil {
		err = multierr.Append(err, enc.AddObject("externalWorkflowExecutionSignaledEventAttributes", v.ExternalWorkflowExecutionSignaledEventAttributes))
	}
	if v.UpsertWorkflowSearchAttributesEventAttributes != nil {
		err = multierr.Append(err, enc.AddObject("upsertWorkflowSearchAttributesEventAttributes", v.UpsertWorkflowSearchAttributesEventAttributes))
	}
	return err
}

// GetEventId returns the value of EventId if it is set or its
// zero value if it is unset.
func (v *HistoryEvent) GetEventId() (o int64) {
	if v != nil && v.EventId != nil {
		return *v.EventId
	}

	return
}

// IsSetEventId returns true if EventId is not nil.
func (v *HistoryEvent) IsSetEventId() bool {
	return v != nil && v.EventId != nil
}

// GetTimestamp returns the value of Timestamp if it is set or its
// zero value if it is unset.
func (v *HistoryEvent) GetTimestamp() (o int64) {
	if v != nil && v.Timestamp != nil {
		return *v.Timestamp
	}

	return
}

// IsSetTimestamp returns true if Timestamp is not nil.
func (v *HistoryEvent) IsSetTimestamp() bool {
	return v != nil && v.Timestamp != nil
}

// GetEventType returns the value of EventType if it is set or its
// zero value if it is unset.
func (v *HistoryEvent) GetEventType() (o EventType) {
	if v != nil && v.EventType != nil {
		return *v.EventType
	}

	return
}

// IsSetEventType returns true if EventType is not nil.
func (v *HistoryEvent) IsSetEventType() bool {
	return v != nil && v.EventType != nil
}

// GetVersion returns the value of Version if it is set or its
// zero value if it is unset.
func (v *HistoryEvent) GetVersion() (o int64) {
	if v != nil && v.Version != nil {
		return *v.Version
	}

	return
}

// IsSetVersion returns true if Version is not nil.
func (v *HistoryEvent) IsSetVersion() bool {
	return v != nil && v.Version != nil
}

// GetTaskId returns the value of TaskId if it is set or its
// zero value if it is unset.
func (v *HistoryEvent) GetTaskId() (o int64) {
	if v != nil && v.TaskId != nil {
		return *v.TaskId
	}

	return
}

// IsSetTaskId returns true if TaskId is not nil.
func (v *HistoryEvent) IsSetTaskId() bool {
	return v != nil && v.TaskId != nil
}

// GetWorkflowExecutionStartedEventAttributes returns the value of WorkflowExecutionStartedEventAttributes if it is set or its
// zero value if it is unset.
func (v *HistoryEvent) GetWorkflowExecutionStartedEventAttributes() (o *WorkflowExecutionStartedEventAttributes) {
	if v != nil && v.WorkflowExecutionStartedEventAttributes != nil {
		return v.WorkflowExecutionStartedEventAttributes
	}

	return
}

// IsSetWorkflowExecutionStartedEventAttributes returns true if WorkflowExecutionStartedEventAttributes is not nil.
func (v *HistoryEvent) IsSetWorkflowExecutionStartedEventAttributes() bool {
	return v != nil && v.WorkflowExecutionStartedEventAttributes != nil
}

// GetWorkflowExecutionCompletedEventAttributes returns the value of WorkflowExecutionCompletedEventAttributes if it is set or its
// zero value if it is unset.
func (v *HistoryEvent) GetWorkflowExecutionCompletedEventAttributes() (o *WorkflowExecutionCompletedEventAttributes) {
	if v != nil && v.WorkflowExecutionCompletedEventAttributes != nil {
		return v.WorkflowExecutionCompletedEventAttributes
	}

	return
}

// IsSetWorkflowExecutionCompletedEventAttributes returns true if WorkflowExecutionCompletedEventAttributes is not nil.
func (v *HistoryEvent) IsSetWorkflowExecutionCompletedEventAttributes() bool {
	return v != nil && v.WorkflowExecutionCompletedEventAttributes != nil
}

// GetWorkflowExecutionFailedEventAttributes returns the value of WorkflowExecutionFailedEventAttributes if it is set or its
// zero value if it is unset.
func (v *HistoryEvent) GetWorkflowExecutionFailedEventAttributes() (o *WorkflowExecutionFailedEventAttributes) {
	if v != nil && v.WorkflowExecutionFailedEventAttributes != nil {
		return v.WorkflowExecutionFailedEventAttributes
	}

	return
}

// IsSetWorkflowExecutionFailedEventAttributes returns true if WorkflowExecutionFailedEventAttributes is not nil.
func (v *HistoryEvent) IsSetWorkflowExecutionFailedEventAttributes() bool {
	return v != nil && v.WorkflowExecutionFailedEventAttributes != nil
}

// GetWorkflowExecutionTimedOutEventAttributes returns the value of WorkflowExecutionTimedOutEventAttributes if it is set or its
// zero value if it is unset.
func (v *HistoryEvent) GetWorkflowExecutionTimedOutEventAttributes() (o *WorkflowExecutionTimedOutEventAttributes) {
	if v != nil && v.WorkflowExecutionTimedOutEventAttributes != nil {
		return v.WorkflowExecutionTimedOutEventAttributes
	}

	return
}

// IsSetWorkflowExecutionTimedOutEventAttributes returns true if WorkflowExecutionTimedOutEventAttributes is not nil.
func (v *HistoryEvent) IsSetWorkflowExecutionTimedOutEventAttributes() bool {
	return v != nil && v.WorkflowExecutionTimedOutEventAttributes != nil
}

// GetDecisionTaskScheduledEventAttributes returns the value of DecisionTaskScheduledEventAttributes if it is set or its
// zero value if it is unset.
func (v *HistoryEvent) GetDecisionTaskScheduledEventAttributes() (o *DecisionTaskScheduledEventAttributes) {
	if v != nil && v.DecisionTaskScheduledEventAttributes != nil {
		return v.DecisionTaskScheduledEventAttributes
	}

	return
}

// IsSetDecisionTaskScheduledEventAttributes returns true if DecisionTaskScheduledEventAttributes is not nil.
func (v *HistoryEvent) IsSetDecisionTaskScheduledEventAttributes() bool {
	return v != nil && v.DecisionTaskScheduledEventAttributes != nil
}

// GetDecisionTaskStartedEventAttributes returns the value of DecisionTaskStartedEventAttributes if it is set or its
// zero value if it is unset.
func (v *HistoryEvent) GetDecisionTaskStartedEventAttributes() (o *DecisionTaskStartedEventAttributes) {
	if v != nil && v.DecisionTaskStartedEventAttributes != nil {
		return v.DecisionTaskStartedEventAttributes
	}

	return
}

// IsSetDecisionTaskStartedEventAttributes returns true if DecisionTaskStartedEventAttributes is not nil.
func (v *HistoryEvent) IsSetDecisionTaskStartedEventAttributes() bool {
	return v != nil && v.DecisionTaskStartedEventAttributes != nil
}

// GetDecisionTaskCompletedEventAttributes returns the value of DecisionTaskCompletedEventAttributes if it is set or its
// zero value if it is unset.
func (v *HistoryEvent) GetDecisionTaskCompletedEventAttributes() (o *DecisionTaskCompletedEventAttributes) {
	if v != nil && v.DecisionTaskCompletedEventAttributes != nil {
		return v.DecisionTaskCompletedEventAttributes
	}

	return
}

// IsSetDecisionTaskCompletedEventAttributes returns true if DecisionTaskCompletedEventAttributes is not nil.
func (v *HistoryEvent) IsSetDecisionTaskCompletedEventAttributes() bool {
	return v != nil && v.DecisionTaskCompletedEventAttributes != nil
}

// GetDecisionTaskTimedOutEventAttributes returns the value of DecisionTaskTimedOutEventAttributes if it is set or its
// zero value if it is unset.
func (v *HistoryEvent) GetDecisionTaskTimedOutEventAttributes() (o *DecisionTaskTimedOutEventAttributes) {
	if v != nil && v.DecisionTaskTimedOutEventAttributes != nil {
		return v.DecisionTaskTimedOutEventAttributes
	}

	return
}

// IsSetDecisionTaskTimedOutEventAttributes returns true if DecisionTaskTimedOutEventAttributes is not nil.
func (v *HistoryEvent) IsSetDecisionTaskTimedOutEventAttributes() bool {
	return v != nil && v.DecisionTaskTimedOutEventAttributes != nil
}

// GetDecisionTaskFailedEventAttributes returns the value of DecisionTaskFailedEventAttributes if it is set or its
// zero value if it is unset.
func (v *HistoryEvent) GetDecisionTaskFailedEventAttributes() (o *DecisionTaskFailedEventAttributes) {
	if v != nil && v.DecisionTaskFailedEventAttributes != nil {
		return v.DecisionTaskFailedEventAttributes
	}

	return
}

// IsSetDecisionTaskFailedEventAttributes returns true if DecisionTaskFailedEventAttributes is not nil.
func (v *HistoryEvent) IsSetDecisionTaskFailedEventAttributes() bool {
	return v != nil && v.DecisionTaskFailedEventAttributes != nil
}

// GetActivityTaskScheduledEventAttributes returns the value of ActivityTaskScheduledEventAttributes if it is set or its
// zero value if it is unset.
func (v *HistoryEvent) GetActivityTaskScheduledEventAttributes() (o *ActivityTaskScheduledEventAttributes) {
	if v != nil && v.ActivityTaskScheduledEventAttributes != nil {
		return v.ActivityTaskScheduledEventAttributes
	}

	return
}

// IsSetActivityTaskScheduledEventAttributes returns true if ActivityTaskScheduledEventAttributes is not nil.
func (v *HistoryEvent) IsSetActivityTaskScheduledEventAttributes() bool {
	return v != nil && v.ActivityTaskScheduledEventAttributes != nil
}

// GetActivityTaskStartedEventAttributes returns the value of ActivityTaskStartedEventAttributes if it is set or its
// zero value if it is unset.
func (v *HistoryEvent) GetActivityTaskStartedEventAttributes() (o *ActivityTaskStartedEventAttributes) {
	if v != nil && v.ActivityTaskStartedEventAttributes != nil {
		return v.ActivityTaskStartedEventAttributes
	}

	return
}

// IsSetActivityTaskStartedEventAttributes returns true if ActivityTaskStartedEventAttributes is not nil.
func (v *HistoryEvent) IsSetActivityTaskStartedEventAttributes() bool {
	return v != nil && v.ActivityTaskStartedEventAttributes != nil
}

// GetActivityTaskCompletedEventAttributes returns the value of ActivityTaskCompletedEventAttributes if it is set or its
// zero value if it is unset.
func (v *HistoryEvent) GetActivityTaskCompletedEventAttributes() (o *ActivityTaskCompletedEventAttributes) {
	if v != nil && v.ActivityTaskCompletedEventAttributes != nil {
		return v.ActivityTaskCompletedEventAttributes
	}

	return
}

// IsSetActivityTaskCompletedEventAttributes returns true if ActivityTaskCompletedEventAttributes is not nil.
func (v *HistoryEvent) IsSetActivityTaskCompletedEventAttributes() bool {
	return v != nil && v.ActivityTaskCompletedEventAttributes != nil
}

// GetActivityTaskFailedEventAttributes returns the value of ActivityTaskFailedEventAttributes if it is set or its
// zero value if it is unset.
func (v *HistoryEvent) GetActivityTaskFailedEventAttributes() (o *ActivityTaskFailedEventAttributes) {
	if v != nil && v.ActivityTaskFailedEventAttributes != nil {
		return v.ActivityTaskFailedEventAttributes
	}

	return
}

// IsSetActivityTaskFailedEventAttributes returns true if ActivityTaskFailedEventAttributes is not nil.
func (v *HistoryEvent) IsSetActivityTaskFailedEventAttributes() bool {
	return v != nil && v.ActivityTaskFailedEventAttributes != nil
}

// GetActivityTaskTimedOutEventAttributes returns the value of ActivityTaskTimedOutEventAttributes if it is set or its
// zero value if it is unset.
func (v *HistoryEvent) GetActivityTaskTimedOutEventAttributes() (o *ActivityTaskTimedOutEventAttributes) {
	if v != nil && v.ActivityTaskTimedOutEventAttributes != nil {
		return v.ActivityTaskTimedOutEventAttributes
	}

	return
}

// IsSetActivityTaskTimedOutEventAttributes returns true if ActivityTaskTimedOutEventAttributes is not nil.
func (v *HistoryEvent) IsSetActivityTaskTimedOutEventAttributes() bool {
	return v != nil && v.ActivityTaskTimedOutEventAttributes != nil
}

// GetTimerStartedEventAttributes returns the value of TimerStartedEventAttributes if it is set or its
// zero value if it is unset.
func (v *HistoryEvent) GetTimerStartedEventAttributes() (o *TimerStartedEventAttributes) {
	if v != nil && v.TimerStartedEventAttributes != nil {
		return v.TimerStartedEventAttributes
	}

	return
}

// IsSetTimerStartedEventAttributes returns true if TimerStartedEventAttributes is not nil.
func (v *HistoryEvent) IsSetTimerStartedEventAttributes() bool {
	return v != nil && v.TimerStartedEventAttributes != nil
}

// GetTimerFiredEventAttributes returns the value of TimerFiredEventAttributes if it is set or its
// zero value if it is unset.
func (v *HistoryEvent) GetTimerFiredEventAttributes() (o *TimerFiredEventAttributes) {
	if v != nil && v.TimerFiredEventAttributes != nil {
		return v.TimerFiredEventAttributes
	}

	return
}

// IsSetTimerFiredEventAttributes returns true if TimerFiredEventAttributes is not nil.
func (v *HistoryEvent) IsSetTimerFiredEventAttributes() bool {
	return v != nil && v.TimerFiredEventAttributes != nil
}

// GetActivityTaskCancelRequestedEventAttributes returns the value of ActivityTaskCancelRequestedEventAttributes if it is set or its
// zero value if it is unset.
func (v *HistoryEvent) GetActivityTaskCancelRequestedEventAttributes() (o *ActivityTaskCancelRequestedEventAttributes) {
	if v != nil && v.ActivityTaskCancelRequestedEventAttributes != nil {
		return v.ActivityTaskCancelRequestedEventAttributes
	}

	return
}

// IsSetActivityTaskCancelRequestedEventAttributes returns true if ActivityTaskCancelRequestedEventAttributes is not nil.
func (v *HistoryEvent) IsSetActivityTaskCancelRequestedEventAttributes() bool {
	return v != nil && v.ActivityTaskCancelRequestedEventAttributes != nil
}

// GetRequestCancelActivityTaskFailedEventAttributes returns the value of RequestCancelActivityTaskFailedEventAttributes if it is set or its
// zero value if it is unset.
func (v *HistoryEvent) GetRequestCancelActivityTaskFailedEventAttributes() (o *RequestCancelActivityTaskFailedEventAttributes) {
	if v != nil && v.RequestCancelActivityTaskFailedEventAttributes != nil {
		return v.RequestCancelActivityTaskFailedEventAttributes
	}

	return
}

// IsSetRequestCancelActivityTaskFailedEventAttributes returns true if RequestCancelActivityTaskFailedEventAttributes is not nil.
func (v *HistoryEvent) IsSetRequestCancelActivityTaskFailedEventAttributes() bool {
	return v != nil && v.RequestCancelActivityTaskFailedEventAttributes != nil
}

// GetActivityTaskCanceledEventAttributes returns the value of ActivityTaskCanceledEventAttributes if it is set or its
// zero value if it is unset.
func (v *HistoryEvent) GetActivityTaskCanceledEventAttributes() (o *ActivityTaskCanceledEventAttributes) {
	if v != nil && v.ActivityTaskCanceledEventAttributes != nil {
		return v.ActivityTaskCanceledEventAttributes
	}

	return
}

// IsSetActivityTaskCanceledEventAttributes returns true if ActivityTaskCanceledEventAttributes is not nil.
func (v *HistoryEvent) IsSetActivityTaskCanceledEventAttributes() bool {
	return v != nil && v.ActivityTaskCanceledEventAttributes != nil
}

// GetTimerCanceledEventAttributes returns the value of TimerCanceledEventAttributes if it is set or its
// zero value if it is unset.
func (v *HistoryEvent) GetTimerCanceledEventAttributes() (o *TimerCanceledEventAttributes) {
	if v != nil && v.TimerCanceledEventAttributes != nil {
		return v.TimerCanceledEventAttributes
	}

	return
}

// IsSetTimerCanceledEventAttributes returns true if TimerCanceledEventAttributes is not nil.
func (v *HistoryEvent) IsSetTimerCanceledEventAttributes() bool {
	return v != nil && v.TimerCanceledEventAttributes != nil
}

// GetCancelTimerFailedEventAttributes returns the value of CancelTimerFailedEventAttributes if it is set or its
// zero value if it is unset.
func (v *HistoryEvent) GetCancelTimerFailedEventAttributes() (o *CancelTimerFailedEventAttributes) {
	if v != nil && v.CancelTimerFailedEventAttributes != nil {
		return v.CancelTimerFailedEventAttributes
	}

	return
}

// IsSetCancelTimerFailedEventAttributes returns true if CancelTimerFailedEventAttributes is not nil.
func (v *HistoryEvent) IsSetCancelTimerFailedEventAttributes() bool {
	return v != nil && v.CancelTimerFailedEventAttributes != nil
}

// GetMarkerRecordedEventAttributes returns the value of MarkerRecordedEventAttributes if it is set or its
// zero value if it is unset.
func (v *HistoryEvent) GetMarkerRecordedEventAttributes() (o *MarkerRecordedEventAttributes) {
	if v != nil && v.MarkerRecordedEventAttributes != nil {
		return v.MarkerRecordedEventAttributes
	}

	return
}

// IsSetMarkerRecordedEventAttributes returns true if MarkerRecordedEventAttributes is not nil.
func (v *HistoryEvent) IsSetMarkerRecordedEventAttributes() bool {
	return v != nil && v.MarkerRecordedEventAttributes != nil
}

// GetWorkflowExecutionSignaledEventAttributes returns the value of WorkflowExecutionSignaledEventAttributes if it is set or its
// zero value if it is unset.
func (v *HistoryEvent) GetWorkflowExecutionSignaledEventAttributes() (o *WorkflowExecutionSignaledEventAttributes) {
	if v != nil && v.WorkflowExecutionSignaledEventAttributes != nil {
		return v.WorkflowExecutionSignaledEventAttributes
	}

	return
}

// IsSetWorkflowExecutionSignaledEventAttributes returns true if WorkflowExecutionSignaledEventAttributes is not nil.
func (v *HistoryEvent) IsSetWorkflowExecutionSignaledEventAttributes() bool {
	return v != nil && v.WorkflowExecutionSignaledEventAttributes != nil
}

// GetWorkflowExecutionTerminatedEventAttributes returns the value of WorkflowExecutionTerminatedEventAttributes if it is set or its
// zero value if it is unset.
func (v *HistoryEvent) GetWorkflowExecutionTerminatedEventAttributes() (o *WorkflowExecutionTerminatedEventAttributes) {
	if v != nil && v.WorkflowExecutionTerminatedEventAttributes != nil {
		return v.WorkflowExecutionTerminatedEventAttributes
	}

	return
}

// IsSetWorkflowExecutionTerminatedEventAttributes returns true if WorkflowExecutionTerminatedEventAttributes is not nil.
func (v *HistoryEvent) IsSetWorkflowExecutionTerminatedEventAttributes() bool {
	return v != nil && v.WorkflowExecutionTerminatedEventAttributes != nil
}

// GetWorkflowExecutionCancelRequestedEventAttributes returns the value of WorkflowExecutionCancelRequestedEventAttributes if it is set or its
// zero value if it is unset.
func (v *HistoryEvent) GetWorkflowExecutionCancelRequestedEventAttributes() (o *WorkflowExecutionCancelRequestedEventAttributes) {
	if v != nil && v.WorkflowExecutionCancelRequestedEventAttributes != nil {
		return v.WorkflowExecutionCancelRequestedEventAttributes
	}

	return
}

// IsSetWorkflowExecutionCancelRequestedEventAttributes returns true if WorkflowExecutionCancelRequestedEventAttributes is not nil.
func (v *HistoryEvent) IsSetWorkflowExecutionCancelRequestedEventAttributes() bool {
	return v != nil && v.WorkflowExecutionCancelRequestedEventAttributes != nil
}

// GetWorkflowExecutionCanceledEventAttributes returns the value of WorkflowExecutionCanceledEventAttributes if it is set or its
// zero value if it is unset.
func (v *HistoryEvent) GetWorkflowExecutionCanceledEventAttributes() (o *WorkflowExecutionCanceledEventAttributes) {
	if v != nil && v.WorkflowExecutionCanceledEventAttributes != nil {
		return v.WorkflowExecutionCanceledEventAttributes
	}

	return
}

// IsSetWorkflowExecutionCanceledEventAttributes returns true if WorkflowExecutionCanceledEventAttributes is not nil.
func (v *HistoryEvent) IsSetWorkflowExecutionCanceledEventAttributes() bool {
	return v != nil && v.WorkflowExecutionCanceledEventAttributes != nil
}

// GetRequestCancelExternalWorkflowExecutionInitiatedEventAttributes returns the value of RequestCancelExternalWorkflowExecutionInitiatedEventAttributes if it is set or its
// zero value if it is unset.
func (v *HistoryEvent) GetRequestCancelExternalWorkflowExecutionInitiatedEventAttributes() (o *RequestCancelExternalWorkflowExecutionInitiatedEventAttributes) {
	if v != nil && v.RequestCancelExternalWorkflowExecutionInitiatedEventAttributes != nil {
		return v.RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
	}

	return
}

// IsSetRequestCancelExternalWorkflowExecutionInitiatedEventAttributes returns true if RequestCancelExternalWorkflowExecutionInitiatedEventAttributes is not nil.
func (v *HistoryEvent) IsSetRequestCancelExternalWorkflowExecutionInitiatedEventAttributes() bool {
	return v != nil && v.RequestCancelExternalWorkflowExecutionInitiatedEventAttributes != nil
}

// GetRequestCancelExternalWorkflowExecutionFailedEventAttributes returns the value of RequestCancelExternalWorkflowExecutionFailedEventAttributes if it is set or its
// zero value if it is unset.
func (v *HistoryEvent) GetRequestCancelExternalWorkflowExecutionFailedEventAttributes() (o *RequestCancelExternalWorkflowExecutionFailedEventAttributes) {
	if v != nil && v.RequestCancelExternalWorkflowExecutionFailedEventAttributes != nil {
		return v.RequestCancelExternalWorkflowExecutionFailedEventAttributes
	}

	return
}

// IsSetRequestCancelExternalWorkflowExecutionFailedEventAttributes returns true if RequestCancelExternalWorkflowExecutionFailedEventAttributes is not nil.
func (v *HistoryEvent) IsSetRequestCancelExternalWorkflowExecutionFailedEventAttributes() bool {
	return v != nil && v.RequestCancelExternalWorkflowExecutionFailedEventAttributes != nil
}

// GetExternalWorkflowExecutionCancelRequestedEventAttributes returns the value of ExternalWorkflowExecutionCancelRequestedEventAttributes if it is set or its
// zero value if it is unset.
func (v *HistoryEvent) GetExternalWorkflowExecutionCancelRequestedEventAttributes() (o *ExternalWorkflowExecutionCancelRequestedEventAttributes) {
	if v != nil && v.ExternalWorkflowExecutionCancelRequestedEventAttributes != nil {
		return v.ExternalWorkflowExecutionCancelRequestedEventAttributes
	}

	return
}

// IsSetExternalWorkflowExecutionCancelRequestedEventAttributes returns true if ExternalWorkflowExecutionCancelRequestedEventAttributes is not nil.
func (v *HistoryEvent) IsSetExternalWorkflowExecutionCancelRequestedEventAttributes() bool {
	return v != nil && v.ExternalWorkflowExecutionCancelRequestedEventAttributes != nil
}

// GetWorkflowExecutionContinuedAsNewEventAttributes returns the value of WorkflowExecutionContinuedAsNewEventAttributes if it is set or its
// zero value if it is unset.
func (v *HistoryEvent) GetWorkflowExecutionContinuedAsNewEventAttributes() (o *WorkflowExecutionContinuedAsNewEventAttributes) {
	if v != nil && v.WorkflowExecutionContinuedAsNewEventAttributes != nil {
		return v.WorkflowExecutionContinuedAsNewEventAttributes
	}

	return
}

// IsSetWorkflowExecutionContinuedAsNewEventAttributes returns true if WorkflowExecutionContinuedAsNewEventAttributes is not nil.
func (v *HistoryEvent) IsSetWorkflowExecutionContinuedAsNewEventAttributes() bool {
	return v != nil && v.WorkflowExecutionContinuedAsNewEventAttributes != nil
}

// GetStartChildWorkflowExecutionInitiatedEventAttributes returns the value of StartChildWorkflowExecutionInitiatedEventAttributes if it is set or its
// zero value if it is unset.
func (v *HistoryEvent) GetStartChildWorkflowExecutionInitiatedEventAttributes() (o *StartChildWorkflowExecutionInitiatedEventAttributes) {
	if v != nil && v.StartChildWorkflowExecutionInitiatedEventAttributes != nil {
		return v.StartChildWorkflowExecutionInitiatedEventAttributes
	}

	return
}

// IsSetStartChildWorkflowExecutionInitiatedEventAttributes returns true if StartChildWorkflowExecutionInitiatedEventAttributes is not nil.
func (v *HistoryEvent) IsSetStartChildWorkflowExecutionInitiatedEventAttributes() bool {
	return v != nil && v.StartChildWorkflowExecutionInitiatedEventAttributes != nil
}

// GetStartChildWorkflowExecutionFailedEventAttributes returns the value of StartChildWorkflowExecutionFailedEventAttributes if it is set or its
// zero value if it is unset.
func (v *HistoryEvent) GetStartChildWorkflowExecutionFailedEventAttributes() (o *StartChildWorkflowExecutionFailedEventAttributes) {
	if v != nil && v.StartChildWorkflowExecutionFailedEventAttributes != nil {
		return v.StartChildWorkflowExecutionFailedEventAttributes
	}

	return
}

// IsSetStartChildWorkflowExecutionFailedEventAttributes returns true if StartChildWorkflowExecutionFailedEventAttributes is not nil.
func (v *HistoryEvent) IsSetStartChildWorkflowExecutionFailedEventAttributes() bool {
	return v != nil && v.StartChildWorkflowExecutionFailedEventAttributes != nil
}

// GetChildWorkflowExecutionStartedEventAttributes returns the value of ChildWorkflowExecutionStartedEventAttributes if it is set or its
// zero value if it is unset.
func (v *HistoryEvent) GetChildWorkflowExecutionStartedEventAttributes() (o *ChildWorkflowExecutionStartedEventAttributes) {
	if v != nil && v.ChildWorkflowExecutionStartedEventAttributes != nil {
		return v.ChildWorkflowExecutionStartedEventAttributes
	}

	return
}

// IsSetChildWorkflowExecutionStartedEventAttributes returns true if ChildWorkflowExecutionStartedEventAttributes is not nil.
func (v *HistoryEvent) IsSetChildWorkflowExecutionStartedEventAttributes() bool {
	return v != nil && v.ChildWorkflowExecutionStartedEventAttributes != nil
}

// GetChildWorkflowExecutionCompletedEventAttributes returns the value of ChildWorkflowExecutionCompletedEventAttributes if it is set or its
// zero value if it is unset.
func (v *HistoryEvent) GetChildWorkflowExecutionCompletedEventAttributes() (o *ChildWorkflowExecutionCompletedEventAttributes) {
	if v != nil && v.ChildWorkflowExecutionCompletedEventAttributes != nil {
		return v.ChildWorkflowExecutionCompletedEventAttributes
	}

	return
}

// IsSetChildWorkflowExecutionCompletedEventAttributes returns true if ChildWorkflowExecutionCompletedEventAttributes is not nil.
func (v *HistoryEvent) IsSetChildWorkflowExecutionCompletedEventAttributes() bool {
	return v != nil && v.ChildWorkflowExecutionCompletedEventAttributes != nil
}

// GetChildWorkflowExecutionFailedEventAttributes returns the value of ChildWorkflowExecutionFailedEventAttributes if it is set or its
// zero value if it is unset.
func (v *HistoryEvent) GetChildWorkflowExecutionFailedEventAttributes() (o *ChildWorkflowExecutionFailedEventAttributes) {
	if v != nil && v.ChildWorkflowExecutionFailedEventAttributes != nil {
		return v.ChildWorkflowExecutionFailedEventAttributes
	}

	return
}

// IsSetChildWorkflowExecutionFailedEventAttributes returns true if ChildWorkflowExecutionFailedEventAttributes is not nil.
func (v *HistoryEvent) IsSetChildWorkflowExecutionFailedEventAttributes() bool {
	return v != nil && v.ChildWorkflowExecutionFailedEventAttributes != nil
}

// GetChildWorkflowExecutionCanceledEventAttributes returns the value of ChildWorkflowExecutionCanceledEventAttributes if it is set or its
// zero value if it is unset.
func (v *HistoryEvent) GetChildWorkflowExecutionCanceledEventAttributes() (o *ChildWorkflowExecutionCanceledEventAttributes) {
	if v != nil && v.ChildWorkflowExecutionCanceledEventAttributes != nil {
		return v.ChildWorkflowExecutionCanceledEventAttributes
	}

	return
}

// IsSetChildWorkflowExecutionCanceledEventAttributes returns true if ChildWorkflowExecutionCanceledEventAttributes is not nil.
func (v *HistoryEvent) IsSetChildWorkflowExecutionCanceledEventAttributes() bool {
	return v != nil && v.ChildWorkflowExecutionCanceledEventAttributes != nil
}

// GetChildWorkflowExecutionTimedOutEventAttributes returns the value of ChildWorkflowExecutionTimedOutEventAttributes if it is set or its
// zero value if it is unset.
func (v *HistoryEvent) GetChildWorkflowExecutionTimedOutEventAttributes() (o *ChildWorkflowExecutionTimedOutEventAttributes) {
	if v != nil && v.ChildWorkflowExecutionTimedOutEventAttributes != nil {
		return v.ChildWorkflowExecutionTimedOutEventAttributes
	}

	return
}

// IsSetChildWorkflowExecutionTimedOutEventAttributes returns true if ChildWorkflowExecutionTimedOutEventAttributes is not nil.
func (v *HistoryEvent) IsSetChildWorkflowExecutionTimedOutEventAttributes() bool {
	return v != nil && v.ChildWorkflowExecutionTimedOutEventAttributes != nil
}

// GetChildWorkflowExecutionTerminatedEventAttributes returns the value of ChildWorkflowExecutionTerminatedEventAttributes if it is set or its
// zero value if it is unset.
func (v *HistoryEvent) GetChildWorkflowExecutionTerminatedEventAttributes() (o *ChildWorkflowExecutionTerminatedEventAttributes) {
	if v != nil && v.ChildWorkflowExecutionTerminatedEventAttributes != nil {
		return v.ChildWorkflowExecutionTerminatedEventAttributes
	}

	return
}

// IsSetChildWorkflowExecutionTerminatedEventAttributes returns true if ChildWorkflowExecutionTerminatedEventAttributes is not nil.
func (v *HistoryEvent) IsSetChildWorkflowExecutionTerminatedEventAttributes() bool {
	return v != nil && v.ChildWorkflowExecutionTerminatedEventAttributes != nil
}

// GetSignalExternalWorkflowExecutionInitiatedEventAttributes returns the value of SignalExternalWorkflowExecutionInitiatedEventAttributes if it is set or its
// zero value if it is unset.
func (v *HistoryEvent) GetSignalExternalWorkflowExecutionInitiatedEventAttributes() (o *SignalExternalWorkflowExecutionInitiatedEventAttributes) {
	if v != nil && v.SignalExternalWorkflowExecutionInitiatedEventAttributes != nil {
		return v.SignalExternalWorkflowExecutionInitiatedEventAttributes
	}

	return
}

// IsSetSignalExternalWorkflowExecutionInitiatedEventAttributes returns true if SignalExternalWorkflowExecutionInitiatedEventAttributes is not nil.
func (v *HistoryEvent) IsSetSignalExternalWorkflowExecutionInitiatedEventAttributes() bool {
	return v != nil && v.SignalExternalWorkflowExecutionInitiatedEventAttributes != nil
}

// GetSignalExternalWorkflowExecutionFailedEventAttributes returns the value of SignalExternalWorkflowExecutionFailedEventAttributes if it is set or its
// zero value if it is unset.
func (v *HistoryEvent) GetSignalExternalWorkflowExecutionFailedEventAttributes() (o *SignalExternalWorkflowExecutionFailedEventAttributes) {
	if v != nil && v.SignalExternalWorkflowExecutionFailedEventAttributes != nil {
		return v.SignalExternalWorkflowExecutionFailedEventAttributes
	}

	return
}

// IsSetSignalExternalWorkflowExecutionFailedEventAttributes returns true if SignalExternalWorkflowExecutionFailedEventAttributes is not nil.
func (v *HistoryEvent) IsSetSignalExternalWorkflowExecutionFailedEventAttributes() bool {
	return v != nil && v.SignalExternalWorkflowExecutionFailedEventAttributes != nil
}

// GetExternalWorkflowExecutionSignaledEventAttributes returns the value of ExternalWorkflowExecutionSignaledEventAttributes if it is set or its
// zero value if it is unset.
func (v *HistoryEvent) GetExternalWorkflowExecutionSignaledEventAttributes() (o *ExternalWorkflowExecutionSignaledEventAttributes) {
	if v != nil && v.ExternalWorkflowExecutionSignaledEventAttributes != nil {
		return v.ExternalWorkflowExecutionSignaledEventAttributes
	}

	return
}

// IsSetExternalWorkflowExecutionSignaledEventAttributes returns true if ExternalWorkflowExecutionSignaledEventAttributes is not nil.
func (v *HistoryEvent) IsSetExternalWorkflowExecutionSignaledEventAttributes() bool {
	return v != nil && v.ExternalWorkflowExecutionSignaledEventAttributes != nil
}

// GetUpsertWorkflowSearchAttributesEventAttributes returns the value of UpsertWorkflowSearchAttributesEventAttributes if it is set or its
// zero value if it is unset.
func (v *HistoryEvent) GetUpsertWorkflowSearchAttributesEventAttributes() (o *UpsertWorkflowSearchAttributesEventAttributes) {
	if v != nil && v.UpsertWorkflowSearchAttributesEventAttributes != nil {
		return v.UpsertWorkflowSearchAttributesEventAttributes
	}

	return
}

// IsSetUpsertWorkflowSearchAttributesEventAttributes returns true if UpsertWorkflowSearchAttributesEventAttributes is not nil.
func (v *HistoryEvent) IsSetUpsertWorkflowSearchAttributesEventAttributes() bool {
	return v != nil && v.UpsertWorkflowSearchAttributesEventAttributes != nil
}

type HistoryEventFilterType int32

const (
	HistoryEventFilterTypeAllEvent   HistoryEventFilterType = 0
	HistoryEventFilterTypeCloseEvent HistoryEventFilterType = 1
)

// HistoryEventFilterType_Values returns all recognized values of HistoryEventFilterType.
func HistoryEventFilterType_Values() []HistoryEventFilterType {
	return []HistoryEventFilterType{
		HistoryEventFilterTypeAllEvent,
		HistoryEventFilterTypeCloseEvent,
	}
}

// UnmarshalText tries to decode HistoryEventFilterType from a byte slice
// containing its name.
//
//	var v HistoryEventFilterType
//	err := v.UnmarshalText([]byte("ALL_EVENT"))
func (v *HistoryEventFilterType) UnmarshalText(value []byte) error {
	switch s := string(value); s {
	case "ALL_EVENT":
		*v = HistoryEventFilterTypeAllEvent
		return nil
	case "CLOSE_EVENT":
		*v = HistoryEventFilterTypeCloseEvent
		return nil
	default:
		val, err := strconv.ParseInt(s, 10, 32)
		if err != nil {
			return fmt.Errorf("unknown enum value %q for %q: %v", s, "HistoryEventFilterType", err)
		}
		*v = HistoryEventFilterType(val)
		return nil
	}
}

// MarshalText encodes HistoryEventFilterType 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 HistoryEventFilterType) MarshalText() ([]byte, error) {
	switch int32(v) {
	case 0:
		return []byte("ALL_EVENT"), nil
	case 1:
		return []byte("CLOSE_EVENT"), nil
	}
	return []byte(strconv.FormatInt(int64(v), 10)), nil
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of HistoryEventFilterType.
// 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 HistoryEventFilterType) MarshalLogObject(enc zapcore.ObjectEncoder) error {
	enc.AddInt32("value", int32(v))
	switch int32(v) {
	case 0:
		enc.AddString("name", "ALL_EVENT")
	case 1:
		enc.AddString("name", "CLOSE_EVENT")
	}
	return nil
}

// Ptr returns a pointer to this enum value.
func (v HistoryEventFilterType) Ptr() *HistoryEventFilterType {
	return &v
}

// ToWire translates HistoryEventFilterType 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 HistoryEventFilterType) ToWire() (wire.Value, error) {
	return wire.NewValueI32(int32(v)), nil
}

// FromWire deserializes HistoryEventFilterType from its Thrift-level
// representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TI32)
//	if err != nil {
//	  return HistoryEventFilterType(0), err
//	}
//
//	var v HistoryEventFilterType
//	if err := v.FromWire(x); err != nil {
//	  return HistoryEventFilterType(0), err
//	}
//	return v, nil
func (v *HistoryEventFilterType) FromWire(w wire.Value) error {
	*v = (HistoryEventFilterType)(w.GetI32())
	return nil
}

// String returns a readable string representation of HistoryEventFilterType.
func (v HistoryEventFilterType) String() string {
	w := int32(v)
	switch w {
	case 0:
		return "ALL_EVENT"
	case 1:
		return "CLOSE_EVENT"
	}
	return fmt.Sprintf("HistoryEventFilterType(%d)", w)
}

// Equals returns true if this HistoryEventFilterType value matches the provided
// value.
func (v HistoryEventFilterType) Equals(rhs HistoryEventFilterType) bool {
	return v == rhs
}

// MarshalJSON serializes HistoryEventFilterType into JSON.
//
// If the enum value is recognized, its name is returned. Otherwise,
// its integer value is returned.
//
// This implements json.Marshaler.
func (v HistoryEventFilterType) MarshalJSON() ([]byte, error) {
	switch int32(v) {
	case 0:
		return ([]byte)("\"ALL_EVENT\""), nil
	case 1:
		return ([]byte)("\"CLOSE_EVENT\""), nil
	}
	return ([]byte)(strconv.FormatInt(int64(v), 10)), nil
}

// UnmarshalJSON attempts to decode HistoryEventFilterType 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 *HistoryEventFilterType) 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, "HistoryEventFilterType")
		}
		if x < math.MinInt32 {
			return fmt.Errorf("enum underflow from JSON %q for %q", text, "HistoryEventFilterType")
		}
		*v = (HistoryEventFilterType)(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, "HistoryEventFilterType")
	}
}

type IndexedValueType int32

const (
	IndexedValueTypeString   IndexedValueType = 0
	IndexedValueTypeKeyword  IndexedValueType = 1
	IndexedValueTypeInt      IndexedValueType = 2
	IndexedValueTypeDouble   IndexedValueType = 3
	IndexedValueTypeBool     IndexedValueType = 4
	IndexedValueTypeDatetime IndexedValueType = 5
)

// IndexedValueType_Values returns all recognized values of IndexedValueType.
func IndexedValueType_Values() []IndexedValueType {
	return []IndexedValueType{
		IndexedValueTypeString,
		IndexedValueTypeKeyword,
		IndexedValueTypeInt,
		IndexedValueTypeDouble,
		IndexedValueTypeBool,
		IndexedValueTypeDatetime,
	}
}

// UnmarshalText tries to decode IndexedValueType from a byte slice
// containing its name.
//
//	var v IndexedValueType
//	err := v.UnmarshalText([]byte("STRING"))
func (v *IndexedValueType) UnmarshalText(value []byte) error {
	switch s := string(value); s {
	case "STRING":
		*v = IndexedValueTypeString
		return nil
	case "KEYWORD":
		*v = IndexedValueTypeKeyword
		return nil
	case "INT":
		*v = IndexedValueTypeInt
		return nil
	case "DOUBLE":
		*v = IndexedValueTypeDouble
		return nil
	case "BOOL":
		*v = IndexedValueTypeBool
		return nil
	case "DATETIME":
		*v = IndexedValueTypeDatetime
		return nil
	default:
		val, err := strconv.ParseInt(s, 10, 32)
		if err != nil {
			return fmt.Errorf("unknown enum value %q for %q: %v", s, "IndexedValueType", err)
		}
		*v = IndexedValueType(val)
		return nil
	}
}

// MarshalText encodes IndexedValueType 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 IndexedValueType) MarshalText() ([]byte, error) {
	switch int32(v) {
	case 0:
		return []byte("STRING"), nil
	case 1:
		return []byte("KEYWORD"), nil
	case 2:
		return []byte("INT"), nil
	case 3:
		return []byte("DOUBLE"), nil
	case 4:
		return []byte("BOOL"), nil
	case 5:
		return []byte("DATETIME"), nil
	}
	return []byte(strconv.FormatInt(int64(v), 10)), nil
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of IndexedValueType.
// 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 IndexedValueType) MarshalLogObject(enc zapcore.ObjectEncoder) error {
	enc.AddInt32("value", int32(v))
	switch int32(v) {
	case 0:
		enc.AddString("name", "STRING")
	case 1:
		enc.AddString("name", "KEYWORD")
	case 2:
		enc.AddString("name", "INT")
	case 3:
		enc.AddString("name", "DOUBLE")
	case 4:
		enc.AddString("name", "BOOL")
	case 5:
		enc.AddString("name", "DATETIME")
	}
	return nil
}

// Ptr returns a pointer to this enum value.
func (v IndexedValueType) Ptr() *IndexedValueType {
	return &v
}

// ToWire translates IndexedValueType 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 IndexedValueType) ToWire() (wire.Value, error) {
	return wire.NewValueI32(int32(v)), nil
}

// FromWire deserializes IndexedValueType from its Thrift-level
// representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TI32)
//	if err != nil {
//	  return IndexedValueType(0), err
//	}
//
//	var v IndexedValueType
//	if err := v.FromWire(x); err != nil {
//	  return IndexedValueType(0), err
//	}
//	return v, nil
func (v *IndexedValueType) FromWire(w wire.Value) error {
	*v = (IndexedValueType)(w.GetI32())
	return nil
}

// String returns a readable string representation of IndexedValueType.
func (v IndexedValueType) String() string {
	w := int32(v)
	switch w {
	case 0:
		return "STRING"
	case 1:
		return "KEYWORD"
	case 2:
		return "INT"
	case 3:
		return "DOUBLE"
	case 4:
		return "BOOL"
	case 5:
		return "DATETIME"
	}
	return fmt.Sprintf("IndexedValueType(%d)", w)
}

// Equals returns true if this IndexedValueType value matches the provided
// value.
func (v IndexedValueType) Equals(rhs IndexedValueType) bool {
	return v == rhs
}

// MarshalJSON serializes IndexedValueType into JSON.
//
// If the enum value is recognized, its name is returned. Otherwise,
// its integer value is returned.
//
// This implements json.Marshaler.
func (v IndexedValueType) MarshalJSON() ([]byte, error) {
	switch int32(v) {
	case 0:
		return ([]byte)("\"STRING\""), nil
	case 1:
		return ([]byte)("\"KEYWORD\""), nil
	case 2:
		return ([]byte)("\"INT\""), nil
	case 3:
		return ([]byte)("\"DOUBLE\""), nil
	case 4:
		return ([]byte)("\"BOOL\""), nil
	case 5:
		return ([]byte)("\"DATETIME\""), nil
	}
	return ([]byte)(strconv.FormatInt(int64(v), 10)), nil
}

// UnmarshalJSON attempts to decode IndexedValueType 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 *IndexedValueType) 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, "IndexedValueType")
		}
		if x < math.MinInt32 {
			return fmt.Errorf("enum underflow from JSON %q for %q", text, "IndexedValueType")
		}
		*v = (IndexedValueType)(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, "IndexedValueType")
	}
}

type InternalDataInconsistencyError struct {
	Message string `json:"message,required"`
}

// ToWire translates a InternalDataInconsistencyError 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 *InternalDataInconsistencyError) 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
}

// FromWire deserializes a InternalDataInconsistencyError 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 InternalDataInconsistencyError struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v InternalDataInconsistencyError
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *InternalDataInconsistencyError) 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 InternalDataInconsistencyError is required")
	}

	return nil
}

// String returns a readable string representation of a InternalDataInconsistencyError
// struct.
func (v *InternalDataInconsistencyError) 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("InternalDataInconsistencyError{%v}", strings.Join(fields[:i], ", "))
}

// ErrorName is the name of this type as defined in the Thrift
// file.
func (*InternalDataInconsistencyError) ErrorName() string {
	return "InternalDataInconsistencyError"
}

// Equals returns true if all the fields of this InternalDataInconsistencyError match the
// provided InternalDataInconsistencyError.
//
// This function performs a deep comparison.
func (v *InternalDataInconsistencyError) Equals(rhs *InternalDataInconsistencyError) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !(v.Message == rhs.Message) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of InternalDataInconsistencyError.
func (v *InternalDataInconsistencyError) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	enc.AddString("message", v.Message)
	return err
}

// GetMessage returns the value of Message if it is set or its
// zero value if it is unset.
func (v *InternalDataInconsistencyError) GetMessage() (o string) {
	if v != nil {
		o = v.Message
	}
	return
}

func (v *InternalDataInconsistencyError) Error() string {
	return v.String()
}

type InternalServiceError struct {
	Message string `json:"message,required"`
}

// ToWire translates a InternalServiceError 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 *InternalServiceError) 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
}

// FromWire deserializes a InternalServiceError 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 InternalServiceError struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v InternalServiceError
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *InternalServiceError) 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 InternalServiceError is required")
	}

	return nil
}

// String returns a readable string representation of a InternalServiceError
// struct.
func (v *InternalServiceError) 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("InternalServiceError{%v}", strings.Join(fields[:i], ", "))
}

// ErrorName is the name of this type as defined in the Thrift
// file.
func (*InternalServiceError) ErrorName() string {
	return "InternalServiceError"
}

// Equals returns true if all the fields of this InternalServiceError match the
// provided InternalServiceError.
//
// This function performs a deep comparison.
func (v *InternalServiceError) Equals(rhs *InternalServiceError) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !(v.Message == rhs.Message) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of InternalServiceError.
func (v *InternalServiceError) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	enc.AddString("message", v.Message)
	return err
}

// GetMessage returns the value of Message if it is set or its
// zero value if it is unset.
func (v *InternalServiceError) GetMessage() (o string) {
	if v != nil {
		o = v.Message
	}
	return
}

func (v *InternalServiceError) Error() string {
	return v.String()
}

type IsolationGroupConfiguration struct {
	IsolationGroups []*IsolationGroupPartition `json:"isolationGroups,omitempty"`
}

type _List_IsolationGroupPartition_ValueList []*IsolationGroupPartition

func (v _List_IsolationGroupPartition_ValueList) ForEach(f func(wire.Value) error) error {
	for i, x := range v {
		if x == nil {
			return fmt.Errorf("invalid [%v]: value is nil", i)
		}
		w, err := x.ToWire()
		if err != nil {
			return err
		}
		err = f(w)
		if err != nil {
			return err
		}
	}
	return nil
}

func (v _List_IsolationGroupPartition_ValueList) Size() int {
	return len(v)
}

func (_List_IsolationGroupPartition_ValueList) ValueType() wire.Type {
	return wire.TStruct
}

func (_List_IsolationGroupPartition_ValueList) Close() {}

// ToWire translates a IsolationGroupConfiguration 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 *IsolationGroupConfiguration) ToWire() (wire.Value, error) {
	var (
		fields [1]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.IsolationGroups != nil {
		w, err = wire.NewValueList(_List_IsolationGroupPartition_ValueList(v.IsolationGroups)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

func _IsolationGroupPartition_Read(w wire.Value) (*IsolationGroupPartition, error) {
	var v IsolationGroupPartition
	err := v.FromWire(w)
	return &v, err
}

func _List_IsolationGroupPartition_Read(l wire.ValueList) ([]*IsolationGroupPartition, error) {
	if l.ValueType() != wire.TStruct {
		return nil, nil
	}

	o := make([]*IsolationGroupPartition, 0, l.Size())
	err := l.ForEach(func(x wire.Value) error {
		i, err := _IsolationGroupPartition_Read(x)
		if err != nil {
			return err
		}
		o = append(o, i)
		return nil
	})
	l.Close()
	return o, err
}

// FromWire deserializes a IsolationGroupConfiguration 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 IsolationGroupConfiguration struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v IsolationGroupConfiguration
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *IsolationGroupConfiguration) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			if field.Value.Type() == wire.TList {
				v.IsolationGroups, err = _List_IsolationGroupPartition_Read(field.Value.GetList())
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a IsolationGroupConfiguration
// struct.
func (v *IsolationGroupConfiguration) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [1]string
	i := 0
	if v.IsolationGroups != nil {
		fields[i] = fmt.Sprintf("IsolationGroups: %v", v.IsolationGroups)
		i++
	}

	return fmt.Sprintf("IsolationGroupConfiguration{%v}", strings.Join(fields[:i], ", "))
}

func _List_IsolationGroupPartition_Equals(lhs, rhs []*IsolationGroupPartition) bool {
	if len(lhs) != len(rhs) {
		return false
	}

	for i, lv := range lhs {
		rv := rhs[i]
		if !lv.Equals(rv) {
			return false
		}
	}

	return true
}

// Equals returns true if all the fields of this IsolationGroupConfiguration match the
// provided IsolationGroupConfiguration.
//
// This function performs a deep comparison.
func (v *IsolationGroupConfiguration) Equals(rhs *IsolationGroupConfiguration) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !((v.IsolationGroups == nil && rhs.IsolationGroups == nil) || (v.IsolationGroups != nil && rhs.IsolationGroups != nil && _List_IsolationGroupPartition_Equals(v.IsolationGroups, rhs.IsolationGroups))) {
		return false
	}

	return true
}

type _List_IsolationGroupPartition_Zapper []*IsolationGroupPartition

// MarshalLogArray implements zapcore.ArrayMarshaler, enabling
// fast logging of _List_IsolationGroupPartition_Zapper.
func (l _List_IsolationGroupPartition_Zapper) MarshalLogArray(enc zapcore.ArrayEncoder) (err error) {
	for _, v := range l {
		err = multierr.Append(err, enc.AppendObject(v))
	}
	return err
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of IsolationGroupConfiguration.
func (v *IsolationGroupConfiguration) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.IsolationGroups != nil {
		err = multierr.Append(err, enc.AddArray("isolationGroups", (_List_IsolationGroupPartition_Zapper)(v.IsolationGroups)))
	}
	return err
}

// GetIsolationGroups returns the value of IsolationGroups if it is set or its
// zero value if it is unset.
func (v *IsolationGroupConfiguration) GetIsolationGroups() (o []*IsolationGroupPartition) {
	if v != nil && v.IsolationGroups != nil {
		return v.IsolationGroups
	}

	return
}

// IsSetIsolationGroups returns true if IsolationGroups is not nil.
func (v *IsolationGroupConfiguration) IsSetIsolationGroups() bool {
	return v != nil && v.IsolationGroups != nil
}

type IsolationGroupMetrics struct {
	NewTasksPerSecond *float64 `json:"newTasksPerSecond,omitempty"`
	PollerCount       *int64   `json:"pollerCount,omitempty"`
}

// ToWire translates a IsolationGroupMetrics 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 *IsolationGroupMetrics) ToWire() (wire.Value, error) {
	var (
		fields [2]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.NewTasksPerSecond != nil {
		w, err = wire.NewValueDouble(*(v.NewTasksPerSecond)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.PollerCount != nil {
		w, err = wire.NewValueI64(*(v.PollerCount)), 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
}

// FromWire deserializes a IsolationGroupMetrics 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 IsolationGroupMetrics struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v IsolationGroupMetrics
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *IsolationGroupMetrics) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			if field.Value.Type() == wire.TDouble {
				var x float64
				x, err = field.Value.GetDouble(), error(nil)
				v.NewTasksPerSecond = &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.PollerCount = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a IsolationGroupMetrics
// struct.
func (v *IsolationGroupMetrics) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [2]string
	i := 0
	if v.NewTasksPerSecond != nil {
		fields[i] = fmt.Sprintf("NewTasksPerSecond: %v", *(v.NewTasksPerSecond))
		i++
	}
	if v.PollerCount != nil {
		fields[i] = fmt.Sprintf("PollerCount: %v", *(v.PollerCount))
		i++
	}

	return fmt.Sprintf("IsolationGroupMetrics{%v}", strings.Join(fields[:i], ", "))
}

func _Double_EqualsPtr(lhs, rhs *float64) 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 IsolationGroupMetrics match the
// provided IsolationGroupMetrics.
//
// This function performs a deep comparison.
func (v *IsolationGroupMetrics) Equals(rhs *IsolationGroupMetrics) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_Double_EqualsPtr(v.NewTasksPerSecond, rhs.NewTasksPerSecond) {
		return false
	}
	if !_I64_EqualsPtr(v.PollerCount, rhs.PollerCount) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of IsolationGroupMetrics.
func (v *IsolationGroupMetrics) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.NewTasksPerSecond != nil {
		enc.AddFloat64("newTasksPerSecond", *v.NewTasksPerSecond)
	}
	if v.PollerCount != nil {
		enc.AddInt64("pollerCount", *v.PollerCount)
	}
	return err
}

// GetNewTasksPerSecond returns the value of NewTasksPerSecond if it is set or its
// zero value if it is unset.
func (v *IsolationGroupMetrics) GetNewTasksPerSecond() (o float64) {
	if v != nil && v.NewTasksPerSecond != nil {
		return *v.NewTasksPerSecond
	}

	return
}

// IsSetNewTasksPerSecond returns true if NewTasksPerSecond is not nil.
func (v *IsolationGroupMetrics) IsSetNewTasksPerSecond() bool {
	return v != nil && v.NewTasksPerSecond != nil
}

// GetPollerCount returns the value of PollerCount if it is set or its
// zero value if it is unset.
func (v *IsolationGroupMetrics) GetPollerCount() (o int64) {
	if v != nil && v.PollerCount != nil {
		return *v.PollerCount
	}

	return
}

// IsSetPollerCount returns true if PollerCount is not nil.
func (v *IsolationGroupMetrics) IsSetPollerCount() bool {
	return v != nil && v.PollerCount != nil
}

type IsolationGroupPartition struct {
	Name  *string              `json:"name,omitempty"`
	State *IsolationGroupState `json:"state,omitempty"`
}

// ToWire translates a IsolationGroupPartition 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 *IsolationGroupPartition) ToWire() (wire.Value, error) {
	var (
		fields [2]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.Name != nil {
		w, err = wire.NewValueString(*(v.Name)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.State != nil {
		w, err = v.State.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 _IsolationGroupState_Read(w wire.Value) (IsolationGroupState, error) {
	var v IsolationGroupState
	err := v.FromWire(w)
	return v, err
}

// FromWire deserializes a IsolationGroupPartition 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 IsolationGroupPartition struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v IsolationGroupPartition
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *IsolationGroupPartition) 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.Name = &x
				if err != nil {
					return err
				}

			}
		case 20:
			if field.Value.Type() == wire.TI32 {
				var x IsolationGroupState
				x, err = _IsolationGroupState_Read(field.Value)
				v.State = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a IsolationGroupPartition
// struct.
func (v *IsolationGroupPartition) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [2]string
	i := 0
	if v.Name != nil {
		fields[i] = fmt.Sprintf("Name: %v", *(v.Name))
		i++
	}
	if v.State != nil {
		fields[i] = fmt.Sprintf("State: %v", *(v.State))
		i++
	}

	return fmt.Sprintf("IsolationGroupPartition{%v}", strings.Join(fields[:i], ", "))
}

func _IsolationGroupState_EqualsPtr(lhs, rhs *IsolationGroupState) bool {
	if lhs != nil && rhs != nil {

		x := *lhs
		y := *rhs
		return x.Equals(y)
	}
	return lhs == nil && rhs == nil
}

// Equals returns true if all the fields of this IsolationGroupPartition match the
// provided IsolationGroupPartition.
//
// This function performs a deep comparison.
func (v *IsolationGroupPartition) Equals(rhs *IsolationGroupPartition) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.Name, rhs.Name) {
		return false
	}
	if !_IsolationGroupState_EqualsPtr(v.State, rhs.State) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of IsolationGroupPartition.
func (v *IsolationGroupPartition) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Name != nil {
		enc.AddString("name", *v.Name)
	}
	if v.State != nil {
		err = multierr.Append(err, enc.AddObject("state", *v.State))
	}
	return err
}

// GetName returns the value of Name if it is set or its
// zero value if it is unset.
func (v *IsolationGroupPartition) GetName() (o string) {
	if v != nil && v.Name != nil {
		return *v.Name
	}

	return
}

// IsSetName returns true if Name is not nil.
func (v *IsolationGroupPartition) IsSetName() bool {
	return v != nil && v.Name != nil
}

// GetState returns the value of State if it is set or its
// zero value if it is unset.
func (v *IsolationGroupPartition) GetState() (o IsolationGroupState) {
	if v != nil && v.State != nil {
		return *v.State
	}

	return
}

// IsSetState returns true if State is not nil.
func (v *IsolationGroupPartition) IsSetState() bool {
	return v != nil && v.State != nil
}

type IsolationGroupState int32

const (
	IsolationGroupStateInvalid IsolationGroupState = 0
	IsolationGroupStateHealthy IsolationGroupState = 1
	IsolationGroupStateDrained IsolationGroupState = 2
)

// IsolationGroupState_Values returns all recognized values of IsolationGroupState.
func IsolationGroupState_Values() []IsolationGroupState {
	return []IsolationGroupState{
		IsolationGroupStateInvalid,
		IsolationGroupStateHealthy,
		IsolationGroupStateDrained,
	}
}

// UnmarshalText tries to decode IsolationGroupState from a byte slice
// containing its name.
//
//	var v IsolationGroupState
//	err := v.UnmarshalText([]byte("INVALID"))
func (v *IsolationGroupState) UnmarshalText(value []byte) error {
	switch s := string(value); s {
	case "INVALID":
		*v = IsolationGroupStateInvalid
		return nil
	case "HEALTHY":
		*v = IsolationGroupStateHealthy
		return nil
	case "DRAINED":
		*v = IsolationGroupStateDrained
		return nil
	default:
		val, err := strconv.ParseInt(s, 10, 32)
		if err != nil {
			return fmt.Errorf("unknown enum value %q for %q: %v", s, "IsolationGroupState", err)
		}
		*v = IsolationGroupState(val)
		return nil
	}
}

// MarshalText encodes IsolationGroupState 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 IsolationGroupState) MarshalText() ([]byte, error) {
	switch int32(v) {
	case 0:
		return []byte("INVALID"), nil
	case 1:
		return []byte("HEALTHY"), nil
	case 2:
		return []byte("DRAINED"), nil
	}
	return []byte(strconv.FormatInt(int64(v), 10)), nil
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of IsolationGroupState.
// 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 IsolationGroupState) MarshalLogObject(enc zapcore.ObjectEncoder) error {
	enc.AddInt32("value", int32(v))
	switch int32(v) {
	case 0:
		enc.AddString("name", "INVALID")
	case 1:
		enc.AddString("name", "HEALTHY")
	case 2:
		enc.AddString("name", "DRAINED")
	}
	return nil
}

// Ptr returns a pointer to this enum value.
func (v IsolationGroupState) Ptr() *IsolationGroupState {
	return &v
}

// ToWire translates IsolationGroupState 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 IsolationGroupState) ToWire() (wire.Value, error) {
	return wire.NewValueI32(int32(v)), nil
}

// FromWire deserializes IsolationGroupState from its Thrift-level
// representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TI32)
//	if err != nil {
//	  return IsolationGroupState(0), err
//	}
//
//	var v IsolationGroupState
//	if err := v.FromWire(x); err != nil {
//	  return IsolationGroupState(0), err
//	}
//	return v, nil
func (v *IsolationGroupState) FromWire(w wire.Value) error {
	*v = (IsolationGroupState)(w.GetI32())
	return nil
}

// String returns a readable string representation of IsolationGroupState.
func (v IsolationGroupState) String() string {
	w := int32(v)
	switch w {
	case 0:
		return "INVALID"
	case 1:
		return "HEALTHY"
	case 2:
		return "DRAINED"
	}
	return fmt.Sprintf("IsolationGroupState(%d)", w)
}

// Equals returns true if this IsolationGroupState value matches the provided
// value.
func (v IsolationGroupState) Equals(rhs IsolationGroupState) bool {
	return v == rhs
}

// MarshalJSON serializes IsolationGroupState into JSON.
//
// If the enum value is recognized, its name is returned. Otherwise,
// its integer value is returned.
//
// This implements json.Marshaler.
func (v IsolationGroupState) MarshalJSON() ([]byte, error) {
	switch int32(v) {
	case 0:
		return ([]byte)("\"INVALID\""), nil
	case 1:
		return ([]byte)("\"HEALTHY\""), nil
	case 2:
		return ([]byte)("\"DRAINED\""), nil
	}
	return ([]byte)(strconv.FormatInt(int64(v), 10)), nil
}

// UnmarshalJSON attempts to decode IsolationGroupState 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 *IsolationGroupState) 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, "IsolationGroupState")
		}
		if x < math.MinInt32 {
			return fmt.Errorf("enum underflow from JSON %q for %q", text, "IsolationGroupState")
		}
		*v = (IsolationGroupState)(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, "IsolationGroupState")
	}
}

type LimitExceededError struct {
	Message string `json:"message,required"`
}

// ToWire translates a LimitExceededError 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 *LimitExceededError) 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
}

// FromWire deserializes a LimitExceededError 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 LimitExceededError struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v LimitExceededError
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *LimitExceededError) 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 LimitExceededError is required")
	}

	return nil
}

// String returns a readable string representation of a LimitExceededError
// struct.
func (v *LimitExceededError) 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("LimitExceededError{%v}", strings.Join(fields[:i], ", "))
}

// ErrorName is the name of this type as defined in the Thrift
// file.
func (*LimitExceededError) ErrorName() string {
	return "LimitExceededError"
}

// Equals returns true if all the fields of this LimitExceededError match the
// provided LimitExceededError.
//
// This function performs a deep comparison.
func (v *LimitExceededError) Equals(rhs *LimitExceededError) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !(v.Message == rhs.Message) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of LimitExceededError.
func (v *LimitExceededError) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	enc.AddString("message", v.Message)
	return err
}

// GetMessage returns the value of Message if it is set or its
// zero value if it is unset.
func (v *LimitExceededError) GetMessage() (o string) {
	if v != nil {
		o = v.Message
	}
	return
}

func (v *LimitExceededError) Error() string {
	return v.String()
}

type ListArchivedWorkflowExecutionsRequest struct {
	Domain        *string `json:"domain,omitempty"`
	PageSize      *int32  `json:"pageSize,omitempty"`
	NextPageToken []byte  `json:"nextPageToken,omitempty"`
	Query         *string `json:"query,omitempty"`
}

// ToWire translates a ListArchivedWorkflowExecutionsRequest 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 *ListArchivedWorkflowExecutionsRequest) ToWire() (wire.Value, error) {
	var (
		fields [4]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.PageSize != nil {
		w, err = wire.NewValueI32(*(v.PageSize)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.NextPageToken != nil {
		w, err = wire.NewValueBinary(v.NextPageToken), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.Query != nil {
		w, err = wire.NewValueString(*(v.Query)), 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 ListArchivedWorkflowExecutionsRequest 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 ListArchivedWorkflowExecutionsRequest struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v ListArchivedWorkflowExecutionsRequest
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *ListArchivedWorkflowExecutionsRequest) 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.TI32 {
				var x int32
				x, err = field.Value.GetI32(), error(nil)
				v.PageSize = &x
				if err != nil {
					return err
				}

			}
		case 30:
			if field.Value.Type() == wire.TBinary {
				v.NextPageToken, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		case 40:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.Query = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a ListArchivedWorkflowExecutionsRequest
// struct.
func (v *ListArchivedWorkflowExecutionsRequest) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [4]string
	i := 0
	if v.Domain != nil {
		fields[i] = fmt.Sprintf("Domain: %v", *(v.Domain))
		i++
	}
	if v.PageSize != nil {
		fields[i] = fmt.Sprintf("PageSize: %v", *(v.PageSize))
		i++
	}
	if v.NextPageToken != nil {
		fields[i] = fmt.Sprintf("NextPageToken: %v", v.NextPageToken)
		i++
	}
	if v.Query != nil {
		fields[i] = fmt.Sprintf("Query: %v", *(v.Query))
		i++
	}

	return fmt.Sprintf("ListArchivedWorkflowExecutionsRequest{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this ListArchivedWorkflowExecutionsRequest match the
// provided ListArchivedWorkflowExecutionsRequest.
//
// This function performs a deep comparison.
func (v *ListArchivedWorkflowExecutionsRequest) Equals(rhs *ListArchivedWorkflowExecutionsRequest) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.Domain, rhs.Domain) {
		return false
	}
	if !_I32_EqualsPtr(v.PageSize, rhs.PageSize) {
		return false
	}
	if !((v.NextPageToken == nil && rhs.NextPageToken == nil) || (v.NextPageToken != nil && rhs.NextPageToken != nil && bytes.Equal(v.NextPageToken, rhs.NextPageToken))) {
		return false
	}
	if !_String_EqualsPtr(v.Query, rhs.Query) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of ListArchivedWorkflowExecutionsRequest.
func (v *ListArchivedWorkflowExecutionsRequest) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Domain != nil {
		enc.AddString("domain", *v.Domain)
	}
	if v.PageSize != nil {
		enc.AddInt32("pageSize", *v.PageSize)
	}
	if v.NextPageToken != nil {
		enc.AddString("nextPageToken", base64.StdEncoding.EncodeToString(v.NextPageToken))
	}
	if v.Query != nil {
		enc.AddString("query", *v.Query)
	}
	return err
}

// GetDomain returns the value of Domain if it is set or its
// zero value if it is unset.
func (v *ListArchivedWorkflowExecutionsRequest) GetDomain() (o string) {
	if v != nil && v.Domain != nil {
		return *v.Domain
	}

	return
}

// IsSetDomain returns true if Domain is not nil.
func (v *ListArchivedWorkflowExecutionsRequest) IsSetDomain() bool {
	return v != nil && v.Domain != nil
}

// GetPageSize returns the value of PageSize if it is set or its
// zero value if it is unset.
func (v *ListArchivedWorkflowExecutionsRequest) GetPageSize() (o int32) {
	if v != nil && v.PageSize != nil {
		return *v.PageSize
	}

	return
}

// IsSetPageSize returns true if PageSize is not nil.
func (v *ListArchivedWorkflowExecutionsRequest) IsSetPageSize() bool {
	return v != nil && v.PageSize != nil
}

// GetNextPageToken returns the value of NextPageToken if it is set or its
// zero value if it is unset.
func (v *ListArchivedWorkflowExecutionsRequest) GetNextPageToken() (o []byte) {
	if v != nil && v.NextPageToken != nil {
		return v.NextPageToken
	}

	return
}

// IsSetNextPageToken returns true if NextPageToken is not nil.
func (v *ListArchivedWorkflowExecutionsRequest) IsSetNextPageToken() bool {
	return v != nil && v.NextPageToken != nil
}

// GetQuery returns the value of Query if it is set or its
// zero value if it is unset.
func (v *ListArchivedWorkflowExecutionsRequest) GetQuery() (o string) {
	if v != nil && v.Query != nil {
		return *v.Query
	}

	return
}

// IsSetQuery returns true if Query is not nil.
func (v *ListArchivedWorkflowExecutionsRequest) IsSetQuery() bool {
	return v != nil && v.Query != nil
}

type ListArchivedWorkflowExecutionsResponse struct {
	Executions    []*WorkflowExecutionInfo `json:"executions,omitempty"`
	NextPageToken []byte                   `json:"nextPageToken,omitempty"`
}

type _List_WorkflowExecutionInfo_ValueList []*WorkflowExecutionInfo

func (v _List_WorkflowExecutionInfo_ValueList) ForEach(f func(wire.Value) error) error {
	for i, x := range v {
		if x == nil {
			return fmt.Errorf("invalid [%v]: value is nil", i)
		}
		w, err := x.ToWire()
		if err != nil {
			return err
		}
		err = f(w)
		if err != nil {
			return err
		}
	}
	return nil
}

func (v _List_WorkflowExecutionInfo_ValueList) Size() int {
	return len(v)
}

func (_List_WorkflowExecutionInfo_ValueList) ValueType() wire.Type {
	return wire.TStruct
}

func (_List_WorkflowExecutionInfo_ValueList) Close() {}

// ToWire translates a ListArchivedWorkflowExecutionsResponse 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 *ListArchivedWorkflowExecutionsResponse) ToWire() (wire.Value, error) {
	var (
		fields [2]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.Executions != nil {
		w, err = wire.NewValueList(_List_WorkflowExecutionInfo_ValueList(v.Executions)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.NextPageToken != nil {
		w, err = wire.NewValueBinary(v.NextPageToken), 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 _List_WorkflowExecutionInfo_Read(l wire.ValueList) ([]*WorkflowExecutionInfo, error) {
	if l.ValueType() != wire.TStruct {
		return nil, nil
	}

	o := make([]*WorkflowExecutionInfo, 0, l.Size())
	err := l.ForEach(func(x wire.Value) error {
		i, err := _WorkflowExecutionInfo_Read(x)
		if err != nil {
			return err
		}
		o = append(o, i)
		return nil
	})
	l.Close()
	return o, err
}

// FromWire deserializes a ListArchivedWorkflowExecutionsResponse 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 ListArchivedWorkflowExecutionsResponse struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v ListArchivedWorkflowExecutionsResponse
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *ListArchivedWorkflowExecutionsResponse) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			if field.Value.Type() == wire.TList {
				v.Executions, err = _List_WorkflowExecutionInfo_Read(field.Value.GetList())
				if err != nil {
					return err
				}

			}
		case 20:
			if field.Value.Type() == wire.TBinary {
				v.NextPageToken, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a ListArchivedWorkflowExecutionsResponse
// struct.
func (v *ListArchivedWorkflowExecutionsResponse) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [2]string
	i := 0
	if v.Executions != nil {
		fields[i] = fmt.Sprintf("Executions: %v", v.Executions)
		i++
	}
	if v.NextPageToken != nil {
		fields[i] = fmt.Sprintf("NextPageToken: %v", v.NextPageToken)
		i++
	}

	return fmt.Sprintf("ListArchivedWorkflowExecutionsResponse{%v}", strings.Join(fields[:i], ", "))
}

func _List_WorkflowExecutionInfo_Equals(lhs, rhs []*WorkflowExecutionInfo) bool {
	if len(lhs) != len(rhs) {
		return false
	}

	for i, lv := range lhs {
		rv := rhs[i]
		if !lv.Equals(rv) {
			return false
		}
	}

	return true
}

// Equals returns true if all the fields of this ListArchivedWorkflowExecutionsResponse match the
// provided ListArchivedWorkflowExecutionsResponse.
//
// This function performs a deep comparison.
func (v *ListArchivedWorkflowExecutionsResponse) Equals(rhs *ListArchivedWorkflowExecutionsResponse) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !((v.Executions == nil && rhs.Executions == nil) || (v.Executions != nil && rhs.Executions != nil && _List_WorkflowExecutionInfo_Equals(v.Executions, rhs.Executions))) {
		return false
	}
	if !((v.NextPageToken == nil && rhs.NextPageToken == nil) || (v.NextPageToken != nil && rhs.NextPageToken != nil && bytes.Equal(v.NextPageToken, rhs.NextPageToken))) {
		return false
	}

	return true
}

type _List_WorkflowExecutionInfo_Zapper []*WorkflowExecutionInfo

// MarshalLogArray implements zapcore.ArrayMarshaler, enabling
// fast logging of _List_WorkflowExecutionInfo_Zapper.
func (l _List_WorkflowExecutionInfo_Zapper) MarshalLogArray(enc zapcore.ArrayEncoder) (err error) {
	for _, v := range l {
		err = multierr.Append(err, enc.AppendObject(v))
	}
	return err
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of ListArchivedWorkflowExecutionsResponse.
func (v *ListArchivedWorkflowExecutionsResponse) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Executions != nil {
		err = multierr.Append(err, enc.AddArray("executions", (_List_WorkflowExecutionInfo_Zapper)(v.Executions)))
	}
	if v.NextPageToken != nil {
		enc.AddString("nextPageToken", base64.StdEncoding.EncodeToString(v.NextPageToken))
	}
	return err
}

// GetExecutions returns the value of Executions if it is set or its
// zero value if it is unset.
func (v *ListArchivedWorkflowExecutionsResponse) GetExecutions() (o []*WorkflowExecutionInfo) {
	if v != nil && v.Executions != nil {
		return v.Executions
	}

	return
}

// IsSetExecutions returns true if Executions is not nil.
func (v *ListArchivedWorkflowExecutionsResponse) IsSetExecutions() bool {
	return v != nil && v.Executions != nil
}

// GetNextPageToken returns the value of NextPageToken if it is set or its
// zero value if it is unset.
func (v *ListArchivedWorkflowExecutionsResponse) GetNextPageToken() (o []byte) {
	if v != nil && v.NextPageToken != nil {
		return v.NextPageToken
	}

	return
}

// IsSetNextPageToken returns true if NextPageToken is not nil.
func (v *ListArchivedWorkflowExecutionsResponse) IsSetNextPageToken() bool {
	return v != nil && v.NextPageToken != nil
}

type ListClosedWorkflowExecutionsRequest struct {
	Domain          *string                       `json:"domain,omitempty"`
	MaximumPageSize *int32                        `json:"maximumPageSize,omitempty"`
	NextPageToken   []byte                        `json:"nextPageToken,omitempty"`
	StartTimeFilter *StartTimeFilter              `json:"StartTimeFilter,omitempty"`
	ExecutionFilter *WorkflowExecutionFilter      `json:"executionFilter,omitempty"`
	TypeFilter      *WorkflowTypeFilter           `json:"typeFilter,omitempty"`
	StatusFilter    *WorkflowExecutionCloseStatus `json:"statusFilter,omitempty"`
}

// ToWire translates a ListClosedWorkflowExecutionsRequest 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 *ListClosedWorkflowExecutionsRequest) ToWire() (wire.Value, error) {
	var (
		fields [7]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.MaximumPageSize != nil {
		w, err = wire.NewValueI32(*(v.MaximumPageSize)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.NextPageToken != nil {
		w, err = wire.NewValueBinary(v.NextPageToken), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.StartTimeFilter != nil {
		w, err = v.StartTimeFilter.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 40, Value: w}
		i++
	}
	if v.ExecutionFilter != nil {
		w, err = v.ExecutionFilter.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 50, Value: w}
		i++
	}
	if v.TypeFilter != nil {
		w, err = v.TypeFilter.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 60, Value: w}
		i++
	}
	if v.StatusFilter != nil {
		w, err = v.StatusFilter.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 70, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

func _StartTimeFilter_Read(w wire.Value) (*StartTimeFilter, error) {
	var v StartTimeFilter
	err := v.FromWire(w)
	return &v, err
}

func _WorkflowExecutionFilter_Read(w wire.Value) (*WorkflowExecutionFilter, error) {
	var v WorkflowExecutionFilter
	err := v.FromWire(w)
	return &v, err
}

func _WorkflowTypeFilter_Read(w wire.Value) (*WorkflowTypeFilter, error) {
	var v WorkflowTypeFilter
	err := v.FromWire(w)
	return &v, err
}

func _WorkflowExecutionCloseStatus_Read(w wire.Value) (WorkflowExecutionCloseStatus, error) {
	var v WorkflowExecutionCloseStatus
	err := v.FromWire(w)
	return v, err
}

// FromWire deserializes a ListClosedWorkflowExecutionsRequest 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 ListClosedWorkflowExecutionsRequest struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v ListClosedWorkflowExecutionsRequest
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *ListClosedWorkflowExecutionsRequest) 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.TI32 {
				var x int32
				x, err = field.Value.GetI32(), error(nil)
				v.MaximumPageSize = &x
				if err != nil {
					return err
				}

			}
		case 30:
			if field.Value.Type() == wire.TBinary {
				v.NextPageToken, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		case 40:
			if field.Value.Type() == wire.TStruct {
				v.StartTimeFilter, err = _StartTimeFilter_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 50:
			if field.Value.Type() == wire.TStruct {
				v.ExecutionFilter, err = _WorkflowExecutionFilter_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 60:
			if field.Value.Type() == wire.TStruct {
				v.TypeFilter, err = _WorkflowTypeFilter_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 70:
			if field.Value.Type() == wire.TI32 {
				var x WorkflowExecutionCloseStatus
				x, err = _WorkflowExecutionCloseStatus_Read(field.Value)
				v.StatusFilter = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a ListClosedWorkflowExecutionsRequest
// struct.
func (v *ListClosedWorkflowExecutionsRequest) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [7]string
	i := 0
	if v.Domain != nil {
		fields[i] = fmt.Sprintf("Domain: %v", *(v.Domain))
		i++
	}
	if v.MaximumPageSize != nil {
		fields[i] = fmt.Sprintf("MaximumPageSize: %v", *(v.MaximumPageSize))
		i++
	}
	if v.NextPageToken != nil {
		fields[i] = fmt.Sprintf("NextPageToken: %v", v.NextPageToken)
		i++
	}
	if v.StartTimeFilter != nil {
		fields[i] = fmt.Sprintf("StartTimeFilter: %v", v.StartTimeFilter)
		i++
	}
	if v.ExecutionFilter != nil {
		fields[i] = fmt.Sprintf("ExecutionFilter: %v", v.ExecutionFilter)
		i++
	}
	if v.TypeFilter != nil {
		fields[i] = fmt.Sprintf("TypeFilter: %v", v.TypeFilter)
		i++
	}
	if v.StatusFilter != nil {
		fields[i] = fmt.Sprintf("StatusFilter: %v", *(v.StatusFilter))
		i++
	}

	return fmt.Sprintf("ListClosedWorkflowExecutionsRequest{%v}", strings.Join(fields[:i], ", "))
}

func _WorkflowExecutionCloseStatus_EqualsPtr(lhs, rhs *WorkflowExecutionCloseStatus) bool {
	if lhs != nil && rhs != nil {

		x := *lhs
		y := *rhs
		return x.Equals(y)
	}
	return lhs == nil && rhs == nil
}

// Equals returns true if all the fields of this ListClosedWorkflowExecutionsRequest match the
// provided ListClosedWorkflowExecutionsRequest.
//
// This function performs a deep comparison.
func (v *ListClosedWorkflowExecutionsRequest) Equals(rhs *ListClosedWorkflowExecutionsRequest) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.Domain, rhs.Domain) {
		return false
	}
	if !_I32_EqualsPtr(v.MaximumPageSize, rhs.MaximumPageSize) {
		return false
	}
	if !((v.NextPageToken == nil && rhs.NextPageToken == nil) || (v.NextPageToken != nil && rhs.NextPageToken != nil && bytes.Equal(v.NextPageToken, rhs.NextPageToken))) {
		return false
	}
	if !((v.StartTimeFilter == nil && rhs.StartTimeFilter == nil) || (v.StartTimeFilter != nil && rhs.StartTimeFilter != nil && v.StartTimeFilter.Equals(rhs.StartTimeFilter))) {
		return false
	}
	if !((v.ExecutionFilter == nil && rhs.ExecutionFilter == nil) || (v.ExecutionFilter != nil && rhs.ExecutionFilter != nil && v.ExecutionFilter.Equals(rhs.ExecutionFilter))) {
		return false
	}
	if !((v.TypeFilter == nil && rhs.TypeFilter == nil) || (v.TypeFilter != nil && rhs.TypeFilter != nil && v.TypeFilter.Equals(rhs.TypeFilter))) {
		return false
	}
	if !_WorkflowExecutionCloseStatus_EqualsPtr(v.StatusFilter, rhs.StatusFilter) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of ListClosedWorkflowExecutionsRequest.
func (v *ListClosedWorkflowExecutionsRequest) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Domain != nil {
		enc.AddString("domain", *v.Domain)
	}
	if v.MaximumPageSize != nil {
		enc.AddInt32("maximumPageSize", *v.MaximumPageSize)
	}
	if v.NextPageToken != nil {
		enc.AddString("nextPageToken", base64.StdEncoding.EncodeToString(v.NextPageToken))
	}
	if v.StartTimeFilter != nil {
		err = multierr.Append(err, enc.AddObject("StartTimeFilter", v.StartTimeFilter))
	}
	if v.ExecutionFilter != nil {
		err = multierr.Append(err, enc.AddObject("executionFilter", v.ExecutionFilter))
	}
	if v.TypeFilter != nil {
		err = multierr.Append(err, enc.AddObject("typeFilter", v.TypeFilter))
	}
	if v.StatusFilter != nil {
		err = multierr.Append(err, enc.AddObject("statusFilter", *v.StatusFilter))
	}
	return err
}

// GetDomain returns the value of Domain if it is set or its
// zero value if it is unset.
func (v *ListClosedWorkflowExecutionsRequest) GetDomain() (o string) {
	if v != nil && v.Domain != nil {
		return *v.Domain
	}

	return
}

// IsSetDomain returns true if Domain is not nil.
func (v *ListClosedWorkflowExecutionsRequest) IsSetDomain() bool {
	return v != nil && v.Domain != nil
}

// GetMaximumPageSize returns the value of MaximumPageSize if it is set or its
// zero value if it is unset.
func (v *ListClosedWorkflowExecutionsRequest) GetMaximumPageSize() (o int32) {
	if v != nil && v.MaximumPageSize != nil {
		return *v.MaximumPageSize
	}

	return
}

// IsSetMaximumPageSize returns true if MaximumPageSize is not nil.
func (v *ListClosedWorkflowExecutionsRequest) IsSetMaximumPageSize() bool {
	return v != nil && v.MaximumPageSize != nil
}

// GetNextPageToken returns the value of NextPageToken if it is set or its
// zero value if it is unset.
func (v *ListClosedWorkflowExecutionsRequest) GetNextPageToken() (o []byte) {
	if v != nil && v.NextPageToken != nil {
		return v.NextPageToken
	}

	return
}

// IsSetNextPageToken returns true if NextPageToken is not nil.
func (v *ListClosedWorkflowExecutionsRequest) IsSetNextPageToken() bool {
	return v != nil && v.NextPageToken != nil
}

// GetStartTimeFilter returns the value of StartTimeFilter if it is set or its
// zero value if it is unset.
func (v *ListClosedWorkflowExecutionsRequest) GetStartTimeFilter() (o *StartTimeFilter) {
	if v != nil && v.StartTimeFilter != nil {
		return v.StartTimeFilter
	}

	return
}

// IsSetStartTimeFilter returns true if StartTimeFilter is not nil.
func (v *ListClosedWorkflowExecutionsRequest) IsSetStartTimeFilter() bool {
	return v != nil && v.StartTimeFilter != nil
}

// GetExecutionFilter returns the value of ExecutionFilter if it is set or its
// zero value if it is unset.
func (v *ListClosedWorkflowExecutionsRequest) GetExecutionFilter() (o *WorkflowExecutionFilter) {
	if v != nil && v.ExecutionFilter != nil {
		return v.ExecutionFilter
	}

	return
}

// IsSetExecutionFilter returns true if ExecutionFilter is not nil.
func (v *ListClosedWorkflowExecutionsRequest) IsSetExecutionFilter() bool {
	return v != nil && v.ExecutionFilter != nil
}

// GetTypeFilter returns the value of TypeFilter if it is set or its
// zero value if it is unset.
func (v *ListClosedWorkflowExecutionsRequest) GetTypeFilter() (o *WorkflowTypeFilter) {
	if v != nil && v.TypeFilter != nil {
		return v.TypeFilter
	}

	return
}

// IsSetTypeFilter returns true if TypeFilter is not nil.
func (v *ListClosedWorkflowExecutionsRequest) IsSetTypeFilter() bool {
	return v != nil && v.TypeFilter != nil
}

// GetStatusFilter returns the value of StatusFilter if it is set or its
// zero value if it is unset.
func (v *ListClosedWorkflowExecutionsRequest) GetStatusFilter() (o WorkflowExecutionCloseStatus) {
	if v != nil && v.StatusFilter != nil {
		return *v.StatusFilter
	}

	return
}

// IsSetStatusFilter returns true if StatusFilter is not nil.
func (v *ListClosedWorkflowExecutionsRequest) IsSetStatusFilter() bool {
	return v != nil && v.StatusFilter != nil
}

type ListClosedWorkflowExecutionsResponse struct {
	Executions    []*WorkflowExecutionInfo `json:"executions,omitempty"`
	NextPageToken []byte                   `json:"nextPageToken,omitempty"`
}

// ToWire translates a ListClosedWorkflowExecutionsResponse 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 *ListClosedWorkflowExecutionsResponse) ToWire() (wire.Value, error) {
	var (
		fields [2]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.Executions != nil {
		w, err = wire.NewValueList(_List_WorkflowExecutionInfo_ValueList(v.Executions)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.NextPageToken != nil {
		w, err = wire.NewValueBinary(v.NextPageToken), 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
}

// FromWire deserializes a ListClosedWorkflowExecutionsResponse 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 ListClosedWorkflowExecutionsResponse struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v ListClosedWorkflowExecutionsResponse
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *ListClosedWorkflowExecutionsResponse) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			if field.Value.Type() == wire.TList {
				v.Executions, err = _List_WorkflowExecutionInfo_Read(field.Value.GetList())
				if err != nil {
					return err
				}

			}
		case 20:
			if field.Value.Type() == wire.TBinary {
				v.NextPageToken, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a ListClosedWorkflowExecutionsResponse
// struct.
func (v *ListClosedWorkflowExecutionsResponse) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [2]string
	i := 0
	if v.Executions != nil {
		fields[i] = fmt.Sprintf("Executions: %v", v.Executions)
		i++
	}
	if v.NextPageToken != nil {
		fields[i] = fmt.Sprintf("NextPageToken: %v", v.NextPageToken)
		i++
	}

	return fmt.Sprintf("ListClosedWorkflowExecutionsResponse{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this ListClosedWorkflowExecutionsResponse match the
// provided ListClosedWorkflowExecutionsResponse.
//
// This function performs a deep comparison.
func (v *ListClosedWorkflowExecutionsResponse) Equals(rhs *ListClosedWorkflowExecutionsResponse) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !((v.Executions == nil && rhs.Executions == nil) || (v.Executions != nil && rhs.Executions != nil && _List_WorkflowExecutionInfo_Equals(v.Executions, rhs.Executions))) {
		return false
	}
	if !((v.NextPageToken == nil && rhs.NextPageToken == nil) || (v.NextPageToken != nil && rhs.NextPageToken != nil && bytes.Equal(v.NextPageToken, rhs.NextPageToken))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of ListClosedWorkflowExecutionsResponse.
func (v *ListClosedWorkflowExecutionsResponse) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Executions != nil {
		err = multierr.Append(err, enc.AddArray("executions", (_List_WorkflowExecutionInfo_Zapper)(v.Executions)))
	}
	if v.NextPageToken != nil {
		enc.AddString("nextPageToken", base64.StdEncoding.EncodeToString(v.NextPageToken))
	}
	return err
}

// GetExecutions returns the value of Executions if it is set or its
// zero value if it is unset.
func (v *ListClosedWorkflowExecutionsResponse) GetExecutions() (o []*WorkflowExecutionInfo) {
	if v != nil && v.Executions != nil {
		return v.Executions
	}

	return
}

// IsSetExecutions returns true if Executions is not nil.
func (v *ListClosedWorkflowExecutionsResponse) IsSetExecutions() bool {
	return v != nil && v.Executions != nil
}

// GetNextPageToken returns the value of NextPageToken if it is set or its
// zero value if it is unset.
func (v *ListClosedWorkflowExecutionsResponse) GetNextPageToken() (o []byte) {
	if v != nil && v.NextPageToken != nil {
		return v.NextPageToken
	}

	return
}

// IsSetNextPageToken returns true if NextPageToken is not nil.
func (v *ListClosedWorkflowExecutionsResponse) IsSetNextPageToken() bool {
	return v != nil && v.NextPageToken != nil
}

type ListDomainsRequest struct {
	PageSize      *int32 `json:"pageSize,omitempty"`
	NextPageToken []byte `json:"nextPageToken,omitempty"`
}

// ToWire translates a ListDomainsRequest 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 *ListDomainsRequest) ToWire() (wire.Value, error) {
	var (
		fields [2]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.PageSize != nil {
		w, err = wire.NewValueI32(*(v.PageSize)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.NextPageToken != nil {
		w, err = wire.NewValueBinary(v.NextPageToken), 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
}

// FromWire deserializes a ListDomainsRequest 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 ListDomainsRequest struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v ListDomainsRequest
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *ListDomainsRequest) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			if field.Value.Type() == wire.TI32 {
				var x int32
				x, err = field.Value.GetI32(), error(nil)
				v.PageSize = &x
				if err != nil {
					return err
				}

			}
		case 20:
			if field.Value.Type() == wire.TBinary {
				v.NextPageToken, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a ListDomainsRequest
// struct.
func (v *ListDomainsRequest) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [2]string
	i := 0
	if v.PageSize != nil {
		fields[i] = fmt.Sprintf("PageSize: %v", *(v.PageSize))
		i++
	}
	if v.NextPageToken != nil {
		fields[i] = fmt.Sprintf("NextPageToken: %v", v.NextPageToken)
		i++
	}

	return fmt.Sprintf("ListDomainsRequest{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this ListDomainsRequest match the
// provided ListDomainsRequest.
//
// This function performs a deep comparison.
func (v *ListDomainsRequest) Equals(rhs *ListDomainsRequest) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_I32_EqualsPtr(v.PageSize, rhs.PageSize) {
		return false
	}
	if !((v.NextPageToken == nil && rhs.NextPageToken == nil) || (v.NextPageToken != nil && rhs.NextPageToken != nil && bytes.Equal(v.NextPageToken, rhs.NextPageToken))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of ListDomainsRequest.
func (v *ListDomainsRequest) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.PageSize != nil {
		enc.AddInt32("pageSize", *v.PageSize)
	}
	if v.NextPageToken != nil {
		enc.AddString("nextPageToken", base64.StdEncoding.EncodeToString(v.NextPageToken))
	}
	return err
}

// GetPageSize returns the value of PageSize if it is set or its
// zero value if it is unset.
func (v *ListDomainsRequest) GetPageSize() (o int32) {
	if v != nil && v.PageSize != nil {
		return *v.PageSize
	}

	return
}

// IsSetPageSize returns true if PageSize is not nil.
func (v *ListDomainsRequest) IsSetPageSize() bool {
	return v != nil && v.PageSize != nil
}

// GetNextPageToken returns the value of NextPageToken if it is set or its
// zero value if it is unset.
func (v *ListDomainsRequest) GetNextPageToken() (o []byte) {
	if v != nil && v.NextPageToken != nil {
		return v.NextPageToken
	}

	return
}

// IsSetNextPageToken returns true if NextPageToken is not nil.
func (v *ListDomainsRequest) IsSetNextPageToken() bool {
	return v != nil && v.NextPageToken != nil
}

type ListDomainsResponse struct {
	Domains       []*DescribeDomainResponse `json:"domains,omitempty"`
	NextPageToken []byte                    `json:"nextPageToken,omitempty"`
}

type _List_DescribeDomainResponse_ValueList []*DescribeDomainResponse

func (v _List_DescribeDomainResponse_ValueList) ForEach(f func(wire.Value) error) error {
	for i, x := range v {
		if x == nil {
			return fmt.Errorf("invalid [%v]: value is nil", i)
		}
		w, err := x.ToWire()
		if err != nil {
			return err
		}
		err = f(w)
		if err != nil {
			return err
		}
	}
	return nil
}

func (v _List_DescribeDomainResponse_ValueList) Size() int {
	return len(v)
}

func (_List_DescribeDomainResponse_ValueList) ValueType() wire.Type {
	return wire.TStruct
}

func (_List_DescribeDomainResponse_ValueList) Close() {}

// ToWire translates a ListDomainsResponse 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 *ListDomainsResponse) ToWire() (wire.Value, error) {
	var (
		fields [2]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.Domains != nil {
		w, err = wire.NewValueList(_List_DescribeDomainResponse_ValueList(v.Domains)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.NextPageToken != nil {
		w, err = wire.NewValueBinary(v.NextPageToken), 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 _DescribeDomainResponse_Read(w wire.Value) (*DescribeDomainResponse, error) {
	var v DescribeDomainResponse
	err := v.FromWire(w)
	return &v, err
}

func _List_DescribeDomainResponse_Read(l wire.ValueList) ([]*DescribeDomainResponse, error) {
	if l.ValueType() != wire.TStruct {
		return nil, nil
	}

	o := make([]*DescribeDomainResponse, 0, l.Size())
	err := l.ForEach(func(x wire.Value) error {
		i, err := _DescribeDomainResponse_Read(x)
		if err != nil {
			return err
		}
		o = append(o, i)
		return nil
	})
	l.Close()
	return o, err
}

// FromWire deserializes a ListDomainsResponse 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 ListDomainsResponse struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v ListDomainsResponse
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *ListDomainsResponse) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			if field.Value.Type() == wire.TList {
				v.Domains, err = _List_DescribeDomainResponse_Read(field.Value.GetList())
				if err != nil {
					return err
				}

			}
		case 20:
			if field.Value.Type() == wire.TBinary {
				v.NextPageToken, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a ListDomainsResponse
// struct.
func (v *ListDomainsResponse) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [2]string
	i := 0
	if v.Domains != nil {
		fields[i] = fmt.Sprintf("Domains: %v", v.Domains)
		i++
	}
	if v.NextPageToken != nil {
		fields[i] = fmt.Sprintf("NextPageToken: %v", v.NextPageToken)
		i++
	}

	return fmt.Sprintf("ListDomainsResponse{%v}", strings.Join(fields[:i], ", "))
}

func _List_DescribeDomainResponse_Equals(lhs, rhs []*DescribeDomainResponse) bool {
	if len(lhs) != len(rhs) {
		return false
	}

	for i, lv := range lhs {
		rv := rhs[i]
		if !lv.Equals(rv) {
			return false
		}
	}

	return true
}

// Equals returns true if all the fields of this ListDomainsResponse match the
// provided ListDomainsResponse.
//
// This function performs a deep comparison.
func (v *ListDomainsResponse) Equals(rhs *ListDomainsResponse) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !((v.Domains == nil && rhs.Domains == nil) || (v.Domains != nil && rhs.Domains != nil && _List_DescribeDomainResponse_Equals(v.Domains, rhs.Domains))) {
		return false
	}
	if !((v.NextPageToken == nil && rhs.NextPageToken == nil) || (v.NextPageToken != nil && rhs.NextPageToken != nil && bytes.Equal(v.NextPageToken, rhs.NextPageToken))) {
		return false
	}

	return true
}

type _List_DescribeDomainResponse_Zapper []*DescribeDomainResponse

// MarshalLogArray implements zapcore.ArrayMarshaler, enabling
// fast logging of _List_DescribeDomainResponse_Zapper.
func (l _List_DescribeDomainResponse_Zapper) MarshalLogArray(enc zapcore.ArrayEncoder) (err error) {
	for _, v := range l {
		err = multierr.Append(err, enc.AppendObject(v))
	}
	return err
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of ListDomainsResponse.
func (v *ListDomainsResponse) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Domains != nil {
		err = multierr.Append(err, enc.AddArray("domains", (_List_DescribeDomainResponse_Zapper)(v.Domains)))
	}
	if v.NextPageToken != nil {
		enc.AddString("nextPageToken", base64.StdEncoding.EncodeToString(v.NextPageToken))
	}
	return err
}

// GetDomains returns the value of Domains if it is set or its
// zero value if it is unset.
func (v *ListDomainsResponse) GetDomains() (o []*DescribeDomainResponse) {
	if v != nil && v.Domains != nil {
		return v.Domains
	}

	return
}

// IsSetDomains returns true if Domains is not nil.
func (v *ListDomainsResponse) IsSetDomains() bool {
	return v != nil && v.Domains != nil
}

// GetNextPageToken returns the value of NextPageToken if it is set or its
// zero value if it is unset.
func (v *ListDomainsResponse) GetNextPageToken() (o []byte) {
	if v != nil && v.NextPageToken != nil {
		return v.NextPageToken
	}

	return
}

// IsSetNextPageToken returns true if NextPageToken is not nil.
func (v *ListDomainsResponse) IsSetNextPageToken() bool {
	return v != nil && v.NextPageToken != nil
}

type ListOpenWorkflowExecutionsRequest struct {
	Domain          *string                  `json:"domain,omitempty"`
	MaximumPageSize *int32                   `json:"maximumPageSize,omitempty"`
	NextPageToken   []byte                   `json:"nextPageToken,omitempty"`
	StartTimeFilter *StartTimeFilter         `json:"StartTimeFilter,omitempty"`
	ExecutionFilter *WorkflowExecutionFilter `json:"executionFilter,omitempty"`
	TypeFilter      *WorkflowTypeFilter      `json:"typeFilter,omitempty"`
}

// ToWire translates a ListOpenWorkflowExecutionsRequest 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 *ListOpenWorkflowExecutionsRequest) ToWire() (wire.Value, error) {
	var (
		fields [6]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.MaximumPageSize != nil {
		w, err = wire.NewValueI32(*(v.MaximumPageSize)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.NextPageToken != nil {
		w, err = wire.NewValueBinary(v.NextPageToken), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.StartTimeFilter != nil {
		w, err = v.StartTimeFilter.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 40, Value: w}
		i++
	}
	if v.ExecutionFilter != nil {
		w, err = v.ExecutionFilter.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 50, Value: w}
		i++
	}
	if v.TypeFilter != nil {
		w, err = v.TypeFilter.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 60, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

// FromWire deserializes a ListOpenWorkflowExecutionsRequest 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 ListOpenWorkflowExecutionsRequest struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v ListOpenWorkflowExecutionsRequest
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *ListOpenWorkflowExecutionsRequest) 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.TI32 {
				var x int32
				x, err = field.Value.GetI32(), error(nil)
				v.MaximumPageSize = &x
				if err != nil {
					return err
				}

			}
		case 30:
			if field.Value.Type() == wire.TBinary {
				v.NextPageToken, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		case 40:
			if field.Value.Type() == wire.TStruct {
				v.StartTimeFilter, err = _StartTimeFilter_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 50:
			if field.Value.Type() == wire.TStruct {
				v.ExecutionFilter, err = _WorkflowExecutionFilter_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 60:
			if field.Value.Type() == wire.TStruct {
				v.TypeFilter, err = _WorkflowTypeFilter_Read(field.Value)
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a ListOpenWorkflowExecutionsRequest
// struct.
func (v *ListOpenWorkflowExecutionsRequest) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [6]string
	i := 0
	if v.Domain != nil {
		fields[i] = fmt.Sprintf("Domain: %v", *(v.Domain))
		i++
	}
	if v.MaximumPageSize != nil {
		fields[i] = fmt.Sprintf("MaximumPageSize: %v", *(v.MaximumPageSize))
		i++
	}
	if v.NextPageToken != nil {
		fields[i] = fmt.Sprintf("NextPageToken: %v", v.NextPageToken)
		i++
	}
	if v.StartTimeFilter != nil {
		fields[i] = fmt.Sprintf("StartTimeFilter: %v", v.StartTimeFilter)
		i++
	}
	if v.ExecutionFilter != nil {
		fields[i] = fmt.Sprintf("ExecutionFilter: %v", v.ExecutionFilter)
		i++
	}
	if v.TypeFilter != nil {
		fields[i] = fmt.Sprintf("TypeFilter: %v", v.TypeFilter)
		i++
	}

	return fmt.Sprintf("ListOpenWorkflowExecutionsRequest{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this ListOpenWorkflowExecutionsRequest match the
// provided ListOpenWorkflowExecutionsRequest.
//
// This function performs a deep comparison.
func (v *ListOpenWorkflowExecutionsRequest) Equals(rhs *ListOpenWorkflowExecutionsRequest) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.Domain, rhs.Domain) {
		return false
	}
	if !_I32_EqualsPtr(v.MaximumPageSize, rhs.MaximumPageSize) {
		return false
	}
	if !((v.NextPageToken == nil && rhs.NextPageToken == nil) || (v.NextPageToken != nil && rhs.NextPageToken != nil && bytes.Equal(v.NextPageToken, rhs.NextPageToken))) {
		return false
	}
	if !((v.StartTimeFilter == nil && rhs.StartTimeFilter == nil) || (v.StartTimeFilter != nil && rhs.StartTimeFilter != nil && v.StartTimeFilter.Equals(rhs.StartTimeFilter))) {
		return false
	}
	if !((v.ExecutionFilter == nil && rhs.ExecutionFilter == nil) || (v.ExecutionFilter != nil && rhs.ExecutionFilter != nil && v.ExecutionFilter.Equals(rhs.ExecutionFilter))) {
		return false
	}
	if !((v.TypeFilter == nil && rhs.TypeFilter == nil) || (v.TypeFilter != nil && rhs.TypeFilter != nil && v.TypeFilter.Equals(rhs.TypeFilter))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of ListOpenWorkflowExecutionsRequest.
func (v *ListOpenWorkflowExecutionsRequest) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Domain != nil {
		enc.AddString("domain", *v.Domain)
	}
	if v.MaximumPageSize != nil {
		enc.AddInt32("maximumPageSize", *v.MaximumPageSize)
	}
	if v.NextPageToken != nil {
		enc.AddString("nextPageToken", base64.StdEncoding.EncodeToString(v.NextPageToken))
	}
	if v.StartTimeFilter != nil {
		err = multierr.Append(err, enc.AddObject("StartTimeFilter", v.StartTimeFilter))
	}
	if v.ExecutionFilter != nil {
		err = multierr.Append(err, enc.AddObject("executionFilter", v.ExecutionFilter))
	}
	if v.TypeFilter != nil {
		err = multierr.Append(err, enc.AddObject("typeFilter", v.TypeFilter))
	}
	return err
}

// GetDomain returns the value of Domain if it is set or its
// zero value if it is unset.
func (v *ListOpenWorkflowExecutionsRequest) GetDomain() (o string) {
	if v != nil && v.Domain != nil {
		return *v.Domain
	}

	return
}

// IsSetDomain returns true if Domain is not nil.
func (v *ListOpenWorkflowExecutionsRequest) IsSetDomain() bool {
	return v != nil && v.Domain != nil
}

// GetMaximumPageSize returns the value of MaximumPageSize if it is set or its
// zero value if it is unset.
func (v *ListOpenWorkflowExecutionsRequest) GetMaximumPageSize() (o int32) {
	if v != nil && v.MaximumPageSize != nil {
		return *v.MaximumPageSize
	}

	return
}

// IsSetMaximumPageSize returns true if MaximumPageSize is not nil.
func (v *ListOpenWorkflowExecutionsRequest) IsSetMaximumPageSize() bool {
	return v != nil && v.MaximumPageSize != nil
}

// GetNextPageToken returns the value of NextPageToken if it is set or its
// zero value if it is unset.
func (v *ListOpenWorkflowExecutionsRequest) GetNextPageToken() (o []byte) {
	if v != nil && v.NextPageToken != nil {
		return v.NextPageToken
	}

	return
}

// IsSetNextPageToken returns true if NextPageToken is not nil.
func (v *ListOpenWorkflowExecutionsRequest) IsSetNextPageToken() bool {
	return v != nil && v.NextPageToken != nil
}

// GetStartTimeFilter returns the value of StartTimeFilter if it is set or its
// zero value if it is unset.
func (v *ListOpenWorkflowExecutionsRequest) GetStartTimeFilter() (o *StartTimeFilter) {
	if v != nil && v.StartTimeFilter != nil {
		return v.StartTimeFilter
	}

	return
}

// IsSetStartTimeFilter returns true if StartTimeFilter is not nil.
func (v *ListOpenWorkflowExecutionsRequest) IsSetStartTimeFilter() bool {
	return v != nil && v.StartTimeFilter != nil
}

// GetExecutionFilter returns the value of ExecutionFilter if it is set or its
// zero value if it is unset.
func (v *ListOpenWorkflowExecutionsRequest) GetExecutionFilter() (o *WorkflowExecutionFilter) {
	if v != nil && v.ExecutionFilter != nil {
		return v.ExecutionFilter
	}

	return
}

// IsSetExecutionFilter returns true if ExecutionFilter is not nil.
func (v *ListOpenWorkflowExecutionsRequest) IsSetExecutionFilter() bool {
	return v != nil && v.ExecutionFilter != nil
}

// GetTypeFilter returns the value of TypeFilter if it is set or its
// zero value if it is unset.
func (v *ListOpenWorkflowExecutionsRequest) GetTypeFilter() (o *WorkflowTypeFilter) {
	if v != nil && v.TypeFilter != nil {
		return v.TypeFilter
	}

	return
}

// IsSetTypeFilter returns true if TypeFilter is not nil.
func (v *ListOpenWorkflowExecutionsRequest) IsSetTypeFilter() bool {
	return v != nil && v.TypeFilter != nil
}

type ListOpenWorkflowExecutionsResponse struct {
	Executions    []*WorkflowExecutionInfo `json:"executions,omitempty"`
	NextPageToken []byte                   `json:"nextPageToken,omitempty"`
}

// ToWire translates a ListOpenWorkflowExecutionsResponse 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 *ListOpenWorkflowExecutionsResponse) ToWire() (wire.Value, error) {
	var (
		fields [2]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.Executions != nil {
		w, err = wire.NewValueList(_List_WorkflowExecutionInfo_ValueList(v.Executions)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.NextPageToken != nil {
		w, err = wire.NewValueBinary(v.NextPageToken), 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
}

// FromWire deserializes a ListOpenWorkflowExecutionsResponse 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 ListOpenWorkflowExecutionsResponse struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v ListOpenWorkflowExecutionsResponse
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *ListOpenWorkflowExecutionsResponse) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			if field.Value.Type() == wire.TList {
				v.Executions, err = _List_WorkflowExecutionInfo_Read(field.Value.GetList())
				if err != nil {
					return err
				}

			}
		case 20:
			if field.Value.Type() == wire.TBinary {
				v.NextPageToken, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a ListOpenWorkflowExecutionsResponse
// struct.
func (v *ListOpenWorkflowExecutionsResponse) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [2]string
	i := 0
	if v.Executions != nil {
		fields[i] = fmt.Sprintf("Executions: %v", v.Executions)
		i++
	}
	if v.NextPageToken != nil {
		fields[i] = fmt.Sprintf("NextPageToken: %v", v.NextPageToken)
		i++
	}

	return fmt.Sprintf("ListOpenWorkflowExecutionsResponse{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this ListOpenWorkflowExecutionsResponse match the
// provided ListOpenWorkflowExecutionsResponse.
//
// This function performs a deep comparison.
func (v *ListOpenWorkflowExecutionsResponse) Equals(rhs *ListOpenWorkflowExecutionsResponse) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !((v.Executions == nil && rhs.Executions == nil) || (v.Executions != nil && rhs.Executions != nil && _List_WorkflowExecutionInfo_Equals(v.Executions, rhs.Executions))) {
		return false
	}
	if !((v.NextPageToken == nil && rhs.NextPageToken == nil) || (v.NextPageToken != nil && rhs.NextPageToken != nil && bytes.Equal(v.NextPageToken, rhs.NextPageToken))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of ListOpenWorkflowExecutionsResponse.
func (v *ListOpenWorkflowExecutionsResponse) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Executions != nil {
		err = multierr.Append(err, enc.AddArray("executions", (_List_WorkflowExecutionInfo_Zapper)(v.Executions)))
	}
	if v.NextPageToken != nil {
		enc.AddString("nextPageToken", base64.StdEncoding.EncodeToString(v.NextPageToken))
	}
	return err
}

// GetExecutions returns the value of Executions if it is set or its
// zero value if it is unset.
func (v *ListOpenWorkflowExecutionsResponse) GetExecutions() (o []*WorkflowExecutionInfo) {
	if v != nil && v.Executions != nil {
		return v.Executions
	}

	return
}

// IsSetExecutions returns true if Executions is not nil.
func (v *ListOpenWorkflowExecutionsResponse) IsSetExecutions() bool {
	return v != nil && v.Executions != nil
}

// GetNextPageToken returns the value of NextPageToken if it is set or its
// zero value if it is unset.
func (v *ListOpenWorkflowExecutionsResponse) GetNextPageToken() (o []byte) {
	if v != nil && v.NextPageToken != nil {
		return v.NextPageToken
	}

	return
}

// IsSetNextPageToken returns true if NextPageToken is not nil.
func (v *ListOpenWorkflowExecutionsResponse) IsSetNextPageToken() bool {
	return v != nil && v.NextPageToken != nil
}

type ListTaskListPartitionsRequest struct {
	Domain   *string   `json:"domain,omitempty"`
	TaskList *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
}

// 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 *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 ListTaskListPartitionsResponse struct {
	ActivityTaskListPartitions []*TaskListPartitionMetadata `json:"activityTaskListPartitions,omitempty"`
	DecisionTaskListPartitions []*TaskListPartitionMetadata `json:"decisionTaskListPartitions,omitempty"`
}

type _List_TaskListPartitionMetadata_ValueList []*TaskListPartitionMetadata

func (v _List_TaskListPartitionMetadata_ValueList) ForEach(f func(wire.Value) error) error {
	for i, x := range v {
		if x == nil {
			return fmt.Errorf("invalid [%v]: value is nil", i)
		}
		w, err := x.ToWire()
		if err != nil {
			return err
		}
		err = f(w)
		if err != nil {
			return err
		}
	}
	return nil
}

func (v _List_TaskListPartitionMetadata_ValueList) Size() int {
	return len(v)
}

func (_List_TaskListPartitionMetadata_ValueList) ValueType() wire.Type {
	return wire.TStruct
}

func (_List_TaskListPartitionMetadata_ValueList) Close() {}

// ToWire translates a ListTaskListPartitionsResponse 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 *ListTaskListPartitionsResponse) ToWire() (wire.Value, error) {
	var (
		fields [2]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.ActivityTaskListPartitions != nil {
		w, err = wire.NewValueList(_List_TaskListPartitionMetadata_ValueList(v.ActivityTaskListPartitions)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.DecisionTaskListPartitions != nil {
		w, err = wire.NewValueList(_List_TaskListPartitionMetadata_ValueList(v.DecisionTaskListPartitions)), 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 _TaskListPartitionMetadata_Read(w wire.Value) (*TaskListPartitionMetadata, error) {
	var v TaskListPartitionMetadata
	err := v.FromWire(w)
	return &v, err
}

func _List_TaskListPartitionMetadata_Read(l wire.ValueList) ([]*TaskListPartitionMetadata, error) {
	if l.ValueType() != wire.TStruct {
		return nil, nil
	}

	o := make([]*TaskListPartitionMetadata, 0, l.Size())
	err := l.ForEach(func(x wire.Value) error {
		i, err := _TaskListPartitionMetadata_Read(x)
		if err != nil {
			return err
		}
		o = append(o, i)
		return nil
	})
	l.Close()
	return o, err
}

// FromWire deserializes a ListTaskListPartitionsResponse 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 ListTaskListPartitionsResponse struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v ListTaskListPartitionsResponse
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *ListTaskListPartitionsResponse) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			if field.Value.Type() == wire.TList {
				v.ActivityTaskListPartitions, err = _List_TaskListPartitionMetadata_Read(field.Value.GetList())
				if err != nil {
					return err
				}

			}
		case 20:
			if field.Value.Type() == wire.TList {
				v.DecisionTaskListPartitions, err = _List_TaskListPartitionMetadata_Read(field.Value.GetList())
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a ListTaskListPartitionsResponse
// struct.
func (v *ListTaskListPartitionsResponse) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [2]string
	i := 0
	if v.ActivityTaskListPartitions != nil {
		fields[i] = fmt.Sprintf("ActivityTaskListPartitions: %v", v.ActivityTaskListPartitions)
		i++
	}
	if v.DecisionTaskListPartitions != nil {
		fields[i] = fmt.Sprintf("DecisionTaskListPartitions: %v", v.DecisionTaskListPartitions)
		i++
	}

	return fmt.Sprintf("ListTaskListPartitionsResponse{%v}", strings.Join(fields[:i], ", "))
}

func _List_TaskListPartitionMetadata_Equals(lhs, rhs []*TaskListPartitionMetadata) bool {
	if len(lhs) != len(rhs) {
		return false
	}

	for i, lv := range lhs {
		rv := rhs[i]
		if !lv.Equals(rv) {
			return false
		}
	}

	return true
}

// Equals returns true if all the fields of this ListTaskListPartitionsResponse match the
// provided ListTaskListPartitionsResponse.
//
// This function performs a deep comparison.
func (v *ListTaskListPartitionsResponse) Equals(rhs *ListTaskListPartitionsResponse) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !((v.ActivityTaskListPartitions == nil && rhs.ActivityTaskListPartitions == nil) || (v.ActivityTaskListPartitions != nil && rhs.ActivityTaskListPartitions != nil && _List_TaskListPartitionMetadata_Equals(v.ActivityTaskListPartitions, rhs.ActivityTaskListPartitions))) {
		return false
	}
	if !((v.DecisionTaskListPartitions == nil && rhs.DecisionTaskListPartitions == nil) || (v.DecisionTaskListPartitions != nil && rhs.DecisionTaskListPartitions != nil && _List_TaskListPartitionMetadata_Equals(v.DecisionTaskListPartitions, rhs.DecisionTaskListPartitions))) {
		return false
	}

	return true
}

type _List_TaskListPartitionMetadata_Zapper []*TaskListPartitionMetadata

// MarshalLogArray implements zapcore.ArrayMarshaler, enabling
// fast logging of _List_TaskListPartitionMetadata_Zapper.
func (l _List_TaskListPartitionMetadata_Zapper) MarshalLogArray(enc zapcore.ArrayEncoder) (err error) {
	for _, v := range l {
		err = multierr.Append(err, enc.AppendObject(v))
	}
	return err
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of ListTaskListPartitionsResponse.
func (v *ListTaskListPartitionsResponse) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.ActivityTaskListPartitions != nil {
		err = multierr.Append(err, enc.AddArray("activityTaskListPartitions", (_List_TaskListPartitionMetadata_Zapper)(v.ActivityTaskListPartitions)))
	}
	if v.DecisionTaskListPartitions != nil {
		err = multierr.Append(err, enc.AddArray("decisionTaskListPartitions", (_List_TaskListPartitionMetadata_Zapper)(v.DecisionTaskListPartitions)))
	}
	return err
}

// GetActivityTaskListPartitions returns the value of ActivityTaskListPartitions if it is set or its
// zero value if it is unset.
func (v *ListTaskListPartitionsResponse) GetActivityTaskListPartitions() (o []*TaskListPartitionMetadata) {
	if v != nil && v.ActivityTaskListPartitions != nil {
		return v.ActivityTaskListPartitions
	}

	return
}

// IsSetActivityTaskListPartitions returns true if ActivityTaskListPartitions is not nil.
func (v *ListTaskListPartitionsResponse) IsSetActivityTaskListPartitions() bool {
	return v != nil && v.ActivityTaskListPartitions != nil
}

// GetDecisionTaskListPartitions returns the value of DecisionTaskListPartitions if it is set or its
// zero value if it is unset.
func (v *ListTaskListPartitionsResponse) GetDecisionTaskListPartitions() (o []*TaskListPartitionMetadata) {
	if v != nil && v.DecisionTaskListPartitions != nil {
		return v.DecisionTaskListPartitions
	}

	return
}

// IsSetDecisionTaskListPartitions returns true if DecisionTaskListPartitions is not nil.
func (v *ListTaskListPartitionsResponse) IsSetDecisionTaskListPartitions() bool {
	return v != nil && v.DecisionTaskListPartitions != nil
}

type ListWorkflowExecutionsRequest struct {
	Domain        *string `json:"domain,omitempty"`
	PageSize      *int32  `json:"pageSize,omitempty"`
	NextPageToken []byte  `json:"nextPageToken,omitempty"`
	Query         *string `json:"query,omitempty"`
}

// ToWire translates a ListWorkflowExecutionsRequest 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 *ListWorkflowExecutionsRequest) ToWire() (wire.Value, error) {
	var (
		fields [4]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.PageSize != nil {
		w, err = wire.NewValueI32(*(v.PageSize)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.NextPageToken != nil {
		w, err = wire.NewValueBinary(v.NextPageToken), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.Query != nil {
		w, err = wire.NewValueString(*(v.Query)), 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 ListWorkflowExecutionsRequest 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 ListWorkflowExecutionsRequest struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v ListWorkflowExecutionsRequest
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *ListWorkflowExecutionsRequest) 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.TI32 {
				var x int32
				x, err = field.Value.GetI32(), error(nil)
				v.PageSize = &x
				if err != nil {
					return err
				}

			}
		case 30:
			if field.Value.Type() == wire.TBinary {
				v.NextPageToken, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		case 40:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.Query = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a ListWorkflowExecutionsRequest
// struct.
func (v *ListWorkflowExecutionsRequest) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [4]string
	i := 0
	if v.Domain != nil {
		fields[i] = fmt.Sprintf("Domain: %v", *(v.Domain))
		i++
	}
	if v.PageSize != nil {
		fields[i] = fmt.Sprintf("PageSize: %v", *(v.PageSize))
		i++
	}
	if v.NextPageToken != nil {
		fields[i] = fmt.Sprintf("NextPageToken: %v", v.NextPageToken)
		i++
	}
	if v.Query != nil {
		fields[i] = fmt.Sprintf("Query: %v", *(v.Query))
		i++
	}

	return fmt.Sprintf("ListWorkflowExecutionsRequest{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this ListWorkflowExecutionsRequest match the
// provided ListWorkflowExecutionsRequest.
//
// This function performs a deep comparison.
func (v *ListWorkflowExecutionsRequest) Equals(rhs *ListWorkflowExecutionsRequest) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.Domain, rhs.Domain) {
		return false
	}
	if !_I32_EqualsPtr(v.PageSize, rhs.PageSize) {
		return false
	}
	if !((v.NextPageToken == nil && rhs.NextPageToken == nil) || (v.NextPageToken != nil && rhs.NextPageToken != nil && bytes.Equal(v.NextPageToken, rhs.NextPageToken))) {
		return false
	}
	if !_String_EqualsPtr(v.Query, rhs.Query) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of ListWorkflowExecutionsRequest.
func (v *ListWorkflowExecutionsRequest) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Domain != nil {
		enc.AddString("domain", *v.Domain)
	}
	if v.PageSize != nil {
		enc.AddInt32("pageSize", *v.PageSize)
	}
	if v.NextPageToken != nil {
		enc.AddString("nextPageToken", base64.StdEncoding.EncodeToString(v.NextPageToken))
	}
	if v.Query != nil {
		enc.AddString("query", *v.Query)
	}
	return err
}

// GetDomain returns the value of Domain if it is set or its
// zero value if it is unset.
func (v *ListWorkflowExecutionsRequest) GetDomain() (o string) {
	if v != nil && v.Domain != nil {
		return *v.Domain
	}

	return
}

// IsSetDomain returns true if Domain is not nil.
func (v *ListWorkflowExecutionsRequest) IsSetDomain() bool {
	return v != nil && v.Domain != nil
}

// GetPageSize returns the value of PageSize if it is set or its
// zero value if it is unset.
func (v *ListWorkflowExecutionsRequest) GetPageSize() (o int32) {
	if v != nil && v.PageSize != nil {
		return *v.PageSize
	}

	return
}

// IsSetPageSize returns true if PageSize is not nil.
func (v *ListWorkflowExecutionsRequest) IsSetPageSize() bool {
	return v != nil && v.PageSize != nil
}

// GetNextPageToken returns the value of NextPageToken if it is set or its
// zero value if it is unset.
func (v *ListWorkflowExecutionsRequest) GetNextPageToken() (o []byte) {
	if v != nil && v.NextPageToken != nil {
		return v.NextPageToken
	}

	return
}

// IsSetNextPageToken returns true if NextPageToken is not nil.
func (v *ListWorkflowExecutionsRequest) IsSetNextPageToken() bool {
	return v != nil && v.NextPageToken != nil
}

// GetQuery returns the value of Query if it is set or its
// zero value if it is unset.
func (v *ListWorkflowExecutionsRequest) GetQuery() (o string) {
	if v != nil && v.Query != nil {
		return *v.Query
	}

	return
}

// IsSetQuery returns true if Query is not nil.
func (v *ListWorkflowExecutionsRequest) IsSetQuery() bool {
	return v != nil && v.Query != nil
}

type ListWorkflowExecutionsResponse struct {
	Executions    []*WorkflowExecutionInfo `json:"executions,omitempty"`
	NextPageToken []byte                   `json:"nextPageToken,omitempty"`
}

// ToWire translates a ListWorkflowExecutionsResponse 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 *ListWorkflowExecutionsResponse) ToWire() (wire.Value, error) {
	var (
		fields [2]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.Executions != nil {
		w, err = wire.NewValueList(_List_WorkflowExecutionInfo_ValueList(v.Executions)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.NextPageToken != nil {
		w, err = wire.NewValueBinary(v.NextPageToken), 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
}

// FromWire deserializes a ListWorkflowExecutionsResponse 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 ListWorkflowExecutionsResponse struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v ListWorkflowExecutionsResponse
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *ListWorkflowExecutionsResponse) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			if field.Value.Type() == wire.TList {
				v.Executions, err = _List_WorkflowExecutionInfo_Read(field.Value.GetList())
				if err != nil {
					return err
				}

			}
		case 20:
			if field.Value.Type() == wire.TBinary {
				v.NextPageToken, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a ListWorkflowExecutionsResponse
// struct.
func (v *ListWorkflowExecutionsResponse) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [2]string
	i := 0
	if v.Executions != nil {
		fields[i] = fmt.Sprintf("Executions: %v", v.Executions)
		i++
	}
	if v.NextPageToken != nil {
		fields[i] = fmt.Sprintf("NextPageToken: %v", v.NextPageToken)
		i++
	}

	return fmt.Sprintf("ListWorkflowExecutionsResponse{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this ListWorkflowExecutionsResponse match the
// provided ListWorkflowExecutionsResponse.
//
// This function performs a deep comparison.
func (v *ListWorkflowExecutionsResponse) Equals(rhs *ListWorkflowExecutionsResponse) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !((v.Executions == nil && rhs.Executions == nil) || (v.Executions != nil && rhs.Executions != nil && _List_WorkflowExecutionInfo_Equals(v.Executions, rhs.Executions))) {
		return false
	}
	if !((v.NextPageToken == nil && rhs.NextPageToken == nil) || (v.NextPageToken != nil && rhs.NextPageToken != nil && bytes.Equal(v.NextPageToken, rhs.NextPageToken))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of ListWorkflowExecutionsResponse.
func (v *ListWorkflowExecutionsResponse) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Executions != nil {
		err = multierr.Append(err, enc.AddArray("executions", (_List_WorkflowExecutionInfo_Zapper)(v.Executions)))
	}
	if v.NextPageToken != nil {
		enc.AddString("nextPageToken", base64.StdEncoding.EncodeToString(v.NextPageToken))
	}
	return err
}

// GetExecutions returns the value of Executions if it is set or its
// zero value if it is unset.
func (v *ListWorkflowExecutionsResponse) GetExecutions() (o []*WorkflowExecutionInfo) {
	if v != nil && v.Executions != nil {
		return v.Executions
	}

	return
}

// IsSetExecutions returns true if Executions is not nil.
func (v *ListWorkflowExecutionsResponse) IsSetExecutions() bool {
	return v != nil && v.Executions != nil
}

// GetNextPageToken returns the value of NextPageToken if it is set or its
// zero value if it is unset.
func (v *ListWorkflowExecutionsResponse) GetNextPageToken() (o []byte) {
	if v != nil && v.NextPageToken != nil {
		return v.NextPageToken
	}

	return
}

// IsSetNextPageToken returns true if NextPageToken is not nil.
func (v *ListWorkflowExecutionsResponse) IsSetNextPageToken() bool {
	return v != nil && v.NextPageToken != nil
}

type MarkerRecordedEventAttributes struct {
	MarkerName                   *string `json:"markerName,omitempty"`
	Details                      []byte  `json:"details,omitempty"`
	DecisionTaskCompletedEventId *int64  `json:"decisionTaskCompletedEventId,omitempty"`
	Header                       *Header `json:"header,omitempty"`
}

// ToWire translates a MarkerRecordedEventAttributes 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 *MarkerRecordedEventAttributes) ToWire() (wire.Value, error) {
	var (
		fields [4]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.MarkerName != nil {
		w, err = wire.NewValueString(*(v.MarkerName)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.Details != nil {
		w, err = wire.NewValueBinary(v.Details), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, 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: 30, Value: w}
		i++
	}
	if v.Header != nil {
		w, err = v.Header.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
}

// FromWire deserializes a MarkerRecordedEventAttributes 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 MarkerRecordedEventAttributes struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v MarkerRecordedEventAttributes
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *MarkerRecordedEventAttributes) 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.MarkerName = &x
				if err != nil {
					return err
				}

			}
		case 20:
			if field.Value.Type() == wire.TBinary {
				v.Details, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		case 30:
			if field.Value.Type() == wire.TI64 {
				var x int64
				x, err = field.Value.GetI64(), error(nil)
				v.DecisionTaskCompletedEventId = &x
				if err != nil {
					return err
				}

			}
		case 40:
			if field.Value.Type() == wire.TStruct {
				v.Header, err = _Header_Read(field.Value)
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a MarkerRecordedEventAttributes
// struct.
func (v *MarkerRecordedEventAttributes) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [4]string
	i := 0
	if v.MarkerName != nil {
		fields[i] = fmt.Sprintf("MarkerName: %v", *(v.MarkerName))
		i++
	}
	if v.Details != nil {
		fields[i] = fmt.Sprintf("Details: %v", v.Details)
		i++
	}
	if v.DecisionTaskCompletedEventId != nil {
		fields[i] = fmt.Sprintf("DecisionTaskCompletedEventId: %v", *(v.DecisionTaskCompletedEventId))
		i++
	}
	if v.Header != nil {
		fields[i] = fmt.Sprintf("Header: %v", v.Header)
		i++
	}

	return fmt.Sprintf("MarkerRecordedEventAttributes{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this MarkerRecordedEventAttributes match the
// provided MarkerRecordedEventAttributes.
//
// This function performs a deep comparison.
func (v *MarkerRecordedEventAttributes) Equals(rhs *MarkerRecordedEventAttributes) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.MarkerName, rhs.MarkerName) {
		return false
	}
	if !((v.Details == nil && rhs.Details == nil) || (v.Details != nil && rhs.Details != nil && bytes.Equal(v.Details, rhs.Details))) {
		return false
	}
	if !_I64_EqualsPtr(v.DecisionTaskCompletedEventId, rhs.DecisionTaskCompletedEventId) {
		return false
	}
	if !((v.Header == nil && rhs.Header == nil) || (v.Header != nil && rhs.Header != nil && v.Header.Equals(rhs.Header))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of MarkerRecordedEventAttributes.
func (v *MarkerRecordedEventAttributes) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.MarkerName != nil {
		enc.AddString("markerName", *v.MarkerName)
	}
	if v.Details != nil {
		enc.AddString("details", base64.StdEncoding.EncodeToString(v.Details))
	}
	if v.DecisionTaskCompletedEventId != nil {
		enc.AddInt64("decisionTaskCompletedEventId", *v.DecisionTaskCompletedEventId)
	}
	if v.Header != nil {
		err = multierr.Append(err, enc.AddObject("header", v.Header))
	}
	return err
}

// GetMarkerName returns the value of MarkerName if it is set or its
// zero value if it is unset.
func (v *MarkerRecordedEventAttributes) GetMarkerName() (o string) {
	if v != nil && v.MarkerName != nil {
		return *v.MarkerName
	}

	return
}

// IsSetMarkerName returns true if MarkerName is not nil.
func (v *MarkerRecordedEventAttributes) IsSetMarkerName() bool {
	return v != nil && v.MarkerName != nil
}

// GetDetails returns the value of Details if it is set or its
// zero value if it is unset.
func (v *MarkerRecordedEventAttributes) GetDetails() (o []byte) {
	if v != nil && v.Details != nil {
		return v.Details
	}

	return
}

// IsSetDetails returns true if Details is not nil.
func (v *MarkerRecordedEventAttributes) IsSetDetails() bool {
	return v != nil && v.Details != nil
}

// GetDecisionTaskCompletedEventId returns the value of DecisionTaskCompletedEventId if it is set or its
// zero value if it is unset.
func (v *MarkerRecordedEventAttributes) GetDecisionTaskCompletedEventId() (o int64) {
	if v != nil && v.DecisionTaskCompletedEventId != nil {
		return *v.DecisionTaskCompletedEventId
	}

	return
}

// IsSetDecisionTaskCompletedEventId returns true if DecisionTaskCompletedEventId is not nil.
func (v *MarkerRecordedEventAttributes) IsSetDecisionTaskCompletedEventId() bool {
	return v != nil && v.DecisionTaskCompletedEventId != nil
}

// GetHeader returns the value of Header if it is set or its
// zero value if it is unset.
func (v *MarkerRecordedEventAttributes) GetHeader() (o *Header) {
	if v != nil && v.Header != nil {
		return v.Header
	}

	return
}

// IsSetHeader returns true if Header is not nil.
func (v *MarkerRecordedEventAttributes) IsSetHeader() bool {
	return v != nil && v.Header != nil
}

type Memo struct {
	Fields map[string][]byte `json:"fields,omitempty"`
}

// ToWire translates a Memo 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 *Memo) ToWire() (wire.Value, error) {
	var (
		fields [1]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.Fields != nil {
		w, err = wire.NewValueMap(_Map_String_Binary_MapItemList(v.Fields)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

// FromWire deserializes a Memo 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 Memo struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v Memo
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *Memo) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			if field.Value.Type() == wire.TMap {
				v.Fields, err = _Map_String_Binary_Read(field.Value.GetMap())
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a Memo
// struct.
func (v *Memo) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [1]string
	i := 0
	if v.Fields != nil {
		fields[i] = fmt.Sprintf("Fields: %v", v.Fields)
		i++
	}

	return fmt.Sprintf("Memo{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this Memo match the
// provided Memo.
//
// This function performs a deep comparison.
func (v *Memo) Equals(rhs *Memo) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !((v.Fields == nil && rhs.Fields == nil) || (v.Fields != nil && rhs.Fields != nil && _Map_String_Binary_Equals(v.Fields, rhs.Fields))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of Memo.
func (v *Memo) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Fields != nil {
		err = multierr.Append(err, enc.AddObject("fields", (_Map_String_Binary_Zapper)(v.Fields)))
	}
	return err
}

// GetFields returns the value of Fields if it is set or its
// zero value if it is unset.
func (v *Memo) GetFields() (o map[string][]byte) {
	if v != nil && v.Fields != nil {
		return v.Fields
	}

	return
}

// IsSetFields returns true if Fields is not nil.
func (v *Memo) IsSetFields() bool {
	return v != nil && v.Fields != nil
}

type ParentClosePolicy int32

const (
	ParentClosePolicyAbandon       ParentClosePolicy = 0
	ParentClosePolicyRequestCancel ParentClosePolicy = 1
	ParentClosePolicyTerminate     ParentClosePolicy = 2
)

// ParentClosePolicy_Values returns all recognized values of ParentClosePolicy.
func ParentClosePolicy_Values() []ParentClosePolicy {
	return []ParentClosePolicy{
		ParentClosePolicyAbandon,
		ParentClosePolicyRequestCancel,
		ParentClosePolicyTerminate,
	}
}

// UnmarshalText tries to decode ParentClosePolicy from a byte slice
// containing its name.
//
//	var v ParentClosePolicy
//	err := v.UnmarshalText([]byte("ABANDON"))
func (v *ParentClosePolicy) UnmarshalText(value []byte) error {
	switch s := string(value); s {
	case "ABANDON":
		*v = ParentClosePolicyAbandon
		return nil
	case "REQUEST_CANCEL":
		*v = ParentClosePolicyRequestCancel
		return nil
	case "TERMINATE":
		*v = ParentClosePolicyTerminate
		return nil
	default:
		val, err := strconv.ParseInt(s, 10, 32)
		if err != nil {
			return fmt.Errorf("unknown enum value %q for %q: %v", s, "ParentClosePolicy", err)
		}
		*v = ParentClosePolicy(val)
		return nil
	}
}

// MarshalText encodes ParentClosePolicy 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 ParentClosePolicy) MarshalText() ([]byte, error) {
	switch int32(v) {
	case 0:
		return []byte("ABANDON"), nil
	case 1:
		return []byte("REQUEST_CANCEL"), nil
	case 2:
		return []byte("TERMINATE"), nil
	}
	return []byte(strconv.FormatInt(int64(v), 10)), nil
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of ParentClosePolicy.
// 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 ParentClosePolicy) MarshalLogObject(enc zapcore.ObjectEncoder) error {
	enc.AddInt32("value", int32(v))
	switch int32(v) {
	case 0:
		enc.AddString("name", "ABANDON")
	case 1:
		enc.AddString("name", "REQUEST_CANCEL")
	case 2:
		enc.AddString("name", "TERMINATE")
	}
	return nil
}

// Ptr returns a pointer to this enum value.
func (v ParentClosePolicy) Ptr() *ParentClosePolicy {
	return &v
}

// ToWire translates ParentClosePolicy 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 ParentClosePolicy) ToWire() (wire.Value, error) {
	return wire.NewValueI32(int32(v)), nil
}

// FromWire deserializes ParentClosePolicy from its Thrift-level
// representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TI32)
//	if err != nil {
//	  return ParentClosePolicy(0), err
//	}
//
//	var v ParentClosePolicy
//	if err := v.FromWire(x); err != nil {
//	  return ParentClosePolicy(0), err
//	}
//	return v, nil
func (v *ParentClosePolicy) FromWire(w wire.Value) error {
	*v = (ParentClosePolicy)(w.GetI32())
	return nil
}

// String returns a readable string representation of ParentClosePolicy.
func (v ParentClosePolicy) String() string {
	w := int32(v)
	switch w {
	case 0:
		return "ABANDON"
	case 1:
		return "REQUEST_CANCEL"
	case 2:
		return "TERMINATE"
	}
	return fmt.Sprintf("ParentClosePolicy(%d)", w)
}

// Equals returns true if this ParentClosePolicy value matches the provided
// value.
func (v ParentClosePolicy) Equals(rhs ParentClosePolicy) bool {
	return v == rhs
}

// MarshalJSON serializes ParentClosePolicy into JSON.
//
// If the enum value is recognized, its name is returned. Otherwise,
// its integer value is returned.
//
// This implements json.Marshaler.
func (v ParentClosePolicy) MarshalJSON() ([]byte, error) {
	switch int32(v) {
	case 0:
		return ([]byte)("\"ABANDON\""), nil
	case 1:
		return ([]byte)("\"REQUEST_CANCEL\""), nil
	case 2:
		return ([]byte)("\"TERMINATE\""), nil
	}
	return ([]byte)(strconv.FormatInt(int64(v), 10)), nil
}

// UnmarshalJSON attempts to decode ParentClosePolicy 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 *ParentClosePolicy) 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, "ParentClosePolicy")
		}
		if x < math.MinInt32 {
			return fmt.Errorf("enum underflow from JSON %q for %q", text, "ParentClosePolicy")
		}
		*v = (ParentClosePolicy)(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, "ParentClosePolicy")
	}
}

type PendingActivityInfo struct {
	ActivityID             *string               `json:"activityID,omitempty"`
	ActivityType           *ActivityType         `json:"activityType,omitempty"`
	State                  *PendingActivityState `json:"state,omitempty"`
	HeartbeatDetails       []byte                `json:"heartbeatDetails,omitempty"`
	LastHeartbeatTimestamp *int64                `json:"lastHeartbeatTimestamp,omitempty"`
	LastStartedTimestamp   *int64                `json:"lastStartedTimestamp,omitempty"`
	Attempt                *int32                `json:"attempt,omitempty"`
	MaximumAttempts        *int32                `json:"maximumAttempts,omitempty"`
	ScheduledTimestamp     *int64                `json:"scheduledTimestamp,omitempty"`
	ExpirationTimestamp    *int64                `json:"expirationTimestamp,omitempty"`
	LastFailureReason      *string               `json:"lastFailureReason,omitempty"`
	LastWorkerIdentity     *string               `json:"lastWorkerIdentity,omitempty"`
	LastFailureDetails     []byte                `json:"lastFailureDetails,omitempty"`
	StartedWorkerIdentity  *string               `json:"startedWorkerIdentity,omitempty"`
	ScheduleID             *int64                `json:"scheduleID,omitempty"`
}

// ToWire translates a PendingActivityInfo 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 *PendingActivityInfo) ToWire() (wire.Value, error) {
	var (
		fields [15]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.ActivityType != nil {
		w, err = v.ActivityType.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.State != nil {
		w, err = v.State.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, 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: 40, Value: w}
		i++
	}
	if v.LastHeartbeatTimestamp != nil {
		w, err = wire.NewValueI64(*(v.LastHeartbeatTimestamp)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 50, Value: w}
		i++
	}
	if v.LastStartedTimestamp != nil {
		w, err = wire.NewValueI64(*(v.LastStartedTimestamp)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 60, Value: w}
		i++
	}
	if v.Attempt != nil {
		w, err = wire.NewValueI32(*(v.Attempt)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 70, Value: w}
		i++
	}
	if v.MaximumAttempts != nil {
		w, err = wire.NewValueI32(*(v.MaximumAttempts)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 80, 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: 90, Value: w}
		i++
	}
	if v.ExpirationTimestamp != nil {
		w, err = wire.NewValueI64(*(v.ExpirationTimestamp)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 100, Value: w}
		i++
	}
	if v.LastFailureReason != nil {
		w, err = wire.NewValueString(*(v.LastFailureReason)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 110, Value: w}
		i++
	}
	if v.LastWorkerIdentity != nil {
		w, err = wire.NewValueString(*(v.LastWorkerIdentity)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 120, Value: w}
		i++
	}
	if v.LastFailureDetails != nil {
		w, err = wire.NewValueBinary(v.LastFailureDetails), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 130, Value: w}
		i++
	}
	if v.StartedWorkerIdentity != nil {
		w, err = wire.NewValueString(*(v.StartedWorkerIdentity)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 140, 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: 150, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

func _PendingActivityState_Read(w wire.Value) (PendingActivityState, error) {
	var v PendingActivityState
	err := v.FromWire(w)
	return v, err
}

// FromWire deserializes a PendingActivityInfo 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 PendingActivityInfo struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v PendingActivityInfo
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *PendingActivityInfo) 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.TStruct {
				v.ActivityType, err = _ActivityType_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 30:
			if field.Value.Type() == wire.TI32 {
				var x PendingActivityState
				x, err = _PendingActivityState_Read(field.Value)
				v.State = &x
				if err != nil {
					return err
				}

			}
		case 40:
			if field.Value.Type() == wire.TBinary {
				v.HeartbeatDetails, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		case 50:
			if field.Value.Type() == wire.TI64 {
				var x int64
				x, err = field.Value.GetI64(), error(nil)
				v.LastHeartbeatTimestamp = &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.LastStartedTimestamp = &x
				if err != nil {
					return err
				}

			}
		case 70:
			if field.Value.Type() == wire.TI32 {
				var x int32
				x, err = field.Value.GetI32(), error(nil)
				v.Attempt = &x
				if err != nil {
					return err
				}

			}
		case 80:
			if field.Value.Type() == wire.TI32 {
				var x int32
				x, err = field.Value.GetI32(), error(nil)
				v.MaximumAttempts = &x
				if err != nil {
					return err
				}

			}
		case 90:
			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 100:
			if field.Value.Type() == wire.TI64 {
				var x int64
				x, err = field.Value.GetI64(), error(nil)
				v.ExpirationTimestamp = &x
				if err != nil {
					return err
				}

			}
		case 110:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.LastFailureReason = &x
				if err != nil {
					return err
				}

			}
		case 120:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.LastWorkerIdentity = &x
				if err != nil {
					return err
				}

			}
		case 130:
			if field.Value.Type() == wire.TBinary {
				v.LastFailureDetails, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		case 140:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.StartedWorkerIdentity = &x
				if err != nil {
					return err
				}

			}
		case 150:
			if field.Value.Type() == wire.TI64 {
				var x int64
				x, err = field.Value.GetI64(), error(nil)
				v.ScheduleID = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a PendingActivityInfo
// struct.
func (v *PendingActivityInfo) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [15]string
	i := 0
	if v.ActivityID != nil {
		fields[i] = fmt.Sprintf("ActivityID: %v", *(v.ActivityID))
		i++
	}
	if v.ActivityType != nil {
		fields[i] = fmt.Sprintf("ActivityType: %v", v.ActivityType)
		i++
	}
	if v.State != nil {
		fields[i] = fmt.Sprintf("State: %v", *(v.State))
		i++
	}
	if v.HeartbeatDetails != nil {
		fields[i] = fmt.Sprintf("HeartbeatDetails: %v", v.HeartbeatDetails)
		i++
	}
	if v.LastHeartbeatTimestamp != nil {
		fields[i] = fmt.Sprintf("LastHeartbeatTimestamp: %v", *(v.LastHeartbeatTimestamp))
		i++
	}
	if v.LastStartedTimestamp != nil {
		fields[i] = fmt.Sprintf("LastStartedTimestamp: %v", *(v.LastStartedTimestamp))
		i++
	}
	if v.Attempt != nil {
		fields[i] = fmt.Sprintf("Attempt: %v", *(v.Attempt))
		i++
	}
	if v.MaximumAttempts != nil {
		fields[i] = fmt.Sprintf("MaximumAttempts: %v", *(v.MaximumAttempts))
		i++
	}
	if v.ScheduledTimestamp != nil {
		fields[i] = fmt.Sprintf("ScheduledTimestamp: %v", *(v.ScheduledTimestamp))
		i++
	}
	if v.ExpirationTimestamp != nil {
		fields[i] = fmt.Sprintf("ExpirationTimestamp: %v", *(v.ExpirationTimestamp))
		i++
	}
	if v.LastFailureReason != nil {
		fields[i] = fmt.Sprintf("LastFailureReason: %v", *(v.LastFailureReason))
		i++
	}
	if v.LastWorkerIdentity != nil {
		fields[i] = fmt.Sprintf("LastWorkerIdentity: %v", *(v.LastWorkerIdentity))
		i++
	}
	if v.LastFailureDetails != nil {
		fields[i] = fmt.Sprintf("LastFailureDetails: %v", v.LastFailureDetails)
		i++
	}
	if v.StartedWorkerIdentity != nil {
		fields[i] = fmt.Sprintf("StartedWorkerIdentity: %v", *(v.StartedWorkerIdentity))
		i++
	}
	if v.ScheduleID != nil {
		fields[i] = fmt.Sprintf("ScheduleID: %v", *(v.ScheduleID))
		i++
	}

	return fmt.Sprintf("PendingActivityInfo{%v}", strings.Join(fields[:i], ", "))
}

func _PendingActivityState_EqualsPtr(lhs, rhs *PendingActivityState) bool {
	if lhs != nil && rhs != nil {

		x := *lhs
		y := *rhs
		return x.Equals(y)
	}
	return lhs == nil && rhs == nil
}

// Equals returns true if all the fields of this PendingActivityInfo match the
// provided PendingActivityInfo.
//
// This function performs a deep comparison.
func (v *PendingActivityInfo) Equals(rhs *PendingActivityInfo) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.ActivityID, rhs.ActivityID) {
		return false
	}
	if !((v.ActivityType == nil && rhs.ActivityType == nil) || (v.ActivityType != nil && rhs.ActivityType != nil && v.ActivityType.Equals(rhs.ActivityType))) {
		return false
	}
	if !_PendingActivityState_EqualsPtr(v.State, rhs.State) {
		return false
	}
	if !((v.HeartbeatDetails == nil && rhs.HeartbeatDetails == nil) || (v.HeartbeatDetails != nil && rhs.HeartbeatDetails != nil && bytes.Equal(v.HeartbeatDetails, rhs.HeartbeatDetails))) {
		return false
	}
	if !_I64_EqualsPtr(v.LastHeartbeatTimestamp, rhs.LastHeartbeatTimestamp) {
		return false
	}
	if !_I64_EqualsPtr(v.LastStartedTimestamp, rhs.LastStartedTimestamp) {
		return false
	}
	if !_I32_EqualsPtr(v.Attempt, rhs.Attempt) {
		return false
	}
	if !_I32_EqualsPtr(v.MaximumAttempts, rhs.MaximumAttempts) {
		return false
	}
	if !_I64_EqualsPtr(v.ScheduledTimestamp, rhs.ScheduledTimestamp) {
		return false
	}
	if !_I64_EqualsPtr(v.ExpirationTimestamp, rhs.ExpirationTimestamp) {
		return false
	}
	if !_String_EqualsPtr(v.LastFailureReason, rhs.LastFailureReason) {
		return false
	}
	if !_String_EqualsPtr(v.LastWorkerIdentity, rhs.LastWorkerIdentity) {
		return false
	}
	if !((v.LastFailureDetails == nil && rhs.LastFailureDetails == nil) || (v.LastFailureDetails != nil && rhs.LastFailureDetails != nil && bytes.Equal(v.LastFailureDetails, rhs.LastFailureDetails))) {
		return false
	}
	if !_String_EqualsPtr(v.StartedWorkerIdentity, rhs.StartedWorkerIdentity) {
		return false
	}
	if !_I64_EqualsPtr(v.ScheduleID, rhs.ScheduleID) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of PendingActivityInfo.
func (v *PendingActivityInfo) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.ActivityID != nil {
		enc.AddString("activityID", *v.ActivityID)
	}
	if v.ActivityType != nil {
		err = multierr.Append(err, enc.AddObject("activityType", v.ActivityType))
	}
	if v.State != nil {
		err = multierr.Append(err, enc.AddObject("state", *v.State))
	}
	if v.HeartbeatDetails != nil {
		enc.AddString("heartbeatDetails", base64.StdEncoding.EncodeToString(v.HeartbeatDetails))
	}
	if v.LastHeartbeatTimestamp != nil {
		enc.AddInt64("lastHeartbeatTimestamp", *v.LastHeartbeatTimestamp)
	}
	if v.LastStartedTimestamp != nil {
		enc.AddInt64("lastStartedTimestamp", *v.LastStartedTimestamp)
	}
	if v.Attempt != nil {
		enc.AddInt32("attempt", *v.Attempt)
	}
	if v.MaximumAttempts != nil {
		enc.AddInt32("maximumAttempts", *v.MaximumAttempts)
	}
	if v.ScheduledTimestamp != nil {
		enc.AddInt64("scheduledTimestamp", *v.ScheduledTimestamp)
	}
	if v.ExpirationTimestamp != nil {
		enc.AddInt64("expirationTimestamp", *v.ExpirationTimestamp)
	}
	if v.LastFailureReason != nil {
		enc.AddString("lastFailureReason", *v.LastFailureReason)
	}
	if v.LastWorkerIdentity != nil {
		enc.AddString("lastWorkerIdentity", *v.LastWorkerIdentity)
	}
	if v.LastFailureDetails != nil {
		enc.AddString("lastFailureDetails", base64.StdEncoding.EncodeToString(v.LastFailureDetails))
	}
	if v.StartedWorkerIdentity != nil {
		enc.AddString("startedWorkerIdentity", *v.StartedWorkerIdentity)
	}
	if v.ScheduleID != nil {
		enc.AddInt64("scheduleID", *v.ScheduleID)
	}
	return err
}

// GetActivityID returns the value of ActivityID if it is set or its
// zero value if it is unset.
func (v *PendingActivityInfo) GetActivityID() (o string) {
	if v != nil && v.ActivityID != nil {
		return *v.ActivityID
	}

	return
}

// IsSetActivityID returns true if ActivityID is not nil.
func (v *PendingActivityInfo) IsSetActivityID() bool {
	return v != nil && v.ActivityID != nil
}

// GetActivityType returns the value of ActivityType if it is set or its
// zero value if it is unset.
func (v *PendingActivityInfo) GetActivityType() (o *ActivityType) {
	if v != nil && v.ActivityType != nil {
		return v.ActivityType
	}

	return
}

// IsSetActivityType returns true if ActivityType is not nil.
func (v *PendingActivityInfo) IsSetActivityType() bool {
	return v != nil && v.ActivityType != nil
}

// GetState returns the value of State if it is set or its
// zero value if it is unset.
func (v *PendingActivityInfo) GetState() (o PendingActivityState) {
	if v != nil && v.State != nil {
		return *v.State
	}

	return
}

// IsSetState returns true if State is not nil.
func (v *PendingActivityInfo) IsSetState() bool {
	return v != nil && v.State != nil
}

// GetHeartbeatDetails returns the value of HeartbeatDetails if it is set or its
// zero value if it is unset.
func (v *PendingActivityInfo) GetHeartbeatDetails() (o []byte) {
	if v != nil && v.HeartbeatDetails != nil {
		return v.HeartbeatDetails
	}

	return
}

// IsSetHeartbeatDetails returns true if HeartbeatDetails is not nil.
func (v *PendingActivityInfo) IsSetHeartbeatDetails() bool {
	return v != nil && v.HeartbeatDetails != nil
}

// GetLastHeartbeatTimestamp returns the value of LastHeartbeatTimestamp if it is set or its
// zero value if it is unset.
func (v *PendingActivityInfo) GetLastHeartbeatTimestamp() (o int64) {
	if v != nil && v.LastHeartbeatTimestamp != nil {
		return *v.LastHeartbeatTimestamp
	}

	return
}

// IsSetLastHeartbeatTimestamp returns true if LastHeartbeatTimestamp is not nil.
func (v *PendingActivityInfo) IsSetLastHeartbeatTimestamp() bool {
	return v != nil && v.LastHeartbeatTimestamp != nil
}

// GetLastStartedTimestamp returns the value of LastStartedTimestamp if it is set or its
// zero value if it is unset.
func (v *PendingActivityInfo) GetLastStartedTimestamp() (o int64) {
	if v != nil && v.LastStartedTimestamp != nil {
		return *v.LastStartedTimestamp
	}

	return
}

// IsSetLastStartedTimestamp returns true if LastStartedTimestamp is not nil.
func (v *PendingActivityInfo) IsSetLastStartedTimestamp() bool {
	return v != nil && v.LastStartedTimestamp != nil
}

// GetAttempt returns the value of Attempt if it is set or its
// zero value if it is unset.
func (v *PendingActivityInfo) GetAttempt() (o int32) {
	if v != nil && v.Attempt != nil {
		return *v.Attempt
	}

	return
}

// IsSetAttempt returns true if Attempt is not nil.
func (v *PendingActivityInfo) IsSetAttempt() bool {
	return v != nil && v.Attempt != nil
}

// GetMaximumAttempts returns the value of MaximumAttempts if it is set or its
// zero value if it is unset.
func (v *PendingActivityInfo) GetMaximumAttempts() (o int32) {
	if v != nil && v.MaximumAttempts != nil {
		return *v.MaximumAttempts
	}

	return
}

// IsSetMaximumAttempts returns true if MaximumAttempts is not nil.
func (v *PendingActivityInfo) IsSetMaximumAttempts() bool {
	return v != nil && v.MaximumAttempts != nil
}

// GetScheduledTimestamp returns the value of ScheduledTimestamp if it is set or its
// zero value if it is unset.
func (v *PendingActivityInfo) GetScheduledTimestamp() (o int64) {
	if v != nil && v.ScheduledTimestamp != nil {
		return *v.ScheduledTimestamp
	}

	return
}

// IsSetScheduledTimestamp returns true if ScheduledTimestamp is not nil.
func (v *PendingActivityInfo) IsSetScheduledTimestamp() bool {
	return v != nil && v.ScheduledTimestamp != nil
}

// GetExpirationTimestamp returns the value of ExpirationTimestamp if it is set or its
// zero value if it is unset.
func (v *PendingActivityInfo) GetExpirationTimestamp() (o int64) {
	if v != nil && v.ExpirationTimestamp != nil {
		return *v.ExpirationTimestamp
	}

	return
}

// IsSetExpirationTimestamp returns true if ExpirationTimestamp is not nil.
func (v *PendingActivityInfo) IsSetExpirationTimestamp() bool {
	return v != nil && v.ExpirationTimestamp != nil
}

// GetLastFailureReason returns the value of LastFailureReason if it is set or its
// zero value if it is unset.
func (v *PendingActivityInfo) GetLastFailureReason() (o string) {
	if v != nil && v.LastFailureReason != nil {
		return *v.LastFailureReason
	}

	return
}

// IsSetLastFailureReason returns true if LastFailureReason is not nil.
func (v *PendingActivityInfo) IsSetLastFailureReason() bool {
	return v != nil && v.LastFailureReason != nil
}

// GetLastWorkerIdentity returns the value of LastWorkerIdentity if it is set or its
// zero value if it is unset.
func (v *PendingActivityInfo) GetLastWorkerIdentity() (o string) {
	if v != nil && v.LastWorkerIdentity != nil {
		return *v.LastWorkerIdentity
	}

	return
}

// IsSetLastWorkerIdentity returns true if LastWorkerIdentity is not nil.
func (v *PendingActivityInfo) IsSetLastWorkerIdentity() bool {
	return v != nil && v.LastWorkerIdentity != nil
}

// GetLastFailureDetails returns the value of LastFailureDetails if it is set or its
// zero value if it is unset.
func (v *PendingActivityInfo) GetLastFailureDetails() (o []byte) {
	if v != nil && v.LastFailureDetails != nil {
		return v.LastFailureDetails
	}

	return
}

// IsSetLastFailureDetails returns true if LastFailureDetails is not nil.
func (v *PendingActivityInfo) IsSetLastFailureDetails() bool {
	return v != nil && v.LastFailureDetails != nil
}

// GetStartedWorkerIdentity returns the value of StartedWorkerIdentity if it is set or its
// zero value if it is unset.
func (v *PendingActivityInfo) GetStartedWorkerIdentity() (o string) {
	if v != nil && v.StartedWorkerIdentity != nil {
		return *v.StartedWorkerIdentity
	}

	return
}

// IsSetStartedWorkerIdentity returns true if StartedWorkerIdentity is not nil.
func (v *PendingActivityInfo) IsSetStartedWorkerIdentity() bool {
	return v != nil && v.StartedWorkerIdentity != nil
}

// GetScheduleID returns the value of ScheduleID if it is set or its
// zero value if it is unset.
func (v *PendingActivityInfo) GetScheduleID() (o int64) {
	if v != nil && v.ScheduleID != nil {
		return *v.ScheduleID
	}

	return
}

// IsSetScheduleID returns true if ScheduleID is not nil.
func (v *PendingActivityInfo) IsSetScheduleID() bool {
	return v != nil && v.ScheduleID != nil
}

type PendingActivityState int32

const (
	PendingActivityStateScheduled       PendingActivityState = 0
	PendingActivityStateStarted         PendingActivityState = 1
	PendingActivityStateCancelRequested PendingActivityState = 2
)

// PendingActivityState_Values returns all recognized values of PendingActivityState.
func PendingActivityState_Values() []PendingActivityState {
	return []PendingActivityState{
		PendingActivityStateScheduled,
		PendingActivityStateStarted,
		PendingActivityStateCancelRequested,
	}
}

// UnmarshalText tries to decode PendingActivityState from a byte slice
// containing its name.
//
//	var v PendingActivityState
//	err := v.UnmarshalText([]byte("SCHEDULED"))
func (v *PendingActivityState) UnmarshalText(value []byte) error {
	switch s := string(value); s {
	case "SCHEDULED":
		*v = PendingActivityStateScheduled
		return nil
	case "STARTED":
		*v = PendingActivityStateStarted
		return nil
	case "CANCEL_REQUESTED":
		*v = PendingActivityStateCancelRequested
		return nil
	default:
		val, err := strconv.ParseInt(s, 10, 32)
		if err != nil {
			return fmt.Errorf("unknown enum value %q for %q: %v", s, "PendingActivityState", err)
		}
		*v = PendingActivityState(val)
		return nil
	}
}

// MarshalText encodes PendingActivityState 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 PendingActivityState) MarshalText() ([]byte, error) {
	switch int32(v) {
	case 0:
		return []byte("SCHEDULED"), nil
	case 1:
		return []byte("STARTED"), nil
	case 2:
		return []byte("CANCEL_REQUESTED"), nil
	}
	return []byte(strconv.FormatInt(int64(v), 10)), nil
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of PendingActivityState.
// 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 PendingActivityState) MarshalLogObject(enc zapcore.ObjectEncoder) error {
	enc.AddInt32("value", int32(v))
	switch int32(v) {
	case 0:
		enc.AddString("name", "SCHEDULED")
	case 1:
		enc.AddString("name", "STARTED")
	case 2:
		enc.AddString("name", "CANCEL_REQUESTED")
	}
	return nil
}

// Ptr returns a pointer to this enum value.
func (v PendingActivityState) Ptr() *PendingActivityState {
	return &v
}

// ToWire translates PendingActivityState 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 PendingActivityState) ToWire() (wire.Value, error) {
	return wire.NewValueI32(int32(v)), nil
}

// FromWire deserializes PendingActivityState from its Thrift-level
// representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TI32)
//	if err != nil {
//	  return PendingActivityState(0), err
//	}
//
//	var v PendingActivityState
//	if err := v.FromWire(x); err != nil {
//	  return PendingActivityState(0), err
//	}
//	return v, nil
func (v *PendingActivityState) FromWire(w wire.Value) error {
	*v = (PendingActivityState)(w.GetI32())
	return nil
}

// String returns a readable string representation of PendingActivityState.
func (v PendingActivityState) String() string {
	w := int32(v)
	switch w {
	case 0:
		return "SCHEDULED"
	case 1:
		return "STARTED"
	case 2:
		return "CANCEL_REQUESTED"
	}
	return fmt.Sprintf("PendingActivityState(%d)", w)
}

// Equals returns true if this PendingActivityState value matches the provided
// value.
func (v PendingActivityState) Equals(rhs PendingActivityState) bool {
	return v == rhs
}

// MarshalJSON serializes PendingActivityState into JSON.
//
// If the enum value is recognized, its name is returned. Otherwise,
// its integer value is returned.
//
// This implements json.Marshaler.
func (v PendingActivityState) MarshalJSON() ([]byte, error) {
	switch int32(v) {
	case 0:
		return ([]byte)("\"SCHEDULED\""), nil
	case 1:
		return ([]byte)("\"STARTED\""), nil
	case 2:
		return ([]byte)("\"CANCEL_REQUESTED\""), nil
	}
	return ([]byte)(strconv.FormatInt(int64(v), 10)), nil
}

// UnmarshalJSON attempts to decode PendingActivityState 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 *PendingActivityState) 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, "PendingActivityState")
		}
		if x < math.MinInt32 {
			return fmt.Errorf("enum underflow from JSON %q for %q", text, "PendingActivityState")
		}
		*v = (PendingActivityState)(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, "PendingActivityState")
	}
}

type PendingChildExecutionInfo struct {
	Domain            *string            `json:"domain,omitempty"`
	WorkflowID        *string            `json:"workflowID,omitempty"`
	RunID             *string            `json:"runID,omitempty"`
	WorkflowTypName   *string            `json:"workflowTypName,omitempty"`
	InitiatedID       *int64             `json:"initiatedID,omitempty"`
	ParentClosePolicy *ParentClosePolicy `json:"parentClosePolicy,omitempty"`
}

// ToWire translates a PendingChildExecutionInfo 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 *PendingChildExecutionInfo) ToWire() (wire.Value, error) {
	var (
		fields [6]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: 1, Value: w}
		i++
	}
	if v.WorkflowID != nil {
		w, err = wire.NewValueString(*(v.WorkflowID)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.RunID != nil {
		w, err = wire.NewValueString(*(v.RunID)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.WorkflowTypName != nil {
		w, err = wire.NewValueString(*(v.WorkflowTypName)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.InitiatedID != nil {
		w, err = wire.NewValueI64(*(v.InitiatedID)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 40, Value: w}
		i++
	}
	if v.ParentClosePolicy != nil {
		w, err = v.ParentClosePolicy.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 50, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

// FromWire deserializes a PendingChildExecutionInfo 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 PendingChildExecutionInfo struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v PendingChildExecutionInfo
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *PendingChildExecutionInfo) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 1:
			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 10:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.WorkflowID = &x
				if err != nil {
					return err
				}

			}
		case 20:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.RunID = &x
				if err != nil {
					return err
				}

			}
		case 30:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.WorkflowTypName = &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.InitiatedID = &x
				if err != nil {
					return err
				}

			}
		case 50:
			if field.Value.Type() == wire.TI32 {
				var x ParentClosePolicy
				x, err = _ParentClosePolicy_Read(field.Value)
				v.ParentClosePolicy = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a PendingChildExecutionInfo
// struct.
func (v *PendingChildExecutionInfo) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [6]string
	i := 0
	if v.Domain != nil {
		fields[i] = fmt.Sprintf("Domain: %v", *(v.Domain))
		i++
	}
	if v.WorkflowID != nil {
		fields[i] = fmt.Sprintf("WorkflowID: %v", *(v.WorkflowID))
		i++
	}
	if v.RunID != nil {
		fields[i] = fmt.Sprintf("RunID: %v", *(v.RunID))
		i++
	}
	if v.WorkflowTypName != nil {
		fields[i] = fmt.Sprintf("WorkflowTypName: %v", *(v.WorkflowTypName))
		i++
	}
	if v.InitiatedID != nil {
		fields[i] = fmt.Sprintf("InitiatedID: %v", *(v.InitiatedID))
		i++
	}
	if v.ParentClosePolicy != nil {
		fields[i] = fmt.Sprintf("ParentClosePolicy: %v", *(v.ParentClosePolicy))
		i++
	}

	return fmt.Sprintf("PendingChildExecutionInfo{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this PendingChildExecutionInfo match the
// provided PendingChildExecutionInfo.
//
// This function performs a deep comparison.
func (v *PendingChildExecutionInfo) Equals(rhs *PendingChildExecutionInfo) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.Domain, rhs.Domain) {
		return false
	}
	if !_String_EqualsPtr(v.WorkflowID, rhs.WorkflowID) {
		return false
	}
	if !_String_EqualsPtr(v.RunID, rhs.RunID) {
		return false
	}
	if !_String_EqualsPtr(v.WorkflowTypName, rhs.WorkflowTypName) {
		return false
	}
	if !_I64_EqualsPtr(v.InitiatedID, rhs.InitiatedID) {
		return false
	}
	if !_ParentClosePolicy_EqualsPtr(v.ParentClosePolicy, rhs.ParentClosePolicy) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of PendingChildExecutionInfo.
func (v *PendingChildExecutionInfo) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Domain != nil {
		enc.AddString("domain", *v.Domain)
	}
	if v.WorkflowID != nil {
		enc.AddString("workflowID", *v.WorkflowID)
	}
	if v.RunID != nil {
		enc.AddString("runID", *v.RunID)
	}
	if v.WorkflowTypName != nil {
		enc.AddString("workflowTypName", *v.WorkflowTypName)
	}
	if v.InitiatedID != nil {
		enc.AddInt64("initiatedID", *v.InitiatedID)
	}
	if v.ParentClosePolicy != nil {
		err = multierr.Append(err, enc.AddObject("parentClosePolicy", *v.ParentClosePolicy))
	}
	return err
}

// GetDomain returns the value of Domain if it is set or its
// zero value if it is unset.
func (v *PendingChildExecutionInfo) GetDomain() (o string) {
	if v != nil && v.Domain != nil {
		return *v.Domain
	}

	return
}

// IsSetDomain returns true if Domain is not nil.
func (v *PendingChildExecutionInfo) IsSetDomain() bool {
	return v != nil && v.Domain != nil
}

// GetWorkflowID returns the value of WorkflowID if it is set or its
// zero value if it is unset.
func (v *PendingChildExecutionInfo) GetWorkflowID() (o string) {
	if v != nil && v.WorkflowID != nil {
		return *v.WorkflowID
	}

	return
}

// IsSetWorkflowID returns true if WorkflowID is not nil.
func (v *PendingChildExecutionInfo) IsSetWorkflowID() bool {
	return v != nil && v.WorkflowID != nil
}

// GetRunID returns the value of RunID if it is set or its
// zero value if it is unset.
func (v *PendingChildExecutionInfo) GetRunID() (o string) {
	if v != nil && v.RunID != nil {
		return *v.RunID
	}

	return
}

// IsSetRunID returns true if RunID is not nil.
func (v *PendingChildExecutionInfo) IsSetRunID() bool {
	return v != nil && v.RunID != nil
}

// GetWorkflowTypName returns the value of WorkflowTypName if it is set or its
// zero value if it is unset.
func (v *PendingChildExecutionInfo) GetWorkflowTypName() (o string) {
	if v != nil && v.WorkflowTypName != nil {
		return *v.WorkflowTypName
	}

	return
}

// IsSetWorkflowTypName returns true if WorkflowTypName is not nil.
func (v *PendingChildExecutionInfo) IsSetWorkflowTypName() bool {
	return v != nil && v.WorkflowTypName != nil
}

// GetInitiatedID returns the value of InitiatedID if it is set or its
// zero value if it is unset.
func (v *PendingChildExecutionInfo) GetInitiatedID() (o int64) {
	if v != nil && v.InitiatedID != nil {
		return *v.InitiatedID
	}

	return
}

// IsSetInitiatedID returns true if InitiatedID is not nil.
func (v *PendingChildExecutionInfo) IsSetInitiatedID() bool {
	return v != nil && v.InitiatedID != nil
}

// GetParentClosePolicy returns the value of ParentClosePolicy if it is set or its
// zero value if it is unset.
func (v *PendingChildExecutionInfo) GetParentClosePolicy() (o ParentClosePolicy) {
	if v != nil && v.ParentClosePolicy != nil {
		return *v.ParentClosePolicy
	}

	return
}

// IsSetParentClosePolicy returns true if ParentClosePolicy is not nil.
func (v *PendingChildExecutionInfo) IsSetParentClosePolicy() bool {
	return v != nil && v.ParentClosePolicy != nil
}

type PendingDecisionInfo struct {
	State                      *PendingDecisionState `json:"state,omitempty"`
	ScheduledTimestamp         *int64                `json:"scheduledTimestamp,omitempty"`
	StartedTimestamp           *int64                `json:"startedTimestamp,omitempty"`
	Attempt                    *int64                `json:"attempt,omitempty"`
	OriginalScheduledTimestamp *int64                `json:"originalScheduledTimestamp,omitempty"`
	ScheduleID                 *int64                `json:"scheduleID,omitempty"`
}

// ToWire translates a PendingDecisionInfo 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 *PendingDecisionInfo) ToWire() (wire.Value, error) {
	var (
		fields [6]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.State != nil {
		w, err = v.State.ToWire()
		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.Attempt != nil {
		w, err = wire.NewValueI64(*(v.Attempt)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 40, Value: w}
		i++
	}
	if v.OriginalScheduledTimestamp != nil {
		w, err = wire.NewValueI64(*(v.OriginalScheduledTimestamp)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 50, 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: 60, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

func _PendingDecisionState_Read(w wire.Value) (PendingDecisionState, error) {
	var v PendingDecisionState
	err := v.FromWire(w)
	return v, err
}

// FromWire deserializes a PendingDecisionInfo 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 PendingDecisionInfo struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v PendingDecisionInfo
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *PendingDecisionInfo) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			if field.Value.Type() == wire.TI32 {
				var x PendingDecisionState
				x, err = _PendingDecisionState_Read(field.Value)
				v.State = &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.Attempt = &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.OriginalScheduledTimestamp = &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.ScheduleID = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a PendingDecisionInfo
// struct.
func (v *PendingDecisionInfo) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [6]string
	i := 0
	if v.State != nil {
		fields[i] = fmt.Sprintf("State: %v", *(v.State))
		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.Attempt != nil {
		fields[i] = fmt.Sprintf("Attempt: %v", *(v.Attempt))
		i++
	}
	if v.OriginalScheduledTimestamp != nil {
		fields[i] = fmt.Sprintf("OriginalScheduledTimestamp: %v", *(v.OriginalScheduledTimestamp))
		i++
	}
	if v.ScheduleID != nil {
		fields[i] = fmt.Sprintf("ScheduleID: %v", *(v.ScheduleID))
		i++
	}

	return fmt.Sprintf("PendingDecisionInfo{%v}", strings.Join(fields[:i], ", "))
}

func _PendingDecisionState_EqualsPtr(lhs, rhs *PendingDecisionState) bool {
	if lhs != nil && rhs != nil {

		x := *lhs
		y := *rhs
		return x.Equals(y)
	}
	return lhs == nil && rhs == nil
}

// Equals returns true if all the fields of this PendingDecisionInfo match the
// provided PendingDecisionInfo.
//
// This function performs a deep comparison.
func (v *PendingDecisionInfo) Equals(rhs *PendingDecisionInfo) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_PendingDecisionState_EqualsPtr(v.State, rhs.State) {
		return false
	}
	if !_I64_EqualsPtr(v.ScheduledTimestamp, rhs.ScheduledTimestamp) {
		return false
	}
	if !_I64_EqualsPtr(v.StartedTimestamp, rhs.StartedTimestamp) {
		return false
	}
	if !_I64_EqualsPtr(v.Attempt, rhs.Attempt) {
		return false
	}
	if !_I64_EqualsPtr(v.OriginalScheduledTimestamp, rhs.OriginalScheduledTimestamp) {
		return false
	}
	if !_I64_EqualsPtr(v.ScheduleID, rhs.ScheduleID) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of PendingDecisionInfo.
func (v *PendingDecisionInfo) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.State != nil {
		err = multierr.Append(err, enc.AddObject("state", *v.State))
	}
	if v.ScheduledTimestamp != nil {
		enc.AddInt64("scheduledTimestamp", *v.ScheduledTimestamp)
	}
	if v.StartedTimestamp != nil {
		enc.AddInt64("startedTimestamp", *v.StartedTimestamp)
	}
	if v.Attempt != nil {
		enc.AddInt64("attempt", *v.Attempt)
	}
	if v.OriginalScheduledTimestamp != nil {
		enc.AddInt64("originalScheduledTimestamp", *v.OriginalScheduledTimestamp)
	}
	if v.ScheduleID != nil {
		enc.AddInt64("scheduleID", *v.ScheduleID)
	}
	return err
}

// GetState returns the value of State if it is set or its
// zero value if it is unset.
func (v *PendingDecisionInfo) GetState() (o PendingDecisionState) {
	if v != nil && v.State != nil {
		return *v.State
	}

	return
}

// IsSetState returns true if State is not nil.
func (v *PendingDecisionInfo) IsSetState() bool {
	return v != nil && v.State != nil
}

// GetScheduledTimestamp returns the value of ScheduledTimestamp if it is set or its
// zero value if it is unset.
func (v *PendingDecisionInfo) GetScheduledTimestamp() (o int64) {
	if v != nil && v.ScheduledTimestamp != nil {
		return *v.ScheduledTimestamp
	}

	return
}

// IsSetScheduledTimestamp returns true if ScheduledTimestamp is not nil.
func (v *PendingDecisionInfo) 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 *PendingDecisionInfo) GetStartedTimestamp() (o int64) {
	if v != nil && v.StartedTimestamp != nil {
		return *v.StartedTimestamp
	}

	return
}

// IsSetStartedTimestamp returns true if StartedTimestamp is not nil.
func (v *PendingDecisionInfo) 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 *PendingDecisionInfo) GetAttempt() (o int64) {
	if v != nil && v.Attempt != nil {
		return *v.Attempt
	}

	return
}

// IsSetAttempt returns true if Attempt is not nil.
func (v *PendingDecisionInfo) IsSetAttempt() bool {
	return v != nil && v.Attempt != nil
}

// GetOriginalScheduledTimestamp returns the value of OriginalScheduledTimestamp if it is set or its
// zero value if it is unset.
func (v *PendingDecisionInfo) GetOriginalScheduledTimestamp() (o int64) {
	if v != nil && v.OriginalScheduledTimestamp != nil {
		return *v.OriginalScheduledTimestamp
	}

	return
}

// IsSetOriginalScheduledTimestamp returns true if OriginalScheduledTimestamp is not nil.
func (v *PendingDecisionInfo) IsSetOriginalScheduledTimestamp() bool {
	return v != nil && v.OriginalScheduledTimestamp != nil
}

// GetScheduleID returns the value of ScheduleID if it is set or its
// zero value if it is unset.
func (v *PendingDecisionInfo) GetScheduleID() (o int64) {
	if v != nil && v.ScheduleID != nil {
		return *v.ScheduleID
	}

	return
}

// IsSetScheduleID returns true if ScheduleID is not nil.
func (v *PendingDecisionInfo) IsSetScheduleID() bool {
	return v != nil && v.ScheduleID != nil
}

type PendingDecisionState int32

const (
	PendingDecisionStateScheduled PendingDecisionState = 0
	PendingDecisionStateStarted   PendingDecisionState = 1
)

// PendingDecisionState_Values returns all recognized values of PendingDecisionState.
func PendingDecisionState_Values() []PendingDecisionState {
	return []PendingDecisionState{
		PendingDecisionStateScheduled,
		PendingDecisionStateStarted,
	}
}

// UnmarshalText tries to decode PendingDecisionState from a byte slice
// containing its name.
//
//	var v PendingDecisionState
//	err := v.UnmarshalText([]byte("SCHEDULED"))
func (v *PendingDecisionState) UnmarshalText(value []byte) error {
	switch s := string(value); s {
	case "SCHEDULED":
		*v = PendingDecisionStateScheduled
		return nil
	case "STARTED":
		*v = PendingDecisionStateStarted
		return nil
	default:
		val, err := strconv.ParseInt(s, 10, 32)
		if err != nil {
			return fmt.Errorf("unknown enum value %q for %q: %v", s, "PendingDecisionState", err)
		}
		*v = PendingDecisionState(val)
		return nil
	}
}

// MarshalText encodes PendingDecisionState 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 PendingDecisionState) MarshalText() ([]byte, error) {
	switch int32(v) {
	case 0:
		return []byte("SCHEDULED"), nil
	case 1:
		return []byte("STARTED"), nil
	}
	return []byte(strconv.FormatInt(int64(v), 10)), nil
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of PendingDecisionState.
// 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 PendingDecisionState) MarshalLogObject(enc zapcore.ObjectEncoder) error {
	enc.AddInt32("value", int32(v))
	switch int32(v) {
	case 0:
		enc.AddString("name", "SCHEDULED")
	case 1:
		enc.AddString("name", "STARTED")
	}
	return nil
}

// Ptr returns a pointer to this enum value.
func (v PendingDecisionState) Ptr() *PendingDecisionState {
	return &v
}

// ToWire translates PendingDecisionState 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 PendingDecisionState) ToWire() (wire.Value, error) {
	return wire.NewValueI32(int32(v)), nil
}

// FromWire deserializes PendingDecisionState from its Thrift-level
// representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TI32)
//	if err != nil {
//	  return PendingDecisionState(0), err
//	}
//
//	var v PendingDecisionState
//	if err := v.FromWire(x); err != nil {
//	  return PendingDecisionState(0), err
//	}
//	return v, nil
func (v *PendingDecisionState) FromWire(w wire.Value) error {
	*v = (PendingDecisionState)(w.GetI32())
	return nil
}

// String returns a readable string representation of PendingDecisionState.
func (v PendingDecisionState) String() string {
	w := int32(v)
	switch w {
	case 0:
		return "SCHEDULED"
	case 1:
		return "STARTED"
	}
	return fmt.Sprintf("PendingDecisionState(%d)", w)
}

// Equals returns true if this PendingDecisionState value matches the provided
// value.
func (v PendingDecisionState) Equals(rhs PendingDecisionState) bool {
	return v == rhs
}

// MarshalJSON serializes PendingDecisionState into JSON.
//
// If the enum value is recognized, its name is returned. Otherwise,
// its integer value is returned.
//
// This implements json.Marshaler.
func (v PendingDecisionState) MarshalJSON() ([]byte, error) {
	switch int32(v) {
	case 0:
		return ([]byte)("\"SCHEDULED\""), nil
	case 1:
		return ([]byte)("\"STARTED\""), nil
	}
	return ([]byte)(strconv.FormatInt(int64(v), 10)), nil
}

// UnmarshalJSON attempts to decode PendingDecisionState 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 *PendingDecisionState) 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, "PendingDecisionState")
		}
		if x < math.MinInt32 {
			return fmt.Errorf("enum underflow from JSON %q for %q", text, "PendingDecisionState")
		}
		*v = (PendingDecisionState)(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, "PendingDecisionState")
	}
}

type PollForActivityTaskRequest struct {
	Domain           *string           `json:"domain,omitempty"`
	TaskList         *TaskList         `json:"taskList,omitempty"`
	Identity         *string           `json:"identity,omitempty"`
	TaskListMetadata *TaskListMetadata `json:"taskListMetadata,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 [4]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++
	}
	if v.Identity != nil {
		w, err = wire.NewValueString(*(v.Identity)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.TaskListMetadata != nil {
		w, err = v.TaskListMetadata.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 _TaskListMetadata_Read(w wire.Value) (*TaskListMetadata, error) {
	var v TaskListMetadata
	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.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
				}

			}
		case 30:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.Identity = &x
				if err != nil {
					return err
				}

			}
		case 40:
			if field.Value.Type() == wire.TStruct {
				v.TaskListMetadata, err = _TaskListMetadata_Read(field.Value)
				if 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 [4]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++
	}
	if v.Identity != nil {
		fields[i] = fmt.Sprintf("Identity: %v", *(v.Identity))
		i++
	}
	if v.TaskListMetadata != nil {
		fields[i] = fmt.Sprintf("TaskListMetadata: %v", v.TaskListMetadata)
		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.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
	}
	if !_String_EqualsPtr(v.Identity, rhs.Identity) {
		return false
	}
	if !((v.TaskListMetadata == nil && rhs.TaskListMetadata == nil) || (v.TaskListMetadata != nil && rhs.TaskListMetadata != nil && v.TaskListMetadata.Equals(rhs.TaskListMetadata))) {
		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.Domain != nil {
		enc.AddString("domain", *v.Domain)
	}
	if v.TaskList != nil {
		err = multierr.Append(err, enc.AddObject("taskList", v.TaskList))
	}
	if v.Identity != nil {
		enc.AddString("identity", *v.Identity)
	}
	if v.TaskListMetadata != nil {
		err = multierr.Append(err, enc.AddObject("taskListMetadata", v.TaskListMetadata))
	}
	return err
}

// GetDomain returns the value of Domain if it is set or its
// zero value if it is unset.
func (v *PollForActivityTaskRequest) GetDomain() (o string) {
	if v != nil && v.Domain != nil {
		return *v.Domain
	}

	return
}

// IsSetDomain returns true if Domain is not nil.
func (v *PollForActivityTaskRequest) 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 *PollForActivityTaskRequest) GetTaskList() (o *TaskList) {
	if v != nil && v.TaskList != nil {
		return v.TaskList
	}

	return
}

// IsSetTaskList returns true if TaskList is not nil.
func (v *PollForActivityTaskRequest) IsSetTaskList() bool {
	return v != nil && v.TaskList != nil
}

// GetIdentity returns the value of Identity if it is set or its
// zero value if it is unset.
func (v *PollForActivityTaskRequest) GetIdentity() (o string) {
	if v != nil && v.Identity != nil {
		return *v.Identity
	}

	return
}

// IsSetIdentity returns true if Identity is not nil.
func (v *PollForActivityTaskRequest) IsSetIdentity() bool {
	return v != nil && v.Identity != nil
}

// GetTaskListMetadata returns the value of TaskListMetadata if it is set or its
// zero value if it is unset.
func (v *PollForActivityTaskRequest) GetTaskListMetadata() (o *TaskListMetadata) {
	if v != nil && v.TaskListMetadata != nil {
		return v.TaskListMetadata
	}

	return
}

// IsSetTaskListMetadata returns true if TaskListMetadata is not nil.
func (v *PollForActivityTaskRequest) IsSetTaskListMetadata() bool {
	return v != nil && v.TaskListMetadata != nil
}

type PollForActivityTaskResponse struct {
	TaskToken                       []byte             `json:"taskToken,omitempty"`
	WorkflowExecution               *WorkflowExecution `json:"workflowExecution,omitempty"`
	ActivityId                      *string            `json:"activityId,omitempty"`
	ActivityType                    *ActivityType      `json:"activityType,omitempty"`
	Input                           []byte             `json:"input,omitempty"`
	ScheduledTimestamp              *int64             `json:"scheduledTimestamp,omitempty"`
	ScheduleToCloseTimeoutSeconds   *int32             `json:"scheduleToCloseTimeoutSeconds,omitempty"`
	StartedTimestamp                *int64             `json:"startedTimestamp,omitempty"`
	StartToCloseTimeoutSeconds      *int32             `json:"startToCloseTimeoutSeconds,omitempty"`
	HeartbeatTimeoutSeconds         *int32             `json:"heartbeatTimeoutSeconds,omitempty"`
	Attempt                         *int32             `json:"attempt,omitempty"`
	ScheduledTimestampOfThisAttempt *int64             `json:"scheduledTimestampOfThisAttempt,omitempty"`
	HeartbeatDetails                []byte             `json:"heartbeatDetails,omitempty"`
	WorkflowType                    *WorkflowType      `json:"workflowType,omitempty"`
	WorkflowDomain                  *string            `json:"workflowDomain,omitempty"`
	Header                          *Header            `json:"header,omitempty"`
	AutoConfigHint                  *AutoConfigHint    `json:"autoConfigHint,omitempty"`
}

// ToWire translates a PollForActivityTaskResponse 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 *PollForActivityTaskResponse) ToWire() (wire.Value, error) {
	var (
		fields [17]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.ActivityId != nil {
		w, err = wire.NewValueString(*(v.ActivityId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.ActivityType != nil {
		w, err = v.ActivityType.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 40, Value: w}
		i++
	}
	if v.Input != nil {
		w, err = wire.NewValueBinary(v.Input), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 50, 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: 70, Value: w}
		i++
	}
	if v.ScheduleToCloseTimeoutSeconds != nil {
		w, err = wire.NewValueI32(*(v.ScheduleToCloseTimeoutSeconds)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 80, 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: 90, Value: w}
		i++
	}
	if v.StartToCloseTimeoutSeconds != nil {
		w, err = wire.NewValueI32(*(v.StartToCloseTimeoutSeconds)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 100, Value: w}
		i++
	}
	if v.HeartbeatTimeoutSeconds != nil {
		w, err = wire.NewValueI32(*(v.HeartbeatTimeoutSeconds)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 110, Value: w}
		i++
	}
	if v.Attempt != nil {
		w, err = wire.NewValueI32(*(v.Attempt)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 120, 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: 130, 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: 140, Value: w}
		i++
	}
	if v.WorkflowType != nil {
		w, err = v.WorkflowType.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 150, 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: 160, Value: w}
		i++
	}
	if v.Header != nil {
		w, err = v.Header.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 170, Value: w}
		i++
	}
	if v.AutoConfigHint != nil {
		w, err = v.AutoConfigHint.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 180, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

func _AutoConfigHint_Read(w wire.Value) (*AutoConfigHint, error) {
	var v AutoConfigHint
	err := v.FromWire(w)
	return &v, err
}

// FromWire deserializes a PollForActivityTaskResponse 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 PollForActivityTaskResponse struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v PollForActivityTaskResponse
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *PollForActivityTaskResponse) 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.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.ActivityId = &x
				if err != nil {
					return err
				}

			}
		case 40:
			if field.Value.Type() == wire.TStruct {
				v.ActivityType, err = _ActivityType_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 50:
			if field.Value.Type() == wire.TBinary {
				v.Input, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		case 70:
			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 80:
			if field.Value.Type() == wire.TI32 {
				var x int32
				x, err = field.Value.GetI32(), error(nil)
				v.ScheduleToCloseTimeoutSeconds = &x
				if err != nil {
					return err
				}

			}
		case 90:
			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 100:
			if field.Value.Type() == wire.TI32 {
				var x int32
				x, err = field.Value.GetI32(), error(nil)
				v.StartToCloseTimeoutSeconds = &x
				if err != nil {
					return err
				}

			}
		case 110:
			if field.Value.Type() == wire.TI32 {
				var x int32
				x, err = field.Value.GetI32(), error(nil)
				v.HeartbeatTimeoutSeconds = &x
				if err != nil {
					return err
				}

			}
		case 120:
			if field.Value.Type() == wire.TI32 {
				var x int32
				x, err = field.Value.GetI32(), error(nil)
				v.Attempt = &x
				if err != nil {
					return err
				}

			}
		case 130:
			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 140:
			if field.Value.Type() == wire.TBinary {
				v.HeartbeatDetails, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		case 150:
			if field.Value.Type() == wire.TStruct {
				v.WorkflowType, err = _WorkflowType_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 160:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.WorkflowDomain = &x
				if err != nil {
					return err
				}

			}
		case 170:
			if field.Value.Type() == wire.TStruct {
				v.Header, err = _Header_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 180:
			if field.Value.Type() == wire.TStruct {
				v.AutoConfigHint, err = _AutoConfigHint_Read(field.Value)
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a PollForActivityTaskResponse
// struct.
func (v *PollForActivityTaskResponse) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [17]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.ActivityId != nil {
		fields[i] = fmt.Sprintf("ActivityId: %v", *(v.ActivityId))
		i++
	}
	if v.ActivityType != nil {
		fields[i] = fmt.Sprintf("ActivityType: %v", v.ActivityType)
		i++
	}
	if v.Input != nil {
		fields[i] = fmt.Sprintf("Input: %v", v.Input)
		i++
	}
	if v.ScheduledTimestamp != nil {
		fields[i] = fmt.Sprintf("ScheduledTimestamp: %v", *(v.ScheduledTimestamp))
		i++
	}
	if v.ScheduleToCloseTimeoutSeconds != nil {
		fields[i] = fmt.Sprintf("ScheduleToCloseTimeoutSeconds: %v", *(v.ScheduleToCloseTimeoutSeconds))
		i++
	}
	if v.StartedTimestamp != nil {
		fields[i] = fmt.Sprintf("StartedTimestamp: %v", *(v.StartedTimestamp))
		i++
	}
	if v.StartToCloseTimeoutSeconds != nil {
		fields[i] = fmt.Sprintf("StartToCloseTimeoutSeconds: %v", *(v.StartToCloseTimeoutSeconds))
		i++
	}
	if v.HeartbeatTimeoutSeconds != nil {
		fields[i] = fmt.Sprintf("HeartbeatTimeoutSeconds: %v", *(v.HeartbeatTimeoutSeconds))
		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.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++
	}
	if v.Header != nil {
		fields[i] = fmt.Sprintf("Header: %v", v.Header)
		i++
	}
	if v.AutoConfigHint != nil {
		fields[i] = fmt.Sprintf("AutoConfigHint: %v", v.AutoConfigHint)
		i++
	}

	return fmt.Sprintf("PollForActivityTaskResponse{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this PollForActivityTaskResponse match the
// provided PollForActivityTaskResponse.
//
// This function performs a deep comparison.
func (v *PollForActivityTaskResponse) Equals(rhs *PollForActivityTaskResponse) 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 !_String_EqualsPtr(v.ActivityId, rhs.ActivityId) {
		return false
	}
	if !((v.ActivityType == nil && rhs.ActivityType == nil) || (v.ActivityType != nil && rhs.ActivityType != nil && v.ActivityType.Equals(rhs.ActivityType))) {
		return false
	}
	if !((v.Input == nil && rhs.Input == nil) || (v.Input != nil && rhs.Input != nil && bytes.Equal(v.Input, rhs.Input))) {
		return false
	}
	if !_I64_EqualsPtr(v.ScheduledTimestamp, rhs.ScheduledTimestamp) {
		return false
	}
	if !_I32_EqualsPtr(v.ScheduleToCloseTimeoutSeconds, rhs.ScheduleToCloseTimeoutSeconds) {
		return false
	}
	if !_I64_EqualsPtr(v.StartedTimestamp, rhs.StartedTimestamp) {
		return false
	}
	if !_I32_EqualsPtr(v.StartToCloseTimeoutSeconds, rhs.StartToCloseTimeoutSeconds) {
		return false
	}
	if !_I32_EqualsPtr(v.HeartbeatTimeoutSeconds, rhs.HeartbeatTimeoutSeconds) {
		return false
	}
	if !_I32_EqualsPtr(v.Attempt, rhs.Attempt) {
		return false
	}
	if !_I64_EqualsPtr(v.ScheduledTimestampOfThisAttempt, rhs.ScheduledTimestampOfThisAttempt) {
		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
	}
	if !((v.Header == nil && rhs.Header == nil) || (v.Header != nil && rhs.Header != nil && v.Header.Equals(rhs.Header))) {
		return false
	}
	if !((v.AutoConfigHint == nil && rhs.AutoConfigHint == nil) || (v.AutoConfigHint != nil && rhs.AutoConfigHint != nil && v.AutoConfigHint.Equals(rhs.AutoConfigHint))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of PollForActivityTaskResponse.
func (v *PollForActivityTaskResponse) 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.ActivityId != nil {
		enc.AddString("activityId", *v.ActivityId)
	}
	if v.ActivityType != nil {
		err = multierr.Append(err, enc.AddObject("activityType", v.ActivityType))
	}
	if v.Input != nil {
		enc.AddString("input", base64.StdEncoding.EncodeToString(v.Input))
	}
	if v.ScheduledTimestamp != nil {
		enc.AddInt64("scheduledTimestamp", *v.ScheduledTimestamp)
	}
	if v.ScheduleToCloseTimeoutSeconds != nil {
		enc.AddInt32("scheduleToCloseTimeoutSeconds", *v.ScheduleToCloseTimeoutSeconds)
	}
	if v.StartedTimestamp != nil {
		enc.AddInt64("startedTimestamp", *v.StartedTimestamp)
	}
	if v.StartToCloseTimeoutSeconds != nil {
		enc.AddInt32("startToCloseTimeoutSeconds", *v.StartToCloseTimeoutSeconds)
	}
	if v.HeartbeatTimeoutSeconds != nil {
		enc.AddInt32("heartbeatTimeoutSeconds", *v.HeartbeatTimeoutSeconds)
	}
	if v.Attempt != nil {
		enc.AddInt32("attempt", *v.Attempt)
	}
	if v.ScheduledTimestampOfThisAttempt != nil {
		enc.AddInt64("scheduledTimestampOfThisAttempt", *v.ScheduledTimestampOfThisAttempt)
	}
	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)
	}
	if v.Header != nil {
		err = multierr.Append(err, enc.AddObject("header", v.Header))
	}
	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 *PollForActivityTaskResponse) GetTaskToken() (o []byte) {
	if v != nil && v.TaskToken != nil {
		return v.TaskToken
	}

	return
}

// IsSetTaskToken returns true if TaskToken is not nil.
func (v *PollForActivityTaskResponse) 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 *PollForActivityTaskResponse) GetWorkflowExecution() (o *WorkflowExecution) {
	if v != nil && v.WorkflowExecution != nil {
		return v.WorkflowExecution
	}

	return
}

// IsSetWorkflowExecution returns true if WorkflowExecution is not nil.
func (v *PollForActivityTaskResponse) IsSetWorkflowExecution() bool {
	return v != nil && v.WorkflowExecution != nil
}

// GetActivityId returns the value of ActivityId if it is set or its
// zero value if it is unset.
func (v *PollForActivityTaskResponse) GetActivityId() (o string) {
	if v != nil && v.ActivityId != nil {
		return *v.ActivityId
	}

	return
}

// IsSetActivityId returns true if ActivityId is not nil.
func (v *PollForActivityTaskResponse) IsSetActivityId() bool {
	return v != nil && v.ActivityId != nil
}

// GetActivityType returns the value of ActivityType if it is set or its
// zero value if it is unset.
func (v *PollForActivityTaskResponse) GetActivityType() (o *ActivityType) {
	if v != nil && v.ActivityType != nil {
		return v.ActivityType
	}

	return
}

// IsSetActivityType returns true if ActivityType is not nil.
func (v *PollForActivityTaskResponse) IsSetActivityType() bool {
	return v != nil && v.ActivityType != nil
}

// GetInput returns the value of Input if it is set or its
// zero value if it is unset.
func (v *PollForActivityTaskResponse) GetInput() (o []byte) {
	if v != nil && v.Input != nil {
		return v.Input
	}

	return
}

// IsSetInput returns true if Input is not nil.
func (v *PollForActivityTaskResponse) IsSetInput() bool {
	return v != nil && v.Input != nil
}

// GetScheduledTimestamp returns the value of ScheduledTimestamp if it is set or its
// zero value if it is unset.
func (v *PollForActivityTaskResponse) GetScheduledTimestamp() (o int64) {
	if v != nil && v.ScheduledTimestamp != nil {
		return *v.ScheduledTimestamp
	}

	return
}

// IsSetScheduledTimestamp returns true if ScheduledTimestamp is not nil.
func (v *PollForActivityTaskResponse) IsSetScheduledTimestamp() bool {
	return v != nil && v.ScheduledTimestamp != nil
}

// GetScheduleToCloseTimeoutSeconds returns the value of ScheduleToCloseTimeoutSeconds if it is set or its
// zero value if it is unset.
func (v *PollForActivityTaskResponse) GetScheduleToCloseTimeoutSeconds() (o int32) {
	if v != nil && v.ScheduleToCloseTimeoutSeconds != nil {
		return *v.ScheduleToCloseTimeoutSeconds
	}

	return
}

// IsSetScheduleToCloseTimeoutSeconds returns true if ScheduleToCloseTimeoutSeconds is not nil.
func (v *PollForActivityTaskResponse) IsSetScheduleToCloseTimeoutSeconds() bool {
	return v != nil && v.ScheduleToCloseTimeoutSeconds != nil
}

// GetStartedTimestamp returns the value of StartedTimestamp if it is set or its
// zero value if it is unset.
func (v *PollForActivityTaskResponse) GetStartedTimestamp() (o int64) {
	if v != nil && v.StartedTimestamp != nil {
		return *v.StartedTimestamp
	}

	return
}

// IsSetStartedTimestamp returns true if StartedTimestamp is not nil.
func (v *PollForActivityTaskResponse) IsSetStartedTimestamp() bool {
	return v != nil && v.StartedTimestamp != nil
}

// GetStartToCloseTimeoutSeconds returns the value of StartToCloseTimeoutSeconds if it is set or its
// zero value if it is unset.
func (v *PollForActivityTaskResponse) GetStartToCloseTimeoutSeconds() (o int32) {
	if v != nil && v.StartToCloseTimeoutSeconds != nil {
		return *v.StartToCloseTimeoutSeconds
	}

	return
}

// IsSetStartToCloseTimeoutSeconds returns true if StartToCloseTimeoutSeconds is not nil.
func (v *PollForActivityTaskResponse) IsSetStartToCloseTimeoutSeconds() bool {
	return v != nil && v.StartToCloseTimeoutSeconds != nil
}

// GetHeartbeatTimeoutSeconds returns the value of HeartbeatTimeoutSeconds if it is set or its
// zero value if it is unset.
func (v *PollForActivityTaskResponse) GetHeartbeatTimeoutSeconds() (o int32) {
	if v != nil && v.HeartbeatTimeoutSeconds != nil {
		return *v.HeartbeatTimeoutSeconds
	}

	return
}

// IsSetHeartbeatTimeoutSeconds returns true if HeartbeatTimeoutSeconds is not nil.
func (v *PollForActivityTaskResponse) IsSetHeartbeatTimeoutSeconds() bool {
	return v != nil && v.HeartbeatTimeoutSeconds != nil
}

// GetAttempt returns the value of Attempt if it is set or its
// zero value if it is unset.
func (v *PollForActivityTaskResponse) GetAttempt() (o int32) {
	if v != nil && v.Attempt != nil {
		return *v.Attempt
	}

	return
}

// IsSetAttempt returns true if Attempt is not nil.
func (v *PollForActivityTaskResponse) 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 *PollForActivityTaskResponse) GetScheduledTimestampOfThisAttempt() (o int64) {
	if v != nil && v.ScheduledTimestampOfThisAttempt != nil {
		return *v.ScheduledTimestampOfThisAttempt
	}

	return
}

// IsSetScheduledTimestampOfThisAttempt returns true if ScheduledTimestampOfThisAttempt is not nil.
func (v *PollForActivityTaskResponse) IsSetScheduledTimestampOfThisAttempt() bool {
	return v != nil && v.ScheduledTimestampOfThisAttempt != nil
}

// GetHeartbeatDetails returns the value of HeartbeatDetails if it is set or its
// zero value if it is unset.
func (v *PollForActivityTaskResponse) GetHeartbeatDetails() (o []byte) {
	if v != nil && v.HeartbeatDetails != nil {
		return v.HeartbeatDetails
	}

	return
}

// IsSetHeartbeatDetails returns true if HeartbeatDetails is not nil.
func (v *PollForActivityTaskResponse) 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 *PollForActivityTaskResponse) GetWorkflowType() (o *WorkflowType) {
	if v != nil && v.WorkflowType != nil {
		return v.WorkflowType
	}

	return
}

// IsSetWorkflowType returns true if WorkflowType is not nil.
func (v *PollForActivityTaskResponse) 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 *PollForActivityTaskResponse) GetWorkflowDomain() (o string) {
	if v != nil && v.WorkflowDomain != nil {
		return *v.WorkflowDomain
	}

	return
}

// IsSetWorkflowDomain returns true if WorkflowDomain is not nil.
func (v *PollForActivityTaskResponse) IsSetWorkflowDomain() bool {
	return v != nil && v.WorkflowDomain != nil
}

// GetHeader returns the value of Header if it is set or its
// zero value if it is unset.
func (v *PollForActivityTaskResponse) GetHeader() (o *Header) {
	if v != nil && v.Header != nil {
		return v.Header
	}

	return
}

// IsSetHeader returns true if Header is not nil.
func (v *PollForActivityTaskResponse) IsSetHeader() bool {
	return v != nil && v.Header != nil
}

// GetAutoConfigHint returns the value of AutoConfigHint if it is set or its
// zero value if it is unset.
func (v *PollForActivityTaskResponse) GetAutoConfigHint() (o *AutoConfigHint) {
	if v != nil && v.AutoConfigHint != nil {
		return v.AutoConfigHint
	}

	return
}

// IsSetAutoConfigHint returns true if AutoConfigHint is not nil.
func (v *PollForActivityTaskResponse) IsSetAutoConfigHint() bool {
	return v != nil && v.AutoConfigHint != nil
}

type PollForDecisionTaskRequest struct {
	Domain         *string   `json:"domain,omitempty"`
	TaskList       *TaskList `json:"taskList,omitempty"`
	Identity       *string   `json:"identity,omitempty"`
	BinaryChecksum *string   `json:"binaryChecksum,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 [4]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++
	}
	if v.Identity != nil {
		w, err = wire.NewValueString(*(v.Identity)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.BinaryChecksum != nil {
		w, err = wire.NewValueString(*(v.BinaryChecksum)), 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 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.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
				}

			}
		case 30:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.Identity = &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.BinaryChecksum = &x
				if 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 [4]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++
	}
	if v.Identity != nil {
		fields[i] = fmt.Sprintf("Identity: %v", *(v.Identity))
		i++
	}
	if v.BinaryChecksum != nil {
		fields[i] = fmt.Sprintf("BinaryChecksum: %v", *(v.BinaryChecksum))
		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.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
	}
	if !_String_EqualsPtr(v.Identity, rhs.Identity) {
		return false
	}
	if !_String_EqualsPtr(v.BinaryChecksum, rhs.BinaryChecksum) {
		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.Domain != nil {
		enc.AddString("domain", *v.Domain)
	}
	if v.TaskList != nil {
		err = multierr.Append(err, enc.AddObject("taskList", v.TaskList))
	}
	if v.Identity != nil {
		enc.AddString("identity", *v.Identity)
	}
	if v.BinaryChecksum != nil {
		enc.AddString("binaryChecksum", *v.BinaryChecksum)
	}
	return err
}

// GetDomain returns the value of Domain if it is set or its
// zero value if it is unset.
func (v *PollForDecisionTaskRequest) GetDomain() (o string) {
	if v != nil && v.Domain != nil {
		return *v.Domain
	}

	return
}

// IsSetDomain returns true if Domain is not nil.
func (v *PollForDecisionTaskRequest) 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 *PollForDecisionTaskRequest) GetTaskList() (o *TaskList) {
	if v != nil && v.TaskList != nil {
		return v.TaskList
	}

	return
}

// IsSetTaskList returns true if TaskList is not nil.
func (v *PollForDecisionTaskRequest) IsSetTaskList() bool {
	return v != nil && v.TaskList != nil
}

// GetIdentity returns the value of Identity if it is set or its
// zero value if it is unset.
func (v *PollForDecisionTaskRequest) GetIdentity() (o string) {
	if v != nil && v.Identity != nil {
		return *v.Identity
	}

	return
}

// IsSetIdentity returns true if Identity is not nil.
func (v *PollForDecisionTaskRequest) IsSetIdentity() bool {
	return v != nil && v.Identity != nil
}

// GetBinaryChecksum returns the value of BinaryChecksum if it is set or its
// zero value if it is unset.
func (v *PollForDecisionTaskRequest) GetBinaryChecksum() (o string) {
	if v != nil && v.BinaryChecksum != nil {
		return *v.BinaryChecksum
	}

	return
}

// IsSetBinaryChecksum returns true if BinaryChecksum is not nil.
func (v *PollForDecisionTaskRequest) IsSetBinaryChecksum() bool {
	return v != nil && v.BinaryChecksum != nil
}

type PollForDecisionTaskResponse struct {
	TaskToken                 []byte                    `json:"taskToken,omitempty"`
	WorkflowExecution         *WorkflowExecution        `json:"workflowExecution,omitempty"`
	WorkflowType              *WorkflowType             `json:"workflowType,omitempty"`
	PreviousStartedEventId    *int64                    `json:"previousStartedEventId,omitempty"`
	StartedEventId            *int64                    `json:"startedEventId,omitempty"`
	Attempt                   *int64                    `json:"attempt,omitempty"`
	BacklogCountHint          *int64                    `json:"backlogCountHint,omitempty"`
	History                   *History                  `json:"history,omitempty"`
	NextPageToken             []byte                    `json:"nextPageToken,omitempty"`
	Query                     *WorkflowQuery            `json:"query,omitempty"`
	WorkflowExecutionTaskList *TaskList                 `json:"WorkflowExecutionTaskList,omitempty"`
	ScheduledTimestamp        *int64                    `json:"scheduledTimestamp,omitempty"`
	StartedTimestamp          *int64                    `json:"startedTimestamp,omitempty"`
	Queries                   map[string]*WorkflowQuery `json:"queries,omitempty"`
	NextEventId               *int64                    `json:"nextEventId,omitempty"`
	TotalHistoryBytes         *int64                    `json:"totalHistoryBytes,omitempty"`
	AutoConfigHint            *AutoConfigHint           `json:"autoConfigHint,omitempty"`
}

type _Map_String_WorkflowQuery_MapItemList map[string]*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 [%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 [17]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.BacklogCountHint != nil {
		w, err = wire.NewValueI64(*(v.BacklogCountHint)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 54, Value: w}
		i++
	}
	if v.History != nil {
		w, err = v.History.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 60, Value: w}
		i++
	}
	if v.NextPageToken != nil {
		w, err = wire.NewValueBinary(v.NextPageToken), 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.WorkflowExecutionTaskList != nil {
		w, err = v.WorkflowExecutionTaskList.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 90, 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: 100, 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: 110, 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: 120, 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: 130, 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: 140, Value: w}
		i++
	}
	if v.AutoConfigHint != nil {
		w, err = v.AutoConfigHint.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 150, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

func _WorkflowQuery_Read(w wire.Value) (*WorkflowQuery, error) {
	var v WorkflowQuery
	err := v.FromWire(w)
	return &v, err
}

func _Map_String_WorkflowQuery_Read(m wire.MapItemList) (map[string]*WorkflowQuery, error) {
	if m.KeyType() != wire.TBinary {
		return nil, nil
	}

	if m.ValueType() != wire.TStruct {
		return nil, nil
	}

	o := make(map[string]*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
}

// 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 54:
			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 60:
			if field.Value.Type() == wire.TStruct {
				v.History, err = _History_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 70:
			if field.Value.Type() == wire.TBinary {
				v.NextPageToken, err = field.Value.GetBinary(), error(nil)
				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.WorkflowExecutionTaskList, err = _TaskList_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 100:
			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 110:
			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 120:
			if field.Value.Type() == wire.TMap {
				v.Queries, err = _Map_String_WorkflowQuery_Read(field.Value.GetMap())
				if err != nil {
					return err
				}

			}
		case 130:
			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 140:
			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 150:
			if field.Value.Type() == wire.TStruct {
				v.AutoConfigHint, err = _AutoConfigHint_Read(field.Value)
				if 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 [17]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.BacklogCountHint != nil {
		fields[i] = fmt.Sprintf("BacklogCountHint: %v", *(v.BacklogCountHint))
		i++
	}
	if v.History != nil {
		fields[i] = fmt.Sprintf("History: %v", v.History)
		i++
	}
	if v.NextPageToken != nil {
		fields[i] = fmt.Sprintf("NextPageToken: %v", v.NextPageToken)
		i++
	}
	if v.Query != nil {
		fields[i] = fmt.Sprintf("Query: %v", v.Query)
		i++
	}
	if v.WorkflowExecutionTaskList != nil {
		fields[i] = fmt.Sprintf("WorkflowExecutionTaskList: %v", v.WorkflowExecutionTaskList)
		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.NextEventId != nil {
		fields[i] = fmt.Sprintf("NextEventId: %v", *(v.NextEventId))
		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 _Map_String_WorkflowQuery_Equals(lhs, rhs map[string]*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.BacklogCountHint, rhs.BacklogCountHint) {
		return false
	}
	if !((v.History == nil && rhs.History == nil) || (v.History != nil && rhs.History != nil && v.History.Equals(rhs.History))) {
		return false
	}
	if !((v.NextPageToken == nil && rhs.NextPageToken == nil) || (v.NextPageToken != nil && rhs.NextPageToken != nil && bytes.Equal(v.NextPageToken, rhs.NextPageToken))) {
		return false
	}
	if !((v.Query == nil && rhs.Query == nil) || (v.Query != nil && rhs.Query != nil && v.Query.Equals(rhs.Query))) {
		return false
	}
	if !((v.WorkflowExecutionTaskList == nil && rhs.WorkflowExecutionTaskList == nil) || (v.WorkflowExecutionTaskList != nil && rhs.WorkflowExecutionTaskList != nil && v.WorkflowExecutionTaskList.Equals(rhs.WorkflowExecutionTaskList))) {
		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.NextEventId, rhs.NextEventId) {
		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]*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.BacklogCountHint != nil {
		enc.AddInt64("backlogCountHint", *v.BacklogCountHint)
	}
	if v.History != nil {
		err = multierr.Append(err, enc.AddObject("history", v.History))
	}
	if v.NextPageToken != nil {
		enc.AddString("nextPageToken", base64.StdEncoding.EncodeToString(v.NextPageToken))
	}
	if v.Query != nil {
		err = multierr.Append(err, enc.AddObject("query", v.Query))
	}
	if v.WorkflowExecutionTaskList != nil {
		err = multierr.Append(err, enc.AddObject("WorkflowExecutionTaskList", v.WorkflowExecutionTaskList))
	}
	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.NextEventId != nil {
		enc.AddInt64("nextEventId", *v.NextEventId)
	}
	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 *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 *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
}

// 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
}

// GetHistory returns the value of History if it is set or its
// zero value if it is unset.
func (v *PollForDecisionTaskResponse) GetHistory() (o *History) {
	if v != nil && v.History != nil {
		return v.History
	}

	return
}

// IsSetHistory returns true if History is not nil.
func (v *PollForDecisionTaskResponse) IsSetHistory() bool {
	return v != nil && v.History != nil
}

// GetNextPageToken returns the value of NextPageToken if it is set or its
// zero value if it is unset.
func (v *PollForDecisionTaskResponse) GetNextPageToken() (o []byte) {
	if v != nil && v.NextPageToken != nil {
		return v.NextPageToken
	}

	return
}

// IsSetNextPageToken returns true if NextPageToken is not nil.
func (v *PollForDecisionTaskResponse) IsSetNextPageToken() bool {
	return v != nil && v.NextPageToken != nil
}

// GetQuery returns the value of Query if it is set or its
// zero value if it is unset.
func (v *PollForDecisionTaskResponse) GetQuery() (o *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
}

// GetWorkflowExecutionTaskList returns the value of WorkflowExecutionTaskList if it is set or its
// zero value if it is unset.
func (v *PollForDecisionTaskResponse) GetWorkflowExecutionTaskList() (o *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
}

// 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]*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
}

// 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
}

// 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 *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 PollerInfo struct {
	LastAccessTime *int64   `json:"lastAccessTime,omitempty"`
	Identity       *string  `json:"identity,omitempty"`
	RatePerSecond  *float64 `json:"ratePerSecond,omitempty"`
}

// ToWire translates a PollerInfo 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 *PollerInfo) ToWire() (wire.Value, error) {
	var (
		fields [3]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.LastAccessTime != nil {
		w, err = wire.NewValueI64(*(v.LastAccessTime)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, 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: 20, Value: w}
		i++
	}
	if v.RatePerSecond != nil {
		w, err = wire.NewValueDouble(*(v.RatePerSecond)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

// FromWire deserializes a PollerInfo 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 PollerInfo struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v PollerInfo
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *PollerInfo) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			if field.Value.Type() == wire.TI64 {
				var x int64
				x, err = field.Value.GetI64(), error(nil)
				v.LastAccessTime = &x
				if err != nil {
					return err
				}

			}
		case 20:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.Identity = &x
				if err != nil {
					return err
				}

			}
		case 30:
			if field.Value.Type() == wire.TDouble {
				var x float64
				x, err = field.Value.GetDouble(), error(nil)
				v.RatePerSecond = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a PollerInfo
// struct.
func (v *PollerInfo) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [3]string
	i := 0
	if v.LastAccessTime != nil {
		fields[i] = fmt.Sprintf("LastAccessTime: %v", *(v.LastAccessTime))
		i++
	}
	if v.Identity != nil {
		fields[i] = fmt.Sprintf("Identity: %v", *(v.Identity))
		i++
	}
	if v.RatePerSecond != nil {
		fields[i] = fmt.Sprintf("RatePerSecond: %v", *(v.RatePerSecond))
		i++
	}

	return fmt.Sprintf("PollerInfo{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this PollerInfo match the
// provided PollerInfo.
//
// This function performs a deep comparison.
func (v *PollerInfo) Equals(rhs *PollerInfo) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_I64_EqualsPtr(v.LastAccessTime, rhs.LastAccessTime) {
		return false
	}
	if !_String_EqualsPtr(v.Identity, rhs.Identity) {
		return false
	}
	if !_Double_EqualsPtr(v.RatePerSecond, rhs.RatePerSecond) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of PollerInfo.
func (v *PollerInfo) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.LastAccessTime != nil {
		enc.AddInt64("lastAccessTime", *v.LastAccessTime)
	}
	if v.Identity != nil {
		enc.AddString("identity", *v.Identity)
	}
	if v.RatePerSecond != nil {
		enc.AddFloat64("ratePerSecond", *v.RatePerSecond)
	}
	return err
}

// GetLastAccessTime returns the value of LastAccessTime if it is set or its
// zero value if it is unset.
func (v *PollerInfo) GetLastAccessTime() (o int64) {
	if v != nil && v.LastAccessTime != nil {
		return *v.LastAccessTime
	}

	return
}

// IsSetLastAccessTime returns true if LastAccessTime is not nil.
func (v *PollerInfo) IsSetLastAccessTime() bool {
	return v != nil && v.LastAccessTime != nil
}

// GetIdentity returns the value of Identity if it is set or its
// zero value if it is unset.
func (v *PollerInfo) GetIdentity() (o string) {
	if v != nil && v.Identity != nil {
		return *v.Identity
	}

	return
}

// IsSetIdentity returns true if Identity is not nil.
func (v *PollerInfo) IsSetIdentity() bool {
	return v != nil && v.Identity != nil
}

// GetRatePerSecond returns the value of RatePerSecond if it is set or its
// zero value if it is unset.
func (v *PollerInfo) GetRatePerSecond() (o float64) {
	if v != nil && v.RatePerSecond != nil {
		return *v.RatePerSecond
	}

	return
}

// IsSetRatePerSecond returns true if RatePerSecond is not nil.
func (v *PollerInfo) IsSetRatePerSecond() bool {
	return v != nil && v.RatePerSecond != nil
}

type QueryConsistencyLevel int32

const (
	QueryConsistencyLevelEventual QueryConsistencyLevel = 0
	QueryConsistencyLevelStrong   QueryConsistencyLevel = 1
)

// QueryConsistencyLevel_Values returns all recognized values of QueryConsistencyLevel.
func QueryConsistencyLevel_Values() []QueryConsistencyLevel {
	return []QueryConsistencyLevel{
		QueryConsistencyLevelEventual,
		QueryConsistencyLevelStrong,
	}
}

// UnmarshalText tries to decode QueryConsistencyLevel from a byte slice
// containing its name.
//
//	var v QueryConsistencyLevel
//	err := v.UnmarshalText([]byte("EVENTUAL"))
func (v *QueryConsistencyLevel) UnmarshalText(value []byte) error {
	switch s := string(value); s {
	case "EVENTUAL":
		*v = QueryConsistencyLevelEventual
		return nil
	case "STRONG":
		*v = QueryConsistencyLevelStrong
		return nil
	default:
		val, err := strconv.ParseInt(s, 10, 32)
		if err != nil {
			return fmt.Errorf("unknown enum value %q for %q: %v", s, "QueryConsistencyLevel", err)
		}
		*v = QueryConsistencyLevel(val)
		return nil
	}
}

// MarshalText encodes QueryConsistencyLevel 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 QueryConsistencyLevel) MarshalText() ([]byte, error) {
	switch int32(v) {
	case 0:
		return []byte("EVENTUAL"), nil
	case 1:
		return []byte("STRONG"), nil
	}
	return []byte(strconv.FormatInt(int64(v), 10)), nil
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of QueryConsistencyLevel.
// 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 QueryConsistencyLevel) MarshalLogObject(enc zapcore.ObjectEncoder) error {
	enc.AddInt32("value", int32(v))
	switch int32(v) {
	case 0:
		enc.AddString("name", "EVENTUAL")
	case 1:
		enc.AddString("name", "STRONG")
	}
	return nil
}

// Ptr returns a pointer to this enum value.
func (v QueryConsistencyLevel) Ptr() *QueryConsistencyLevel {
	return &v
}

// ToWire translates QueryConsistencyLevel 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 QueryConsistencyLevel) ToWire() (wire.Value, error) {
	return wire.NewValueI32(int32(v)), nil
}

// FromWire deserializes QueryConsistencyLevel from its Thrift-level
// representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TI32)
//	if err != nil {
//	  return QueryConsistencyLevel(0), err
//	}
//
//	var v QueryConsistencyLevel
//	if err := v.FromWire(x); err != nil {
//	  return QueryConsistencyLevel(0), err
//	}
//	return v, nil
func (v *QueryConsistencyLevel) FromWire(w wire.Value) error {
	*v = (QueryConsistencyLevel)(w.GetI32())
	return nil
}

// String returns a readable string representation of QueryConsistencyLevel.
func (v QueryConsistencyLevel) String() string {
	w := int32(v)
	switch w {
	case 0:
		return "EVENTUAL"
	case 1:
		return "STRONG"
	}
	return fmt.Sprintf("QueryConsistencyLevel(%d)", w)
}

// Equals returns true if this QueryConsistencyLevel value matches the provided
// value.
func (v QueryConsistencyLevel) Equals(rhs QueryConsistencyLevel) bool {
	return v == rhs
}

// MarshalJSON serializes QueryConsistencyLevel into JSON.
//
// If the enum value is recognized, its name is returned. Otherwise,
// its integer value is returned.
//
// This implements json.Marshaler.
func (v QueryConsistencyLevel) MarshalJSON() ([]byte, error) {
	switch int32(v) {
	case 0:
		return ([]byte)("\"EVENTUAL\""), nil
	case 1:
		return ([]byte)("\"STRONG\""), nil
	}
	return ([]byte)(strconv.FormatInt(int64(v), 10)), nil
}

// UnmarshalJSON attempts to decode QueryConsistencyLevel 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 *QueryConsistencyLevel) 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, "QueryConsistencyLevel")
		}
		if x < math.MinInt32 {
			return fmt.Errorf("enum underflow from JSON %q for %q", text, "QueryConsistencyLevel")
		}
		*v = (QueryConsistencyLevel)(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, "QueryConsistencyLevel")
	}
}

type QueryFailedError struct {
	Message string `json:"message,required"`
}

// ToWire translates a QueryFailedError 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 *QueryFailedError) 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
}

// FromWire deserializes a QueryFailedError 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 QueryFailedError struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v QueryFailedError
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *QueryFailedError) 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 QueryFailedError is required")
	}

	return nil
}

// String returns a readable string representation of a QueryFailedError
// struct.
func (v *QueryFailedError) 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("QueryFailedError{%v}", strings.Join(fields[:i], ", "))
}

// ErrorName is the name of this type as defined in the Thrift
// file.
func (*QueryFailedError) ErrorName() string {
	return "QueryFailedError"
}

// Equals returns true if all the fields of this QueryFailedError match the
// provided QueryFailedError.
//
// This function performs a deep comparison.
func (v *QueryFailedError) Equals(rhs *QueryFailedError) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !(v.Message == rhs.Message) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of QueryFailedError.
func (v *QueryFailedError) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	enc.AddString("message", v.Message)
	return err
}

// GetMessage returns the value of Message if it is set or its
// zero value if it is unset.
func (v *QueryFailedError) GetMessage() (o string) {
	if v != nil {
		o = v.Message
	}
	return
}

func (v *QueryFailedError) Error() string {
	return v.String()
}

type QueryRejectCondition int32

const (
	QueryRejectConditionNotOpen             QueryRejectCondition = 0
	QueryRejectConditionNotCompletedCleanly QueryRejectCondition = 1
)

// QueryRejectCondition_Values returns all recognized values of QueryRejectCondition.
func QueryRejectCondition_Values() []QueryRejectCondition {
	return []QueryRejectCondition{
		QueryRejectConditionNotOpen,
		QueryRejectConditionNotCompletedCleanly,
	}
}

// UnmarshalText tries to decode QueryRejectCondition from a byte slice
// containing its name.
//
//	var v QueryRejectCondition
//	err := v.UnmarshalText([]byte("NOT_OPEN"))
func (v *QueryRejectCondition) UnmarshalText(value []byte) error {
	switch s := string(value); s {
	case "NOT_OPEN":
		*v = QueryRejectConditionNotOpen
		return nil
	case "NOT_COMPLETED_CLEANLY":
		*v = QueryRejectConditionNotCompletedCleanly
		return nil
	default:
		val, err := strconv.ParseInt(s, 10, 32)
		if err != nil {
			return fmt.Errorf("unknown enum value %q for %q: %v", s, "QueryRejectCondition", err)
		}
		*v = QueryRejectCondition(val)
		return nil
	}
}

// MarshalText encodes QueryRejectCondition 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 QueryRejectCondition) MarshalText() ([]byte, error) {
	switch int32(v) {
	case 0:
		return []byte("NOT_OPEN"), nil
	case 1:
		return []byte("NOT_COMPLETED_CLEANLY"), nil
	}
	return []byte(strconv.FormatInt(int64(v), 10)), nil
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of QueryRejectCondition.
// 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 QueryRejectCondition) MarshalLogObject(enc zapcore.ObjectEncoder) error {
	enc.AddInt32("value", int32(v))
	switch int32(v) {
	case 0:
		enc.AddString("name", "NOT_OPEN")
	case 1:
		enc.AddString("name", "NOT_COMPLETED_CLEANLY")
	}
	return nil
}

// Ptr returns a pointer to this enum value.
func (v QueryRejectCondition) Ptr() *QueryRejectCondition {
	return &v
}

// ToWire translates QueryRejectCondition 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 QueryRejectCondition) ToWire() (wire.Value, error) {
	return wire.NewValueI32(int32(v)), nil
}

// FromWire deserializes QueryRejectCondition from its Thrift-level
// representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TI32)
//	if err != nil {
//	  return QueryRejectCondition(0), err
//	}
//
//	var v QueryRejectCondition
//	if err := v.FromWire(x); err != nil {
//	  return QueryRejectCondition(0), err
//	}
//	return v, nil
func (v *QueryRejectCondition) FromWire(w wire.Value) error {
	*v = (QueryRejectCondition)(w.GetI32())
	return nil
}

// String returns a readable string representation of QueryRejectCondition.
func (v QueryRejectCondition) String() string {
	w := int32(v)
	switch w {
	case 0:
		return "NOT_OPEN"
	case 1:
		return "NOT_COMPLETED_CLEANLY"
	}
	return fmt.Sprintf("QueryRejectCondition(%d)", w)
}

// Equals returns true if this QueryRejectCondition value matches the provided
// value.
func (v QueryRejectCondition) Equals(rhs QueryRejectCondition) bool {
	return v == rhs
}

// MarshalJSON serializes QueryRejectCondition into JSON.
//
// If the enum value is recognized, its name is returned. Otherwise,
// its integer value is returned.
//
// This implements json.Marshaler.
func (v QueryRejectCondition) MarshalJSON() ([]byte, error) {
	switch int32(v) {
	case 0:
		return ([]byte)("\"NOT_OPEN\""), nil
	case 1:
		return ([]byte)("\"NOT_COMPLETED_CLEANLY\""), nil
	}
	return ([]byte)(strconv.FormatInt(int64(v), 10)), nil
}

// UnmarshalJSON attempts to decode QueryRejectCondition 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 *QueryRejectCondition) 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, "QueryRejectCondition")
		}
		if x < math.MinInt32 {
			return fmt.Errorf("enum underflow from JSON %q for %q", text, "QueryRejectCondition")
		}
		*v = (QueryRejectCondition)(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, "QueryRejectCondition")
	}
}

type QueryRejected struct {
	CloseStatus *WorkflowExecutionCloseStatus `json:"closeStatus,omitempty"`
}

// ToWire translates a QueryRejected 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 *QueryRejected) ToWire() (wire.Value, error) {
	var (
		fields [1]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.CloseStatus != nil {
		w, err = v.CloseStatus.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

// FromWire deserializes a QueryRejected 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 QueryRejected struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v QueryRejected
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *QueryRejected) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			if field.Value.Type() == wire.TI32 {
				var x WorkflowExecutionCloseStatus
				x, err = _WorkflowExecutionCloseStatus_Read(field.Value)
				v.CloseStatus = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a QueryRejected
// struct.
func (v *QueryRejected) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [1]string
	i := 0
	if v.CloseStatus != nil {
		fields[i] = fmt.Sprintf("CloseStatus: %v", *(v.CloseStatus))
		i++
	}

	return fmt.Sprintf("QueryRejected{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this QueryRejected match the
// provided QueryRejected.
//
// This function performs a deep comparison.
func (v *QueryRejected) Equals(rhs *QueryRejected) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_WorkflowExecutionCloseStatus_EqualsPtr(v.CloseStatus, rhs.CloseStatus) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of QueryRejected.
func (v *QueryRejected) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.CloseStatus != nil {
		err = multierr.Append(err, enc.AddObject("closeStatus", *v.CloseStatus))
	}
	return err
}

// GetCloseStatus returns the value of CloseStatus if it is set or its
// zero value if it is unset.
func (v *QueryRejected) GetCloseStatus() (o WorkflowExecutionCloseStatus) {
	if v != nil && v.CloseStatus != nil {
		return *v.CloseStatus
	}

	return
}

// IsSetCloseStatus returns true if CloseStatus is not nil.
func (v *QueryRejected) IsSetCloseStatus() bool {
	return v != nil && v.CloseStatus != nil
}

type QueryResultType int32

const (
	QueryResultTypeAnswered QueryResultType = 0
	QueryResultTypeFailed   QueryResultType = 1
)

// QueryResultType_Values returns all recognized values of QueryResultType.
func QueryResultType_Values() []QueryResultType {
	return []QueryResultType{
		QueryResultTypeAnswered,
		QueryResultTypeFailed,
	}
}

// UnmarshalText tries to decode QueryResultType from a byte slice
// containing its name.
//
//	var v QueryResultType
//	err := v.UnmarshalText([]byte("ANSWERED"))
func (v *QueryResultType) UnmarshalText(value []byte) error {
	switch s := string(value); s {
	case "ANSWERED":
		*v = QueryResultTypeAnswered
		return nil
	case "FAILED":
		*v = QueryResultTypeFailed
		return nil
	default:
		val, err := strconv.ParseInt(s, 10, 32)
		if err != nil {
			return fmt.Errorf("unknown enum value %q for %q: %v", s, "QueryResultType", err)
		}
		*v = QueryResultType(val)
		return nil
	}
}

// MarshalText encodes QueryResultType 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 QueryResultType) MarshalText() ([]byte, error) {
	switch int32(v) {
	case 0:
		return []byte("ANSWERED"), nil
	case 1:
		return []byte("FAILED"), nil
	}
	return []byte(strconv.FormatInt(int64(v), 10)), nil
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of QueryResultType.
// 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 QueryResultType) MarshalLogObject(enc zapcore.ObjectEncoder) error {
	enc.AddInt32("value", int32(v))
	switch int32(v) {
	case 0:
		enc.AddString("name", "ANSWERED")
	case 1:
		enc.AddString("name", "FAILED")
	}
	return nil
}

// Ptr returns a pointer to this enum value.
func (v QueryResultType) Ptr() *QueryResultType {
	return &v
}

// ToWire translates QueryResultType 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 QueryResultType) ToWire() (wire.Value, error) {
	return wire.NewValueI32(int32(v)), nil
}

// FromWire deserializes QueryResultType from its Thrift-level
// representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TI32)
//	if err != nil {
//	  return QueryResultType(0), err
//	}
//
//	var v QueryResultType
//	if err := v.FromWire(x); err != nil {
//	  return QueryResultType(0), err
//	}
//	return v, nil
func (v *QueryResultType) FromWire(w wire.Value) error {
	*v = (QueryResultType)(w.GetI32())
	return nil
}

// String returns a readable string representation of QueryResultType.
func (v QueryResultType) String() string {
	w := int32(v)
	switch w {
	case 0:
		return "ANSWERED"
	case 1:
		return "FAILED"
	}
	return fmt.Sprintf("QueryResultType(%d)", w)
}

// Equals returns true if this QueryResultType value matches the provided
// value.
func (v QueryResultType) Equals(rhs QueryResultType) bool {
	return v == rhs
}

// MarshalJSON serializes QueryResultType into JSON.
//
// If the enum value is recognized, its name is returned. Otherwise,
// its integer value is returned.
//
// This implements json.Marshaler.
func (v QueryResultType) MarshalJSON() ([]byte, error) {
	switch int32(v) {
	case 0:
		return ([]byte)("\"ANSWERED\""), nil
	case 1:
		return ([]byte)("\"FAILED\""), nil
	}
	return ([]byte)(strconv.FormatInt(int64(v), 10)), nil
}

// UnmarshalJSON attempts to decode QueryResultType 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 *QueryResultType) 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, "QueryResultType")
		}
		if x < math.MinInt32 {
			return fmt.Errorf("enum underflow from JSON %q for %q", text, "QueryResultType")
		}
		*v = (QueryResultType)(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, "QueryResultType")
	}
}

type QueryTaskCompletedType int32

const (
	QueryTaskCompletedTypeCompleted QueryTaskCompletedType = 0
	QueryTaskCompletedTypeFailed    QueryTaskCompletedType = 1
)

// QueryTaskCompletedType_Values returns all recognized values of QueryTaskCompletedType.
func QueryTaskCompletedType_Values() []QueryTaskCompletedType {
	return []QueryTaskCompletedType{
		QueryTaskCompletedTypeCompleted,
		QueryTaskCompletedTypeFailed,
	}
}

// UnmarshalText tries to decode QueryTaskCompletedType from a byte slice
// containing its name.
//
//	var v QueryTaskCompletedType
//	err := v.UnmarshalText([]byte("COMPLETED"))
func (v *QueryTaskCompletedType) UnmarshalText(value []byte) error {
	switch s := string(value); s {
	case "COMPLETED":
		*v = QueryTaskCompletedTypeCompleted
		return nil
	case "FAILED":
		*v = QueryTaskCompletedTypeFailed
		return nil
	default:
		val, err := strconv.ParseInt(s, 10, 32)
		if err != nil {
			return fmt.Errorf("unknown enum value %q for %q: %v", s, "QueryTaskCompletedType", err)
		}
		*v = QueryTaskCompletedType(val)
		return nil
	}
}

// MarshalText encodes QueryTaskCompletedType 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 QueryTaskCompletedType) MarshalText() ([]byte, error) {
	switch int32(v) {
	case 0:
		return []byte("COMPLETED"), nil
	case 1:
		return []byte("FAILED"), nil
	}
	return []byte(strconv.FormatInt(int64(v), 10)), nil
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of QueryTaskCompletedType.
// 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 QueryTaskCompletedType) MarshalLogObject(enc zapcore.ObjectEncoder) error {
	enc.AddInt32("value", int32(v))
	switch int32(v) {
	case 0:
		enc.AddString("name", "COMPLETED")
	case 1:
		enc.AddString("name", "FAILED")
	}
	return nil
}

// Ptr returns a pointer to this enum value.
func (v QueryTaskCompletedType) Ptr() *QueryTaskCompletedType {
	return &v
}

// ToWire translates QueryTaskCompletedType 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 QueryTaskCompletedType) ToWire() (wire.Value, error) {
	return wire.NewValueI32(int32(v)), nil
}

// FromWire deserializes QueryTaskCompletedType from its Thrift-level
// representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TI32)
//	if err != nil {
//	  return QueryTaskCompletedType(0), err
//	}
//
//	var v QueryTaskCompletedType
//	if err := v.FromWire(x); err != nil {
//	  return QueryTaskCompletedType(0), err
//	}
//	return v, nil
func (v *QueryTaskCompletedType) FromWire(w wire.Value) error {
	*v = (QueryTaskCompletedType)(w.GetI32())
	return nil
}

// String returns a readable string representation of QueryTaskCompletedType.
func (v QueryTaskCompletedType) String() string {
	w := int32(v)
	switch w {
	case 0:
		return "COMPLETED"
	case 1:
		return "FAILED"
	}
	return fmt.Sprintf("QueryTaskCompletedType(%d)", w)
}

// Equals returns true if this QueryTaskCompletedType value matches the provided
// value.
func (v QueryTaskCompletedType) Equals(rhs QueryTaskCompletedType) bool {
	return v == rhs
}

// MarshalJSON serializes QueryTaskCompletedType into JSON.
//
// If the enum value is recognized, its name is returned. Otherwise,
// its integer value is returned.
//
// This implements json.Marshaler.
func (v QueryTaskCompletedType) MarshalJSON() ([]byte, error) {
	switch int32(v) {
	case 0:
		return ([]byte)("\"COMPLETED\""), nil
	case 1:
		return ([]byte)("\"FAILED\""), nil
	}
	return ([]byte)(strconv.FormatInt(int64(v), 10)), nil
}

// UnmarshalJSON attempts to decode QueryTaskCompletedType 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 *QueryTaskCompletedType) 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, "QueryTaskCompletedType")
		}
		if x < math.MinInt32 {
			return fmt.Errorf("enum underflow from JSON %q for %q", text, "QueryTaskCompletedType")
		}
		*v = (QueryTaskCompletedType)(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, "QueryTaskCompletedType")
	}
}

type QueryWorkflowRequest struct {
	Domain                *string                `json:"domain,omitempty"`
	Execution             *WorkflowExecution     `json:"execution,omitempty"`
	Query                 *WorkflowQuery         `json:"query,omitempty"`
	QueryRejectCondition  *QueryRejectCondition  `json:"queryRejectCondition,omitempty"`
	QueryConsistencyLevel *QueryConsistencyLevel `json:"queryConsistencyLevel,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 [5]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.Execution != nil {
		w, err = v.Execution.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.Query != nil {
		w, err = v.Query.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.QueryRejectCondition != nil {
		w, err = v.QueryRejectCondition.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 40, Value: w}
		i++
	}
	if v.QueryConsistencyLevel != nil {
		w, err = v.QueryConsistencyLevel.ToWire()
		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 _QueryRejectCondition_Read(w wire.Value) (QueryRejectCondition, error) {
	var v QueryRejectCondition
	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.Domain = &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.Query, err = _WorkflowQuery_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 40:
			if field.Value.Type() == wire.TI32 {
				var x QueryRejectCondition
				x, err = _QueryRejectCondition_Read(field.Value)
				v.QueryRejectCondition = &x
				if err != nil {
					return err
				}

			}
		case 50:
			if field.Value.Type() == wire.TI32 {
				var x QueryConsistencyLevel
				x, err = _QueryConsistencyLevel_Read(field.Value)
				v.QueryConsistencyLevel = &x
				if 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 [5]string
	i := 0
	if v.Domain != nil {
		fields[i] = fmt.Sprintf("Domain: %v", *(v.Domain))
		i++
	}
	if v.Execution != nil {
		fields[i] = fmt.Sprintf("Execution: %v", v.Execution)
		i++
	}
	if v.Query != nil {
		fields[i] = fmt.Sprintf("Query: %v", v.Query)
		i++
	}
	if v.QueryRejectCondition != nil {
		fields[i] = fmt.Sprintf("QueryRejectCondition: %v", *(v.QueryRejectCondition))
		i++
	}
	if v.QueryConsistencyLevel != nil {
		fields[i] = fmt.Sprintf("QueryConsistencyLevel: %v", *(v.QueryConsistencyLevel))
		i++
	}

	return fmt.Sprintf("QueryWorkflowRequest{%v}", strings.Join(fields[:i], ", "))
}

func _QueryRejectCondition_EqualsPtr(lhs, rhs *QueryRejectCondition) bool {
	if lhs != nil && rhs != nil {

		x := *lhs
		y := *rhs
		return x.Equals(y)
	}
	return lhs == nil && rhs == nil
}

// 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.Domain, rhs.Domain) {
		return false
	}
	if !((v.Execution == nil && rhs.Execution == nil) || (v.Execution != nil && rhs.Execution != nil && v.Execution.Equals(rhs.Execution))) {
		return false
	}
	if !((v.Query == nil && rhs.Query == nil) || (v.Query != nil && rhs.Query != nil && v.Query.Equals(rhs.Query))) {
		return false
	}
	if !_QueryRejectCondition_EqualsPtr(v.QueryRejectCondition, rhs.QueryRejectCondition) {
		return false
	}
	if !_QueryConsistencyLevel_EqualsPtr(v.QueryConsistencyLevel, rhs.QueryConsistencyLevel) {
		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.Domain != nil {
		enc.AddString("domain", *v.Domain)
	}
	if v.Execution != nil {
		err = multierr.Append(err, enc.AddObject("execution", v.Execution))
	}
	if v.Query != nil {
		err = multierr.Append(err, enc.AddObject("query", v.Query))
	}
	if v.QueryRejectCondition != nil {
		err = multierr.Append(err, enc.AddObject("queryRejectCondition", *v.QueryRejectCondition))
	}
	if v.QueryConsistencyLevel != nil {
		err = multierr.Append(err, enc.AddObject("queryConsistencyLevel", *v.QueryConsistencyLevel))
	}
	return err
}

// GetDomain returns the value of Domain if it is set or its
// zero value if it is unset.
func (v *QueryWorkflowRequest) GetDomain() (o string) {
	if v != nil && v.Domain != nil {
		return *v.Domain
	}

	return
}

// IsSetDomain returns true if Domain is not nil.
func (v *QueryWorkflowRequest) IsSetDomain() bool {
	return v != nil && v.Domain != nil
}

// GetExecution returns the value of Execution if it is set or its
// zero value if it is unset.
func (v *QueryWorkflowRequest) GetExecution() (o *WorkflowExecution) {
	if v != nil && v.Execution != nil {
		return v.Execution
	}

	return
}

// IsSetExecution returns true if Execution is not nil.
func (v *QueryWorkflowRequest) IsSetExecution() bool {
	return v != nil && v.Execution != nil
}

// GetQuery returns the value of Query if it is set or its
// zero value if it is unset.
func (v *QueryWorkflowRequest) GetQuery() (o *WorkflowQuery) {
	if v != nil && v.Query != nil {
		return v.Query
	}

	return
}

// IsSetQuery returns true if Query is not nil.
func (v *QueryWorkflowRequest) IsSetQuery() bool {
	return v != nil && v.Query != nil
}

// GetQueryRejectCondition returns the value of QueryRejectCondition if it is set or its
// zero value if it is unset.
func (v *QueryWorkflowRequest) GetQueryRejectCondition() (o QueryRejectCondition) {
	if v != nil && v.QueryRejectCondition != nil {
		return *v.QueryRejectCondition
	}

	return
}

// IsSetQueryRejectCondition returns true if QueryRejectCondition is not nil.
func (v *QueryWorkflowRequest) IsSetQueryRejectCondition() bool {
	return v != nil && v.QueryRejectCondition != nil
}

// GetQueryConsistencyLevel returns the value of QueryConsistencyLevel if it is set or its
// zero value if it is unset.
func (v *QueryWorkflowRequest) GetQueryConsistencyLevel() (o QueryConsistencyLevel) {
	if v != nil && v.QueryConsistencyLevel != nil {
		return *v.QueryConsistencyLevel
	}

	return
}

// IsSetQueryConsistencyLevel returns true if QueryConsistencyLevel is not nil.
func (v *QueryWorkflowRequest) IsSetQueryConsistencyLevel() bool {
	return v != nil && v.QueryConsistencyLevel != nil
}

type QueryWorkflowResponse struct {
	QueryResult   []byte         `json:"queryResult,omitempty"`
	QueryRejected *QueryRejected `json:"queryRejected,omitempty"`
}

// ToWire translates a QueryWorkflowResponse 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 *QueryWorkflowResponse) ToWire() (wire.Value, error) {
	var (
		fields [2]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.QueryResult != nil {
		w, err = wire.NewValueBinary(v.QueryResult), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.QueryRejected != nil {
		w, err = v.QueryRejected.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 _QueryRejected_Read(w wire.Value) (*QueryRejected, error) {
	var v QueryRejected
	err := v.FromWire(w)
	return &v, err
}

// FromWire deserializes a QueryWorkflowResponse 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 QueryWorkflowResponse struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v QueryWorkflowResponse
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *QueryWorkflowResponse) 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.QueryResult, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		case 20:
			if field.Value.Type() == wire.TStruct {
				v.QueryRejected, err = _QueryRejected_Read(field.Value)
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a QueryWorkflowResponse
// struct.
func (v *QueryWorkflowResponse) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [2]string
	i := 0
	if v.QueryResult != nil {
		fields[i] = fmt.Sprintf("QueryResult: %v", v.QueryResult)
		i++
	}
	if v.QueryRejected != nil {
		fields[i] = fmt.Sprintf("QueryRejected: %v", v.QueryRejected)
		i++
	}

	return fmt.Sprintf("QueryWorkflowResponse{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this QueryWorkflowResponse match the
// provided QueryWorkflowResponse.
//
// This function performs a deep comparison.
func (v *QueryWorkflowResponse) Equals(rhs *QueryWorkflowResponse) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !((v.QueryResult == nil && rhs.QueryResult == nil) || (v.QueryResult != nil && rhs.QueryResult != nil && bytes.Equal(v.QueryResult, rhs.QueryResult))) {
		return false
	}
	if !((v.QueryRejected == nil && rhs.QueryRejected == nil) || (v.QueryRejected != nil && rhs.QueryRejected != nil && v.QueryRejected.Equals(rhs.QueryRejected))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of QueryWorkflowResponse.
func (v *QueryWorkflowResponse) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.QueryResult != nil {
		enc.AddString("queryResult", base64.StdEncoding.EncodeToString(v.QueryResult))
	}
	if v.QueryRejected != nil {
		err = multierr.Append(err, enc.AddObject("queryRejected", v.QueryRejected))
	}
	return err
}

// GetQueryResult returns the value of QueryResult if it is set or its
// zero value if it is unset.
func (v *QueryWorkflowResponse) GetQueryResult() (o []byte) {
	if v != nil && v.QueryResult != nil {
		return v.QueryResult
	}

	return
}

// IsSetQueryResult returns true if QueryResult is not nil.
func (v *QueryWorkflowResponse) IsSetQueryResult() bool {
	return v != nil && v.QueryResult != nil
}

// GetQueryRejected returns the value of QueryRejected if it is set or its
// zero value if it is unset.
func (v *QueryWorkflowResponse) GetQueryRejected() (o *QueryRejected) {
	if v != nil && v.QueryRejected != nil {
		return v.QueryRejected
	}

	return
}

// IsSetQueryRejected returns true if QueryRejected is not nil.
func (v *QueryWorkflowResponse) IsSetQueryRejected() bool {
	return v != nil && v.QueryRejected != nil
}

type QueueState struct {
	VirtualQueueStates    map[int64]*VirtualQueueState `json:"virtualQueueStates,omitempty"`
	ExclusiveMaxReadLevel *TaskKey                     `json:"exclusiveMaxReadLevel,omitempty"`
}

type _Map_I64_VirtualQueueState_MapItemList map[int64]*VirtualQueueState

func (m _Map_I64_VirtualQueueState_MapItemList) ForEach(f func(wire.MapItem) error) error {
	for k, v := range m {
		if v == nil {
			return fmt.Errorf("invalid [%v]: value is nil", k)
		}
		kw, err := wire.NewValueI64(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_I64_VirtualQueueState_MapItemList) Size() int {
	return len(m)
}

func (_Map_I64_VirtualQueueState_MapItemList) KeyType() wire.Type {
	return wire.TI64
}

func (_Map_I64_VirtualQueueState_MapItemList) ValueType() wire.Type {
	return wire.TStruct
}

func (_Map_I64_VirtualQueueState_MapItemList) Close() {}

// ToWire translates a QueueState 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 *QueueState) ToWire() (wire.Value, error) {
	var (
		fields [2]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.VirtualQueueStates != nil {
		w, err = wire.NewValueMap(_Map_I64_VirtualQueueState_MapItemList(v.VirtualQueueStates)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.ExclusiveMaxReadLevel != nil {
		w, err = v.ExclusiveMaxReadLevel.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 _VirtualQueueState_Read(w wire.Value) (*VirtualQueueState, error) {
	var v VirtualQueueState
	err := v.FromWire(w)
	return &v, err
}

func _Map_I64_VirtualQueueState_Read(m wire.MapItemList) (map[int64]*VirtualQueueState, error) {
	if m.KeyType() != wire.TI64 {
		return nil, nil
	}

	if m.ValueType() != wire.TStruct {
		return nil, nil
	}

	o := make(map[int64]*VirtualQueueState, m.Size())
	err := m.ForEach(func(x wire.MapItem) error {
		k, err := x.Key.GetI64(), error(nil)
		if err != nil {
			return err
		}

		v, err := _VirtualQueueState_Read(x.Value)
		if err != nil {
			return err
		}

		o[k] = v
		return nil
	})
	m.Close()
	return o, err
}

func _TaskKey_Read(w wire.Value) (*TaskKey, error) {
	var v TaskKey
	err := v.FromWire(w)
	return &v, err
}

// FromWire deserializes a QueueState 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 QueueState struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v QueueState
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *QueueState) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			if field.Value.Type() == wire.TMap {
				v.VirtualQueueStates, err = _Map_I64_VirtualQueueState_Read(field.Value.GetMap())
				if err != nil {
					return err
				}

			}
		case 20:
			if field.Value.Type() == wire.TStruct {
				v.ExclusiveMaxReadLevel, err = _TaskKey_Read(field.Value)
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a QueueState
// struct.
func (v *QueueState) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [2]string
	i := 0
	if v.VirtualQueueStates != nil {
		fields[i] = fmt.Sprintf("VirtualQueueStates: %v", v.VirtualQueueStates)
		i++
	}
	if v.ExclusiveMaxReadLevel != nil {
		fields[i] = fmt.Sprintf("ExclusiveMaxReadLevel: %v", v.ExclusiveMaxReadLevel)
		i++
	}

	return fmt.Sprintf("QueueState{%v}", strings.Join(fields[:i], ", "))
}

func _Map_I64_VirtualQueueState_Equals(lhs, rhs map[int64]*VirtualQueueState) 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 QueueState match the
// provided QueueState.
//
// This function performs a deep comparison.
func (v *QueueState) Equals(rhs *QueueState) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !((v.VirtualQueueStates == nil && rhs.VirtualQueueStates == nil) || (v.VirtualQueueStates != nil && rhs.VirtualQueueStates != nil && _Map_I64_VirtualQueueState_Equals(v.VirtualQueueStates, rhs.VirtualQueueStates))) {
		return false
	}
	if !((v.ExclusiveMaxReadLevel == nil && rhs.ExclusiveMaxReadLevel == nil) || (v.ExclusiveMaxReadLevel != nil && rhs.ExclusiveMaxReadLevel != nil && v.ExclusiveMaxReadLevel.Equals(rhs.ExclusiveMaxReadLevel))) {
		return false
	}

	return true
}

type _Map_I64_VirtualQueueState_Item_Zapper struct {
	Key   int64
	Value *VirtualQueueState
}

// MarshalLogArray implements zapcore.ArrayMarshaler, enabling
// fast logging of _Map_I64_VirtualQueueState_Item_Zapper.
func (v _Map_I64_VirtualQueueState_Item_Zapper) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	enc.AddInt64("key", v.Key)
	err = multierr.Append(err, enc.AddObject("value", v.Value))
	return err
}

type _Map_I64_VirtualQueueState_Zapper map[int64]*VirtualQueueState

// MarshalLogArray implements zapcore.ArrayMarshaler, enabling
// fast logging of _Map_I64_VirtualQueueState_Zapper.
func (m _Map_I64_VirtualQueueState_Zapper) MarshalLogArray(enc zapcore.ArrayEncoder) (err error) {
	for k, v := range m {
		err = multierr.Append(err, enc.AppendObject(_Map_I64_VirtualQueueState_Item_Zapper{Key: k, Value: v}))
	}
	return err
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of QueueState.
func (v *QueueState) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.VirtualQueueStates != nil {
		err = multierr.Append(err, enc.AddArray("virtualQueueStates", (_Map_I64_VirtualQueueState_Zapper)(v.VirtualQueueStates)))
	}
	if v.ExclusiveMaxReadLevel != nil {
		err = multierr.Append(err, enc.AddObject("exclusiveMaxReadLevel", v.ExclusiveMaxReadLevel))
	}
	return err
}

// GetVirtualQueueStates returns the value of VirtualQueueStates if it is set or its
// zero value if it is unset.
func (v *QueueState) GetVirtualQueueStates() (o map[int64]*VirtualQueueState) {
	if v != nil && v.VirtualQueueStates != nil {
		return v.VirtualQueueStates
	}

	return
}

// IsSetVirtualQueueStates returns true if VirtualQueueStates is not nil.
func (v *QueueState) IsSetVirtualQueueStates() bool {
	return v != nil && v.VirtualQueueStates != nil
}

// GetExclusiveMaxReadLevel returns the value of ExclusiveMaxReadLevel if it is set or its
// zero value if it is unset.
func (v *QueueState) GetExclusiveMaxReadLevel() (o *TaskKey) {
	if v != nil && v.ExclusiveMaxReadLevel != nil {
		return v.ExclusiveMaxReadLevel
	}

	return
}

// IsSetExclusiveMaxReadLevel returns true if ExclusiveMaxReadLevel is not nil.
func (v *QueueState) IsSetExclusiveMaxReadLevel() bool {
	return v != nil && v.ExclusiveMaxReadLevel != nil
}

type ReapplyEventsRequest struct {
	DomainName        *string            `json:"domainName,omitempty"`
	WorkflowExecution *WorkflowExecution `json:"workflowExecution,omitempty"`
	Events            *DataBlob          `json:"events,omitempty"`
}

// ToWire translates a ReapplyEventsRequest 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 *ReapplyEventsRequest) ToWire() (wire.Value, error) {
	var (
		fields [3]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.DomainName != nil {
		w, err = wire.NewValueString(*(v.DomainName)), 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.Events != nil {
		w, err = v.Events.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

// FromWire deserializes a ReapplyEventsRequest 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 ReapplyEventsRequest struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v ReapplyEventsRequest
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *ReapplyEventsRequest) 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.DomainName = &x
				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.Events, err = _DataBlob_Read(field.Value)
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a ReapplyEventsRequest
// struct.
func (v *ReapplyEventsRequest) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [3]string
	i := 0
	if v.DomainName != nil {
		fields[i] = fmt.Sprintf("DomainName: %v", *(v.DomainName))
		i++
	}
	if v.WorkflowExecution != nil {
		fields[i] = fmt.Sprintf("WorkflowExecution: %v", v.WorkflowExecution)
		i++
	}
	if v.Events != nil {
		fields[i] = fmt.Sprintf("Events: %v", v.Events)
		i++
	}

	return fmt.Sprintf("ReapplyEventsRequest{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this ReapplyEventsRequest match the
// provided ReapplyEventsRequest.
//
// This function performs a deep comparison.
func (v *ReapplyEventsRequest) Equals(rhs *ReapplyEventsRequest) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.DomainName, rhs.DomainName) {
		return false
	}
	if !((v.WorkflowExecution == nil && rhs.WorkflowExecution == nil) || (v.WorkflowExecution != nil && rhs.WorkflowExecution != nil && v.WorkflowExecution.Equals(rhs.WorkflowExecution))) {
		return false
	}
	if !((v.Events == nil && rhs.Events == nil) || (v.Events != nil && rhs.Events != nil && v.Events.Equals(rhs.Events))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of ReapplyEventsRequest.
func (v *ReapplyEventsRequest) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.DomainName != nil {
		enc.AddString("domainName", *v.DomainName)
	}
	if v.WorkflowExecution != nil {
		err = multierr.Append(err, enc.AddObject("workflowExecution", v.WorkflowExecution))
	}
	if v.Events != nil {
		err = multierr.Append(err, enc.AddObject("events", v.Events))
	}
	return err
}

// GetDomainName returns the value of DomainName if it is set or its
// zero value if it is unset.
func (v *ReapplyEventsRequest) GetDomainName() (o string) {
	if v != nil && v.DomainName != nil {
		return *v.DomainName
	}

	return
}

// IsSetDomainName returns true if DomainName is not nil.
func (v *ReapplyEventsRequest) IsSetDomainName() bool {
	return v != nil && v.DomainName != nil
}

// GetWorkflowExecution returns the value of WorkflowExecution if it is set or its
// zero value if it is unset.
func (v *ReapplyEventsRequest) GetWorkflowExecution() (o *WorkflowExecution) {
	if v != nil && v.WorkflowExecution != nil {
		return v.WorkflowExecution
	}

	return
}

// IsSetWorkflowExecution returns true if WorkflowExecution is not nil.
func (v *ReapplyEventsRequest) IsSetWorkflowExecution() bool {
	return v != nil && v.WorkflowExecution != nil
}

// GetEvents returns the value of Events if it is set or its
// zero value if it is unset.
func (v *ReapplyEventsRequest) GetEvents() (o *DataBlob) {
	if v != nil && v.Events != nil {
		return v.Events
	}

	return
}

// IsSetEvents returns true if Events is not nil.
func (v *ReapplyEventsRequest) IsSetEvents() bool {
	return v != nil && v.Events != nil
}

type RecordActivityTaskHeartbeatByIDRequest struct {
	Domain     *string `json:"domain,omitempty"`
	WorkflowID *string `json:"workflowID,omitempty"`
	RunID      *string `json:"runID,omitempty"`
	ActivityID *string `json:"activityID,omitempty"`
	Details    []byte  `json:"details,omitempty"`
	Identity   *string `json:"identity,omitempty"`
}

// ToWire translates a RecordActivityTaskHeartbeatByIDRequest 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 *RecordActivityTaskHeartbeatByIDRequest) ToWire() (wire.Value, error) {
	var (
		fields [6]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.WorkflowID != nil {
		w, err = wire.NewValueString(*(v.WorkflowID)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.RunID != nil {
		w, err = wire.NewValueString(*(v.RunID)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.ActivityID != nil {
		w, err = wire.NewValueString(*(v.ActivityID)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 40, Value: w}
		i++
	}
	if v.Details != nil {
		w, err = wire.NewValueBinary(v.Details), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 50, 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: 60, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

// FromWire deserializes a RecordActivityTaskHeartbeatByIDRequest 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 RecordActivityTaskHeartbeatByIDRequest struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v RecordActivityTaskHeartbeatByIDRequest
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *RecordActivityTaskHeartbeatByIDRequest) 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.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.WorkflowID = &x
				if err != nil {
					return err
				}

			}
		case 30:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.RunID = &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.ActivityID = &x
				if err != nil {
					return err
				}

			}
		case 50:
			if field.Value.Type() == wire.TBinary {
				v.Details, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		case 60:
			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
}

// String returns a readable string representation of a RecordActivityTaskHeartbeatByIDRequest
// struct.
func (v *RecordActivityTaskHeartbeatByIDRequest) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [6]string
	i := 0
	if v.Domain != nil {
		fields[i] = fmt.Sprintf("Domain: %v", *(v.Domain))
		i++
	}
	if v.WorkflowID != nil {
		fields[i] = fmt.Sprintf("WorkflowID: %v", *(v.WorkflowID))
		i++
	}
	if v.RunID != nil {
		fields[i] = fmt.Sprintf("RunID: %v", *(v.RunID))
		i++
	}
	if v.ActivityID != nil {
		fields[i] = fmt.Sprintf("ActivityID: %v", *(v.ActivityID))
		i++
	}
	if v.Details != nil {
		fields[i] = fmt.Sprintf("Details: %v", v.Details)
		i++
	}
	if v.Identity != nil {
		fields[i] = fmt.Sprintf("Identity: %v", *(v.Identity))
		i++
	}

	return fmt.Sprintf("RecordActivityTaskHeartbeatByIDRequest{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this RecordActivityTaskHeartbeatByIDRequest match the
// provided RecordActivityTaskHeartbeatByIDRequest.
//
// This function performs a deep comparison.
func (v *RecordActivityTaskHeartbeatByIDRequest) Equals(rhs *RecordActivityTaskHeartbeatByIDRequest) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.Domain, rhs.Domain) {
		return false
	}
	if !_String_EqualsPtr(v.WorkflowID, rhs.WorkflowID) {
		return false
	}
	if !_String_EqualsPtr(v.RunID, rhs.RunID) {
		return false
	}
	if !_String_EqualsPtr(v.ActivityID, rhs.ActivityID) {
		return false
	}
	if !((v.Details == nil && rhs.Details == nil) || (v.Details != nil && rhs.Details != nil && bytes.Equal(v.Details, rhs.Details))) {
		return false
	}
	if !_String_EqualsPtr(v.Identity, rhs.Identity) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of RecordActivityTaskHeartbeatByIDRequest.
func (v *RecordActivityTaskHeartbeatByIDRequest) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Domain != nil {
		enc.AddString("domain", *v.Domain)
	}
	if v.WorkflowID != nil {
		enc.AddString("workflowID", *v.WorkflowID)
	}
	if v.RunID != nil {
		enc.AddString("runID", *v.RunID)
	}
	if v.ActivityID != nil {
		enc.AddString("activityID", *v.ActivityID)
	}
	if v.Details != nil {
		enc.AddString("details", base64.StdEncoding.EncodeToString(v.Details))
	}
	if v.Identity != nil {
		enc.AddString("identity", *v.Identity)
	}
	return err
}

// GetDomain returns the value of Domain if it is set or its
// zero value if it is unset.
func (v *RecordActivityTaskHeartbeatByIDRequest) GetDomain() (o string) {
	if v != nil && v.Domain != nil {
		return *v.Domain
	}

	return
}

// IsSetDomain returns true if Domain is not nil.
func (v *RecordActivityTaskHeartbeatByIDRequest) IsSetDomain() bool {
	return v != nil && v.Domain != nil
}

// GetWorkflowID returns the value of WorkflowID if it is set or its
// zero value if it is unset.
func (v *RecordActivityTaskHeartbeatByIDRequest) GetWorkflowID() (o string) {
	if v != nil && v.WorkflowID != nil {
		return *v.WorkflowID
	}

	return
}

// IsSetWorkflowID returns true if WorkflowID is not nil.
func (v *RecordActivityTaskHeartbeatByIDRequest) IsSetWorkflowID() bool {
	return v != nil && v.WorkflowID != nil
}

// GetRunID returns the value of RunID if it is set or its
// zero value if it is unset.
func (v *RecordActivityTaskHeartbeatByIDRequest) GetRunID() (o string) {
	if v != nil && v.RunID != nil {
		return *v.RunID
	}

	return
}

// IsSetRunID returns true if RunID is not nil.
func (v *RecordActivityTaskHeartbeatByIDRequest) IsSetRunID() bool {
	return v != nil && v.RunID != nil
}

// GetActivityID returns the value of ActivityID if it is set or its
// zero value if it is unset.
func (v *RecordActivityTaskHeartbeatByIDRequest) GetActivityID() (o string) {
	if v != nil && v.ActivityID != nil {
		return *v.ActivityID
	}

	return
}

// IsSetActivityID returns true if ActivityID is not nil.
func (v *RecordActivityTaskHeartbeatByIDRequest) IsSetActivityID() bool {
	return v != nil && v.ActivityID != nil
}

// GetDetails returns the value of Details if it is set or its
// zero value if it is unset.
func (v *RecordActivityTaskHeartbeatByIDRequest) GetDetails() (o []byte) {
	if v != nil && v.Details != nil {
		return v.Details
	}

	return
}

// IsSetDetails returns true if Details is not nil.
func (v *RecordActivityTaskHeartbeatByIDRequest) IsSetDetails() bool {
	return v != nil && v.Details != nil
}

// GetIdentity returns the value of Identity if it is set or its
// zero value if it is unset.
func (v *RecordActivityTaskHeartbeatByIDRequest) GetIdentity() (o string) {
	if v != nil && v.Identity != nil {
		return *v.Identity
	}

	return
}

// IsSetIdentity returns true if Identity is not nil.
func (v *RecordActivityTaskHeartbeatByIDRequest) IsSetIdentity() bool {
	return v != nil && v.Identity != nil
}

type RecordActivityTaskHeartbeatRequest struct {
	TaskToken []byte  `json:"taskToken,omitempty"`
	Details   []byte  `json:"details,omitempty"`
	Identity  *string `json:"identity,omitempty"`
}

// ToWire translates a RecordActivityTaskHeartbeatRequest 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 *RecordActivityTaskHeartbeatRequest) ToWire() (wire.Value, error) {
	var (
		fields [3]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.Details != nil {
		w, err = wire.NewValueBinary(v.Details), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, 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: 30, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

// FromWire deserializes a RecordActivityTaskHeartbeatRequest 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 RecordActivityTaskHeartbeatRequest struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v RecordActivityTaskHeartbeatRequest
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *RecordActivityTaskHeartbeatRequest) 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.TBinary {
				v.Details, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		case 30:
			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
}

// String returns a readable string representation of a RecordActivityTaskHeartbeatRequest
// struct.
func (v *RecordActivityTaskHeartbeatRequest) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [3]string
	i := 0
	if v.TaskToken != nil {
		fields[i] = fmt.Sprintf("TaskToken: %v", v.TaskToken)
		i++
	}
	if v.Details != nil {
		fields[i] = fmt.Sprintf("Details: %v", v.Details)
		i++
	}
	if v.Identity != nil {
		fields[i] = fmt.Sprintf("Identity: %v", *(v.Identity))
		i++
	}

	return fmt.Sprintf("RecordActivityTaskHeartbeatRequest{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this RecordActivityTaskHeartbeatRequest match the
// provided RecordActivityTaskHeartbeatRequest.
//
// This function performs a deep comparison.
func (v *RecordActivityTaskHeartbeatRequest) Equals(rhs *RecordActivityTaskHeartbeatRequest) 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.Details == nil && rhs.Details == nil) || (v.Details != nil && rhs.Details != nil && bytes.Equal(v.Details, rhs.Details))) {
		return false
	}
	if !_String_EqualsPtr(v.Identity, rhs.Identity) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of RecordActivityTaskHeartbeatRequest.
func (v *RecordActivityTaskHeartbeatRequest) 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.Details != nil {
		enc.AddString("details", base64.StdEncoding.EncodeToString(v.Details))
	}
	if v.Identity != nil {
		enc.AddString("identity", *v.Identity)
	}
	return err
}

// GetTaskToken returns the value of TaskToken if it is set or its
// zero value if it is unset.
func (v *RecordActivityTaskHeartbeatRequest) GetTaskToken() (o []byte) {
	if v != nil && v.TaskToken != nil {
		return v.TaskToken
	}

	return
}

// IsSetTaskToken returns true if TaskToken is not nil.
func (v *RecordActivityTaskHeartbeatRequest) IsSetTaskToken() bool {
	return v != nil && v.TaskToken != nil
}

// GetDetails returns the value of Details if it is set or its
// zero value if it is unset.
func (v *RecordActivityTaskHeartbeatRequest) GetDetails() (o []byte) {
	if v != nil && v.Details != nil {
		return v.Details
	}

	return
}

// IsSetDetails returns true if Details is not nil.
func (v *RecordActivityTaskHeartbeatRequest) IsSetDetails() bool {
	return v != nil && v.Details != nil
}

// GetIdentity returns the value of Identity if it is set or its
// zero value if it is unset.
func (v *RecordActivityTaskHeartbeatRequest) GetIdentity() (o string) {
	if v != nil && v.Identity != nil {
		return *v.Identity
	}

	return
}

// IsSetIdentity returns true if Identity is not nil.
func (v *RecordActivityTaskHeartbeatRequest) IsSetIdentity() bool {
	return v != nil && v.Identity != nil
}

type RecordActivityTaskHeartbeatResponse struct {
	CancelRequested *bool `json:"cancelRequested,omitempty"`
}

// ToWire translates a RecordActivityTaskHeartbeatResponse 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 *RecordActivityTaskHeartbeatResponse) ToWire() (wire.Value, error) {
	var (
		fields [1]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.CancelRequested != nil {
		w, err = wire.NewValueBool(*(v.CancelRequested)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

// FromWire deserializes a RecordActivityTaskHeartbeatResponse 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 RecordActivityTaskHeartbeatResponse struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v RecordActivityTaskHeartbeatResponse
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *RecordActivityTaskHeartbeatResponse) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			if field.Value.Type() == wire.TBool {
				var x bool
				x, err = field.Value.GetBool(), error(nil)
				v.CancelRequested = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a RecordActivityTaskHeartbeatResponse
// struct.
func (v *RecordActivityTaskHeartbeatResponse) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [1]string
	i := 0
	if v.CancelRequested != nil {
		fields[i] = fmt.Sprintf("CancelRequested: %v", *(v.CancelRequested))
		i++
	}

	return fmt.Sprintf("RecordActivityTaskHeartbeatResponse{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this RecordActivityTaskHeartbeatResponse match the
// provided RecordActivityTaskHeartbeatResponse.
//
// This function performs a deep comparison.
func (v *RecordActivityTaskHeartbeatResponse) Equals(rhs *RecordActivityTaskHeartbeatResponse) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_Bool_EqualsPtr(v.CancelRequested, rhs.CancelRequested) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of RecordActivityTaskHeartbeatResponse.
func (v *RecordActivityTaskHeartbeatResponse) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.CancelRequested != nil {
		enc.AddBool("cancelRequested", *v.CancelRequested)
	}
	return err
}

// GetCancelRequested returns the value of CancelRequested if it is set or its
// zero value if it is unset.
func (v *RecordActivityTaskHeartbeatResponse) GetCancelRequested() (o bool) {
	if v != nil && v.CancelRequested != nil {
		return *v.CancelRequested
	}

	return
}

// IsSetCancelRequested returns true if CancelRequested is not nil.
func (v *RecordActivityTaskHeartbeatResponse) IsSetCancelRequested() bool {
	return v != nil && v.CancelRequested != nil
}

type RecordMarkerDecisionAttributes struct {
	MarkerName *string `json:"markerName,omitempty"`
	Details    []byte  `json:"details,omitempty"`
	Header     *Header `json:"header,omitempty"`
}

// ToWire translates a RecordMarkerDecisionAttributes 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 *RecordMarkerDecisionAttributes) ToWire() (wire.Value, error) {
	var (
		fields [3]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.MarkerName != nil {
		w, err = wire.NewValueString(*(v.MarkerName)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.Details != nil {
		w, err = wire.NewValueBinary(v.Details), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.Header != nil {
		w, err = v.Header.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

// FromWire deserializes a RecordMarkerDecisionAttributes 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 RecordMarkerDecisionAttributes struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v RecordMarkerDecisionAttributes
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *RecordMarkerDecisionAttributes) 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.MarkerName = &x
				if err != nil {
					return err
				}

			}
		case 20:
			if field.Value.Type() == wire.TBinary {
				v.Details, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		case 30:
			if field.Value.Type() == wire.TStruct {
				v.Header, err = _Header_Read(field.Value)
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a RecordMarkerDecisionAttributes
// struct.
func (v *RecordMarkerDecisionAttributes) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [3]string
	i := 0
	if v.MarkerName != nil {
		fields[i] = fmt.Sprintf("MarkerName: %v", *(v.MarkerName))
		i++
	}
	if v.Details != nil {
		fields[i] = fmt.Sprintf("Details: %v", v.Details)
		i++
	}
	if v.Header != nil {
		fields[i] = fmt.Sprintf("Header: %v", v.Header)
		i++
	}

	return fmt.Sprintf("RecordMarkerDecisionAttributes{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this RecordMarkerDecisionAttributes match the
// provided RecordMarkerDecisionAttributes.
//
// This function performs a deep comparison.
func (v *RecordMarkerDecisionAttributes) Equals(rhs *RecordMarkerDecisionAttributes) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.MarkerName, rhs.MarkerName) {
		return false
	}
	if !((v.Details == nil && rhs.Details == nil) || (v.Details != nil && rhs.Details != nil && bytes.Equal(v.Details, rhs.Details))) {
		return false
	}
	if !((v.Header == nil && rhs.Header == nil) || (v.Header != nil && rhs.Header != nil && v.Header.Equals(rhs.Header))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of RecordMarkerDecisionAttributes.
func (v *RecordMarkerDecisionAttributes) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.MarkerName != nil {
		enc.AddString("markerName", *v.MarkerName)
	}
	if v.Details != nil {
		enc.AddString("details", base64.StdEncoding.EncodeToString(v.Details))
	}
	if v.Header != nil {
		err = multierr.Append(err, enc.AddObject("header", v.Header))
	}
	return err
}

// GetMarkerName returns the value of MarkerName if it is set or its
// zero value if it is unset.
func (v *RecordMarkerDecisionAttributes) GetMarkerName() (o string) {
	if v != nil && v.MarkerName != nil {
		return *v.MarkerName
	}

	return
}

// IsSetMarkerName returns true if MarkerName is not nil.
func (v *RecordMarkerDecisionAttributes) IsSetMarkerName() bool {
	return v != nil && v.MarkerName != nil
}

// GetDetails returns the value of Details if it is set or its
// zero value if it is unset.
func (v *RecordMarkerDecisionAttributes) GetDetails() (o []byte) {
	if v != nil && v.Details != nil {
		return v.Details
	}

	return
}

// IsSetDetails returns true if Details is not nil.
func (v *RecordMarkerDecisionAttributes) IsSetDetails() bool {
	return v != nil && v.Details != nil
}

// GetHeader returns the value of Header if it is set or its
// zero value if it is unset.
func (v *RecordMarkerDecisionAttributes) GetHeader() (o *Header) {
	if v != nil && v.Header != nil {
		return v.Header
	}

	return
}

// IsSetHeader returns true if Header is not nil.
func (v *RecordMarkerDecisionAttributes) IsSetHeader() bool {
	return v != nil && v.Header != nil
}

type RefreshWorkflowTasksRequest struct {
	Domain    *string            `json:"domain,omitempty"`
	Execution *WorkflowExecution `json:"execution,omitempty"`
}

// ToWire translates a RefreshWorkflowTasksRequest 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 *RefreshWorkflowTasksRequest) 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.Execution != nil {
		w, err = v.Execution.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 RefreshWorkflowTasksRequest 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 RefreshWorkflowTasksRequest struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v RefreshWorkflowTasksRequest
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *RefreshWorkflowTasksRequest) 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.Execution, err = _WorkflowExecution_Read(field.Value)
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a RefreshWorkflowTasksRequest
// struct.
func (v *RefreshWorkflowTasksRequest) 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.Execution != nil {
		fields[i] = fmt.Sprintf("Execution: %v", v.Execution)
		i++
	}

	return fmt.Sprintf("RefreshWorkflowTasksRequest{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this RefreshWorkflowTasksRequest match the
// provided RefreshWorkflowTasksRequest.
//
// This function performs a deep comparison.
func (v *RefreshWorkflowTasksRequest) Equals(rhs *RefreshWorkflowTasksRequest) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.Domain, rhs.Domain) {
		return false
	}
	if !((v.Execution == nil && rhs.Execution == nil) || (v.Execution != nil && rhs.Execution != nil && v.Execution.Equals(rhs.Execution))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of RefreshWorkflowTasksRequest.
func (v *RefreshWorkflowTasksRequest) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Domain != nil {
		enc.AddString("domain", *v.Domain)
	}
	if v.Execution != nil {
		err = multierr.Append(err, enc.AddObject("execution", v.Execution))
	}
	return err
}

// GetDomain returns the value of Domain if it is set or its
// zero value if it is unset.
func (v *RefreshWorkflowTasksRequest) GetDomain() (o string) {
	if v != nil && v.Domain != nil {
		return *v.Domain
	}

	return
}

// IsSetDomain returns true if Domain is not nil.
func (v *RefreshWorkflowTasksRequest) IsSetDomain() bool {
	return v != nil && v.Domain != nil
}

// GetExecution returns the value of Execution if it is set or its
// zero value if it is unset.
func (v *RefreshWorkflowTasksRequest) GetExecution() (o *WorkflowExecution) {
	if v != nil && v.Execution != nil {
		return v.Execution
	}

	return
}

// IsSetExecution returns true if Execution is not nil.
func (v *RefreshWorkflowTasksRequest) IsSetExecution() bool {
	return v != nil && v.Execution != nil
}

type RegisterDomainRequest struct {
	Name                                   *string                            `json:"name,omitempty"`
	Description                            *string                            `json:"description,omitempty"`
	OwnerEmail                             *string                            `json:"ownerEmail,omitempty"`
	WorkflowExecutionRetentionPeriodInDays *int32                             `json:"workflowExecutionRetentionPeriodInDays,omitempty"`
	EmitMetric                             *bool                              `json:"emitMetric,omitempty"`
	Clusters                               []*ClusterReplicationConfiguration `json:"clusters,omitempty"`
	ActiveClusterName                      *string                            `json:"activeClusterName,omitempty"`
	ActiveClustersByRegion                 map[string]string                  `json:"activeClustersByRegion,omitempty"`
	Data                                   map[string]string                  `json:"data,omitempty"`
	SecurityToken                          *string                            `json:"securityToken,omitempty"`
	IsGlobalDomain                         *bool                              `json:"isGlobalDomain,omitempty"`
	HistoryArchivalStatus                  *ArchivalStatus                    `json:"historyArchivalStatus,omitempty"`
	HistoryArchivalURI                     *string                            `json:"historyArchivalURI,omitempty"`
	VisibilityArchivalStatus               *ArchivalStatus                    `json:"visibilityArchivalStatus,omitempty"`
	VisibilityArchivalURI                  *string                            `json:"visibilityArchivalURI,omitempty"`
}

// Default_RegisterDomainRequest constructs a new RegisterDomainRequest struct,
// pre-populating any fields with defined default values.
func Default_RegisterDomainRequest() *RegisterDomainRequest {
	var v RegisterDomainRequest
	v.EmitMetric = ptr.Bool(true)
	return &v
}

// ToWire translates a RegisterDomainRequest 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 *RegisterDomainRequest) ToWire() (wire.Value, error) {
	var (
		fields [15]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.Name != nil {
		w, err = wire.NewValueString(*(v.Name)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.Description != nil {
		w, err = wire.NewValueString(*(v.Description)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.OwnerEmail != nil {
		w, err = wire.NewValueString(*(v.OwnerEmail)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.WorkflowExecutionRetentionPeriodInDays != nil {
		w, err = wire.NewValueI32(*(v.WorkflowExecutionRetentionPeriodInDays)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 40, Value: w}
		i++
	}
	vEmitMetric := v.EmitMetric
	if vEmitMetric == nil {
		vEmitMetric = ptr.Bool(true)
	}
	{
		w, err = wire.NewValueBool(*(vEmitMetric)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 50, Value: w}
		i++
	}
	if v.Clusters != nil {
		w, err = wire.NewValueList(_List_ClusterReplicationConfiguration_ValueList(v.Clusters)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 60, Value: w}
		i++
	}
	if v.ActiveClusterName != nil {
		w, err = wire.NewValueString(*(v.ActiveClusterName)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 70, Value: w}
		i++
	}
	if v.ActiveClustersByRegion != nil {
		w, err = wire.NewValueMap(_Map_String_String_MapItemList(v.ActiveClustersByRegion)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 75, Value: w}
		i++
	}
	if v.Data != nil {
		w, err = wire.NewValueMap(_Map_String_String_MapItemList(v.Data)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 80, Value: w}
		i++
	}
	if v.SecurityToken != nil {
		w, err = wire.NewValueString(*(v.SecurityToken)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 90, Value: w}
		i++
	}
	if v.IsGlobalDomain != nil {
		w, err = wire.NewValueBool(*(v.IsGlobalDomain)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 120, Value: w}
		i++
	}
	if v.HistoryArchivalStatus != nil {
		w, err = v.HistoryArchivalStatus.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 130, Value: w}
		i++
	}
	if v.HistoryArchivalURI != nil {
		w, err = wire.NewValueString(*(v.HistoryArchivalURI)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 140, Value: w}
		i++
	}
	if v.VisibilityArchivalStatus != nil {
		w, err = v.VisibilityArchivalStatus.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 150, Value: w}
		i++
	}
	if v.VisibilityArchivalURI != nil {
		w, err = wire.NewValueString(*(v.VisibilityArchivalURI)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 160, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

// FromWire deserializes a RegisterDomainRequest 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 RegisterDomainRequest struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v RegisterDomainRequest
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *RegisterDomainRequest) 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.Name = &x
				if err != nil {
					return err
				}

			}
		case 20:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.Description = &x
				if err != nil {
					return err
				}

			}
		case 30:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.OwnerEmail = &x
				if err != nil {
					return err
				}

			}
		case 40:
			if field.Value.Type() == wire.TI32 {
				var x int32
				x, err = field.Value.GetI32(), error(nil)
				v.WorkflowExecutionRetentionPeriodInDays = &x
				if err != nil {
					return err
				}

			}
		case 50:
			if field.Value.Type() == wire.TBool {
				var x bool
				x, err = field.Value.GetBool(), error(nil)
				v.EmitMetric = &x
				if err != nil {
					return err
				}

			}
		case 60:
			if field.Value.Type() == wire.TList {
				v.Clusters, err = _List_ClusterReplicationConfiguration_Read(field.Value.GetList())
				if err != nil {
					return err
				}

			}
		case 70:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.ActiveClusterName = &x
				if err != nil {
					return err
				}

			}
		case 75:
			if field.Value.Type() == wire.TMap {
				v.ActiveClustersByRegion, err = _Map_String_String_Read(field.Value.GetMap())
				if err != nil {
					return err
				}

			}
		case 80:
			if field.Value.Type() == wire.TMap {
				v.Data, err = _Map_String_String_Read(field.Value.GetMap())
				if err != nil {
					return err
				}

			}
		case 90:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.SecurityToken = &x
				if err != nil {
					return err
				}

			}
		case 120:
			if field.Value.Type() == wire.TBool {
				var x bool
				x, err = field.Value.GetBool(), error(nil)
				v.IsGlobalDomain = &x
				if err != nil {
					return err
				}

			}
		case 130:
			if field.Value.Type() == wire.TI32 {
				var x ArchivalStatus
				x, err = _ArchivalStatus_Read(field.Value)
				v.HistoryArchivalStatus = &x
				if err != nil {
					return err
				}

			}
		case 140:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.HistoryArchivalURI = &x
				if err != nil {
					return err
				}

			}
		case 150:
			if field.Value.Type() == wire.TI32 {
				var x ArchivalStatus
				x, err = _ArchivalStatus_Read(field.Value)
				v.VisibilityArchivalStatus = &x
				if err != nil {
					return err
				}

			}
		case 160:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.VisibilityArchivalURI = &x
				if err != nil {
					return err
				}

			}
		}
	}

	if v.EmitMetric == nil {
		v.EmitMetric = ptr.Bool(true)
	}

	return nil
}

// String returns a readable string representation of a RegisterDomainRequest
// struct.
func (v *RegisterDomainRequest) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [15]string
	i := 0
	if v.Name != nil {
		fields[i] = fmt.Sprintf("Name: %v", *(v.Name))
		i++
	}
	if v.Description != nil {
		fields[i] = fmt.Sprintf("Description: %v", *(v.Description))
		i++
	}
	if v.OwnerEmail != nil {
		fields[i] = fmt.Sprintf("OwnerEmail: %v", *(v.OwnerEmail))
		i++
	}
	if v.WorkflowExecutionRetentionPeriodInDays != nil {
		fields[i] = fmt.Sprintf("WorkflowExecutionRetentionPeriodInDays: %v", *(v.WorkflowExecutionRetentionPeriodInDays))
		i++
	}
	if v.EmitMetric != nil {
		fields[i] = fmt.Sprintf("EmitMetric: %v", *(v.EmitMetric))
		i++
	}
	if v.Clusters != nil {
		fields[i] = fmt.Sprintf("Clusters: %v", v.Clusters)
		i++
	}
	if v.ActiveClusterName != nil {
		fields[i] = fmt.Sprintf("ActiveClusterName: %v", *(v.ActiveClusterName))
		i++
	}
	if v.ActiveClustersByRegion != nil {
		fields[i] = fmt.Sprintf("ActiveClustersByRegion: %v", v.ActiveClustersByRegion)
		i++
	}
	if v.Data != nil {
		fields[i] = fmt.Sprintf("Data: %v", v.Data)
		i++
	}
	if v.SecurityToken != nil {
		fields[i] = fmt.Sprintf("SecurityToken: %v", *(v.SecurityToken))
		i++
	}
	if v.IsGlobalDomain != nil {
		fields[i] = fmt.Sprintf("IsGlobalDomain: %v", *(v.IsGlobalDomain))
		i++
	}
	if v.HistoryArchivalStatus != nil {
		fields[i] = fmt.Sprintf("HistoryArchivalStatus: %v", *(v.HistoryArchivalStatus))
		i++
	}
	if v.HistoryArchivalURI != nil {
		fields[i] = fmt.Sprintf("HistoryArchivalURI: %v", *(v.HistoryArchivalURI))
		i++
	}
	if v.VisibilityArchivalStatus != nil {
		fields[i] = fmt.Sprintf("VisibilityArchivalStatus: %v", *(v.VisibilityArchivalStatus))
		i++
	}
	if v.VisibilityArchivalURI != nil {
		fields[i] = fmt.Sprintf("VisibilityArchivalURI: %v", *(v.VisibilityArchivalURI))
		i++
	}

	return fmt.Sprintf("RegisterDomainRequest{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this RegisterDomainRequest match the
// provided RegisterDomainRequest.
//
// This function performs a deep comparison.
func (v *RegisterDomainRequest) Equals(rhs *RegisterDomainRequest) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.Name, rhs.Name) {
		return false
	}
	if !_String_EqualsPtr(v.Description, rhs.Description) {
		return false
	}
	if !_String_EqualsPtr(v.OwnerEmail, rhs.OwnerEmail) {
		return false
	}
	if !_I32_EqualsPtr(v.WorkflowExecutionRetentionPeriodInDays, rhs.WorkflowExecutionRetentionPeriodInDays) {
		return false
	}
	if !_Bool_EqualsPtr(v.EmitMetric, rhs.EmitMetric) {
		return false
	}
	if !((v.Clusters == nil && rhs.Clusters == nil) || (v.Clusters != nil && rhs.Clusters != nil && _List_ClusterReplicationConfiguration_Equals(v.Clusters, rhs.Clusters))) {
		return false
	}
	if !_String_EqualsPtr(v.ActiveClusterName, rhs.ActiveClusterName) {
		return false
	}
	if !((v.ActiveClustersByRegion == nil && rhs.ActiveClustersByRegion == nil) || (v.ActiveClustersByRegion != nil && rhs.ActiveClustersByRegion != nil && _Map_String_String_Equals(v.ActiveClustersByRegion, rhs.ActiveClustersByRegion))) {
		return false
	}
	if !((v.Data == nil && rhs.Data == nil) || (v.Data != nil && rhs.Data != nil && _Map_String_String_Equals(v.Data, rhs.Data))) {
		return false
	}
	if !_String_EqualsPtr(v.SecurityToken, rhs.SecurityToken) {
		return false
	}
	if !_Bool_EqualsPtr(v.IsGlobalDomain, rhs.IsGlobalDomain) {
		return false
	}
	if !_ArchivalStatus_EqualsPtr(v.HistoryArchivalStatus, rhs.HistoryArchivalStatus) {
		return false
	}
	if !_String_EqualsPtr(v.HistoryArchivalURI, rhs.HistoryArchivalURI) {
		return false
	}
	if !_ArchivalStatus_EqualsPtr(v.VisibilityArchivalStatus, rhs.VisibilityArchivalStatus) {
		return false
	}
	if !_String_EqualsPtr(v.VisibilityArchivalURI, rhs.VisibilityArchivalURI) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of RegisterDomainRequest.
func (v *RegisterDomainRequest) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Name != nil {
		enc.AddString("name", *v.Name)
	}
	if v.Description != nil {
		enc.AddString("description", *v.Description)
	}
	if v.OwnerEmail != nil {
		enc.AddString("ownerEmail", *v.OwnerEmail)
	}
	if v.WorkflowExecutionRetentionPeriodInDays != nil {
		enc.AddInt32("workflowExecutionRetentionPeriodInDays", *v.WorkflowExecutionRetentionPeriodInDays)
	}
	if v.EmitMetric != nil {
		enc.AddBool("emitMetric", *v.EmitMetric)
	}
	if v.Clusters != nil {
		err = multierr.Append(err, enc.AddArray("clusters", (_List_ClusterReplicationConfiguration_Zapper)(v.Clusters)))
	}
	if v.ActiveClusterName != nil {
		enc.AddString("activeClusterName", *v.ActiveClusterName)
	}
	if v.ActiveClustersByRegion != nil {
		err = multierr.Append(err, enc.AddObject("activeClustersByRegion", (_Map_String_String_Zapper)(v.ActiveClustersByRegion)))
	}
	if v.Data != nil {
		err = multierr.Append(err, enc.AddObject("data", (_Map_String_String_Zapper)(v.Data)))
	}
	if v.SecurityToken != nil {
		enc.AddString("securityToken", *v.SecurityToken)
	}
	if v.IsGlobalDomain != nil {
		enc.AddBool("isGlobalDomain", *v.IsGlobalDomain)
	}
	if v.HistoryArchivalStatus != nil {
		err = multierr.Append(err, enc.AddObject("historyArchivalStatus", *v.HistoryArchivalStatus))
	}
	if v.HistoryArchivalURI != nil {
		enc.AddString("historyArchivalURI", *v.HistoryArchivalURI)
	}
	if v.VisibilityArchivalStatus != nil {
		err = multierr.Append(err, enc.AddObject("visibilityArchivalStatus", *v.VisibilityArchivalStatus))
	}
	if v.VisibilityArchivalURI != nil {
		enc.AddString("visibilityArchivalURI", *v.VisibilityArchivalURI)
	}
	return err
}

// GetName returns the value of Name if it is set or its
// zero value if it is unset.
func (v *RegisterDomainRequest) GetName() (o string) {
	if v != nil && v.Name != nil {
		return *v.Name
	}

	return
}

// IsSetName returns true if Name is not nil.
func (v *RegisterDomainRequest) IsSetName() bool {
	return v != nil && v.Name != nil
}

// GetDescription returns the value of Description if it is set or its
// zero value if it is unset.
func (v *RegisterDomainRequest) GetDescription() (o string) {
	if v != nil && v.Description != nil {
		return *v.Description
	}

	return
}

// IsSetDescription returns true if Description is not nil.
func (v *RegisterDomainRequest) IsSetDescription() bool {
	return v != nil && v.Description != nil
}

// GetOwnerEmail returns the value of OwnerEmail if it is set or its
// zero value if it is unset.
func (v *RegisterDomainRequest) GetOwnerEmail() (o string) {
	if v != nil && v.OwnerEmail != nil {
		return *v.OwnerEmail
	}

	return
}

// IsSetOwnerEmail returns true if OwnerEmail is not nil.
func (v *RegisterDomainRequest) IsSetOwnerEmail() bool {
	return v != nil && v.OwnerEmail != nil
}

// GetWorkflowExecutionRetentionPeriodInDays returns the value of WorkflowExecutionRetentionPeriodInDays if it is set or its
// zero value if it is unset.
func (v *RegisterDomainRequest) GetWorkflowExecutionRetentionPeriodInDays() (o int32) {
	if v != nil && v.WorkflowExecutionRetentionPeriodInDays != nil {
		return *v.WorkflowExecutionRetentionPeriodInDays
	}

	return
}

// IsSetWorkflowExecutionRetentionPeriodInDays returns true if WorkflowExecutionRetentionPeriodInDays is not nil.
func (v *RegisterDomainRequest) IsSetWorkflowExecutionRetentionPeriodInDays() bool {
	return v != nil && v.WorkflowExecutionRetentionPeriodInDays != nil
}

// GetEmitMetric returns the value of EmitMetric if it is set or its
// default value if it is unset.
func (v *RegisterDomainRequest) GetEmitMetric() (o bool) {
	if v != nil && v.EmitMetric != nil {
		return *v.EmitMetric
	}
	o = true
	return
}

// IsSetEmitMetric returns true if EmitMetric is not nil.
func (v *RegisterDomainRequest) IsSetEmitMetric() bool {
	return v != nil && v.EmitMetric != nil
}

// GetClusters returns the value of Clusters if it is set or its
// zero value if it is unset.
func (v *RegisterDomainRequest) GetClusters() (o []*ClusterReplicationConfiguration) {
	if v != nil && v.Clusters != nil {
		return v.Clusters
	}

	return
}

// IsSetClusters returns true if Clusters is not nil.
func (v *RegisterDomainRequest) IsSetClusters() bool {
	return v != nil && v.Clusters != nil
}

// GetActiveClusterName returns the value of ActiveClusterName if it is set or its
// zero value if it is unset.
func (v *RegisterDomainRequest) GetActiveClusterName() (o string) {
	if v != nil && v.ActiveClusterName != nil {
		return *v.ActiveClusterName
	}

	return
}

// IsSetActiveClusterName returns true if ActiveClusterName is not nil.
func (v *RegisterDomainRequest) IsSetActiveClusterName() bool {
	return v != nil && v.ActiveClusterName != nil
}

// GetActiveClustersByRegion returns the value of ActiveClustersByRegion if it is set or its
// zero value if it is unset.
func (v *RegisterDomainRequest) GetActiveClustersByRegion() (o map[string]string) {
	if v != nil && v.ActiveClustersByRegion != nil {
		return v.ActiveClustersByRegion
	}

	return
}

// IsSetActiveClustersByRegion returns true if ActiveClustersByRegion is not nil.
func (v *RegisterDomainRequest) IsSetActiveClustersByRegion() bool {
	return v != nil && v.ActiveClustersByRegion != nil
}

// GetData returns the value of Data if it is set or its
// zero value if it is unset.
func (v *RegisterDomainRequest) GetData() (o map[string]string) {
	if v != nil && v.Data != nil {
		return v.Data
	}

	return
}

// IsSetData returns true if Data is not nil.
func (v *RegisterDomainRequest) IsSetData() bool {
	return v != nil && v.Data != nil
}

// GetSecurityToken returns the value of SecurityToken if it is set or its
// zero value if it is unset.
func (v *RegisterDomainRequest) GetSecurityToken() (o string) {
	if v != nil && v.SecurityToken != nil {
		return *v.SecurityToken
	}

	return
}

// IsSetSecurityToken returns true if SecurityToken is not nil.
func (v *RegisterDomainRequest) IsSetSecurityToken() bool {
	return v != nil && v.SecurityToken != nil
}

// GetIsGlobalDomain returns the value of IsGlobalDomain if it is set or its
// zero value if it is unset.
func (v *RegisterDomainRequest) GetIsGlobalDomain() (o bool) {
	if v != nil && v.IsGlobalDomain != nil {
		return *v.IsGlobalDomain
	}

	return
}

// IsSetIsGlobalDomain returns true if IsGlobalDomain is not nil.
func (v *RegisterDomainRequest) IsSetIsGlobalDomain() bool {
	return v != nil && v.IsGlobalDomain != nil
}

// GetHistoryArchivalStatus returns the value of HistoryArchivalStatus if it is set or its
// zero value if it is unset.
func (v *RegisterDomainRequest) GetHistoryArchivalStatus() (o ArchivalStatus) {
	if v != nil && v.HistoryArchivalStatus != nil {
		return *v.HistoryArchivalStatus
	}

	return
}

// IsSetHistoryArchivalStatus returns true if HistoryArchivalStatus is not nil.
func (v *RegisterDomainRequest) IsSetHistoryArchivalStatus() bool {
	return v != nil && v.HistoryArchivalStatus != nil
}

// GetHistoryArchivalURI returns the value of HistoryArchivalURI if it is set or its
// zero value if it is unset.
func (v *RegisterDomainRequest) GetHistoryArchivalURI() (o string) {
	if v != nil && v.HistoryArchivalURI != nil {
		return *v.HistoryArchivalURI
	}

	return
}

// IsSetHistoryArchivalURI returns true if HistoryArchivalURI is not nil.
func (v *RegisterDomainRequest) IsSetHistoryArchivalURI() bool {
	return v != nil && v.HistoryArchivalURI != nil
}

// GetVisibilityArchivalStatus returns the value of VisibilityArchivalStatus if it is set or its
// zero value if it is unset.
func (v *RegisterDomainRequest) GetVisibilityArchivalStatus() (o ArchivalStatus) {
	if v != nil && v.VisibilityArchivalStatus != nil {
		return *v.VisibilityArchivalStatus
	}

	return
}

// IsSetVisibilityArchivalStatus returns true if VisibilityArchivalStatus is not nil.
func (v *RegisterDomainRequest) IsSetVisibilityArchivalStatus() bool {
	return v != nil && v.VisibilityArchivalStatus != nil
}

// GetVisibilityArchivalURI returns the value of VisibilityArchivalURI if it is set or its
// zero value if it is unset.
func (v *RegisterDomainRequest) GetVisibilityArchivalURI() (o string) {
	if v != nil && v.VisibilityArchivalURI != nil {
		return *v.VisibilityArchivalURI
	}

	return
}

// IsSetVisibilityArchivalURI returns true if VisibilityArchivalURI is not nil.
func (v *RegisterDomainRequest) IsSetVisibilityArchivalURI() bool {
	return v != nil && v.VisibilityArchivalURI != nil
}

type RemoteSyncMatchedError struct {
	Message string `json:"message,required"`
}

// ToWire translates a RemoteSyncMatchedError 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 *RemoteSyncMatchedError) 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: 10, Value: w}
	i++

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

// FromWire deserializes a RemoteSyncMatchedError 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 RemoteSyncMatchedError struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v RemoteSyncMatchedError
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *RemoteSyncMatchedError) FromWire(w wire.Value) error {
	var err error

	messageIsSet := false

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			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 RemoteSyncMatchedError is required")
	}

	return nil
}

// String returns a readable string representation of a RemoteSyncMatchedError
// struct.
func (v *RemoteSyncMatchedError) 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("RemoteSyncMatchedError{%v}", strings.Join(fields[:i], ", "))
}

// ErrorName is the name of this type as defined in the Thrift
// file.
func (*RemoteSyncMatchedError) ErrorName() string {
	return "RemoteSyncMatchedError"
}

// Equals returns true if all the fields of this RemoteSyncMatchedError match the
// provided RemoteSyncMatchedError.
//
// This function performs a deep comparison.
func (v *RemoteSyncMatchedError) Equals(rhs *RemoteSyncMatchedError) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !(v.Message == rhs.Message) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of RemoteSyncMatchedError.
func (v *RemoteSyncMatchedError) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	enc.AddString("message", v.Message)
	return err
}

// GetMessage returns the value of Message if it is set or its
// zero value if it is unset.
func (v *RemoteSyncMatchedError) GetMessage() (o string) {
	if v != nil {
		o = v.Message
	}
	return
}

func (v *RemoteSyncMatchedError) Error() string {
	return v.String()
}

type RemoveTaskRequest struct {
	ShardID             *int32  `json:"shardID,omitempty"`
	Type                *int32  `json:"type,omitempty"`
	TaskID              *int64  `json:"taskID,omitempty"`
	VisibilityTimestamp *int64  `json:"visibilityTimestamp,omitempty"`
	ClusterName         *string `json:"clusterName,omitempty"`
}

// ToWire translates a RemoveTaskRequest 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 *RemoveTaskRequest) ToWire() (wire.Value, error) {
	var (
		fields [5]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.ShardID != nil {
		w, err = wire.NewValueI32(*(v.ShardID)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.Type != nil {
		w, err = wire.NewValueI32(*(v.Type)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.TaskID != nil {
		w, err = wire.NewValueI64(*(v.TaskID)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.VisibilityTimestamp != nil {
		w, err = wire.NewValueI64(*(v.VisibilityTimestamp)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 40, Value: w}
		i++
	}
	if v.ClusterName != nil {
		w, err = wire.NewValueString(*(v.ClusterName)), 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
}

// FromWire deserializes a RemoveTaskRequest 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 RemoveTaskRequest struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v RemoveTaskRequest
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *RemoveTaskRequest) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			if field.Value.Type() == wire.TI32 {
				var x int32
				x, err = field.Value.GetI32(), error(nil)
				v.ShardID = &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.Type = &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.TaskID = &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.VisibilityTimestamp = &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.ClusterName = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a RemoveTaskRequest
// struct.
func (v *RemoveTaskRequest) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [5]string
	i := 0
	if v.ShardID != nil {
		fields[i] = fmt.Sprintf("ShardID: %v", *(v.ShardID))
		i++
	}
	if v.Type != nil {
		fields[i] = fmt.Sprintf("Type: %v", *(v.Type))
		i++
	}
	if v.TaskID != nil {
		fields[i] = fmt.Sprintf("TaskID: %v", *(v.TaskID))
		i++
	}
	if v.VisibilityTimestamp != nil {
		fields[i] = fmt.Sprintf("VisibilityTimestamp: %v", *(v.VisibilityTimestamp))
		i++
	}
	if v.ClusterName != nil {
		fields[i] = fmt.Sprintf("ClusterName: %v", *(v.ClusterName))
		i++
	}

	return fmt.Sprintf("RemoveTaskRequest{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this RemoveTaskRequest match the
// provided RemoveTaskRequest.
//
// This function performs a deep comparison.
func (v *RemoveTaskRequest) Equals(rhs *RemoveTaskRequest) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_I32_EqualsPtr(v.ShardID, rhs.ShardID) {
		return false
	}
	if !_I32_EqualsPtr(v.Type, rhs.Type) {
		return false
	}
	if !_I64_EqualsPtr(v.TaskID, rhs.TaskID) {
		return false
	}
	if !_I64_EqualsPtr(v.VisibilityTimestamp, rhs.VisibilityTimestamp) {
		return false
	}
	if !_String_EqualsPtr(v.ClusterName, rhs.ClusterName) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of RemoveTaskRequest.
func (v *RemoveTaskRequest) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.ShardID != nil {
		enc.AddInt32("shardID", *v.ShardID)
	}
	if v.Type != nil {
		enc.AddInt32("type", *v.Type)
	}
	if v.TaskID != nil {
		enc.AddInt64("taskID", *v.TaskID)
	}
	if v.VisibilityTimestamp != nil {
		enc.AddInt64("visibilityTimestamp", *v.VisibilityTimestamp)
	}
	if v.ClusterName != nil {
		enc.AddString("clusterName", *v.ClusterName)
	}
	return err
}

// GetShardID returns the value of ShardID if it is set or its
// zero value if it is unset.
func (v *RemoveTaskRequest) GetShardID() (o int32) {
	if v != nil && v.ShardID != nil {
		return *v.ShardID
	}

	return
}

// IsSetShardID returns true if ShardID is not nil.
func (v *RemoveTaskRequest) IsSetShardID() bool {
	return v != nil && v.ShardID != nil
}

// GetType returns the value of Type if it is set or its
// zero value if it is unset.
func (v *RemoveTaskRequest) GetType() (o int32) {
	if v != nil && v.Type != nil {
		return *v.Type
	}

	return
}

// IsSetType returns true if Type is not nil.
func (v *RemoveTaskRequest) IsSetType() bool {
	return v != nil && v.Type != nil
}

// GetTaskID returns the value of TaskID if it is set or its
// zero value if it is unset.
func (v *RemoveTaskRequest) GetTaskID() (o int64) {
	if v != nil && v.TaskID != nil {
		return *v.TaskID
	}

	return
}

// IsSetTaskID returns true if TaskID is not nil.
func (v *RemoveTaskRequest) IsSetTaskID() bool {
	return v != nil && v.TaskID != nil
}

// GetVisibilityTimestamp returns the value of VisibilityTimestamp if it is set or its
// zero value if it is unset.
func (v *RemoveTaskRequest) GetVisibilityTimestamp() (o int64) {
	if v != nil && v.VisibilityTimestamp != nil {
		return *v.VisibilityTimestamp
	}

	return
}

// IsSetVisibilityTimestamp returns true if VisibilityTimestamp is not nil.
func (v *RemoveTaskRequest) IsSetVisibilityTimestamp() bool {
	return v != nil && v.VisibilityTimestamp != nil
}

// GetClusterName returns the value of ClusterName if it is set or its
// zero value if it is unset.
func (v *RemoveTaskRequest) GetClusterName() (o string) {
	if v != nil && v.ClusterName != nil {
		return *v.ClusterName
	}

	return
}

// IsSetClusterName returns true if ClusterName is not nil.
func (v *RemoveTaskRequest) IsSetClusterName() bool {
	return v != nil && v.ClusterName != nil
}

type RequestCancelActivityTaskDecisionAttributes struct {
	ActivityId *string `json:"activityId,omitempty"`
}

// ToWire translates a RequestCancelActivityTaskDecisionAttributes 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 *RequestCancelActivityTaskDecisionAttributes) ToWire() (wire.Value, error) {
	var (
		fields [1]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++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

// FromWire deserializes a RequestCancelActivityTaskDecisionAttributes 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 RequestCancelActivityTaskDecisionAttributes struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v RequestCancelActivityTaskDecisionAttributes
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *RequestCancelActivityTaskDecisionAttributes) 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
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a RequestCancelActivityTaskDecisionAttributes
// struct.
func (v *RequestCancelActivityTaskDecisionAttributes) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [1]string
	i := 0
	if v.ActivityId != nil {
		fields[i] = fmt.Sprintf("ActivityId: %v", *(v.ActivityId))
		i++
	}

	return fmt.Sprintf("RequestCancelActivityTaskDecisionAttributes{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this RequestCancelActivityTaskDecisionAttributes match the
// provided RequestCancelActivityTaskDecisionAttributes.
//
// This function performs a deep comparison.
func (v *RequestCancelActivityTaskDecisionAttributes) Equals(rhs *RequestCancelActivityTaskDecisionAttributes) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.ActivityId, rhs.ActivityId) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of RequestCancelActivityTaskDecisionAttributes.
func (v *RequestCancelActivityTaskDecisionAttributes) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.ActivityId != nil {
		enc.AddString("activityId", *v.ActivityId)
	}
	return err
}

// GetActivityId returns the value of ActivityId if it is set or its
// zero value if it is unset.
func (v *RequestCancelActivityTaskDecisionAttributes) GetActivityId() (o string) {
	if v != nil && v.ActivityId != nil {
		return *v.ActivityId
	}

	return
}

// IsSetActivityId returns true if ActivityId is not nil.
func (v *RequestCancelActivityTaskDecisionAttributes) IsSetActivityId() bool {
	return v != nil && v.ActivityId != nil
}

type RequestCancelActivityTaskFailedEventAttributes struct {
	ActivityId                   *string `json:"activityId,omitempty"`
	Cause                        *string `json:"cause,omitempty"`
	DecisionTaskCompletedEventId *int64  `json:"decisionTaskCompletedEventId,omitempty"`
}

// ToWire translates a RequestCancelActivityTaskFailedEventAttributes 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 *RequestCancelActivityTaskFailedEventAttributes) ToWire() (wire.Value, error) {
	var (
		fields [3]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.Cause != nil {
		w, err = wire.NewValueString(*(v.Cause)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, 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: 30, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

// FromWire deserializes a RequestCancelActivityTaskFailedEventAttributes 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 RequestCancelActivityTaskFailedEventAttributes struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v RequestCancelActivityTaskFailedEventAttributes
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *RequestCancelActivityTaskFailedEventAttributes) 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.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.Cause = &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.DecisionTaskCompletedEventId = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a RequestCancelActivityTaskFailedEventAttributes
// struct.
func (v *RequestCancelActivityTaskFailedEventAttributes) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [3]string
	i := 0
	if v.ActivityId != nil {
		fields[i] = fmt.Sprintf("ActivityId: %v", *(v.ActivityId))
		i++
	}
	if v.Cause != nil {
		fields[i] = fmt.Sprintf("Cause: %v", *(v.Cause))
		i++
	}
	if v.DecisionTaskCompletedEventId != nil {
		fields[i] = fmt.Sprintf("DecisionTaskCompletedEventId: %v", *(v.DecisionTaskCompletedEventId))
		i++
	}

	return fmt.Sprintf("RequestCancelActivityTaskFailedEventAttributes{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this RequestCancelActivityTaskFailedEventAttributes match the
// provided RequestCancelActivityTaskFailedEventAttributes.
//
// This function performs a deep comparison.
func (v *RequestCancelActivityTaskFailedEventAttributes) Equals(rhs *RequestCancelActivityTaskFailedEventAttributes) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.ActivityId, rhs.ActivityId) {
		return false
	}
	if !_String_EqualsPtr(v.Cause, rhs.Cause) {
		return false
	}
	if !_I64_EqualsPtr(v.DecisionTaskCompletedEventId, rhs.DecisionTaskCompletedEventId) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of RequestCancelActivityTaskFailedEventAttributes.
func (v *RequestCancelActivityTaskFailedEventAttributes) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.ActivityId != nil {
		enc.AddString("activityId", *v.ActivityId)
	}
	if v.Cause != nil {
		enc.AddString("cause", *v.Cause)
	}
	if v.DecisionTaskCompletedEventId != nil {
		enc.AddInt64("decisionTaskCompletedEventId", *v.DecisionTaskCompletedEventId)
	}
	return err
}

// GetActivityId returns the value of ActivityId if it is set or its
// zero value if it is unset.
func (v *RequestCancelActivityTaskFailedEventAttributes) GetActivityId() (o string) {
	if v != nil && v.ActivityId != nil {
		return *v.ActivityId
	}

	return
}

// IsSetActivityId returns true if ActivityId is not nil.
func (v *RequestCancelActivityTaskFailedEventAttributes) IsSetActivityId() bool {
	return v != nil && v.ActivityId != nil
}

// GetCause returns the value of Cause if it is set or its
// zero value if it is unset.
func (v *RequestCancelActivityTaskFailedEventAttributes) GetCause() (o string) {
	if v != nil && v.Cause != nil {
		return *v.Cause
	}

	return
}

// IsSetCause returns true if Cause is not nil.
func (v *RequestCancelActivityTaskFailedEventAttributes) IsSetCause() bool {
	return v != nil && v.Cause != nil
}

// GetDecisionTaskCompletedEventId returns the value of DecisionTaskCompletedEventId if it is set or its
// zero value if it is unset.
func (v *RequestCancelActivityTaskFailedEventAttributes) GetDecisionTaskCompletedEventId() (o int64) {
	if v != nil && v.DecisionTaskCompletedEventId != nil {
		return *v.DecisionTaskCompletedEventId
	}

	return
}

// IsSetDecisionTaskCompletedEventId returns true if DecisionTaskCompletedEventId is not nil.
func (v *RequestCancelActivityTaskFailedEventAttributes) IsSetDecisionTaskCompletedEventId() bool {
	return v != nil && v.DecisionTaskCompletedEventId != nil
}

type RequestCancelExternalWorkflowExecutionDecisionAttributes struct {
	Domain            *string `json:"domain,omitempty"`
	WorkflowId        *string `json:"workflowId,omitempty"`
	RunId             *string `json:"runId,omitempty"`
	Control           []byte  `json:"control,omitempty"`
	ChildWorkflowOnly *bool   `json:"childWorkflowOnly,omitempty"`
}

// ToWire translates a RequestCancelExternalWorkflowExecutionDecisionAttributes 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 *RequestCancelExternalWorkflowExecutionDecisionAttributes) ToWire() (wire.Value, error) {
	var (
		fields [5]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.WorkflowId != nil {
		w, err = wire.NewValueString(*(v.WorkflowId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.RunId != nil {
		w, err = wire.NewValueString(*(v.RunId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.Control != nil {
		w, err = wire.NewValueBinary(v.Control), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 40, Value: w}
		i++
	}
	if v.ChildWorkflowOnly != nil {
		w, err = wire.NewValueBool(*(v.ChildWorkflowOnly)), 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
}

// FromWire deserializes a RequestCancelExternalWorkflowExecutionDecisionAttributes 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 RequestCancelExternalWorkflowExecutionDecisionAttributes struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v RequestCancelExternalWorkflowExecutionDecisionAttributes
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *RequestCancelExternalWorkflowExecutionDecisionAttributes) 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.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.WorkflowId = &x
				if err != nil {
					return err
				}

			}
		case 30:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.RunId = &x
				if err != nil {
					return err
				}

			}
		case 40:
			if field.Value.Type() == wire.TBinary {
				v.Control, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		case 50:
			if field.Value.Type() == wire.TBool {
				var x bool
				x, err = field.Value.GetBool(), error(nil)
				v.ChildWorkflowOnly = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a RequestCancelExternalWorkflowExecutionDecisionAttributes
// struct.
func (v *RequestCancelExternalWorkflowExecutionDecisionAttributes) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [5]string
	i := 0
	if v.Domain != nil {
		fields[i] = fmt.Sprintf("Domain: %v", *(v.Domain))
		i++
	}
	if v.WorkflowId != nil {
		fields[i] = fmt.Sprintf("WorkflowId: %v", *(v.WorkflowId))
		i++
	}
	if v.RunId != nil {
		fields[i] = fmt.Sprintf("RunId: %v", *(v.RunId))
		i++
	}
	if v.Control != nil {
		fields[i] = fmt.Sprintf("Control: %v", v.Control)
		i++
	}
	if v.ChildWorkflowOnly != nil {
		fields[i] = fmt.Sprintf("ChildWorkflowOnly: %v", *(v.ChildWorkflowOnly))
		i++
	}

	return fmt.Sprintf("RequestCancelExternalWorkflowExecutionDecisionAttributes{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this RequestCancelExternalWorkflowExecutionDecisionAttributes match the
// provided RequestCancelExternalWorkflowExecutionDecisionAttributes.
//
// This function performs a deep comparison.
func (v *RequestCancelExternalWorkflowExecutionDecisionAttributes) Equals(rhs *RequestCancelExternalWorkflowExecutionDecisionAttributes) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.Domain, rhs.Domain) {
		return false
	}
	if !_String_EqualsPtr(v.WorkflowId, rhs.WorkflowId) {
		return false
	}
	if !_String_EqualsPtr(v.RunId, rhs.RunId) {
		return false
	}
	if !((v.Control == nil && rhs.Control == nil) || (v.Control != nil && rhs.Control != nil && bytes.Equal(v.Control, rhs.Control))) {
		return false
	}
	if !_Bool_EqualsPtr(v.ChildWorkflowOnly, rhs.ChildWorkflowOnly) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of RequestCancelExternalWorkflowExecutionDecisionAttributes.
func (v *RequestCancelExternalWorkflowExecutionDecisionAttributes) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Domain != nil {
		enc.AddString("domain", *v.Domain)
	}
	if v.WorkflowId != nil {
		enc.AddString("workflowId", *v.WorkflowId)
	}
	if v.RunId != nil {
		enc.AddString("runId", *v.RunId)
	}
	if v.Control != nil {
		enc.AddString("control", base64.StdEncoding.EncodeToString(v.Control))
	}
	if v.ChildWorkflowOnly != nil {
		enc.AddBool("childWorkflowOnly", *v.ChildWorkflowOnly)
	}
	return err
}

// GetDomain returns the value of Domain if it is set or its
// zero value if it is unset.
func (v *RequestCancelExternalWorkflowExecutionDecisionAttributes) GetDomain() (o string) {
	if v != nil && v.Domain != nil {
		return *v.Domain
	}

	return
}

// IsSetDomain returns true if Domain is not nil.
func (v *RequestCancelExternalWorkflowExecutionDecisionAttributes) IsSetDomain() bool {
	return v != nil && v.Domain != nil
}

// GetWorkflowId returns the value of WorkflowId if it is set or its
// zero value if it is unset.
func (v *RequestCancelExternalWorkflowExecutionDecisionAttributes) GetWorkflowId() (o string) {
	if v != nil && v.WorkflowId != nil {
		return *v.WorkflowId
	}

	return
}

// IsSetWorkflowId returns true if WorkflowId is not nil.
func (v *RequestCancelExternalWorkflowExecutionDecisionAttributes) IsSetWorkflowId() bool {
	return v != nil && v.WorkflowId != nil
}

// GetRunId returns the value of RunId if it is set or its
// zero value if it is unset.
func (v *RequestCancelExternalWorkflowExecutionDecisionAttributes) GetRunId() (o string) {
	if v != nil && v.RunId != nil {
		return *v.RunId
	}

	return
}

// IsSetRunId returns true if RunId is not nil.
func (v *RequestCancelExternalWorkflowExecutionDecisionAttributes) IsSetRunId() bool {
	return v != nil && v.RunId != nil
}

// GetControl returns the value of Control if it is set or its
// zero value if it is unset.
func (v *RequestCancelExternalWorkflowExecutionDecisionAttributes) GetControl() (o []byte) {
	if v != nil && v.Control != nil {
		return v.Control
	}

	return
}

// IsSetControl returns true if Control is not nil.
func (v *RequestCancelExternalWorkflowExecutionDecisionAttributes) IsSetControl() bool {
	return v != nil && v.Control != nil
}

// GetChildWorkflowOnly returns the value of ChildWorkflowOnly if it is set or its
// zero value if it is unset.
func (v *RequestCancelExternalWorkflowExecutionDecisionAttributes) GetChildWorkflowOnly() (o bool) {
	if v != nil && v.ChildWorkflowOnly != nil {
		return *v.ChildWorkflowOnly
	}

	return
}

// IsSetChildWorkflowOnly returns true if ChildWorkflowOnly is not nil.
func (v *RequestCancelExternalWorkflowExecutionDecisionAttributes) IsSetChildWorkflowOnly() bool {
	return v != nil && v.ChildWorkflowOnly != nil
}

type RequestCancelExternalWorkflowExecutionFailedEventAttributes struct {
	Cause                        *CancelExternalWorkflowExecutionFailedCause `json:"cause,omitempty"`
	DecisionTaskCompletedEventId *int64                                      `json:"decisionTaskCompletedEventId,omitempty"`
	Domain                       *string                                     `json:"domain,omitempty"`
	WorkflowExecution            *WorkflowExecution                          `json:"workflowExecution,omitempty"`
	InitiatedEventId             *int64                                      `json:"initiatedEventId,omitempty"`
	Control                      []byte                                      `json:"control,omitempty"`
}

// ToWire translates a RequestCancelExternalWorkflowExecutionFailedEventAttributes 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 *RequestCancelExternalWorkflowExecutionFailedEventAttributes) ToWire() (wire.Value, error) {
	var (
		fields [6]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.Cause != nil {
		w, err = v.Cause.ToWire()
		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++
	}
	if v.Domain != nil {
		w, err = wire.NewValueString(*(v.Domain)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.WorkflowExecution != nil {
		w, err = v.WorkflowExecution.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 40, Value: w}
		i++
	}
	if v.InitiatedEventId != nil {
		w, err = wire.NewValueI64(*(v.InitiatedEventId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 50, Value: w}
		i++
	}
	if v.Control != nil {
		w, err = wire.NewValueBinary(v.Control), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 60, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

func _CancelExternalWorkflowExecutionFailedCause_Read(w wire.Value) (CancelExternalWorkflowExecutionFailedCause, error) {
	var v CancelExternalWorkflowExecutionFailedCause
	err := v.FromWire(w)
	return v, err
}

// FromWire deserializes a RequestCancelExternalWorkflowExecutionFailedEventAttributes 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 RequestCancelExternalWorkflowExecutionFailedEventAttributes struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v RequestCancelExternalWorkflowExecutionFailedEventAttributes
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *RequestCancelExternalWorkflowExecutionFailedEventAttributes) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			if field.Value.Type() == wire.TI32 {
				var x CancelExternalWorkflowExecutionFailedCause
				x, err = _CancelExternalWorkflowExecutionFailedCause_Read(field.Value)
				v.Cause = &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
				}

			}
		case 30:
			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 40:
			if field.Value.Type() == wire.TStruct {
				v.WorkflowExecution, err = _WorkflowExecution_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.InitiatedEventId = &x
				if err != nil {
					return err
				}

			}
		case 60:
			if field.Value.Type() == wire.TBinary {
				v.Control, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a RequestCancelExternalWorkflowExecutionFailedEventAttributes
// struct.
func (v *RequestCancelExternalWorkflowExecutionFailedEventAttributes) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [6]string
	i := 0
	if v.Cause != nil {
		fields[i] = fmt.Sprintf("Cause: %v", *(v.Cause))
		i++
	}
	if v.DecisionTaskCompletedEventId != nil {
		fields[i] = fmt.Sprintf("DecisionTaskCompletedEventId: %v", *(v.DecisionTaskCompletedEventId))
		i++
	}
	if v.Domain != nil {
		fields[i] = fmt.Sprintf("Domain: %v", *(v.Domain))
		i++
	}
	if v.WorkflowExecution != nil {
		fields[i] = fmt.Sprintf("WorkflowExecution: %v", v.WorkflowExecution)
		i++
	}
	if v.InitiatedEventId != nil {
		fields[i] = fmt.Sprintf("InitiatedEventId: %v", *(v.InitiatedEventId))
		i++
	}
	if v.Control != nil {
		fields[i] = fmt.Sprintf("Control: %v", v.Control)
		i++
	}

	return fmt.Sprintf("RequestCancelExternalWorkflowExecutionFailedEventAttributes{%v}", strings.Join(fields[:i], ", "))
}

func _CancelExternalWorkflowExecutionFailedCause_EqualsPtr(lhs, rhs *CancelExternalWorkflowExecutionFailedCause) bool {
	if lhs != nil && rhs != nil {

		x := *lhs
		y := *rhs
		return x.Equals(y)
	}
	return lhs == nil && rhs == nil
}

// Equals returns true if all the fields of this RequestCancelExternalWorkflowExecutionFailedEventAttributes match the
// provided RequestCancelExternalWorkflowExecutionFailedEventAttributes.
//
// This function performs a deep comparison.
func (v *RequestCancelExternalWorkflowExecutionFailedEventAttributes) Equals(rhs *RequestCancelExternalWorkflowExecutionFailedEventAttributes) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_CancelExternalWorkflowExecutionFailedCause_EqualsPtr(v.Cause, rhs.Cause) {
		return false
	}
	if !_I64_EqualsPtr(v.DecisionTaskCompletedEventId, rhs.DecisionTaskCompletedEventId) {
		return false
	}
	if !_String_EqualsPtr(v.Domain, rhs.Domain) {
		return false
	}
	if !((v.WorkflowExecution == nil && rhs.WorkflowExecution == nil) || (v.WorkflowExecution != nil && rhs.WorkflowExecution != nil && v.WorkflowExecution.Equals(rhs.WorkflowExecution))) {
		return false
	}
	if !_I64_EqualsPtr(v.InitiatedEventId, rhs.InitiatedEventId) {
		return false
	}
	if !((v.Control == nil && rhs.Control == nil) || (v.Control != nil && rhs.Control != nil && bytes.Equal(v.Control, rhs.Control))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of RequestCancelExternalWorkflowExecutionFailedEventAttributes.
func (v *RequestCancelExternalWorkflowExecutionFailedEventAttributes) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Cause != nil {
		err = multierr.Append(err, enc.AddObject("cause", *v.Cause))
	}
	if v.DecisionTaskCompletedEventId != nil {
		enc.AddInt64("decisionTaskCompletedEventId", *v.DecisionTaskCompletedEventId)
	}
	if v.Domain != nil {
		enc.AddString("domain", *v.Domain)
	}
	if v.WorkflowExecution != nil {
		err = multierr.Append(err, enc.AddObject("workflowExecution", v.WorkflowExecution))
	}
	if v.InitiatedEventId != nil {
		enc.AddInt64("initiatedEventId", *v.InitiatedEventId)
	}
	if v.Control != nil {
		enc.AddString("control", base64.StdEncoding.EncodeToString(v.Control))
	}
	return err
}

// GetCause returns the value of Cause if it is set or its
// zero value if it is unset.
func (v *RequestCancelExternalWorkflowExecutionFailedEventAttributes) GetCause() (o CancelExternalWorkflowExecutionFailedCause) {
	if v != nil && v.Cause != nil {
		return *v.Cause
	}

	return
}

// IsSetCause returns true if Cause is not nil.
func (v *RequestCancelExternalWorkflowExecutionFailedEventAttributes) IsSetCause() bool {
	return v != nil && v.Cause != nil
}

// GetDecisionTaskCompletedEventId returns the value of DecisionTaskCompletedEventId if it is set or its
// zero value if it is unset.
func (v *RequestCancelExternalWorkflowExecutionFailedEventAttributes) GetDecisionTaskCompletedEventId() (o int64) {
	if v != nil && v.DecisionTaskCompletedEventId != nil {
		return *v.DecisionTaskCompletedEventId
	}

	return
}

// IsSetDecisionTaskCompletedEventId returns true if DecisionTaskCompletedEventId is not nil.
func (v *RequestCancelExternalWorkflowExecutionFailedEventAttributes) IsSetDecisionTaskCompletedEventId() bool {
	return v != nil && v.DecisionTaskCompletedEventId != nil
}

// GetDomain returns the value of Domain if it is set or its
// zero value if it is unset.
func (v *RequestCancelExternalWorkflowExecutionFailedEventAttributes) GetDomain() (o string) {
	if v != nil && v.Domain != nil {
		return *v.Domain
	}

	return
}

// IsSetDomain returns true if Domain is not nil.
func (v *RequestCancelExternalWorkflowExecutionFailedEventAttributes) IsSetDomain() bool {
	return v != nil && v.Domain != nil
}

// GetWorkflowExecution returns the value of WorkflowExecution if it is set or its
// zero value if it is unset.
func (v *RequestCancelExternalWorkflowExecutionFailedEventAttributes) GetWorkflowExecution() (o *WorkflowExecution) {
	if v != nil && v.WorkflowExecution != nil {
		return v.WorkflowExecution
	}

	return
}

// IsSetWorkflowExecution returns true if WorkflowExecution is not nil.
func (v *RequestCancelExternalWorkflowExecutionFailedEventAttributes) IsSetWorkflowExecution() bool {
	return v != nil && v.WorkflowExecution != nil
}

// GetInitiatedEventId returns the value of InitiatedEventId if it is set or its
// zero value if it is unset.
func (v *RequestCancelExternalWorkflowExecutionFailedEventAttributes) GetInitiatedEventId() (o int64) {
	if v != nil && v.InitiatedEventId != nil {
		return *v.InitiatedEventId
	}

	return
}

// IsSetInitiatedEventId returns true if InitiatedEventId is not nil.
func (v *RequestCancelExternalWorkflowExecutionFailedEventAttributes) IsSetInitiatedEventId() bool {
	return v != nil && v.InitiatedEventId != nil
}

// GetControl returns the value of Control if it is set or its
// zero value if it is unset.
func (v *RequestCancelExternalWorkflowExecutionFailedEventAttributes) GetControl() (o []byte) {
	if v != nil && v.Control != nil {
		return v.Control
	}

	return
}

// IsSetControl returns true if Control is not nil.
func (v *RequestCancelExternalWorkflowExecutionFailedEventAttributes) IsSetControl() bool {
	return v != nil && v.Control != nil
}

type RequestCancelExternalWorkflowExecutionInitiatedEventAttributes struct {
	DecisionTaskCompletedEventId *int64             `json:"decisionTaskCompletedEventId,omitempty"`
	Domain                       *string            `json:"domain,omitempty"`
	WorkflowExecution            *WorkflowExecution `json:"workflowExecution,omitempty"`
	Control                      []byte             `json:"control,omitempty"`
	ChildWorkflowOnly            *bool              `json:"childWorkflowOnly,omitempty"`
}

// ToWire translates a RequestCancelExternalWorkflowExecutionInitiatedEventAttributes 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 *RequestCancelExternalWorkflowExecutionInitiatedEventAttributes) ToWire() (wire.Value, error) {
	var (
		fields [5]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.DecisionTaskCompletedEventId != nil {
		w, err = wire.NewValueI64(*(v.DecisionTaskCompletedEventId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.Domain != nil {
		w, err = wire.NewValueString(*(v.Domain)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.WorkflowExecution != nil {
		w, err = v.WorkflowExecution.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.Control != nil {
		w, err = wire.NewValueBinary(v.Control), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 40, Value: w}
		i++
	}
	if v.ChildWorkflowOnly != nil {
		w, err = wire.NewValueBool(*(v.ChildWorkflowOnly)), 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
}

// FromWire deserializes a RequestCancelExternalWorkflowExecutionInitiatedEventAttributes 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 RequestCancelExternalWorkflowExecutionInitiatedEventAttributes struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *RequestCancelExternalWorkflowExecutionInitiatedEventAttributes) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			if field.Value.Type() == wire.TI64 {
				var x int64
				x, err = field.Value.GetI64(), error(nil)
				v.DecisionTaskCompletedEventId = &x
				if err != nil {
					return err
				}

			}
		case 20:
			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 30:
			if field.Value.Type() == wire.TStruct {
				v.WorkflowExecution, err = _WorkflowExecution_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 40:
			if field.Value.Type() == wire.TBinary {
				v.Control, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		case 50:
			if field.Value.Type() == wire.TBool {
				var x bool
				x, err = field.Value.GetBool(), error(nil)
				v.ChildWorkflowOnly = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a RequestCancelExternalWorkflowExecutionInitiatedEventAttributes
// struct.
func (v *RequestCancelExternalWorkflowExecutionInitiatedEventAttributes) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [5]string
	i := 0
	if v.DecisionTaskCompletedEventId != nil {
		fields[i] = fmt.Sprintf("DecisionTaskCompletedEventId: %v", *(v.DecisionTaskCompletedEventId))
		i++
	}
	if v.Domain != nil {
		fields[i] = fmt.Sprintf("Domain: %v", *(v.Domain))
		i++
	}
	if v.WorkflowExecution != nil {
		fields[i] = fmt.Sprintf("WorkflowExecution: %v", v.WorkflowExecution)
		i++
	}
	if v.Control != nil {
		fields[i] = fmt.Sprintf("Control: %v", v.Control)
		i++
	}
	if v.ChildWorkflowOnly != nil {
		fields[i] = fmt.Sprintf("ChildWorkflowOnly: %v", *(v.ChildWorkflowOnly))
		i++
	}

	return fmt.Sprintf("RequestCancelExternalWorkflowExecutionInitiatedEventAttributes{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this RequestCancelExternalWorkflowExecutionInitiatedEventAttributes match the
// provided RequestCancelExternalWorkflowExecutionInitiatedEventAttributes.
//
// This function performs a deep comparison.
func (v *RequestCancelExternalWorkflowExecutionInitiatedEventAttributes) Equals(rhs *RequestCancelExternalWorkflowExecutionInitiatedEventAttributes) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_I64_EqualsPtr(v.DecisionTaskCompletedEventId, rhs.DecisionTaskCompletedEventId) {
		return false
	}
	if !_String_EqualsPtr(v.Domain, rhs.Domain) {
		return false
	}
	if !((v.WorkflowExecution == nil && rhs.WorkflowExecution == nil) || (v.WorkflowExecution != nil && rhs.WorkflowExecution != nil && v.WorkflowExecution.Equals(rhs.WorkflowExecution))) {
		return false
	}
	if !((v.Control == nil && rhs.Control == nil) || (v.Control != nil && rhs.Control != nil && bytes.Equal(v.Control, rhs.Control))) {
		return false
	}
	if !_Bool_EqualsPtr(v.ChildWorkflowOnly, rhs.ChildWorkflowOnly) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of RequestCancelExternalWorkflowExecutionInitiatedEventAttributes.
func (v *RequestCancelExternalWorkflowExecutionInitiatedEventAttributes) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.DecisionTaskCompletedEventId != nil {
		enc.AddInt64("decisionTaskCompletedEventId", *v.DecisionTaskCompletedEventId)
	}
	if v.Domain != nil {
		enc.AddString("domain", *v.Domain)
	}
	if v.WorkflowExecution != nil {
		err = multierr.Append(err, enc.AddObject("workflowExecution", v.WorkflowExecution))
	}
	if v.Control != nil {
		enc.AddString("control", base64.StdEncoding.EncodeToString(v.Control))
	}
	if v.ChildWorkflowOnly != nil {
		enc.AddBool("childWorkflowOnly", *v.ChildWorkflowOnly)
	}
	return err
}

// GetDecisionTaskCompletedEventId returns the value of DecisionTaskCompletedEventId if it is set or its
// zero value if it is unset.
func (v *RequestCancelExternalWorkflowExecutionInitiatedEventAttributes) GetDecisionTaskCompletedEventId() (o int64) {
	if v != nil && v.DecisionTaskCompletedEventId != nil {
		return *v.DecisionTaskCompletedEventId
	}

	return
}

// IsSetDecisionTaskCompletedEventId returns true if DecisionTaskCompletedEventId is not nil.
func (v *RequestCancelExternalWorkflowExecutionInitiatedEventAttributes) IsSetDecisionTaskCompletedEventId() bool {
	return v != nil && v.DecisionTaskCompletedEventId != nil
}

// GetDomain returns the value of Domain if it is set or its
// zero value if it is unset.
func (v *RequestCancelExternalWorkflowExecutionInitiatedEventAttributes) GetDomain() (o string) {
	if v != nil && v.Domain != nil {
		return *v.Domain
	}

	return
}

// IsSetDomain returns true if Domain is not nil.
func (v *RequestCancelExternalWorkflowExecutionInitiatedEventAttributes) IsSetDomain() bool {
	return v != nil && v.Domain != nil
}

// GetWorkflowExecution returns the value of WorkflowExecution if it is set or its
// zero value if it is unset.
func (v *RequestCancelExternalWorkflowExecutionInitiatedEventAttributes) GetWorkflowExecution() (o *WorkflowExecution) {
	if v != nil && v.WorkflowExecution != nil {
		return v.WorkflowExecution
	}

	return
}

// IsSetWorkflowExecution returns true if WorkflowExecution is not nil.
func (v *RequestCancelExternalWorkflowExecutionInitiatedEventAttributes) IsSetWorkflowExecution() bool {
	return v != nil && v.WorkflowExecution != nil
}

// GetControl returns the value of Control if it is set or its
// zero value if it is unset.
func (v *RequestCancelExternalWorkflowExecutionInitiatedEventAttributes) GetControl() (o []byte) {
	if v != nil && v.Control != nil {
		return v.Control
	}

	return
}

// IsSetControl returns true if Control is not nil.
func (v *RequestCancelExternalWorkflowExecutionInitiatedEventAttributes) IsSetControl() bool {
	return v != nil && v.Control != nil
}

// GetChildWorkflowOnly returns the value of ChildWorkflowOnly if it is set or its
// zero value if it is unset.
func (v *RequestCancelExternalWorkflowExecutionInitiatedEventAttributes) GetChildWorkflowOnly() (o bool) {
	if v != nil && v.ChildWorkflowOnly != nil {
		return *v.ChildWorkflowOnly
	}

	return
}

// IsSetChildWorkflowOnly returns true if ChildWorkflowOnly is not nil.
func (v *RequestCancelExternalWorkflowExecutionInitiatedEventAttributes) IsSetChildWorkflowOnly() bool {
	return v != nil && v.ChildWorkflowOnly != nil
}

type RequestCancelWorkflowExecutionRequest struct {
	Domain              *string            `json:"domain,omitempty"`
	WorkflowExecution   *WorkflowExecution `json:"workflowExecution,omitempty"`
	Identity            *string            `json:"identity,omitempty"`
	RequestId           *string            `json:"requestId,omitempty"`
	Cause               *string            `json:"cause,omitempty"`
	FirstExecutionRunID *string            `json:"firstExecutionRunID,omitempty"`
}

// ToWire translates a RequestCancelWorkflowExecutionRequest 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 *RequestCancelWorkflowExecutionRequest) ToWire() (wire.Value, error) {
	var (
		fields [6]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.WorkflowExecution != nil {
		w, err = v.WorkflowExecution.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, 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: 30, Value: w}
		i++
	}
	if v.RequestId != nil {
		w, err = wire.NewValueString(*(v.RequestId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 40, Value: w}
		i++
	}
	if v.Cause != nil {
		w, err = wire.NewValueString(*(v.Cause)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 50, Value: w}
		i++
	}
	if v.FirstExecutionRunID != nil {
		w, err = wire.NewValueString(*(v.FirstExecutionRunID)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 60, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

// FromWire deserializes a RequestCancelWorkflowExecutionRequest 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 RequestCancelWorkflowExecutionRequest struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v RequestCancelWorkflowExecutionRequest
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *RequestCancelWorkflowExecutionRequest) 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.WorkflowExecution, 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.Identity = &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.RequestId = &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.Cause = &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.FirstExecutionRunID = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a RequestCancelWorkflowExecutionRequest
// struct.
func (v *RequestCancelWorkflowExecutionRequest) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [6]string
	i := 0
	if v.Domain != nil {
		fields[i] = fmt.Sprintf("Domain: %v", *(v.Domain))
		i++
	}
	if v.WorkflowExecution != nil {
		fields[i] = fmt.Sprintf("WorkflowExecution: %v", v.WorkflowExecution)
		i++
	}
	if v.Identity != nil {
		fields[i] = fmt.Sprintf("Identity: %v", *(v.Identity))
		i++
	}
	if v.RequestId != nil {
		fields[i] = fmt.Sprintf("RequestId: %v", *(v.RequestId))
		i++
	}
	if v.Cause != nil {
		fields[i] = fmt.Sprintf("Cause: %v", *(v.Cause))
		i++
	}
	if v.FirstExecutionRunID != nil {
		fields[i] = fmt.Sprintf("FirstExecutionRunID: %v", *(v.FirstExecutionRunID))
		i++
	}

	return fmt.Sprintf("RequestCancelWorkflowExecutionRequest{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this RequestCancelWorkflowExecutionRequest match the
// provided RequestCancelWorkflowExecutionRequest.
//
// This function performs a deep comparison.
func (v *RequestCancelWorkflowExecutionRequest) Equals(rhs *RequestCancelWorkflowExecutionRequest) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.Domain, rhs.Domain) {
		return false
	}
	if !((v.WorkflowExecution == nil && rhs.WorkflowExecution == nil) || (v.WorkflowExecution != nil && rhs.WorkflowExecution != nil && v.WorkflowExecution.Equals(rhs.WorkflowExecution))) {
		return false
	}
	if !_String_EqualsPtr(v.Identity, rhs.Identity) {
		return false
	}
	if !_String_EqualsPtr(v.RequestId, rhs.RequestId) {
		return false
	}
	if !_String_EqualsPtr(v.Cause, rhs.Cause) {
		return false
	}
	if !_String_EqualsPtr(v.FirstExecutionRunID, rhs.FirstExecutionRunID) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of RequestCancelWorkflowExecutionRequest.
func (v *RequestCancelWorkflowExecutionRequest) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Domain != nil {
		enc.AddString("domain", *v.Domain)
	}
	if v.WorkflowExecution != nil {
		err = multierr.Append(err, enc.AddObject("workflowExecution", v.WorkflowExecution))
	}
	if v.Identity != nil {
		enc.AddString("identity", *v.Identity)
	}
	if v.RequestId != nil {
		enc.AddString("requestId", *v.RequestId)
	}
	if v.Cause != nil {
		enc.AddString("cause", *v.Cause)
	}
	if v.FirstExecutionRunID != nil {
		enc.AddString("firstExecutionRunID", *v.FirstExecutionRunID)
	}
	return err
}

// GetDomain returns the value of Domain if it is set or its
// zero value if it is unset.
func (v *RequestCancelWorkflowExecutionRequest) GetDomain() (o string) {
	if v != nil && v.Domain != nil {
		return *v.Domain
	}

	return
}

// IsSetDomain returns true if Domain is not nil.
func (v *RequestCancelWorkflowExecutionRequest) IsSetDomain() bool {
	return v != nil && v.Domain != nil
}

// GetWorkflowExecution returns the value of WorkflowExecution if it is set or its
// zero value if it is unset.
func (v *RequestCancelWorkflowExecutionRequest) GetWorkflowExecution() (o *WorkflowExecution) {
	if v != nil && v.WorkflowExecution != nil {
		return v.WorkflowExecution
	}

	return
}

// IsSetWorkflowExecution returns true if WorkflowExecution is not nil.
func (v *RequestCancelWorkflowExecutionRequest) IsSetWorkflowExecution() bool {
	return v != nil && v.WorkflowExecution != nil
}

// GetIdentity returns the value of Identity if it is set or its
// zero value if it is unset.
func (v *RequestCancelWorkflowExecutionRequest) GetIdentity() (o string) {
	if v != nil && v.Identity != nil {
		return *v.Identity
	}

	return
}

// IsSetIdentity returns true if Identity is not nil.
func (v *RequestCancelWorkflowExecutionRequest) IsSetIdentity() bool {
	return v != nil && v.Identity != nil
}

// GetRequestId returns the value of RequestId if it is set or its
// zero value if it is unset.
func (v *RequestCancelWorkflowExecutionRequest) GetRequestId() (o string) {
	if v != nil && v.RequestId != nil {
		return *v.RequestId
	}

	return
}

// IsSetRequestId returns true if RequestId is not nil.
func (v *RequestCancelWorkflowExecutionRequest) IsSetRequestId() bool {
	return v != nil && v.RequestId != nil
}

// GetCause returns the value of Cause if it is set or its
// zero value if it is unset.
func (v *RequestCancelWorkflowExecutionRequest) GetCause() (o string) {
	if v != nil && v.Cause != nil {
		return *v.Cause
	}

	return
}

// IsSetCause returns true if Cause is not nil.
func (v *RequestCancelWorkflowExecutionRequest) IsSetCause() bool {
	return v != nil && v.Cause != nil
}

// GetFirstExecutionRunID returns the value of FirstExecutionRunID if it is set or its
// zero value if it is unset.
func (v *RequestCancelWorkflowExecutionRequest) GetFirstExecutionRunID() (o string) {
	if v != nil && v.FirstExecutionRunID != nil {
		return *v.FirstExecutionRunID
	}

	return
}

// IsSetFirstExecutionRunID returns true if FirstExecutionRunID is not nil.
func (v *RequestCancelWorkflowExecutionRequest) IsSetFirstExecutionRunID() bool {
	return v != nil && v.FirstExecutionRunID != nil
}

type ResetPointInfo struct {
	BinaryChecksum           *string `json:"binaryChecksum,omitempty"`
	RunId                    *string `json:"runId,omitempty"`
	FirstDecisionCompletedId *int64  `json:"firstDecisionCompletedId,omitempty"`
	CreatedTimeNano          *int64  `json:"createdTimeNano,omitempty"`
	ExpiringTimeNano         *int64  `json:"expiringTimeNano,omitempty"`
	Resettable               *bool   `json:"resettable,omitempty"`
}

// ToWire translates a ResetPointInfo 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 *ResetPointInfo) ToWire() (wire.Value, error) {
	var (
		fields [6]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.BinaryChecksum != nil {
		w, err = wire.NewValueString(*(v.BinaryChecksum)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.RunId != nil {
		w, err = wire.NewValueString(*(v.RunId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.FirstDecisionCompletedId != nil {
		w, err = wire.NewValueI64(*(v.FirstDecisionCompletedId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.CreatedTimeNano != nil {
		w, err = wire.NewValueI64(*(v.CreatedTimeNano)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 40, Value: w}
		i++
	}
	if v.ExpiringTimeNano != nil {
		w, err = wire.NewValueI64(*(v.ExpiringTimeNano)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 50, Value: w}
		i++
	}
	if v.Resettable != nil {
		w, err = wire.NewValueBool(*(v.Resettable)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 60, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

// FromWire deserializes a ResetPointInfo 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 ResetPointInfo struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v ResetPointInfo
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *ResetPointInfo) 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.BinaryChecksum = &x
				if err != nil {
					return err
				}

			}
		case 20:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.RunId = &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.FirstDecisionCompletedId = &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.CreatedTimeNano = &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.ExpiringTimeNano = &x
				if err != nil {
					return err
				}

			}
		case 60:
			if field.Value.Type() == wire.TBool {
				var x bool
				x, err = field.Value.GetBool(), error(nil)
				v.Resettable = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a ResetPointInfo
// struct.
func (v *ResetPointInfo) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [6]string
	i := 0
	if v.BinaryChecksum != nil {
		fields[i] = fmt.Sprintf("BinaryChecksum: %v", *(v.BinaryChecksum))
		i++
	}
	if v.RunId != nil {
		fields[i] = fmt.Sprintf("RunId: %v", *(v.RunId))
		i++
	}
	if v.FirstDecisionCompletedId != nil {
		fields[i] = fmt.Sprintf("FirstDecisionCompletedId: %v", *(v.FirstDecisionCompletedId))
		i++
	}
	if v.CreatedTimeNano != nil {
		fields[i] = fmt.Sprintf("CreatedTimeNano: %v", *(v.CreatedTimeNano))
		i++
	}
	if v.ExpiringTimeNano != nil {
		fields[i] = fmt.Sprintf("ExpiringTimeNano: %v", *(v.ExpiringTimeNano))
		i++
	}
	if v.Resettable != nil {
		fields[i] = fmt.Sprintf("Resettable: %v", *(v.Resettable))
		i++
	}

	return fmt.Sprintf("ResetPointInfo{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this ResetPointInfo match the
// provided ResetPointInfo.
//
// This function performs a deep comparison.
func (v *ResetPointInfo) Equals(rhs *ResetPointInfo) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.BinaryChecksum, rhs.BinaryChecksum) {
		return false
	}
	if !_String_EqualsPtr(v.RunId, rhs.RunId) {
		return false
	}
	if !_I64_EqualsPtr(v.FirstDecisionCompletedId, rhs.FirstDecisionCompletedId) {
		return false
	}
	if !_I64_EqualsPtr(v.CreatedTimeNano, rhs.CreatedTimeNano) {
		return false
	}
	if !_I64_EqualsPtr(v.ExpiringTimeNano, rhs.ExpiringTimeNano) {
		return false
	}
	if !_Bool_EqualsPtr(v.Resettable, rhs.Resettable) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of ResetPointInfo.
func (v *ResetPointInfo) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.BinaryChecksum != nil {
		enc.AddString("binaryChecksum", *v.BinaryChecksum)
	}
	if v.RunId != nil {
		enc.AddString("runId", *v.RunId)
	}
	if v.FirstDecisionCompletedId != nil {
		enc.AddInt64("firstDecisionCompletedId", *v.FirstDecisionCompletedId)
	}
	if v.CreatedTimeNano != nil {
		enc.AddInt64("createdTimeNano", *v.CreatedTimeNano)
	}
	if v.ExpiringTimeNano != nil {
		enc.AddInt64("expiringTimeNano", *v.ExpiringTimeNano)
	}
	if v.Resettable != nil {
		enc.AddBool("resettable", *v.Resettable)
	}
	return err
}

// GetBinaryChecksum returns the value of BinaryChecksum if it is set or its
// zero value if it is unset.
func (v *ResetPointInfo) GetBinaryChecksum() (o string) {
	if v != nil && v.BinaryChecksum != nil {
		return *v.BinaryChecksum
	}

	return
}

// IsSetBinaryChecksum returns true if BinaryChecksum is not nil.
func (v *ResetPointInfo) IsSetBinaryChecksum() bool {
	return v != nil && v.BinaryChecksum != nil
}

// GetRunId returns the value of RunId if it is set or its
// zero value if it is unset.
func (v *ResetPointInfo) GetRunId() (o string) {
	if v != nil && v.RunId != nil {
		return *v.RunId
	}

	return
}

// IsSetRunId returns true if RunId is not nil.
func (v *ResetPointInfo) IsSetRunId() bool {
	return v != nil && v.RunId != nil
}

// GetFirstDecisionCompletedId returns the value of FirstDecisionCompletedId if it is set or its
// zero value if it is unset.
func (v *ResetPointInfo) GetFirstDecisionCompletedId() (o int64) {
	if v != nil && v.FirstDecisionCompletedId != nil {
		return *v.FirstDecisionCompletedId
	}

	return
}

// IsSetFirstDecisionCompletedId returns true if FirstDecisionCompletedId is not nil.
func (v *ResetPointInfo) IsSetFirstDecisionCompletedId() bool {
	return v != nil && v.FirstDecisionCompletedId != nil
}

// GetCreatedTimeNano returns the value of CreatedTimeNano if it is set or its
// zero value if it is unset.
func (v *ResetPointInfo) GetCreatedTimeNano() (o int64) {
	if v != nil && v.CreatedTimeNano != nil {
		return *v.CreatedTimeNano
	}

	return
}

// IsSetCreatedTimeNano returns true if CreatedTimeNano is not nil.
func (v *ResetPointInfo) IsSetCreatedTimeNano() bool {
	return v != nil && v.CreatedTimeNano != nil
}

// GetExpiringTimeNano returns the value of ExpiringTimeNano if it is set or its
// zero value if it is unset.
func (v *ResetPointInfo) GetExpiringTimeNano() (o int64) {
	if v != nil && v.ExpiringTimeNano != nil {
		return *v.ExpiringTimeNano
	}

	return
}

// IsSetExpiringTimeNano returns true if ExpiringTimeNano is not nil.
func (v *ResetPointInfo) IsSetExpiringTimeNano() bool {
	return v != nil && v.ExpiringTimeNano != nil
}

// GetResettable returns the value of Resettable if it is set or its
// zero value if it is unset.
func (v *ResetPointInfo) GetResettable() (o bool) {
	if v != nil && v.Resettable != nil {
		return *v.Resettable
	}

	return
}

// IsSetResettable returns true if Resettable is not nil.
func (v *ResetPointInfo) IsSetResettable() bool {
	return v != nil && v.Resettable != nil
}

type ResetPoints struct {
	Points []*ResetPointInfo `json:"points,omitempty"`
}

type _List_ResetPointInfo_ValueList []*ResetPointInfo

func (v _List_ResetPointInfo_ValueList) ForEach(f func(wire.Value) error) error {
	for i, x := range v {
		if x == nil {
			return fmt.Errorf("invalid [%v]: value is nil", i)
		}
		w, err := x.ToWire()
		if err != nil {
			return err
		}
		err = f(w)
		if err != nil {
			return err
		}
	}
	return nil
}

func (v _List_ResetPointInfo_ValueList) Size() int {
	return len(v)
}

func (_List_ResetPointInfo_ValueList) ValueType() wire.Type {
	return wire.TStruct
}

func (_List_ResetPointInfo_ValueList) Close() {}

// ToWire translates a ResetPoints 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 *ResetPoints) ToWire() (wire.Value, error) {
	var (
		fields [1]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.Points != nil {
		w, err = wire.NewValueList(_List_ResetPointInfo_ValueList(v.Points)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

func _ResetPointInfo_Read(w wire.Value) (*ResetPointInfo, error) {
	var v ResetPointInfo
	err := v.FromWire(w)
	return &v, err
}

func _List_ResetPointInfo_Read(l wire.ValueList) ([]*ResetPointInfo, error) {
	if l.ValueType() != wire.TStruct {
		return nil, nil
	}

	o := make([]*ResetPointInfo, 0, l.Size())
	err := l.ForEach(func(x wire.Value) error {
		i, err := _ResetPointInfo_Read(x)
		if err != nil {
			return err
		}
		o = append(o, i)
		return nil
	})
	l.Close()
	return o, err
}

// FromWire deserializes a ResetPoints 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 ResetPoints struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v ResetPoints
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *ResetPoints) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			if field.Value.Type() == wire.TList {
				v.Points, err = _List_ResetPointInfo_Read(field.Value.GetList())
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a ResetPoints
// struct.
func (v *ResetPoints) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [1]string
	i := 0
	if v.Points != nil {
		fields[i] = fmt.Sprintf("Points: %v", v.Points)
		i++
	}

	return fmt.Sprintf("ResetPoints{%v}", strings.Join(fields[:i], ", "))
}

func _List_ResetPointInfo_Equals(lhs, rhs []*ResetPointInfo) bool {
	if len(lhs) != len(rhs) {
		return false
	}

	for i, lv := range lhs {
		rv := rhs[i]
		if !lv.Equals(rv) {
			return false
		}
	}

	return true
}

// Equals returns true if all the fields of this ResetPoints match the
// provided ResetPoints.
//
// This function performs a deep comparison.
func (v *ResetPoints) Equals(rhs *ResetPoints) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !((v.Points == nil && rhs.Points == nil) || (v.Points != nil && rhs.Points != nil && _List_ResetPointInfo_Equals(v.Points, rhs.Points))) {
		return false
	}

	return true
}

type _List_ResetPointInfo_Zapper []*ResetPointInfo

// MarshalLogArray implements zapcore.ArrayMarshaler, enabling
// fast logging of _List_ResetPointInfo_Zapper.
func (l _List_ResetPointInfo_Zapper) MarshalLogArray(enc zapcore.ArrayEncoder) (err error) {
	for _, v := range l {
		err = multierr.Append(err, enc.AppendObject(v))
	}
	return err
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of ResetPoints.
func (v *ResetPoints) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Points != nil {
		err = multierr.Append(err, enc.AddArray("points", (_List_ResetPointInfo_Zapper)(v.Points)))
	}
	return err
}

// GetPoints returns the value of Points if it is set or its
// zero value if it is unset.
func (v *ResetPoints) GetPoints() (o []*ResetPointInfo) {
	if v != nil && v.Points != nil {
		return v.Points
	}

	return
}

// IsSetPoints returns true if Points is not nil.
func (v *ResetPoints) IsSetPoints() bool {
	return v != nil && v.Points != nil
}

type ResetQueueRequest struct {
	ShardID     *int32  `json:"shardID,omitempty"`
	ClusterName *string `json:"clusterName,omitempty"`
	Type        *int32  `json:"type,omitempty"`
}

// ToWire translates a ResetQueueRequest 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 *ResetQueueRequest) ToWire() (wire.Value, error) {
	var (
		fields [3]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.ShardID != nil {
		w, err = wire.NewValueI32(*(v.ShardID)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.ClusterName != nil {
		w, err = wire.NewValueString(*(v.ClusterName)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.Type != nil {
		w, err = wire.NewValueI32(*(v.Type)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

// FromWire deserializes a ResetQueueRequest 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 ResetQueueRequest struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v ResetQueueRequest
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *ResetQueueRequest) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			if field.Value.Type() == wire.TI32 {
				var x int32
				x, err = field.Value.GetI32(), error(nil)
				v.ShardID = &x
				if err != nil {
					return err
				}

			}
		case 20:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.ClusterName = &x
				if err != nil {
					return err
				}

			}
		case 30:
			if field.Value.Type() == wire.TI32 {
				var x int32
				x, err = field.Value.GetI32(), error(nil)
				v.Type = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a ResetQueueRequest
// struct.
func (v *ResetQueueRequest) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [3]string
	i := 0
	if v.ShardID != nil {
		fields[i] = fmt.Sprintf("ShardID: %v", *(v.ShardID))
		i++
	}
	if v.ClusterName != nil {
		fields[i] = fmt.Sprintf("ClusterName: %v", *(v.ClusterName))
		i++
	}
	if v.Type != nil {
		fields[i] = fmt.Sprintf("Type: %v", *(v.Type))
		i++
	}

	return fmt.Sprintf("ResetQueueRequest{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this ResetQueueRequest match the
// provided ResetQueueRequest.
//
// This function performs a deep comparison.
func (v *ResetQueueRequest) Equals(rhs *ResetQueueRequest) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_I32_EqualsPtr(v.ShardID, rhs.ShardID) {
		return false
	}
	if !_String_EqualsPtr(v.ClusterName, rhs.ClusterName) {
		return false
	}
	if !_I32_EqualsPtr(v.Type, rhs.Type) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of ResetQueueRequest.
func (v *ResetQueueRequest) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.ShardID != nil {
		enc.AddInt32("shardID", *v.ShardID)
	}
	if v.ClusterName != nil {
		enc.AddString("clusterName", *v.ClusterName)
	}
	if v.Type != nil {
		enc.AddInt32("type", *v.Type)
	}
	return err
}

// GetShardID returns the value of ShardID if it is set or its
// zero value if it is unset.
func (v *ResetQueueRequest) GetShardID() (o int32) {
	if v != nil && v.ShardID != nil {
		return *v.ShardID
	}

	return
}

// IsSetShardID returns true if ShardID is not nil.
func (v *ResetQueueRequest) IsSetShardID() bool {
	return v != nil && v.ShardID != nil
}

// GetClusterName returns the value of ClusterName if it is set or its
// zero value if it is unset.
func (v *ResetQueueRequest) GetClusterName() (o string) {
	if v != nil && v.ClusterName != nil {
		return *v.ClusterName
	}

	return
}

// IsSetClusterName returns true if ClusterName is not nil.
func (v *ResetQueueRequest) IsSetClusterName() bool {
	return v != nil && v.ClusterName != nil
}

// GetType returns the value of Type if it is set or its
// zero value if it is unset.
func (v *ResetQueueRequest) GetType() (o int32) {
	if v != nil && v.Type != nil {
		return *v.Type
	}

	return
}

// IsSetType returns true if Type is not nil.
func (v *ResetQueueRequest) IsSetType() bool {
	return v != nil && v.Type != nil
}

type ResetStickyTaskListRequest struct {
	Domain    *string            `json:"domain,omitempty"`
	Execution *WorkflowExecution `json:"execution,omitempty"`
}

// ToWire translates a ResetStickyTaskListRequest 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 *ResetStickyTaskListRequest) 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.Execution != nil {
		w, err = v.Execution.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 ResetStickyTaskListRequest 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 ResetStickyTaskListRequest struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v ResetStickyTaskListRequest
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *ResetStickyTaskListRequest) 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.Execution, err = _WorkflowExecution_Read(field.Value)
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a ResetStickyTaskListRequest
// struct.
func (v *ResetStickyTaskListRequest) 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.Execution != nil {
		fields[i] = fmt.Sprintf("Execution: %v", v.Execution)
		i++
	}

	return fmt.Sprintf("ResetStickyTaskListRequest{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this ResetStickyTaskListRequest match the
// provided ResetStickyTaskListRequest.
//
// This function performs a deep comparison.
func (v *ResetStickyTaskListRequest) Equals(rhs *ResetStickyTaskListRequest) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.Domain, rhs.Domain) {
		return false
	}
	if !((v.Execution == nil && rhs.Execution == nil) || (v.Execution != nil && rhs.Execution != nil && v.Execution.Equals(rhs.Execution))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of ResetStickyTaskListRequest.
func (v *ResetStickyTaskListRequest) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Domain != nil {
		enc.AddString("domain", *v.Domain)
	}
	if v.Execution != nil {
		err = multierr.Append(err, enc.AddObject("execution", v.Execution))
	}
	return err
}

// GetDomain returns the value of Domain if it is set or its
// zero value if it is unset.
func (v *ResetStickyTaskListRequest) GetDomain() (o string) {
	if v != nil && v.Domain != nil {
		return *v.Domain
	}

	return
}

// IsSetDomain returns true if Domain is not nil.
func (v *ResetStickyTaskListRequest) IsSetDomain() bool {
	return v != nil && v.Domain != nil
}

// GetExecution returns the value of Execution if it is set or its
// zero value if it is unset.
func (v *ResetStickyTaskListRequest) GetExecution() (o *WorkflowExecution) {
	if v != nil && v.Execution != nil {
		return v.Execution
	}

	return
}

// IsSetExecution returns true if Execution is not nil.
func (v *ResetStickyTaskListRequest) IsSetExecution() bool {
	return v != nil && v.Execution != nil
}

type ResetStickyTaskListResponse struct {
}

// ToWire translates a ResetStickyTaskListResponse 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 *ResetStickyTaskListResponse) ToWire() (wire.Value, error) {
	var (
		fields [0]wire.Field
		i      int = 0
	)

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

// FromWire deserializes a ResetStickyTaskListResponse 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 ResetStickyTaskListResponse struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v ResetStickyTaskListResponse
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *ResetStickyTaskListResponse) FromWire(w wire.Value) error {

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		}
	}

	return nil
}

// String returns a readable string representation of a ResetStickyTaskListResponse
// struct.
func (v *ResetStickyTaskListResponse) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [0]string
	i := 0

	return fmt.Sprintf("ResetStickyTaskListResponse{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this ResetStickyTaskListResponse match the
// provided ResetStickyTaskListResponse.
//
// This function performs a deep comparison.
func (v *ResetStickyTaskListResponse) Equals(rhs *ResetStickyTaskListResponse) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of ResetStickyTaskListResponse.
func (v *ResetStickyTaskListResponse) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	return err
}

type ResetWorkflowExecutionRequest struct {
	Domain                *string            `json:"domain,omitempty"`
	WorkflowExecution     *WorkflowExecution `json:"workflowExecution,omitempty"`
	Reason                *string            `json:"reason,omitempty"`
	DecisionFinishEventId *int64             `json:"decisionFinishEventId,omitempty"`
	RequestId             *string            `json:"requestId,omitempty"`
	SkipSignalReapply     *bool              `json:"skipSignalReapply,omitempty"`
}

// ToWire translates a ResetWorkflowExecutionRequest 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 *ResetWorkflowExecutionRequest) ToWire() (wire.Value, error) {
	var (
		fields [6]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.WorkflowExecution != nil {
		w, err = v.WorkflowExecution.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.Reason != nil {
		w, err = wire.NewValueString(*(v.Reason)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.DecisionFinishEventId != nil {
		w, err = wire.NewValueI64(*(v.DecisionFinishEventId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 40, Value: w}
		i++
	}
	if v.RequestId != nil {
		w, err = wire.NewValueString(*(v.RequestId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 50, Value: w}
		i++
	}
	if v.SkipSignalReapply != nil {
		w, err = wire.NewValueBool(*(v.SkipSignalReapply)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 60, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

// FromWire deserializes a ResetWorkflowExecutionRequest 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 ResetWorkflowExecutionRequest struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v ResetWorkflowExecutionRequest
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *ResetWorkflowExecutionRequest) 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.WorkflowExecution, 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.Reason = &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.DecisionFinishEventId = &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.RequestId = &x
				if err != nil {
					return err
				}

			}
		case 60:
			if field.Value.Type() == wire.TBool {
				var x bool
				x, err = field.Value.GetBool(), error(nil)
				v.SkipSignalReapply = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a ResetWorkflowExecutionRequest
// struct.
func (v *ResetWorkflowExecutionRequest) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [6]string
	i := 0
	if v.Domain != nil {
		fields[i] = fmt.Sprintf("Domain: %v", *(v.Domain))
		i++
	}
	if v.WorkflowExecution != nil {
		fields[i] = fmt.Sprintf("WorkflowExecution: %v", v.WorkflowExecution)
		i++
	}
	if v.Reason != nil {
		fields[i] = fmt.Sprintf("Reason: %v", *(v.Reason))
		i++
	}
	if v.DecisionFinishEventId != nil {
		fields[i] = fmt.Sprintf("DecisionFinishEventId: %v", *(v.DecisionFinishEventId))
		i++
	}
	if v.RequestId != nil {
		fields[i] = fmt.Sprintf("RequestId: %v", *(v.RequestId))
		i++
	}
	if v.SkipSignalReapply != nil {
		fields[i] = fmt.Sprintf("SkipSignalReapply: %v", *(v.SkipSignalReapply))
		i++
	}

	return fmt.Sprintf("ResetWorkflowExecutionRequest{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this ResetWorkflowExecutionRequest match the
// provided ResetWorkflowExecutionRequest.
//
// This function performs a deep comparison.
func (v *ResetWorkflowExecutionRequest) Equals(rhs *ResetWorkflowExecutionRequest) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.Domain, rhs.Domain) {
		return false
	}
	if !((v.WorkflowExecution == nil && rhs.WorkflowExecution == nil) || (v.WorkflowExecution != nil && rhs.WorkflowExecution != nil && v.WorkflowExecution.Equals(rhs.WorkflowExecution))) {
		return false
	}
	if !_String_EqualsPtr(v.Reason, rhs.Reason) {
		return false
	}
	if !_I64_EqualsPtr(v.DecisionFinishEventId, rhs.DecisionFinishEventId) {
		return false
	}
	if !_String_EqualsPtr(v.RequestId, rhs.RequestId) {
		return false
	}
	if !_Bool_EqualsPtr(v.SkipSignalReapply, rhs.SkipSignalReapply) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of ResetWorkflowExecutionRequest.
func (v *ResetWorkflowExecutionRequest) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Domain != nil {
		enc.AddString("domain", *v.Domain)
	}
	if v.WorkflowExecution != nil {
		err = multierr.Append(err, enc.AddObject("workflowExecution", v.WorkflowExecution))
	}
	if v.Reason != nil {
		enc.AddString("reason", *v.Reason)
	}
	if v.DecisionFinishEventId != nil {
		enc.AddInt64("decisionFinishEventId", *v.DecisionFinishEventId)
	}
	if v.RequestId != nil {
		enc.AddString("requestId", *v.RequestId)
	}
	if v.SkipSignalReapply != nil {
		enc.AddBool("skipSignalReapply", *v.SkipSignalReapply)
	}
	return err
}

// GetDomain returns the value of Domain if it is set or its
// zero value if it is unset.
func (v *ResetWorkflowExecutionRequest) GetDomain() (o string) {
	if v != nil && v.Domain != nil {
		return *v.Domain
	}

	return
}

// IsSetDomain returns true if Domain is not nil.
func (v *ResetWorkflowExecutionRequest) IsSetDomain() bool {
	return v != nil && v.Domain != nil
}

// GetWorkflowExecution returns the value of WorkflowExecution if it is set or its
// zero value if it is unset.
func (v *ResetWorkflowExecutionRequest) GetWorkflowExecution() (o *WorkflowExecution) {
	if v != nil && v.WorkflowExecution != nil {
		return v.WorkflowExecution
	}

	return
}

// IsSetWorkflowExecution returns true if WorkflowExecution is not nil.
func (v *ResetWorkflowExecutionRequest) IsSetWorkflowExecution() bool {
	return v != nil && v.WorkflowExecution != nil
}

// GetReason returns the value of Reason if it is set or its
// zero value if it is unset.
func (v *ResetWorkflowExecutionRequest) GetReason() (o string) {
	if v != nil && v.Reason != nil {
		return *v.Reason
	}

	return
}

// IsSetReason returns true if Reason is not nil.
func (v *ResetWorkflowExecutionRequest) IsSetReason() bool {
	return v != nil && v.Reason != nil
}

// GetDecisionFinishEventId returns the value of DecisionFinishEventId if it is set or its
// zero value if it is unset.
func (v *ResetWorkflowExecutionRequest) GetDecisionFinishEventId() (o int64) {
	if v != nil && v.DecisionFinishEventId != nil {
		return *v.DecisionFinishEventId
	}

	return
}

// IsSetDecisionFinishEventId returns true if DecisionFinishEventId is not nil.
func (v *ResetWorkflowExecutionRequest) IsSetDecisionFinishEventId() bool {
	return v != nil && v.DecisionFinishEventId != nil
}

// GetRequestId returns the value of RequestId if it is set or its
// zero value if it is unset.
func (v *ResetWorkflowExecutionRequest) GetRequestId() (o string) {
	if v != nil && v.RequestId != nil {
		return *v.RequestId
	}

	return
}

// IsSetRequestId returns true if RequestId is not nil.
func (v *ResetWorkflowExecutionRequest) IsSetRequestId() bool {
	return v != nil && v.RequestId != nil
}

// GetSkipSignalReapply returns the value of SkipSignalReapply if it is set or its
// zero value if it is unset.
func (v *ResetWorkflowExecutionRequest) GetSkipSignalReapply() (o bool) {
	if v != nil && v.SkipSignalReapply != nil {
		return *v.SkipSignalReapply
	}

	return
}

// IsSetSkipSignalReapply returns true if SkipSignalReapply is not nil.
func (v *ResetWorkflowExecutionRequest) IsSetSkipSignalReapply() bool {
	return v != nil && v.SkipSignalReapply != nil
}

type ResetWorkflowExecutionResponse struct {
	RunId *string `json:"runId,omitempty"`
}

// ToWire translates a ResetWorkflowExecutionResponse 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 *ResetWorkflowExecutionResponse) ToWire() (wire.Value, error) {
	var (
		fields [1]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.RunId != nil {
		w, err = wire.NewValueString(*(v.RunId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

// FromWire deserializes a ResetWorkflowExecutionResponse 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 ResetWorkflowExecutionResponse struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v ResetWorkflowExecutionResponse
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *ResetWorkflowExecutionResponse) 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.RunId = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a ResetWorkflowExecutionResponse
// struct.
func (v *ResetWorkflowExecutionResponse) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [1]string
	i := 0
	if v.RunId != nil {
		fields[i] = fmt.Sprintf("RunId: %v", *(v.RunId))
		i++
	}

	return fmt.Sprintf("ResetWorkflowExecutionResponse{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this ResetWorkflowExecutionResponse match the
// provided ResetWorkflowExecutionResponse.
//
// This function performs a deep comparison.
func (v *ResetWorkflowExecutionResponse) Equals(rhs *ResetWorkflowExecutionResponse) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.RunId, rhs.RunId) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of ResetWorkflowExecutionResponse.
func (v *ResetWorkflowExecutionResponse) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.RunId != nil {
		enc.AddString("runId", *v.RunId)
	}
	return err
}

// GetRunId returns the value of RunId if it is set or its
// zero value if it is unset.
func (v *ResetWorkflowExecutionResponse) GetRunId() (o string) {
	if v != nil && v.RunId != nil {
		return *v.RunId
	}

	return
}

// IsSetRunId returns true if RunId is not nil.
func (v *ResetWorkflowExecutionResponse) IsSetRunId() bool {
	return v != nil && v.RunId != nil
}

type RespondActivityTaskCanceledByIDRequest struct {
	Domain     *string `json:"domain,omitempty"`
	WorkflowID *string `json:"workflowID,omitempty"`
	RunID      *string `json:"runID,omitempty"`
	ActivityID *string `json:"activityID,omitempty"`
	Details    []byte  `json:"details,omitempty"`
	Identity   *string `json:"identity,omitempty"`
}

// ToWire translates a RespondActivityTaskCanceledByIDRequest 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 *RespondActivityTaskCanceledByIDRequest) ToWire() (wire.Value, error) {
	var (
		fields [6]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.WorkflowID != nil {
		w, err = wire.NewValueString(*(v.WorkflowID)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.RunID != nil {
		w, err = wire.NewValueString(*(v.RunID)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.ActivityID != nil {
		w, err = wire.NewValueString(*(v.ActivityID)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 40, Value: w}
		i++
	}
	if v.Details != nil {
		w, err = wire.NewValueBinary(v.Details), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 50, 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: 60, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

// FromWire deserializes a RespondActivityTaskCanceledByIDRequest 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 RespondActivityTaskCanceledByIDRequest struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v RespondActivityTaskCanceledByIDRequest
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *RespondActivityTaskCanceledByIDRequest) 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.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.WorkflowID = &x
				if err != nil {
					return err
				}

			}
		case 30:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.RunID = &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.ActivityID = &x
				if err != nil {
					return err
				}

			}
		case 50:
			if field.Value.Type() == wire.TBinary {
				v.Details, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		case 60:
			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
}

// String returns a readable string representation of a RespondActivityTaskCanceledByIDRequest
// struct.
func (v *RespondActivityTaskCanceledByIDRequest) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [6]string
	i := 0
	if v.Domain != nil {
		fields[i] = fmt.Sprintf("Domain: %v", *(v.Domain))
		i++
	}
	if v.WorkflowID != nil {
		fields[i] = fmt.Sprintf("WorkflowID: %v", *(v.WorkflowID))
		i++
	}
	if v.RunID != nil {
		fields[i] = fmt.Sprintf("RunID: %v", *(v.RunID))
		i++
	}
	if v.ActivityID != nil {
		fields[i] = fmt.Sprintf("ActivityID: %v", *(v.ActivityID))
		i++
	}
	if v.Details != nil {
		fields[i] = fmt.Sprintf("Details: %v", v.Details)
		i++
	}
	if v.Identity != nil {
		fields[i] = fmt.Sprintf("Identity: %v", *(v.Identity))
		i++
	}

	return fmt.Sprintf("RespondActivityTaskCanceledByIDRequest{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this RespondActivityTaskCanceledByIDRequest match the
// provided RespondActivityTaskCanceledByIDRequest.
//
// This function performs a deep comparison.
func (v *RespondActivityTaskCanceledByIDRequest) Equals(rhs *RespondActivityTaskCanceledByIDRequest) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.Domain, rhs.Domain) {
		return false
	}
	if !_String_EqualsPtr(v.WorkflowID, rhs.WorkflowID) {
		return false
	}
	if !_String_EqualsPtr(v.RunID, rhs.RunID) {
		return false
	}
	if !_String_EqualsPtr(v.ActivityID, rhs.ActivityID) {
		return false
	}
	if !((v.Details == nil && rhs.Details == nil) || (v.Details != nil && rhs.Details != nil && bytes.Equal(v.Details, rhs.Details))) {
		return false
	}
	if !_String_EqualsPtr(v.Identity, rhs.Identity) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of RespondActivityTaskCanceledByIDRequest.
func (v *RespondActivityTaskCanceledByIDRequest) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Domain != nil {
		enc.AddString("domain", *v.Domain)
	}
	if v.WorkflowID != nil {
		enc.AddString("workflowID", *v.WorkflowID)
	}
	if v.RunID != nil {
		enc.AddString("runID", *v.RunID)
	}
	if v.ActivityID != nil {
		enc.AddString("activityID", *v.ActivityID)
	}
	if v.Details != nil {
		enc.AddString("details", base64.StdEncoding.EncodeToString(v.Details))
	}
	if v.Identity != nil {
		enc.AddString("identity", *v.Identity)
	}
	return err
}

// GetDomain returns the value of Domain if it is set or its
// zero value if it is unset.
func (v *RespondActivityTaskCanceledByIDRequest) GetDomain() (o string) {
	if v != nil && v.Domain != nil {
		return *v.Domain
	}

	return
}

// IsSetDomain returns true if Domain is not nil.
func (v *RespondActivityTaskCanceledByIDRequest) IsSetDomain() bool {
	return v != nil && v.Domain != nil
}

// GetWorkflowID returns the value of WorkflowID if it is set or its
// zero value if it is unset.
func (v *RespondActivityTaskCanceledByIDRequest) GetWorkflowID() (o string) {
	if v != nil && v.WorkflowID != nil {
		return *v.WorkflowID
	}

	return
}

// IsSetWorkflowID returns true if WorkflowID is not nil.
func (v *RespondActivityTaskCanceledByIDRequest) IsSetWorkflowID() bool {
	return v != nil && v.WorkflowID != nil
}

// GetRunID returns the value of RunID if it is set or its
// zero value if it is unset.
func (v *RespondActivityTaskCanceledByIDRequest) GetRunID() (o string) {
	if v != nil && v.RunID != nil {
		return *v.RunID
	}

	return
}

// IsSetRunID returns true if RunID is not nil.
func (v *RespondActivityTaskCanceledByIDRequest) IsSetRunID() bool {
	return v != nil && v.RunID != nil
}

// GetActivityID returns the value of ActivityID if it is set or its
// zero value if it is unset.
func (v *RespondActivityTaskCanceledByIDRequest) GetActivityID() (o string) {
	if v != nil && v.ActivityID != nil {
		return *v.ActivityID
	}

	return
}

// IsSetActivityID returns true if ActivityID is not nil.
func (v *RespondActivityTaskCanceledByIDRequest) IsSetActivityID() bool {
	return v != nil && v.ActivityID != nil
}

// GetDetails returns the value of Details if it is set or its
// zero value if it is unset.
func (v *RespondActivityTaskCanceledByIDRequest) GetDetails() (o []byte) {
	if v != nil && v.Details != nil {
		return v.Details
	}

	return
}

// IsSetDetails returns true if Details is not nil.
func (v *RespondActivityTaskCanceledByIDRequest) IsSetDetails() bool {
	return v != nil && v.Details != nil
}

// GetIdentity returns the value of Identity if it is set or its
// zero value if it is unset.
func (v *RespondActivityTaskCanceledByIDRequest) GetIdentity() (o string) {
	if v != nil && v.Identity != nil {
		return *v.Identity
	}

	return
}

// IsSetIdentity returns true if Identity is not nil.
func (v *RespondActivityTaskCanceledByIDRequest) IsSetIdentity() bool {
	return v != nil && v.Identity != nil
}

type RespondActivityTaskCanceledRequest struct {
	TaskToken []byte  `json:"taskToken,omitempty"`
	Details   []byte  `json:"details,omitempty"`
	Identity  *string `json:"identity,omitempty"`
}

// ToWire translates a RespondActivityTaskCanceledRequest 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 *RespondActivityTaskCanceledRequest) ToWire() (wire.Value, error) {
	var (
		fields [3]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.Details != nil {
		w, err = wire.NewValueBinary(v.Details), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, 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: 30, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

// FromWire deserializes a RespondActivityTaskCanceledRequest 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 RespondActivityTaskCanceledRequest struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v RespondActivityTaskCanceledRequest
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *RespondActivityTaskCanceledRequest) 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.TBinary {
				v.Details, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		case 30:
			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
}

// String returns a readable string representation of a RespondActivityTaskCanceledRequest
// struct.
func (v *RespondActivityTaskCanceledRequest) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [3]string
	i := 0
	if v.TaskToken != nil {
		fields[i] = fmt.Sprintf("TaskToken: %v", v.TaskToken)
		i++
	}
	if v.Details != nil {
		fields[i] = fmt.Sprintf("Details: %v", v.Details)
		i++
	}
	if v.Identity != nil {
		fields[i] = fmt.Sprintf("Identity: %v", *(v.Identity))
		i++
	}

	return fmt.Sprintf("RespondActivityTaskCanceledRequest{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this RespondActivityTaskCanceledRequest match the
// provided RespondActivityTaskCanceledRequest.
//
// This function performs a deep comparison.
func (v *RespondActivityTaskCanceledRequest) Equals(rhs *RespondActivityTaskCanceledRequest) 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.Details == nil && rhs.Details == nil) || (v.Details != nil && rhs.Details != nil && bytes.Equal(v.Details, rhs.Details))) {
		return false
	}
	if !_String_EqualsPtr(v.Identity, rhs.Identity) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of RespondActivityTaskCanceledRequest.
func (v *RespondActivityTaskCanceledRequest) 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.Details != nil {
		enc.AddString("details", base64.StdEncoding.EncodeToString(v.Details))
	}
	if v.Identity != nil {
		enc.AddString("identity", *v.Identity)
	}
	return err
}

// GetTaskToken returns the value of TaskToken if it is set or its
// zero value if it is unset.
func (v *RespondActivityTaskCanceledRequest) GetTaskToken() (o []byte) {
	if v != nil && v.TaskToken != nil {
		return v.TaskToken
	}

	return
}

// IsSetTaskToken returns true if TaskToken is not nil.
func (v *RespondActivityTaskCanceledRequest) IsSetTaskToken() bool {
	return v != nil && v.TaskToken != nil
}

// GetDetails returns the value of Details if it is set or its
// zero value if it is unset.
func (v *RespondActivityTaskCanceledRequest) GetDetails() (o []byte) {
	if v != nil && v.Details != nil {
		return v.Details
	}

	return
}

// IsSetDetails returns true if Details is not nil.
func (v *RespondActivityTaskCanceledRequest) IsSetDetails() bool {
	return v != nil && v.Details != nil
}

// GetIdentity returns the value of Identity if it is set or its
// zero value if it is unset.
func (v *RespondActivityTaskCanceledRequest) GetIdentity() (o string) {
	if v != nil && v.Identity != nil {
		return *v.Identity
	}

	return
}

// IsSetIdentity returns true if Identity is not nil.
func (v *RespondActivityTaskCanceledRequest) IsSetIdentity() bool {
	return v != nil && v.Identity != nil
}

type RespondActivityTaskCompletedByIDRequest struct {
	Domain     *string `json:"domain,omitempty"`
	WorkflowID *string `json:"workflowID,omitempty"`
	RunID      *string `json:"runID,omitempty"`
	ActivityID *string `json:"activityID,omitempty"`
	Result     []byte  `json:"result,omitempty"`
	Identity   *string `json:"identity,omitempty"`
}

// ToWire translates a RespondActivityTaskCompletedByIDRequest 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 *RespondActivityTaskCompletedByIDRequest) ToWire() (wire.Value, error) {
	var (
		fields [6]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.WorkflowID != nil {
		w, err = wire.NewValueString(*(v.WorkflowID)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.RunID != nil {
		w, err = wire.NewValueString(*(v.RunID)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.ActivityID != nil {
		w, err = wire.NewValueString(*(v.ActivityID)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 40, Value: w}
		i++
	}
	if v.Result != nil {
		w, err = wire.NewValueBinary(v.Result), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 50, 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: 60, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

// FromWire deserializes a RespondActivityTaskCompletedByIDRequest 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 RespondActivityTaskCompletedByIDRequest struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v RespondActivityTaskCompletedByIDRequest
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *RespondActivityTaskCompletedByIDRequest) 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.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.WorkflowID = &x
				if err != nil {
					return err
				}

			}
		case 30:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.RunID = &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.ActivityID = &x
				if err != nil {
					return err
				}

			}
		case 50:
			if field.Value.Type() == wire.TBinary {
				v.Result, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		case 60:
			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
}

// String returns a readable string representation of a RespondActivityTaskCompletedByIDRequest
// struct.
func (v *RespondActivityTaskCompletedByIDRequest) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [6]string
	i := 0
	if v.Domain != nil {
		fields[i] = fmt.Sprintf("Domain: %v", *(v.Domain))
		i++
	}
	if v.WorkflowID != nil {
		fields[i] = fmt.Sprintf("WorkflowID: %v", *(v.WorkflowID))
		i++
	}
	if v.RunID != nil {
		fields[i] = fmt.Sprintf("RunID: %v", *(v.RunID))
		i++
	}
	if v.ActivityID != nil {
		fields[i] = fmt.Sprintf("ActivityID: %v", *(v.ActivityID))
		i++
	}
	if v.Result != nil {
		fields[i] = fmt.Sprintf("Result: %v", v.Result)
		i++
	}
	if v.Identity != nil {
		fields[i] = fmt.Sprintf("Identity: %v", *(v.Identity))
		i++
	}

	return fmt.Sprintf("RespondActivityTaskCompletedByIDRequest{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this RespondActivityTaskCompletedByIDRequest match the
// provided RespondActivityTaskCompletedByIDRequest.
//
// This function performs a deep comparison.
func (v *RespondActivityTaskCompletedByIDRequest) Equals(rhs *RespondActivityTaskCompletedByIDRequest) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.Domain, rhs.Domain) {
		return false
	}
	if !_String_EqualsPtr(v.WorkflowID, rhs.WorkflowID) {
		return false
	}
	if !_String_EqualsPtr(v.RunID, rhs.RunID) {
		return false
	}
	if !_String_EqualsPtr(v.ActivityID, rhs.ActivityID) {
		return false
	}
	if !((v.Result == nil && rhs.Result == nil) || (v.Result != nil && rhs.Result != nil && bytes.Equal(v.Result, rhs.Result))) {
		return false
	}
	if !_String_EqualsPtr(v.Identity, rhs.Identity) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of RespondActivityTaskCompletedByIDRequest.
func (v *RespondActivityTaskCompletedByIDRequest) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Domain != nil {
		enc.AddString("domain", *v.Domain)
	}
	if v.WorkflowID != nil {
		enc.AddString("workflowID", *v.WorkflowID)
	}
	if v.RunID != nil {
		enc.AddString("runID", *v.RunID)
	}
	if v.ActivityID != nil {
		enc.AddString("activityID", *v.ActivityID)
	}
	if v.Result != nil {
		enc.AddString("result", base64.StdEncoding.EncodeToString(v.Result))
	}
	if v.Identity != nil {
		enc.AddString("identity", *v.Identity)
	}
	return err
}

// GetDomain returns the value of Domain if it is set or its
// zero value if it is unset.
func (v *RespondActivityTaskCompletedByIDRequest) GetDomain() (o string) {
	if v != nil && v.Domain != nil {
		return *v.Domain
	}

	return
}

// IsSetDomain returns true if Domain is not nil.
func (v *RespondActivityTaskCompletedByIDRequest) IsSetDomain() bool {
	return v != nil && v.Domain != nil
}

// GetWorkflowID returns the value of WorkflowID if it is set or its
// zero value if it is unset.
func (v *RespondActivityTaskCompletedByIDRequest) GetWorkflowID() (o string) {
	if v != nil && v.WorkflowID != nil {
		return *v.WorkflowID
	}

	return
}

// IsSetWorkflowID returns true if WorkflowID is not nil.
func (v *RespondActivityTaskCompletedByIDRequest) IsSetWorkflowID() bool {
	return v != nil && v.WorkflowID != nil
}

// GetRunID returns the value of RunID if it is set or its
// zero value if it is unset.
func (v *RespondActivityTaskCompletedByIDRequest) GetRunID() (o string) {
	if v != nil && v.RunID != nil {
		return *v.RunID
	}

	return
}

// IsSetRunID returns true if RunID is not nil.
func (v *RespondActivityTaskCompletedByIDRequest) IsSetRunID() bool {
	return v != nil && v.RunID != nil
}

// GetActivityID returns the value of ActivityID if it is set or its
// zero value if it is unset.
func (v *RespondActivityTaskCompletedByIDRequest) GetActivityID() (o string) {
	if v != nil && v.ActivityID != nil {
		return *v.ActivityID
	}

	return
}

// IsSetActivityID returns true if ActivityID is not nil.
func (v *RespondActivityTaskCompletedByIDRequest) IsSetActivityID() bool {
	return v != nil && v.ActivityID != nil
}

// GetResult returns the value of Result if it is set or its
// zero value if it is unset.
func (v *RespondActivityTaskCompletedByIDRequest) GetResult() (o []byte) {
	if v != nil && v.Result != nil {
		return v.Result
	}

	return
}

// IsSetResult returns true if Result is not nil.
func (v *RespondActivityTaskCompletedByIDRequest) IsSetResult() bool {
	return v != nil && v.Result != nil
}

// GetIdentity returns the value of Identity if it is set or its
// zero value if it is unset.
func (v *RespondActivityTaskCompletedByIDRequest) GetIdentity() (o string) {
	if v != nil && v.Identity != nil {
		return *v.Identity
	}

	return
}

// IsSetIdentity returns true if Identity is not nil.
func (v *RespondActivityTaskCompletedByIDRequest) IsSetIdentity() bool {
	return v != nil && v.Identity != nil
}

type RespondActivityTaskCompletedRequest struct {
	TaskToken []byte  `json:"taskToken,omitempty"`
	Result    []byte  `json:"result,omitempty"`
	Identity  *string `json:"identity,omitempty"`
}

// ToWire translates a RespondActivityTaskCompletedRequest 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 *RespondActivityTaskCompletedRequest) ToWire() (wire.Value, error) {
	var (
		fields [3]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.Result != nil {
		w, err = wire.NewValueBinary(v.Result), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, 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: 30, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

// FromWire deserializes a RespondActivityTaskCompletedRequest 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 RespondActivityTaskCompletedRequest struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v RespondActivityTaskCompletedRequest
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *RespondActivityTaskCompletedRequest) 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.TBinary {
				v.Result, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		case 30:
			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
}

// String returns a readable string representation of a RespondActivityTaskCompletedRequest
// struct.
func (v *RespondActivityTaskCompletedRequest) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [3]string
	i := 0
	if v.TaskToken != nil {
		fields[i] = fmt.Sprintf("TaskToken: %v", v.TaskToken)
		i++
	}
	if v.Result != nil {
		fields[i] = fmt.Sprintf("Result: %v", v.Result)
		i++
	}
	if v.Identity != nil {
		fields[i] = fmt.Sprintf("Identity: %v", *(v.Identity))
		i++
	}

	return fmt.Sprintf("RespondActivityTaskCompletedRequest{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this RespondActivityTaskCompletedRequest match the
// provided RespondActivityTaskCompletedRequest.
//
// This function performs a deep comparison.
func (v *RespondActivityTaskCompletedRequest) Equals(rhs *RespondActivityTaskCompletedRequest) 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.Result == nil && rhs.Result == nil) || (v.Result != nil && rhs.Result != nil && bytes.Equal(v.Result, rhs.Result))) {
		return false
	}
	if !_String_EqualsPtr(v.Identity, rhs.Identity) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of RespondActivityTaskCompletedRequest.
func (v *RespondActivityTaskCompletedRequest) 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.Result != nil {
		enc.AddString("result", base64.StdEncoding.EncodeToString(v.Result))
	}
	if v.Identity != nil {
		enc.AddString("identity", *v.Identity)
	}
	return err
}

// GetTaskToken returns the value of TaskToken if it is set or its
// zero value if it is unset.
func (v *RespondActivityTaskCompletedRequest) GetTaskToken() (o []byte) {
	if v != nil && v.TaskToken != nil {
		return v.TaskToken
	}

	return
}

// IsSetTaskToken returns true if TaskToken is not nil.
func (v *RespondActivityTaskCompletedRequest) IsSetTaskToken() bool {
	return v != nil && v.TaskToken != nil
}

// GetResult returns the value of Result if it is set or its
// zero value if it is unset.
func (v *RespondActivityTaskCompletedRequest) GetResult() (o []byte) {
	if v != nil && v.Result != nil {
		return v.Result
	}

	return
}

// IsSetResult returns true if Result is not nil.
func (v *RespondActivityTaskCompletedRequest) IsSetResult() bool {
	return v != nil && v.Result != nil
}

// GetIdentity returns the value of Identity if it is set or its
// zero value if it is unset.
func (v *RespondActivityTaskCompletedRequest) GetIdentity() (o string) {
	if v != nil && v.Identity != nil {
		return *v.Identity
	}

	return
}

// IsSetIdentity returns true if Identity is not nil.
func (v *RespondActivityTaskCompletedRequest) IsSetIdentity() bool {
	return v != nil && v.Identity != nil
}

type RespondActivityTaskFailedByIDRequest struct {
	Domain     *string `json:"domain,omitempty"`
	WorkflowID *string `json:"workflowID,omitempty"`
	RunID      *string `json:"runID,omitempty"`
	ActivityID *string `json:"activityID,omitempty"`
	Reason     *string `json:"reason,omitempty"`
	Details    []byte  `json:"details,omitempty"`
	Identity   *string `json:"identity,omitempty"`
}

// ToWire translates a RespondActivityTaskFailedByIDRequest 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 *RespondActivityTaskFailedByIDRequest) ToWire() (wire.Value, error) {
	var (
		fields [7]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.WorkflowID != nil {
		w, err = wire.NewValueString(*(v.WorkflowID)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.RunID != nil {
		w, err = wire.NewValueString(*(v.RunID)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.ActivityID != nil {
		w, err = wire.NewValueString(*(v.ActivityID)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 40, Value: w}
		i++
	}
	if v.Reason != nil {
		w, err = wire.NewValueString(*(v.Reason)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 50, Value: w}
		i++
	}
	if v.Details != nil {
		w, err = wire.NewValueBinary(v.Details), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 60, 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: 70, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

// FromWire deserializes a RespondActivityTaskFailedByIDRequest 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 RespondActivityTaskFailedByIDRequest struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v RespondActivityTaskFailedByIDRequest
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *RespondActivityTaskFailedByIDRequest) 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.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.WorkflowID = &x
				if err != nil {
					return err
				}

			}
		case 30:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.RunID = &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.ActivityID = &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.Reason = &x
				if err != nil {
					return err
				}

			}
		case 60:
			if field.Value.Type() == wire.TBinary {
				v.Details, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		case 70:
			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
}

// String returns a readable string representation of a RespondActivityTaskFailedByIDRequest
// struct.
func (v *RespondActivityTaskFailedByIDRequest) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [7]string
	i := 0
	if v.Domain != nil {
		fields[i] = fmt.Sprintf("Domain: %v", *(v.Domain))
		i++
	}
	if v.WorkflowID != nil {
		fields[i] = fmt.Sprintf("WorkflowID: %v", *(v.WorkflowID))
		i++
	}
	if v.RunID != nil {
		fields[i] = fmt.Sprintf("RunID: %v", *(v.RunID))
		i++
	}
	if v.ActivityID != nil {
		fields[i] = fmt.Sprintf("ActivityID: %v", *(v.ActivityID))
		i++
	}
	if v.Reason != nil {
		fields[i] = fmt.Sprintf("Reason: %v", *(v.Reason))
		i++
	}
	if v.Details != nil {
		fields[i] = fmt.Sprintf("Details: %v", v.Details)
		i++
	}
	if v.Identity != nil {
		fields[i] = fmt.Sprintf("Identity: %v", *(v.Identity))
		i++
	}

	return fmt.Sprintf("RespondActivityTaskFailedByIDRequest{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this RespondActivityTaskFailedByIDRequest match the
// provided RespondActivityTaskFailedByIDRequest.
//
// This function performs a deep comparison.
func (v *RespondActivityTaskFailedByIDRequest) Equals(rhs *RespondActivityTaskFailedByIDRequest) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.Domain, rhs.Domain) {
		return false
	}
	if !_String_EqualsPtr(v.WorkflowID, rhs.WorkflowID) {
		return false
	}
	if !_String_EqualsPtr(v.RunID, rhs.RunID) {
		return false
	}
	if !_String_EqualsPtr(v.ActivityID, rhs.ActivityID) {
		return false
	}
	if !_String_EqualsPtr(v.Reason, rhs.Reason) {
		return false
	}
	if !((v.Details == nil && rhs.Details == nil) || (v.Details != nil && rhs.Details != nil && bytes.Equal(v.Details, rhs.Details))) {
		return false
	}
	if !_String_EqualsPtr(v.Identity, rhs.Identity) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of RespondActivityTaskFailedByIDRequest.
func (v *RespondActivityTaskFailedByIDRequest) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Domain != nil {
		enc.AddString("domain", *v.Domain)
	}
	if v.WorkflowID != nil {
		enc.AddString("workflowID", *v.WorkflowID)
	}
	if v.RunID != nil {
		enc.AddString("runID", *v.RunID)
	}
	if v.ActivityID != nil {
		enc.AddString("activityID", *v.ActivityID)
	}
	if v.Reason != nil {
		enc.AddString("reason", *v.Reason)
	}
	if v.Details != nil {
		enc.AddString("details", base64.StdEncoding.EncodeToString(v.Details))
	}
	if v.Identity != nil {
		enc.AddString("identity", *v.Identity)
	}
	return err
}

// GetDomain returns the value of Domain if it is set or its
// zero value if it is unset.
func (v *RespondActivityTaskFailedByIDRequest) GetDomain() (o string) {
	if v != nil && v.Domain != nil {
		return *v.Domain
	}

	return
}

// IsSetDomain returns true if Domain is not nil.
func (v *RespondActivityTaskFailedByIDRequest) IsSetDomain() bool {
	return v != nil && v.Domain != nil
}

// GetWorkflowID returns the value of WorkflowID if it is set or its
// zero value if it is unset.
func (v *RespondActivityTaskFailedByIDRequest) GetWorkflowID() (o string) {
	if v != nil && v.WorkflowID != nil {
		return *v.WorkflowID
	}

	return
}

// IsSetWorkflowID returns true if WorkflowID is not nil.
func (v *RespondActivityTaskFailedByIDRequest) IsSetWorkflowID() bool {
	return v != nil && v.WorkflowID != nil
}

// GetRunID returns the value of RunID if it is set or its
// zero value if it is unset.
func (v *RespondActivityTaskFailedByIDRequest) GetRunID() (o string) {
	if v != nil && v.RunID != nil {
		return *v.RunID
	}

	return
}

// IsSetRunID returns true if RunID is not nil.
func (v *RespondActivityTaskFailedByIDRequest) IsSetRunID() bool {
	return v != nil && v.RunID != nil
}

// GetActivityID returns the value of ActivityID if it is set or its
// zero value if it is unset.
func (v *RespondActivityTaskFailedByIDRequest) GetActivityID() (o string) {
	if v != nil && v.ActivityID != nil {
		return *v.ActivityID
	}

	return
}

// IsSetActivityID returns true if ActivityID is not nil.
func (v *RespondActivityTaskFailedByIDRequest) IsSetActivityID() bool {
	return v != nil && v.ActivityID != nil
}

// GetReason returns the value of Reason if it is set or its
// zero value if it is unset.
func (v *RespondActivityTaskFailedByIDRequest) GetReason() (o string) {
	if v != nil && v.Reason != nil {
		return *v.Reason
	}

	return
}

// IsSetReason returns true if Reason is not nil.
func (v *RespondActivityTaskFailedByIDRequest) IsSetReason() bool {
	return v != nil && v.Reason != nil
}

// GetDetails returns the value of Details if it is set or its
// zero value if it is unset.
func (v *RespondActivityTaskFailedByIDRequest) GetDetails() (o []byte) {
	if v != nil && v.Details != nil {
		return v.Details
	}

	return
}

// IsSetDetails returns true if Details is not nil.
func (v *RespondActivityTaskFailedByIDRequest) IsSetDetails() bool {
	return v != nil && v.Details != nil
}

// GetIdentity returns the value of Identity if it is set or its
// zero value if it is unset.
func (v *RespondActivityTaskFailedByIDRequest) GetIdentity() (o string) {
	if v != nil && v.Identity != nil {
		return *v.Identity
	}

	return
}

// IsSetIdentity returns true if Identity is not nil.
func (v *RespondActivityTaskFailedByIDRequest) IsSetIdentity() bool {
	return v != nil && v.Identity != nil
}

type RespondActivityTaskFailedRequest struct {
	TaskToken []byte  `json:"taskToken,omitempty"`
	Reason    *string `json:"reason,omitempty"`
	Details   []byte  `json:"details,omitempty"`
	Identity  *string `json:"identity,omitempty"`
}

// ToWire translates a RespondActivityTaskFailedRequest 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 *RespondActivityTaskFailedRequest) ToWire() (wire.Value, error) {
	var (
		fields [4]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.Reason != nil {
		w, err = wire.NewValueString(*(v.Reason)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.Details != nil {
		w, err = wire.NewValueBinary(v.Details), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, 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: 40, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

// FromWire deserializes a RespondActivityTaskFailedRequest 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 RespondActivityTaskFailedRequest struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v RespondActivityTaskFailedRequest
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *RespondActivityTaskFailedRequest) 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.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.Reason = &x
				if err != nil {
					return err
				}

			}
		case 30:
			if field.Value.Type() == wire.TBinary {
				v.Details, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		case 40:
			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
}

// String returns a readable string representation of a RespondActivityTaskFailedRequest
// struct.
func (v *RespondActivityTaskFailedRequest) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [4]string
	i := 0
	if v.TaskToken != nil {
		fields[i] = fmt.Sprintf("TaskToken: %v", v.TaskToken)
		i++
	}
	if v.Reason != nil {
		fields[i] = fmt.Sprintf("Reason: %v", *(v.Reason))
		i++
	}
	if v.Details != nil {
		fields[i] = fmt.Sprintf("Details: %v", v.Details)
		i++
	}
	if v.Identity != nil {
		fields[i] = fmt.Sprintf("Identity: %v", *(v.Identity))
		i++
	}

	return fmt.Sprintf("RespondActivityTaskFailedRequest{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this RespondActivityTaskFailedRequest match the
// provided RespondActivityTaskFailedRequest.
//
// This function performs a deep comparison.
func (v *RespondActivityTaskFailedRequest) Equals(rhs *RespondActivityTaskFailedRequest) 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 !_String_EqualsPtr(v.Reason, rhs.Reason) {
		return false
	}
	if !((v.Details == nil && rhs.Details == nil) || (v.Details != nil && rhs.Details != nil && bytes.Equal(v.Details, rhs.Details))) {
		return false
	}
	if !_String_EqualsPtr(v.Identity, rhs.Identity) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of RespondActivityTaskFailedRequest.
func (v *RespondActivityTaskFailedRequest) 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.Reason != nil {
		enc.AddString("reason", *v.Reason)
	}
	if v.Details != nil {
		enc.AddString("details", base64.StdEncoding.EncodeToString(v.Details))
	}
	if v.Identity != nil {
		enc.AddString("identity", *v.Identity)
	}
	return err
}

// GetTaskToken returns the value of TaskToken if it is set or its
// zero value if it is unset.
func (v *RespondActivityTaskFailedRequest) GetTaskToken() (o []byte) {
	if v != nil && v.TaskToken != nil {
		return v.TaskToken
	}

	return
}

// IsSetTaskToken returns true if TaskToken is not nil.
func (v *RespondActivityTaskFailedRequest) IsSetTaskToken() bool {
	return v != nil && v.TaskToken != nil
}

// GetReason returns the value of Reason if it is set or its
// zero value if it is unset.
func (v *RespondActivityTaskFailedRequest) GetReason() (o string) {
	if v != nil && v.Reason != nil {
		return *v.Reason
	}

	return
}

// IsSetReason returns true if Reason is not nil.
func (v *RespondActivityTaskFailedRequest) IsSetReason() bool {
	return v != nil && v.Reason != nil
}

// GetDetails returns the value of Details if it is set or its
// zero value if it is unset.
func (v *RespondActivityTaskFailedRequest) GetDetails() (o []byte) {
	if v != nil && v.Details != nil {
		return v.Details
	}

	return
}

// IsSetDetails returns true if Details is not nil.
func (v *RespondActivityTaskFailedRequest) IsSetDetails() bool {
	return v != nil && v.Details != nil
}

// GetIdentity returns the value of Identity if it is set or its
// zero value if it is unset.
func (v *RespondActivityTaskFailedRequest) GetIdentity() (o string) {
	if v != nil && v.Identity != nil {
		return *v.Identity
	}

	return
}

// IsSetIdentity returns true if Identity is not nil.
func (v *RespondActivityTaskFailedRequest) IsSetIdentity() bool {
	return v != nil && v.Identity != nil
}

type RespondCrossClusterTasksCompletedRequest struct {
	ShardID       *int32                      `json:"shardID,omitempty"`
	TargetCluster *string                     `json:"targetCluster,omitempty"`
	TaskResponses []*CrossClusterTaskResponse `json:"taskResponses,omitempty"`
	FetchNewTasks *bool                       `json:"fetchNewTasks,omitempty"`
}

type _List_CrossClusterTaskResponse_ValueList []*CrossClusterTaskResponse

func (v _List_CrossClusterTaskResponse_ValueList) ForEach(f func(wire.Value) error) error {
	for i, x := range v {
		if x == nil {
			return fmt.Errorf("invalid [%v]: value is nil", i)
		}
		w, err := x.ToWire()
		if err != nil {
			return err
		}
		err = f(w)
		if err != nil {
			return err
		}
	}
	return nil
}

func (v _List_CrossClusterTaskResponse_ValueList) Size() int {
	return len(v)
}

func (_List_CrossClusterTaskResponse_ValueList) ValueType() wire.Type {
	return wire.TStruct
}

func (_List_CrossClusterTaskResponse_ValueList) Close() {}

// ToWire translates a RespondCrossClusterTasksCompletedRequest 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 *RespondCrossClusterTasksCompletedRequest) ToWire() (wire.Value, error) {
	var (
		fields [4]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.ShardID != nil {
		w, err = wire.NewValueI32(*(v.ShardID)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.TargetCluster != nil {
		w, err = wire.NewValueString(*(v.TargetCluster)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.TaskResponses != nil {
		w, err = wire.NewValueList(_List_CrossClusterTaskResponse_ValueList(v.TaskResponses)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.FetchNewTasks != nil {
		w, err = wire.NewValueBool(*(v.FetchNewTasks)), 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 _CrossClusterTaskResponse_Read(w wire.Value) (*CrossClusterTaskResponse, error) {
	var v CrossClusterTaskResponse
	err := v.FromWire(w)
	return &v, err
}

func _List_CrossClusterTaskResponse_Read(l wire.ValueList) ([]*CrossClusterTaskResponse, error) {
	if l.ValueType() != wire.TStruct {
		return nil, nil
	}

	o := make([]*CrossClusterTaskResponse, 0, l.Size())
	err := l.ForEach(func(x wire.Value) error {
		i, err := _CrossClusterTaskResponse_Read(x)
		if err != nil {
			return err
		}
		o = append(o, i)
		return nil
	})
	l.Close()
	return o, err
}

// FromWire deserializes a RespondCrossClusterTasksCompletedRequest 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 RespondCrossClusterTasksCompletedRequest struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v RespondCrossClusterTasksCompletedRequest
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *RespondCrossClusterTasksCompletedRequest) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			if field.Value.Type() == wire.TI32 {
				var x int32
				x, err = field.Value.GetI32(), error(nil)
				v.ShardID = &x
				if err != nil {
					return err
				}

			}
		case 20:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.TargetCluster = &x
				if err != nil {
					return err
				}

			}
		case 30:
			if field.Value.Type() == wire.TList {
				v.TaskResponses, err = _List_CrossClusterTaskResponse_Read(field.Value.GetList())
				if err != nil {
					return err
				}

			}
		case 40:
			if field.Value.Type() == wire.TBool {
				var x bool
				x, err = field.Value.GetBool(), error(nil)
				v.FetchNewTasks = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a RespondCrossClusterTasksCompletedRequest
// struct.
func (v *RespondCrossClusterTasksCompletedRequest) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [4]string
	i := 0
	if v.ShardID != nil {
		fields[i] = fmt.Sprintf("ShardID: %v", *(v.ShardID))
		i++
	}
	if v.TargetCluster != nil {
		fields[i] = fmt.Sprintf("TargetCluster: %v", *(v.TargetCluster))
		i++
	}
	if v.TaskResponses != nil {
		fields[i] = fmt.Sprintf("TaskResponses: %v", v.TaskResponses)
		i++
	}
	if v.FetchNewTasks != nil {
		fields[i] = fmt.Sprintf("FetchNewTasks: %v", *(v.FetchNewTasks))
		i++
	}

	return fmt.Sprintf("RespondCrossClusterTasksCompletedRequest{%v}", strings.Join(fields[:i], ", "))
}

func _List_CrossClusterTaskResponse_Equals(lhs, rhs []*CrossClusterTaskResponse) bool {
	if len(lhs) != len(rhs) {
		return false
	}

	for i, lv := range lhs {
		rv := rhs[i]
		if !lv.Equals(rv) {
			return false
		}
	}

	return true
}

// Equals returns true if all the fields of this RespondCrossClusterTasksCompletedRequest match the
// provided RespondCrossClusterTasksCompletedRequest.
//
// This function performs a deep comparison.
func (v *RespondCrossClusterTasksCompletedRequest) Equals(rhs *RespondCrossClusterTasksCompletedRequest) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_I32_EqualsPtr(v.ShardID, rhs.ShardID) {
		return false
	}
	if !_String_EqualsPtr(v.TargetCluster, rhs.TargetCluster) {
		return false
	}
	if !((v.TaskResponses == nil && rhs.TaskResponses == nil) || (v.TaskResponses != nil && rhs.TaskResponses != nil && _List_CrossClusterTaskResponse_Equals(v.TaskResponses, rhs.TaskResponses))) {
		return false
	}
	if !_Bool_EqualsPtr(v.FetchNewTasks, rhs.FetchNewTasks) {
		return false
	}

	return true
}

type _List_CrossClusterTaskResponse_Zapper []*CrossClusterTaskResponse

// MarshalLogArray implements zapcore.ArrayMarshaler, enabling
// fast logging of _List_CrossClusterTaskResponse_Zapper.
func (l _List_CrossClusterTaskResponse_Zapper) MarshalLogArray(enc zapcore.ArrayEncoder) (err error) {
	for _, v := range l {
		err = multierr.Append(err, enc.AppendObject(v))
	}
	return err
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of RespondCrossClusterTasksCompletedRequest.
func (v *RespondCrossClusterTasksCompletedRequest) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.ShardID != nil {
		enc.AddInt32("shardID", *v.ShardID)
	}
	if v.TargetCluster != nil {
		enc.AddString("targetCluster", *v.TargetCluster)
	}
	if v.TaskResponses != nil {
		err = multierr.Append(err, enc.AddArray("taskResponses", (_List_CrossClusterTaskResponse_Zapper)(v.TaskResponses)))
	}
	if v.FetchNewTasks != nil {
		enc.AddBool("fetchNewTasks", *v.FetchNewTasks)
	}
	return err
}

// GetShardID returns the value of ShardID if it is set or its
// zero value if it is unset.
func (v *RespondCrossClusterTasksCompletedRequest) GetShardID() (o int32) {
	if v != nil && v.ShardID != nil {
		return *v.ShardID
	}

	return
}

// IsSetShardID returns true if ShardID is not nil.
func (v *RespondCrossClusterTasksCompletedRequest) IsSetShardID() bool {
	return v != nil && v.ShardID != nil
}

// GetTargetCluster returns the value of TargetCluster if it is set or its
// zero value if it is unset.
func (v *RespondCrossClusterTasksCompletedRequest) GetTargetCluster() (o string) {
	if v != nil && v.TargetCluster != nil {
		return *v.TargetCluster
	}

	return
}

// IsSetTargetCluster returns true if TargetCluster is not nil.
func (v *RespondCrossClusterTasksCompletedRequest) IsSetTargetCluster() bool {
	return v != nil && v.TargetCluster != nil
}

// GetTaskResponses returns the value of TaskResponses if it is set or its
// zero value if it is unset.
func (v *RespondCrossClusterTasksCompletedRequest) GetTaskResponses() (o []*CrossClusterTaskResponse) {
	if v != nil && v.TaskResponses != nil {
		return v.TaskResponses
	}

	return
}

// IsSetTaskResponses returns true if TaskResponses is not nil.
func (v *RespondCrossClusterTasksCompletedRequest) IsSetTaskResponses() bool {
	return v != nil && v.TaskResponses != nil
}

// GetFetchNewTasks returns the value of FetchNewTasks if it is set or its
// zero value if it is unset.
func (v *RespondCrossClusterTasksCompletedRequest) GetFetchNewTasks() (o bool) {
	if v != nil && v.FetchNewTasks != nil {
		return *v.FetchNewTasks
	}

	return
}

// IsSetFetchNewTasks returns true if FetchNewTasks is not nil.
func (v *RespondCrossClusterTasksCompletedRequest) IsSetFetchNewTasks() bool {
	return v != nil && v.FetchNewTasks != nil
}

type RespondCrossClusterTasksCompletedResponse struct {
	Tasks []*CrossClusterTaskRequest `json:"tasks,omitempty"`
}

// ToWire translates a RespondCrossClusterTasksCompletedResponse 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 *RespondCrossClusterTasksCompletedResponse) ToWire() (wire.Value, error) {
	var (
		fields [1]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.Tasks != nil {
		w, err = wire.NewValueList(_List_CrossClusterTaskRequest_ValueList(v.Tasks)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

// FromWire deserializes a RespondCrossClusterTasksCompletedResponse 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 RespondCrossClusterTasksCompletedResponse struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v RespondCrossClusterTasksCompletedResponse
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *RespondCrossClusterTasksCompletedResponse) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			if field.Value.Type() == wire.TList {
				v.Tasks, err = _List_CrossClusterTaskRequest_Read(field.Value.GetList())
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a RespondCrossClusterTasksCompletedResponse
// struct.
func (v *RespondCrossClusterTasksCompletedResponse) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [1]string
	i := 0
	if v.Tasks != nil {
		fields[i] = fmt.Sprintf("Tasks: %v", v.Tasks)
		i++
	}

	return fmt.Sprintf("RespondCrossClusterTasksCompletedResponse{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this RespondCrossClusterTasksCompletedResponse match the
// provided RespondCrossClusterTasksCompletedResponse.
//
// This function performs a deep comparison.
func (v *RespondCrossClusterTasksCompletedResponse) Equals(rhs *RespondCrossClusterTasksCompletedResponse) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !((v.Tasks == nil && rhs.Tasks == nil) || (v.Tasks != nil && rhs.Tasks != nil && _List_CrossClusterTaskRequest_Equals(v.Tasks, rhs.Tasks))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of RespondCrossClusterTasksCompletedResponse.
func (v *RespondCrossClusterTasksCompletedResponse) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Tasks != nil {
		err = multierr.Append(err, enc.AddArray("tasks", (_List_CrossClusterTaskRequest_Zapper)(v.Tasks)))
	}
	return err
}

// GetTasks returns the value of Tasks if it is set or its
// zero value if it is unset.
func (v *RespondCrossClusterTasksCompletedResponse) GetTasks() (o []*CrossClusterTaskRequest) {
	if v != nil && v.Tasks != nil {
		return v.Tasks
	}

	return
}

// IsSetTasks returns true if Tasks is not nil.
func (v *RespondCrossClusterTasksCompletedResponse) IsSetTasks() bool {
	return v != nil && v.Tasks != nil
}

type RespondDecisionTaskCompletedRequest struct {
	TaskToken                  []byte                          `json:"taskToken,omitempty"`
	Decisions                  []*Decision                     `json:"decisions,omitempty"`
	ExecutionContext           []byte                          `json:"executionContext,omitempty"`
	Identity                   *string                         `json:"identity,omitempty"`
	StickyAttributes           *StickyExecutionAttributes      `json:"stickyAttributes,omitempty"`
	ReturnNewDecisionTask      *bool                           `json:"returnNewDecisionTask,omitempty"`
	ForceCreateNewDecisionTask *bool                           `json:"forceCreateNewDecisionTask,omitempty"`
	BinaryChecksum             *string                         `json:"binaryChecksum,omitempty"`
	QueryResults               map[string]*WorkflowQueryResult `json:"queryResults,omitempty"`
}

type _List_Decision_ValueList []*Decision

func (v _List_Decision_ValueList) ForEach(f func(wire.Value) error) error {
	for i, x := range v {
		if x == nil {
			return fmt.Errorf("invalid [%v]: value is nil", i)
		}
		w, err := x.ToWire()
		if err != nil {
			return err
		}
		err = f(w)
		if err != nil {
			return err
		}
	}
	return nil
}

func (v _List_Decision_ValueList) Size() int {
	return len(v)
}

func (_List_Decision_ValueList) ValueType() wire.Type {
	return wire.TStruct
}

func (_List_Decision_ValueList) Close() {}

type _Map_String_WorkflowQueryResult_MapItemList map[string]*WorkflowQueryResult

func (m _Map_String_WorkflowQueryResult_MapItemList) ForEach(f func(wire.MapItem) error) error {
	for k, v := range m {
		if v == nil {
			return fmt.Errorf("invalid [%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_WorkflowQueryResult_MapItemList) Size() int {
	return len(m)
}

func (_Map_String_WorkflowQueryResult_MapItemList) KeyType() wire.Type {
	return wire.TBinary
}

func (_Map_String_WorkflowQueryResult_MapItemList) ValueType() wire.Type {
	return wire.TStruct
}

func (_Map_String_WorkflowQueryResult_MapItemList) Close() {}

// ToWire translates a RespondDecisionTaskCompletedRequest 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 *RespondDecisionTaskCompletedRequest) ToWire() (wire.Value, error) {
	var (
		fields [9]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.Decisions != nil {
		w, err = wire.NewValueList(_List_Decision_ValueList(v.Decisions)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.ExecutionContext != nil {
		w, err = wire.NewValueBinary(v.ExecutionContext), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, 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: 40, Value: w}
		i++
	}
	if v.StickyAttributes != nil {
		w, err = v.StickyAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 50, Value: w}
		i++
	}
	if v.ReturnNewDecisionTask != nil {
		w, err = wire.NewValueBool(*(v.ReturnNewDecisionTask)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 60, Value: w}
		i++
	}
	if v.ForceCreateNewDecisionTask != nil {
		w, err = wire.NewValueBool(*(v.ForceCreateNewDecisionTask)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 70, Value: w}
		i++
	}
	if v.BinaryChecksum != nil {
		w, err = wire.NewValueString(*(v.BinaryChecksum)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 80, Value: w}
		i++
	}
	if v.QueryResults != nil {
		w, err = wire.NewValueMap(_Map_String_WorkflowQueryResult_MapItemList(v.QueryResults)), 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 _Decision_Read(w wire.Value) (*Decision, error) {
	var v Decision
	err := v.FromWire(w)
	return &v, err
}

func _List_Decision_Read(l wire.ValueList) ([]*Decision, error) {
	if l.ValueType() != wire.TStruct {
		return nil, nil
	}

	o := make([]*Decision, 0, l.Size())
	err := l.ForEach(func(x wire.Value) error {
		i, err := _Decision_Read(x)
		if err != nil {
			return err
		}
		o = append(o, i)
		return nil
	})
	l.Close()
	return o, err
}

func _StickyExecutionAttributes_Read(w wire.Value) (*StickyExecutionAttributes, error) {
	var v StickyExecutionAttributes
	err := v.FromWire(w)
	return &v, err
}

func _WorkflowQueryResult_Read(w wire.Value) (*WorkflowQueryResult, error) {
	var v WorkflowQueryResult
	err := v.FromWire(w)
	return &v, err
}

func _Map_String_WorkflowQueryResult_Read(m wire.MapItemList) (map[string]*WorkflowQueryResult, error) {
	if m.KeyType() != wire.TBinary {
		return nil, nil
	}

	if m.ValueType() != wire.TStruct {
		return nil, nil
	}

	o := make(map[string]*WorkflowQueryResult, m.Size())
	err := m.ForEach(func(x wire.MapItem) error {
		k, err := x.Key.GetString(), error(nil)
		if err != nil {
			return err
		}

		v, err := _WorkflowQueryResult_Read(x.Value)
		if err != nil {
			return err
		}

		o[k] = v
		return nil
	})
	m.Close()
	return o, err
}

// FromWire deserializes a RespondDecisionTaskCompletedRequest 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 RespondDecisionTaskCompletedRequest struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v RespondDecisionTaskCompletedRequest
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *RespondDecisionTaskCompletedRequest) 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.TList {
				v.Decisions, err = _List_Decision_Read(field.Value.GetList())
				if err != nil {
					return err
				}

			}
		case 30:
			if field.Value.Type() == wire.TBinary {
				v.ExecutionContext, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		case 40:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.Identity = &x
				if err != nil {
					return err
				}

			}
		case 50:
			if field.Value.Type() == wire.TStruct {
				v.StickyAttributes, err = _StickyExecutionAttributes_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 60:
			if field.Value.Type() == wire.TBool {
				var x bool
				x, err = field.Value.GetBool(), error(nil)
				v.ReturnNewDecisionTask = &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.ForceCreateNewDecisionTask = &x
				if err != nil {
					return err
				}

			}
		case 80:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.BinaryChecksum = &x
				if err != nil {
					return err
				}

			}
		case 90:
			if field.Value.Type() == wire.TMap {
				v.QueryResults, err = _Map_String_WorkflowQueryResult_Read(field.Value.GetMap())
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a RespondDecisionTaskCompletedRequest
// struct.
func (v *RespondDecisionTaskCompletedRequest) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [9]string
	i := 0
	if v.TaskToken != nil {
		fields[i] = fmt.Sprintf("TaskToken: %v", v.TaskToken)
		i++
	}
	if v.Decisions != nil {
		fields[i] = fmt.Sprintf("Decisions: %v", v.Decisions)
		i++
	}
	if v.ExecutionContext != nil {
		fields[i] = fmt.Sprintf("ExecutionContext: %v", v.ExecutionContext)
		i++
	}
	if v.Identity != nil {
		fields[i] = fmt.Sprintf("Identity: %v", *(v.Identity))
		i++
	}
	if v.StickyAttributes != nil {
		fields[i] = fmt.Sprintf("StickyAttributes: %v", v.StickyAttributes)
		i++
	}
	if v.ReturnNewDecisionTask != nil {
		fields[i] = fmt.Sprintf("ReturnNewDecisionTask: %v", *(v.ReturnNewDecisionTask))
		i++
	}
	if v.ForceCreateNewDecisionTask != nil {
		fields[i] = fmt.Sprintf("ForceCreateNewDecisionTask: %v", *(v.ForceCreateNewDecisionTask))
		i++
	}
	if v.BinaryChecksum != nil {
		fields[i] = fmt.Sprintf("BinaryChecksum: %v", *(v.BinaryChecksum))
		i++
	}
	if v.QueryResults != nil {
		fields[i] = fmt.Sprintf("QueryResults: %v", v.QueryResults)
		i++
	}

	return fmt.Sprintf("RespondDecisionTaskCompletedRequest{%v}", strings.Join(fields[:i], ", "))
}

func _List_Decision_Equals(lhs, rhs []*Decision) bool {
	if len(lhs) != len(rhs) {
		return false
	}

	for i, lv := range lhs {
		rv := rhs[i]
		if !lv.Equals(rv) {
			return false
		}
	}

	return true
}

func _Map_String_WorkflowQueryResult_Equals(lhs, rhs map[string]*WorkflowQueryResult) 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 RespondDecisionTaskCompletedRequest match the
// provided RespondDecisionTaskCompletedRequest.
//
// This function performs a deep comparison.
func (v *RespondDecisionTaskCompletedRequest) Equals(rhs *RespondDecisionTaskCompletedRequest) 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.Decisions == nil && rhs.Decisions == nil) || (v.Decisions != nil && rhs.Decisions != nil && _List_Decision_Equals(v.Decisions, rhs.Decisions))) {
		return false
	}
	if !((v.ExecutionContext == nil && rhs.ExecutionContext == nil) || (v.ExecutionContext != nil && rhs.ExecutionContext != nil && bytes.Equal(v.ExecutionContext, rhs.ExecutionContext))) {
		return false
	}
	if !_String_EqualsPtr(v.Identity, rhs.Identity) {
		return false
	}
	if !((v.StickyAttributes == nil && rhs.StickyAttributes == nil) || (v.StickyAttributes != nil && rhs.StickyAttributes != nil && v.StickyAttributes.Equals(rhs.StickyAttributes))) {
		return false
	}
	if !_Bool_EqualsPtr(v.ReturnNewDecisionTask, rhs.ReturnNewDecisionTask) {
		return false
	}
	if !_Bool_EqualsPtr(v.ForceCreateNewDecisionTask, rhs.ForceCreateNewDecisionTask) {
		return false
	}
	if !_String_EqualsPtr(v.BinaryChecksum, rhs.BinaryChecksum) {
		return false
	}
	if !((v.QueryResults == nil && rhs.QueryResults == nil) || (v.QueryResults != nil && rhs.QueryResults != nil && _Map_String_WorkflowQueryResult_Equals(v.QueryResults, rhs.QueryResults))) {
		return false
	}

	return true
}

type _List_Decision_Zapper []*Decision

// MarshalLogArray implements zapcore.ArrayMarshaler, enabling
// fast logging of _List_Decision_Zapper.
func (l _List_Decision_Zapper) MarshalLogArray(enc zapcore.ArrayEncoder) (err error) {
	for _, v := range l {
		err = multierr.Append(err, enc.AppendObject(v))
	}
	return err
}

type _Map_String_WorkflowQueryResult_Zapper map[string]*WorkflowQueryResult

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of _Map_String_WorkflowQueryResult_Zapper.
func (m _Map_String_WorkflowQueryResult_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 RespondDecisionTaskCompletedRequest.
func (v *RespondDecisionTaskCompletedRequest) 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.Decisions != nil {
		err = multierr.Append(err, enc.AddArray("decisions", (_List_Decision_Zapper)(v.Decisions)))
	}
	if v.ExecutionContext != nil {
		enc.AddString("executionContext", base64.StdEncoding.EncodeToString(v.ExecutionContext))
	}
	if v.Identity != nil {
		enc.AddString("identity", *v.Identity)
	}
	if v.StickyAttributes != nil {
		err = multierr.Append(err, enc.AddObject("stickyAttributes", v.StickyAttributes))
	}
	if v.ReturnNewDecisionTask != nil {
		enc.AddBool("returnNewDecisionTask", *v.ReturnNewDecisionTask)
	}
	if v.ForceCreateNewDecisionTask != nil {
		enc.AddBool("forceCreateNewDecisionTask", *v.ForceCreateNewDecisionTask)
	}
	if v.BinaryChecksum != nil {
		enc.AddString("binaryChecksum", *v.BinaryChecksum)
	}
	if v.QueryResults != nil {
		err = multierr.Append(err, enc.AddObject("queryResults", (_Map_String_WorkflowQueryResult_Zapper)(v.QueryResults)))
	}
	return err
}

// GetTaskToken returns the value of TaskToken if it is set or its
// zero value if it is unset.
func (v *RespondDecisionTaskCompletedRequest) GetTaskToken() (o []byte) {
	if v != nil && v.TaskToken != nil {
		return v.TaskToken
	}

	return
}

// IsSetTaskToken returns true if TaskToken is not nil.
func (v *RespondDecisionTaskCompletedRequest) IsSetTaskToken() bool {
	return v != nil && v.TaskToken != nil
}

// GetDecisions returns the value of Decisions if it is set or its
// zero value if it is unset.
func (v *RespondDecisionTaskCompletedRequest) GetDecisions() (o []*Decision) {
	if v != nil && v.Decisions != nil {
		return v.Decisions
	}

	return
}

// IsSetDecisions returns true if Decisions is not nil.
func (v *RespondDecisionTaskCompletedRequest) IsSetDecisions() bool {
	return v != nil && v.Decisions != nil
}

// GetExecutionContext returns the value of ExecutionContext if it is set or its
// zero value if it is unset.
func (v *RespondDecisionTaskCompletedRequest) GetExecutionContext() (o []byte) {
	if v != nil && v.ExecutionContext != nil {
		return v.ExecutionContext
	}

	return
}

// IsSetExecutionContext returns true if ExecutionContext is not nil.
func (v *RespondDecisionTaskCompletedRequest) IsSetExecutionContext() bool {
	return v != nil && v.ExecutionContext != nil
}

// GetIdentity returns the value of Identity if it is set or its
// zero value if it is unset.
func (v *RespondDecisionTaskCompletedRequest) GetIdentity() (o string) {
	if v != nil && v.Identity != nil {
		return *v.Identity
	}

	return
}

// IsSetIdentity returns true if Identity is not nil.
func (v *RespondDecisionTaskCompletedRequest) IsSetIdentity() bool {
	return v != nil && v.Identity != nil
}

// GetStickyAttributes returns the value of StickyAttributes if it is set or its
// zero value if it is unset.
func (v *RespondDecisionTaskCompletedRequest) GetStickyAttributes() (o *StickyExecutionAttributes) {
	if v != nil && v.StickyAttributes != nil {
		return v.StickyAttributes
	}

	return
}

// IsSetStickyAttributes returns true if StickyAttributes is not nil.
func (v *RespondDecisionTaskCompletedRequest) IsSetStickyAttributes() bool {
	return v != nil && v.StickyAttributes != nil
}

// GetReturnNewDecisionTask returns the value of ReturnNewDecisionTask if it is set or its
// zero value if it is unset.
func (v *RespondDecisionTaskCompletedRequest) GetReturnNewDecisionTask() (o bool) {
	if v != nil && v.ReturnNewDecisionTask != nil {
		return *v.ReturnNewDecisionTask
	}

	return
}

// IsSetReturnNewDecisionTask returns true if ReturnNewDecisionTask is not nil.
func (v *RespondDecisionTaskCompletedRequest) IsSetReturnNewDecisionTask() bool {
	return v != nil && v.ReturnNewDecisionTask != nil
}

// GetForceCreateNewDecisionTask returns the value of ForceCreateNewDecisionTask if it is set or its
// zero value if it is unset.
func (v *RespondDecisionTaskCompletedRequest) GetForceCreateNewDecisionTask() (o bool) {
	if v != nil && v.ForceCreateNewDecisionTask != nil {
		return *v.ForceCreateNewDecisionTask
	}

	return
}

// IsSetForceCreateNewDecisionTask returns true if ForceCreateNewDecisionTask is not nil.
func (v *RespondDecisionTaskCompletedRequest) IsSetForceCreateNewDecisionTask() bool {
	return v != nil && v.ForceCreateNewDecisionTask != nil
}

// GetBinaryChecksum returns the value of BinaryChecksum if it is set or its
// zero value if it is unset.
func (v *RespondDecisionTaskCompletedRequest) GetBinaryChecksum() (o string) {
	if v != nil && v.BinaryChecksum != nil {
		return *v.BinaryChecksum
	}

	return
}

// IsSetBinaryChecksum returns true if BinaryChecksum is not nil.
func (v *RespondDecisionTaskCompletedRequest) IsSetBinaryChecksum() bool {
	return v != nil && v.BinaryChecksum != nil
}

// GetQueryResults returns the value of QueryResults if it is set or its
// zero value if it is unset.
func (v *RespondDecisionTaskCompletedRequest) GetQueryResults() (o map[string]*WorkflowQueryResult) {
	if v != nil && v.QueryResults != nil {
		return v.QueryResults
	}

	return
}

// IsSetQueryResults returns true if QueryResults is not nil.
func (v *RespondDecisionTaskCompletedRequest) IsSetQueryResults() bool {
	return v != nil && v.QueryResults != nil
}

type RespondDecisionTaskCompletedResponse struct {
	DecisionTask                *PollForDecisionTaskResponse          `json:"decisionTask,omitempty"`
	ActivitiesToDispatchLocally map[string]*ActivityLocalDispatchInfo `json:"activitiesToDispatchLocally,omitempty"`
}

type _Map_String_ActivityLocalDispatchInfo_MapItemList map[string]*ActivityLocalDispatchInfo

func (m _Map_String_ActivityLocalDispatchInfo_MapItemList) ForEach(f func(wire.MapItem) error) error {
	for k, v := range m {
		if v == nil {
			return fmt.Errorf("invalid [%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_ActivityLocalDispatchInfo_MapItemList) Size() int {
	return len(m)
}

func (_Map_String_ActivityLocalDispatchInfo_MapItemList) KeyType() wire.Type {
	return wire.TBinary
}

func (_Map_String_ActivityLocalDispatchInfo_MapItemList) ValueType() wire.Type {
	return wire.TStruct
}

func (_Map_String_ActivityLocalDispatchInfo_MapItemList) Close() {}

// ToWire translates a RespondDecisionTaskCompletedResponse 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 *RespondDecisionTaskCompletedResponse) ToWire() (wire.Value, error) {
	var (
		fields [2]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.DecisionTask != nil {
		w, err = v.DecisionTask.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.ActivitiesToDispatchLocally != nil {
		w, err = wire.NewValueMap(_Map_String_ActivityLocalDispatchInfo_MapItemList(v.ActivitiesToDispatchLocally)), 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 _PollForDecisionTaskResponse_Read(w wire.Value) (*PollForDecisionTaskResponse, error) {
	var v PollForDecisionTaskResponse
	err := v.FromWire(w)
	return &v, err
}

func _ActivityLocalDispatchInfo_Read(w wire.Value) (*ActivityLocalDispatchInfo, error) {
	var v ActivityLocalDispatchInfo
	err := v.FromWire(w)
	return &v, err
}

func _Map_String_ActivityLocalDispatchInfo_Read(m wire.MapItemList) (map[string]*ActivityLocalDispatchInfo, error) {
	if m.KeyType() != wire.TBinary {
		return nil, nil
	}

	if m.ValueType() != wire.TStruct {
		return nil, nil
	}

	o := make(map[string]*ActivityLocalDispatchInfo, m.Size())
	err := m.ForEach(func(x wire.MapItem) error {
		k, err := x.Key.GetString(), error(nil)
		if err != nil {
			return err
		}

		v, err := _ActivityLocalDispatchInfo_Read(x.Value)
		if err != nil {
			return err
		}

		o[k] = v
		return nil
	})
	m.Close()
	return o, err
}

// FromWire deserializes a RespondDecisionTaskCompletedResponse 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 RespondDecisionTaskCompletedResponse struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v RespondDecisionTaskCompletedResponse
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *RespondDecisionTaskCompletedResponse) 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.DecisionTask, err = _PollForDecisionTaskResponse_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 20:
			if field.Value.Type() == wire.TMap {
				v.ActivitiesToDispatchLocally, err = _Map_String_ActivityLocalDispatchInfo_Read(field.Value.GetMap())
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a RespondDecisionTaskCompletedResponse
// struct.
func (v *RespondDecisionTaskCompletedResponse) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [2]string
	i := 0
	if v.DecisionTask != nil {
		fields[i] = fmt.Sprintf("DecisionTask: %v", v.DecisionTask)
		i++
	}
	if v.ActivitiesToDispatchLocally != nil {
		fields[i] = fmt.Sprintf("ActivitiesToDispatchLocally: %v", v.ActivitiesToDispatchLocally)
		i++
	}

	return fmt.Sprintf("RespondDecisionTaskCompletedResponse{%v}", strings.Join(fields[:i], ", "))
}

func _Map_String_ActivityLocalDispatchInfo_Equals(lhs, rhs map[string]*ActivityLocalDispatchInfo) 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 RespondDecisionTaskCompletedResponse match the
// provided RespondDecisionTaskCompletedResponse.
//
// This function performs a deep comparison.
func (v *RespondDecisionTaskCompletedResponse) Equals(rhs *RespondDecisionTaskCompletedResponse) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !((v.DecisionTask == nil && rhs.DecisionTask == nil) || (v.DecisionTask != nil && rhs.DecisionTask != nil && v.DecisionTask.Equals(rhs.DecisionTask))) {
		return false
	}
	if !((v.ActivitiesToDispatchLocally == nil && rhs.ActivitiesToDispatchLocally == nil) || (v.ActivitiesToDispatchLocally != nil && rhs.ActivitiesToDispatchLocally != nil && _Map_String_ActivityLocalDispatchInfo_Equals(v.ActivitiesToDispatchLocally, rhs.ActivitiesToDispatchLocally))) {
		return false
	}

	return true
}

type _Map_String_ActivityLocalDispatchInfo_Zapper map[string]*ActivityLocalDispatchInfo

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of _Map_String_ActivityLocalDispatchInfo_Zapper.
func (m _Map_String_ActivityLocalDispatchInfo_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 RespondDecisionTaskCompletedResponse.
func (v *RespondDecisionTaskCompletedResponse) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.DecisionTask != nil {
		err = multierr.Append(err, enc.AddObject("decisionTask", v.DecisionTask))
	}
	if v.ActivitiesToDispatchLocally != nil {
		err = multierr.Append(err, enc.AddObject("activitiesToDispatchLocally", (_Map_String_ActivityLocalDispatchInfo_Zapper)(v.ActivitiesToDispatchLocally)))
	}
	return err
}

// GetDecisionTask returns the value of DecisionTask if it is set or its
// zero value if it is unset.
func (v *RespondDecisionTaskCompletedResponse) GetDecisionTask() (o *PollForDecisionTaskResponse) {
	if v != nil && v.DecisionTask != nil {
		return v.DecisionTask
	}

	return
}

// IsSetDecisionTask returns true if DecisionTask is not nil.
func (v *RespondDecisionTaskCompletedResponse) IsSetDecisionTask() bool {
	return v != nil && v.DecisionTask != nil
}

// GetActivitiesToDispatchLocally returns the value of ActivitiesToDispatchLocally if it is set or its
// zero value if it is unset.
func (v *RespondDecisionTaskCompletedResponse) GetActivitiesToDispatchLocally() (o map[string]*ActivityLocalDispatchInfo) {
	if v != nil && v.ActivitiesToDispatchLocally != nil {
		return v.ActivitiesToDispatchLocally
	}

	return
}

// IsSetActivitiesToDispatchLocally returns true if ActivitiesToDispatchLocally is not nil.
func (v *RespondDecisionTaskCompletedResponse) IsSetActivitiesToDispatchLocally() bool {
	return v != nil && v.ActivitiesToDispatchLocally != nil
}

type RespondDecisionTaskFailedRequest struct {
	TaskToken      []byte                   `json:"taskToken,omitempty"`
	Cause          *DecisionTaskFailedCause `json:"cause,omitempty"`
	Details        []byte                   `json:"details,omitempty"`
	Identity       *string                  `json:"identity,omitempty"`
	BinaryChecksum *string                  `json:"binaryChecksum,omitempty"`
}

// ToWire translates a RespondDecisionTaskFailedRequest 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 *RespondDecisionTaskFailedRequest) ToWire() (wire.Value, error) {
	var (
		fields [5]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.Cause != nil {
		w, err = v.Cause.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.Details != nil {
		w, err = wire.NewValueBinary(v.Details), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, 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: 40, Value: w}
		i++
	}
	if v.BinaryChecksum != nil {
		w, err = wire.NewValueString(*(v.BinaryChecksum)), 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
}

// FromWire deserializes a RespondDecisionTaskFailedRequest 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 RespondDecisionTaskFailedRequest struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v RespondDecisionTaskFailedRequest
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *RespondDecisionTaskFailedRequest) 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.TI32 {
				var x DecisionTaskFailedCause
				x, err = _DecisionTaskFailedCause_Read(field.Value)
				v.Cause = &x
				if err != nil {
					return err
				}

			}
		case 30:
			if field.Value.Type() == wire.TBinary {
				v.Details, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		case 40:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.Identity = &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.BinaryChecksum = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a RespondDecisionTaskFailedRequest
// struct.
func (v *RespondDecisionTaskFailedRequest) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [5]string
	i := 0
	if v.TaskToken != nil {
		fields[i] = fmt.Sprintf("TaskToken: %v", v.TaskToken)
		i++
	}
	if v.Cause != nil {
		fields[i] = fmt.Sprintf("Cause: %v", *(v.Cause))
		i++
	}
	if v.Details != nil {
		fields[i] = fmt.Sprintf("Details: %v", v.Details)
		i++
	}
	if v.Identity != nil {
		fields[i] = fmt.Sprintf("Identity: %v", *(v.Identity))
		i++
	}
	if v.BinaryChecksum != nil {
		fields[i] = fmt.Sprintf("BinaryChecksum: %v", *(v.BinaryChecksum))
		i++
	}

	return fmt.Sprintf("RespondDecisionTaskFailedRequest{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this RespondDecisionTaskFailedRequest match the
// provided RespondDecisionTaskFailedRequest.
//
// This function performs a deep comparison.
func (v *RespondDecisionTaskFailedRequest) Equals(rhs *RespondDecisionTaskFailedRequest) 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 !_DecisionTaskFailedCause_EqualsPtr(v.Cause, rhs.Cause) {
		return false
	}
	if !((v.Details == nil && rhs.Details == nil) || (v.Details != nil && rhs.Details != nil && bytes.Equal(v.Details, rhs.Details))) {
		return false
	}
	if !_String_EqualsPtr(v.Identity, rhs.Identity) {
		return false
	}
	if !_String_EqualsPtr(v.BinaryChecksum, rhs.BinaryChecksum) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of RespondDecisionTaskFailedRequest.
func (v *RespondDecisionTaskFailedRequest) 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.Cause != nil {
		err = multierr.Append(err, enc.AddObject("cause", *v.Cause))
	}
	if v.Details != nil {
		enc.AddString("details", base64.StdEncoding.EncodeToString(v.Details))
	}
	if v.Identity != nil {
		enc.AddString("identity", *v.Identity)
	}
	if v.BinaryChecksum != nil {
		enc.AddString("binaryChecksum", *v.BinaryChecksum)
	}
	return err
}

// GetTaskToken returns the value of TaskToken if it is set or its
// zero value if it is unset.
func (v *RespondDecisionTaskFailedRequest) GetTaskToken() (o []byte) {
	if v != nil && v.TaskToken != nil {
		return v.TaskToken
	}

	return
}

// IsSetTaskToken returns true if TaskToken is not nil.
func (v *RespondDecisionTaskFailedRequest) IsSetTaskToken() bool {
	return v != nil && v.TaskToken != nil
}

// GetCause returns the value of Cause if it is set or its
// zero value if it is unset.
func (v *RespondDecisionTaskFailedRequest) GetCause() (o DecisionTaskFailedCause) {
	if v != nil && v.Cause != nil {
		return *v.Cause
	}

	return
}

// IsSetCause returns true if Cause is not nil.
func (v *RespondDecisionTaskFailedRequest) IsSetCause() bool {
	return v != nil && v.Cause != nil
}

// GetDetails returns the value of Details if it is set or its
// zero value if it is unset.
func (v *RespondDecisionTaskFailedRequest) GetDetails() (o []byte) {
	if v != nil && v.Details != nil {
		return v.Details
	}

	return
}

// IsSetDetails returns true if Details is not nil.
func (v *RespondDecisionTaskFailedRequest) IsSetDetails() bool {
	return v != nil && v.Details != nil
}

// GetIdentity returns the value of Identity if it is set or its
// zero value if it is unset.
func (v *RespondDecisionTaskFailedRequest) GetIdentity() (o string) {
	if v != nil && v.Identity != nil {
		return *v.Identity
	}

	return
}

// IsSetIdentity returns true if Identity is not nil.
func (v *RespondDecisionTaskFailedRequest) IsSetIdentity() bool {
	return v != nil && v.Identity != nil
}

// GetBinaryChecksum returns the value of BinaryChecksum if it is set or its
// zero value if it is unset.
func (v *RespondDecisionTaskFailedRequest) GetBinaryChecksum() (o string) {
	if v != nil && v.BinaryChecksum != nil {
		return *v.BinaryChecksum
	}

	return
}

// IsSetBinaryChecksum returns true if BinaryChecksum is not nil.
func (v *RespondDecisionTaskFailedRequest) IsSetBinaryChecksum() bool {
	return v != nil && v.BinaryChecksum != nil
}

type RespondQueryTaskCompletedRequest struct {
	TaskToken         []byte                  `json:"taskToken,omitempty"`
	CompletedType     *QueryTaskCompletedType `json:"completedType,omitempty"`
	QueryResult       []byte                  `json:"queryResult,omitempty"`
	ErrorMessage      *string                 `json:"errorMessage,omitempty"`
	WorkerVersionInfo *WorkerVersionInfo      `json:"workerVersionInfo,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 [5]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.CompletedType != nil {
		w, err = v.CompletedType.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.QueryResult != nil {
		w, err = wire.NewValueBinary(v.QueryResult), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.ErrorMessage != nil {
		w, err = wire.NewValueString(*(v.ErrorMessage)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 40, Value: w}
		i++
	}
	if v.WorkerVersionInfo != nil {
		w, err = v.WorkerVersionInfo.ToWire()
		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 _QueryTaskCompletedType_Read(w wire.Value) (QueryTaskCompletedType, error) {
	var v QueryTaskCompletedType
	err := v.FromWire(w)
	return v, err
}

func _WorkerVersionInfo_Read(w wire.Value) (*WorkerVersionInfo, error) {
	var v WorkerVersionInfo
	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 {
				v.TaskToken, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		case 20:
			if field.Value.Type() == wire.TI32 {
				var x QueryTaskCompletedType
				x, err = _QueryTaskCompletedType_Read(field.Value)
				v.CompletedType = &x
				if err != nil {
					return err
				}

			}
		case 30:
			if field.Value.Type() == wire.TBinary {
				v.QueryResult, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		case 40:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.ErrorMessage = &x
				if err != nil {
					return err
				}

			}
		case 50:
			if field.Value.Type() == wire.TStruct {
				v.WorkerVersionInfo, err = _WorkerVersionInfo_Read(field.Value)
				if 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 [5]string
	i := 0
	if v.TaskToken != nil {
		fields[i] = fmt.Sprintf("TaskToken: %v", v.TaskToken)
		i++
	}
	if v.CompletedType != nil {
		fields[i] = fmt.Sprintf("CompletedType: %v", *(v.CompletedType))
		i++
	}
	if v.QueryResult != nil {
		fields[i] = fmt.Sprintf("QueryResult: %v", v.QueryResult)
		i++
	}
	if v.ErrorMessage != nil {
		fields[i] = fmt.Sprintf("ErrorMessage: %v", *(v.ErrorMessage))
		i++
	}
	if v.WorkerVersionInfo != nil {
		fields[i] = fmt.Sprintf("WorkerVersionInfo: %v", v.WorkerVersionInfo)
		i++
	}

	return fmt.Sprintf("RespondQueryTaskCompletedRequest{%v}", strings.Join(fields[:i], ", "))
}

func _QueryTaskCompletedType_EqualsPtr(lhs, rhs *QueryTaskCompletedType) bool {
	if lhs != nil && rhs != nil {

		x := *lhs
		y := *rhs
		return x.Equals(y)
	}
	return lhs == nil && rhs == nil
}

// 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 !((v.TaskToken == nil && rhs.TaskToken == nil) || (v.TaskToken != nil && rhs.TaskToken != nil && bytes.Equal(v.TaskToken, rhs.TaskToken))) {
		return false
	}
	if !_QueryTaskCompletedType_EqualsPtr(v.CompletedType, rhs.CompletedType) {
		return false
	}
	if !((v.QueryResult == nil && rhs.QueryResult == nil) || (v.QueryResult != nil && rhs.QueryResult != nil && bytes.Equal(v.QueryResult, rhs.QueryResult))) {
		return false
	}
	if !_String_EqualsPtr(v.ErrorMessage, rhs.ErrorMessage) {
		return false
	}
	if !((v.WorkerVersionInfo == nil && rhs.WorkerVersionInfo == nil) || (v.WorkerVersionInfo != nil && rhs.WorkerVersionInfo != nil && v.WorkerVersionInfo.Equals(rhs.WorkerVersionInfo))) {
		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.TaskToken != nil {
		enc.AddString("taskToken", base64.StdEncoding.EncodeToString(v.TaskToken))
	}
	if v.CompletedType != nil {
		err = multierr.Append(err, enc.AddObject("completedType", *v.CompletedType))
	}
	if v.QueryResult != nil {
		enc.AddString("queryResult", base64.StdEncoding.EncodeToString(v.QueryResult))
	}
	if v.ErrorMessage != nil {
		enc.AddString("errorMessage", *v.ErrorMessage)
	}
	if v.WorkerVersionInfo != nil {
		err = multierr.Append(err, enc.AddObject("workerVersionInfo", v.WorkerVersionInfo))
	}
	return err
}

// GetTaskToken returns the value of TaskToken if it is set or its
// zero value if it is unset.
func (v *RespondQueryTaskCompletedRequest) GetTaskToken() (o []byte) {
	if v != nil && v.TaskToken != nil {
		return v.TaskToken
	}

	return
}

// IsSetTaskToken returns true if TaskToken is not nil.
func (v *RespondQueryTaskCompletedRequest) IsSetTaskToken() bool {
	return v != nil && v.TaskToken != nil
}

// GetCompletedType returns the value of CompletedType if it is set or its
// zero value if it is unset.
func (v *RespondQueryTaskCompletedRequest) GetCompletedType() (o QueryTaskCompletedType) {
	if v != nil && v.CompletedType != nil {
		return *v.CompletedType
	}

	return
}

// IsSetCompletedType returns true if CompletedType is not nil.
func (v *RespondQueryTaskCompletedRequest) IsSetCompletedType() bool {
	return v != nil && v.CompletedType != nil
}

// GetQueryResult returns the value of QueryResult if it is set or its
// zero value if it is unset.
func (v *RespondQueryTaskCompletedRequest) GetQueryResult() (o []byte) {
	if v != nil && v.QueryResult != nil {
		return v.QueryResult
	}

	return
}

// IsSetQueryResult returns true if QueryResult is not nil.
func (v *RespondQueryTaskCompletedRequest) IsSetQueryResult() bool {
	return v != nil && v.QueryResult != nil
}

// GetErrorMessage returns the value of ErrorMessage if it is set or its
// zero value if it is unset.
func (v *RespondQueryTaskCompletedRequest) GetErrorMessage() (o string) {
	if v != nil && v.ErrorMessage != nil {
		return *v.ErrorMessage
	}

	return
}

// IsSetErrorMessage returns true if ErrorMessage is not nil.
func (v *RespondQueryTaskCompletedRequest) IsSetErrorMessage() bool {
	return v != nil && v.ErrorMessage != nil
}

// GetWorkerVersionInfo returns the value of WorkerVersionInfo if it is set or its
// zero value if it is unset.
func (v *RespondQueryTaskCompletedRequest) GetWorkerVersionInfo() (o *WorkerVersionInfo) {
	if v != nil && v.WorkerVersionInfo != nil {
		return v.WorkerVersionInfo
	}

	return
}

// IsSetWorkerVersionInfo returns true if WorkerVersionInfo is not nil.
func (v *RespondQueryTaskCompletedRequest) IsSetWorkerVersionInfo() bool {
	return v != nil && v.WorkerVersionInfo != nil
}

type RestartWorkflowExecutionRequest struct {
	Domain            *string            `json:"domain,omitempty"`
	WorkflowExecution *WorkflowExecution `json:"workflowExecution,omitempty"`
	Reason            *string            `json:"reason,omitempty"`
	Identity          *string            `json:"identity,omitempty"`
}

// ToWire translates a RestartWorkflowExecutionRequest 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 *RestartWorkflowExecutionRequest) ToWire() (wire.Value, error) {
	var (
		fields [4]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.WorkflowExecution != nil {
		w, err = v.WorkflowExecution.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.Reason != nil {
		w, err = wire.NewValueString(*(v.Reason)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, 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: 40, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

// FromWire deserializes a RestartWorkflowExecutionRequest 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 RestartWorkflowExecutionRequest struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v RestartWorkflowExecutionRequest
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *RestartWorkflowExecutionRequest) 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.WorkflowExecution, 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.Reason = &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.Identity = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a RestartWorkflowExecutionRequest
// struct.
func (v *RestartWorkflowExecutionRequest) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [4]string
	i := 0
	if v.Domain != nil {
		fields[i] = fmt.Sprintf("Domain: %v", *(v.Domain))
		i++
	}
	if v.WorkflowExecution != nil {
		fields[i] = fmt.Sprintf("WorkflowExecution: %v", v.WorkflowExecution)
		i++
	}
	if v.Reason != nil {
		fields[i] = fmt.Sprintf("Reason: %v", *(v.Reason))
		i++
	}
	if v.Identity != nil {
		fields[i] = fmt.Sprintf("Identity: %v", *(v.Identity))
		i++
	}

	return fmt.Sprintf("RestartWorkflowExecutionRequest{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this RestartWorkflowExecutionRequest match the
// provided RestartWorkflowExecutionRequest.
//
// This function performs a deep comparison.
func (v *RestartWorkflowExecutionRequest) Equals(rhs *RestartWorkflowExecutionRequest) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.Domain, rhs.Domain) {
		return false
	}
	if !((v.WorkflowExecution == nil && rhs.WorkflowExecution == nil) || (v.WorkflowExecution != nil && rhs.WorkflowExecution != nil && v.WorkflowExecution.Equals(rhs.WorkflowExecution))) {
		return false
	}
	if !_String_EqualsPtr(v.Reason, rhs.Reason) {
		return false
	}
	if !_String_EqualsPtr(v.Identity, rhs.Identity) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of RestartWorkflowExecutionRequest.
func (v *RestartWorkflowExecutionRequest) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Domain != nil {
		enc.AddString("domain", *v.Domain)
	}
	if v.WorkflowExecution != nil {
		err = multierr.Append(err, enc.AddObject("workflowExecution", v.WorkflowExecution))
	}
	if v.Reason != nil {
		enc.AddString("reason", *v.Reason)
	}
	if v.Identity != nil {
		enc.AddString("identity", *v.Identity)
	}
	return err
}

// GetDomain returns the value of Domain if it is set or its
// zero value if it is unset.
func (v *RestartWorkflowExecutionRequest) GetDomain() (o string) {
	if v != nil && v.Domain != nil {
		return *v.Domain
	}

	return
}

// IsSetDomain returns true if Domain is not nil.
func (v *RestartWorkflowExecutionRequest) IsSetDomain() bool {
	return v != nil && v.Domain != nil
}

// GetWorkflowExecution returns the value of WorkflowExecution if it is set or its
// zero value if it is unset.
func (v *RestartWorkflowExecutionRequest) GetWorkflowExecution() (o *WorkflowExecution) {
	if v != nil && v.WorkflowExecution != nil {
		return v.WorkflowExecution
	}

	return
}

// IsSetWorkflowExecution returns true if WorkflowExecution is not nil.
func (v *RestartWorkflowExecutionRequest) IsSetWorkflowExecution() bool {
	return v != nil && v.WorkflowExecution != nil
}

// GetReason returns the value of Reason if it is set or its
// zero value if it is unset.
func (v *RestartWorkflowExecutionRequest) GetReason() (o string) {
	if v != nil && v.Reason != nil {
		return *v.Reason
	}

	return
}

// IsSetReason returns true if Reason is not nil.
func (v *RestartWorkflowExecutionRequest) IsSetReason() bool {
	return v != nil && v.Reason != nil
}

// GetIdentity returns the value of Identity if it is set or its
// zero value if it is unset.
func (v *RestartWorkflowExecutionRequest) GetIdentity() (o string) {
	if v != nil && v.Identity != nil {
		return *v.Identity
	}

	return
}

// IsSetIdentity returns true if Identity is not nil.
func (v *RestartWorkflowExecutionRequest) IsSetIdentity() bool {
	return v != nil && v.Identity != nil
}

type RestartWorkflowExecutionResponse struct {
	RunId *string `json:"runId,omitempty"`
}

// ToWire translates a RestartWorkflowExecutionResponse 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 *RestartWorkflowExecutionResponse) ToWire() (wire.Value, error) {
	var (
		fields [1]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.RunId != nil {
		w, err = wire.NewValueString(*(v.RunId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

// FromWire deserializes a RestartWorkflowExecutionResponse 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 RestartWorkflowExecutionResponse struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v RestartWorkflowExecutionResponse
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *RestartWorkflowExecutionResponse) 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.RunId = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a RestartWorkflowExecutionResponse
// struct.
func (v *RestartWorkflowExecutionResponse) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [1]string
	i := 0
	if v.RunId != nil {
		fields[i] = fmt.Sprintf("RunId: %v", *(v.RunId))
		i++
	}

	return fmt.Sprintf("RestartWorkflowExecutionResponse{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this RestartWorkflowExecutionResponse match the
// provided RestartWorkflowExecutionResponse.
//
// This function performs a deep comparison.
func (v *RestartWorkflowExecutionResponse) Equals(rhs *RestartWorkflowExecutionResponse) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.RunId, rhs.RunId) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of RestartWorkflowExecutionResponse.
func (v *RestartWorkflowExecutionResponse) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.RunId != nil {
		enc.AddString("runId", *v.RunId)
	}
	return err
}

// GetRunId returns the value of RunId if it is set or its
// zero value if it is unset.
func (v *RestartWorkflowExecutionResponse) GetRunId() (o string) {
	if v != nil && v.RunId != nil {
		return *v.RunId
	}

	return
}

// IsSetRunId returns true if RunId is not nil.
func (v *RestartWorkflowExecutionResponse) IsSetRunId() bool {
	return v != nil && v.RunId != nil
}

type RetryPolicy struct {
	InitialIntervalInSeconds    *int32   `json:"initialIntervalInSeconds,omitempty"`
	BackoffCoefficient          *float64 `json:"backoffCoefficient,omitempty"`
	MaximumIntervalInSeconds    *int32   `json:"maximumIntervalInSeconds,omitempty"`
	MaximumAttempts             *int32   `json:"maximumAttempts,omitempty"`
	NonRetriableErrorReasons    []string `json:"nonRetriableErrorReasons,omitempty"`
	ExpirationIntervalInSeconds *int32   `json:"expirationIntervalInSeconds,omitempty"`
}

// ToWire translates a RetryPolicy 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 *RetryPolicy) ToWire() (wire.Value, error) {
	var (
		fields [6]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.InitialIntervalInSeconds != nil {
		w, err = wire.NewValueI32(*(v.InitialIntervalInSeconds)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.BackoffCoefficient != nil {
		w, err = wire.NewValueDouble(*(v.BackoffCoefficient)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.MaximumIntervalInSeconds != nil {
		w, err = wire.NewValueI32(*(v.MaximumIntervalInSeconds)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.MaximumAttempts != nil {
		w, err = wire.NewValueI32(*(v.MaximumAttempts)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 40, Value: w}
		i++
	}
	if v.NonRetriableErrorReasons != nil {
		w, err = wire.NewValueList(_List_String_ValueList(v.NonRetriableErrorReasons)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 50, Value: w}
		i++
	}
	if v.ExpirationIntervalInSeconds != nil {
		w, err = wire.NewValueI32(*(v.ExpirationIntervalInSeconds)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 60, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

// FromWire deserializes a RetryPolicy 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 RetryPolicy struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v RetryPolicy
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *RetryPolicy) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			if field.Value.Type() == wire.TI32 {
				var x int32
				x, err = field.Value.GetI32(), error(nil)
				v.InitialIntervalInSeconds = &x
				if err != nil {
					return err
				}

			}
		case 20:
			if field.Value.Type() == wire.TDouble {
				var x float64
				x, err = field.Value.GetDouble(), error(nil)
				v.BackoffCoefficient = &x
				if err != nil {
					return err
				}

			}
		case 30:
			if field.Value.Type() == wire.TI32 {
				var x int32
				x, err = field.Value.GetI32(), error(nil)
				v.MaximumIntervalInSeconds = &x
				if err != nil {
					return err
				}

			}
		case 40:
			if field.Value.Type() == wire.TI32 {
				var x int32
				x, err = field.Value.GetI32(), error(nil)
				v.MaximumAttempts = &x
				if err != nil {
					return err
				}

			}
		case 50:
			if field.Value.Type() == wire.TList {
				v.NonRetriableErrorReasons, err = _List_String_Read(field.Value.GetList())
				if err != nil {
					return err
				}

			}
		case 60:
			if field.Value.Type() == wire.TI32 {
				var x int32
				x, err = field.Value.GetI32(), error(nil)
				v.ExpirationIntervalInSeconds = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a RetryPolicy
// struct.
func (v *RetryPolicy) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [6]string
	i := 0
	if v.InitialIntervalInSeconds != nil {
		fields[i] = fmt.Sprintf("InitialIntervalInSeconds: %v", *(v.InitialIntervalInSeconds))
		i++
	}
	if v.BackoffCoefficient != nil {
		fields[i] = fmt.Sprintf("BackoffCoefficient: %v", *(v.BackoffCoefficient))
		i++
	}
	if v.MaximumIntervalInSeconds != nil {
		fields[i] = fmt.Sprintf("MaximumIntervalInSeconds: %v", *(v.MaximumIntervalInSeconds))
		i++
	}
	if v.MaximumAttempts != nil {
		fields[i] = fmt.Sprintf("MaximumAttempts: %v", *(v.MaximumAttempts))
		i++
	}
	if v.NonRetriableErrorReasons != nil {
		fields[i] = fmt.Sprintf("NonRetriableErrorReasons: %v", v.NonRetriableErrorReasons)
		i++
	}
	if v.ExpirationIntervalInSeconds != nil {
		fields[i] = fmt.Sprintf("ExpirationIntervalInSeconds: %v", *(v.ExpirationIntervalInSeconds))
		i++
	}

	return fmt.Sprintf("RetryPolicy{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this RetryPolicy match the
// provided RetryPolicy.
//
// This function performs a deep comparison.
func (v *RetryPolicy) Equals(rhs *RetryPolicy) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_I32_EqualsPtr(v.InitialIntervalInSeconds, rhs.InitialIntervalInSeconds) {
		return false
	}
	if !_Double_EqualsPtr(v.BackoffCoefficient, rhs.BackoffCoefficient) {
		return false
	}
	if !_I32_EqualsPtr(v.MaximumIntervalInSeconds, rhs.MaximumIntervalInSeconds) {
		return false
	}
	if !_I32_EqualsPtr(v.MaximumAttempts, rhs.MaximumAttempts) {
		return false
	}
	if !((v.NonRetriableErrorReasons == nil && rhs.NonRetriableErrorReasons == nil) || (v.NonRetriableErrorReasons != nil && rhs.NonRetriableErrorReasons != nil && _List_String_Equals(v.NonRetriableErrorReasons, rhs.NonRetriableErrorReasons))) {
		return false
	}
	if !_I32_EqualsPtr(v.ExpirationIntervalInSeconds, rhs.ExpirationIntervalInSeconds) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of RetryPolicy.
func (v *RetryPolicy) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.InitialIntervalInSeconds != nil {
		enc.AddInt32("initialIntervalInSeconds", *v.InitialIntervalInSeconds)
	}
	if v.BackoffCoefficient != nil {
		enc.AddFloat64("backoffCoefficient", *v.BackoffCoefficient)
	}
	if v.MaximumIntervalInSeconds != nil {
		enc.AddInt32("maximumIntervalInSeconds", *v.MaximumIntervalInSeconds)
	}
	if v.MaximumAttempts != nil {
		enc.AddInt32("maximumAttempts", *v.MaximumAttempts)
	}
	if v.NonRetriableErrorReasons != nil {
		err = multierr.Append(err, enc.AddArray("nonRetriableErrorReasons", (_List_String_Zapper)(v.NonRetriableErrorReasons)))
	}
	if v.ExpirationIntervalInSeconds != nil {
		enc.AddInt32("expirationIntervalInSeconds", *v.ExpirationIntervalInSeconds)
	}
	return err
}

// GetInitialIntervalInSeconds returns the value of InitialIntervalInSeconds if it is set or its
// zero value if it is unset.
func (v *RetryPolicy) GetInitialIntervalInSeconds() (o int32) {
	if v != nil && v.InitialIntervalInSeconds != nil {
		return *v.InitialIntervalInSeconds
	}

	return
}

// IsSetInitialIntervalInSeconds returns true if InitialIntervalInSeconds is not nil.
func (v *RetryPolicy) IsSetInitialIntervalInSeconds() bool {
	return v != nil && v.InitialIntervalInSeconds != nil
}

// GetBackoffCoefficient returns the value of BackoffCoefficient if it is set or its
// zero value if it is unset.
func (v *RetryPolicy) GetBackoffCoefficient() (o float64) {
	if v != nil && v.BackoffCoefficient != nil {
		return *v.BackoffCoefficient
	}

	return
}

// IsSetBackoffCoefficient returns true if BackoffCoefficient is not nil.
func (v *RetryPolicy) IsSetBackoffCoefficient() bool {
	return v != nil && v.BackoffCoefficient != nil
}

// GetMaximumIntervalInSeconds returns the value of MaximumIntervalInSeconds if it is set or its
// zero value if it is unset.
func (v *RetryPolicy) GetMaximumIntervalInSeconds() (o int32) {
	if v != nil && v.MaximumIntervalInSeconds != nil {
		return *v.MaximumIntervalInSeconds
	}

	return
}

// IsSetMaximumIntervalInSeconds returns true if MaximumIntervalInSeconds is not nil.
func (v *RetryPolicy) IsSetMaximumIntervalInSeconds() bool {
	return v != nil && v.MaximumIntervalInSeconds != nil
}

// GetMaximumAttempts returns the value of MaximumAttempts if it is set or its
// zero value if it is unset.
func (v *RetryPolicy) GetMaximumAttempts() (o int32) {
	if v != nil && v.MaximumAttempts != nil {
		return *v.MaximumAttempts
	}

	return
}

// IsSetMaximumAttempts returns true if MaximumAttempts is not nil.
func (v *RetryPolicy) IsSetMaximumAttempts() bool {
	return v != nil && v.MaximumAttempts != nil
}

// GetNonRetriableErrorReasons returns the value of NonRetriableErrorReasons if it is set or its
// zero value if it is unset.
func (v *RetryPolicy) GetNonRetriableErrorReasons() (o []string) {
	if v != nil && v.NonRetriableErrorReasons != nil {
		return v.NonRetriableErrorReasons
	}

	return
}

// IsSetNonRetriableErrorReasons returns true if NonRetriableErrorReasons is not nil.
func (v *RetryPolicy) IsSetNonRetriableErrorReasons() bool {
	return v != nil && v.NonRetriableErrorReasons != nil
}

// GetExpirationIntervalInSeconds returns the value of ExpirationIntervalInSeconds if it is set or its
// zero value if it is unset.
func (v *RetryPolicy) GetExpirationIntervalInSeconds() (o int32) {
	if v != nil && v.ExpirationIntervalInSeconds != nil {
		return *v.ExpirationIntervalInSeconds
	}

	return
}

// IsSetExpirationIntervalInSeconds returns true if ExpirationIntervalInSeconds is not nil.
func (v *RetryPolicy) IsSetExpirationIntervalInSeconds() bool {
	return v != nil && v.ExpirationIntervalInSeconds != nil
}

type RetryTaskV2Error struct {
	Message           string  `json:"message,required"`
	DomainId          *string `json:"domainId,omitempty"`
	WorkflowId        *string `json:"workflowId,omitempty"`
	RunId             *string `json:"runId,omitempty"`
	StartEventId      *int64  `json:"startEventId,omitempty"`
	StartEventVersion *int64  `json:"startEventVersion,omitempty"`
	EndEventId        *int64  `json:"endEventId,omitempty"`
	EndEventVersion   *int64  `json:"endEventVersion,omitempty"`
}

// ToWire translates a RetryTaskV2Error 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 *RetryTaskV2Error) ToWire() (wire.Value, error) {
	var (
		fields [8]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++
	if v.DomainId != nil {
		w, err = wire.NewValueString(*(v.DomainId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 2, Value: w}
		i++
	}
	if v.WorkflowId != nil {
		w, err = wire.NewValueString(*(v.WorkflowId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 3, Value: w}
		i++
	}
	if v.RunId != nil {
		w, err = wire.NewValueString(*(v.RunId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 4, Value: w}
		i++
	}
	if v.StartEventId != nil {
		w, err = wire.NewValueI64(*(v.StartEventId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 5, Value: w}
		i++
	}
	if v.StartEventVersion != nil {
		w, err = wire.NewValueI64(*(v.StartEventVersion)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 6, Value: w}
		i++
	}
	if v.EndEventId != nil {
		w, err = wire.NewValueI64(*(v.EndEventId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 7, Value: w}
		i++
	}
	if v.EndEventVersion != nil {
		w, err = wire.NewValueI64(*(v.EndEventVersion)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 8, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

// FromWire deserializes a RetryTaskV2Error 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 RetryTaskV2Error struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v RetryTaskV2Error
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *RetryTaskV2Error) 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
			}
		case 2:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.DomainId = &x
				if err != nil {
					return err
				}

			}
		case 3:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.WorkflowId = &x
				if err != nil {
					return err
				}

			}
		case 4:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.RunId = &x
				if err != nil {
					return err
				}

			}
		case 5:
			if field.Value.Type() == wire.TI64 {
				var x int64
				x, err = field.Value.GetI64(), error(nil)
				v.StartEventId = &x
				if err != nil {
					return err
				}

			}
		case 6:
			if field.Value.Type() == wire.TI64 {
				var x int64
				x, err = field.Value.GetI64(), error(nil)
				v.StartEventVersion = &x
				if err != nil {
					return err
				}

			}
		case 7:
			if field.Value.Type() == wire.TI64 {
				var x int64
				x, err = field.Value.GetI64(), error(nil)
				v.EndEventId = &x
				if err != nil {
					return err
				}

			}
		case 8:
			if field.Value.Type() == wire.TI64 {
				var x int64
				x, err = field.Value.GetI64(), error(nil)
				v.EndEventVersion = &x
				if err != nil {
					return err
				}

			}
		}
	}

	if !messageIsSet {
		return errors.New("field Message of RetryTaskV2Error is required")
	}

	return nil
}

// String returns a readable string representation of a RetryTaskV2Error
// struct.
func (v *RetryTaskV2Error) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [8]string
	i := 0
	fields[i] = fmt.Sprintf("Message: %v", v.Message)
	i++
	if v.DomainId != nil {
		fields[i] = fmt.Sprintf("DomainId: %v", *(v.DomainId))
		i++
	}
	if v.WorkflowId != nil {
		fields[i] = fmt.Sprintf("WorkflowId: %v", *(v.WorkflowId))
		i++
	}
	if v.RunId != nil {
		fields[i] = fmt.Sprintf("RunId: %v", *(v.RunId))
		i++
	}
	if v.StartEventId != nil {
		fields[i] = fmt.Sprintf("StartEventId: %v", *(v.StartEventId))
		i++
	}
	if v.StartEventVersion != nil {
		fields[i] = fmt.Sprintf("StartEventVersion: %v", *(v.StartEventVersion))
		i++
	}
	if v.EndEventId != nil {
		fields[i] = fmt.Sprintf("EndEventId: %v", *(v.EndEventId))
		i++
	}
	if v.EndEventVersion != nil {
		fields[i] = fmt.Sprintf("EndEventVersion: %v", *(v.EndEventVersion))
		i++
	}

	return fmt.Sprintf("RetryTaskV2Error{%v}", strings.Join(fields[:i], ", "))
}

// ErrorName is the name of this type as defined in the Thrift
// file.
func (*RetryTaskV2Error) ErrorName() string {
	return "RetryTaskV2Error"
}

// Equals returns true if all the fields of this RetryTaskV2Error match the
// provided RetryTaskV2Error.
//
// This function performs a deep comparison.
func (v *RetryTaskV2Error) Equals(rhs *RetryTaskV2Error) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !(v.Message == rhs.Message) {
		return false
	}
	if !_String_EqualsPtr(v.DomainId, rhs.DomainId) {
		return false
	}
	if !_String_EqualsPtr(v.WorkflowId, rhs.WorkflowId) {
		return false
	}
	if !_String_EqualsPtr(v.RunId, rhs.RunId) {
		return false
	}
	if !_I64_EqualsPtr(v.StartEventId, rhs.StartEventId) {
		return false
	}
	if !_I64_EqualsPtr(v.StartEventVersion, rhs.StartEventVersion) {
		return false
	}
	if !_I64_EqualsPtr(v.EndEventId, rhs.EndEventId) {
		return false
	}
	if !_I64_EqualsPtr(v.EndEventVersion, rhs.EndEventVersion) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of RetryTaskV2Error.
func (v *RetryTaskV2Error) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	enc.AddString("message", v.Message)
	if v.DomainId != nil {
		enc.AddString("domainId", *v.DomainId)
	}
	if v.WorkflowId != nil {
		enc.AddString("workflowId", *v.WorkflowId)
	}
	if v.RunId != nil {
		enc.AddString("runId", *v.RunId)
	}
	if v.StartEventId != nil {
		enc.AddInt64("startEventId", *v.StartEventId)
	}
	if v.StartEventVersion != nil {
		enc.AddInt64("startEventVersion", *v.StartEventVersion)
	}
	if v.EndEventId != nil {
		enc.AddInt64("endEventId", *v.EndEventId)
	}
	if v.EndEventVersion != nil {
		enc.AddInt64("endEventVersion", *v.EndEventVersion)
	}
	return err
}

// GetMessage returns the value of Message if it is set or its
// zero value if it is unset.
func (v *RetryTaskV2Error) GetMessage() (o string) {
	if v != nil {
		o = v.Message
	}
	return
}

// GetDomainId returns the value of DomainId if it is set or its
// zero value if it is unset.
func (v *RetryTaskV2Error) GetDomainId() (o string) {
	if v != nil && v.DomainId != nil {
		return *v.DomainId
	}

	return
}

// IsSetDomainId returns true if DomainId is not nil.
func (v *RetryTaskV2Error) IsSetDomainId() bool {
	return v != nil && v.DomainId != nil
}

// GetWorkflowId returns the value of WorkflowId if it is set or its
// zero value if it is unset.
func (v *RetryTaskV2Error) GetWorkflowId() (o string) {
	if v != nil && v.WorkflowId != nil {
		return *v.WorkflowId
	}

	return
}

// IsSetWorkflowId returns true if WorkflowId is not nil.
func (v *RetryTaskV2Error) IsSetWorkflowId() bool {
	return v != nil && v.WorkflowId != nil
}

// GetRunId returns the value of RunId if it is set or its
// zero value if it is unset.
func (v *RetryTaskV2Error) GetRunId() (o string) {
	if v != nil && v.RunId != nil {
		return *v.RunId
	}

	return
}

// IsSetRunId returns true if RunId is not nil.
func (v *RetryTaskV2Error) IsSetRunId() bool {
	return v != nil && v.RunId != nil
}

// GetStartEventId returns the value of StartEventId if it is set or its
// zero value if it is unset.
func (v *RetryTaskV2Error) GetStartEventId() (o int64) {
	if v != nil && v.StartEventId != nil {
		return *v.StartEventId
	}

	return
}

// IsSetStartEventId returns true if StartEventId is not nil.
func (v *RetryTaskV2Error) IsSetStartEventId() bool {
	return v != nil && v.StartEventId != nil
}

// GetStartEventVersion returns the value of StartEventVersion if it is set or its
// zero value if it is unset.
func (v *RetryTaskV2Error) GetStartEventVersion() (o int64) {
	if v != nil && v.StartEventVersion != nil {
		return *v.StartEventVersion
	}

	return
}

// IsSetStartEventVersion returns true if StartEventVersion is not nil.
func (v *RetryTaskV2Error) IsSetStartEventVersion() bool {
	return v != nil && v.StartEventVersion != nil
}

// GetEndEventId returns the value of EndEventId if it is set or its
// zero value if it is unset.
func (v *RetryTaskV2Error) GetEndEventId() (o int64) {
	if v != nil && v.EndEventId != nil {
		return *v.EndEventId
	}

	return
}

// IsSetEndEventId returns true if EndEventId is not nil.
func (v *RetryTaskV2Error) IsSetEndEventId() bool {
	return v != nil && v.EndEventId != nil
}

// GetEndEventVersion returns the value of EndEventVersion if it is set or its
// zero value if it is unset.
func (v *RetryTaskV2Error) GetEndEventVersion() (o int64) {
	if v != nil && v.EndEventVersion != nil {
		return *v.EndEventVersion
	}

	return
}

// IsSetEndEventVersion returns true if EndEventVersion is not nil.
func (v *RetryTaskV2Error) IsSetEndEventVersion() bool {
	return v != nil && v.EndEventVersion != nil
}

func (v *RetryTaskV2Error) Error() string {
	return v.String()
}

type ScheduleActivityTaskDecisionAttributes struct {
	ActivityId                    *string       `json:"activityId,omitempty"`
	ActivityType                  *ActivityType `json:"activityType,omitempty"`
	Domain                        *string       `json:"domain,omitempty"`
	TaskList                      *TaskList     `json:"taskList,omitempty"`
	Input                         []byte        `json:"input,omitempty"`
	ScheduleToCloseTimeoutSeconds *int32        `json:"scheduleToCloseTimeoutSeconds,omitempty"`
	ScheduleToStartTimeoutSeconds *int32        `json:"scheduleToStartTimeoutSeconds,omitempty"`
	StartToCloseTimeoutSeconds    *int32        `json:"startToCloseTimeoutSeconds,omitempty"`
	HeartbeatTimeoutSeconds       *int32        `json:"heartbeatTimeoutSeconds,omitempty"`
	RetryPolicy                   *RetryPolicy  `json:"retryPolicy,omitempty"`
	Header                        *Header       `json:"header,omitempty"`
	RequestLocalDispatch          *bool         `json:"requestLocalDispatch,omitempty"`
}

// ToWire translates a ScheduleActivityTaskDecisionAttributes 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 *ScheduleActivityTaskDecisionAttributes) ToWire() (wire.Value, error) {
	var (
		fields [12]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.ActivityType != nil {
		w, err = v.ActivityType.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.Domain != nil {
		w, err = wire.NewValueString(*(v.Domain)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 25, 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.Input != nil {
		w, err = wire.NewValueBinary(v.Input), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 40, Value: w}
		i++
	}
	if v.ScheduleToCloseTimeoutSeconds != nil {
		w, err = wire.NewValueI32(*(v.ScheduleToCloseTimeoutSeconds)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 45, 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.StartToCloseTimeoutSeconds != nil {
		w, err = wire.NewValueI32(*(v.StartToCloseTimeoutSeconds)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 55, Value: w}
		i++
	}
	if v.HeartbeatTimeoutSeconds != nil {
		w, err = wire.NewValueI32(*(v.HeartbeatTimeoutSeconds)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 60, Value: w}
		i++
	}
	if v.RetryPolicy != nil {
		w, err = v.RetryPolicy.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 70, Value: w}
		i++
	}
	if v.Header != nil {
		w, err = v.Header.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 80, Value: w}
		i++
	}
	if v.RequestLocalDispatch != nil {
		w, err = wire.NewValueBool(*(v.RequestLocalDispatch)), 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
}

// FromWire deserializes a ScheduleActivityTaskDecisionAttributes 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 ScheduleActivityTaskDecisionAttributes struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v ScheduleActivityTaskDecisionAttributes
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *ScheduleActivityTaskDecisionAttributes) 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.TStruct {
				v.ActivityType, err = _ActivityType_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 25:
			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 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 {
				v.Input, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		case 45:
			if field.Value.Type() == wire.TI32 {
				var x int32
				x, err = field.Value.GetI32(), error(nil)
				v.ScheduleToCloseTimeoutSeconds = &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 55:
			if field.Value.Type() == wire.TI32 {
				var x int32
				x, err = field.Value.GetI32(), error(nil)
				v.StartToCloseTimeoutSeconds = &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.HeartbeatTimeoutSeconds = &x
				if err != nil {
					return err
				}

			}
		case 70:
			if field.Value.Type() == wire.TStruct {
				v.RetryPolicy, err = _RetryPolicy_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 80:
			if field.Value.Type() == wire.TStruct {
				v.Header, err = _Header_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 90:
			if field.Value.Type() == wire.TBool {
				var x bool
				x, err = field.Value.GetBool(), error(nil)
				v.RequestLocalDispatch = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a ScheduleActivityTaskDecisionAttributes
// struct.
func (v *ScheduleActivityTaskDecisionAttributes) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [12]string
	i := 0
	if v.ActivityId != nil {
		fields[i] = fmt.Sprintf("ActivityId: %v", *(v.ActivityId))
		i++
	}
	if v.ActivityType != nil {
		fields[i] = fmt.Sprintf("ActivityType: %v", v.ActivityType)
		i++
	}
	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++
	}
	if v.Input != nil {
		fields[i] = fmt.Sprintf("Input: %v", v.Input)
		i++
	}
	if v.ScheduleToCloseTimeoutSeconds != nil {
		fields[i] = fmt.Sprintf("ScheduleToCloseTimeoutSeconds: %v", *(v.ScheduleToCloseTimeoutSeconds))
		i++
	}
	if v.ScheduleToStartTimeoutSeconds != nil {
		fields[i] = fmt.Sprintf("ScheduleToStartTimeoutSeconds: %v", *(v.ScheduleToStartTimeoutSeconds))
		i++
	}
	if v.StartToCloseTimeoutSeconds != nil {
		fields[i] = fmt.Sprintf("StartToCloseTimeoutSeconds: %v", *(v.StartToCloseTimeoutSeconds))
		i++
	}
	if v.HeartbeatTimeoutSeconds != nil {
		fields[i] = fmt.Sprintf("HeartbeatTimeoutSeconds: %v", *(v.HeartbeatTimeoutSeconds))
		i++
	}
	if v.RetryPolicy != nil {
		fields[i] = fmt.Sprintf("RetryPolicy: %v", v.RetryPolicy)
		i++
	}
	if v.Header != nil {
		fields[i] = fmt.Sprintf("Header: %v", v.Header)
		i++
	}
	if v.RequestLocalDispatch != nil {
		fields[i] = fmt.Sprintf("RequestLocalDispatch: %v", *(v.RequestLocalDispatch))
		i++
	}

	return fmt.Sprintf("ScheduleActivityTaskDecisionAttributes{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this ScheduleActivityTaskDecisionAttributes match the
// provided ScheduleActivityTaskDecisionAttributes.
//
// This function performs a deep comparison.
func (v *ScheduleActivityTaskDecisionAttributes) Equals(rhs *ScheduleActivityTaskDecisionAttributes) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.ActivityId, rhs.ActivityId) {
		return false
	}
	if !((v.ActivityType == nil && rhs.ActivityType == nil) || (v.ActivityType != nil && rhs.ActivityType != nil && v.ActivityType.Equals(rhs.ActivityType))) {
		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
	}
	if !((v.Input == nil && rhs.Input == nil) || (v.Input != nil && rhs.Input != nil && bytes.Equal(v.Input, rhs.Input))) {
		return false
	}
	if !_I32_EqualsPtr(v.ScheduleToCloseTimeoutSeconds, rhs.ScheduleToCloseTimeoutSeconds) {
		return false
	}
	if !_I32_EqualsPtr(v.ScheduleToStartTimeoutSeconds, rhs.ScheduleToStartTimeoutSeconds) {
		return false
	}
	if !_I32_EqualsPtr(v.StartToCloseTimeoutSeconds, rhs.StartToCloseTimeoutSeconds) {
		return false
	}
	if !_I32_EqualsPtr(v.HeartbeatTimeoutSeconds, rhs.HeartbeatTimeoutSeconds) {
		return false
	}
	if !((v.RetryPolicy == nil && rhs.RetryPolicy == nil) || (v.RetryPolicy != nil && rhs.RetryPolicy != nil && v.RetryPolicy.Equals(rhs.RetryPolicy))) {
		return false
	}
	if !((v.Header == nil && rhs.Header == nil) || (v.Header != nil && rhs.Header != nil && v.Header.Equals(rhs.Header))) {
		return false
	}
	if !_Bool_EqualsPtr(v.RequestLocalDispatch, rhs.RequestLocalDispatch) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of ScheduleActivityTaskDecisionAttributes.
func (v *ScheduleActivityTaskDecisionAttributes) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.ActivityId != nil {
		enc.AddString("activityId", *v.ActivityId)
	}
	if v.ActivityType != nil {
		err = multierr.Append(err, enc.AddObject("activityType", v.ActivityType))
	}
	if v.Domain != nil {
		enc.AddString("domain", *v.Domain)
	}
	if v.TaskList != nil {
		err = multierr.Append(err, enc.AddObject("taskList", v.TaskList))
	}
	if v.Input != nil {
		enc.AddString("input", base64.StdEncoding.EncodeToString(v.Input))
	}
	if v.ScheduleToCloseTimeoutSeconds != nil {
		enc.AddInt32("scheduleToCloseTimeoutSeconds", *v.ScheduleToCloseTimeoutSeconds)
	}
	if v.ScheduleToStartTimeoutSeconds != nil {
		enc.AddInt32("scheduleToStartTimeoutSeconds", *v.ScheduleToStartTimeoutSeconds)
	}
	if v.StartToCloseTimeoutSeconds != nil {
		enc.AddInt32("startToCloseTimeoutSeconds", *v.StartToCloseTimeoutSeconds)
	}
	if v.HeartbeatTimeoutSeconds != nil {
		enc.AddInt32("heartbeatTimeoutSeconds", *v.HeartbeatTimeoutSeconds)
	}
	if v.RetryPolicy != nil {
		err = multierr.Append(err, enc.AddObject("retryPolicy", v.RetryPolicy))
	}
	if v.Header != nil {
		err = multierr.Append(err, enc.AddObject("header", v.Header))
	}
	if v.RequestLocalDispatch != nil {
		enc.AddBool("requestLocalDispatch", *v.RequestLocalDispatch)
	}
	return err
}

// GetActivityId returns the value of ActivityId if it is set or its
// zero value if it is unset.
func (v *ScheduleActivityTaskDecisionAttributes) GetActivityId() (o string) {
	if v != nil && v.ActivityId != nil {
		return *v.ActivityId
	}

	return
}

// IsSetActivityId returns true if ActivityId is not nil.
func (v *ScheduleActivityTaskDecisionAttributes) IsSetActivityId() bool {
	return v != nil && v.ActivityId != nil
}

// GetActivityType returns the value of ActivityType if it is set or its
// zero value if it is unset.
func (v *ScheduleActivityTaskDecisionAttributes) GetActivityType() (o *ActivityType) {
	if v != nil && v.ActivityType != nil {
		return v.ActivityType
	}

	return
}

// IsSetActivityType returns true if ActivityType is not nil.
func (v *ScheduleActivityTaskDecisionAttributes) IsSetActivityType() bool {
	return v != nil && v.ActivityType != nil
}

// GetDomain returns the value of Domain if it is set or its
// zero value if it is unset.
func (v *ScheduleActivityTaskDecisionAttributes) GetDomain() (o string) {
	if v != nil && v.Domain != nil {
		return *v.Domain
	}

	return
}

// IsSetDomain returns true if Domain is not nil.
func (v *ScheduleActivityTaskDecisionAttributes) 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 *ScheduleActivityTaskDecisionAttributes) GetTaskList() (o *TaskList) {
	if v != nil && v.TaskList != nil {
		return v.TaskList
	}

	return
}

// IsSetTaskList returns true if TaskList is not nil.
func (v *ScheduleActivityTaskDecisionAttributes) IsSetTaskList() bool {
	return v != nil && v.TaskList != nil
}

// GetInput returns the value of Input if it is set or its
// zero value if it is unset.
func (v *ScheduleActivityTaskDecisionAttributes) GetInput() (o []byte) {
	if v != nil && v.Input != nil {
		return v.Input
	}

	return
}

// IsSetInput returns true if Input is not nil.
func (v *ScheduleActivityTaskDecisionAttributes) IsSetInput() bool {
	return v != nil && v.Input != nil
}

// GetScheduleToCloseTimeoutSeconds returns the value of ScheduleToCloseTimeoutSeconds if it is set or its
// zero value if it is unset.
func (v *ScheduleActivityTaskDecisionAttributes) GetScheduleToCloseTimeoutSeconds() (o int32) {
	if v != nil && v.ScheduleToCloseTimeoutSeconds != nil {
		return *v.ScheduleToCloseTimeoutSeconds
	}

	return
}

// IsSetScheduleToCloseTimeoutSeconds returns true if ScheduleToCloseTimeoutSeconds is not nil.
func (v *ScheduleActivityTaskDecisionAttributes) IsSetScheduleToCloseTimeoutSeconds() bool {
	return v != nil && v.ScheduleToCloseTimeoutSeconds != nil
}

// GetScheduleToStartTimeoutSeconds returns the value of ScheduleToStartTimeoutSeconds if it is set or its
// zero value if it is unset.
func (v *ScheduleActivityTaskDecisionAttributes) GetScheduleToStartTimeoutSeconds() (o int32) {
	if v != nil && v.ScheduleToStartTimeoutSeconds != nil {
		return *v.ScheduleToStartTimeoutSeconds
	}

	return
}

// IsSetScheduleToStartTimeoutSeconds returns true if ScheduleToStartTimeoutSeconds is not nil.
func (v *ScheduleActivityTaskDecisionAttributes) IsSetScheduleToStartTimeoutSeconds() bool {
	return v != nil && v.ScheduleToStartTimeoutSeconds != nil
}

// GetStartToCloseTimeoutSeconds returns the value of StartToCloseTimeoutSeconds if it is set or its
// zero value if it is unset.
func (v *ScheduleActivityTaskDecisionAttributes) GetStartToCloseTimeoutSeconds() (o int32) {
	if v != nil && v.StartToCloseTimeoutSeconds != nil {
		return *v.StartToCloseTimeoutSeconds
	}

	return
}

// IsSetStartToCloseTimeoutSeconds returns true if StartToCloseTimeoutSeconds is not nil.
func (v *ScheduleActivityTaskDecisionAttributes) IsSetStartToCloseTimeoutSeconds() bool {
	return v != nil && v.StartToCloseTimeoutSeconds != nil
}

// GetHeartbeatTimeoutSeconds returns the value of HeartbeatTimeoutSeconds if it is set or its
// zero value if it is unset.
func (v *ScheduleActivityTaskDecisionAttributes) GetHeartbeatTimeoutSeconds() (o int32) {
	if v != nil && v.HeartbeatTimeoutSeconds != nil {
		return *v.HeartbeatTimeoutSeconds
	}

	return
}

// IsSetHeartbeatTimeoutSeconds returns true if HeartbeatTimeoutSeconds is not nil.
func (v *ScheduleActivityTaskDecisionAttributes) IsSetHeartbeatTimeoutSeconds() bool {
	return v != nil && v.HeartbeatTimeoutSeconds != nil
}

// GetRetryPolicy returns the value of RetryPolicy if it is set or its
// zero value if it is unset.
func (v *ScheduleActivityTaskDecisionAttributes) GetRetryPolicy() (o *RetryPolicy) {
	if v != nil && v.RetryPolicy != nil {
		return v.RetryPolicy
	}

	return
}

// IsSetRetryPolicy returns true if RetryPolicy is not nil.
func (v *ScheduleActivityTaskDecisionAttributes) IsSetRetryPolicy() bool {
	return v != nil && v.RetryPolicy != nil
}

// GetHeader returns the value of Header if it is set or its
// zero value if it is unset.
func (v *ScheduleActivityTaskDecisionAttributes) GetHeader() (o *Header) {
	if v != nil && v.Header != nil {
		return v.Header
	}

	return
}

// IsSetHeader returns true if Header is not nil.
func (v *ScheduleActivityTaskDecisionAttributes) IsSetHeader() bool {
	return v != nil && v.Header != nil
}

// GetRequestLocalDispatch returns the value of RequestLocalDispatch if it is set or its
// zero value if it is unset.
func (v *ScheduleActivityTaskDecisionAttributes) GetRequestLocalDispatch() (o bool) {
	if v != nil && v.RequestLocalDispatch != nil {
		return *v.RequestLocalDispatch
	}

	return
}

// IsSetRequestLocalDispatch returns true if RequestLocalDispatch is not nil.
func (v *ScheduleActivityTaskDecisionAttributes) IsSetRequestLocalDispatch() bool {
	return v != nil && v.RequestLocalDispatch != nil
}

type SearchAttributes struct {
	IndexedFields map[string][]byte `json:"indexedFields,omitempty"`
}

// ToWire translates a SearchAttributes 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 *SearchAttributes) ToWire() (wire.Value, error) {
	var (
		fields [1]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.IndexedFields != nil {
		w, err = wire.NewValueMap(_Map_String_Binary_MapItemList(v.IndexedFields)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

// FromWire deserializes a SearchAttributes 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 SearchAttributes struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v SearchAttributes
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *SearchAttributes) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			if field.Value.Type() == wire.TMap {
				v.IndexedFields, err = _Map_String_Binary_Read(field.Value.GetMap())
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a SearchAttributes
// struct.
func (v *SearchAttributes) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [1]string
	i := 0
	if v.IndexedFields != nil {
		fields[i] = fmt.Sprintf("IndexedFields: %v", v.IndexedFields)
		i++
	}

	return fmt.Sprintf("SearchAttributes{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this SearchAttributes match the
// provided SearchAttributes.
//
// This function performs a deep comparison.
func (v *SearchAttributes) Equals(rhs *SearchAttributes) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !((v.IndexedFields == nil && rhs.IndexedFields == nil) || (v.IndexedFields != nil && rhs.IndexedFields != nil && _Map_String_Binary_Equals(v.IndexedFields, rhs.IndexedFields))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of SearchAttributes.
func (v *SearchAttributes) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.IndexedFields != nil {
		err = multierr.Append(err, enc.AddObject("indexedFields", (_Map_String_Binary_Zapper)(v.IndexedFields)))
	}
	return err
}

// GetIndexedFields returns the value of IndexedFields if it is set or its
// zero value if it is unset.
func (v *SearchAttributes) GetIndexedFields() (o map[string][]byte) {
	if v != nil && v.IndexedFields != nil {
		return v.IndexedFields
	}

	return
}

// IsSetIndexedFields returns true if IndexedFields is not nil.
func (v *SearchAttributes) IsSetIndexedFields() bool {
	return v != nil && v.IndexedFields != nil
}

type ServiceBusyError struct {
	Message string  `json:"message,required"`
	Reason  *string `json:"reason,omitempty"`
}

// ToWire translates a ServiceBusyError 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 *ServiceBusyError) ToWire() (wire.Value, error) {
	var (
		fields [2]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++
	if v.Reason != nil {
		w, err = wire.NewValueString(*(v.Reason)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 2, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

// FromWire deserializes a ServiceBusyError 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 ServiceBusyError struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v ServiceBusyError
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *ServiceBusyError) 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
			}
		case 2:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.Reason = &x
				if err != nil {
					return err
				}

			}
		}
	}

	if !messageIsSet {
		return errors.New("field Message of ServiceBusyError is required")
	}

	return nil
}

// String returns a readable string representation of a ServiceBusyError
// struct.
func (v *ServiceBusyError) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [2]string
	i := 0
	fields[i] = fmt.Sprintf("Message: %v", v.Message)
	i++
	if v.Reason != nil {
		fields[i] = fmt.Sprintf("Reason: %v", *(v.Reason))
		i++
	}

	return fmt.Sprintf("ServiceBusyError{%v}", strings.Join(fields[:i], ", "))
}

// ErrorName is the name of this type as defined in the Thrift
// file.
func (*ServiceBusyError) ErrorName() string {
	return "ServiceBusyError"
}

// Equals returns true if all the fields of this ServiceBusyError match the
// provided ServiceBusyError.
//
// This function performs a deep comparison.
func (v *ServiceBusyError) Equals(rhs *ServiceBusyError) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !(v.Message == rhs.Message) {
		return false
	}
	if !_String_EqualsPtr(v.Reason, rhs.Reason) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of ServiceBusyError.
func (v *ServiceBusyError) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	enc.AddString("message", v.Message)
	if v.Reason != nil {
		enc.AddString("reason", *v.Reason)
	}
	return err
}

// GetMessage returns the value of Message if it is set or its
// zero value if it is unset.
func (v *ServiceBusyError) GetMessage() (o string) {
	if v != nil {
		o = v.Message
	}
	return
}

// GetReason returns the value of Reason if it is set or its
// zero value if it is unset.
func (v *ServiceBusyError) GetReason() (o string) {
	if v != nil && v.Reason != nil {
		return *v.Reason
	}

	return
}

// IsSetReason returns true if Reason is not nil.
func (v *ServiceBusyError) IsSetReason() bool {
	return v != nil && v.Reason != nil
}

func (v *ServiceBusyError) Error() string {
	return v.String()
}

type SignalExternalWorkflowExecutionDecisionAttributes struct {
	Domain            *string            `json:"domain,omitempty"`
	Execution         *WorkflowExecution `json:"execution,omitempty"`
	SignalName        *string            `json:"signalName,omitempty"`
	Input             []byte             `json:"input,omitempty"`
	Control           []byte             `json:"control,omitempty"`
	ChildWorkflowOnly *bool              `json:"childWorkflowOnly,omitempty"`
}

// ToWire translates a SignalExternalWorkflowExecutionDecisionAttributes 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 *SignalExternalWorkflowExecutionDecisionAttributes) ToWire() (wire.Value, error) {
	var (
		fields [6]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.Execution != nil {
		w, err = v.Execution.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.SignalName != nil {
		w, err = wire.NewValueString(*(v.SignalName)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.Input != nil {
		w, err = wire.NewValueBinary(v.Input), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 40, Value: w}
		i++
	}
	if v.Control != nil {
		w, err = wire.NewValueBinary(v.Control), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 50, Value: w}
		i++
	}
	if v.ChildWorkflowOnly != nil {
		w, err = wire.NewValueBool(*(v.ChildWorkflowOnly)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 60, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

// FromWire deserializes a SignalExternalWorkflowExecutionDecisionAttributes 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 SignalExternalWorkflowExecutionDecisionAttributes struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v SignalExternalWorkflowExecutionDecisionAttributes
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *SignalExternalWorkflowExecutionDecisionAttributes) 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.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.SignalName = &x
				if err != nil {
					return err
				}

			}
		case 40:
			if field.Value.Type() == wire.TBinary {
				v.Input, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		case 50:
			if field.Value.Type() == wire.TBinary {
				v.Control, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		case 60:
			if field.Value.Type() == wire.TBool {
				var x bool
				x, err = field.Value.GetBool(), error(nil)
				v.ChildWorkflowOnly = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a SignalExternalWorkflowExecutionDecisionAttributes
// struct.
func (v *SignalExternalWorkflowExecutionDecisionAttributes) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [6]string
	i := 0
	if v.Domain != nil {
		fields[i] = fmt.Sprintf("Domain: %v", *(v.Domain))
		i++
	}
	if v.Execution != nil {
		fields[i] = fmt.Sprintf("Execution: %v", v.Execution)
		i++
	}
	if v.SignalName != nil {
		fields[i] = fmt.Sprintf("SignalName: %v", *(v.SignalName))
		i++
	}
	if v.Input != nil {
		fields[i] = fmt.Sprintf("Input: %v", v.Input)
		i++
	}
	if v.Control != nil {
		fields[i] = fmt.Sprintf("Control: %v", v.Control)
		i++
	}
	if v.ChildWorkflowOnly != nil {
		fields[i] = fmt.Sprintf("ChildWorkflowOnly: %v", *(v.ChildWorkflowOnly))
		i++
	}

	return fmt.Sprintf("SignalExternalWorkflowExecutionDecisionAttributes{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this SignalExternalWorkflowExecutionDecisionAttributes match the
// provided SignalExternalWorkflowExecutionDecisionAttributes.
//
// This function performs a deep comparison.
func (v *SignalExternalWorkflowExecutionDecisionAttributes) Equals(rhs *SignalExternalWorkflowExecutionDecisionAttributes) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.Domain, rhs.Domain) {
		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.SignalName, rhs.SignalName) {
		return false
	}
	if !((v.Input == nil && rhs.Input == nil) || (v.Input != nil && rhs.Input != nil && bytes.Equal(v.Input, rhs.Input))) {
		return false
	}
	if !((v.Control == nil && rhs.Control == nil) || (v.Control != nil && rhs.Control != nil && bytes.Equal(v.Control, rhs.Control))) {
		return false
	}
	if !_Bool_EqualsPtr(v.ChildWorkflowOnly, rhs.ChildWorkflowOnly) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of SignalExternalWorkflowExecutionDecisionAttributes.
func (v *SignalExternalWorkflowExecutionDecisionAttributes) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Domain != nil {
		enc.AddString("domain", *v.Domain)
	}
	if v.Execution != nil {
		err = multierr.Append(err, enc.AddObject("execution", v.Execution))
	}
	if v.SignalName != nil {
		enc.AddString("signalName", *v.SignalName)
	}
	if v.Input != nil {
		enc.AddString("input", base64.StdEncoding.EncodeToString(v.Input))
	}
	if v.Control != nil {
		enc.AddString("control", base64.StdEncoding.EncodeToString(v.Control))
	}
	if v.ChildWorkflowOnly != nil {
		enc.AddBool("childWorkflowOnly", *v.ChildWorkflowOnly)
	}
	return err
}

// GetDomain returns the value of Domain if it is set or its
// zero value if it is unset.
func (v *SignalExternalWorkflowExecutionDecisionAttributes) GetDomain() (o string) {
	if v != nil && v.Domain != nil {
		return *v.Domain
	}

	return
}

// IsSetDomain returns true if Domain is not nil.
func (v *SignalExternalWorkflowExecutionDecisionAttributes) IsSetDomain() bool {
	return v != nil && v.Domain != nil
}

// GetExecution returns the value of Execution if it is set or its
// zero value if it is unset.
func (v *SignalExternalWorkflowExecutionDecisionAttributes) GetExecution() (o *WorkflowExecution) {
	if v != nil && v.Execution != nil {
		return v.Execution
	}

	return
}

// IsSetExecution returns true if Execution is not nil.
func (v *SignalExternalWorkflowExecutionDecisionAttributes) IsSetExecution() bool {
	return v != nil && v.Execution != nil
}

// GetSignalName returns the value of SignalName if it is set or its
// zero value if it is unset.
func (v *SignalExternalWorkflowExecutionDecisionAttributes) GetSignalName() (o string) {
	if v != nil && v.SignalName != nil {
		return *v.SignalName
	}

	return
}

// IsSetSignalName returns true if SignalName is not nil.
func (v *SignalExternalWorkflowExecutionDecisionAttributes) IsSetSignalName() bool {
	return v != nil && v.SignalName != nil
}

// GetInput returns the value of Input if it is set or its
// zero value if it is unset.
func (v *SignalExternalWorkflowExecutionDecisionAttributes) GetInput() (o []byte) {
	if v != nil && v.Input != nil {
		return v.Input
	}

	return
}

// IsSetInput returns true if Input is not nil.
func (v *SignalExternalWorkflowExecutionDecisionAttributes) IsSetInput() bool {
	return v != nil && v.Input != nil
}

// GetControl returns the value of Control if it is set or its
// zero value if it is unset.
func (v *SignalExternalWorkflowExecutionDecisionAttributes) GetControl() (o []byte) {
	if v != nil && v.Control != nil {
		return v.Control
	}

	return
}

// IsSetControl returns true if Control is not nil.
func (v *SignalExternalWorkflowExecutionDecisionAttributes) IsSetControl() bool {
	return v != nil && v.Control != nil
}

// GetChildWorkflowOnly returns the value of ChildWorkflowOnly if it is set or its
// zero value if it is unset.
func (v *SignalExternalWorkflowExecutionDecisionAttributes) GetChildWorkflowOnly() (o bool) {
	if v != nil && v.ChildWorkflowOnly != nil {
		return *v.ChildWorkflowOnly
	}

	return
}

// IsSetChildWorkflowOnly returns true if ChildWorkflowOnly is not nil.
func (v *SignalExternalWorkflowExecutionDecisionAttributes) IsSetChildWorkflowOnly() bool {
	return v != nil && v.ChildWorkflowOnly != nil
}

type SignalExternalWorkflowExecutionFailedCause int32

const (
	SignalExternalWorkflowExecutionFailedCauseUnknownExternalWorkflowExecution SignalExternalWorkflowExecutionFailedCause = 0
	SignalExternalWorkflowExecutionFailedCauseWorkflowAlreadyCompleted         SignalExternalWorkflowExecutionFailedCause = 1
)

// SignalExternalWorkflowExecutionFailedCause_Values returns all recognized values of SignalExternalWorkflowExecutionFailedCause.
func SignalExternalWorkflowExecutionFailedCause_Values() []SignalExternalWorkflowExecutionFailedCause {
	return []SignalExternalWorkflowExecutionFailedCause{
		SignalExternalWorkflowExecutionFailedCauseUnknownExternalWorkflowExecution,
		SignalExternalWorkflowExecutionFailedCauseWorkflowAlreadyCompleted,
	}
}

// UnmarshalText tries to decode SignalExternalWorkflowExecutionFailedCause from a byte slice
// containing its name.
//
//	var v SignalExternalWorkflowExecutionFailedCause
//	err := v.UnmarshalText([]byte("UNKNOWN_EXTERNAL_WORKFLOW_EXECUTION"))
func (v *SignalExternalWorkflowExecutionFailedCause) UnmarshalText(value []byte) error {
	switch s := string(value); s {
	case "UNKNOWN_EXTERNAL_WORKFLOW_EXECUTION":
		*v = SignalExternalWorkflowExecutionFailedCauseUnknownExternalWorkflowExecution
		return nil
	case "WORKFLOW_ALREADY_COMPLETED":
		*v = SignalExternalWorkflowExecutionFailedCauseWorkflowAlreadyCompleted
		return nil
	default:
		val, err := strconv.ParseInt(s, 10, 32)
		if err != nil {
			return fmt.Errorf("unknown enum value %q for %q: %v", s, "SignalExternalWorkflowExecutionFailedCause", err)
		}
		*v = SignalExternalWorkflowExecutionFailedCause(val)
		return nil
	}
}

// MarshalText encodes SignalExternalWorkflowExecutionFailedCause 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 SignalExternalWorkflowExecutionFailedCause) MarshalText() ([]byte, error) {
	switch int32(v) {
	case 0:
		return []byte("UNKNOWN_EXTERNAL_WORKFLOW_EXECUTION"), nil
	case 1:
		return []byte("WORKFLOW_ALREADY_COMPLETED"), nil
	}
	return []byte(strconv.FormatInt(int64(v), 10)), nil
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of SignalExternalWorkflowExecutionFailedCause.
// 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 SignalExternalWorkflowExecutionFailedCause) MarshalLogObject(enc zapcore.ObjectEncoder) error {
	enc.AddInt32("value", int32(v))
	switch int32(v) {
	case 0:
		enc.AddString("name", "UNKNOWN_EXTERNAL_WORKFLOW_EXECUTION")
	case 1:
		enc.AddString("name", "WORKFLOW_ALREADY_COMPLETED")
	}
	return nil
}

// Ptr returns a pointer to this enum value.
func (v SignalExternalWorkflowExecutionFailedCause) Ptr() *SignalExternalWorkflowExecutionFailedCause {
	return &v
}

// ToWire translates SignalExternalWorkflowExecutionFailedCause 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 SignalExternalWorkflowExecutionFailedCause) ToWire() (wire.Value, error) {
	return wire.NewValueI32(int32(v)), nil
}

// FromWire deserializes SignalExternalWorkflowExecutionFailedCause from its Thrift-level
// representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TI32)
//	if err != nil {
//	  return SignalExternalWorkflowExecutionFailedCause(0), err
//	}
//
//	var v SignalExternalWorkflowExecutionFailedCause
//	if err := v.FromWire(x); err != nil {
//	  return SignalExternalWorkflowExecutionFailedCause(0), err
//	}
//	return v, nil
func (v *SignalExternalWorkflowExecutionFailedCause) FromWire(w wire.Value) error {
	*v = (SignalExternalWorkflowExecutionFailedCause)(w.GetI32())
	return nil
}

// String returns a readable string representation of SignalExternalWorkflowExecutionFailedCause.
func (v SignalExternalWorkflowExecutionFailedCause) String() string {
	w := int32(v)
	switch w {
	case 0:
		return "UNKNOWN_EXTERNAL_WORKFLOW_EXECUTION"
	case 1:
		return "WORKFLOW_ALREADY_COMPLETED"
	}
	return fmt.Sprintf("SignalExternalWorkflowExecutionFailedCause(%d)", w)
}

// Equals returns true if this SignalExternalWorkflowExecutionFailedCause value matches the provided
// value.
func (v SignalExternalWorkflowExecutionFailedCause) Equals(rhs SignalExternalWorkflowExecutionFailedCause) bool {
	return v == rhs
}

// MarshalJSON serializes SignalExternalWorkflowExecutionFailedCause into JSON.
//
// If the enum value is recognized, its name is returned. Otherwise,
// its integer value is returned.
//
// This implements json.Marshaler.
func (v SignalExternalWorkflowExecutionFailedCause) MarshalJSON() ([]byte, error) {
	switch int32(v) {
	case 0:
		return ([]byte)("\"UNKNOWN_EXTERNAL_WORKFLOW_EXECUTION\""), nil
	case 1:
		return ([]byte)("\"WORKFLOW_ALREADY_COMPLETED\""), nil
	}
	return ([]byte)(strconv.FormatInt(int64(v), 10)), nil
}

// UnmarshalJSON attempts to decode SignalExternalWorkflowExecutionFailedCause 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 *SignalExternalWorkflowExecutionFailedCause) 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, "SignalExternalWorkflowExecutionFailedCause")
		}
		if x < math.MinInt32 {
			return fmt.Errorf("enum underflow from JSON %q for %q", text, "SignalExternalWorkflowExecutionFailedCause")
		}
		*v = (SignalExternalWorkflowExecutionFailedCause)(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, "SignalExternalWorkflowExecutionFailedCause")
	}
}

type SignalExternalWorkflowExecutionFailedEventAttributes struct {
	Cause                        *SignalExternalWorkflowExecutionFailedCause `json:"cause,omitempty"`
	DecisionTaskCompletedEventId *int64                                      `json:"decisionTaskCompletedEventId,omitempty"`
	Domain                       *string                                     `json:"domain,omitempty"`
	WorkflowExecution            *WorkflowExecution                          `json:"workflowExecution,omitempty"`
	InitiatedEventId             *int64                                      `json:"initiatedEventId,omitempty"`
	Control                      []byte                                      `json:"control,omitempty"`
}

// ToWire translates a SignalExternalWorkflowExecutionFailedEventAttributes 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 *SignalExternalWorkflowExecutionFailedEventAttributes) ToWire() (wire.Value, error) {
	var (
		fields [6]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.Cause != nil {
		w, err = v.Cause.ToWire()
		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++
	}
	if v.Domain != nil {
		w, err = wire.NewValueString(*(v.Domain)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.WorkflowExecution != nil {
		w, err = v.WorkflowExecution.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 40, Value: w}
		i++
	}
	if v.InitiatedEventId != nil {
		w, err = wire.NewValueI64(*(v.InitiatedEventId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 50, Value: w}
		i++
	}
	if v.Control != nil {
		w, err = wire.NewValueBinary(v.Control), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 60, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

func _SignalExternalWorkflowExecutionFailedCause_Read(w wire.Value) (SignalExternalWorkflowExecutionFailedCause, error) {
	var v SignalExternalWorkflowExecutionFailedCause
	err := v.FromWire(w)
	return v, err
}

// FromWire deserializes a SignalExternalWorkflowExecutionFailedEventAttributes 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 SignalExternalWorkflowExecutionFailedEventAttributes struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v SignalExternalWorkflowExecutionFailedEventAttributes
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *SignalExternalWorkflowExecutionFailedEventAttributes) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			if field.Value.Type() == wire.TI32 {
				var x SignalExternalWorkflowExecutionFailedCause
				x, err = _SignalExternalWorkflowExecutionFailedCause_Read(field.Value)
				v.Cause = &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
				}

			}
		case 30:
			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 40:
			if field.Value.Type() == wire.TStruct {
				v.WorkflowExecution, err = _WorkflowExecution_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.InitiatedEventId = &x
				if err != nil {
					return err
				}

			}
		case 60:
			if field.Value.Type() == wire.TBinary {
				v.Control, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a SignalExternalWorkflowExecutionFailedEventAttributes
// struct.
func (v *SignalExternalWorkflowExecutionFailedEventAttributes) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [6]string
	i := 0
	if v.Cause != nil {
		fields[i] = fmt.Sprintf("Cause: %v", *(v.Cause))
		i++
	}
	if v.DecisionTaskCompletedEventId != nil {
		fields[i] = fmt.Sprintf("DecisionTaskCompletedEventId: %v", *(v.DecisionTaskCompletedEventId))
		i++
	}
	if v.Domain != nil {
		fields[i] = fmt.Sprintf("Domain: %v", *(v.Domain))
		i++
	}
	if v.WorkflowExecution != nil {
		fields[i] = fmt.Sprintf("WorkflowExecution: %v", v.WorkflowExecution)
		i++
	}
	if v.InitiatedEventId != nil {
		fields[i] = fmt.Sprintf("InitiatedEventId: %v", *(v.InitiatedEventId))
		i++
	}
	if v.Control != nil {
		fields[i] = fmt.Sprintf("Control: %v", v.Control)
		i++
	}

	return fmt.Sprintf("SignalExternalWorkflowExecutionFailedEventAttributes{%v}", strings.Join(fields[:i], ", "))
}

func _SignalExternalWorkflowExecutionFailedCause_EqualsPtr(lhs, rhs *SignalExternalWorkflowExecutionFailedCause) bool {
	if lhs != nil && rhs != nil {

		x := *lhs
		y := *rhs
		return x.Equals(y)
	}
	return lhs == nil && rhs == nil
}

// Equals returns true if all the fields of this SignalExternalWorkflowExecutionFailedEventAttributes match the
// provided SignalExternalWorkflowExecutionFailedEventAttributes.
//
// This function performs a deep comparison.
func (v *SignalExternalWorkflowExecutionFailedEventAttributes) Equals(rhs *SignalExternalWorkflowExecutionFailedEventAttributes) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_SignalExternalWorkflowExecutionFailedCause_EqualsPtr(v.Cause, rhs.Cause) {
		return false
	}
	if !_I64_EqualsPtr(v.DecisionTaskCompletedEventId, rhs.DecisionTaskCompletedEventId) {
		return false
	}
	if !_String_EqualsPtr(v.Domain, rhs.Domain) {
		return false
	}
	if !((v.WorkflowExecution == nil && rhs.WorkflowExecution == nil) || (v.WorkflowExecution != nil && rhs.WorkflowExecution != nil && v.WorkflowExecution.Equals(rhs.WorkflowExecution))) {
		return false
	}
	if !_I64_EqualsPtr(v.InitiatedEventId, rhs.InitiatedEventId) {
		return false
	}
	if !((v.Control == nil && rhs.Control == nil) || (v.Control != nil && rhs.Control != nil && bytes.Equal(v.Control, rhs.Control))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of SignalExternalWorkflowExecutionFailedEventAttributes.
func (v *SignalExternalWorkflowExecutionFailedEventAttributes) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Cause != nil {
		err = multierr.Append(err, enc.AddObject("cause", *v.Cause))
	}
	if v.DecisionTaskCompletedEventId != nil {
		enc.AddInt64("decisionTaskCompletedEventId", *v.DecisionTaskCompletedEventId)
	}
	if v.Domain != nil {
		enc.AddString("domain", *v.Domain)
	}
	if v.WorkflowExecution != nil {
		err = multierr.Append(err, enc.AddObject("workflowExecution", v.WorkflowExecution))
	}
	if v.InitiatedEventId != nil {
		enc.AddInt64("initiatedEventId", *v.InitiatedEventId)
	}
	if v.Control != nil {
		enc.AddString("control", base64.StdEncoding.EncodeToString(v.Control))
	}
	return err
}

// GetCause returns the value of Cause if it is set or its
// zero value if it is unset.
func (v *SignalExternalWorkflowExecutionFailedEventAttributes) GetCause() (o SignalExternalWorkflowExecutionFailedCause) {
	if v != nil && v.Cause != nil {
		return *v.Cause
	}

	return
}

// IsSetCause returns true if Cause is not nil.
func (v *SignalExternalWorkflowExecutionFailedEventAttributes) IsSetCause() bool {
	return v != nil && v.Cause != nil
}

// GetDecisionTaskCompletedEventId returns the value of DecisionTaskCompletedEventId if it is set or its
// zero value if it is unset.
func (v *SignalExternalWorkflowExecutionFailedEventAttributes) GetDecisionTaskCompletedEventId() (o int64) {
	if v != nil && v.DecisionTaskCompletedEventId != nil {
		return *v.DecisionTaskCompletedEventId
	}

	return
}

// IsSetDecisionTaskCompletedEventId returns true if DecisionTaskCompletedEventId is not nil.
func (v *SignalExternalWorkflowExecutionFailedEventAttributes) IsSetDecisionTaskCompletedEventId() bool {
	return v != nil && v.DecisionTaskCompletedEventId != nil
}

// GetDomain returns the value of Domain if it is set or its
// zero value if it is unset.
func (v *SignalExternalWorkflowExecutionFailedEventAttributes) GetDomain() (o string) {
	if v != nil && v.Domain != nil {
		return *v.Domain
	}

	return
}

// IsSetDomain returns true if Domain is not nil.
func (v *SignalExternalWorkflowExecutionFailedEventAttributes) IsSetDomain() bool {
	return v != nil && v.Domain != nil
}

// GetWorkflowExecution returns the value of WorkflowExecution if it is set or its
// zero value if it is unset.
func (v *SignalExternalWorkflowExecutionFailedEventAttributes) GetWorkflowExecution() (o *WorkflowExecution) {
	if v != nil && v.WorkflowExecution != nil {
		return v.WorkflowExecution
	}

	return
}

// IsSetWorkflowExecution returns true if WorkflowExecution is not nil.
func (v *SignalExternalWorkflowExecutionFailedEventAttributes) IsSetWorkflowExecution() bool {
	return v != nil && v.WorkflowExecution != nil
}

// GetInitiatedEventId returns the value of InitiatedEventId if it is set or its
// zero value if it is unset.
func (v *SignalExternalWorkflowExecutionFailedEventAttributes) GetInitiatedEventId() (o int64) {
	if v != nil && v.InitiatedEventId != nil {
		return *v.InitiatedEventId
	}

	return
}

// IsSetInitiatedEventId returns true if InitiatedEventId is not nil.
func (v *SignalExternalWorkflowExecutionFailedEventAttributes) IsSetInitiatedEventId() bool {
	return v != nil && v.InitiatedEventId != nil
}

// GetControl returns the value of Control if it is set or its
// zero value if it is unset.
func (v *SignalExternalWorkflowExecutionFailedEventAttributes) GetControl() (o []byte) {
	if v != nil && v.Control != nil {
		return v.Control
	}

	return
}

// IsSetControl returns true if Control is not nil.
func (v *SignalExternalWorkflowExecutionFailedEventAttributes) IsSetControl() bool {
	return v != nil && v.Control != nil
}

type SignalExternalWorkflowExecutionInitiatedEventAttributes struct {
	DecisionTaskCompletedEventId *int64             `json:"decisionTaskCompletedEventId,omitempty"`
	Domain                       *string            `json:"domain,omitempty"`
	WorkflowExecution            *WorkflowExecution `json:"workflowExecution,omitempty"`
	SignalName                   *string            `json:"signalName,omitempty"`
	Input                        []byte             `json:"input,omitempty"`
	Control                      []byte             `json:"control,omitempty"`
	ChildWorkflowOnly            *bool              `json:"childWorkflowOnly,omitempty"`
}

// ToWire translates a SignalExternalWorkflowExecutionInitiatedEventAttributes 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 *SignalExternalWorkflowExecutionInitiatedEventAttributes) ToWire() (wire.Value, error) {
	var (
		fields [7]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.DecisionTaskCompletedEventId != nil {
		w, err = wire.NewValueI64(*(v.DecisionTaskCompletedEventId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.Domain != nil {
		w, err = wire.NewValueString(*(v.Domain)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.WorkflowExecution != nil {
		w, err = v.WorkflowExecution.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.SignalName != nil {
		w, err = wire.NewValueString(*(v.SignalName)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 40, Value: w}
		i++
	}
	if v.Input != nil {
		w, err = wire.NewValueBinary(v.Input), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 50, Value: w}
		i++
	}
	if v.Control != nil {
		w, err = wire.NewValueBinary(v.Control), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 60, Value: w}
		i++
	}
	if v.ChildWorkflowOnly != nil {
		w, err = wire.NewValueBool(*(v.ChildWorkflowOnly)), 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 SignalExternalWorkflowExecutionInitiatedEventAttributes 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 SignalExternalWorkflowExecutionInitiatedEventAttributes struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v SignalExternalWorkflowExecutionInitiatedEventAttributes
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *SignalExternalWorkflowExecutionInitiatedEventAttributes) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			if field.Value.Type() == wire.TI64 {
				var x int64
				x, err = field.Value.GetI64(), error(nil)
				v.DecisionTaskCompletedEventId = &x
				if err != nil {
					return err
				}

			}
		case 20:
			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 30:
			if field.Value.Type() == wire.TStruct {
				v.WorkflowExecution, err = _WorkflowExecution_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.SignalName = &x
				if err != nil {
					return err
				}

			}
		case 50:
			if field.Value.Type() == wire.TBinary {
				v.Input, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		case 60:
			if field.Value.Type() == wire.TBinary {
				v.Control, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		case 70:
			if field.Value.Type() == wire.TBool {
				var x bool
				x, err = field.Value.GetBool(), error(nil)
				v.ChildWorkflowOnly = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a SignalExternalWorkflowExecutionInitiatedEventAttributes
// struct.
func (v *SignalExternalWorkflowExecutionInitiatedEventAttributes) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [7]string
	i := 0
	if v.DecisionTaskCompletedEventId != nil {
		fields[i] = fmt.Sprintf("DecisionTaskCompletedEventId: %v", *(v.DecisionTaskCompletedEventId))
		i++
	}
	if v.Domain != nil {
		fields[i] = fmt.Sprintf("Domain: %v", *(v.Domain))
		i++
	}
	if v.WorkflowExecution != nil {
		fields[i] = fmt.Sprintf("WorkflowExecution: %v", v.WorkflowExecution)
		i++
	}
	if v.SignalName != nil {
		fields[i] = fmt.Sprintf("SignalName: %v", *(v.SignalName))
		i++
	}
	if v.Input != nil {
		fields[i] = fmt.Sprintf("Input: %v", v.Input)
		i++
	}
	if v.Control != nil {
		fields[i] = fmt.Sprintf("Control: %v", v.Control)
		i++
	}
	if v.ChildWorkflowOnly != nil {
		fields[i] = fmt.Sprintf("ChildWorkflowOnly: %v", *(v.ChildWorkflowOnly))
		i++
	}

	return fmt.Sprintf("SignalExternalWorkflowExecutionInitiatedEventAttributes{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this SignalExternalWorkflowExecutionInitiatedEventAttributes match the
// provided SignalExternalWorkflowExecutionInitiatedEventAttributes.
//
// This function performs a deep comparison.
func (v *SignalExternalWorkflowExecutionInitiatedEventAttributes) Equals(rhs *SignalExternalWorkflowExecutionInitiatedEventAttributes) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_I64_EqualsPtr(v.DecisionTaskCompletedEventId, rhs.DecisionTaskCompletedEventId) {
		return false
	}
	if !_String_EqualsPtr(v.Domain, rhs.Domain) {
		return false
	}
	if !((v.WorkflowExecution == nil && rhs.WorkflowExecution == nil) || (v.WorkflowExecution != nil && rhs.WorkflowExecution != nil && v.WorkflowExecution.Equals(rhs.WorkflowExecution))) {
		return false
	}
	if !_String_EqualsPtr(v.SignalName, rhs.SignalName) {
		return false
	}
	if !((v.Input == nil && rhs.Input == nil) || (v.Input != nil && rhs.Input != nil && bytes.Equal(v.Input, rhs.Input))) {
		return false
	}
	if !((v.Control == nil && rhs.Control == nil) || (v.Control != nil && rhs.Control != nil && bytes.Equal(v.Control, rhs.Control))) {
		return false
	}
	if !_Bool_EqualsPtr(v.ChildWorkflowOnly, rhs.ChildWorkflowOnly) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of SignalExternalWorkflowExecutionInitiatedEventAttributes.
func (v *SignalExternalWorkflowExecutionInitiatedEventAttributes) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.DecisionTaskCompletedEventId != nil {
		enc.AddInt64("decisionTaskCompletedEventId", *v.DecisionTaskCompletedEventId)
	}
	if v.Domain != nil {
		enc.AddString("domain", *v.Domain)
	}
	if v.WorkflowExecution != nil {
		err = multierr.Append(err, enc.AddObject("workflowExecution", v.WorkflowExecution))
	}
	if v.SignalName != nil {
		enc.AddString("signalName", *v.SignalName)
	}
	if v.Input != nil {
		enc.AddString("input", base64.StdEncoding.EncodeToString(v.Input))
	}
	if v.Control != nil {
		enc.AddString("control", base64.StdEncoding.EncodeToString(v.Control))
	}
	if v.ChildWorkflowOnly != nil {
		enc.AddBool("childWorkflowOnly", *v.ChildWorkflowOnly)
	}
	return err
}

// GetDecisionTaskCompletedEventId returns the value of DecisionTaskCompletedEventId if it is set or its
// zero value if it is unset.
func (v *SignalExternalWorkflowExecutionInitiatedEventAttributes) GetDecisionTaskCompletedEventId() (o int64) {
	if v != nil && v.DecisionTaskCompletedEventId != nil {
		return *v.DecisionTaskCompletedEventId
	}

	return
}

// IsSetDecisionTaskCompletedEventId returns true if DecisionTaskCompletedEventId is not nil.
func (v *SignalExternalWorkflowExecutionInitiatedEventAttributes) IsSetDecisionTaskCompletedEventId() bool {
	return v != nil && v.DecisionTaskCompletedEventId != nil
}

// GetDomain returns the value of Domain if it is set or its
// zero value if it is unset.
func (v *SignalExternalWorkflowExecutionInitiatedEventAttributes) GetDomain() (o string) {
	if v != nil && v.Domain != nil {
		return *v.Domain
	}

	return
}

// IsSetDomain returns true if Domain is not nil.
func (v *SignalExternalWorkflowExecutionInitiatedEventAttributes) IsSetDomain() bool {
	return v != nil && v.Domain != nil
}

// GetWorkflowExecution returns the value of WorkflowExecution if it is set or its
// zero value if it is unset.
func (v *SignalExternalWorkflowExecutionInitiatedEventAttributes) GetWorkflowExecution() (o *WorkflowExecution) {
	if v != nil && v.WorkflowExecution != nil {
		return v.WorkflowExecution
	}

	return
}

// IsSetWorkflowExecution returns true if WorkflowExecution is not nil.
func (v *SignalExternalWorkflowExecutionInitiatedEventAttributes) IsSetWorkflowExecution() bool {
	return v != nil && v.WorkflowExecution != nil
}

// GetSignalName returns the value of SignalName if it is set or its
// zero value if it is unset.
func (v *SignalExternalWorkflowExecutionInitiatedEventAttributes) GetSignalName() (o string) {
	if v != nil && v.SignalName != nil {
		return *v.SignalName
	}

	return
}

// IsSetSignalName returns true if SignalName is not nil.
func (v *SignalExternalWorkflowExecutionInitiatedEventAttributes) IsSetSignalName() bool {
	return v != nil && v.SignalName != nil
}

// GetInput returns the value of Input if it is set or its
// zero value if it is unset.
func (v *SignalExternalWorkflowExecutionInitiatedEventAttributes) GetInput() (o []byte) {
	if v != nil && v.Input != nil {
		return v.Input
	}

	return
}

// IsSetInput returns true if Input is not nil.
func (v *SignalExternalWorkflowExecutionInitiatedEventAttributes) IsSetInput() bool {
	return v != nil && v.Input != nil
}

// GetControl returns the value of Control if it is set or its
// zero value if it is unset.
func (v *SignalExternalWorkflowExecutionInitiatedEventAttributes) GetControl() (o []byte) {
	if v != nil && v.Control != nil {
		return v.Control
	}

	return
}

// IsSetControl returns true if Control is not nil.
func (v *SignalExternalWorkflowExecutionInitiatedEventAttributes) IsSetControl() bool {
	return v != nil && v.Control != nil
}

// GetChildWorkflowOnly returns the value of ChildWorkflowOnly if it is set or its
// zero value if it is unset.
func (v *SignalExternalWorkflowExecutionInitiatedEventAttributes) GetChildWorkflowOnly() (o bool) {
	if v != nil && v.ChildWorkflowOnly != nil {
		return *v.ChildWorkflowOnly
	}

	return
}

// IsSetChildWorkflowOnly returns true if ChildWorkflowOnly is not nil.
func (v *SignalExternalWorkflowExecutionInitiatedEventAttributes) IsSetChildWorkflowOnly() bool {
	return v != nil && v.ChildWorkflowOnly != nil
}

type SignalWithStartWorkflowExecutionAsyncRequest struct {
	Request *SignalWithStartWorkflowExecutionRequest `json:"request,omitempty"`
}

// ToWire translates a SignalWithStartWorkflowExecutionAsyncRequest 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 *SignalWithStartWorkflowExecutionAsyncRequest) 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: 10, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

func _SignalWithStartWorkflowExecutionRequest_Read(w wire.Value) (*SignalWithStartWorkflowExecutionRequest, error) {
	var v SignalWithStartWorkflowExecutionRequest
	err := v.FromWire(w)
	return &v, err
}

// FromWire deserializes a SignalWithStartWorkflowExecutionAsyncRequest 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 SignalWithStartWorkflowExecutionAsyncRequest struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v SignalWithStartWorkflowExecutionAsyncRequest
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *SignalWithStartWorkflowExecutionAsyncRequest) 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.Request, err = _SignalWithStartWorkflowExecutionRequest_Read(field.Value)
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a SignalWithStartWorkflowExecutionAsyncRequest
// struct.
func (v *SignalWithStartWorkflowExecutionAsyncRequest) 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("SignalWithStartWorkflowExecutionAsyncRequest{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this SignalWithStartWorkflowExecutionAsyncRequest match the
// provided SignalWithStartWorkflowExecutionAsyncRequest.
//
// This function performs a deep comparison.
func (v *SignalWithStartWorkflowExecutionAsyncRequest) Equals(rhs *SignalWithStartWorkflowExecutionAsyncRequest) 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 SignalWithStartWorkflowExecutionAsyncRequest.
func (v *SignalWithStartWorkflowExecutionAsyncRequest) 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 *SignalWithStartWorkflowExecutionAsyncRequest) GetRequest() (o *SignalWithStartWorkflowExecutionRequest) {
	if v != nil && v.Request != nil {
		return v.Request
	}

	return
}

// IsSetRequest returns true if Request is not nil.
func (v *SignalWithStartWorkflowExecutionAsyncRequest) IsSetRequest() bool {
	return v != nil && v.Request != nil
}

type SignalWithStartWorkflowExecutionAsyncResponse struct {
}

// ToWire translates a SignalWithStartWorkflowExecutionAsyncResponse 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 *SignalWithStartWorkflowExecutionAsyncResponse) ToWire() (wire.Value, error) {
	var (
		fields [0]wire.Field
		i      int = 0
	)

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

// FromWire deserializes a SignalWithStartWorkflowExecutionAsyncResponse 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 SignalWithStartWorkflowExecutionAsyncResponse struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v SignalWithStartWorkflowExecutionAsyncResponse
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *SignalWithStartWorkflowExecutionAsyncResponse) FromWire(w wire.Value) error {

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		}
	}

	return nil
}

// String returns a readable string representation of a SignalWithStartWorkflowExecutionAsyncResponse
// struct.
func (v *SignalWithStartWorkflowExecutionAsyncResponse) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [0]string
	i := 0

	return fmt.Sprintf("SignalWithStartWorkflowExecutionAsyncResponse{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this SignalWithStartWorkflowExecutionAsyncResponse match the
// provided SignalWithStartWorkflowExecutionAsyncResponse.
//
// This function performs a deep comparison.
func (v *SignalWithStartWorkflowExecutionAsyncResponse) Equals(rhs *SignalWithStartWorkflowExecutionAsyncResponse) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of SignalWithStartWorkflowExecutionAsyncResponse.
func (v *SignalWithStartWorkflowExecutionAsyncResponse) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	return err
}

type SignalWithStartWorkflowExecutionRequest struct {
	Domain                              *string                       `json:"domain,omitempty"`
	WorkflowId                          *string                       `json:"workflowId,omitempty"`
	WorkflowType                        *WorkflowType                 `json:"workflowType,omitempty"`
	TaskList                            *TaskList                     `json:"taskList,omitempty"`
	Input                               []byte                        `json:"input,omitempty"`
	ExecutionStartToCloseTimeoutSeconds *int32                        `json:"executionStartToCloseTimeoutSeconds,omitempty"`
	TaskStartToCloseTimeoutSeconds      *int32                        `json:"taskStartToCloseTimeoutSeconds,omitempty"`
	Identity                            *string                       `json:"identity,omitempty"`
	RequestId                           *string                       `json:"requestId,omitempty"`
	WorkflowIdReusePolicy               *WorkflowIdReusePolicy        `json:"workflowIdReusePolicy,omitempty"`
	SignalName                          *string                       `json:"signalName,omitempty"`
	SignalInput                         []byte                        `json:"signalInput,omitempty"`
	Control                             []byte                        `json:"control,omitempty"`
	RetryPolicy                         *RetryPolicy                  `json:"retryPolicy,omitempty"`
	CronSchedule                        *string                       `json:"cronSchedule,omitempty"`
	Memo                                *Memo                         `json:"memo,omitempty"`
	SearchAttributes                    *SearchAttributes             `json:"searchAttributes,omitempty"`
	Header                              *Header                       `json:"header,omitempty"`
	DelayStartSeconds                   *int32                        `json:"delayStartSeconds,omitempty"`
	JitterStartSeconds                  *int32                        `json:"jitterStartSeconds,omitempty"`
	FirstRunAtTimestamp                 *int64                        `json:"firstRunAtTimestamp,omitempty"`
	CronOverlapPolicy                   *CronOverlapPolicy            `json:"cronOverlapPolicy,omitempty"`
	ActiveClusterSelectionPolicy        *ActiveClusterSelectionPolicy `json:"activeClusterSelectionPolicy,omitempty"`
}

// ToWire translates a SignalWithStartWorkflowExecutionRequest 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 *SignalWithStartWorkflowExecutionRequest) ToWire() (wire.Value, error) {
	var (
		fields [23]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.WorkflowId != nil {
		w, err = wire.NewValueString(*(v.WorkflowId)), error(nil)
		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.TaskList != nil {
		w, err = v.TaskList.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 40, Value: w}
		i++
	}
	if v.Input != nil {
		w, err = wire.NewValueBinary(v.Input), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 50, Value: w}
		i++
	}
	if v.ExecutionStartToCloseTimeoutSeconds != nil {
		w, err = wire.NewValueI32(*(v.ExecutionStartToCloseTimeoutSeconds)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 60, Value: w}
		i++
	}
	if v.TaskStartToCloseTimeoutSeconds != nil {
		w, err = wire.NewValueI32(*(v.TaskStartToCloseTimeoutSeconds)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 70, 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: 80, Value: w}
		i++
	}
	if v.RequestId != nil {
		w, err = wire.NewValueString(*(v.RequestId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 90, Value: w}
		i++
	}
	if v.WorkflowIdReusePolicy != nil {
		w, err = v.WorkflowIdReusePolicy.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 100, Value: w}
		i++
	}
	if v.SignalName != nil {
		w, err = wire.NewValueString(*(v.SignalName)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 110, Value: w}
		i++
	}
	if v.SignalInput != nil {
		w, err = wire.NewValueBinary(v.SignalInput), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 120, Value: w}
		i++
	}
	if v.Control != nil {
		w, err = wire.NewValueBinary(v.Control), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 130, Value: w}
		i++
	}
	if v.RetryPolicy != nil {
		w, err = v.RetryPolicy.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 140, Value: w}
		i++
	}
	if v.CronSchedule != nil {
		w, err = wire.NewValueString(*(v.CronSchedule)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 150, Value: w}
		i++
	}
	if v.Memo != nil {
		w, err = v.Memo.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 160, Value: w}
		i++
	}
	if v.SearchAttributes != nil {
		w, err = v.SearchAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 161, Value: w}
		i++
	}
	if v.Header != nil {
		w, err = v.Header.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 170, Value: w}
		i++
	}
	if v.DelayStartSeconds != nil {
		w, err = wire.NewValueI32(*(v.DelayStartSeconds)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 180, Value: w}
		i++
	}
	if v.JitterStartSeconds != nil {
		w, err = wire.NewValueI32(*(v.JitterStartSeconds)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 190, Value: w}
		i++
	}
	if v.FirstRunAtTimestamp != nil {
		w, err = wire.NewValueI64(*(v.FirstRunAtTimestamp)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 200, Value: w}
		i++
	}
	if v.CronOverlapPolicy != nil {
		w, err = v.CronOverlapPolicy.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 210, Value: w}
		i++
	}
	if v.ActiveClusterSelectionPolicy != nil {
		w, err = v.ActiveClusterSelectionPolicy.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 220, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

func _WorkflowIdReusePolicy_Read(w wire.Value) (WorkflowIdReusePolicy, error) {
	var v WorkflowIdReusePolicy
	err := v.FromWire(w)
	return v, err
}

// FromWire deserializes a SignalWithStartWorkflowExecutionRequest 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 SignalWithStartWorkflowExecutionRequest struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v SignalWithStartWorkflowExecutionRequest
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *SignalWithStartWorkflowExecutionRequest) 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.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.WorkflowId = &x
				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.TStruct {
				v.TaskList, err = _TaskList_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 50:
			if field.Value.Type() == wire.TBinary {
				v.Input, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		case 60:
			if field.Value.Type() == wire.TI32 {
				var x int32
				x, err = field.Value.GetI32(), error(nil)
				v.ExecutionStartToCloseTimeoutSeconds = &x
				if err != nil {
					return err
				}

			}
		case 70:
			if field.Value.Type() == wire.TI32 {
				var x int32
				x, err = field.Value.GetI32(), error(nil)
				v.TaskStartToCloseTimeoutSeconds = &x
				if err != nil {
					return err
				}

			}
		case 80:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.Identity = &x
				if err != nil {
					return err
				}

			}
		case 90:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.RequestId = &x
				if err != nil {
					return err
				}

			}
		case 100:
			if field.Value.Type() == wire.TI32 {
				var x WorkflowIdReusePolicy
				x, err = _WorkflowIdReusePolicy_Read(field.Value)
				v.WorkflowIdReusePolicy = &x
				if err != nil {
					return err
				}

			}
		case 110:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.SignalName = &x
				if err != nil {
					return err
				}

			}
		case 120:
			if field.Value.Type() == wire.TBinary {
				v.SignalInput, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		case 130:
			if field.Value.Type() == wire.TBinary {
				v.Control, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		case 140:
			if field.Value.Type() == wire.TStruct {
				v.RetryPolicy, err = _RetryPolicy_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 150:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.CronSchedule = &x
				if err != nil {
					return err
				}

			}
		case 160:
			if field.Value.Type() == wire.TStruct {
				v.Memo, err = _Memo_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 161:
			if field.Value.Type() == wire.TStruct {
				v.SearchAttributes, err = _SearchAttributes_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 170:
			if field.Value.Type() == wire.TStruct {
				v.Header, err = _Header_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 180:
			if field.Value.Type() == wire.TI32 {
				var x int32
				x, err = field.Value.GetI32(), error(nil)
				v.DelayStartSeconds = &x
				if err != nil {
					return err
				}

			}
		case 190:
			if field.Value.Type() == wire.TI32 {
				var x int32
				x, err = field.Value.GetI32(), error(nil)
				v.JitterStartSeconds = &x
				if err != nil {
					return err
				}

			}
		case 200:
			if field.Value.Type() == wire.TI64 {
				var x int64
				x, err = field.Value.GetI64(), error(nil)
				v.FirstRunAtTimestamp = &x
				if err != nil {
					return err
				}

			}
		case 210:
			if field.Value.Type() == wire.TI32 {
				var x CronOverlapPolicy
				x, err = _CronOverlapPolicy_Read(field.Value)
				v.CronOverlapPolicy = &x
				if err != nil {
					return err
				}

			}
		case 220:
			if field.Value.Type() == wire.TStruct {
				v.ActiveClusterSelectionPolicy, err = _ActiveClusterSelectionPolicy_Read(field.Value)
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a SignalWithStartWorkflowExecutionRequest
// struct.
func (v *SignalWithStartWorkflowExecutionRequest) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [23]string
	i := 0
	if v.Domain != nil {
		fields[i] = fmt.Sprintf("Domain: %v", *(v.Domain))
		i++
	}
	if v.WorkflowId != nil {
		fields[i] = fmt.Sprintf("WorkflowId: %v", *(v.WorkflowId))
		i++
	}
	if v.WorkflowType != nil {
		fields[i] = fmt.Sprintf("WorkflowType: %v", v.WorkflowType)
		i++
	}
	if v.TaskList != nil {
		fields[i] = fmt.Sprintf("TaskList: %v", v.TaskList)
		i++
	}
	if v.Input != nil {
		fields[i] = fmt.Sprintf("Input: %v", v.Input)
		i++
	}
	if v.ExecutionStartToCloseTimeoutSeconds != nil {
		fields[i] = fmt.Sprintf("ExecutionStartToCloseTimeoutSeconds: %v", *(v.ExecutionStartToCloseTimeoutSeconds))
		i++
	}
	if v.TaskStartToCloseTimeoutSeconds != nil {
		fields[i] = fmt.Sprintf("TaskStartToCloseTimeoutSeconds: %v", *(v.TaskStartToCloseTimeoutSeconds))
		i++
	}
	if v.Identity != nil {
		fields[i] = fmt.Sprintf("Identity: %v", *(v.Identity))
		i++
	}
	if v.RequestId != nil {
		fields[i] = fmt.Sprintf("RequestId: %v", *(v.RequestId))
		i++
	}
	if v.WorkflowIdReusePolicy != nil {
		fields[i] = fmt.Sprintf("WorkflowIdReusePolicy: %v", *(v.WorkflowIdReusePolicy))
		i++
	}
	if v.SignalName != nil {
		fields[i] = fmt.Sprintf("SignalName: %v", *(v.SignalName))
		i++
	}
	if v.SignalInput != nil {
		fields[i] = fmt.Sprintf("SignalInput: %v", v.SignalInput)
		i++
	}
	if v.Control != nil {
		fields[i] = fmt.Sprintf("Control: %v", v.Control)
		i++
	}
	if v.RetryPolicy != nil {
		fields[i] = fmt.Sprintf("RetryPolicy: %v", v.RetryPolicy)
		i++
	}
	if v.CronSchedule != nil {
		fields[i] = fmt.Sprintf("CronSchedule: %v", *(v.CronSchedule))
		i++
	}
	if v.Memo != nil {
		fields[i] = fmt.Sprintf("Memo: %v", v.Memo)
		i++
	}
	if v.SearchAttributes != nil {
		fields[i] = fmt.Sprintf("SearchAttributes: %v", v.SearchAttributes)
		i++
	}
	if v.Header != nil {
		fields[i] = fmt.Sprintf("Header: %v", v.Header)
		i++
	}
	if v.DelayStartSeconds != nil {
		fields[i] = fmt.Sprintf("DelayStartSeconds: %v", *(v.DelayStartSeconds))
		i++
	}
	if v.JitterStartSeconds != nil {
		fields[i] = fmt.Sprintf("JitterStartSeconds: %v", *(v.JitterStartSeconds))
		i++
	}
	if v.FirstRunAtTimestamp != nil {
		fields[i] = fmt.Sprintf("FirstRunAtTimestamp: %v", *(v.FirstRunAtTimestamp))
		i++
	}
	if v.CronOverlapPolicy != nil {
		fields[i] = fmt.Sprintf("CronOverlapPolicy: %v", *(v.CronOverlapPolicy))
		i++
	}
	if v.ActiveClusterSelectionPolicy != nil {
		fields[i] = fmt.Sprintf("ActiveClusterSelectionPolicy: %v", v.ActiveClusterSelectionPolicy)
		i++
	}

	return fmt.Sprintf("SignalWithStartWorkflowExecutionRequest{%v}", strings.Join(fields[:i], ", "))
}

func _WorkflowIdReusePolicy_EqualsPtr(lhs, rhs *WorkflowIdReusePolicy) bool {
	if lhs != nil && rhs != nil {

		x := *lhs
		y := *rhs
		return x.Equals(y)
	}
	return lhs == nil && rhs == nil
}

// Equals returns true if all the fields of this SignalWithStartWorkflowExecutionRequest match the
// provided SignalWithStartWorkflowExecutionRequest.
//
// This function performs a deep comparison.
func (v *SignalWithStartWorkflowExecutionRequest) Equals(rhs *SignalWithStartWorkflowExecutionRequest) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.Domain, rhs.Domain) {
		return false
	}
	if !_String_EqualsPtr(v.WorkflowId, rhs.WorkflowId) {
		return false
	}
	if !((v.WorkflowType == nil && rhs.WorkflowType == nil) || (v.WorkflowType != nil && rhs.WorkflowType != nil && v.WorkflowType.Equals(rhs.WorkflowType))) {
		return false
	}
	if !((v.TaskList == nil && rhs.TaskList == nil) || (v.TaskList != nil && rhs.TaskList != nil && v.TaskList.Equals(rhs.TaskList))) {
		return false
	}
	if !((v.Input == nil && rhs.Input == nil) || (v.Input != nil && rhs.Input != nil && bytes.Equal(v.Input, rhs.Input))) {
		return false
	}
	if !_I32_EqualsPtr(v.ExecutionStartToCloseTimeoutSeconds, rhs.ExecutionStartToCloseTimeoutSeconds) {
		return false
	}
	if !_I32_EqualsPtr(v.TaskStartToCloseTimeoutSeconds, rhs.TaskStartToCloseTimeoutSeconds) {
		return false
	}
	if !_String_EqualsPtr(v.Identity, rhs.Identity) {
		return false
	}
	if !_String_EqualsPtr(v.RequestId, rhs.RequestId) {
		return false
	}
	if !_WorkflowIdReusePolicy_EqualsPtr(v.WorkflowIdReusePolicy, rhs.WorkflowIdReusePolicy) {
		return false
	}
	if !_String_EqualsPtr(v.SignalName, rhs.SignalName) {
		return false
	}
	if !((v.SignalInput == nil && rhs.SignalInput == nil) || (v.SignalInput != nil && rhs.SignalInput != nil && bytes.Equal(v.SignalInput, rhs.SignalInput))) {
		return false
	}
	if !((v.Control == nil && rhs.Control == nil) || (v.Control != nil && rhs.Control != nil && bytes.Equal(v.Control, rhs.Control))) {
		return false
	}
	if !((v.RetryPolicy == nil && rhs.RetryPolicy == nil) || (v.RetryPolicy != nil && rhs.RetryPolicy != nil && v.RetryPolicy.Equals(rhs.RetryPolicy))) {
		return false
	}
	if !_String_EqualsPtr(v.CronSchedule, rhs.CronSchedule) {
		return false
	}
	if !((v.Memo == nil && rhs.Memo == nil) || (v.Memo != nil && rhs.Memo != nil && v.Memo.Equals(rhs.Memo))) {
		return false
	}
	if !((v.SearchAttributes == nil && rhs.SearchAttributes == nil) || (v.SearchAttributes != nil && rhs.SearchAttributes != nil && v.SearchAttributes.Equals(rhs.SearchAttributes))) {
		return false
	}
	if !((v.Header == nil && rhs.Header == nil) || (v.Header != nil && rhs.Header != nil && v.Header.Equals(rhs.Header))) {
		return false
	}
	if !_I32_EqualsPtr(v.DelayStartSeconds, rhs.DelayStartSeconds) {
		return false
	}
	if !_I32_EqualsPtr(v.JitterStartSeconds, rhs.JitterStartSeconds) {
		return false
	}
	if !_I64_EqualsPtr(v.FirstRunAtTimestamp, rhs.FirstRunAtTimestamp) {
		return false
	}
	if !_CronOverlapPolicy_EqualsPtr(v.CronOverlapPolicy, rhs.CronOverlapPolicy) {
		return false
	}
	if !((v.ActiveClusterSelectionPolicy == nil && rhs.ActiveClusterSelectionPolicy == nil) || (v.ActiveClusterSelectionPolicy != nil && rhs.ActiveClusterSelectionPolicy != nil && v.ActiveClusterSelectionPolicy.Equals(rhs.ActiveClusterSelectionPolicy))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of SignalWithStartWorkflowExecutionRequest.
func (v *SignalWithStartWorkflowExecutionRequest) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Domain != nil {
		enc.AddString("domain", *v.Domain)
	}
	if v.WorkflowId != nil {
		enc.AddString("workflowId", *v.WorkflowId)
	}
	if v.WorkflowType != nil {
		err = multierr.Append(err, enc.AddObject("workflowType", v.WorkflowType))
	}
	if v.TaskList != nil {
		err = multierr.Append(err, enc.AddObject("taskList", v.TaskList))
	}
	if v.Input != nil {
		enc.AddString("input", base64.StdEncoding.EncodeToString(v.Input))
	}
	if v.ExecutionStartToCloseTimeoutSeconds != nil {
		enc.AddInt32("executionStartToCloseTimeoutSeconds", *v.ExecutionStartToCloseTimeoutSeconds)
	}
	if v.TaskStartToCloseTimeoutSeconds != nil {
		enc.AddInt32("taskStartToCloseTimeoutSeconds", *v.TaskStartToCloseTimeoutSeconds)
	}
	if v.Identity != nil {
		enc.AddString("identity", *v.Identity)
	}
	if v.RequestId != nil {
		enc.AddString("requestId", *v.RequestId)
	}
	if v.WorkflowIdReusePolicy != nil {
		err = multierr.Append(err, enc.AddObject("workflowIdReusePolicy", *v.WorkflowIdReusePolicy))
	}
	if v.SignalName != nil {
		enc.AddString("signalName", *v.SignalName)
	}
	if v.SignalInput != nil {
		enc.AddString("signalInput", base64.StdEncoding.EncodeToString(v.SignalInput))
	}
	if v.Control != nil {
		enc.AddString("control", base64.StdEncoding.EncodeToString(v.Control))
	}
	if v.RetryPolicy != nil {
		err = multierr.Append(err, enc.AddObject("retryPolicy", v.RetryPolicy))
	}
	if v.CronSchedule != nil {
		enc.AddString("cronSchedule", *v.CronSchedule)
	}
	if v.Memo != nil {
		err = multierr.Append(err, enc.AddObject("memo", v.Memo))
	}
	if v.SearchAttributes != nil {
		err = multierr.Append(err, enc.AddObject("searchAttributes", v.SearchAttributes))
	}
	if v.Header != nil {
		err = multierr.Append(err, enc.AddObject("header", v.Header))
	}
	if v.DelayStartSeconds != nil {
		enc.AddInt32("delayStartSeconds", *v.DelayStartSeconds)
	}
	if v.JitterStartSeconds != nil {
		enc.AddInt32("jitterStartSeconds", *v.JitterStartSeconds)
	}
	if v.FirstRunAtTimestamp != nil {
		enc.AddInt64("firstRunAtTimestamp", *v.FirstRunAtTimestamp)
	}
	if v.CronOverlapPolicy != nil {
		err = multierr.Append(err, enc.AddObject("cronOverlapPolicy", *v.CronOverlapPolicy))
	}
	if v.ActiveClusterSelectionPolicy != nil {
		err = multierr.Append(err, enc.AddObject("activeClusterSelectionPolicy", v.ActiveClusterSelectionPolicy))
	}
	return err
}

// GetDomain returns the value of Domain if it is set or its
// zero value if it is unset.
func (v *SignalWithStartWorkflowExecutionRequest) GetDomain() (o string) {
	if v != nil && v.Domain != nil {
		return *v.Domain
	}

	return
}

// IsSetDomain returns true if Domain is not nil.
func (v *SignalWithStartWorkflowExecutionRequest) IsSetDomain() bool {
	return v != nil && v.Domain != nil
}

// GetWorkflowId returns the value of WorkflowId if it is set or its
// zero value if it is unset.
func (v *SignalWithStartWorkflowExecutionRequest) GetWorkflowId() (o string) {
	if v != nil && v.WorkflowId != nil {
		return *v.WorkflowId
	}

	return
}

// IsSetWorkflowId returns true if WorkflowId is not nil.
func (v *SignalWithStartWorkflowExecutionRequest) IsSetWorkflowId() bool {
	return v != nil && v.WorkflowId != nil
}

// GetWorkflowType returns the value of WorkflowType if it is set or its
// zero value if it is unset.
func (v *SignalWithStartWorkflowExecutionRequest) GetWorkflowType() (o *WorkflowType) {
	if v != nil && v.WorkflowType != nil {
		return v.WorkflowType
	}

	return
}

// IsSetWorkflowType returns true if WorkflowType is not nil.
func (v *SignalWithStartWorkflowExecutionRequest) IsSetWorkflowType() bool {
	return v != nil && v.WorkflowType != nil
}

// GetTaskList returns the value of TaskList if it is set or its
// zero value if it is unset.
func (v *SignalWithStartWorkflowExecutionRequest) GetTaskList() (o *TaskList) {
	if v != nil && v.TaskList != nil {
		return v.TaskList
	}

	return
}

// IsSetTaskList returns true if TaskList is not nil.
func (v *SignalWithStartWorkflowExecutionRequest) IsSetTaskList() bool {
	return v != nil && v.TaskList != nil
}

// GetInput returns the value of Input if it is set or its
// zero value if it is unset.
func (v *SignalWithStartWorkflowExecutionRequest) GetInput() (o []byte) {
	if v != nil && v.Input != nil {
		return v.Input
	}

	return
}

// IsSetInput returns true if Input is not nil.
func (v *SignalWithStartWorkflowExecutionRequest) IsSetInput() bool {
	return v != nil && v.Input != nil
}

// GetExecutionStartToCloseTimeoutSeconds returns the value of ExecutionStartToCloseTimeoutSeconds if it is set or its
// zero value if it is unset.
func (v *SignalWithStartWorkflowExecutionRequest) GetExecutionStartToCloseTimeoutSeconds() (o int32) {
	if v != nil && v.ExecutionStartToCloseTimeoutSeconds != nil {
		return *v.ExecutionStartToCloseTimeoutSeconds
	}

	return
}

// IsSetExecutionStartToCloseTimeoutSeconds returns true if ExecutionStartToCloseTimeoutSeconds is not nil.
func (v *SignalWithStartWorkflowExecutionRequest) IsSetExecutionStartToCloseTimeoutSeconds() bool {
	return v != nil && v.ExecutionStartToCloseTimeoutSeconds != nil
}

// GetTaskStartToCloseTimeoutSeconds returns the value of TaskStartToCloseTimeoutSeconds if it is set or its
// zero value if it is unset.
func (v *SignalWithStartWorkflowExecutionRequest) GetTaskStartToCloseTimeoutSeconds() (o int32) {
	if v != nil && v.TaskStartToCloseTimeoutSeconds != nil {
		return *v.TaskStartToCloseTimeoutSeconds
	}

	return
}

// IsSetTaskStartToCloseTimeoutSeconds returns true if TaskStartToCloseTimeoutSeconds is not nil.
func (v *SignalWithStartWorkflowExecutionRequest) IsSetTaskStartToCloseTimeoutSeconds() bool {
	return v != nil && v.TaskStartToCloseTimeoutSeconds != nil
}

// GetIdentity returns the value of Identity if it is set or its
// zero value if it is unset.
func (v *SignalWithStartWorkflowExecutionRequest) GetIdentity() (o string) {
	if v != nil && v.Identity != nil {
		return *v.Identity
	}

	return
}

// IsSetIdentity returns true if Identity is not nil.
func (v *SignalWithStartWorkflowExecutionRequest) IsSetIdentity() bool {
	return v != nil && v.Identity != nil
}

// GetRequestId returns the value of RequestId if it is set or its
// zero value if it is unset.
func (v *SignalWithStartWorkflowExecutionRequest) GetRequestId() (o string) {
	if v != nil && v.RequestId != nil {
		return *v.RequestId
	}

	return
}

// IsSetRequestId returns true if RequestId is not nil.
func (v *SignalWithStartWorkflowExecutionRequest) IsSetRequestId() bool {
	return v != nil && v.RequestId != nil
}

// GetWorkflowIdReusePolicy returns the value of WorkflowIdReusePolicy if it is set or its
// zero value if it is unset.
func (v *SignalWithStartWorkflowExecutionRequest) GetWorkflowIdReusePolicy() (o WorkflowIdReusePolicy) {
	if v != nil && v.WorkflowIdReusePolicy != nil {
		return *v.WorkflowIdReusePolicy
	}

	return
}

// IsSetWorkflowIdReusePolicy returns true if WorkflowIdReusePolicy is not nil.
func (v *SignalWithStartWorkflowExecutionRequest) IsSetWorkflowIdReusePolicy() bool {
	return v != nil && v.WorkflowIdReusePolicy != nil
}

// GetSignalName returns the value of SignalName if it is set or its
// zero value if it is unset.
func (v *SignalWithStartWorkflowExecutionRequest) GetSignalName() (o string) {
	if v != nil && v.SignalName != nil {
		return *v.SignalName
	}

	return
}

// IsSetSignalName returns true if SignalName is not nil.
func (v *SignalWithStartWorkflowExecutionRequest) IsSetSignalName() bool {
	return v != nil && v.SignalName != nil
}

// GetSignalInput returns the value of SignalInput if it is set or its
// zero value if it is unset.
func (v *SignalWithStartWorkflowExecutionRequest) GetSignalInput() (o []byte) {
	if v != nil && v.SignalInput != nil {
		return v.SignalInput
	}

	return
}

// IsSetSignalInput returns true if SignalInput is not nil.
func (v *SignalWithStartWorkflowExecutionRequest) IsSetSignalInput() bool {
	return v != nil && v.SignalInput != nil
}

// GetControl returns the value of Control if it is set or its
// zero value if it is unset.
func (v *SignalWithStartWorkflowExecutionRequest) GetControl() (o []byte) {
	if v != nil && v.Control != nil {
		return v.Control
	}

	return
}

// IsSetControl returns true if Control is not nil.
func (v *SignalWithStartWorkflowExecutionRequest) IsSetControl() bool {
	return v != nil && v.Control != nil
}

// GetRetryPolicy returns the value of RetryPolicy if it is set or its
// zero value if it is unset.
func (v *SignalWithStartWorkflowExecutionRequest) GetRetryPolicy() (o *RetryPolicy) {
	if v != nil && v.RetryPolicy != nil {
		return v.RetryPolicy
	}

	return
}

// IsSetRetryPolicy returns true if RetryPolicy is not nil.
func (v *SignalWithStartWorkflowExecutionRequest) IsSetRetryPolicy() bool {
	return v != nil && v.RetryPolicy != nil
}

// GetCronSchedule returns the value of CronSchedule if it is set or its
// zero value if it is unset.
func (v *SignalWithStartWorkflowExecutionRequest) GetCronSchedule() (o string) {
	if v != nil && v.CronSchedule != nil {
		return *v.CronSchedule
	}

	return
}

// IsSetCronSchedule returns true if CronSchedule is not nil.
func (v *SignalWithStartWorkflowExecutionRequest) IsSetCronSchedule() bool {
	return v != nil && v.CronSchedule != nil
}

// GetMemo returns the value of Memo if it is set or its
// zero value if it is unset.
func (v *SignalWithStartWorkflowExecutionRequest) GetMemo() (o *Memo) {
	if v != nil && v.Memo != nil {
		return v.Memo
	}

	return
}

// IsSetMemo returns true if Memo is not nil.
func (v *SignalWithStartWorkflowExecutionRequest) IsSetMemo() bool {
	return v != nil && v.Memo != nil
}

// GetSearchAttributes returns the value of SearchAttributes if it is set or its
// zero value if it is unset.
func (v *SignalWithStartWorkflowExecutionRequest) GetSearchAttributes() (o *SearchAttributes) {
	if v != nil && v.SearchAttributes != nil {
		return v.SearchAttributes
	}

	return
}

// IsSetSearchAttributes returns true if SearchAttributes is not nil.
func (v *SignalWithStartWorkflowExecutionRequest) IsSetSearchAttributes() bool {
	return v != nil && v.SearchAttributes != nil
}

// GetHeader returns the value of Header if it is set or its
// zero value if it is unset.
func (v *SignalWithStartWorkflowExecutionRequest) GetHeader() (o *Header) {
	if v != nil && v.Header != nil {
		return v.Header
	}

	return
}

// IsSetHeader returns true if Header is not nil.
func (v *SignalWithStartWorkflowExecutionRequest) IsSetHeader() bool {
	return v != nil && v.Header != nil
}

// GetDelayStartSeconds returns the value of DelayStartSeconds if it is set or its
// zero value if it is unset.
func (v *SignalWithStartWorkflowExecutionRequest) GetDelayStartSeconds() (o int32) {
	if v != nil && v.DelayStartSeconds != nil {
		return *v.DelayStartSeconds
	}

	return
}

// IsSetDelayStartSeconds returns true if DelayStartSeconds is not nil.
func (v *SignalWithStartWorkflowExecutionRequest) IsSetDelayStartSeconds() bool {
	return v != nil && v.DelayStartSeconds != nil
}

// GetJitterStartSeconds returns the value of JitterStartSeconds if it is set or its
// zero value if it is unset.
func (v *SignalWithStartWorkflowExecutionRequest) GetJitterStartSeconds() (o int32) {
	if v != nil && v.JitterStartSeconds != nil {
		return *v.JitterStartSeconds
	}

	return
}

// IsSetJitterStartSeconds returns true if JitterStartSeconds is not nil.
func (v *SignalWithStartWorkflowExecutionRequest) IsSetJitterStartSeconds() bool {
	return v != nil && v.JitterStartSeconds != nil
}

// GetFirstRunAtTimestamp returns the value of FirstRunAtTimestamp if it is set or its
// zero value if it is unset.
func (v *SignalWithStartWorkflowExecutionRequest) GetFirstRunAtTimestamp() (o int64) {
	if v != nil && v.FirstRunAtTimestamp != nil {
		return *v.FirstRunAtTimestamp
	}

	return
}

// IsSetFirstRunAtTimestamp returns true if FirstRunAtTimestamp is not nil.
func (v *SignalWithStartWorkflowExecutionRequest) IsSetFirstRunAtTimestamp() bool {
	return v != nil && v.FirstRunAtTimestamp != nil
}

// GetCronOverlapPolicy returns the value of CronOverlapPolicy if it is set or its
// zero value if it is unset.
func (v *SignalWithStartWorkflowExecutionRequest) GetCronOverlapPolicy() (o CronOverlapPolicy) {
	if v != nil && v.CronOverlapPolicy != nil {
		return *v.CronOverlapPolicy
	}

	return
}

// IsSetCronOverlapPolicy returns true if CronOverlapPolicy is not nil.
func (v *SignalWithStartWorkflowExecutionRequest) IsSetCronOverlapPolicy() bool {
	return v != nil && v.CronOverlapPolicy != nil
}

// GetActiveClusterSelectionPolicy returns the value of ActiveClusterSelectionPolicy if it is set or its
// zero value if it is unset.
func (v *SignalWithStartWorkflowExecutionRequest) GetActiveClusterSelectionPolicy() (o *ActiveClusterSelectionPolicy) {
	if v != nil && v.ActiveClusterSelectionPolicy != nil {
		return v.ActiveClusterSelectionPolicy
	}

	return
}

// IsSetActiveClusterSelectionPolicy returns true if ActiveClusterSelectionPolicy is not nil.
func (v *SignalWithStartWorkflowExecutionRequest) IsSetActiveClusterSelectionPolicy() bool {
	return v != nil && v.ActiveClusterSelectionPolicy != nil
}

type SignalWorkflowExecutionRequest struct {
	Domain            *string            `json:"domain,omitempty"`
	WorkflowExecution *WorkflowExecution `json:"workflowExecution,omitempty"`
	SignalName        *string            `json:"signalName,omitempty"`
	Input             []byte             `json:"input,omitempty"`
	Identity          *string            `json:"identity,omitempty"`
	RequestId         *string            `json:"requestId,omitempty"`
	Control           []byte             `json:"control,omitempty"`
}

// ToWire translates a SignalWorkflowExecutionRequest 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 *SignalWorkflowExecutionRequest) ToWire() (wire.Value, error) {
	var (
		fields [7]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.WorkflowExecution != nil {
		w, err = v.WorkflowExecution.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.SignalName != nil {
		w, err = wire.NewValueString(*(v.SignalName)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.Input != nil {
		w, err = wire.NewValueBinary(v.Input), 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++
	}
	if v.RequestId != nil {
		w, err = wire.NewValueString(*(v.RequestId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 60, Value: w}
		i++
	}
	if v.Control != nil {
		w, err = wire.NewValueBinary(v.Control), 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 SignalWorkflowExecutionRequest 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 SignalWorkflowExecutionRequest struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v SignalWorkflowExecutionRequest
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *SignalWorkflowExecutionRequest) 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.WorkflowExecution, 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.SignalName = &x
				if err != nil {
					return err
				}

			}
		case 40:
			if field.Value.Type() == wire.TBinary {
				v.Input, err = field.Value.GetBinary(), error(nil)
				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
				}

			}
		case 60:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.RequestId = &x
				if err != nil {
					return err
				}

			}
		case 70:
			if field.Value.Type() == wire.TBinary {
				v.Control, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a SignalWorkflowExecutionRequest
// struct.
func (v *SignalWorkflowExecutionRequest) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [7]string
	i := 0
	if v.Domain != nil {
		fields[i] = fmt.Sprintf("Domain: %v", *(v.Domain))
		i++
	}
	if v.WorkflowExecution != nil {
		fields[i] = fmt.Sprintf("WorkflowExecution: %v", v.WorkflowExecution)
		i++
	}
	if v.SignalName != nil {
		fields[i] = fmt.Sprintf("SignalName: %v", *(v.SignalName))
		i++
	}
	if v.Input != nil {
		fields[i] = fmt.Sprintf("Input: %v", v.Input)
		i++
	}
	if v.Identity != nil {
		fields[i] = fmt.Sprintf("Identity: %v", *(v.Identity))
		i++
	}
	if v.RequestId != nil {
		fields[i] = fmt.Sprintf("RequestId: %v", *(v.RequestId))
		i++
	}
	if v.Control != nil {
		fields[i] = fmt.Sprintf("Control: %v", v.Control)
		i++
	}

	return fmt.Sprintf("SignalWorkflowExecutionRequest{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this SignalWorkflowExecutionRequest match the
// provided SignalWorkflowExecutionRequest.
//
// This function performs a deep comparison.
func (v *SignalWorkflowExecutionRequest) Equals(rhs *SignalWorkflowExecutionRequest) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.Domain, rhs.Domain) {
		return false
	}
	if !((v.WorkflowExecution == nil && rhs.WorkflowExecution == nil) || (v.WorkflowExecution != nil && rhs.WorkflowExecution != nil && v.WorkflowExecution.Equals(rhs.WorkflowExecution))) {
		return false
	}
	if !_String_EqualsPtr(v.SignalName, rhs.SignalName) {
		return false
	}
	if !((v.Input == nil && rhs.Input == nil) || (v.Input != nil && rhs.Input != nil && bytes.Equal(v.Input, rhs.Input))) {
		return false
	}
	if !_String_EqualsPtr(v.Identity, rhs.Identity) {
		return false
	}
	if !_String_EqualsPtr(v.RequestId, rhs.RequestId) {
		return false
	}
	if !((v.Control == nil && rhs.Control == nil) || (v.Control != nil && rhs.Control != nil && bytes.Equal(v.Control, rhs.Control))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of SignalWorkflowExecutionRequest.
func (v *SignalWorkflowExecutionRequest) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Domain != nil {
		enc.AddString("domain", *v.Domain)
	}
	if v.WorkflowExecution != nil {
		err = multierr.Append(err, enc.AddObject("workflowExecution", v.WorkflowExecution))
	}
	if v.SignalName != nil {
		enc.AddString("signalName", *v.SignalName)
	}
	if v.Input != nil {
		enc.AddString("input", base64.StdEncoding.EncodeToString(v.Input))
	}
	if v.Identity != nil {
		enc.AddString("identity", *v.Identity)
	}
	if v.RequestId != nil {
		enc.AddString("requestId", *v.RequestId)
	}
	if v.Control != nil {
		enc.AddString("control", base64.StdEncoding.EncodeToString(v.Control))
	}
	return err
}

// GetDomain returns the value of Domain if it is set or its
// zero value if it is unset.
func (v *SignalWorkflowExecutionRequest) GetDomain() (o string) {
	if v != nil && v.Domain != nil {
		return *v.Domain
	}

	return
}

// IsSetDomain returns true if Domain is not nil.
func (v *SignalWorkflowExecutionRequest) IsSetDomain() bool {
	return v != nil && v.Domain != nil
}

// GetWorkflowExecution returns the value of WorkflowExecution if it is set or its
// zero value if it is unset.
func (v *SignalWorkflowExecutionRequest) GetWorkflowExecution() (o *WorkflowExecution) {
	if v != nil && v.WorkflowExecution != nil {
		return v.WorkflowExecution
	}

	return
}

// IsSetWorkflowExecution returns true if WorkflowExecution is not nil.
func (v *SignalWorkflowExecutionRequest) IsSetWorkflowExecution() bool {
	return v != nil && v.WorkflowExecution != nil
}

// GetSignalName returns the value of SignalName if it is set or its
// zero value if it is unset.
func (v *SignalWorkflowExecutionRequest) GetSignalName() (o string) {
	if v != nil && v.SignalName != nil {
		return *v.SignalName
	}

	return
}

// IsSetSignalName returns true if SignalName is not nil.
func (v *SignalWorkflowExecutionRequest) IsSetSignalName() bool {
	return v != nil && v.SignalName != nil
}

// GetInput returns the value of Input if it is set or its
// zero value if it is unset.
func (v *SignalWorkflowExecutionRequest) GetInput() (o []byte) {
	if v != nil && v.Input != nil {
		return v.Input
	}

	return
}

// IsSetInput returns true if Input is not nil.
func (v *SignalWorkflowExecutionRequest) IsSetInput() bool {
	return v != nil && v.Input != nil
}

// GetIdentity returns the value of Identity if it is set or its
// zero value if it is unset.
func (v *SignalWorkflowExecutionRequest) GetIdentity() (o string) {
	if v != nil && v.Identity != nil {
		return *v.Identity
	}

	return
}

// IsSetIdentity returns true if Identity is not nil.
func (v *SignalWorkflowExecutionRequest) IsSetIdentity() bool {
	return v != nil && v.Identity != nil
}

// GetRequestId returns the value of RequestId if it is set or its
// zero value if it is unset.
func (v *SignalWorkflowExecutionRequest) GetRequestId() (o string) {
	if v != nil && v.RequestId != nil {
		return *v.RequestId
	}

	return
}

// IsSetRequestId returns true if RequestId is not nil.
func (v *SignalWorkflowExecutionRequest) IsSetRequestId() bool {
	return v != nil && v.RequestId != nil
}

// GetControl returns the value of Control if it is set or its
// zero value if it is unset.
func (v *SignalWorkflowExecutionRequest) GetControl() (o []byte) {
	if v != nil && v.Control != nil {
		return v.Control
	}

	return
}

// IsSetControl returns true if Control is not nil.
func (v *SignalWorkflowExecutionRequest) IsSetControl() bool {
	return v != nil && v.Control != nil
}

type StartChildWorkflowExecutionDecisionAttributes struct {
	Domain                              *string                       `json:"domain,omitempty"`
	WorkflowId                          *string                       `json:"workflowId,omitempty"`
	WorkflowType                        *WorkflowType                 `json:"workflowType,omitempty"`
	TaskList                            *TaskList                     `json:"taskList,omitempty"`
	Input                               []byte                        `json:"input,omitempty"`
	ExecutionStartToCloseTimeoutSeconds *int32                        `json:"executionStartToCloseTimeoutSeconds,omitempty"`
	TaskStartToCloseTimeoutSeconds      *int32                        `json:"taskStartToCloseTimeoutSeconds,omitempty"`
	ParentClosePolicy                   *ParentClosePolicy            `json:"parentClosePolicy,omitempty"`
	Control                             []byte                        `json:"control,omitempty"`
	WorkflowIdReusePolicy               *WorkflowIdReusePolicy        `json:"workflowIdReusePolicy,omitempty"`
	RetryPolicy                         *RetryPolicy                  `json:"retryPolicy,omitempty"`
	CronSchedule                        *string                       `json:"cronSchedule,omitempty"`
	Header                              *Header                       `json:"header,omitempty"`
	Memo                                *Memo                         `json:"memo,omitempty"`
	SearchAttributes                    *SearchAttributes             `json:"searchAttributes,omitempty"`
	CronOverlapPolicy                   *CronOverlapPolicy            `json:"cronOverlapPolicy,omitempty"`
	ActiveClusterSelectionPolicy        *ActiveClusterSelectionPolicy `json:"activeClusterSelectionPolicy,omitempty"`
}

// ToWire translates a StartChildWorkflowExecutionDecisionAttributes 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 *StartChildWorkflowExecutionDecisionAttributes) ToWire() (wire.Value, error) {
	var (
		fields [17]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.WorkflowId != nil {
		w, err = wire.NewValueString(*(v.WorkflowId)), error(nil)
		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.TaskList != nil {
		w, err = v.TaskList.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 40, Value: w}
		i++
	}
	if v.Input != nil {
		w, err = wire.NewValueBinary(v.Input), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 50, Value: w}
		i++
	}
	if v.ExecutionStartToCloseTimeoutSeconds != nil {
		w, err = wire.NewValueI32(*(v.ExecutionStartToCloseTimeoutSeconds)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 60, Value: w}
		i++
	}
	if v.TaskStartToCloseTimeoutSeconds != nil {
		w, err = wire.NewValueI32(*(v.TaskStartToCloseTimeoutSeconds)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 70, Value: w}
		i++
	}
	if v.ParentClosePolicy != nil {
		w, err = v.ParentClosePolicy.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 81, Value: w}
		i++
	}
	if v.Control != nil {
		w, err = wire.NewValueBinary(v.Control), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 90, Value: w}
		i++
	}
	if v.WorkflowIdReusePolicy != nil {
		w, err = v.WorkflowIdReusePolicy.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 100, Value: w}
		i++
	}
	if v.RetryPolicy != nil {
		w, err = v.RetryPolicy.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 110, Value: w}
		i++
	}
	if v.CronSchedule != nil {
		w, err = wire.NewValueString(*(v.CronSchedule)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 120, Value: w}
		i++
	}
	if v.Header != nil {
		w, err = v.Header.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 130, Value: w}
		i++
	}
	if v.Memo != nil {
		w, err = v.Memo.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 140, Value: w}
		i++
	}
	if v.SearchAttributes != nil {
		w, err = v.SearchAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 150, Value: w}
		i++
	}
	if v.CronOverlapPolicy != nil {
		w, err = v.CronOverlapPolicy.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 160, Value: w}
		i++
	}
	if v.ActiveClusterSelectionPolicy != nil {
		w, err = v.ActiveClusterSelectionPolicy.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
}

// FromWire deserializes a StartChildWorkflowExecutionDecisionAttributes 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 StartChildWorkflowExecutionDecisionAttributes struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v StartChildWorkflowExecutionDecisionAttributes
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *StartChildWorkflowExecutionDecisionAttributes) 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.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.WorkflowId = &x
				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.TStruct {
				v.TaskList, err = _TaskList_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 50:
			if field.Value.Type() == wire.TBinary {
				v.Input, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		case 60:
			if field.Value.Type() == wire.TI32 {
				var x int32
				x, err = field.Value.GetI32(), error(nil)
				v.ExecutionStartToCloseTimeoutSeconds = &x
				if err != nil {
					return err
				}

			}
		case 70:
			if field.Value.Type() == wire.TI32 {
				var x int32
				x, err = field.Value.GetI32(), error(nil)
				v.TaskStartToCloseTimeoutSeconds = &x
				if err != nil {
					return err
				}

			}
		case 81:
			if field.Value.Type() == wire.TI32 {
				var x ParentClosePolicy
				x, err = _ParentClosePolicy_Read(field.Value)
				v.ParentClosePolicy = &x
				if err != nil {
					return err
				}

			}
		case 90:
			if field.Value.Type() == wire.TBinary {
				v.Control, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		case 100:
			if field.Value.Type() == wire.TI32 {
				var x WorkflowIdReusePolicy
				x, err = _WorkflowIdReusePolicy_Read(field.Value)
				v.WorkflowIdReusePolicy = &x
				if err != nil {
					return err
				}

			}
		case 110:
			if field.Value.Type() == wire.TStruct {
				v.RetryPolicy, err = _RetryPolicy_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 120:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.CronSchedule = &x
				if err != nil {
					return err
				}

			}
		case 130:
			if field.Value.Type() == wire.TStruct {
				v.Header, err = _Header_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 140:
			if field.Value.Type() == wire.TStruct {
				v.Memo, err = _Memo_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 150:
			if field.Value.Type() == wire.TStruct {
				v.SearchAttributes, err = _SearchAttributes_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 160:
			if field.Value.Type() == wire.TI32 {
				var x CronOverlapPolicy
				x, err = _CronOverlapPolicy_Read(field.Value)
				v.CronOverlapPolicy = &x
				if err != nil {
					return err
				}

			}
		case 170:
			if field.Value.Type() == wire.TStruct {
				v.ActiveClusterSelectionPolicy, err = _ActiveClusterSelectionPolicy_Read(field.Value)
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a StartChildWorkflowExecutionDecisionAttributes
// struct.
func (v *StartChildWorkflowExecutionDecisionAttributes) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [17]string
	i := 0
	if v.Domain != nil {
		fields[i] = fmt.Sprintf("Domain: %v", *(v.Domain))
		i++
	}
	if v.WorkflowId != nil {
		fields[i] = fmt.Sprintf("WorkflowId: %v", *(v.WorkflowId))
		i++
	}
	if v.WorkflowType != nil {
		fields[i] = fmt.Sprintf("WorkflowType: %v", v.WorkflowType)
		i++
	}
	if v.TaskList != nil {
		fields[i] = fmt.Sprintf("TaskList: %v", v.TaskList)
		i++
	}
	if v.Input != nil {
		fields[i] = fmt.Sprintf("Input: %v", v.Input)
		i++
	}
	if v.ExecutionStartToCloseTimeoutSeconds != nil {
		fields[i] = fmt.Sprintf("ExecutionStartToCloseTimeoutSeconds: %v", *(v.ExecutionStartToCloseTimeoutSeconds))
		i++
	}
	if v.TaskStartToCloseTimeoutSeconds != nil {
		fields[i] = fmt.Sprintf("TaskStartToCloseTimeoutSeconds: %v", *(v.TaskStartToCloseTimeoutSeconds))
		i++
	}
	if v.ParentClosePolicy != nil {
		fields[i] = fmt.Sprintf("ParentClosePolicy: %v", *(v.ParentClosePolicy))
		i++
	}
	if v.Control != nil {
		fields[i] = fmt.Sprintf("Control: %v", v.Control)
		i++
	}
	if v.WorkflowIdReusePolicy != nil {
		fields[i] = fmt.Sprintf("WorkflowIdReusePolicy: %v", *(v.WorkflowIdReusePolicy))
		i++
	}
	if v.RetryPolicy != nil {
		fields[i] = fmt.Sprintf("RetryPolicy: %v", v.RetryPolicy)
		i++
	}
	if v.CronSchedule != nil {
		fields[i] = fmt.Sprintf("CronSchedule: %v", *(v.CronSchedule))
		i++
	}
	if v.Header != nil {
		fields[i] = fmt.Sprintf("Header: %v", v.Header)
		i++
	}
	if v.Memo != nil {
		fields[i] = fmt.Sprintf("Memo: %v", v.Memo)
		i++
	}
	if v.SearchAttributes != nil {
		fields[i] = fmt.Sprintf("SearchAttributes: %v", v.SearchAttributes)
		i++
	}
	if v.CronOverlapPolicy != nil {
		fields[i] = fmt.Sprintf("CronOverlapPolicy: %v", *(v.CronOverlapPolicy))
		i++
	}
	if v.ActiveClusterSelectionPolicy != nil {
		fields[i] = fmt.Sprintf("ActiveClusterSelectionPolicy: %v", v.ActiveClusterSelectionPolicy)
		i++
	}

	return fmt.Sprintf("StartChildWorkflowExecutionDecisionAttributes{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this StartChildWorkflowExecutionDecisionAttributes match the
// provided StartChildWorkflowExecutionDecisionAttributes.
//
// This function performs a deep comparison.
func (v *StartChildWorkflowExecutionDecisionAttributes) Equals(rhs *StartChildWorkflowExecutionDecisionAttributes) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.Domain, rhs.Domain) {
		return false
	}
	if !_String_EqualsPtr(v.WorkflowId, rhs.WorkflowId) {
		return false
	}
	if !((v.WorkflowType == nil && rhs.WorkflowType == nil) || (v.WorkflowType != nil && rhs.WorkflowType != nil && v.WorkflowType.Equals(rhs.WorkflowType))) {
		return false
	}
	if !((v.TaskList == nil && rhs.TaskList == nil) || (v.TaskList != nil && rhs.TaskList != nil && v.TaskList.Equals(rhs.TaskList))) {
		return false
	}
	if !((v.Input == nil && rhs.Input == nil) || (v.Input != nil && rhs.Input != nil && bytes.Equal(v.Input, rhs.Input))) {
		return false
	}
	if !_I32_EqualsPtr(v.ExecutionStartToCloseTimeoutSeconds, rhs.ExecutionStartToCloseTimeoutSeconds) {
		return false
	}
	if !_I32_EqualsPtr(v.TaskStartToCloseTimeoutSeconds, rhs.TaskStartToCloseTimeoutSeconds) {
		return false
	}
	if !_ParentClosePolicy_EqualsPtr(v.ParentClosePolicy, rhs.ParentClosePolicy) {
		return false
	}
	if !((v.Control == nil && rhs.Control == nil) || (v.Control != nil && rhs.Control != nil && bytes.Equal(v.Control, rhs.Control))) {
		return false
	}
	if !_WorkflowIdReusePolicy_EqualsPtr(v.WorkflowIdReusePolicy, rhs.WorkflowIdReusePolicy) {
		return false
	}
	if !((v.RetryPolicy == nil && rhs.RetryPolicy == nil) || (v.RetryPolicy != nil && rhs.RetryPolicy != nil && v.RetryPolicy.Equals(rhs.RetryPolicy))) {
		return false
	}
	if !_String_EqualsPtr(v.CronSchedule, rhs.CronSchedule) {
		return false
	}
	if !((v.Header == nil && rhs.Header == nil) || (v.Header != nil && rhs.Header != nil && v.Header.Equals(rhs.Header))) {
		return false
	}
	if !((v.Memo == nil && rhs.Memo == nil) || (v.Memo != nil && rhs.Memo != nil && v.Memo.Equals(rhs.Memo))) {
		return false
	}
	if !((v.SearchAttributes == nil && rhs.SearchAttributes == nil) || (v.SearchAttributes != nil && rhs.SearchAttributes != nil && v.SearchAttributes.Equals(rhs.SearchAttributes))) {
		return false
	}
	if !_CronOverlapPolicy_EqualsPtr(v.CronOverlapPolicy, rhs.CronOverlapPolicy) {
		return false
	}
	if !((v.ActiveClusterSelectionPolicy == nil && rhs.ActiveClusterSelectionPolicy == nil) || (v.ActiveClusterSelectionPolicy != nil && rhs.ActiveClusterSelectionPolicy != nil && v.ActiveClusterSelectionPolicy.Equals(rhs.ActiveClusterSelectionPolicy))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of StartChildWorkflowExecutionDecisionAttributes.
func (v *StartChildWorkflowExecutionDecisionAttributes) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Domain != nil {
		enc.AddString("domain", *v.Domain)
	}
	if v.WorkflowId != nil {
		enc.AddString("workflowId", *v.WorkflowId)
	}
	if v.WorkflowType != nil {
		err = multierr.Append(err, enc.AddObject("workflowType", v.WorkflowType))
	}
	if v.TaskList != nil {
		err = multierr.Append(err, enc.AddObject("taskList", v.TaskList))
	}
	if v.Input != nil {
		enc.AddString("input", base64.StdEncoding.EncodeToString(v.Input))
	}
	if v.ExecutionStartToCloseTimeoutSeconds != nil {
		enc.AddInt32("executionStartToCloseTimeoutSeconds", *v.ExecutionStartToCloseTimeoutSeconds)
	}
	if v.TaskStartToCloseTimeoutSeconds != nil {
		enc.AddInt32("taskStartToCloseTimeoutSeconds", *v.TaskStartToCloseTimeoutSeconds)
	}
	if v.ParentClosePolicy != nil {
		err = multierr.Append(err, enc.AddObject("parentClosePolicy", *v.ParentClosePolicy))
	}
	if v.Control != nil {
		enc.AddString("control", base64.StdEncoding.EncodeToString(v.Control))
	}
	if v.WorkflowIdReusePolicy != nil {
		err = multierr.Append(err, enc.AddObject("workflowIdReusePolicy", *v.WorkflowIdReusePolicy))
	}
	if v.RetryPolicy != nil {
		err = multierr.Append(err, enc.AddObject("retryPolicy", v.RetryPolicy))
	}
	if v.CronSchedule != nil {
		enc.AddString("cronSchedule", *v.CronSchedule)
	}
	if v.Header != nil {
		err = multierr.Append(err, enc.AddObject("header", v.Header))
	}
	if v.Memo != nil {
		err = multierr.Append(err, enc.AddObject("memo", v.Memo))
	}
	if v.SearchAttributes != nil {
		err = multierr.Append(err, enc.AddObject("searchAttributes", v.SearchAttributes))
	}
	if v.CronOverlapPolicy != nil {
		err = multierr.Append(err, enc.AddObject("cronOverlapPolicy", *v.CronOverlapPolicy))
	}
	if v.ActiveClusterSelectionPolicy != nil {
		err = multierr.Append(err, enc.AddObject("activeClusterSelectionPolicy", v.ActiveClusterSelectionPolicy))
	}
	return err
}

// GetDomain returns the value of Domain if it is set or its
// zero value if it is unset.
func (v *StartChildWorkflowExecutionDecisionAttributes) GetDomain() (o string) {
	if v != nil && v.Domain != nil {
		return *v.Domain
	}

	return
}

// IsSetDomain returns true if Domain is not nil.
func (v *StartChildWorkflowExecutionDecisionAttributes) IsSetDomain() bool {
	return v != nil && v.Domain != nil
}

// GetWorkflowId returns the value of WorkflowId if it is set or its
// zero value if it is unset.
func (v *StartChildWorkflowExecutionDecisionAttributes) GetWorkflowId() (o string) {
	if v != nil && v.WorkflowId != nil {
		return *v.WorkflowId
	}

	return
}

// IsSetWorkflowId returns true if WorkflowId is not nil.
func (v *StartChildWorkflowExecutionDecisionAttributes) IsSetWorkflowId() bool {
	return v != nil && v.WorkflowId != nil
}

// GetWorkflowType returns the value of WorkflowType if it is set or its
// zero value if it is unset.
func (v *StartChildWorkflowExecutionDecisionAttributes) GetWorkflowType() (o *WorkflowType) {
	if v != nil && v.WorkflowType != nil {
		return v.WorkflowType
	}

	return
}

// IsSetWorkflowType returns true if WorkflowType is not nil.
func (v *StartChildWorkflowExecutionDecisionAttributes) IsSetWorkflowType() bool {
	return v != nil && v.WorkflowType != nil
}

// GetTaskList returns the value of TaskList if it is set or its
// zero value if it is unset.
func (v *StartChildWorkflowExecutionDecisionAttributes) GetTaskList() (o *TaskList) {
	if v != nil && v.TaskList != nil {
		return v.TaskList
	}

	return
}

// IsSetTaskList returns true if TaskList is not nil.
func (v *StartChildWorkflowExecutionDecisionAttributes) IsSetTaskList() bool {
	return v != nil && v.TaskList != nil
}

// GetInput returns the value of Input if it is set or its
// zero value if it is unset.
func (v *StartChildWorkflowExecutionDecisionAttributes) GetInput() (o []byte) {
	if v != nil && v.Input != nil {
		return v.Input
	}

	return
}

// IsSetInput returns true if Input is not nil.
func (v *StartChildWorkflowExecutionDecisionAttributes) IsSetInput() bool {
	return v != nil && v.Input != nil
}

// GetExecutionStartToCloseTimeoutSeconds returns the value of ExecutionStartToCloseTimeoutSeconds if it is set or its
// zero value if it is unset.
func (v *StartChildWorkflowExecutionDecisionAttributes) GetExecutionStartToCloseTimeoutSeconds() (o int32) {
	if v != nil && v.ExecutionStartToCloseTimeoutSeconds != nil {
		return *v.ExecutionStartToCloseTimeoutSeconds
	}

	return
}

// IsSetExecutionStartToCloseTimeoutSeconds returns true if ExecutionStartToCloseTimeoutSeconds is not nil.
func (v *StartChildWorkflowExecutionDecisionAttributes) IsSetExecutionStartToCloseTimeoutSeconds() bool {
	return v != nil && v.ExecutionStartToCloseTimeoutSeconds != nil
}

// GetTaskStartToCloseTimeoutSeconds returns the value of TaskStartToCloseTimeoutSeconds if it is set or its
// zero value if it is unset.
func (v *StartChildWorkflowExecutionDecisionAttributes) GetTaskStartToCloseTimeoutSeconds() (o int32) {
	if v != nil && v.TaskStartToCloseTimeoutSeconds != nil {
		return *v.TaskStartToCloseTimeoutSeconds
	}

	return
}

// IsSetTaskStartToCloseTimeoutSeconds returns true if TaskStartToCloseTimeoutSeconds is not nil.
func (v *StartChildWorkflowExecutionDecisionAttributes) IsSetTaskStartToCloseTimeoutSeconds() bool {
	return v != nil && v.TaskStartToCloseTimeoutSeconds != nil
}

// GetParentClosePolicy returns the value of ParentClosePolicy if it is set or its
// zero value if it is unset.
func (v *StartChildWorkflowExecutionDecisionAttributes) GetParentClosePolicy() (o ParentClosePolicy) {
	if v != nil && v.ParentClosePolicy != nil {
		return *v.ParentClosePolicy
	}

	return
}

// IsSetParentClosePolicy returns true if ParentClosePolicy is not nil.
func (v *StartChildWorkflowExecutionDecisionAttributes) IsSetParentClosePolicy() bool {
	return v != nil && v.ParentClosePolicy != nil
}

// GetControl returns the value of Control if it is set or its
// zero value if it is unset.
func (v *StartChildWorkflowExecutionDecisionAttributes) GetControl() (o []byte) {
	if v != nil && v.Control != nil {
		return v.Control
	}

	return
}

// IsSetControl returns true if Control is not nil.
func (v *StartChildWorkflowExecutionDecisionAttributes) IsSetControl() bool {
	return v != nil && v.Control != nil
}

// GetWorkflowIdReusePolicy returns the value of WorkflowIdReusePolicy if it is set or its
// zero value if it is unset.
func (v *StartChildWorkflowExecutionDecisionAttributes) GetWorkflowIdReusePolicy() (o WorkflowIdReusePolicy) {
	if v != nil && v.WorkflowIdReusePolicy != nil {
		return *v.WorkflowIdReusePolicy
	}

	return
}

// IsSetWorkflowIdReusePolicy returns true if WorkflowIdReusePolicy is not nil.
func (v *StartChildWorkflowExecutionDecisionAttributes) IsSetWorkflowIdReusePolicy() bool {
	return v != nil && v.WorkflowIdReusePolicy != nil
}

// GetRetryPolicy returns the value of RetryPolicy if it is set or its
// zero value if it is unset.
func (v *StartChildWorkflowExecutionDecisionAttributes) GetRetryPolicy() (o *RetryPolicy) {
	if v != nil && v.RetryPolicy != nil {
		return v.RetryPolicy
	}

	return
}

// IsSetRetryPolicy returns true if RetryPolicy is not nil.
func (v *StartChildWorkflowExecutionDecisionAttributes) IsSetRetryPolicy() bool {
	return v != nil && v.RetryPolicy != nil
}

// GetCronSchedule returns the value of CronSchedule if it is set or its
// zero value if it is unset.
func (v *StartChildWorkflowExecutionDecisionAttributes) GetCronSchedule() (o string) {
	if v != nil && v.CronSchedule != nil {
		return *v.CronSchedule
	}

	return
}

// IsSetCronSchedule returns true if CronSchedule is not nil.
func (v *StartChildWorkflowExecutionDecisionAttributes) IsSetCronSchedule() bool {
	return v != nil && v.CronSchedule != nil
}

// GetHeader returns the value of Header if it is set or its
// zero value if it is unset.
func (v *StartChildWorkflowExecutionDecisionAttributes) GetHeader() (o *Header) {
	if v != nil && v.Header != nil {
		return v.Header
	}

	return
}

// IsSetHeader returns true if Header is not nil.
func (v *StartChildWorkflowExecutionDecisionAttributes) IsSetHeader() bool {
	return v != nil && v.Header != nil
}

// GetMemo returns the value of Memo if it is set or its
// zero value if it is unset.
func (v *StartChildWorkflowExecutionDecisionAttributes) GetMemo() (o *Memo) {
	if v != nil && v.Memo != nil {
		return v.Memo
	}

	return
}

// IsSetMemo returns true if Memo is not nil.
func (v *StartChildWorkflowExecutionDecisionAttributes) IsSetMemo() bool {
	return v != nil && v.Memo != nil
}

// GetSearchAttributes returns the value of SearchAttributes if it is set or its
// zero value if it is unset.
func (v *StartChildWorkflowExecutionDecisionAttributes) GetSearchAttributes() (o *SearchAttributes) {
	if v != nil && v.SearchAttributes != nil {
		return v.SearchAttributes
	}

	return
}

// IsSetSearchAttributes returns true if SearchAttributes is not nil.
func (v *StartChildWorkflowExecutionDecisionAttributes) IsSetSearchAttributes() bool {
	return v != nil && v.SearchAttributes != nil
}

// GetCronOverlapPolicy returns the value of CronOverlapPolicy if it is set or its
// zero value if it is unset.
func (v *StartChildWorkflowExecutionDecisionAttributes) GetCronOverlapPolicy() (o CronOverlapPolicy) {
	if v != nil && v.CronOverlapPolicy != nil {
		return *v.CronOverlapPolicy
	}

	return
}

// IsSetCronOverlapPolicy returns true if CronOverlapPolicy is not nil.
func (v *StartChildWorkflowExecutionDecisionAttributes) IsSetCronOverlapPolicy() bool {
	return v != nil && v.CronOverlapPolicy != nil
}

// GetActiveClusterSelectionPolicy returns the value of ActiveClusterSelectionPolicy if it is set or its
// zero value if it is unset.
func (v *StartChildWorkflowExecutionDecisionAttributes) GetActiveClusterSelectionPolicy() (o *ActiveClusterSelectionPolicy) {
	if v != nil && v.ActiveClusterSelectionPolicy != nil {
		return v.ActiveClusterSelectionPolicy
	}

	return
}

// IsSetActiveClusterSelectionPolicy returns true if ActiveClusterSelectionPolicy is not nil.
func (v *StartChildWorkflowExecutionDecisionAttributes) IsSetActiveClusterSelectionPolicy() bool {
	return v != nil && v.ActiveClusterSelectionPolicy != nil
}

type StartChildWorkflowExecutionFailedEventAttributes struct {
	Domain                       *string                            `json:"domain,omitempty"`
	WorkflowId                   *string                            `json:"workflowId,omitempty"`
	WorkflowType                 *WorkflowType                      `json:"workflowType,omitempty"`
	Cause                        *ChildWorkflowExecutionFailedCause `json:"cause,omitempty"`
	Control                      []byte                             `json:"control,omitempty"`
	InitiatedEventId             *int64                             `json:"initiatedEventId,omitempty"`
	DecisionTaskCompletedEventId *int64                             `json:"decisionTaskCompletedEventId,omitempty"`
}

// ToWire translates a StartChildWorkflowExecutionFailedEventAttributes 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 *StartChildWorkflowExecutionFailedEventAttributes) ToWire() (wire.Value, error) {
	var (
		fields [7]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.WorkflowId != nil {
		w, err = wire.NewValueString(*(v.WorkflowId)), error(nil)
		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.Cause != nil {
		w, err = v.Cause.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 40, Value: w}
		i++
	}
	if v.Control != nil {
		w, err = wire.NewValueBinary(v.Control), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 50, Value: w}
		i++
	}
	if v.InitiatedEventId != nil {
		w, err = wire.NewValueI64(*(v.InitiatedEventId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 60, 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: 70, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

func _ChildWorkflowExecutionFailedCause_Read(w wire.Value) (ChildWorkflowExecutionFailedCause, error) {
	var v ChildWorkflowExecutionFailedCause
	err := v.FromWire(w)
	return v, err
}

// FromWire deserializes a StartChildWorkflowExecutionFailedEventAttributes 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 StartChildWorkflowExecutionFailedEventAttributes struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v StartChildWorkflowExecutionFailedEventAttributes
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *StartChildWorkflowExecutionFailedEventAttributes) 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.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.WorkflowId = &x
				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.TI32 {
				var x ChildWorkflowExecutionFailedCause
				x, err = _ChildWorkflowExecutionFailedCause_Read(field.Value)
				v.Cause = &x
				if err != nil {
					return err
				}

			}
		case 50:
			if field.Value.Type() == wire.TBinary {
				v.Control, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		case 60:
			if field.Value.Type() == wire.TI64 {
				var x int64
				x, err = field.Value.GetI64(), error(nil)
				v.InitiatedEventId = &x
				if err != nil {
					return err
				}

			}
		case 70:
			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
}

// String returns a readable string representation of a StartChildWorkflowExecutionFailedEventAttributes
// struct.
func (v *StartChildWorkflowExecutionFailedEventAttributes) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [7]string
	i := 0
	if v.Domain != nil {
		fields[i] = fmt.Sprintf("Domain: %v", *(v.Domain))
		i++
	}
	if v.WorkflowId != nil {
		fields[i] = fmt.Sprintf("WorkflowId: %v", *(v.WorkflowId))
		i++
	}
	if v.WorkflowType != nil {
		fields[i] = fmt.Sprintf("WorkflowType: %v", v.WorkflowType)
		i++
	}
	if v.Cause != nil {
		fields[i] = fmt.Sprintf("Cause: %v", *(v.Cause))
		i++
	}
	if v.Control != nil {
		fields[i] = fmt.Sprintf("Control: %v", v.Control)
		i++
	}
	if v.InitiatedEventId != nil {
		fields[i] = fmt.Sprintf("InitiatedEventId: %v", *(v.InitiatedEventId))
		i++
	}
	if v.DecisionTaskCompletedEventId != nil {
		fields[i] = fmt.Sprintf("DecisionTaskCompletedEventId: %v", *(v.DecisionTaskCompletedEventId))
		i++
	}

	return fmt.Sprintf("StartChildWorkflowExecutionFailedEventAttributes{%v}", strings.Join(fields[:i], ", "))
}

func _ChildWorkflowExecutionFailedCause_EqualsPtr(lhs, rhs *ChildWorkflowExecutionFailedCause) bool {
	if lhs != nil && rhs != nil {

		x := *lhs
		y := *rhs
		return x.Equals(y)
	}
	return lhs == nil && rhs == nil
}

// Equals returns true if all the fields of this StartChildWorkflowExecutionFailedEventAttributes match the
// provided StartChildWorkflowExecutionFailedEventAttributes.
//
// This function performs a deep comparison.
func (v *StartChildWorkflowExecutionFailedEventAttributes) Equals(rhs *StartChildWorkflowExecutionFailedEventAttributes) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.Domain, rhs.Domain) {
		return false
	}
	if !_String_EqualsPtr(v.WorkflowId, rhs.WorkflowId) {
		return false
	}
	if !((v.WorkflowType == nil && rhs.WorkflowType == nil) || (v.WorkflowType != nil && rhs.WorkflowType != nil && v.WorkflowType.Equals(rhs.WorkflowType))) {
		return false
	}
	if !_ChildWorkflowExecutionFailedCause_EqualsPtr(v.Cause, rhs.Cause) {
		return false
	}
	if !((v.Control == nil && rhs.Control == nil) || (v.Control != nil && rhs.Control != nil && bytes.Equal(v.Control, rhs.Control))) {
		return false
	}
	if !_I64_EqualsPtr(v.InitiatedEventId, rhs.InitiatedEventId) {
		return false
	}
	if !_I64_EqualsPtr(v.DecisionTaskCompletedEventId, rhs.DecisionTaskCompletedEventId) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of StartChildWorkflowExecutionFailedEventAttributes.
func (v *StartChildWorkflowExecutionFailedEventAttributes) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Domain != nil {
		enc.AddString("domain", *v.Domain)
	}
	if v.WorkflowId != nil {
		enc.AddString("workflowId", *v.WorkflowId)
	}
	if v.WorkflowType != nil {
		err = multierr.Append(err, enc.AddObject("workflowType", v.WorkflowType))
	}
	if v.Cause != nil {
		err = multierr.Append(err, enc.AddObject("cause", *v.Cause))
	}
	if v.Control != nil {
		enc.AddString("control", base64.StdEncoding.EncodeToString(v.Control))
	}
	if v.InitiatedEventId != nil {
		enc.AddInt64("initiatedEventId", *v.InitiatedEventId)
	}
	if v.DecisionTaskCompletedEventId != nil {
		enc.AddInt64("decisionTaskCompletedEventId", *v.DecisionTaskCompletedEventId)
	}
	return err
}

// GetDomain returns the value of Domain if it is set or its
// zero value if it is unset.
func (v *StartChildWorkflowExecutionFailedEventAttributes) GetDomain() (o string) {
	if v != nil && v.Domain != nil {
		return *v.Domain
	}

	return
}

// IsSetDomain returns true if Domain is not nil.
func (v *StartChildWorkflowExecutionFailedEventAttributes) IsSetDomain() bool {
	return v != nil && v.Domain != nil
}

// GetWorkflowId returns the value of WorkflowId if it is set or its
// zero value if it is unset.
func (v *StartChildWorkflowExecutionFailedEventAttributes) GetWorkflowId() (o string) {
	if v != nil && v.WorkflowId != nil {
		return *v.WorkflowId
	}

	return
}

// IsSetWorkflowId returns true if WorkflowId is not nil.
func (v *StartChildWorkflowExecutionFailedEventAttributes) IsSetWorkflowId() bool {
	return v != nil && v.WorkflowId != nil
}

// GetWorkflowType returns the value of WorkflowType if it is set or its
// zero value if it is unset.
func (v *StartChildWorkflowExecutionFailedEventAttributes) GetWorkflowType() (o *WorkflowType) {
	if v != nil && v.WorkflowType != nil {
		return v.WorkflowType
	}

	return
}

// IsSetWorkflowType returns true if WorkflowType is not nil.
func (v *StartChildWorkflowExecutionFailedEventAttributes) IsSetWorkflowType() bool {
	return v != nil && v.WorkflowType != nil
}

// GetCause returns the value of Cause if it is set or its
// zero value if it is unset.
func (v *StartChildWorkflowExecutionFailedEventAttributes) GetCause() (o ChildWorkflowExecutionFailedCause) {
	if v != nil && v.Cause != nil {
		return *v.Cause
	}

	return
}

// IsSetCause returns true if Cause is not nil.
func (v *StartChildWorkflowExecutionFailedEventAttributes) IsSetCause() bool {
	return v != nil && v.Cause != nil
}

// GetControl returns the value of Control if it is set or its
// zero value if it is unset.
func (v *StartChildWorkflowExecutionFailedEventAttributes) GetControl() (o []byte) {
	if v != nil && v.Control != nil {
		return v.Control
	}

	return
}

// IsSetControl returns true if Control is not nil.
func (v *StartChildWorkflowExecutionFailedEventAttributes) IsSetControl() bool {
	return v != nil && v.Control != nil
}

// GetInitiatedEventId returns the value of InitiatedEventId if it is set or its
// zero value if it is unset.
func (v *StartChildWorkflowExecutionFailedEventAttributes) GetInitiatedEventId() (o int64) {
	if v != nil && v.InitiatedEventId != nil {
		return *v.InitiatedEventId
	}

	return
}

// IsSetInitiatedEventId returns true if InitiatedEventId is not nil.
func (v *StartChildWorkflowExecutionFailedEventAttributes) IsSetInitiatedEventId() bool {
	return v != nil && v.InitiatedEventId != nil
}

// GetDecisionTaskCompletedEventId returns the value of DecisionTaskCompletedEventId if it is set or its
// zero value if it is unset.
func (v *StartChildWorkflowExecutionFailedEventAttributes) GetDecisionTaskCompletedEventId() (o int64) {
	if v != nil && v.DecisionTaskCompletedEventId != nil {
		return *v.DecisionTaskCompletedEventId
	}

	return
}

// IsSetDecisionTaskCompletedEventId returns true if DecisionTaskCompletedEventId is not nil.
func (v *StartChildWorkflowExecutionFailedEventAttributes) IsSetDecisionTaskCompletedEventId() bool {
	return v != nil && v.DecisionTaskCompletedEventId != nil
}

type StartChildWorkflowExecutionInitiatedEventAttributes struct {
	Domain                              *string                       `json:"domain,omitempty"`
	WorkflowId                          *string                       `json:"workflowId,omitempty"`
	WorkflowType                        *WorkflowType                 `json:"workflowType,omitempty"`
	TaskList                            *TaskList                     `json:"taskList,omitempty"`
	Input                               []byte                        `json:"input,omitempty"`
	ExecutionStartToCloseTimeoutSeconds *int32                        `json:"executionStartToCloseTimeoutSeconds,omitempty"`
	TaskStartToCloseTimeoutSeconds      *int32                        `json:"taskStartToCloseTimeoutSeconds,omitempty"`
	ParentClosePolicy                   *ParentClosePolicy            `json:"parentClosePolicy,omitempty"`
	Control                             []byte                        `json:"control,omitempty"`
	DecisionTaskCompletedEventId        *int64                        `json:"decisionTaskCompletedEventId,omitempty"`
	WorkflowIdReusePolicy               *WorkflowIdReusePolicy        `json:"workflowIdReusePolicy,omitempty"`
	RetryPolicy                         *RetryPolicy                  `json:"retryPolicy,omitempty"`
	CronSchedule                        *string                       `json:"cronSchedule,omitempty"`
	Header                              *Header                       `json:"header,omitempty"`
	Memo                                *Memo                         `json:"memo,omitempty"`
	SearchAttributes                    *SearchAttributes             `json:"searchAttributes,omitempty"`
	DelayStartSeconds                   *int32                        `json:"delayStartSeconds,omitempty"`
	JitterStartSeconds                  *int32                        `json:"jitterStartSeconds,omitempty"`
	FirstRunAtTimestamp                 *int64                        `json:"firstRunAtTimestamp,omitempty"`
	CronOverlapPolicy                   *CronOverlapPolicy            `json:"cronOverlapPolicy,omitempty"`
	ActiveClusterSelectionPolicy        *ActiveClusterSelectionPolicy `json:"activeClusterSelectionPolicy,omitempty"`
}

// ToWire translates a StartChildWorkflowExecutionInitiatedEventAttributes 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 *StartChildWorkflowExecutionInitiatedEventAttributes) ToWire() (wire.Value, error) {
	var (
		fields [21]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.WorkflowId != nil {
		w, err = wire.NewValueString(*(v.WorkflowId)), error(nil)
		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.TaskList != nil {
		w, err = v.TaskList.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 40, Value: w}
		i++
	}
	if v.Input != nil {
		w, err = wire.NewValueBinary(v.Input), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 50, Value: w}
		i++
	}
	if v.ExecutionStartToCloseTimeoutSeconds != nil {
		w, err = wire.NewValueI32(*(v.ExecutionStartToCloseTimeoutSeconds)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 60, Value: w}
		i++
	}
	if v.TaskStartToCloseTimeoutSeconds != nil {
		w, err = wire.NewValueI32(*(v.TaskStartToCloseTimeoutSeconds)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 70, Value: w}
		i++
	}
	if v.ParentClosePolicy != nil {
		w, err = v.ParentClosePolicy.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 81, Value: w}
		i++
	}
	if v.Control != nil {
		w, err = wire.NewValueBinary(v.Control), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 90, 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: 100, Value: w}
		i++
	}
	if v.WorkflowIdReusePolicy != nil {
		w, err = v.WorkflowIdReusePolicy.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 110, Value: w}
		i++
	}
	if v.RetryPolicy != nil {
		w, err = v.RetryPolicy.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 120, Value: w}
		i++
	}
	if v.CronSchedule != nil {
		w, err = wire.NewValueString(*(v.CronSchedule)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 130, Value: w}
		i++
	}
	if v.Header != nil {
		w, err = v.Header.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 140, Value: w}
		i++
	}
	if v.Memo != nil {
		w, err = v.Memo.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 150, Value: w}
		i++
	}
	if v.SearchAttributes != nil {
		w, err = v.SearchAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 160, Value: w}
		i++
	}
	if v.DelayStartSeconds != nil {
		w, err = wire.NewValueI32(*(v.DelayStartSeconds)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 170, Value: w}
		i++
	}
	if v.JitterStartSeconds != nil {
		w, err = wire.NewValueI32(*(v.JitterStartSeconds)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 180, Value: w}
		i++
	}
	if v.FirstRunAtTimestamp != nil {
		w, err = wire.NewValueI64(*(v.FirstRunAtTimestamp)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 190, Value: w}
		i++
	}
	if v.CronOverlapPolicy != nil {
		w, err = v.CronOverlapPolicy.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 200, Value: w}
		i++
	}
	if v.ActiveClusterSelectionPolicy != nil {
		w, err = v.ActiveClusterSelectionPolicy.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 210, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

// FromWire deserializes a StartChildWorkflowExecutionInitiatedEventAttributes 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 StartChildWorkflowExecutionInitiatedEventAttributes struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v StartChildWorkflowExecutionInitiatedEventAttributes
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *StartChildWorkflowExecutionInitiatedEventAttributes) 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.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.WorkflowId = &x
				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.TStruct {
				v.TaskList, err = _TaskList_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 50:
			if field.Value.Type() == wire.TBinary {
				v.Input, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		case 60:
			if field.Value.Type() == wire.TI32 {
				var x int32
				x, err = field.Value.GetI32(), error(nil)
				v.ExecutionStartToCloseTimeoutSeconds = &x
				if err != nil {
					return err
				}

			}
		case 70:
			if field.Value.Type() == wire.TI32 {
				var x int32
				x, err = field.Value.GetI32(), error(nil)
				v.TaskStartToCloseTimeoutSeconds = &x
				if err != nil {
					return err
				}

			}
		case 81:
			if field.Value.Type() == wire.TI32 {
				var x ParentClosePolicy
				x, err = _ParentClosePolicy_Read(field.Value)
				v.ParentClosePolicy = &x
				if err != nil {
					return err
				}

			}
		case 90:
			if field.Value.Type() == wire.TBinary {
				v.Control, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		case 100:
			if field.Value.Type() == wire.TI64 {
				var x int64
				x, err = field.Value.GetI64(), error(nil)
				v.DecisionTaskCompletedEventId = &x
				if err != nil {
					return err
				}

			}
		case 110:
			if field.Value.Type() == wire.TI32 {
				var x WorkflowIdReusePolicy
				x, err = _WorkflowIdReusePolicy_Read(field.Value)
				v.WorkflowIdReusePolicy = &x
				if err != nil {
					return err
				}

			}
		case 120:
			if field.Value.Type() == wire.TStruct {
				v.RetryPolicy, err = _RetryPolicy_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 130:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.CronSchedule = &x
				if err != nil {
					return err
				}

			}
		case 140:
			if field.Value.Type() == wire.TStruct {
				v.Header, err = _Header_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 150:
			if field.Value.Type() == wire.TStruct {
				v.Memo, err = _Memo_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 160:
			if field.Value.Type() == wire.TStruct {
				v.SearchAttributes, err = _SearchAttributes_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 170:
			if field.Value.Type() == wire.TI32 {
				var x int32
				x, err = field.Value.GetI32(), error(nil)
				v.DelayStartSeconds = &x
				if err != nil {
					return err
				}

			}
		case 180:
			if field.Value.Type() == wire.TI32 {
				var x int32
				x, err = field.Value.GetI32(), error(nil)
				v.JitterStartSeconds = &x
				if err != nil {
					return err
				}

			}
		case 190:
			if field.Value.Type() == wire.TI64 {
				var x int64
				x, err = field.Value.GetI64(), error(nil)
				v.FirstRunAtTimestamp = &x
				if err != nil {
					return err
				}

			}
		case 200:
			if field.Value.Type() == wire.TI32 {
				var x CronOverlapPolicy
				x, err = _CronOverlapPolicy_Read(field.Value)
				v.CronOverlapPolicy = &x
				if err != nil {
					return err
				}

			}
		case 210:
			if field.Value.Type() == wire.TStruct {
				v.ActiveClusterSelectionPolicy, err = _ActiveClusterSelectionPolicy_Read(field.Value)
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a StartChildWorkflowExecutionInitiatedEventAttributes
// struct.
func (v *StartChildWorkflowExecutionInitiatedEventAttributes) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [21]string
	i := 0
	if v.Domain != nil {
		fields[i] = fmt.Sprintf("Domain: %v", *(v.Domain))
		i++
	}
	if v.WorkflowId != nil {
		fields[i] = fmt.Sprintf("WorkflowId: %v", *(v.WorkflowId))
		i++
	}
	if v.WorkflowType != nil {
		fields[i] = fmt.Sprintf("WorkflowType: %v", v.WorkflowType)
		i++
	}
	if v.TaskList != nil {
		fields[i] = fmt.Sprintf("TaskList: %v", v.TaskList)
		i++
	}
	if v.Input != nil {
		fields[i] = fmt.Sprintf("Input: %v", v.Input)
		i++
	}
	if v.ExecutionStartToCloseTimeoutSeconds != nil {
		fields[i] = fmt.Sprintf("ExecutionStartToCloseTimeoutSeconds: %v", *(v.ExecutionStartToCloseTimeoutSeconds))
		i++
	}
	if v.TaskStartToCloseTimeoutSeconds != nil {
		fields[i] = fmt.Sprintf("TaskStartToCloseTimeoutSeconds: %v", *(v.TaskStartToCloseTimeoutSeconds))
		i++
	}
	if v.ParentClosePolicy != nil {
		fields[i] = fmt.Sprintf("ParentClosePolicy: %v", *(v.ParentClosePolicy))
		i++
	}
	if v.Control != nil {
		fields[i] = fmt.Sprintf("Control: %v", v.Control)
		i++
	}
	if v.DecisionTaskCompletedEventId != nil {
		fields[i] = fmt.Sprintf("DecisionTaskCompletedEventId: %v", *(v.DecisionTaskCompletedEventId))
		i++
	}
	if v.WorkflowIdReusePolicy != nil {
		fields[i] = fmt.Sprintf("WorkflowIdReusePolicy: %v", *(v.WorkflowIdReusePolicy))
		i++
	}
	if v.RetryPolicy != nil {
		fields[i] = fmt.Sprintf("RetryPolicy: %v", v.RetryPolicy)
		i++
	}
	if v.CronSchedule != nil {
		fields[i] = fmt.Sprintf("CronSchedule: %v", *(v.CronSchedule))
		i++
	}
	if v.Header != nil {
		fields[i] = fmt.Sprintf("Header: %v", v.Header)
		i++
	}
	if v.Memo != nil {
		fields[i] = fmt.Sprintf("Memo: %v", v.Memo)
		i++
	}
	if v.SearchAttributes != nil {
		fields[i] = fmt.Sprintf("SearchAttributes: %v", v.SearchAttributes)
		i++
	}
	if v.DelayStartSeconds != nil {
		fields[i] = fmt.Sprintf("DelayStartSeconds: %v", *(v.DelayStartSeconds))
		i++
	}
	if v.JitterStartSeconds != nil {
		fields[i] = fmt.Sprintf("JitterStartSeconds: %v", *(v.JitterStartSeconds))
		i++
	}
	if v.FirstRunAtTimestamp != nil {
		fields[i] = fmt.Sprintf("FirstRunAtTimestamp: %v", *(v.FirstRunAtTimestamp))
		i++
	}
	if v.CronOverlapPolicy != nil {
		fields[i] = fmt.Sprintf("CronOverlapPolicy: %v", *(v.CronOverlapPolicy))
		i++
	}
	if v.ActiveClusterSelectionPolicy != nil {
		fields[i] = fmt.Sprintf("ActiveClusterSelectionPolicy: %v", v.ActiveClusterSelectionPolicy)
		i++
	}

	return fmt.Sprintf("StartChildWorkflowExecutionInitiatedEventAttributes{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this StartChildWorkflowExecutionInitiatedEventAttributes match the
// provided StartChildWorkflowExecutionInitiatedEventAttributes.
//
// This function performs a deep comparison.
func (v *StartChildWorkflowExecutionInitiatedEventAttributes) Equals(rhs *StartChildWorkflowExecutionInitiatedEventAttributes) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.Domain, rhs.Domain) {
		return false
	}
	if !_String_EqualsPtr(v.WorkflowId, rhs.WorkflowId) {
		return false
	}
	if !((v.WorkflowType == nil && rhs.WorkflowType == nil) || (v.WorkflowType != nil && rhs.WorkflowType != nil && v.WorkflowType.Equals(rhs.WorkflowType))) {
		return false
	}
	if !((v.TaskList == nil && rhs.TaskList == nil) || (v.TaskList != nil && rhs.TaskList != nil && v.TaskList.Equals(rhs.TaskList))) {
		return false
	}
	if !((v.Input == nil && rhs.Input == nil) || (v.Input != nil && rhs.Input != nil && bytes.Equal(v.Input, rhs.Input))) {
		return false
	}
	if !_I32_EqualsPtr(v.ExecutionStartToCloseTimeoutSeconds, rhs.ExecutionStartToCloseTimeoutSeconds) {
		return false
	}
	if !_I32_EqualsPtr(v.TaskStartToCloseTimeoutSeconds, rhs.TaskStartToCloseTimeoutSeconds) {
		return false
	}
	if !_ParentClosePolicy_EqualsPtr(v.ParentClosePolicy, rhs.ParentClosePolicy) {
		return false
	}
	if !((v.Control == nil && rhs.Control == nil) || (v.Control != nil && rhs.Control != nil && bytes.Equal(v.Control, rhs.Control))) {
		return false
	}
	if !_I64_EqualsPtr(v.DecisionTaskCompletedEventId, rhs.DecisionTaskCompletedEventId) {
		return false
	}
	if !_WorkflowIdReusePolicy_EqualsPtr(v.WorkflowIdReusePolicy, rhs.WorkflowIdReusePolicy) {
		return false
	}
	if !((v.RetryPolicy == nil && rhs.RetryPolicy == nil) || (v.RetryPolicy != nil && rhs.RetryPolicy != nil && v.RetryPolicy.Equals(rhs.RetryPolicy))) {
		return false
	}
	if !_String_EqualsPtr(v.CronSchedule, rhs.CronSchedule) {
		return false
	}
	if !((v.Header == nil && rhs.Header == nil) || (v.Header != nil && rhs.Header != nil && v.Header.Equals(rhs.Header))) {
		return false
	}
	if !((v.Memo == nil && rhs.Memo == nil) || (v.Memo != nil && rhs.Memo != nil && v.Memo.Equals(rhs.Memo))) {
		return false
	}
	if !((v.SearchAttributes == nil && rhs.SearchAttributes == nil) || (v.SearchAttributes != nil && rhs.SearchAttributes != nil && v.SearchAttributes.Equals(rhs.SearchAttributes))) {
		return false
	}
	if !_I32_EqualsPtr(v.DelayStartSeconds, rhs.DelayStartSeconds) {
		return false
	}
	if !_I32_EqualsPtr(v.JitterStartSeconds, rhs.JitterStartSeconds) {
		return false
	}
	if !_I64_EqualsPtr(v.FirstRunAtTimestamp, rhs.FirstRunAtTimestamp) {
		return false
	}
	if !_CronOverlapPolicy_EqualsPtr(v.CronOverlapPolicy, rhs.CronOverlapPolicy) {
		return false
	}
	if !((v.ActiveClusterSelectionPolicy == nil && rhs.ActiveClusterSelectionPolicy == nil) || (v.ActiveClusterSelectionPolicy != nil && rhs.ActiveClusterSelectionPolicy != nil && v.ActiveClusterSelectionPolicy.Equals(rhs.ActiveClusterSelectionPolicy))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of StartChildWorkflowExecutionInitiatedEventAttributes.
func (v *StartChildWorkflowExecutionInitiatedEventAttributes) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Domain != nil {
		enc.AddString("domain", *v.Domain)
	}
	if v.WorkflowId != nil {
		enc.AddString("workflowId", *v.WorkflowId)
	}
	if v.WorkflowType != nil {
		err = multierr.Append(err, enc.AddObject("workflowType", v.WorkflowType))
	}
	if v.TaskList != nil {
		err = multierr.Append(err, enc.AddObject("taskList", v.TaskList))
	}
	if v.Input != nil {
		enc.AddString("input", base64.StdEncoding.EncodeToString(v.Input))
	}
	if v.ExecutionStartToCloseTimeoutSeconds != nil {
		enc.AddInt32("executionStartToCloseTimeoutSeconds", *v.ExecutionStartToCloseTimeoutSeconds)
	}
	if v.TaskStartToCloseTimeoutSeconds != nil {
		enc.AddInt32("taskStartToCloseTimeoutSeconds", *v.TaskStartToCloseTimeoutSeconds)
	}
	if v.ParentClosePolicy != nil {
		err = multierr.Append(err, enc.AddObject("parentClosePolicy", *v.ParentClosePolicy))
	}
	if v.Control != nil {
		enc.AddString("control", base64.StdEncoding.EncodeToString(v.Control))
	}
	if v.DecisionTaskCompletedEventId != nil {
		enc.AddInt64("decisionTaskCompletedEventId", *v.DecisionTaskCompletedEventId)
	}
	if v.WorkflowIdReusePolicy != nil {
		err = multierr.Append(err, enc.AddObject("workflowIdReusePolicy", *v.WorkflowIdReusePolicy))
	}
	if v.RetryPolicy != nil {
		err = multierr.Append(err, enc.AddObject("retryPolicy", v.RetryPolicy))
	}
	if v.CronSchedule != nil {
		enc.AddString("cronSchedule", *v.CronSchedule)
	}
	if v.Header != nil {
		err = multierr.Append(err, enc.AddObject("header", v.Header))
	}
	if v.Memo != nil {
		err = multierr.Append(err, enc.AddObject("memo", v.Memo))
	}
	if v.SearchAttributes != nil {
		err = multierr.Append(err, enc.AddObject("searchAttributes", v.SearchAttributes))
	}
	if v.DelayStartSeconds != nil {
		enc.AddInt32("delayStartSeconds", *v.DelayStartSeconds)
	}
	if v.JitterStartSeconds != nil {
		enc.AddInt32("jitterStartSeconds", *v.JitterStartSeconds)
	}
	if v.FirstRunAtTimestamp != nil {
		enc.AddInt64("firstRunAtTimestamp", *v.FirstRunAtTimestamp)
	}
	if v.CronOverlapPolicy != nil {
		err = multierr.Append(err, enc.AddObject("cronOverlapPolicy", *v.CronOverlapPolicy))
	}
	if v.ActiveClusterSelectionPolicy != nil {
		err = multierr.Append(err, enc.AddObject("activeClusterSelectionPolicy", v.ActiveClusterSelectionPolicy))
	}
	return err
}

// GetDomain returns the value of Domain if it is set or its
// zero value if it is unset.
func (v *StartChildWorkflowExecutionInitiatedEventAttributes) GetDomain() (o string) {
	if v != nil && v.Domain != nil {
		return *v.Domain
	}

	return
}

// IsSetDomain returns true if Domain is not nil.
func (v *StartChildWorkflowExecutionInitiatedEventAttributes) IsSetDomain() bool {
	return v != nil && v.Domain != nil
}

// GetWorkflowId returns the value of WorkflowId if it is set or its
// zero value if it is unset.
func (v *StartChildWorkflowExecutionInitiatedEventAttributes) GetWorkflowId() (o string) {
	if v != nil && v.WorkflowId != nil {
		return *v.WorkflowId
	}

	return
}

// IsSetWorkflowId returns true if WorkflowId is not nil.
func (v *StartChildWorkflowExecutionInitiatedEventAttributes) IsSetWorkflowId() bool {
	return v != nil && v.WorkflowId != nil
}

// GetWorkflowType returns the value of WorkflowType if it is set or its
// zero value if it is unset.
func (v *StartChildWorkflowExecutionInitiatedEventAttributes) GetWorkflowType() (o *WorkflowType) {
	if v != nil && v.WorkflowType != nil {
		return v.WorkflowType
	}

	return
}

// IsSetWorkflowType returns true if WorkflowType is not nil.
func (v *StartChildWorkflowExecutionInitiatedEventAttributes) IsSetWorkflowType() bool {
	return v != nil && v.WorkflowType != nil
}

// GetTaskList returns the value of TaskList if it is set or its
// zero value if it is unset.
func (v *StartChildWorkflowExecutionInitiatedEventAttributes) GetTaskList() (o *TaskList) {
	if v != nil && v.TaskList != nil {
		return v.TaskList
	}

	return
}

// IsSetTaskList returns true if TaskList is not nil.
func (v *StartChildWorkflowExecutionInitiatedEventAttributes) IsSetTaskList() bool {
	return v != nil && v.TaskList != nil
}

// GetInput returns the value of Input if it is set or its
// zero value if it is unset.
func (v *StartChildWorkflowExecutionInitiatedEventAttributes) GetInput() (o []byte) {
	if v != nil && v.Input != nil {
		return v.Input
	}

	return
}

// IsSetInput returns true if Input is not nil.
func (v *StartChildWorkflowExecutionInitiatedEventAttributes) IsSetInput() bool {
	return v != nil && v.Input != nil
}

// GetExecutionStartToCloseTimeoutSeconds returns the value of ExecutionStartToCloseTimeoutSeconds if it is set or its
// zero value if it is unset.
func (v *StartChildWorkflowExecutionInitiatedEventAttributes) GetExecutionStartToCloseTimeoutSeconds() (o int32) {
	if v != nil && v.ExecutionStartToCloseTimeoutSeconds != nil {
		return *v.ExecutionStartToCloseTimeoutSeconds
	}

	return
}

// IsSetExecutionStartToCloseTimeoutSeconds returns true if ExecutionStartToCloseTimeoutSeconds is not nil.
func (v *StartChildWorkflowExecutionInitiatedEventAttributes) IsSetExecutionStartToCloseTimeoutSeconds() bool {
	return v != nil && v.ExecutionStartToCloseTimeoutSeconds != nil
}

// GetTaskStartToCloseTimeoutSeconds returns the value of TaskStartToCloseTimeoutSeconds if it is set or its
// zero value if it is unset.
func (v *StartChildWorkflowExecutionInitiatedEventAttributes) GetTaskStartToCloseTimeoutSeconds() (o int32) {
	if v != nil && v.TaskStartToCloseTimeoutSeconds != nil {
		return *v.TaskStartToCloseTimeoutSeconds
	}

	return
}

// IsSetTaskStartToCloseTimeoutSeconds returns true if TaskStartToCloseTimeoutSeconds is not nil.
func (v *StartChildWorkflowExecutionInitiatedEventAttributes) IsSetTaskStartToCloseTimeoutSeconds() bool {
	return v != nil && v.TaskStartToCloseTimeoutSeconds != nil
}

// GetParentClosePolicy returns the value of ParentClosePolicy if it is set or its
// zero value if it is unset.
func (v *StartChildWorkflowExecutionInitiatedEventAttributes) GetParentClosePolicy() (o ParentClosePolicy) {
	if v != nil && v.ParentClosePolicy != nil {
		return *v.ParentClosePolicy
	}

	return
}

// IsSetParentClosePolicy returns true if ParentClosePolicy is not nil.
func (v *StartChildWorkflowExecutionInitiatedEventAttributes) IsSetParentClosePolicy() bool {
	return v != nil && v.ParentClosePolicy != nil
}

// GetControl returns the value of Control if it is set or its
// zero value if it is unset.
func (v *StartChildWorkflowExecutionInitiatedEventAttributes) GetControl() (o []byte) {
	if v != nil && v.Control != nil {
		return v.Control
	}

	return
}

// IsSetControl returns true if Control is not nil.
func (v *StartChildWorkflowExecutionInitiatedEventAttributes) IsSetControl() bool {
	return v != nil && v.Control != nil
}

// GetDecisionTaskCompletedEventId returns the value of DecisionTaskCompletedEventId if it is set or its
// zero value if it is unset.
func (v *StartChildWorkflowExecutionInitiatedEventAttributes) GetDecisionTaskCompletedEventId() (o int64) {
	if v != nil && v.DecisionTaskCompletedEventId != nil {
		return *v.DecisionTaskCompletedEventId
	}

	return
}

// IsSetDecisionTaskCompletedEventId returns true if DecisionTaskCompletedEventId is not nil.
func (v *StartChildWorkflowExecutionInitiatedEventAttributes) IsSetDecisionTaskCompletedEventId() bool {
	return v != nil && v.DecisionTaskCompletedEventId != nil
}

// GetWorkflowIdReusePolicy returns the value of WorkflowIdReusePolicy if it is set or its
// zero value if it is unset.
func (v *StartChildWorkflowExecutionInitiatedEventAttributes) GetWorkflowIdReusePolicy() (o WorkflowIdReusePolicy) {
	if v != nil && v.WorkflowIdReusePolicy != nil {
		return *v.WorkflowIdReusePolicy
	}

	return
}

// IsSetWorkflowIdReusePolicy returns true if WorkflowIdReusePolicy is not nil.
func (v *StartChildWorkflowExecutionInitiatedEventAttributes) IsSetWorkflowIdReusePolicy() bool {
	return v != nil && v.WorkflowIdReusePolicy != nil
}

// GetRetryPolicy returns the value of RetryPolicy if it is set or its
// zero value if it is unset.
func (v *StartChildWorkflowExecutionInitiatedEventAttributes) GetRetryPolicy() (o *RetryPolicy) {
	if v != nil && v.RetryPolicy != nil {
		return v.RetryPolicy
	}

	return
}

// IsSetRetryPolicy returns true if RetryPolicy is not nil.
func (v *StartChildWorkflowExecutionInitiatedEventAttributes) IsSetRetryPolicy() bool {
	return v != nil && v.RetryPolicy != nil
}

// GetCronSchedule returns the value of CronSchedule if it is set or its
// zero value if it is unset.
func (v *StartChildWorkflowExecutionInitiatedEventAttributes) GetCronSchedule() (o string) {
	if v != nil && v.CronSchedule != nil {
		return *v.CronSchedule
	}

	return
}

// IsSetCronSchedule returns true if CronSchedule is not nil.
func (v *StartChildWorkflowExecutionInitiatedEventAttributes) IsSetCronSchedule() bool {
	return v != nil && v.CronSchedule != nil
}

// GetHeader returns the value of Header if it is set or its
// zero value if it is unset.
func (v *StartChildWorkflowExecutionInitiatedEventAttributes) GetHeader() (o *Header) {
	if v != nil && v.Header != nil {
		return v.Header
	}

	return
}

// IsSetHeader returns true if Header is not nil.
func (v *StartChildWorkflowExecutionInitiatedEventAttributes) IsSetHeader() bool {
	return v != nil && v.Header != nil
}

// GetMemo returns the value of Memo if it is set or its
// zero value if it is unset.
func (v *StartChildWorkflowExecutionInitiatedEventAttributes) GetMemo() (o *Memo) {
	if v != nil && v.Memo != nil {
		return v.Memo
	}

	return
}

// IsSetMemo returns true if Memo is not nil.
func (v *StartChildWorkflowExecutionInitiatedEventAttributes) IsSetMemo() bool {
	return v != nil && v.Memo != nil
}

// GetSearchAttributes returns the value of SearchAttributes if it is set or its
// zero value if it is unset.
func (v *StartChildWorkflowExecutionInitiatedEventAttributes) GetSearchAttributes() (o *SearchAttributes) {
	if v != nil && v.SearchAttributes != nil {
		return v.SearchAttributes
	}

	return
}

// IsSetSearchAttributes returns true if SearchAttributes is not nil.
func (v *StartChildWorkflowExecutionInitiatedEventAttributes) IsSetSearchAttributes() bool {
	return v != nil && v.SearchAttributes != nil
}

// GetDelayStartSeconds returns the value of DelayStartSeconds if it is set or its
// zero value if it is unset.
func (v *StartChildWorkflowExecutionInitiatedEventAttributes) GetDelayStartSeconds() (o int32) {
	if v != nil && v.DelayStartSeconds != nil {
		return *v.DelayStartSeconds
	}

	return
}

// IsSetDelayStartSeconds returns true if DelayStartSeconds is not nil.
func (v *StartChildWorkflowExecutionInitiatedEventAttributes) IsSetDelayStartSeconds() bool {
	return v != nil && v.DelayStartSeconds != nil
}

// GetJitterStartSeconds returns the value of JitterStartSeconds if it is set or its
// zero value if it is unset.
func (v *StartChildWorkflowExecutionInitiatedEventAttributes) GetJitterStartSeconds() (o int32) {
	if v != nil && v.JitterStartSeconds != nil {
		return *v.JitterStartSeconds
	}

	return
}

// IsSetJitterStartSeconds returns true if JitterStartSeconds is not nil.
func (v *StartChildWorkflowExecutionInitiatedEventAttributes) IsSetJitterStartSeconds() bool {
	return v != nil && v.JitterStartSeconds != nil
}

// GetFirstRunAtTimestamp returns the value of FirstRunAtTimestamp if it is set or its
// zero value if it is unset.
func (v *StartChildWorkflowExecutionInitiatedEventAttributes) GetFirstRunAtTimestamp() (o int64) {
	if v != nil && v.FirstRunAtTimestamp != nil {
		return *v.FirstRunAtTimestamp
	}

	return
}

// IsSetFirstRunAtTimestamp returns true if FirstRunAtTimestamp is not nil.
func (v *StartChildWorkflowExecutionInitiatedEventAttributes) IsSetFirstRunAtTimestamp() bool {
	return v != nil && v.FirstRunAtTimestamp != nil
}

// GetCronOverlapPolicy returns the value of CronOverlapPolicy if it is set or its
// zero value if it is unset.
func (v *StartChildWorkflowExecutionInitiatedEventAttributes) GetCronOverlapPolicy() (o CronOverlapPolicy) {
	if v != nil && v.CronOverlapPolicy != nil {
		return *v.CronOverlapPolicy
	}

	return
}

// IsSetCronOverlapPolicy returns true if CronOverlapPolicy is not nil.
func (v *StartChildWorkflowExecutionInitiatedEventAttributes) IsSetCronOverlapPolicy() bool {
	return v != nil && v.CronOverlapPolicy != nil
}

// GetActiveClusterSelectionPolicy returns the value of ActiveClusterSelectionPolicy if it is set or its
// zero value if it is unset.
func (v *StartChildWorkflowExecutionInitiatedEventAttributes) GetActiveClusterSelectionPolicy() (o *ActiveClusterSelectionPolicy) {
	if v != nil && v.ActiveClusterSelectionPolicy != nil {
		return v.ActiveClusterSelectionPolicy
	}

	return
}

// IsSetActiveClusterSelectionPolicy returns true if ActiveClusterSelectionPolicy is not nil.
func (v *StartChildWorkflowExecutionInitiatedEventAttributes) IsSetActiveClusterSelectionPolicy() bool {
	return v != nil && v.ActiveClusterSelectionPolicy != nil
}

type StartTimeFilter struct {
	EarliestTime *int64 `json:"earliestTime,omitempty"`
	LatestTime   *int64 `json:"latestTime,omitempty"`
}

// ToWire translates a StartTimeFilter 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 *StartTimeFilter) ToWire() (wire.Value, error) {
	var (
		fields [2]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.EarliestTime != nil {
		w, err = wire.NewValueI64(*(v.EarliestTime)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.LatestTime != nil {
		w, err = wire.NewValueI64(*(v.LatestTime)), 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
}

// FromWire deserializes a StartTimeFilter 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 StartTimeFilter struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v StartTimeFilter
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *StartTimeFilter) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			if field.Value.Type() == wire.TI64 {
				var x int64
				x, err = field.Value.GetI64(), error(nil)
				v.EarliestTime = &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.LatestTime = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a StartTimeFilter
// struct.
func (v *StartTimeFilter) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [2]string
	i := 0
	if v.EarliestTime != nil {
		fields[i] = fmt.Sprintf("EarliestTime: %v", *(v.EarliestTime))
		i++
	}
	if v.LatestTime != nil {
		fields[i] = fmt.Sprintf("LatestTime: %v", *(v.LatestTime))
		i++
	}

	return fmt.Sprintf("StartTimeFilter{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this StartTimeFilter match the
// provided StartTimeFilter.
//
// This function performs a deep comparison.
func (v *StartTimeFilter) Equals(rhs *StartTimeFilter) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_I64_EqualsPtr(v.EarliestTime, rhs.EarliestTime) {
		return false
	}
	if !_I64_EqualsPtr(v.LatestTime, rhs.LatestTime) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of StartTimeFilter.
func (v *StartTimeFilter) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.EarliestTime != nil {
		enc.AddInt64("earliestTime", *v.EarliestTime)
	}
	if v.LatestTime != nil {
		enc.AddInt64("latestTime", *v.LatestTime)
	}
	return err
}

// GetEarliestTime returns the value of EarliestTime if it is set or its
// zero value if it is unset.
func (v *StartTimeFilter) GetEarliestTime() (o int64) {
	if v != nil && v.EarliestTime != nil {
		return *v.EarliestTime
	}

	return
}

// IsSetEarliestTime returns true if EarliestTime is not nil.
func (v *StartTimeFilter) IsSetEarliestTime() bool {
	return v != nil && v.EarliestTime != nil
}

// GetLatestTime returns the value of LatestTime if it is set or its
// zero value if it is unset.
func (v *StartTimeFilter) GetLatestTime() (o int64) {
	if v != nil && v.LatestTime != nil {
		return *v.LatestTime
	}

	return
}

// IsSetLatestTime returns true if LatestTime is not nil.
func (v *StartTimeFilter) IsSetLatestTime() bool {
	return v != nil && v.LatestTime != nil
}

type StartTimerDecisionAttributes struct {
	TimerId                   *string `json:"timerId,omitempty"`
	StartToFireTimeoutSeconds *int64  `json:"startToFireTimeoutSeconds,omitempty"`
}

// ToWire translates a StartTimerDecisionAttributes 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 *StartTimerDecisionAttributes) ToWire() (wire.Value, error) {
	var (
		fields [2]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.TimerId != nil {
		w, err = wire.NewValueString(*(v.TimerId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.StartToFireTimeoutSeconds != nil {
		w, err = wire.NewValueI64(*(v.StartToFireTimeoutSeconds)), 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
}

// FromWire deserializes a StartTimerDecisionAttributes 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 StartTimerDecisionAttributes struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v StartTimerDecisionAttributes
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *StartTimerDecisionAttributes) 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.TimerId = &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.StartToFireTimeoutSeconds = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a StartTimerDecisionAttributes
// struct.
func (v *StartTimerDecisionAttributes) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [2]string
	i := 0
	if v.TimerId != nil {
		fields[i] = fmt.Sprintf("TimerId: %v", *(v.TimerId))
		i++
	}
	if v.StartToFireTimeoutSeconds != nil {
		fields[i] = fmt.Sprintf("StartToFireTimeoutSeconds: %v", *(v.StartToFireTimeoutSeconds))
		i++
	}

	return fmt.Sprintf("StartTimerDecisionAttributes{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this StartTimerDecisionAttributes match the
// provided StartTimerDecisionAttributes.
//
// This function performs a deep comparison.
func (v *StartTimerDecisionAttributes) Equals(rhs *StartTimerDecisionAttributes) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.TimerId, rhs.TimerId) {
		return false
	}
	if !_I64_EqualsPtr(v.StartToFireTimeoutSeconds, rhs.StartToFireTimeoutSeconds) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of StartTimerDecisionAttributes.
func (v *StartTimerDecisionAttributes) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.TimerId != nil {
		enc.AddString("timerId", *v.TimerId)
	}
	if v.StartToFireTimeoutSeconds != nil {
		enc.AddInt64("startToFireTimeoutSeconds", *v.StartToFireTimeoutSeconds)
	}
	return err
}

// GetTimerId returns the value of TimerId if it is set or its
// zero value if it is unset.
func (v *StartTimerDecisionAttributes) GetTimerId() (o string) {
	if v != nil && v.TimerId != nil {
		return *v.TimerId
	}

	return
}

// IsSetTimerId returns true if TimerId is not nil.
func (v *StartTimerDecisionAttributes) IsSetTimerId() bool {
	return v != nil && v.TimerId != nil
}

// GetStartToFireTimeoutSeconds returns the value of StartToFireTimeoutSeconds if it is set or its
// zero value if it is unset.
func (v *StartTimerDecisionAttributes) GetStartToFireTimeoutSeconds() (o int64) {
	if v != nil && v.StartToFireTimeoutSeconds != nil {
		return *v.StartToFireTimeoutSeconds
	}

	return
}

// IsSetStartToFireTimeoutSeconds returns true if StartToFireTimeoutSeconds is not nil.
func (v *StartTimerDecisionAttributes) IsSetStartToFireTimeoutSeconds() bool {
	return v != nil && v.StartToFireTimeoutSeconds != nil
}

type StartWorkflowExecutionAsyncRequest struct {
	Request *StartWorkflowExecutionRequest `json:"request,omitempty"`
}

// ToWire translates a StartWorkflowExecutionAsyncRequest 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 *StartWorkflowExecutionAsyncRequest) 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: 10, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

func _StartWorkflowExecutionRequest_Read(w wire.Value) (*StartWorkflowExecutionRequest, error) {
	var v StartWorkflowExecutionRequest
	err := v.FromWire(w)
	return &v, err
}

// FromWire deserializes a StartWorkflowExecutionAsyncRequest 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 StartWorkflowExecutionAsyncRequest struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v StartWorkflowExecutionAsyncRequest
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *StartWorkflowExecutionAsyncRequest) 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.Request, err = _StartWorkflowExecutionRequest_Read(field.Value)
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a StartWorkflowExecutionAsyncRequest
// struct.
func (v *StartWorkflowExecutionAsyncRequest) 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("StartWorkflowExecutionAsyncRequest{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this StartWorkflowExecutionAsyncRequest match the
// provided StartWorkflowExecutionAsyncRequest.
//
// This function performs a deep comparison.
func (v *StartWorkflowExecutionAsyncRequest) Equals(rhs *StartWorkflowExecutionAsyncRequest) 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 StartWorkflowExecutionAsyncRequest.
func (v *StartWorkflowExecutionAsyncRequest) 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 *StartWorkflowExecutionAsyncRequest) GetRequest() (o *StartWorkflowExecutionRequest) {
	if v != nil && v.Request != nil {
		return v.Request
	}

	return
}

// IsSetRequest returns true if Request is not nil.
func (v *StartWorkflowExecutionAsyncRequest) IsSetRequest() bool {
	return v != nil && v.Request != nil
}

type StartWorkflowExecutionAsyncResponse struct {
}

// ToWire translates a StartWorkflowExecutionAsyncResponse 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 *StartWorkflowExecutionAsyncResponse) ToWire() (wire.Value, error) {
	var (
		fields [0]wire.Field
		i      int = 0
	)

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

// FromWire deserializes a StartWorkflowExecutionAsyncResponse 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 StartWorkflowExecutionAsyncResponse struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v StartWorkflowExecutionAsyncResponse
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *StartWorkflowExecutionAsyncResponse) FromWire(w wire.Value) error {

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		}
	}

	return nil
}

// String returns a readable string representation of a StartWorkflowExecutionAsyncResponse
// struct.
func (v *StartWorkflowExecutionAsyncResponse) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [0]string
	i := 0

	return fmt.Sprintf("StartWorkflowExecutionAsyncResponse{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this StartWorkflowExecutionAsyncResponse match the
// provided StartWorkflowExecutionAsyncResponse.
//
// This function performs a deep comparison.
func (v *StartWorkflowExecutionAsyncResponse) Equals(rhs *StartWorkflowExecutionAsyncResponse) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of StartWorkflowExecutionAsyncResponse.
func (v *StartWorkflowExecutionAsyncResponse) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	return err
}

type StartWorkflowExecutionRequest struct {
	Domain                              *string                       `json:"domain,omitempty"`
	WorkflowId                          *string                       `json:"workflowId,omitempty"`
	WorkflowType                        *WorkflowType                 `json:"workflowType,omitempty"`
	TaskList                            *TaskList                     `json:"taskList,omitempty"`
	Input                               []byte                        `json:"input,omitempty"`
	ExecutionStartToCloseTimeoutSeconds *int32                        `json:"executionStartToCloseTimeoutSeconds,omitempty"`
	TaskStartToCloseTimeoutSeconds      *int32                        `json:"taskStartToCloseTimeoutSeconds,omitempty"`
	Identity                            *string                       `json:"identity,omitempty"`
	RequestId                           *string                       `json:"requestId,omitempty"`
	WorkflowIdReusePolicy               *WorkflowIdReusePolicy        `json:"workflowIdReusePolicy,omitempty"`
	RetryPolicy                         *RetryPolicy                  `json:"retryPolicy,omitempty"`
	CronSchedule                        *string                       `json:"cronSchedule,omitempty"`
	Memo                                *Memo                         `json:"memo,omitempty"`
	SearchAttributes                    *SearchAttributes             `json:"searchAttributes,omitempty"`
	Header                              *Header                       `json:"header,omitempty"`
	DelayStartSeconds                   *int32                        `json:"delayStartSeconds,omitempty"`
	JitterStartSeconds                  *int32                        `json:"jitterStartSeconds,omitempty"`
	FirstRunAtTimestamp                 *int64                        `json:"firstRunAtTimestamp,omitempty"`
	CronOverlapPolicy                   *CronOverlapPolicy            `json:"cronOverlapPolicy,omitempty"`
	ActiveClusterSelectionPolicy        *ActiveClusterSelectionPolicy `json:"activeClusterSelectionPolicy,omitempty"`
}

// ToWire translates a StartWorkflowExecutionRequest 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 *StartWorkflowExecutionRequest) ToWire() (wire.Value, error) {
	var (
		fields [20]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.WorkflowId != nil {
		w, err = wire.NewValueString(*(v.WorkflowId)), error(nil)
		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.TaskList != nil {
		w, err = v.TaskList.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 40, Value: w}
		i++
	}
	if v.Input != nil {
		w, err = wire.NewValueBinary(v.Input), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 50, Value: w}
		i++
	}
	if v.ExecutionStartToCloseTimeoutSeconds != nil {
		w, err = wire.NewValueI32(*(v.ExecutionStartToCloseTimeoutSeconds)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 60, Value: w}
		i++
	}
	if v.TaskStartToCloseTimeoutSeconds != nil {
		w, err = wire.NewValueI32(*(v.TaskStartToCloseTimeoutSeconds)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 70, 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: 80, Value: w}
		i++
	}
	if v.RequestId != nil {
		w, err = wire.NewValueString(*(v.RequestId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 90, Value: w}
		i++
	}
	if v.WorkflowIdReusePolicy != nil {
		w, err = v.WorkflowIdReusePolicy.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 100, Value: w}
		i++
	}
	if v.RetryPolicy != nil {
		w, err = v.RetryPolicy.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 120, Value: w}
		i++
	}
	if v.CronSchedule != nil {
		w, err = wire.NewValueString(*(v.CronSchedule)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 130, Value: w}
		i++
	}
	if v.Memo != nil {
		w, err = v.Memo.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 140, Value: w}
		i++
	}
	if v.SearchAttributes != nil {
		w, err = v.SearchAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 141, Value: w}
		i++
	}
	if v.Header != nil {
		w, err = v.Header.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 150, Value: w}
		i++
	}
	if v.DelayStartSeconds != nil {
		w, err = wire.NewValueI32(*(v.DelayStartSeconds)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 160, Value: w}
		i++
	}
	if v.JitterStartSeconds != nil {
		w, err = wire.NewValueI32(*(v.JitterStartSeconds)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 170, Value: w}
		i++
	}
	if v.FirstRunAtTimestamp != nil {
		w, err = wire.NewValueI64(*(v.FirstRunAtTimestamp)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 180, Value: w}
		i++
	}
	if v.CronOverlapPolicy != nil {
		w, err = v.CronOverlapPolicy.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 190, Value: w}
		i++
	}
	if v.ActiveClusterSelectionPolicy != nil {
		w, err = v.ActiveClusterSelectionPolicy.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 200, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

// FromWire deserializes a StartWorkflowExecutionRequest 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 StartWorkflowExecutionRequest struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v StartWorkflowExecutionRequest
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *StartWorkflowExecutionRequest) 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.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.WorkflowId = &x
				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.TStruct {
				v.TaskList, err = _TaskList_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 50:
			if field.Value.Type() == wire.TBinary {
				v.Input, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		case 60:
			if field.Value.Type() == wire.TI32 {
				var x int32
				x, err = field.Value.GetI32(), error(nil)
				v.ExecutionStartToCloseTimeoutSeconds = &x
				if err != nil {
					return err
				}

			}
		case 70:
			if field.Value.Type() == wire.TI32 {
				var x int32
				x, err = field.Value.GetI32(), error(nil)
				v.TaskStartToCloseTimeoutSeconds = &x
				if err != nil {
					return err
				}

			}
		case 80:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.Identity = &x
				if err != nil {
					return err
				}

			}
		case 90:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.RequestId = &x
				if err != nil {
					return err
				}

			}
		case 100:
			if field.Value.Type() == wire.TI32 {
				var x WorkflowIdReusePolicy
				x, err = _WorkflowIdReusePolicy_Read(field.Value)
				v.WorkflowIdReusePolicy = &x
				if err != nil {
					return err
				}

			}
		case 120:
			if field.Value.Type() == wire.TStruct {
				v.RetryPolicy, err = _RetryPolicy_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 130:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.CronSchedule = &x
				if err != nil {
					return err
				}

			}
		case 140:
			if field.Value.Type() == wire.TStruct {
				v.Memo, err = _Memo_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 141:
			if field.Value.Type() == wire.TStruct {
				v.SearchAttributes, err = _SearchAttributes_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 150:
			if field.Value.Type() == wire.TStruct {
				v.Header, err = _Header_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 160:
			if field.Value.Type() == wire.TI32 {
				var x int32
				x, err = field.Value.GetI32(), error(nil)
				v.DelayStartSeconds = &x
				if err != nil {
					return err
				}

			}
		case 170:
			if field.Value.Type() == wire.TI32 {
				var x int32
				x, err = field.Value.GetI32(), error(nil)
				v.JitterStartSeconds = &x
				if err != nil {
					return err
				}

			}
		case 180:
			if field.Value.Type() == wire.TI64 {
				var x int64
				x, err = field.Value.GetI64(), error(nil)
				v.FirstRunAtTimestamp = &x
				if err != nil {
					return err
				}

			}
		case 190:
			if field.Value.Type() == wire.TI32 {
				var x CronOverlapPolicy
				x, err = _CronOverlapPolicy_Read(field.Value)
				v.CronOverlapPolicy = &x
				if err != nil {
					return err
				}

			}
		case 200:
			if field.Value.Type() == wire.TStruct {
				v.ActiveClusterSelectionPolicy, err = _ActiveClusterSelectionPolicy_Read(field.Value)
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a StartWorkflowExecutionRequest
// struct.
func (v *StartWorkflowExecutionRequest) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [20]string
	i := 0
	if v.Domain != nil {
		fields[i] = fmt.Sprintf("Domain: %v", *(v.Domain))
		i++
	}
	if v.WorkflowId != nil {
		fields[i] = fmt.Sprintf("WorkflowId: %v", *(v.WorkflowId))
		i++
	}
	if v.WorkflowType != nil {
		fields[i] = fmt.Sprintf("WorkflowType: %v", v.WorkflowType)
		i++
	}
	if v.TaskList != nil {
		fields[i] = fmt.Sprintf("TaskList: %v", v.TaskList)
		i++
	}
	if v.Input != nil {
		fields[i] = fmt.Sprintf("Input: %v", v.Input)
		i++
	}
	if v.ExecutionStartToCloseTimeoutSeconds != nil {
		fields[i] = fmt.Sprintf("ExecutionStartToCloseTimeoutSeconds: %v", *(v.ExecutionStartToCloseTimeoutSeconds))
		i++
	}
	if v.TaskStartToCloseTimeoutSeconds != nil {
		fields[i] = fmt.Sprintf("TaskStartToCloseTimeoutSeconds: %v", *(v.TaskStartToCloseTimeoutSeconds))
		i++
	}
	if v.Identity != nil {
		fields[i] = fmt.Sprintf("Identity: %v", *(v.Identity))
		i++
	}
	if v.RequestId != nil {
		fields[i] = fmt.Sprintf("RequestId: %v", *(v.RequestId))
		i++
	}
	if v.WorkflowIdReusePolicy != nil {
		fields[i] = fmt.Sprintf("WorkflowIdReusePolicy: %v", *(v.WorkflowIdReusePolicy))
		i++
	}
	if v.RetryPolicy != nil {
		fields[i] = fmt.Sprintf("RetryPolicy: %v", v.RetryPolicy)
		i++
	}
	if v.CronSchedule != nil {
		fields[i] = fmt.Sprintf("CronSchedule: %v", *(v.CronSchedule))
		i++
	}
	if v.Memo != nil {
		fields[i] = fmt.Sprintf("Memo: %v", v.Memo)
		i++
	}
	if v.SearchAttributes != nil {
		fields[i] = fmt.Sprintf("SearchAttributes: %v", v.SearchAttributes)
		i++
	}
	if v.Header != nil {
		fields[i] = fmt.Sprintf("Header: %v", v.Header)
		i++
	}
	if v.DelayStartSeconds != nil {
		fields[i] = fmt.Sprintf("DelayStartSeconds: %v", *(v.DelayStartSeconds))
		i++
	}
	if v.JitterStartSeconds != nil {
		fields[i] = fmt.Sprintf("JitterStartSeconds: %v", *(v.JitterStartSeconds))
		i++
	}
	if v.FirstRunAtTimestamp != nil {
		fields[i] = fmt.Sprintf("FirstRunAtTimestamp: %v", *(v.FirstRunAtTimestamp))
		i++
	}
	if v.CronOverlapPolicy != nil {
		fields[i] = fmt.Sprintf("CronOverlapPolicy: %v", *(v.CronOverlapPolicy))
		i++
	}
	if v.ActiveClusterSelectionPolicy != nil {
		fields[i] = fmt.Sprintf("ActiveClusterSelectionPolicy: %v", v.ActiveClusterSelectionPolicy)
		i++
	}

	return fmt.Sprintf("StartWorkflowExecutionRequest{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this StartWorkflowExecutionRequest match the
// provided StartWorkflowExecutionRequest.
//
// This function performs a deep comparison.
func (v *StartWorkflowExecutionRequest) Equals(rhs *StartWorkflowExecutionRequest) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.Domain, rhs.Domain) {
		return false
	}
	if !_String_EqualsPtr(v.WorkflowId, rhs.WorkflowId) {
		return false
	}
	if !((v.WorkflowType == nil && rhs.WorkflowType == nil) || (v.WorkflowType != nil && rhs.WorkflowType != nil && v.WorkflowType.Equals(rhs.WorkflowType))) {
		return false
	}
	if !((v.TaskList == nil && rhs.TaskList == nil) || (v.TaskList != nil && rhs.TaskList != nil && v.TaskList.Equals(rhs.TaskList))) {
		return false
	}
	if !((v.Input == nil && rhs.Input == nil) || (v.Input != nil && rhs.Input != nil && bytes.Equal(v.Input, rhs.Input))) {
		return false
	}
	if !_I32_EqualsPtr(v.ExecutionStartToCloseTimeoutSeconds, rhs.ExecutionStartToCloseTimeoutSeconds) {
		return false
	}
	if !_I32_EqualsPtr(v.TaskStartToCloseTimeoutSeconds, rhs.TaskStartToCloseTimeoutSeconds) {
		return false
	}
	if !_String_EqualsPtr(v.Identity, rhs.Identity) {
		return false
	}
	if !_String_EqualsPtr(v.RequestId, rhs.RequestId) {
		return false
	}
	if !_WorkflowIdReusePolicy_EqualsPtr(v.WorkflowIdReusePolicy, rhs.WorkflowIdReusePolicy) {
		return false
	}
	if !((v.RetryPolicy == nil && rhs.RetryPolicy == nil) || (v.RetryPolicy != nil && rhs.RetryPolicy != nil && v.RetryPolicy.Equals(rhs.RetryPolicy))) {
		return false
	}
	if !_String_EqualsPtr(v.CronSchedule, rhs.CronSchedule) {
		return false
	}
	if !((v.Memo == nil && rhs.Memo == nil) || (v.Memo != nil && rhs.Memo != nil && v.Memo.Equals(rhs.Memo))) {
		return false
	}
	if !((v.SearchAttributes == nil && rhs.SearchAttributes == nil) || (v.SearchAttributes != nil && rhs.SearchAttributes != nil && v.SearchAttributes.Equals(rhs.SearchAttributes))) {
		return false
	}
	if !((v.Header == nil && rhs.Header == nil) || (v.Header != nil && rhs.Header != nil && v.Header.Equals(rhs.Header))) {
		return false
	}
	if !_I32_EqualsPtr(v.DelayStartSeconds, rhs.DelayStartSeconds) {
		return false
	}
	if !_I32_EqualsPtr(v.JitterStartSeconds, rhs.JitterStartSeconds) {
		return false
	}
	if !_I64_EqualsPtr(v.FirstRunAtTimestamp, rhs.FirstRunAtTimestamp) {
		return false
	}
	if !_CronOverlapPolicy_EqualsPtr(v.CronOverlapPolicy, rhs.CronOverlapPolicy) {
		return false
	}
	if !((v.ActiveClusterSelectionPolicy == nil && rhs.ActiveClusterSelectionPolicy == nil) || (v.ActiveClusterSelectionPolicy != nil && rhs.ActiveClusterSelectionPolicy != nil && v.ActiveClusterSelectionPolicy.Equals(rhs.ActiveClusterSelectionPolicy))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of StartWorkflowExecutionRequest.
func (v *StartWorkflowExecutionRequest) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Domain != nil {
		enc.AddString("domain", *v.Domain)
	}
	if v.WorkflowId != nil {
		enc.AddString("workflowId", *v.WorkflowId)
	}
	if v.WorkflowType != nil {
		err = multierr.Append(err, enc.AddObject("workflowType", v.WorkflowType))
	}
	if v.TaskList != nil {
		err = multierr.Append(err, enc.AddObject("taskList", v.TaskList))
	}
	if v.Input != nil {
		enc.AddString("input", base64.StdEncoding.EncodeToString(v.Input))
	}
	if v.ExecutionStartToCloseTimeoutSeconds != nil {
		enc.AddInt32("executionStartToCloseTimeoutSeconds", *v.ExecutionStartToCloseTimeoutSeconds)
	}
	if v.TaskStartToCloseTimeoutSeconds != nil {
		enc.AddInt32("taskStartToCloseTimeoutSeconds", *v.TaskStartToCloseTimeoutSeconds)
	}
	if v.Identity != nil {
		enc.AddString("identity", *v.Identity)
	}
	if v.RequestId != nil {
		enc.AddString("requestId", *v.RequestId)
	}
	if v.WorkflowIdReusePolicy != nil {
		err = multierr.Append(err, enc.AddObject("workflowIdReusePolicy", *v.WorkflowIdReusePolicy))
	}
	if v.RetryPolicy != nil {
		err = multierr.Append(err, enc.AddObject("retryPolicy", v.RetryPolicy))
	}
	if v.CronSchedule != nil {
		enc.AddString("cronSchedule", *v.CronSchedule)
	}
	if v.Memo != nil {
		err = multierr.Append(err, enc.AddObject("memo", v.Memo))
	}
	if v.SearchAttributes != nil {
		err = multierr.Append(err, enc.AddObject("searchAttributes", v.SearchAttributes))
	}
	if v.Header != nil {
		err = multierr.Append(err, enc.AddObject("header", v.Header))
	}
	if v.DelayStartSeconds != nil {
		enc.AddInt32("delayStartSeconds", *v.DelayStartSeconds)
	}
	if v.JitterStartSeconds != nil {
		enc.AddInt32("jitterStartSeconds", *v.JitterStartSeconds)
	}
	if v.FirstRunAtTimestamp != nil {
		enc.AddInt64("firstRunAtTimestamp", *v.FirstRunAtTimestamp)
	}
	if v.CronOverlapPolicy != nil {
		err = multierr.Append(err, enc.AddObject("cronOverlapPolicy", *v.CronOverlapPolicy))
	}
	if v.ActiveClusterSelectionPolicy != nil {
		err = multierr.Append(err, enc.AddObject("activeClusterSelectionPolicy", v.ActiveClusterSelectionPolicy))
	}
	return err
}

// GetDomain returns the value of Domain if it is set or its
// zero value if it is unset.
func (v *StartWorkflowExecutionRequest) GetDomain() (o string) {
	if v != nil && v.Domain != nil {
		return *v.Domain
	}

	return
}

// IsSetDomain returns true if Domain is not nil.
func (v *StartWorkflowExecutionRequest) IsSetDomain() bool {
	return v != nil && v.Domain != nil
}

// GetWorkflowId returns the value of WorkflowId if it is set or its
// zero value if it is unset.
func (v *StartWorkflowExecutionRequest) GetWorkflowId() (o string) {
	if v != nil && v.WorkflowId != nil {
		return *v.WorkflowId
	}

	return
}

// IsSetWorkflowId returns true if WorkflowId is not nil.
func (v *StartWorkflowExecutionRequest) IsSetWorkflowId() bool {
	return v != nil && v.WorkflowId != nil
}

// GetWorkflowType returns the value of WorkflowType if it is set or its
// zero value if it is unset.
func (v *StartWorkflowExecutionRequest) GetWorkflowType() (o *WorkflowType) {
	if v != nil && v.WorkflowType != nil {
		return v.WorkflowType
	}

	return
}

// IsSetWorkflowType returns true if WorkflowType is not nil.
func (v *StartWorkflowExecutionRequest) IsSetWorkflowType() bool {
	return v != nil && v.WorkflowType != nil
}

// GetTaskList returns the value of TaskList if it is set or its
// zero value if it is unset.
func (v *StartWorkflowExecutionRequest) GetTaskList() (o *TaskList) {
	if v != nil && v.TaskList != nil {
		return v.TaskList
	}

	return
}

// IsSetTaskList returns true if TaskList is not nil.
func (v *StartWorkflowExecutionRequest) IsSetTaskList() bool {
	return v != nil && v.TaskList != nil
}

// GetInput returns the value of Input if it is set or its
// zero value if it is unset.
func (v *StartWorkflowExecutionRequest) GetInput() (o []byte) {
	if v != nil && v.Input != nil {
		return v.Input
	}

	return
}

// IsSetInput returns true if Input is not nil.
func (v *StartWorkflowExecutionRequest) IsSetInput() bool {
	return v != nil && v.Input != nil
}

// GetExecutionStartToCloseTimeoutSeconds returns the value of ExecutionStartToCloseTimeoutSeconds if it is set or its
// zero value if it is unset.
func (v *StartWorkflowExecutionRequest) GetExecutionStartToCloseTimeoutSeconds() (o int32) {
	if v != nil && v.ExecutionStartToCloseTimeoutSeconds != nil {
		return *v.ExecutionStartToCloseTimeoutSeconds
	}

	return
}

// IsSetExecutionStartToCloseTimeoutSeconds returns true if ExecutionStartToCloseTimeoutSeconds is not nil.
func (v *StartWorkflowExecutionRequest) IsSetExecutionStartToCloseTimeoutSeconds() bool {
	return v != nil && v.ExecutionStartToCloseTimeoutSeconds != nil
}

// GetTaskStartToCloseTimeoutSeconds returns the value of TaskStartToCloseTimeoutSeconds if it is set or its
// zero value if it is unset.
func (v *StartWorkflowExecutionRequest) GetTaskStartToCloseTimeoutSeconds() (o int32) {
	if v != nil && v.TaskStartToCloseTimeoutSeconds != nil {
		return *v.TaskStartToCloseTimeoutSeconds
	}

	return
}

// IsSetTaskStartToCloseTimeoutSeconds returns true if TaskStartToCloseTimeoutSeconds is not nil.
func (v *StartWorkflowExecutionRequest) IsSetTaskStartToCloseTimeoutSeconds() bool {
	return v != nil && v.TaskStartToCloseTimeoutSeconds != nil
}

// GetIdentity returns the value of Identity if it is set or its
// zero value if it is unset.
func (v *StartWorkflowExecutionRequest) GetIdentity() (o string) {
	if v != nil && v.Identity != nil {
		return *v.Identity
	}

	return
}

// IsSetIdentity returns true if Identity is not nil.
func (v *StartWorkflowExecutionRequest) IsSetIdentity() bool {
	return v != nil && v.Identity != nil
}

// GetRequestId returns the value of RequestId if it is set or its
// zero value if it is unset.
func (v *StartWorkflowExecutionRequest) GetRequestId() (o string) {
	if v != nil && v.RequestId != nil {
		return *v.RequestId
	}

	return
}

// IsSetRequestId returns true if RequestId is not nil.
func (v *StartWorkflowExecutionRequest) IsSetRequestId() bool {
	return v != nil && v.RequestId != nil
}

// GetWorkflowIdReusePolicy returns the value of WorkflowIdReusePolicy if it is set or its
// zero value if it is unset.
func (v *StartWorkflowExecutionRequest) GetWorkflowIdReusePolicy() (o WorkflowIdReusePolicy) {
	if v != nil && v.WorkflowIdReusePolicy != nil {
		return *v.WorkflowIdReusePolicy
	}

	return
}

// IsSetWorkflowIdReusePolicy returns true if WorkflowIdReusePolicy is not nil.
func (v *StartWorkflowExecutionRequest) IsSetWorkflowIdReusePolicy() bool {
	return v != nil && v.WorkflowIdReusePolicy != nil
}

// GetRetryPolicy returns the value of RetryPolicy if it is set or its
// zero value if it is unset.
func (v *StartWorkflowExecutionRequest) GetRetryPolicy() (o *RetryPolicy) {
	if v != nil && v.RetryPolicy != nil {
		return v.RetryPolicy
	}

	return
}

// IsSetRetryPolicy returns true if RetryPolicy is not nil.
func (v *StartWorkflowExecutionRequest) IsSetRetryPolicy() bool {
	return v != nil && v.RetryPolicy != nil
}

// GetCronSchedule returns the value of CronSchedule if it is set or its
// zero value if it is unset.
func (v *StartWorkflowExecutionRequest) GetCronSchedule() (o string) {
	if v != nil && v.CronSchedule != nil {
		return *v.CronSchedule
	}

	return
}

// IsSetCronSchedule returns true if CronSchedule is not nil.
func (v *StartWorkflowExecutionRequest) IsSetCronSchedule() bool {
	return v != nil && v.CronSchedule != nil
}

// GetMemo returns the value of Memo if it is set or its
// zero value if it is unset.
func (v *StartWorkflowExecutionRequest) GetMemo() (o *Memo) {
	if v != nil && v.Memo != nil {
		return v.Memo
	}

	return
}

// IsSetMemo returns true if Memo is not nil.
func (v *StartWorkflowExecutionRequest) IsSetMemo() bool {
	return v != nil && v.Memo != nil
}

// GetSearchAttributes returns the value of SearchAttributes if it is set or its
// zero value if it is unset.
func (v *StartWorkflowExecutionRequest) GetSearchAttributes() (o *SearchAttributes) {
	if v != nil && v.SearchAttributes != nil {
		return v.SearchAttributes
	}

	return
}

// IsSetSearchAttributes returns true if SearchAttributes is not nil.
func (v *StartWorkflowExecutionRequest) IsSetSearchAttributes() bool {
	return v != nil && v.SearchAttributes != nil
}

// GetHeader returns the value of Header if it is set or its
// zero value if it is unset.
func (v *StartWorkflowExecutionRequest) GetHeader() (o *Header) {
	if v != nil && v.Header != nil {
		return v.Header
	}

	return
}

// IsSetHeader returns true if Header is not nil.
func (v *StartWorkflowExecutionRequest) IsSetHeader() bool {
	return v != nil && v.Header != nil
}

// GetDelayStartSeconds returns the value of DelayStartSeconds if it is set or its
// zero value if it is unset.
func (v *StartWorkflowExecutionRequest) GetDelayStartSeconds() (o int32) {
	if v != nil && v.DelayStartSeconds != nil {
		return *v.DelayStartSeconds
	}

	return
}

// IsSetDelayStartSeconds returns true if DelayStartSeconds is not nil.
func (v *StartWorkflowExecutionRequest) IsSetDelayStartSeconds() bool {
	return v != nil && v.DelayStartSeconds != nil
}

// GetJitterStartSeconds returns the value of JitterStartSeconds if it is set or its
// zero value if it is unset.
func (v *StartWorkflowExecutionRequest) GetJitterStartSeconds() (o int32) {
	if v != nil && v.JitterStartSeconds != nil {
		return *v.JitterStartSeconds
	}

	return
}

// IsSetJitterStartSeconds returns true if JitterStartSeconds is not nil.
func (v *StartWorkflowExecutionRequest) IsSetJitterStartSeconds() bool {
	return v != nil && v.JitterStartSeconds != nil
}

// GetFirstRunAtTimestamp returns the value of FirstRunAtTimestamp if it is set or its
// zero value if it is unset.
func (v *StartWorkflowExecutionRequest) GetFirstRunAtTimestamp() (o int64) {
	if v != nil && v.FirstRunAtTimestamp != nil {
		return *v.FirstRunAtTimestamp
	}

	return
}

// IsSetFirstRunAtTimestamp returns true if FirstRunAtTimestamp is not nil.
func (v *StartWorkflowExecutionRequest) IsSetFirstRunAtTimestamp() bool {
	return v != nil && v.FirstRunAtTimestamp != nil
}

// GetCronOverlapPolicy returns the value of CronOverlapPolicy if it is set or its
// zero value if it is unset.
func (v *StartWorkflowExecutionRequest) GetCronOverlapPolicy() (o CronOverlapPolicy) {
	if v != nil && v.CronOverlapPolicy != nil {
		return *v.CronOverlapPolicy
	}

	return
}

// IsSetCronOverlapPolicy returns true if CronOverlapPolicy is not nil.
func (v *StartWorkflowExecutionRequest) IsSetCronOverlapPolicy() bool {
	return v != nil && v.CronOverlapPolicy != nil
}

// GetActiveClusterSelectionPolicy returns the value of ActiveClusterSelectionPolicy if it is set or its
// zero value if it is unset.
func (v *StartWorkflowExecutionRequest) GetActiveClusterSelectionPolicy() (o *ActiveClusterSelectionPolicy) {
	if v != nil && v.ActiveClusterSelectionPolicy != nil {
		return v.ActiveClusterSelectionPolicy
	}

	return
}

// IsSetActiveClusterSelectionPolicy returns true if ActiveClusterSelectionPolicy is not nil.
func (v *StartWorkflowExecutionRequest) IsSetActiveClusterSelectionPolicy() bool {
	return v != nil && v.ActiveClusterSelectionPolicy != nil
}

type StartWorkflowExecutionResponse struct {
	RunId *string `json:"runId,omitempty"`
}

// ToWire translates a StartWorkflowExecutionResponse 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 *StartWorkflowExecutionResponse) ToWire() (wire.Value, error) {
	var (
		fields [1]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.RunId != nil {
		w, err = wire.NewValueString(*(v.RunId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

// FromWire deserializes a StartWorkflowExecutionResponse 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 StartWorkflowExecutionResponse struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v StartWorkflowExecutionResponse
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *StartWorkflowExecutionResponse) 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.RunId = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a StartWorkflowExecutionResponse
// struct.
func (v *StartWorkflowExecutionResponse) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [1]string
	i := 0
	if v.RunId != nil {
		fields[i] = fmt.Sprintf("RunId: %v", *(v.RunId))
		i++
	}

	return fmt.Sprintf("StartWorkflowExecutionResponse{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this StartWorkflowExecutionResponse match the
// provided StartWorkflowExecutionResponse.
//
// This function performs a deep comparison.
func (v *StartWorkflowExecutionResponse) Equals(rhs *StartWorkflowExecutionResponse) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.RunId, rhs.RunId) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of StartWorkflowExecutionResponse.
func (v *StartWorkflowExecutionResponse) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.RunId != nil {
		enc.AddString("runId", *v.RunId)
	}
	return err
}

// GetRunId returns the value of RunId if it is set or its
// zero value if it is unset.
func (v *StartWorkflowExecutionResponse) GetRunId() (o string) {
	if v != nil && v.RunId != nil {
		return *v.RunId
	}

	return
}

// IsSetRunId returns true if RunId is not nil.
func (v *StartWorkflowExecutionResponse) IsSetRunId() bool {
	return v != nil && v.RunId != nil
}

type StickyExecutionAttributes struct {
	WorkerTaskList                *TaskList `json:"workerTaskList,omitempty"`
	ScheduleToStartTimeoutSeconds *int32    `json:"scheduleToStartTimeoutSeconds,omitempty"`
}

// ToWire translates a StickyExecutionAttributes 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 *StickyExecutionAttributes) ToWire() (wire.Value, error) {
	var (
		fields [2]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.WorkerTaskList != nil {
		w, err = v.WorkerTaskList.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, 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: 20, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

// FromWire deserializes a StickyExecutionAttributes 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 StickyExecutionAttributes struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v StickyExecutionAttributes
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *StickyExecutionAttributes) 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.WorkerTaskList, err = _TaskList_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 20:
			if field.Value.Type() == wire.TI32 {
				var x int32
				x, err = field.Value.GetI32(), error(nil)
				v.ScheduleToStartTimeoutSeconds = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a StickyExecutionAttributes
// struct.
func (v *StickyExecutionAttributes) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [2]string
	i := 0
	if v.WorkerTaskList != nil {
		fields[i] = fmt.Sprintf("WorkerTaskList: %v", v.WorkerTaskList)
		i++
	}
	if v.ScheduleToStartTimeoutSeconds != nil {
		fields[i] = fmt.Sprintf("ScheduleToStartTimeoutSeconds: %v", *(v.ScheduleToStartTimeoutSeconds))
		i++
	}

	return fmt.Sprintf("StickyExecutionAttributes{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this StickyExecutionAttributes match the
// provided StickyExecutionAttributes.
//
// This function performs a deep comparison.
func (v *StickyExecutionAttributes) Equals(rhs *StickyExecutionAttributes) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !((v.WorkerTaskList == nil && rhs.WorkerTaskList == nil) || (v.WorkerTaskList != nil && rhs.WorkerTaskList != nil && v.WorkerTaskList.Equals(rhs.WorkerTaskList))) {
		return false
	}
	if !_I32_EqualsPtr(v.ScheduleToStartTimeoutSeconds, rhs.ScheduleToStartTimeoutSeconds) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of StickyExecutionAttributes.
func (v *StickyExecutionAttributes) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.WorkerTaskList != nil {
		err = multierr.Append(err, enc.AddObject("workerTaskList", v.WorkerTaskList))
	}
	if v.ScheduleToStartTimeoutSeconds != nil {
		enc.AddInt32("scheduleToStartTimeoutSeconds", *v.ScheduleToStartTimeoutSeconds)
	}
	return err
}

// GetWorkerTaskList returns the value of WorkerTaskList if it is set or its
// zero value if it is unset.
func (v *StickyExecutionAttributes) GetWorkerTaskList() (o *TaskList) {
	if v != nil && v.WorkerTaskList != nil {
		return v.WorkerTaskList
	}

	return
}

// IsSetWorkerTaskList returns true if WorkerTaskList is not nil.
func (v *StickyExecutionAttributes) IsSetWorkerTaskList() bool {
	return v != nil && v.WorkerTaskList != nil
}

// GetScheduleToStartTimeoutSeconds returns the value of ScheduleToStartTimeoutSeconds if it is set or its
// zero value if it is unset.
func (v *StickyExecutionAttributes) GetScheduleToStartTimeoutSeconds() (o int32) {
	if v != nil && v.ScheduleToStartTimeoutSeconds != nil {
		return *v.ScheduleToStartTimeoutSeconds
	}

	return
}

// IsSetScheduleToStartTimeoutSeconds returns true if ScheduleToStartTimeoutSeconds is not nil.
func (v *StickyExecutionAttributes) IsSetScheduleToStartTimeoutSeconds() bool {
	return v != nil && v.ScheduleToStartTimeoutSeconds != nil
}

type StickyWorkerUnavailableError struct {
	Message string `json:"message,required"`
}

// ToWire translates a StickyWorkerUnavailableError 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 *StickyWorkerUnavailableError) 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
}

// FromWire deserializes a StickyWorkerUnavailableError 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 StickyWorkerUnavailableError struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v StickyWorkerUnavailableError
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *StickyWorkerUnavailableError) 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 StickyWorkerUnavailableError is required")
	}

	return nil
}

// String returns a readable string representation of a StickyWorkerUnavailableError
// struct.
func (v *StickyWorkerUnavailableError) 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("StickyWorkerUnavailableError{%v}", strings.Join(fields[:i], ", "))
}

// ErrorName is the name of this type as defined in the Thrift
// file.
func (*StickyWorkerUnavailableError) ErrorName() string {
	return "StickyWorkerUnavailableError"
}

// Equals returns true if all the fields of this StickyWorkerUnavailableError match the
// provided StickyWorkerUnavailableError.
//
// This function performs a deep comparison.
func (v *StickyWorkerUnavailableError) Equals(rhs *StickyWorkerUnavailableError) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !(v.Message == rhs.Message) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of StickyWorkerUnavailableError.
func (v *StickyWorkerUnavailableError) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	enc.AddString("message", v.Message)
	return err
}

// GetMessage returns the value of Message if it is set or its
// zero value if it is unset.
func (v *StickyWorkerUnavailableError) GetMessage() (o string) {
	if v != nil {
		o = v.Message
	}
	return
}

func (v *StickyWorkerUnavailableError) Error() string {
	return v.String()
}

type SupportedClientVersions struct {
	GoSdk   *string `json:"goSdk,omitempty"`
	JavaSdk *string `json:"javaSdk,omitempty"`
}

// ToWire translates a SupportedClientVersions 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 *SupportedClientVersions) ToWire() (wire.Value, error) {
	var (
		fields [2]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.GoSdk != nil {
		w, err = wire.NewValueString(*(v.GoSdk)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.JavaSdk != nil {
		w, err = wire.NewValueString(*(v.JavaSdk)), 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
}

// FromWire deserializes a SupportedClientVersions 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 SupportedClientVersions struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v SupportedClientVersions
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *SupportedClientVersions) 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.GoSdk = &x
				if err != nil {
					return err
				}

			}
		case 20:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.JavaSdk = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a SupportedClientVersions
// struct.
func (v *SupportedClientVersions) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [2]string
	i := 0
	if v.GoSdk != nil {
		fields[i] = fmt.Sprintf("GoSdk: %v", *(v.GoSdk))
		i++
	}
	if v.JavaSdk != nil {
		fields[i] = fmt.Sprintf("JavaSdk: %v", *(v.JavaSdk))
		i++
	}

	return fmt.Sprintf("SupportedClientVersions{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this SupportedClientVersions match the
// provided SupportedClientVersions.
//
// This function performs a deep comparison.
func (v *SupportedClientVersions) Equals(rhs *SupportedClientVersions) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.GoSdk, rhs.GoSdk) {
		return false
	}
	if !_String_EqualsPtr(v.JavaSdk, rhs.JavaSdk) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of SupportedClientVersions.
func (v *SupportedClientVersions) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.GoSdk != nil {
		enc.AddString("goSdk", *v.GoSdk)
	}
	if v.JavaSdk != nil {
		enc.AddString("javaSdk", *v.JavaSdk)
	}
	return err
}

// GetGoSdk returns the value of GoSdk if it is set or its
// zero value if it is unset.
func (v *SupportedClientVersions) GetGoSdk() (o string) {
	if v != nil && v.GoSdk != nil {
		return *v.GoSdk
	}

	return
}

// IsSetGoSdk returns true if GoSdk is not nil.
func (v *SupportedClientVersions) IsSetGoSdk() bool {
	return v != nil && v.GoSdk != nil
}

// GetJavaSdk returns the value of JavaSdk if it is set or its
// zero value if it is unset.
func (v *SupportedClientVersions) GetJavaSdk() (o string) {
	if v != nil && v.JavaSdk != nil {
		return *v.JavaSdk
	}

	return
}

// IsSetJavaSdk returns true if JavaSdk is not nil.
func (v *SupportedClientVersions) IsSetJavaSdk() bool {
	return v != nil && v.JavaSdk != nil
}

type TaskIDBlock struct {
	StartID *int64 `json:"startID,omitempty"`
	EndID   *int64 `json:"endID,omitempty"`
}

// ToWire translates a TaskIDBlock 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 *TaskIDBlock) ToWire() (wire.Value, error) {
	var (
		fields [2]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.StartID != nil {
		w, err = wire.NewValueI64(*(v.StartID)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.EndID != nil {
		w, err = wire.NewValueI64(*(v.EndID)), 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
}

// FromWire deserializes a TaskIDBlock 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 TaskIDBlock struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v TaskIDBlock
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *TaskIDBlock) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			if field.Value.Type() == wire.TI64 {
				var x int64
				x, err = field.Value.GetI64(), error(nil)
				v.StartID = &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.EndID = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a TaskIDBlock
// struct.
func (v *TaskIDBlock) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [2]string
	i := 0
	if v.StartID != nil {
		fields[i] = fmt.Sprintf("StartID: %v", *(v.StartID))
		i++
	}
	if v.EndID != nil {
		fields[i] = fmt.Sprintf("EndID: %v", *(v.EndID))
		i++
	}

	return fmt.Sprintf("TaskIDBlock{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this TaskIDBlock match the
// provided TaskIDBlock.
//
// This function performs a deep comparison.
func (v *TaskIDBlock) Equals(rhs *TaskIDBlock) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_I64_EqualsPtr(v.StartID, rhs.StartID) {
		return false
	}
	if !_I64_EqualsPtr(v.EndID, rhs.EndID) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of TaskIDBlock.
func (v *TaskIDBlock) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.StartID != nil {
		enc.AddInt64("startID", *v.StartID)
	}
	if v.EndID != nil {
		enc.AddInt64("endID", *v.EndID)
	}
	return err
}

// GetStartID returns the value of StartID if it is set or its
// zero value if it is unset.
func (v *TaskIDBlock) GetStartID() (o int64) {
	if v != nil && v.StartID != nil {
		return *v.StartID
	}

	return
}

// IsSetStartID returns true if StartID is not nil.
func (v *TaskIDBlock) IsSetStartID() bool {
	return v != nil && v.StartID != nil
}

// GetEndID returns the value of EndID if it is set or its
// zero value if it is unset.
func (v *TaskIDBlock) GetEndID() (o int64) {
	if v != nil && v.EndID != nil {
		return *v.EndID
	}

	return
}

// IsSetEndID returns true if EndID is not nil.
func (v *TaskIDBlock) IsSetEndID() bool {
	return v != nil && v.EndID != nil
}

type TaskKey struct {
	ScheduledTimeNano *int64 `json:"scheduledTimeNano,omitempty"`
	TaskID            *int64 `json:"taskID,omitempty"`
}

// ToWire translates a TaskKey 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 *TaskKey) ToWire() (wire.Value, error) {
	var (
		fields [2]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.ScheduledTimeNano != nil {
		w, err = wire.NewValueI64(*(v.ScheduledTimeNano)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.TaskID != nil {
		w, err = wire.NewValueI64(*(v.TaskID)), 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
}

// FromWire deserializes a TaskKey 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 TaskKey struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v TaskKey
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *TaskKey) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			if field.Value.Type() == wire.TI64 {
				var x int64
				x, err = field.Value.GetI64(), error(nil)
				v.ScheduledTimeNano = &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.TaskID = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a TaskKey
// struct.
func (v *TaskKey) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [2]string
	i := 0
	if v.ScheduledTimeNano != nil {
		fields[i] = fmt.Sprintf("ScheduledTimeNano: %v", *(v.ScheduledTimeNano))
		i++
	}
	if v.TaskID != nil {
		fields[i] = fmt.Sprintf("TaskID: %v", *(v.TaskID))
		i++
	}

	return fmt.Sprintf("TaskKey{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this TaskKey match the
// provided TaskKey.
//
// This function performs a deep comparison.
func (v *TaskKey) Equals(rhs *TaskKey) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_I64_EqualsPtr(v.ScheduledTimeNano, rhs.ScheduledTimeNano) {
		return false
	}
	if !_I64_EqualsPtr(v.TaskID, rhs.TaskID) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of TaskKey.
func (v *TaskKey) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.ScheduledTimeNano != nil {
		enc.AddInt64("scheduledTimeNano", *v.ScheduledTimeNano)
	}
	if v.TaskID != nil {
		enc.AddInt64("taskID", *v.TaskID)
	}
	return err
}

// GetScheduledTimeNano returns the value of ScheduledTimeNano if it is set or its
// zero value if it is unset.
func (v *TaskKey) GetScheduledTimeNano() (o int64) {
	if v != nil && v.ScheduledTimeNano != nil {
		return *v.ScheduledTimeNano
	}

	return
}

// IsSetScheduledTimeNano returns true if ScheduledTimeNano is not nil.
func (v *TaskKey) IsSetScheduledTimeNano() bool {
	return v != nil && v.ScheduledTimeNano != nil
}

// GetTaskID returns the value of TaskID if it is set or its
// zero value if it is unset.
func (v *TaskKey) GetTaskID() (o int64) {
	if v != nil && v.TaskID != nil {
		return *v.TaskID
	}

	return
}

// IsSetTaskID returns true if TaskID is not nil.
func (v *TaskKey) IsSetTaskID() bool {
	return v != nil && v.TaskID != nil
}

type TaskList struct {
	Name *string       `json:"name,omitempty"`
	Kind *TaskListKind `json:"kind,omitempty"`
}

// ToWire translates a TaskList 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 *TaskList) ToWire() (wire.Value, error) {
	var (
		fields [2]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.Name != nil {
		w, err = wire.NewValueString(*(v.Name)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.Kind != nil {
		w, err = v.Kind.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 _TaskListKind_Read(w wire.Value) (TaskListKind, error) {
	var v TaskListKind
	err := v.FromWire(w)
	return v, err
}

// FromWire deserializes a TaskList 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 TaskList struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v TaskList
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *TaskList) 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.Name = &x
				if err != nil {
					return err
				}

			}
		case 20:
			if field.Value.Type() == wire.TI32 {
				var x TaskListKind
				x, err = _TaskListKind_Read(field.Value)
				v.Kind = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a TaskList
// struct.
func (v *TaskList) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [2]string
	i := 0
	if v.Name != nil {
		fields[i] = fmt.Sprintf("Name: %v", *(v.Name))
		i++
	}
	if v.Kind != nil {
		fields[i] = fmt.Sprintf("Kind: %v", *(v.Kind))
		i++
	}

	return fmt.Sprintf("TaskList{%v}", strings.Join(fields[:i], ", "))
}

func _TaskListKind_EqualsPtr(lhs, rhs *TaskListKind) bool {
	if lhs != nil && rhs != nil {

		x := *lhs
		y := *rhs
		return x.Equals(y)
	}
	return lhs == nil && rhs == nil
}

// Equals returns true if all the fields of this TaskList match the
// provided TaskList.
//
// This function performs a deep comparison.
func (v *TaskList) Equals(rhs *TaskList) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.Name, rhs.Name) {
		return false
	}
	if !_TaskListKind_EqualsPtr(v.Kind, rhs.Kind) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of TaskList.
func (v *TaskList) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Name != nil {
		enc.AddString("name", *v.Name)
	}
	if v.Kind != nil {
		err = multierr.Append(err, enc.AddObject("kind", *v.Kind))
	}
	return err
}

// GetName returns the value of Name if it is set or its
// zero value if it is unset.
func (v *TaskList) GetName() (o string) {
	if v != nil && v.Name != nil {
		return *v.Name
	}

	return
}

// IsSetName returns true if Name is not nil.
func (v *TaskList) IsSetName() bool {
	return v != nil && v.Name != nil
}

// GetKind returns the value of Kind if it is set or its
// zero value if it is unset.
func (v *TaskList) GetKind() (o TaskListKind) {
	if v != nil && v.Kind != nil {
		return *v.Kind
	}

	return
}

// IsSetKind returns true if Kind is not nil.
func (v *TaskList) IsSetKind() bool {
	return v != nil && v.Kind != nil
}

type TaskListKind int32

const (
	TaskListKindNormal    TaskListKind = 0
	TaskListKindSticky    TaskListKind = 1
	TaskListKindEphemeral TaskListKind = 2
)

// TaskListKind_Values returns all recognized values of TaskListKind.
func TaskListKind_Values() []TaskListKind {
	return []TaskListKind{
		TaskListKindNormal,
		TaskListKindSticky,
		TaskListKindEphemeral,
	}
}

// UnmarshalText tries to decode TaskListKind from a byte slice
// containing its name.
//
//	var v TaskListKind
//	err := v.UnmarshalText([]byte("NORMAL"))
func (v *TaskListKind) UnmarshalText(value []byte) error {
	switch s := string(value); s {
	case "NORMAL":
		*v = TaskListKindNormal
		return nil
	case "STICKY":
		*v = TaskListKindSticky
		return nil
	case "EPHEMERAL":
		*v = TaskListKindEphemeral
		return nil
	default:
		val, err := strconv.ParseInt(s, 10, 32)
		if err != nil {
			return fmt.Errorf("unknown enum value %q for %q: %v", s, "TaskListKind", err)
		}
		*v = TaskListKind(val)
		return nil
	}
}

// MarshalText encodes TaskListKind 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 TaskListKind) MarshalText() ([]byte, error) {
	switch int32(v) {
	case 0:
		return []byte("NORMAL"), nil
	case 1:
		return []byte("STICKY"), nil
	case 2:
		return []byte("EPHEMERAL"), nil
	}
	return []byte(strconv.FormatInt(int64(v), 10)), nil
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of TaskListKind.
// 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 TaskListKind) MarshalLogObject(enc zapcore.ObjectEncoder) error {
	enc.AddInt32("value", int32(v))
	switch int32(v) {
	case 0:
		enc.AddString("name", "NORMAL")
	case 1:
		enc.AddString("name", "STICKY")
	case 2:
		enc.AddString("name", "EPHEMERAL")
	}
	return nil
}

// Ptr returns a pointer to this enum value.
func (v TaskListKind) Ptr() *TaskListKind {
	return &v
}

// ToWire translates TaskListKind 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 TaskListKind) ToWire() (wire.Value, error) {
	return wire.NewValueI32(int32(v)), nil
}

// FromWire deserializes TaskListKind from its Thrift-level
// representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TI32)
//	if err != nil {
//	  return TaskListKind(0), err
//	}
//
//	var v TaskListKind
//	if err := v.FromWire(x); err != nil {
//	  return TaskListKind(0), err
//	}
//	return v, nil
func (v *TaskListKind) FromWire(w wire.Value) error {
	*v = (TaskListKind)(w.GetI32())
	return nil
}

// String returns a readable string representation of TaskListKind.
func (v TaskListKind) String() string {
	w := int32(v)
	switch w {
	case 0:
		return "NORMAL"
	case 1:
		return "STICKY"
	case 2:
		return "EPHEMERAL"
	}
	return fmt.Sprintf("TaskListKind(%d)", w)
}

// Equals returns true if this TaskListKind value matches the provided
// value.
func (v TaskListKind) Equals(rhs TaskListKind) bool {
	return v == rhs
}

// MarshalJSON serializes TaskListKind into JSON.
//
// If the enum value is recognized, its name is returned. Otherwise,
// its integer value is returned.
//
// This implements json.Marshaler.
func (v TaskListKind) MarshalJSON() ([]byte, error) {
	switch int32(v) {
	case 0:
		return ([]byte)("\"NORMAL\""), nil
	case 1:
		return ([]byte)("\"STICKY\""), nil
	case 2:
		return ([]byte)("\"EPHEMERAL\""), nil
	}
	return ([]byte)(strconv.FormatInt(int64(v), 10)), nil
}

// UnmarshalJSON attempts to decode TaskListKind 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 *TaskListKind) 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, "TaskListKind")
		}
		if x < math.MinInt32 {
			return fmt.Errorf("enum underflow from JSON %q for %q", text, "TaskListKind")
		}
		*v = (TaskListKind)(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, "TaskListKind")
	}
}

type TaskListMetadata struct {
	MaxTasksPerSecond *float64 `json:"maxTasksPerSecond,omitempty"`
}

// ToWire translates a TaskListMetadata 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 *TaskListMetadata) ToWire() (wire.Value, error) {
	var (
		fields [1]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.MaxTasksPerSecond != nil {
		w, err = wire.NewValueDouble(*(v.MaxTasksPerSecond)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

// FromWire deserializes a TaskListMetadata 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 TaskListMetadata struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v TaskListMetadata
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *TaskListMetadata) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			if field.Value.Type() == wire.TDouble {
				var x float64
				x, err = field.Value.GetDouble(), error(nil)
				v.MaxTasksPerSecond = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a TaskListMetadata
// struct.
func (v *TaskListMetadata) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [1]string
	i := 0
	if v.MaxTasksPerSecond != nil {
		fields[i] = fmt.Sprintf("MaxTasksPerSecond: %v", *(v.MaxTasksPerSecond))
		i++
	}

	return fmt.Sprintf("TaskListMetadata{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this TaskListMetadata match the
// provided TaskListMetadata.
//
// This function performs a deep comparison.
func (v *TaskListMetadata) Equals(rhs *TaskListMetadata) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_Double_EqualsPtr(v.MaxTasksPerSecond, rhs.MaxTasksPerSecond) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of TaskListMetadata.
func (v *TaskListMetadata) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.MaxTasksPerSecond != nil {
		enc.AddFloat64("maxTasksPerSecond", *v.MaxTasksPerSecond)
	}
	return err
}

// GetMaxTasksPerSecond returns the value of MaxTasksPerSecond if it is set or its
// zero value if it is unset.
func (v *TaskListMetadata) GetMaxTasksPerSecond() (o float64) {
	if v != nil && v.MaxTasksPerSecond != nil {
		return *v.MaxTasksPerSecond
	}

	return
}

// IsSetMaxTasksPerSecond returns true if MaxTasksPerSecond is not nil.
func (v *TaskListMetadata) IsSetMaxTasksPerSecond() bool {
	return v != nil && v.MaxTasksPerSecond != nil
}

type TaskListNotOwnedByHostError struct {
	OwnedByIdentity string `json:"ownedByIdentity,required"`
	MyIdentity      string `json:"myIdentity,required"`
	TasklistName    string `json:"tasklistName,required"`
}

// ToWire translates a TaskListNotOwnedByHostError 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 *TaskListNotOwnedByHostError) ToWire() (wire.Value, error) {
	var (
		fields [3]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	w, err = wire.NewValueString(v.OwnedByIdentity), error(nil)
	if err != nil {
		return w, err
	}
	fields[i] = wire.Field{ID: 1, Value: w}
	i++

	w, err = wire.NewValueString(v.MyIdentity), error(nil)
	if err != nil {
		return w, err
	}
	fields[i] = wire.Field{ID: 2, Value: w}
	i++

	w, err = wire.NewValueString(v.TasklistName), error(nil)
	if err != nil {
		return w, err
	}
	fields[i] = wire.Field{ID: 3, Value: w}
	i++

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

// FromWire deserializes a TaskListNotOwnedByHostError 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 TaskListNotOwnedByHostError struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v TaskListNotOwnedByHostError
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *TaskListNotOwnedByHostError) FromWire(w wire.Value) error {
	var err error

	ownedByIdentityIsSet := false
	myIdentityIsSet := false
	tasklistNameIsSet := false

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 1:
			if field.Value.Type() == wire.TBinary {
				v.OwnedByIdentity, err = field.Value.GetString(), error(nil)
				if err != nil {
					return err
				}
				ownedByIdentityIsSet = true
			}
		case 2:
			if field.Value.Type() == wire.TBinary {
				v.MyIdentity, err = field.Value.GetString(), error(nil)
				if err != nil {
					return err
				}
				myIdentityIsSet = true
			}
		case 3:
			if field.Value.Type() == wire.TBinary {
				v.TasklistName, err = field.Value.GetString(), error(nil)
				if err != nil {
					return err
				}
				tasklistNameIsSet = true
			}
		}
	}

	if !ownedByIdentityIsSet {
		return errors.New("field OwnedByIdentity of TaskListNotOwnedByHostError is required")
	}

	if !myIdentityIsSet {
		return errors.New("field MyIdentity of TaskListNotOwnedByHostError is required")
	}

	if !tasklistNameIsSet {
		return errors.New("field TasklistName of TaskListNotOwnedByHostError is required")
	}

	return nil
}

// String returns a readable string representation of a TaskListNotOwnedByHostError
// struct.
func (v *TaskListNotOwnedByHostError) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [3]string
	i := 0
	fields[i] = fmt.Sprintf("OwnedByIdentity: %v", v.OwnedByIdentity)
	i++
	fields[i] = fmt.Sprintf("MyIdentity: %v", v.MyIdentity)
	i++
	fields[i] = fmt.Sprintf("TasklistName: %v", v.TasklistName)
	i++

	return fmt.Sprintf("TaskListNotOwnedByHostError{%v}", strings.Join(fields[:i], ", "))
}

// ErrorName is the name of this type as defined in the Thrift
// file.
func (*TaskListNotOwnedByHostError) ErrorName() string {
	return "TaskListNotOwnedByHostError"
}

// Equals returns true if all the fields of this TaskListNotOwnedByHostError match the
// provided TaskListNotOwnedByHostError.
//
// This function performs a deep comparison.
func (v *TaskListNotOwnedByHostError) Equals(rhs *TaskListNotOwnedByHostError) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !(v.OwnedByIdentity == rhs.OwnedByIdentity) {
		return false
	}
	if !(v.MyIdentity == rhs.MyIdentity) {
		return false
	}
	if !(v.TasklistName == rhs.TasklistName) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of TaskListNotOwnedByHostError.
func (v *TaskListNotOwnedByHostError) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	enc.AddString("ownedByIdentity", v.OwnedByIdentity)
	enc.AddString("myIdentity", v.MyIdentity)
	enc.AddString("tasklistName", v.TasklistName)
	return err
}

// GetOwnedByIdentity returns the value of OwnedByIdentity if it is set or its
// zero value if it is unset.
func (v *TaskListNotOwnedByHostError) GetOwnedByIdentity() (o string) {
	if v != nil {
		o = v.OwnedByIdentity
	}
	return
}

// GetMyIdentity returns the value of MyIdentity if it is set or its
// zero value if it is unset.
func (v *TaskListNotOwnedByHostError) GetMyIdentity() (o string) {
	if v != nil {
		o = v.MyIdentity
	}
	return
}

// GetTasklistName returns the value of TasklistName if it is set or its
// zero value if it is unset.
func (v *TaskListNotOwnedByHostError) GetTasklistName() (o string) {
	if v != nil {
		o = v.TasklistName
	}
	return
}

func (v *TaskListNotOwnedByHostError) Error() string {
	return v.String()
}

type TaskListPartitionMetadata struct {
	Key           *string `json:"key,omitempty"`
	OwnerHostName *string `json:"ownerHostName,omitempty"`
}

// ToWire translates a TaskListPartitionMetadata 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 *TaskListPartitionMetadata) ToWire() (wire.Value, error) {
	var (
		fields [2]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.Key != nil {
		w, err = wire.NewValueString(*(v.Key)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.OwnerHostName != nil {
		w, err = wire.NewValueString(*(v.OwnerHostName)), 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
}

// FromWire deserializes a TaskListPartitionMetadata 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 TaskListPartitionMetadata struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v TaskListPartitionMetadata
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *TaskListPartitionMetadata) 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.Key = &x
				if err != nil {
					return err
				}

			}
		case 20:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.OwnerHostName = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a TaskListPartitionMetadata
// struct.
func (v *TaskListPartitionMetadata) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [2]string
	i := 0
	if v.Key != nil {
		fields[i] = fmt.Sprintf("Key: %v", *(v.Key))
		i++
	}
	if v.OwnerHostName != nil {
		fields[i] = fmt.Sprintf("OwnerHostName: %v", *(v.OwnerHostName))
		i++
	}

	return fmt.Sprintf("TaskListPartitionMetadata{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this TaskListPartitionMetadata match the
// provided TaskListPartitionMetadata.
//
// This function performs a deep comparison.
func (v *TaskListPartitionMetadata) Equals(rhs *TaskListPartitionMetadata) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.Key, rhs.Key) {
		return false
	}
	if !_String_EqualsPtr(v.OwnerHostName, rhs.OwnerHostName) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of TaskListPartitionMetadata.
func (v *TaskListPartitionMetadata) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Key != nil {
		enc.AddString("key", *v.Key)
	}
	if v.OwnerHostName != nil {
		enc.AddString("ownerHostName", *v.OwnerHostName)
	}
	return err
}

// GetKey returns the value of Key if it is set or its
// zero value if it is unset.
func (v *TaskListPartitionMetadata) GetKey() (o string) {
	if v != nil && v.Key != nil {
		return *v.Key
	}

	return
}

// IsSetKey returns true if Key is not nil.
func (v *TaskListPartitionMetadata) IsSetKey() bool {
	return v != nil && v.Key != nil
}

// GetOwnerHostName returns the value of OwnerHostName if it is set or its
// zero value if it is unset.
func (v *TaskListPartitionMetadata) GetOwnerHostName() (o string) {
	if v != nil && v.OwnerHostName != nil {
		return *v.OwnerHostName
	}

	return
}

// IsSetOwnerHostName returns true if OwnerHostName is not nil.
func (v *TaskListPartitionMetadata) IsSetOwnerHostName() bool {
	return v != nil && v.OwnerHostName != nil
}

type TaskListStatus struct {
	BacklogCountHint      *int64                            `json:"backlogCountHint,omitempty"`
	ReadLevel             *int64                            `json:"readLevel,omitempty"`
	AckLevel              *int64                            `json:"ackLevel,omitempty"`
	RatePerSecond         *float64                          `json:"ratePerSecond,omitempty"`
	TaskIDBlock           *TaskIDBlock                      `json:"taskIDBlock,omitempty"`
	IsolationGroupMetrics map[string]*IsolationGroupMetrics `json:"isolationGroupMetrics,omitempty"`
	NewTasksPerSecond     *float64                          `json:"newTasksPerSecond,omitempty"`
}

type _Map_String_IsolationGroupMetrics_MapItemList map[string]*IsolationGroupMetrics

func (m _Map_String_IsolationGroupMetrics_MapItemList) ForEach(f func(wire.MapItem) error) error {
	for k, v := range m {
		if v == nil {
			return fmt.Errorf("invalid [%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_IsolationGroupMetrics_MapItemList) Size() int {
	return len(m)
}

func (_Map_String_IsolationGroupMetrics_MapItemList) KeyType() wire.Type {
	return wire.TBinary
}

func (_Map_String_IsolationGroupMetrics_MapItemList) ValueType() wire.Type {
	return wire.TStruct
}

func (_Map_String_IsolationGroupMetrics_MapItemList) Close() {}

// ToWire translates a TaskListStatus 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 *TaskListStatus) ToWire() (wire.Value, error) {
	var (
		fields [7]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.BacklogCountHint != nil {
		w, err = wire.NewValueI64(*(v.BacklogCountHint)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.ReadLevel != nil {
		w, err = wire.NewValueI64(*(v.ReadLevel)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.AckLevel != nil {
		w, err = wire.NewValueI64(*(v.AckLevel)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.RatePerSecond != nil {
		w, err = wire.NewValueDouble(*(v.RatePerSecond)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 35, Value: w}
		i++
	}
	if v.TaskIDBlock != nil {
		w, err = v.TaskIDBlock.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 40, Value: w}
		i++
	}
	if v.IsolationGroupMetrics != nil {
		w, err = wire.NewValueMap(_Map_String_IsolationGroupMetrics_MapItemList(v.IsolationGroupMetrics)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 50, Value: w}
		i++
	}
	if v.NewTasksPerSecond != nil {
		w, err = wire.NewValueDouble(*(v.NewTasksPerSecond)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 60, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

func _TaskIDBlock_Read(w wire.Value) (*TaskIDBlock, error) {
	var v TaskIDBlock
	err := v.FromWire(w)
	return &v, err
}

func _IsolationGroupMetrics_Read(w wire.Value) (*IsolationGroupMetrics, error) {
	var v IsolationGroupMetrics
	err := v.FromWire(w)
	return &v, err
}

func _Map_String_IsolationGroupMetrics_Read(m wire.MapItemList) (map[string]*IsolationGroupMetrics, error) {
	if m.KeyType() != wire.TBinary {
		return nil, nil
	}

	if m.ValueType() != wire.TStruct {
		return nil, nil
	}

	o := make(map[string]*IsolationGroupMetrics, m.Size())
	err := m.ForEach(func(x wire.MapItem) error {
		k, err := x.Key.GetString(), error(nil)
		if err != nil {
			return err
		}

		v, err := _IsolationGroupMetrics_Read(x.Value)
		if err != nil {
			return err
		}

		o[k] = v
		return nil
	})
	m.Close()
	return o, err
}

// FromWire deserializes a TaskListStatus 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 TaskListStatus struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v TaskListStatus
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *TaskListStatus) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			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 20:
			if field.Value.Type() == wire.TI64 {
				var x int64
				x, err = field.Value.GetI64(), error(nil)
				v.ReadLevel = &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.AckLevel = &x
				if err != nil {
					return err
				}

			}
		case 35:
			if field.Value.Type() == wire.TDouble {
				var x float64
				x, err = field.Value.GetDouble(), error(nil)
				v.RatePerSecond = &x
				if err != nil {
					return err
				}

			}
		case 40:
			if field.Value.Type() == wire.TStruct {
				v.TaskIDBlock, err = _TaskIDBlock_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 50:
			if field.Value.Type() == wire.TMap {
				v.IsolationGroupMetrics, err = _Map_String_IsolationGroupMetrics_Read(field.Value.GetMap())
				if err != nil {
					return err
				}

			}
		case 60:
			if field.Value.Type() == wire.TDouble {
				var x float64
				x, err = field.Value.GetDouble(), error(nil)
				v.NewTasksPerSecond = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a TaskListStatus
// struct.
func (v *TaskListStatus) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [7]string
	i := 0
	if v.BacklogCountHint != nil {
		fields[i] = fmt.Sprintf("BacklogCountHint: %v", *(v.BacklogCountHint))
		i++
	}
	if v.ReadLevel != nil {
		fields[i] = fmt.Sprintf("ReadLevel: %v", *(v.ReadLevel))
		i++
	}
	if v.AckLevel != nil {
		fields[i] = fmt.Sprintf("AckLevel: %v", *(v.AckLevel))
		i++
	}
	if v.RatePerSecond != nil {
		fields[i] = fmt.Sprintf("RatePerSecond: %v", *(v.RatePerSecond))
		i++
	}
	if v.TaskIDBlock != nil {
		fields[i] = fmt.Sprintf("TaskIDBlock: %v", v.TaskIDBlock)
		i++
	}
	if v.IsolationGroupMetrics != nil {
		fields[i] = fmt.Sprintf("IsolationGroupMetrics: %v", v.IsolationGroupMetrics)
		i++
	}
	if v.NewTasksPerSecond != nil {
		fields[i] = fmt.Sprintf("NewTasksPerSecond: %v", *(v.NewTasksPerSecond))
		i++
	}

	return fmt.Sprintf("TaskListStatus{%v}", strings.Join(fields[:i], ", "))
}

func _Map_String_IsolationGroupMetrics_Equals(lhs, rhs map[string]*IsolationGroupMetrics) 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 TaskListStatus match the
// provided TaskListStatus.
//
// This function performs a deep comparison.
func (v *TaskListStatus) Equals(rhs *TaskListStatus) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_I64_EqualsPtr(v.BacklogCountHint, rhs.BacklogCountHint) {
		return false
	}
	if !_I64_EqualsPtr(v.ReadLevel, rhs.ReadLevel) {
		return false
	}
	if !_I64_EqualsPtr(v.AckLevel, rhs.AckLevel) {
		return false
	}
	if !_Double_EqualsPtr(v.RatePerSecond, rhs.RatePerSecond) {
		return false
	}
	if !((v.TaskIDBlock == nil && rhs.TaskIDBlock == nil) || (v.TaskIDBlock != nil && rhs.TaskIDBlock != nil && v.TaskIDBlock.Equals(rhs.TaskIDBlock))) {
		return false
	}
	if !((v.IsolationGroupMetrics == nil && rhs.IsolationGroupMetrics == nil) || (v.IsolationGroupMetrics != nil && rhs.IsolationGroupMetrics != nil && _Map_String_IsolationGroupMetrics_Equals(v.IsolationGroupMetrics, rhs.IsolationGroupMetrics))) {
		return false
	}
	if !_Double_EqualsPtr(v.NewTasksPerSecond, rhs.NewTasksPerSecond) {
		return false
	}

	return true
}

type _Map_String_IsolationGroupMetrics_Zapper map[string]*IsolationGroupMetrics

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of _Map_String_IsolationGroupMetrics_Zapper.
func (m _Map_String_IsolationGroupMetrics_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 TaskListStatus.
func (v *TaskListStatus) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.BacklogCountHint != nil {
		enc.AddInt64("backlogCountHint", *v.BacklogCountHint)
	}
	if v.ReadLevel != nil {
		enc.AddInt64("readLevel", *v.ReadLevel)
	}
	if v.AckLevel != nil {
		enc.AddInt64("ackLevel", *v.AckLevel)
	}
	if v.RatePerSecond != nil {
		enc.AddFloat64("ratePerSecond", *v.RatePerSecond)
	}
	if v.TaskIDBlock != nil {
		err = multierr.Append(err, enc.AddObject("taskIDBlock", v.TaskIDBlock))
	}
	if v.IsolationGroupMetrics != nil {
		err = multierr.Append(err, enc.AddObject("isolationGroupMetrics", (_Map_String_IsolationGroupMetrics_Zapper)(v.IsolationGroupMetrics)))
	}
	if v.NewTasksPerSecond != nil {
		enc.AddFloat64("newTasksPerSecond", *v.NewTasksPerSecond)
	}
	return err
}

// GetBacklogCountHint returns the value of BacklogCountHint if it is set or its
// zero value if it is unset.
func (v *TaskListStatus) GetBacklogCountHint() (o int64) {
	if v != nil && v.BacklogCountHint != nil {
		return *v.BacklogCountHint
	}

	return
}

// IsSetBacklogCountHint returns true if BacklogCountHint is not nil.
func (v *TaskListStatus) IsSetBacklogCountHint() bool {
	return v != nil && v.BacklogCountHint != nil
}

// GetReadLevel returns the value of ReadLevel if it is set or its
// zero value if it is unset.
func (v *TaskListStatus) GetReadLevel() (o int64) {
	if v != nil && v.ReadLevel != nil {
		return *v.ReadLevel
	}

	return
}

// IsSetReadLevel returns true if ReadLevel is not nil.
func (v *TaskListStatus) IsSetReadLevel() bool {
	return v != nil && v.ReadLevel != nil
}

// GetAckLevel returns the value of AckLevel if it is set or its
// zero value if it is unset.
func (v *TaskListStatus) GetAckLevel() (o int64) {
	if v != nil && v.AckLevel != nil {
		return *v.AckLevel
	}

	return
}

// IsSetAckLevel returns true if AckLevel is not nil.
func (v *TaskListStatus) IsSetAckLevel() bool {
	return v != nil && v.AckLevel != nil
}

// GetRatePerSecond returns the value of RatePerSecond if it is set or its
// zero value if it is unset.
func (v *TaskListStatus) GetRatePerSecond() (o float64) {
	if v != nil && v.RatePerSecond != nil {
		return *v.RatePerSecond
	}

	return
}

// IsSetRatePerSecond returns true if RatePerSecond is not nil.
func (v *TaskListStatus) IsSetRatePerSecond() bool {
	return v != nil && v.RatePerSecond != nil
}

// GetTaskIDBlock returns the value of TaskIDBlock if it is set or its
// zero value if it is unset.
func (v *TaskListStatus) GetTaskIDBlock() (o *TaskIDBlock) {
	if v != nil && v.TaskIDBlock != nil {
		return v.TaskIDBlock
	}

	return
}

// IsSetTaskIDBlock returns true if TaskIDBlock is not nil.
func (v *TaskListStatus) IsSetTaskIDBlock() bool {
	return v != nil && v.TaskIDBlock != nil
}

// GetIsolationGroupMetrics returns the value of IsolationGroupMetrics if it is set or its
// zero value if it is unset.
func (v *TaskListStatus) GetIsolationGroupMetrics() (o map[string]*IsolationGroupMetrics) {
	if v != nil && v.IsolationGroupMetrics != nil {
		return v.IsolationGroupMetrics
	}

	return
}

// IsSetIsolationGroupMetrics returns true if IsolationGroupMetrics is not nil.
func (v *TaskListStatus) IsSetIsolationGroupMetrics() bool {
	return v != nil && v.IsolationGroupMetrics != nil
}

// GetNewTasksPerSecond returns the value of NewTasksPerSecond if it is set or its
// zero value if it is unset.
func (v *TaskListStatus) GetNewTasksPerSecond() (o float64) {
	if v != nil && v.NewTasksPerSecond != nil {
		return *v.NewTasksPerSecond
	}

	return
}

// IsSetNewTasksPerSecond returns true if NewTasksPerSecond is not nil.
func (v *TaskListStatus) IsSetNewTasksPerSecond() bool {
	return v != nil && v.NewTasksPerSecond != nil
}

type TaskListType int32

const (
	TaskListTypeDecision TaskListType = 0
	TaskListTypeActivity TaskListType = 1
)

// TaskListType_Values returns all recognized values of TaskListType.
func TaskListType_Values() []TaskListType {
	return []TaskListType{
		TaskListTypeDecision,
		TaskListTypeActivity,
	}
}

// UnmarshalText tries to decode TaskListType from a byte slice
// containing its name.
//
//	var v TaskListType
//	err := v.UnmarshalText([]byte("Decision"))
func (v *TaskListType) UnmarshalText(value []byte) error {
	switch s := string(value); s {
	case "Decision":
		*v = TaskListTypeDecision
		return nil
	case "Activity":
		*v = TaskListTypeActivity
		return nil
	default:
		val, err := strconv.ParseInt(s, 10, 32)
		if err != nil {
			return fmt.Errorf("unknown enum value %q for %q: %v", s, "TaskListType", err)
		}
		*v = TaskListType(val)
		return nil
	}
}

// MarshalText encodes TaskListType 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 TaskListType) MarshalText() ([]byte, error) {
	switch int32(v) {
	case 0:
		return []byte("Decision"), nil
	case 1:
		return []byte("Activity"), nil
	}
	return []byte(strconv.FormatInt(int64(v), 10)), nil
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of TaskListType.
// 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 TaskListType) MarshalLogObject(enc zapcore.ObjectEncoder) error {
	enc.AddInt32("value", int32(v))
	switch int32(v) {
	case 0:
		enc.AddString("name", "Decision")
	case 1:
		enc.AddString("name", "Activity")
	}
	return nil
}

// Ptr returns a pointer to this enum value.
func (v TaskListType) Ptr() *TaskListType {
	return &v
}

// ToWire translates TaskListType 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 TaskListType) ToWire() (wire.Value, error) {
	return wire.NewValueI32(int32(v)), nil
}

// FromWire deserializes TaskListType from its Thrift-level
// representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TI32)
//	if err != nil {
//	  return TaskListType(0), err
//	}
//
//	var v TaskListType
//	if err := v.FromWire(x); err != nil {
//	  return TaskListType(0), err
//	}
//	return v, nil
func (v *TaskListType) FromWire(w wire.Value) error {
	*v = (TaskListType)(w.GetI32())
	return nil
}

// String returns a readable string representation of TaskListType.
func (v TaskListType) String() string {
	w := int32(v)
	switch w {
	case 0:
		return "Decision"
	case 1:
		return "Activity"
	}
	return fmt.Sprintf("TaskListType(%d)", w)
}

// Equals returns true if this TaskListType value matches the provided
// value.
func (v TaskListType) Equals(rhs TaskListType) bool {
	return v == rhs
}

// MarshalJSON serializes TaskListType into JSON.
//
// If the enum value is recognized, its name is returned. Otherwise,
// its integer value is returned.
//
// This implements json.Marshaler.
func (v TaskListType) MarshalJSON() ([]byte, error) {
	switch int32(v) {
	case 0:
		return ([]byte)("\"Decision\""), nil
	case 1:
		return ([]byte)("\"Activity\""), nil
	}
	return ([]byte)(strconv.FormatInt(int64(v), 10)), nil
}

// UnmarshalJSON attempts to decode TaskListType 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 *TaskListType) 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, "TaskListType")
		}
		if x < math.MinInt32 {
			return fmt.Errorf("enum underflow from JSON %q for %q", text, "TaskListType")
		}
		*v = (TaskListType)(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, "TaskListType")
	}
}

type TaskRange struct {
	InclusiveMin *TaskKey `json:"inclusiveMin,omitempty"`
	ExclusiveMax *TaskKey `json:"exclusiveMax,omitempty"`
}

// ToWire translates a TaskRange 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 *TaskRange) ToWire() (wire.Value, error) {
	var (
		fields [2]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.InclusiveMin != nil {
		w, err = v.InclusiveMin.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.ExclusiveMax != nil {
		w, err = v.ExclusiveMax.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 TaskRange 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 TaskRange struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v TaskRange
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *TaskRange) 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.InclusiveMin, err = _TaskKey_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 20:
			if field.Value.Type() == wire.TStruct {
				v.ExclusiveMax, err = _TaskKey_Read(field.Value)
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a TaskRange
// struct.
func (v *TaskRange) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [2]string
	i := 0
	if v.InclusiveMin != nil {
		fields[i] = fmt.Sprintf("InclusiveMin: %v", v.InclusiveMin)
		i++
	}
	if v.ExclusiveMax != nil {
		fields[i] = fmt.Sprintf("ExclusiveMax: %v", v.ExclusiveMax)
		i++
	}

	return fmt.Sprintf("TaskRange{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this TaskRange match the
// provided TaskRange.
//
// This function performs a deep comparison.
func (v *TaskRange) Equals(rhs *TaskRange) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !((v.InclusiveMin == nil && rhs.InclusiveMin == nil) || (v.InclusiveMin != nil && rhs.InclusiveMin != nil && v.InclusiveMin.Equals(rhs.InclusiveMin))) {
		return false
	}
	if !((v.ExclusiveMax == nil && rhs.ExclusiveMax == nil) || (v.ExclusiveMax != nil && rhs.ExclusiveMax != nil && v.ExclusiveMax.Equals(rhs.ExclusiveMax))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of TaskRange.
func (v *TaskRange) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.InclusiveMin != nil {
		err = multierr.Append(err, enc.AddObject("inclusiveMin", v.InclusiveMin))
	}
	if v.ExclusiveMax != nil {
		err = multierr.Append(err, enc.AddObject("exclusiveMax", v.ExclusiveMax))
	}
	return err
}

// GetInclusiveMin returns the value of InclusiveMin if it is set or its
// zero value if it is unset.
func (v *TaskRange) GetInclusiveMin() (o *TaskKey) {
	if v != nil && v.InclusiveMin != nil {
		return v.InclusiveMin
	}

	return
}

// IsSetInclusiveMin returns true if InclusiveMin is not nil.
func (v *TaskRange) IsSetInclusiveMin() bool {
	return v != nil && v.InclusiveMin != nil
}

// GetExclusiveMax returns the value of ExclusiveMax if it is set or its
// zero value if it is unset.
func (v *TaskRange) GetExclusiveMax() (o *TaskKey) {
	if v != nil && v.ExclusiveMax != nil {
		return v.ExclusiveMax
	}

	return
}

// IsSetExclusiveMax returns true if ExclusiveMax is not nil.
func (v *TaskRange) IsSetExclusiveMax() bool {
	return v != nil && v.ExclusiveMax != nil
}

type TerminateWorkflowExecutionRequest struct {
	Domain              *string            `json:"domain,omitempty"`
	WorkflowExecution   *WorkflowExecution `json:"workflowExecution,omitempty"`
	Reason              *string            `json:"reason,omitempty"`
	Details             []byte             `json:"details,omitempty"`
	Identity            *string            `json:"identity,omitempty"`
	FirstExecutionRunID *string            `json:"firstExecutionRunID,omitempty"`
}

// ToWire translates a TerminateWorkflowExecutionRequest 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 *TerminateWorkflowExecutionRequest) ToWire() (wire.Value, error) {
	var (
		fields [6]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.WorkflowExecution != nil {
		w, err = v.WorkflowExecution.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.Reason != nil {
		w, err = wire.NewValueString(*(v.Reason)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.Details != nil {
		w, err = wire.NewValueBinary(v.Details), 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++
	}
	if v.FirstExecutionRunID != nil {
		w, err = wire.NewValueString(*(v.FirstExecutionRunID)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 60, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

// FromWire deserializes a TerminateWorkflowExecutionRequest 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 TerminateWorkflowExecutionRequest struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v TerminateWorkflowExecutionRequest
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *TerminateWorkflowExecutionRequest) 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.WorkflowExecution, 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.Reason = &x
				if err != nil {
					return err
				}

			}
		case 40:
			if field.Value.Type() == wire.TBinary {
				v.Details, err = field.Value.GetBinary(), error(nil)
				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
				}

			}
		case 60:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.FirstExecutionRunID = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a TerminateWorkflowExecutionRequest
// struct.
func (v *TerminateWorkflowExecutionRequest) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [6]string
	i := 0
	if v.Domain != nil {
		fields[i] = fmt.Sprintf("Domain: %v", *(v.Domain))
		i++
	}
	if v.WorkflowExecution != nil {
		fields[i] = fmt.Sprintf("WorkflowExecution: %v", v.WorkflowExecution)
		i++
	}
	if v.Reason != nil {
		fields[i] = fmt.Sprintf("Reason: %v", *(v.Reason))
		i++
	}
	if v.Details != nil {
		fields[i] = fmt.Sprintf("Details: %v", v.Details)
		i++
	}
	if v.Identity != nil {
		fields[i] = fmt.Sprintf("Identity: %v", *(v.Identity))
		i++
	}
	if v.FirstExecutionRunID != nil {
		fields[i] = fmt.Sprintf("FirstExecutionRunID: %v", *(v.FirstExecutionRunID))
		i++
	}

	return fmt.Sprintf("TerminateWorkflowExecutionRequest{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this TerminateWorkflowExecutionRequest match the
// provided TerminateWorkflowExecutionRequest.
//
// This function performs a deep comparison.
func (v *TerminateWorkflowExecutionRequest) Equals(rhs *TerminateWorkflowExecutionRequest) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.Domain, rhs.Domain) {
		return false
	}
	if !((v.WorkflowExecution == nil && rhs.WorkflowExecution == nil) || (v.WorkflowExecution != nil && rhs.WorkflowExecution != nil && v.WorkflowExecution.Equals(rhs.WorkflowExecution))) {
		return false
	}
	if !_String_EqualsPtr(v.Reason, rhs.Reason) {
		return false
	}
	if !((v.Details == nil && rhs.Details == nil) || (v.Details != nil && rhs.Details != nil && bytes.Equal(v.Details, rhs.Details))) {
		return false
	}
	if !_String_EqualsPtr(v.Identity, rhs.Identity) {
		return false
	}
	if !_String_EqualsPtr(v.FirstExecutionRunID, rhs.FirstExecutionRunID) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of TerminateWorkflowExecutionRequest.
func (v *TerminateWorkflowExecutionRequest) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Domain != nil {
		enc.AddString("domain", *v.Domain)
	}
	if v.WorkflowExecution != nil {
		err = multierr.Append(err, enc.AddObject("workflowExecution", v.WorkflowExecution))
	}
	if v.Reason != nil {
		enc.AddString("reason", *v.Reason)
	}
	if v.Details != nil {
		enc.AddString("details", base64.StdEncoding.EncodeToString(v.Details))
	}
	if v.Identity != nil {
		enc.AddString("identity", *v.Identity)
	}
	if v.FirstExecutionRunID != nil {
		enc.AddString("firstExecutionRunID", *v.FirstExecutionRunID)
	}
	return err
}

// GetDomain returns the value of Domain if it is set or its
// zero value if it is unset.
func (v *TerminateWorkflowExecutionRequest) GetDomain() (o string) {
	if v != nil && v.Domain != nil {
		return *v.Domain
	}

	return
}

// IsSetDomain returns true if Domain is not nil.
func (v *TerminateWorkflowExecutionRequest) IsSetDomain() bool {
	return v != nil && v.Domain != nil
}

// GetWorkflowExecution returns the value of WorkflowExecution if it is set or its
// zero value if it is unset.
func (v *TerminateWorkflowExecutionRequest) GetWorkflowExecution() (o *WorkflowExecution) {
	if v != nil && v.WorkflowExecution != nil {
		return v.WorkflowExecution
	}

	return
}

// IsSetWorkflowExecution returns true if WorkflowExecution is not nil.
func (v *TerminateWorkflowExecutionRequest) IsSetWorkflowExecution() bool {
	return v != nil && v.WorkflowExecution != nil
}

// GetReason returns the value of Reason if it is set or its
// zero value if it is unset.
func (v *TerminateWorkflowExecutionRequest) GetReason() (o string) {
	if v != nil && v.Reason != nil {
		return *v.Reason
	}

	return
}

// IsSetReason returns true if Reason is not nil.
func (v *TerminateWorkflowExecutionRequest) IsSetReason() bool {
	return v != nil && v.Reason != nil
}

// GetDetails returns the value of Details if it is set or its
// zero value if it is unset.
func (v *TerminateWorkflowExecutionRequest) GetDetails() (o []byte) {
	if v != nil && v.Details != nil {
		return v.Details
	}

	return
}

// IsSetDetails returns true if Details is not nil.
func (v *TerminateWorkflowExecutionRequest) IsSetDetails() bool {
	return v != nil && v.Details != nil
}

// GetIdentity returns the value of Identity if it is set or its
// zero value if it is unset.
func (v *TerminateWorkflowExecutionRequest) GetIdentity() (o string) {
	if v != nil && v.Identity != nil {
		return *v.Identity
	}

	return
}

// IsSetIdentity returns true if Identity is not nil.
func (v *TerminateWorkflowExecutionRequest) IsSetIdentity() bool {
	return v != nil && v.Identity != nil
}

// GetFirstExecutionRunID returns the value of FirstExecutionRunID if it is set or its
// zero value if it is unset.
func (v *TerminateWorkflowExecutionRequest) GetFirstExecutionRunID() (o string) {
	if v != nil && v.FirstExecutionRunID != nil {
		return *v.FirstExecutionRunID
	}

	return
}

// IsSetFirstExecutionRunID returns true if FirstExecutionRunID is not nil.
func (v *TerminateWorkflowExecutionRequest) IsSetFirstExecutionRunID() bool {
	return v != nil && v.FirstExecutionRunID != nil
}

type TimeoutType int32

const (
	TimeoutTypeStartToClose    TimeoutType = 0
	TimeoutTypeScheduleToStart TimeoutType = 1
	TimeoutTypeScheduleToClose TimeoutType = 2
	TimeoutTypeHeartbeat       TimeoutType = 3
)

// TimeoutType_Values returns all recognized values of TimeoutType.
func TimeoutType_Values() []TimeoutType {
	return []TimeoutType{
		TimeoutTypeStartToClose,
		TimeoutTypeScheduleToStart,
		TimeoutTypeScheduleToClose,
		TimeoutTypeHeartbeat,
	}
}

// UnmarshalText tries to decode TimeoutType from a byte slice
// containing its name.
//
//	var v TimeoutType
//	err := v.UnmarshalText([]byte("START_TO_CLOSE"))
func (v *TimeoutType) UnmarshalText(value []byte) error {
	switch s := string(value); s {
	case "START_TO_CLOSE":
		*v = TimeoutTypeStartToClose
		return nil
	case "SCHEDULE_TO_START":
		*v = TimeoutTypeScheduleToStart
		return nil
	case "SCHEDULE_TO_CLOSE":
		*v = TimeoutTypeScheduleToClose
		return nil
	case "HEARTBEAT":
		*v = TimeoutTypeHeartbeat
		return nil
	default:
		val, err := strconv.ParseInt(s, 10, 32)
		if err != nil {
			return fmt.Errorf("unknown enum value %q for %q: %v", s, "TimeoutType", err)
		}
		*v = TimeoutType(val)
		return nil
	}
}

// MarshalText encodes TimeoutType 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 TimeoutType) MarshalText() ([]byte, error) {
	switch int32(v) {
	case 0:
		return []byte("START_TO_CLOSE"), nil
	case 1:
		return []byte("SCHEDULE_TO_START"), nil
	case 2:
		return []byte("SCHEDULE_TO_CLOSE"), nil
	case 3:
		return []byte("HEARTBEAT"), nil
	}
	return []byte(strconv.FormatInt(int64(v), 10)), nil
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of TimeoutType.
// 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 TimeoutType) MarshalLogObject(enc zapcore.ObjectEncoder) error {
	enc.AddInt32("value", int32(v))
	switch int32(v) {
	case 0:
		enc.AddString("name", "START_TO_CLOSE")
	case 1:
		enc.AddString("name", "SCHEDULE_TO_START")
	case 2:
		enc.AddString("name", "SCHEDULE_TO_CLOSE")
	case 3:
		enc.AddString("name", "HEARTBEAT")
	}
	return nil
}

// Ptr returns a pointer to this enum value.
func (v TimeoutType) Ptr() *TimeoutType {
	return &v
}

// ToWire translates TimeoutType 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 TimeoutType) ToWire() (wire.Value, error) {
	return wire.NewValueI32(int32(v)), nil
}

// FromWire deserializes TimeoutType from its Thrift-level
// representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TI32)
//	if err != nil {
//	  return TimeoutType(0), err
//	}
//
//	var v TimeoutType
//	if err := v.FromWire(x); err != nil {
//	  return TimeoutType(0), err
//	}
//	return v, nil
func (v *TimeoutType) FromWire(w wire.Value) error {
	*v = (TimeoutType)(w.GetI32())
	return nil
}

// String returns a readable string representation of TimeoutType.
func (v TimeoutType) String() string {
	w := int32(v)
	switch w {
	case 0:
		return "START_TO_CLOSE"
	case 1:
		return "SCHEDULE_TO_START"
	case 2:
		return "SCHEDULE_TO_CLOSE"
	case 3:
		return "HEARTBEAT"
	}
	return fmt.Sprintf("TimeoutType(%d)", w)
}

// Equals returns true if this TimeoutType value matches the provided
// value.
func (v TimeoutType) Equals(rhs TimeoutType) bool {
	return v == rhs
}

// MarshalJSON serializes TimeoutType into JSON.
//
// If the enum value is recognized, its name is returned. Otherwise,
// its integer value is returned.
//
// This implements json.Marshaler.
func (v TimeoutType) MarshalJSON() ([]byte, error) {
	switch int32(v) {
	case 0:
		return ([]byte)("\"START_TO_CLOSE\""), nil
	case 1:
		return ([]byte)("\"SCHEDULE_TO_START\""), nil
	case 2:
		return ([]byte)("\"SCHEDULE_TO_CLOSE\""), nil
	case 3:
		return ([]byte)("\"HEARTBEAT\""), nil
	}
	return ([]byte)(strconv.FormatInt(int64(v), 10)), nil
}

// UnmarshalJSON attempts to decode TimeoutType 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 *TimeoutType) 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, "TimeoutType")
		}
		if x < math.MinInt32 {
			return fmt.Errorf("enum underflow from JSON %q for %q", text, "TimeoutType")
		}
		*v = (TimeoutType)(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, "TimeoutType")
	}
}

type TimerCanceledEventAttributes struct {
	TimerId                      *string `json:"timerId,omitempty"`
	StartedEventId               *int64  `json:"startedEventId,omitempty"`
	DecisionTaskCompletedEventId *int64  `json:"decisionTaskCompletedEventId,omitempty"`
	Identity                     *string `json:"identity,omitempty"`
}

// ToWire translates a TimerCanceledEventAttributes 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 *TimerCanceledEventAttributes) ToWire() (wire.Value, error) {
	var (
		fields [4]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.TimerId != nil {
		w, err = wire.NewValueString(*(v.TimerId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, 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: 20, 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: 30, 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: 40, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

// FromWire deserializes a TimerCanceledEventAttributes 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 TimerCanceledEventAttributes struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v TimerCanceledEventAttributes
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *TimerCanceledEventAttributes) 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.TimerId = &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.StartedEventId = &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.DecisionTaskCompletedEventId = &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.Identity = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a TimerCanceledEventAttributes
// struct.
func (v *TimerCanceledEventAttributes) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [4]string
	i := 0
	if v.TimerId != nil {
		fields[i] = fmt.Sprintf("TimerId: %v", *(v.TimerId))
		i++
	}
	if v.StartedEventId != nil {
		fields[i] = fmt.Sprintf("StartedEventId: %v", *(v.StartedEventId))
		i++
	}
	if v.DecisionTaskCompletedEventId != nil {
		fields[i] = fmt.Sprintf("DecisionTaskCompletedEventId: %v", *(v.DecisionTaskCompletedEventId))
		i++
	}
	if v.Identity != nil {
		fields[i] = fmt.Sprintf("Identity: %v", *(v.Identity))
		i++
	}

	return fmt.Sprintf("TimerCanceledEventAttributes{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this TimerCanceledEventAttributes match the
// provided TimerCanceledEventAttributes.
//
// This function performs a deep comparison.
func (v *TimerCanceledEventAttributes) Equals(rhs *TimerCanceledEventAttributes) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.TimerId, rhs.TimerId) {
		return false
	}
	if !_I64_EqualsPtr(v.StartedEventId, rhs.StartedEventId) {
		return false
	}
	if !_I64_EqualsPtr(v.DecisionTaskCompletedEventId, rhs.DecisionTaskCompletedEventId) {
		return false
	}
	if !_String_EqualsPtr(v.Identity, rhs.Identity) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of TimerCanceledEventAttributes.
func (v *TimerCanceledEventAttributes) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.TimerId != nil {
		enc.AddString("timerId", *v.TimerId)
	}
	if v.StartedEventId != nil {
		enc.AddInt64("startedEventId", *v.StartedEventId)
	}
	if v.DecisionTaskCompletedEventId != nil {
		enc.AddInt64("decisionTaskCompletedEventId", *v.DecisionTaskCompletedEventId)
	}
	if v.Identity != nil {
		enc.AddString("identity", *v.Identity)
	}
	return err
}

// GetTimerId returns the value of TimerId if it is set or its
// zero value if it is unset.
func (v *TimerCanceledEventAttributes) GetTimerId() (o string) {
	if v != nil && v.TimerId != nil {
		return *v.TimerId
	}

	return
}

// IsSetTimerId returns true if TimerId is not nil.
func (v *TimerCanceledEventAttributes) IsSetTimerId() bool {
	return v != nil && v.TimerId != nil
}

// GetStartedEventId returns the value of StartedEventId if it is set or its
// zero value if it is unset.
func (v *TimerCanceledEventAttributes) GetStartedEventId() (o int64) {
	if v != nil && v.StartedEventId != nil {
		return *v.StartedEventId
	}

	return
}

// IsSetStartedEventId returns true if StartedEventId is not nil.
func (v *TimerCanceledEventAttributes) IsSetStartedEventId() bool {
	return v != nil && v.StartedEventId != nil
}

// GetDecisionTaskCompletedEventId returns the value of DecisionTaskCompletedEventId if it is set or its
// zero value if it is unset.
func (v *TimerCanceledEventAttributes) GetDecisionTaskCompletedEventId() (o int64) {
	if v != nil && v.DecisionTaskCompletedEventId != nil {
		return *v.DecisionTaskCompletedEventId
	}

	return
}

// IsSetDecisionTaskCompletedEventId returns true if DecisionTaskCompletedEventId is not nil.
func (v *TimerCanceledEventAttributes) IsSetDecisionTaskCompletedEventId() bool {
	return v != nil && v.DecisionTaskCompletedEventId != nil
}

// GetIdentity returns the value of Identity if it is set or its
// zero value if it is unset.
func (v *TimerCanceledEventAttributes) GetIdentity() (o string) {
	if v != nil && v.Identity != nil {
		return *v.Identity
	}

	return
}

// IsSetIdentity returns true if Identity is not nil.
func (v *TimerCanceledEventAttributes) IsSetIdentity() bool {
	return v != nil && v.Identity != nil
}

type TimerFiredEventAttributes struct {
	TimerId        *string `json:"timerId,omitempty"`
	StartedEventId *int64  `json:"startedEventId,omitempty"`
}

// ToWire translates a TimerFiredEventAttributes 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 *TimerFiredEventAttributes) ToWire() (wire.Value, error) {
	var (
		fields [2]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.TimerId != nil {
		w, err = wire.NewValueString(*(v.TimerId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, 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: 20, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

// FromWire deserializes a TimerFiredEventAttributes 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 TimerFiredEventAttributes struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v TimerFiredEventAttributes
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *TimerFiredEventAttributes) 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.TimerId = &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.StartedEventId = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a TimerFiredEventAttributes
// struct.
func (v *TimerFiredEventAttributes) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [2]string
	i := 0
	if v.TimerId != nil {
		fields[i] = fmt.Sprintf("TimerId: %v", *(v.TimerId))
		i++
	}
	if v.StartedEventId != nil {
		fields[i] = fmt.Sprintf("StartedEventId: %v", *(v.StartedEventId))
		i++
	}

	return fmt.Sprintf("TimerFiredEventAttributes{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this TimerFiredEventAttributes match the
// provided TimerFiredEventAttributes.
//
// This function performs a deep comparison.
func (v *TimerFiredEventAttributes) Equals(rhs *TimerFiredEventAttributes) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.TimerId, rhs.TimerId) {
		return false
	}
	if !_I64_EqualsPtr(v.StartedEventId, rhs.StartedEventId) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of TimerFiredEventAttributes.
func (v *TimerFiredEventAttributes) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.TimerId != nil {
		enc.AddString("timerId", *v.TimerId)
	}
	if v.StartedEventId != nil {
		enc.AddInt64("startedEventId", *v.StartedEventId)
	}
	return err
}

// GetTimerId returns the value of TimerId if it is set or its
// zero value if it is unset.
func (v *TimerFiredEventAttributes) GetTimerId() (o string) {
	if v != nil && v.TimerId != nil {
		return *v.TimerId
	}

	return
}

// IsSetTimerId returns true if TimerId is not nil.
func (v *TimerFiredEventAttributes) IsSetTimerId() bool {
	return v != nil && v.TimerId != nil
}

// GetStartedEventId returns the value of StartedEventId if it is set or its
// zero value if it is unset.
func (v *TimerFiredEventAttributes) GetStartedEventId() (o int64) {
	if v != nil && v.StartedEventId != nil {
		return *v.StartedEventId
	}

	return
}

// IsSetStartedEventId returns true if StartedEventId is not nil.
func (v *TimerFiredEventAttributes) IsSetStartedEventId() bool {
	return v != nil && v.StartedEventId != nil
}

type TimerStartedEventAttributes struct {
	TimerId                      *string `json:"timerId,omitempty"`
	StartToFireTimeoutSeconds    *int64  `json:"startToFireTimeoutSeconds,omitempty"`
	DecisionTaskCompletedEventId *int64  `json:"decisionTaskCompletedEventId,omitempty"`
}

// ToWire translates a TimerStartedEventAttributes 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 *TimerStartedEventAttributes) ToWire() (wire.Value, error) {
	var (
		fields [3]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.TimerId != nil {
		w, err = wire.NewValueString(*(v.TimerId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.StartToFireTimeoutSeconds != nil {
		w, err = wire.NewValueI64(*(v.StartToFireTimeoutSeconds)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, 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: 30, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

// FromWire deserializes a TimerStartedEventAttributes 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 TimerStartedEventAttributes struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v TimerStartedEventAttributes
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *TimerStartedEventAttributes) 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.TimerId = &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.StartToFireTimeoutSeconds = &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.DecisionTaskCompletedEventId = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a TimerStartedEventAttributes
// struct.
func (v *TimerStartedEventAttributes) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [3]string
	i := 0
	if v.TimerId != nil {
		fields[i] = fmt.Sprintf("TimerId: %v", *(v.TimerId))
		i++
	}
	if v.StartToFireTimeoutSeconds != nil {
		fields[i] = fmt.Sprintf("StartToFireTimeoutSeconds: %v", *(v.StartToFireTimeoutSeconds))
		i++
	}
	if v.DecisionTaskCompletedEventId != nil {
		fields[i] = fmt.Sprintf("DecisionTaskCompletedEventId: %v", *(v.DecisionTaskCompletedEventId))
		i++
	}

	return fmt.Sprintf("TimerStartedEventAttributes{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this TimerStartedEventAttributes match the
// provided TimerStartedEventAttributes.
//
// This function performs a deep comparison.
func (v *TimerStartedEventAttributes) Equals(rhs *TimerStartedEventAttributes) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.TimerId, rhs.TimerId) {
		return false
	}
	if !_I64_EqualsPtr(v.StartToFireTimeoutSeconds, rhs.StartToFireTimeoutSeconds) {
		return false
	}
	if !_I64_EqualsPtr(v.DecisionTaskCompletedEventId, rhs.DecisionTaskCompletedEventId) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of TimerStartedEventAttributes.
func (v *TimerStartedEventAttributes) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.TimerId != nil {
		enc.AddString("timerId", *v.TimerId)
	}
	if v.StartToFireTimeoutSeconds != nil {
		enc.AddInt64("startToFireTimeoutSeconds", *v.StartToFireTimeoutSeconds)
	}
	if v.DecisionTaskCompletedEventId != nil {
		enc.AddInt64("decisionTaskCompletedEventId", *v.DecisionTaskCompletedEventId)
	}
	return err
}

// GetTimerId returns the value of TimerId if it is set or its
// zero value if it is unset.
func (v *TimerStartedEventAttributes) GetTimerId() (o string) {
	if v != nil && v.TimerId != nil {
		return *v.TimerId
	}

	return
}

// IsSetTimerId returns true if TimerId is not nil.
func (v *TimerStartedEventAttributes) IsSetTimerId() bool {
	return v != nil && v.TimerId != nil
}

// GetStartToFireTimeoutSeconds returns the value of StartToFireTimeoutSeconds if it is set or its
// zero value if it is unset.
func (v *TimerStartedEventAttributes) GetStartToFireTimeoutSeconds() (o int64) {
	if v != nil && v.StartToFireTimeoutSeconds != nil {
		return *v.StartToFireTimeoutSeconds
	}

	return
}

// IsSetStartToFireTimeoutSeconds returns true if StartToFireTimeoutSeconds is not nil.
func (v *TimerStartedEventAttributes) IsSetStartToFireTimeoutSeconds() bool {
	return v != nil && v.StartToFireTimeoutSeconds != nil
}

// GetDecisionTaskCompletedEventId returns the value of DecisionTaskCompletedEventId if it is set or its
// zero value if it is unset.
func (v *TimerStartedEventAttributes) GetDecisionTaskCompletedEventId() (o int64) {
	if v != nil && v.DecisionTaskCompletedEventId != nil {
		return *v.DecisionTaskCompletedEventId
	}

	return
}

// IsSetDecisionTaskCompletedEventId returns true if DecisionTaskCompletedEventId is not nil.
func (v *TimerStartedEventAttributes) IsSetDecisionTaskCompletedEventId() bool {
	return v != nil && v.DecisionTaskCompletedEventId != nil
}

type TransientDecisionInfo struct {
	ScheduledEvent *HistoryEvent `json:"scheduledEvent,omitempty"`
	StartedEvent   *HistoryEvent `json:"startedEvent,omitempty"`
}

// ToWire translates a TransientDecisionInfo 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 *TransientDecisionInfo) ToWire() (wire.Value, error) {
	var (
		fields [2]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.StartedEvent != nil {
		w, err = v.StartedEvent.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 TransientDecisionInfo 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 TransientDecisionInfo struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v TransientDecisionInfo
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *TransientDecisionInfo) 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.TStruct {
				v.StartedEvent, err = _HistoryEvent_Read(field.Value)
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a TransientDecisionInfo
// struct.
func (v *TransientDecisionInfo) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [2]string
	i := 0
	if v.ScheduledEvent != nil {
		fields[i] = fmt.Sprintf("ScheduledEvent: %v", v.ScheduledEvent)
		i++
	}
	if v.StartedEvent != nil {
		fields[i] = fmt.Sprintf("StartedEvent: %v", v.StartedEvent)
		i++
	}

	return fmt.Sprintf("TransientDecisionInfo{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this TransientDecisionInfo match the
// provided TransientDecisionInfo.
//
// This function performs a deep comparison.
func (v *TransientDecisionInfo) Equals(rhs *TransientDecisionInfo) 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 !((v.StartedEvent == nil && rhs.StartedEvent == nil) || (v.StartedEvent != nil && rhs.StartedEvent != nil && v.StartedEvent.Equals(rhs.StartedEvent))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of TransientDecisionInfo.
func (v *TransientDecisionInfo) 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.StartedEvent != nil {
		err = multierr.Append(err, enc.AddObject("startedEvent", v.StartedEvent))
	}
	return err
}

// GetScheduledEvent returns the value of ScheduledEvent if it is set or its
// zero value if it is unset.
func (v *TransientDecisionInfo) GetScheduledEvent() (o *HistoryEvent) {
	if v != nil && v.ScheduledEvent != nil {
		return v.ScheduledEvent
	}

	return
}

// IsSetScheduledEvent returns true if ScheduledEvent is not nil.
func (v *TransientDecisionInfo) IsSetScheduledEvent() bool {
	return v != nil && v.ScheduledEvent != nil
}

// GetStartedEvent returns the value of StartedEvent if it is set or its
// zero value if it is unset.
func (v *TransientDecisionInfo) GetStartedEvent() (o *HistoryEvent) {
	if v != nil && v.StartedEvent != nil {
		return v.StartedEvent
	}

	return
}

// IsSetStartedEvent returns true if StartedEvent is not nil.
func (v *TransientDecisionInfo) IsSetStartedEvent() bool {
	return v != nil && v.StartedEvent != nil
}

type UpdateDomainInfo struct {
	Description *string           `json:"description,omitempty"`
	OwnerEmail  *string           `json:"ownerEmail,omitempty"`
	Data        map[string]string `json:"data,omitempty"`
}

// ToWire translates a UpdateDomainInfo 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 *UpdateDomainInfo) ToWire() (wire.Value, error) {
	var (
		fields [3]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.Description != nil {
		w, err = wire.NewValueString(*(v.Description)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.OwnerEmail != nil {
		w, err = wire.NewValueString(*(v.OwnerEmail)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.Data != nil {
		w, err = wire.NewValueMap(_Map_String_String_MapItemList(v.Data)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

// FromWire deserializes a UpdateDomainInfo 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 UpdateDomainInfo struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v UpdateDomainInfo
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *UpdateDomainInfo) 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.Description = &x
				if err != nil {
					return err
				}

			}
		case 20:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.OwnerEmail = &x
				if err != nil {
					return err
				}

			}
		case 30:
			if field.Value.Type() == wire.TMap {
				v.Data, err = _Map_String_String_Read(field.Value.GetMap())
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a UpdateDomainInfo
// struct.
func (v *UpdateDomainInfo) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [3]string
	i := 0
	if v.Description != nil {
		fields[i] = fmt.Sprintf("Description: %v", *(v.Description))
		i++
	}
	if v.OwnerEmail != nil {
		fields[i] = fmt.Sprintf("OwnerEmail: %v", *(v.OwnerEmail))
		i++
	}
	if v.Data != nil {
		fields[i] = fmt.Sprintf("Data: %v", v.Data)
		i++
	}

	return fmt.Sprintf("UpdateDomainInfo{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this UpdateDomainInfo match the
// provided UpdateDomainInfo.
//
// This function performs a deep comparison.
func (v *UpdateDomainInfo) Equals(rhs *UpdateDomainInfo) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.Description, rhs.Description) {
		return false
	}
	if !_String_EqualsPtr(v.OwnerEmail, rhs.OwnerEmail) {
		return false
	}
	if !((v.Data == nil && rhs.Data == nil) || (v.Data != nil && rhs.Data != nil && _Map_String_String_Equals(v.Data, rhs.Data))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of UpdateDomainInfo.
func (v *UpdateDomainInfo) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Description != nil {
		enc.AddString("description", *v.Description)
	}
	if v.OwnerEmail != nil {
		enc.AddString("ownerEmail", *v.OwnerEmail)
	}
	if v.Data != nil {
		err = multierr.Append(err, enc.AddObject("data", (_Map_String_String_Zapper)(v.Data)))
	}
	return err
}

// GetDescription returns the value of Description if it is set or its
// zero value if it is unset.
func (v *UpdateDomainInfo) GetDescription() (o string) {
	if v != nil && v.Description != nil {
		return *v.Description
	}

	return
}

// IsSetDescription returns true if Description is not nil.
func (v *UpdateDomainInfo) IsSetDescription() bool {
	return v != nil && v.Description != nil
}

// GetOwnerEmail returns the value of OwnerEmail if it is set or its
// zero value if it is unset.
func (v *UpdateDomainInfo) GetOwnerEmail() (o string) {
	if v != nil && v.OwnerEmail != nil {
		return *v.OwnerEmail
	}

	return
}

// IsSetOwnerEmail returns true if OwnerEmail is not nil.
func (v *UpdateDomainInfo) IsSetOwnerEmail() bool {
	return v != nil && v.OwnerEmail != nil
}

// GetData returns the value of Data if it is set or its
// zero value if it is unset.
func (v *UpdateDomainInfo) GetData() (o map[string]string) {
	if v != nil && v.Data != nil {
		return v.Data
	}

	return
}

// IsSetData returns true if Data is not nil.
func (v *UpdateDomainInfo) IsSetData() bool {
	return v != nil && v.Data != nil
}

type UpdateDomainRequest struct {
	Name                     *string                         `json:"name,omitempty"`
	UpdatedInfo              *UpdateDomainInfo               `json:"updatedInfo,omitempty"`
	Configuration            *DomainConfiguration            `json:"configuration,omitempty"`
	ReplicationConfiguration *DomainReplicationConfiguration `json:"replicationConfiguration,omitempty"`
	SecurityToken            *string                         `json:"securityToken,omitempty"`
	DeleteBadBinary          *string                         `json:"deleteBadBinary,omitempty"`
	FailoverTimeoutInSeconds *int32                          `json:"failoverTimeoutInSeconds,omitempty"`
}

// ToWire translates a UpdateDomainRequest 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 *UpdateDomainRequest) ToWire() (wire.Value, error) {
	var (
		fields [7]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.Name != nil {
		w, err = wire.NewValueString(*(v.Name)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.UpdatedInfo != nil {
		w, err = v.UpdatedInfo.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.Configuration != nil {
		w, err = v.Configuration.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.ReplicationConfiguration != nil {
		w, err = v.ReplicationConfiguration.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 40, Value: w}
		i++
	}
	if v.SecurityToken != nil {
		w, err = wire.NewValueString(*(v.SecurityToken)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 50, Value: w}
		i++
	}
	if v.DeleteBadBinary != nil {
		w, err = wire.NewValueString(*(v.DeleteBadBinary)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 60, Value: w}
		i++
	}
	if v.FailoverTimeoutInSeconds != nil {
		w, err = wire.NewValueI32(*(v.FailoverTimeoutInSeconds)), 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
}

func _UpdateDomainInfo_Read(w wire.Value) (*UpdateDomainInfo, error) {
	var v UpdateDomainInfo
	err := v.FromWire(w)
	return &v, err
}

// FromWire deserializes a UpdateDomainRequest 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 UpdateDomainRequest struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v UpdateDomainRequest
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *UpdateDomainRequest) 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.Name = &x
				if err != nil {
					return err
				}

			}
		case 20:
			if field.Value.Type() == wire.TStruct {
				v.UpdatedInfo, err = _UpdateDomainInfo_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 30:
			if field.Value.Type() == wire.TStruct {
				v.Configuration, err = _DomainConfiguration_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 40:
			if field.Value.Type() == wire.TStruct {
				v.ReplicationConfiguration, err = _DomainReplicationConfiguration_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 50:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.SecurityToken = &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.DeleteBadBinary = &x
				if err != nil {
					return err
				}

			}
		case 70:
			if field.Value.Type() == wire.TI32 {
				var x int32
				x, err = field.Value.GetI32(), error(nil)
				v.FailoverTimeoutInSeconds = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a UpdateDomainRequest
// struct.
func (v *UpdateDomainRequest) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [7]string
	i := 0
	if v.Name != nil {
		fields[i] = fmt.Sprintf("Name: %v", *(v.Name))
		i++
	}
	if v.UpdatedInfo != nil {
		fields[i] = fmt.Sprintf("UpdatedInfo: %v", v.UpdatedInfo)
		i++
	}
	if v.Configuration != nil {
		fields[i] = fmt.Sprintf("Configuration: %v", v.Configuration)
		i++
	}
	if v.ReplicationConfiguration != nil {
		fields[i] = fmt.Sprintf("ReplicationConfiguration: %v", v.ReplicationConfiguration)
		i++
	}
	if v.SecurityToken != nil {
		fields[i] = fmt.Sprintf("SecurityToken: %v", *(v.SecurityToken))
		i++
	}
	if v.DeleteBadBinary != nil {
		fields[i] = fmt.Sprintf("DeleteBadBinary: %v", *(v.DeleteBadBinary))
		i++
	}
	if v.FailoverTimeoutInSeconds != nil {
		fields[i] = fmt.Sprintf("FailoverTimeoutInSeconds: %v", *(v.FailoverTimeoutInSeconds))
		i++
	}

	return fmt.Sprintf("UpdateDomainRequest{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this UpdateDomainRequest match the
// provided UpdateDomainRequest.
//
// This function performs a deep comparison.
func (v *UpdateDomainRequest) Equals(rhs *UpdateDomainRequest) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.Name, rhs.Name) {
		return false
	}
	if !((v.UpdatedInfo == nil && rhs.UpdatedInfo == nil) || (v.UpdatedInfo != nil && rhs.UpdatedInfo != nil && v.UpdatedInfo.Equals(rhs.UpdatedInfo))) {
		return false
	}
	if !((v.Configuration == nil && rhs.Configuration == nil) || (v.Configuration != nil && rhs.Configuration != nil && v.Configuration.Equals(rhs.Configuration))) {
		return false
	}
	if !((v.ReplicationConfiguration == nil && rhs.ReplicationConfiguration == nil) || (v.ReplicationConfiguration != nil && rhs.ReplicationConfiguration != nil && v.ReplicationConfiguration.Equals(rhs.ReplicationConfiguration))) {
		return false
	}
	if !_String_EqualsPtr(v.SecurityToken, rhs.SecurityToken) {
		return false
	}
	if !_String_EqualsPtr(v.DeleteBadBinary, rhs.DeleteBadBinary) {
		return false
	}
	if !_I32_EqualsPtr(v.FailoverTimeoutInSeconds, rhs.FailoverTimeoutInSeconds) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of UpdateDomainRequest.
func (v *UpdateDomainRequest) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Name != nil {
		enc.AddString("name", *v.Name)
	}
	if v.UpdatedInfo != nil {
		err = multierr.Append(err, enc.AddObject("updatedInfo", v.UpdatedInfo))
	}
	if v.Configuration != nil {
		err = multierr.Append(err, enc.AddObject("configuration", v.Configuration))
	}
	if v.ReplicationConfiguration != nil {
		err = multierr.Append(err, enc.AddObject("replicationConfiguration", v.ReplicationConfiguration))
	}
	if v.SecurityToken != nil {
		enc.AddString("securityToken", *v.SecurityToken)
	}
	if v.DeleteBadBinary != nil {
		enc.AddString("deleteBadBinary", *v.DeleteBadBinary)
	}
	if v.FailoverTimeoutInSeconds != nil {
		enc.AddInt32("failoverTimeoutInSeconds", *v.FailoverTimeoutInSeconds)
	}
	return err
}

// GetName returns the value of Name if it is set or its
// zero value if it is unset.
func (v *UpdateDomainRequest) GetName() (o string) {
	if v != nil && v.Name != nil {
		return *v.Name
	}

	return
}

// IsSetName returns true if Name is not nil.
func (v *UpdateDomainRequest) IsSetName() bool {
	return v != nil && v.Name != nil
}

// GetUpdatedInfo returns the value of UpdatedInfo if it is set or its
// zero value if it is unset.
func (v *UpdateDomainRequest) GetUpdatedInfo() (o *UpdateDomainInfo) {
	if v != nil && v.UpdatedInfo != nil {
		return v.UpdatedInfo
	}

	return
}

// IsSetUpdatedInfo returns true if UpdatedInfo is not nil.
func (v *UpdateDomainRequest) IsSetUpdatedInfo() bool {
	return v != nil && v.UpdatedInfo != nil
}

// GetConfiguration returns the value of Configuration if it is set or its
// zero value if it is unset.
func (v *UpdateDomainRequest) GetConfiguration() (o *DomainConfiguration) {
	if v != nil && v.Configuration != nil {
		return v.Configuration
	}

	return
}

// IsSetConfiguration returns true if Configuration is not nil.
func (v *UpdateDomainRequest) IsSetConfiguration() bool {
	return v != nil && v.Configuration != nil
}

// GetReplicationConfiguration returns the value of ReplicationConfiguration if it is set or its
// zero value if it is unset.
func (v *UpdateDomainRequest) GetReplicationConfiguration() (o *DomainReplicationConfiguration) {
	if v != nil && v.ReplicationConfiguration != nil {
		return v.ReplicationConfiguration
	}

	return
}

// IsSetReplicationConfiguration returns true if ReplicationConfiguration is not nil.
func (v *UpdateDomainRequest) IsSetReplicationConfiguration() bool {
	return v != nil && v.ReplicationConfiguration != nil
}

// GetSecurityToken returns the value of SecurityToken if it is set or its
// zero value if it is unset.
func (v *UpdateDomainRequest) GetSecurityToken() (o string) {
	if v != nil && v.SecurityToken != nil {
		return *v.SecurityToken
	}

	return
}

// IsSetSecurityToken returns true if SecurityToken is not nil.
func (v *UpdateDomainRequest) IsSetSecurityToken() bool {
	return v != nil && v.SecurityToken != nil
}

// GetDeleteBadBinary returns the value of DeleteBadBinary if it is set or its
// zero value if it is unset.
func (v *UpdateDomainRequest) GetDeleteBadBinary() (o string) {
	if v != nil && v.DeleteBadBinary != nil {
		return *v.DeleteBadBinary
	}

	return
}

// IsSetDeleteBadBinary returns true if DeleteBadBinary is not nil.
func (v *UpdateDomainRequest) IsSetDeleteBadBinary() bool {
	return v != nil && v.DeleteBadBinary != nil
}

// GetFailoverTimeoutInSeconds returns the value of FailoverTimeoutInSeconds if it is set or its
// zero value if it is unset.
func (v *UpdateDomainRequest) GetFailoverTimeoutInSeconds() (o int32) {
	if v != nil && v.FailoverTimeoutInSeconds != nil {
		return *v.FailoverTimeoutInSeconds
	}

	return
}

// IsSetFailoverTimeoutInSeconds returns true if FailoverTimeoutInSeconds is not nil.
func (v *UpdateDomainRequest) IsSetFailoverTimeoutInSeconds() bool {
	return v != nil && v.FailoverTimeoutInSeconds != nil
}

type UpdateDomainResponse struct {
	DomainInfo               *DomainInfo                     `json:"domainInfo,omitempty"`
	Configuration            *DomainConfiguration            `json:"configuration,omitempty"`
	ReplicationConfiguration *DomainReplicationConfiguration `json:"replicationConfiguration,omitempty"`
	FailoverVersion          *int64                          `json:"failoverVersion,omitempty"`
	IsGlobalDomain           *bool                           `json:"isGlobalDomain,omitempty"`
}

// ToWire translates a UpdateDomainResponse 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 *UpdateDomainResponse) ToWire() (wire.Value, error) {
	var (
		fields [5]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.DomainInfo != nil {
		w, err = v.DomainInfo.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.Configuration != nil {
		w, err = v.Configuration.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.ReplicationConfiguration != nil {
		w, err = v.ReplicationConfiguration.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.FailoverVersion != nil {
		w, err = wire.NewValueI64(*(v.FailoverVersion)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 40, Value: w}
		i++
	}
	if v.IsGlobalDomain != nil {
		w, err = wire.NewValueBool(*(v.IsGlobalDomain)), 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
}

// FromWire deserializes a UpdateDomainResponse 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 UpdateDomainResponse struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v UpdateDomainResponse
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *UpdateDomainResponse) 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.DomainInfo, err = _DomainInfo_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 20:
			if field.Value.Type() == wire.TStruct {
				v.Configuration, err = _DomainConfiguration_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 30:
			if field.Value.Type() == wire.TStruct {
				v.ReplicationConfiguration, err = _DomainReplicationConfiguration_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.FailoverVersion = &x
				if err != nil {
					return err
				}

			}
		case 50:
			if field.Value.Type() == wire.TBool {
				var x bool
				x, err = field.Value.GetBool(), error(nil)
				v.IsGlobalDomain = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a UpdateDomainResponse
// struct.
func (v *UpdateDomainResponse) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [5]string
	i := 0
	if v.DomainInfo != nil {
		fields[i] = fmt.Sprintf("DomainInfo: %v", v.DomainInfo)
		i++
	}
	if v.Configuration != nil {
		fields[i] = fmt.Sprintf("Configuration: %v", v.Configuration)
		i++
	}
	if v.ReplicationConfiguration != nil {
		fields[i] = fmt.Sprintf("ReplicationConfiguration: %v", v.ReplicationConfiguration)
		i++
	}
	if v.FailoverVersion != nil {
		fields[i] = fmt.Sprintf("FailoverVersion: %v", *(v.FailoverVersion))
		i++
	}
	if v.IsGlobalDomain != nil {
		fields[i] = fmt.Sprintf("IsGlobalDomain: %v", *(v.IsGlobalDomain))
		i++
	}

	return fmt.Sprintf("UpdateDomainResponse{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this UpdateDomainResponse match the
// provided UpdateDomainResponse.
//
// This function performs a deep comparison.
func (v *UpdateDomainResponse) Equals(rhs *UpdateDomainResponse) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !((v.DomainInfo == nil && rhs.DomainInfo == nil) || (v.DomainInfo != nil && rhs.DomainInfo != nil && v.DomainInfo.Equals(rhs.DomainInfo))) {
		return false
	}
	if !((v.Configuration == nil && rhs.Configuration == nil) || (v.Configuration != nil && rhs.Configuration != nil && v.Configuration.Equals(rhs.Configuration))) {
		return false
	}
	if !((v.ReplicationConfiguration == nil && rhs.ReplicationConfiguration == nil) || (v.ReplicationConfiguration != nil && rhs.ReplicationConfiguration != nil && v.ReplicationConfiguration.Equals(rhs.ReplicationConfiguration))) {
		return false
	}
	if !_I64_EqualsPtr(v.FailoverVersion, rhs.FailoverVersion) {
		return false
	}
	if !_Bool_EqualsPtr(v.IsGlobalDomain, rhs.IsGlobalDomain) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of UpdateDomainResponse.
func (v *UpdateDomainResponse) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.DomainInfo != nil {
		err = multierr.Append(err, enc.AddObject("domainInfo", v.DomainInfo))
	}
	if v.Configuration != nil {
		err = multierr.Append(err, enc.AddObject("configuration", v.Configuration))
	}
	if v.ReplicationConfiguration != nil {
		err = multierr.Append(err, enc.AddObject("replicationConfiguration", v.ReplicationConfiguration))
	}
	if v.FailoverVersion != nil {
		enc.AddInt64("failoverVersion", *v.FailoverVersion)
	}
	if v.IsGlobalDomain != nil {
		enc.AddBool("isGlobalDomain", *v.IsGlobalDomain)
	}
	return err
}

// GetDomainInfo returns the value of DomainInfo if it is set or its
// zero value if it is unset.
func (v *UpdateDomainResponse) GetDomainInfo() (o *DomainInfo) {
	if v != nil && v.DomainInfo != nil {
		return v.DomainInfo
	}

	return
}

// IsSetDomainInfo returns true if DomainInfo is not nil.
func (v *UpdateDomainResponse) IsSetDomainInfo() bool {
	return v != nil && v.DomainInfo != nil
}

// GetConfiguration returns the value of Configuration if it is set or its
// zero value if it is unset.
func (v *UpdateDomainResponse) GetConfiguration() (o *DomainConfiguration) {
	if v != nil && v.Configuration != nil {
		return v.Configuration
	}

	return
}

// IsSetConfiguration returns true if Configuration is not nil.
func (v *UpdateDomainResponse) IsSetConfiguration() bool {
	return v != nil && v.Configuration != nil
}

// GetReplicationConfiguration returns the value of ReplicationConfiguration if it is set or its
// zero value if it is unset.
func (v *UpdateDomainResponse) GetReplicationConfiguration() (o *DomainReplicationConfiguration) {
	if v != nil && v.ReplicationConfiguration != nil {
		return v.ReplicationConfiguration
	}

	return
}

// IsSetReplicationConfiguration returns true if ReplicationConfiguration is not nil.
func (v *UpdateDomainResponse) IsSetReplicationConfiguration() bool {
	return v != nil && v.ReplicationConfiguration != nil
}

// GetFailoverVersion returns the value of FailoverVersion if it is set or its
// zero value if it is unset.
func (v *UpdateDomainResponse) GetFailoverVersion() (o int64) {
	if v != nil && v.FailoverVersion != nil {
		return *v.FailoverVersion
	}

	return
}

// IsSetFailoverVersion returns true if FailoverVersion is not nil.
func (v *UpdateDomainResponse) IsSetFailoverVersion() bool {
	return v != nil && v.FailoverVersion != nil
}

// GetIsGlobalDomain returns the value of IsGlobalDomain if it is set or its
// zero value if it is unset.
func (v *UpdateDomainResponse) GetIsGlobalDomain() (o bool) {
	if v != nil && v.IsGlobalDomain != nil {
		return *v.IsGlobalDomain
	}

	return
}

// IsSetIsGlobalDomain returns true if IsGlobalDomain is not nil.
func (v *UpdateDomainResponse) IsSetIsGlobalDomain() bool {
	return v != nil && v.IsGlobalDomain != nil
}

type UpsertWorkflowSearchAttributesDecisionAttributes struct {
	SearchAttributes *SearchAttributes `json:"searchAttributes,omitempty"`
}

// ToWire translates a UpsertWorkflowSearchAttributesDecisionAttributes 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 *UpsertWorkflowSearchAttributesDecisionAttributes) ToWire() (wire.Value, error) {
	var (
		fields [1]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.SearchAttributes != nil {
		w, err = v.SearchAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

// FromWire deserializes a UpsertWorkflowSearchAttributesDecisionAttributes 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 UpsertWorkflowSearchAttributesDecisionAttributes struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v UpsertWorkflowSearchAttributesDecisionAttributes
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *UpsertWorkflowSearchAttributesDecisionAttributes) 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.SearchAttributes, err = _SearchAttributes_Read(field.Value)
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a UpsertWorkflowSearchAttributesDecisionAttributes
// struct.
func (v *UpsertWorkflowSearchAttributesDecisionAttributes) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [1]string
	i := 0
	if v.SearchAttributes != nil {
		fields[i] = fmt.Sprintf("SearchAttributes: %v", v.SearchAttributes)
		i++
	}

	return fmt.Sprintf("UpsertWorkflowSearchAttributesDecisionAttributes{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this UpsertWorkflowSearchAttributesDecisionAttributes match the
// provided UpsertWorkflowSearchAttributesDecisionAttributes.
//
// This function performs a deep comparison.
func (v *UpsertWorkflowSearchAttributesDecisionAttributes) Equals(rhs *UpsertWorkflowSearchAttributesDecisionAttributes) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !((v.SearchAttributes == nil && rhs.SearchAttributes == nil) || (v.SearchAttributes != nil && rhs.SearchAttributes != nil && v.SearchAttributes.Equals(rhs.SearchAttributes))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of UpsertWorkflowSearchAttributesDecisionAttributes.
func (v *UpsertWorkflowSearchAttributesDecisionAttributes) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.SearchAttributes != nil {
		err = multierr.Append(err, enc.AddObject("searchAttributes", v.SearchAttributes))
	}
	return err
}

// GetSearchAttributes returns the value of SearchAttributes if it is set or its
// zero value if it is unset.
func (v *UpsertWorkflowSearchAttributesDecisionAttributes) GetSearchAttributes() (o *SearchAttributes) {
	if v != nil && v.SearchAttributes != nil {
		return v.SearchAttributes
	}

	return
}

// IsSetSearchAttributes returns true if SearchAttributes is not nil.
func (v *UpsertWorkflowSearchAttributesDecisionAttributes) IsSetSearchAttributes() bool {
	return v != nil && v.SearchAttributes != nil
}

type UpsertWorkflowSearchAttributesEventAttributes struct {
	DecisionTaskCompletedEventId *int64            `json:"decisionTaskCompletedEventId,omitempty"`
	SearchAttributes             *SearchAttributes `json:"searchAttributes,omitempty"`
}

// ToWire translates a UpsertWorkflowSearchAttributesEventAttributes 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 *UpsertWorkflowSearchAttributesEventAttributes) ToWire() (wire.Value, error) {
	var (
		fields [2]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.DecisionTaskCompletedEventId != nil {
		w, err = wire.NewValueI64(*(v.DecisionTaskCompletedEventId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.SearchAttributes != nil {
		w, err = v.SearchAttributes.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 UpsertWorkflowSearchAttributesEventAttributes 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 UpsertWorkflowSearchAttributesEventAttributes struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v UpsertWorkflowSearchAttributesEventAttributes
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *UpsertWorkflowSearchAttributesEventAttributes) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			if field.Value.Type() == wire.TI64 {
				var x int64
				x, err = field.Value.GetI64(), error(nil)
				v.DecisionTaskCompletedEventId = &x
				if err != nil {
					return err
				}

			}
		case 20:
			if field.Value.Type() == wire.TStruct {
				v.SearchAttributes, err = _SearchAttributes_Read(field.Value)
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a UpsertWorkflowSearchAttributesEventAttributes
// struct.
func (v *UpsertWorkflowSearchAttributesEventAttributes) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [2]string
	i := 0
	if v.DecisionTaskCompletedEventId != nil {
		fields[i] = fmt.Sprintf("DecisionTaskCompletedEventId: %v", *(v.DecisionTaskCompletedEventId))
		i++
	}
	if v.SearchAttributes != nil {
		fields[i] = fmt.Sprintf("SearchAttributes: %v", v.SearchAttributes)
		i++
	}

	return fmt.Sprintf("UpsertWorkflowSearchAttributesEventAttributes{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this UpsertWorkflowSearchAttributesEventAttributes match the
// provided UpsertWorkflowSearchAttributesEventAttributes.
//
// This function performs a deep comparison.
func (v *UpsertWorkflowSearchAttributesEventAttributes) Equals(rhs *UpsertWorkflowSearchAttributesEventAttributes) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_I64_EqualsPtr(v.DecisionTaskCompletedEventId, rhs.DecisionTaskCompletedEventId) {
		return false
	}
	if !((v.SearchAttributes == nil && rhs.SearchAttributes == nil) || (v.SearchAttributes != nil && rhs.SearchAttributes != nil && v.SearchAttributes.Equals(rhs.SearchAttributes))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of UpsertWorkflowSearchAttributesEventAttributes.
func (v *UpsertWorkflowSearchAttributesEventAttributes) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.DecisionTaskCompletedEventId != nil {
		enc.AddInt64("decisionTaskCompletedEventId", *v.DecisionTaskCompletedEventId)
	}
	if v.SearchAttributes != nil {
		err = multierr.Append(err, enc.AddObject("searchAttributes", v.SearchAttributes))
	}
	return err
}

// GetDecisionTaskCompletedEventId returns the value of DecisionTaskCompletedEventId if it is set or its
// zero value if it is unset.
func (v *UpsertWorkflowSearchAttributesEventAttributes) GetDecisionTaskCompletedEventId() (o int64) {
	if v != nil && v.DecisionTaskCompletedEventId != nil {
		return *v.DecisionTaskCompletedEventId
	}

	return
}

// IsSetDecisionTaskCompletedEventId returns true if DecisionTaskCompletedEventId is not nil.
func (v *UpsertWorkflowSearchAttributesEventAttributes) IsSetDecisionTaskCompletedEventId() bool {
	return v != nil && v.DecisionTaskCompletedEventId != nil
}

// GetSearchAttributes returns the value of SearchAttributes if it is set or its
// zero value if it is unset.
func (v *UpsertWorkflowSearchAttributesEventAttributes) GetSearchAttributes() (o *SearchAttributes) {
	if v != nil && v.SearchAttributes != nil {
		return v.SearchAttributes
	}

	return
}

// IsSetSearchAttributes returns true if SearchAttributes is not nil.
func (v *UpsertWorkflowSearchAttributesEventAttributes) IsSetSearchAttributes() bool {
	return v != nil && v.SearchAttributes != nil
}

type VersionHistories struct {
	CurrentVersionHistoryIndex *int32            `json:"currentVersionHistoryIndex,omitempty"`
	Histories                  []*VersionHistory `json:"histories,omitempty"`
}

type _List_VersionHistory_ValueList []*VersionHistory

func (v _List_VersionHistory_ValueList) ForEach(f func(wire.Value) error) error {
	for i, x := range v {
		if x == nil {
			return fmt.Errorf("invalid [%v]: value is nil", i)
		}
		w, err := x.ToWire()
		if err != nil {
			return err
		}
		err = f(w)
		if err != nil {
			return err
		}
	}
	return nil
}

func (v _List_VersionHistory_ValueList) Size() int {
	return len(v)
}

func (_List_VersionHistory_ValueList) ValueType() wire.Type {
	return wire.TStruct
}

func (_List_VersionHistory_ValueList) Close() {}

// ToWire translates a VersionHistories 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 *VersionHistories) ToWire() (wire.Value, error) {
	var (
		fields [2]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.CurrentVersionHistoryIndex != nil {
		w, err = wire.NewValueI32(*(v.CurrentVersionHistoryIndex)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.Histories != nil {
		w, err = wire.NewValueList(_List_VersionHistory_ValueList(v.Histories)), 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 _VersionHistory_Read(w wire.Value) (*VersionHistory, error) {
	var v VersionHistory
	err := v.FromWire(w)
	return &v, err
}

func _List_VersionHistory_Read(l wire.ValueList) ([]*VersionHistory, error) {
	if l.ValueType() != wire.TStruct {
		return nil, nil
	}

	o := make([]*VersionHistory, 0, l.Size())
	err := l.ForEach(func(x wire.Value) error {
		i, err := _VersionHistory_Read(x)
		if err != nil {
			return err
		}
		o = append(o, i)
		return nil
	})
	l.Close()
	return o, err
}

// FromWire deserializes a VersionHistories 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 VersionHistories struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v VersionHistories
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *VersionHistories) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			if field.Value.Type() == wire.TI32 {
				var x int32
				x, err = field.Value.GetI32(), error(nil)
				v.CurrentVersionHistoryIndex = &x
				if err != nil {
					return err
				}

			}
		case 20:
			if field.Value.Type() == wire.TList {
				v.Histories, err = _List_VersionHistory_Read(field.Value.GetList())
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a VersionHistories
// struct.
func (v *VersionHistories) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [2]string
	i := 0
	if v.CurrentVersionHistoryIndex != nil {
		fields[i] = fmt.Sprintf("CurrentVersionHistoryIndex: %v", *(v.CurrentVersionHistoryIndex))
		i++
	}
	if v.Histories != nil {
		fields[i] = fmt.Sprintf("Histories: %v", v.Histories)
		i++
	}

	return fmt.Sprintf("VersionHistories{%v}", strings.Join(fields[:i], ", "))
}

func _List_VersionHistory_Equals(lhs, rhs []*VersionHistory) bool {
	if len(lhs) != len(rhs) {
		return false
	}

	for i, lv := range lhs {
		rv := rhs[i]
		if !lv.Equals(rv) {
			return false
		}
	}

	return true
}

// Equals returns true if all the fields of this VersionHistories match the
// provided VersionHistories.
//
// This function performs a deep comparison.
func (v *VersionHistories) Equals(rhs *VersionHistories) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_I32_EqualsPtr(v.CurrentVersionHistoryIndex, rhs.CurrentVersionHistoryIndex) {
		return false
	}
	if !((v.Histories == nil && rhs.Histories == nil) || (v.Histories != nil && rhs.Histories != nil && _List_VersionHistory_Equals(v.Histories, rhs.Histories))) {
		return false
	}

	return true
}

type _List_VersionHistory_Zapper []*VersionHistory

// MarshalLogArray implements zapcore.ArrayMarshaler, enabling
// fast logging of _List_VersionHistory_Zapper.
func (l _List_VersionHistory_Zapper) MarshalLogArray(enc zapcore.ArrayEncoder) (err error) {
	for _, v := range l {
		err = multierr.Append(err, enc.AppendObject(v))
	}
	return err
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of VersionHistories.
func (v *VersionHistories) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.CurrentVersionHistoryIndex != nil {
		enc.AddInt32("currentVersionHistoryIndex", *v.CurrentVersionHistoryIndex)
	}
	if v.Histories != nil {
		err = multierr.Append(err, enc.AddArray("histories", (_List_VersionHistory_Zapper)(v.Histories)))
	}
	return err
}

// GetCurrentVersionHistoryIndex returns the value of CurrentVersionHistoryIndex if it is set or its
// zero value if it is unset.
func (v *VersionHistories) GetCurrentVersionHistoryIndex() (o int32) {
	if v != nil && v.CurrentVersionHistoryIndex != nil {
		return *v.CurrentVersionHistoryIndex
	}

	return
}

// IsSetCurrentVersionHistoryIndex returns true if CurrentVersionHistoryIndex is not nil.
func (v *VersionHistories) IsSetCurrentVersionHistoryIndex() bool {
	return v != nil && v.CurrentVersionHistoryIndex != nil
}

// GetHistories returns the value of Histories if it is set or its
// zero value if it is unset.
func (v *VersionHistories) GetHistories() (o []*VersionHistory) {
	if v != nil && v.Histories != nil {
		return v.Histories
	}

	return
}

// IsSetHistories returns true if Histories is not nil.
func (v *VersionHistories) IsSetHistories() bool {
	return v != nil && v.Histories != nil
}

type VersionHistory struct {
	BranchToken []byte                `json:"branchToken,omitempty"`
	Items       []*VersionHistoryItem `json:"items,omitempty"`
}

type _List_VersionHistoryItem_ValueList []*VersionHistoryItem

func (v _List_VersionHistoryItem_ValueList) ForEach(f func(wire.Value) error) error {
	for i, x := range v {
		if x == nil {
			return fmt.Errorf("invalid [%v]: value is nil", i)
		}
		w, err := x.ToWire()
		if err != nil {
			return err
		}
		err = f(w)
		if err != nil {
			return err
		}
	}
	return nil
}

func (v _List_VersionHistoryItem_ValueList) Size() int {
	return len(v)
}

func (_List_VersionHistoryItem_ValueList) ValueType() wire.Type {
	return wire.TStruct
}

func (_List_VersionHistoryItem_ValueList) Close() {}

// ToWire translates a VersionHistory 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 *VersionHistory) ToWire() (wire.Value, error) {
	var (
		fields [2]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.BranchToken != nil {
		w, err = wire.NewValueBinary(v.BranchToken), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.Items != nil {
		w, err = wire.NewValueList(_List_VersionHistoryItem_ValueList(v.Items)), 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 _VersionHistoryItem_Read(w wire.Value) (*VersionHistoryItem, error) {
	var v VersionHistoryItem
	err := v.FromWire(w)
	return &v, err
}

func _List_VersionHistoryItem_Read(l wire.ValueList) ([]*VersionHistoryItem, error) {
	if l.ValueType() != wire.TStruct {
		return nil, nil
	}

	o := make([]*VersionHistoryItem, 0, l.Size())
	err := l.ForEach(func(x wire.Value) error {
		i, err := _VersionHistoryItem_Read(x)
		if err != nil {
			return err
		}
		o = append(o, i)
		return nil
	})
	l.Close()
	return o, err
}

// FromWire deserializes a VersionHistory 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 VersionHistory struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v VersionHistory
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *VersionHistory) 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.BranchToken, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		case 20:
			if field.Value.Type() == wire.TList {
				v.Items, err = _List_VersionHistoryItem_Read(field.Value.GetList())
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a VersionHistory
// struct.
func (v *VersionHistory) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [2]string
	i := 0
	if v.BranchToken != nil {
		fields[i] = fmt.Sprintf("BranchToken: %v", v.BranchToken)
		i++
	}
	if v.Items != nil {
		fields[i] = fmt.Sprintf("Items: %v", v.Items)
		i++
	}

	return fmt.Sprintf("VersionHistory{%v}", strings.Join(fields[:i], ", "))
}

func _List_VersionHistoryItem_Equals(lhs, rhs []*VersionHistoryItem) bool {
	if len(lhs) != len(rhs) {
		return false
	}

	for i, lv := range lhs {
		rv := rhs[i]
		if !lv.Equals(rv) {
			return false
		}
	}

	return true
}

// Equals returns true if all the fields of this VersionHistory match the
// provided VersionHistory.
//
// This function performs a deep comparison.
func (v *VersionHistory) Equals(rhs *VersionHistory) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !((v.BranchToken == nil && rhs.BranchToken == nil) || (v.BranchToken != nil && rhs.BranchToken != nil && bytes.Equal(v.BranchToken, rhs.BranchToken))) {
		return false
	}
	if !((v.Items == nil && rhs.Items == nil) || (v.Items != nil && rhs.Items != nil && _List_VersionHistoryItem_Equals(v.Items, rhs.Items))) {
		return false
	}

	return true
}

type _List_VersionHistoryItem_Zapper []*VersionHistoryItem

// MarshalLogArray implements zapcore.ArrayMarshaler, enabling
// fast logging of _List_VersionHistoryItem_Zapper.
func (l _List_VersionHistoryItem_Zapper) MarshalLogArray(enc zapcore.ArrayEncoder) (err error) {
	for _, v := range l {
		err = multierr.Append(err, enc.AppendObject(v))
	}
	return err
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of VersionHistory.
func (v *VersionHistory) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.BranchToken != nil {
		enc.AddString("branchToken", base64.StdEncoding.EncodeToString(v.BranchToken))
	}
	if v.Items != nil {
		err = multierr.Append(err, enc.AddArray("items", (_List_VersionHistoryItem_Zapper)(v.Items)))
	}
	return err
}

// GetBranchToken returns the value of BranchToken if it is set or its
// zero value if it is unset.
func (v *VersionHistory) GetBranchToken() (o []byte) {
	if v != nil && v.BranchToken != nil {
		return v.BranchToken
	}

	return
}

// IsSetBranchToken returns true if BranchToken is not nil.
func (v *VersionHistory) IsSetBranchToken() bool {
	return v != nil && v.BranchToken != nil
}

// GetItems returns the value of Items if it is set or its
// zero value if it is unset.
func (v *VersionHistory) GetItems() (o []*VersionHistoryItem) {
	if v != nil && v.Items != nil {
		return v.Items
	}

	return
}

// IsSetItems returns true if Items is not nil.
func (v *VersionHistory) IsSetItems() bool {
	return v != nil && v.Items != nil
}

type VersionHistoryItem struct {
	EventID *int64 `json:"eventID,omitempty"`
	Version *int64 `json:"version,omitempty"`
}

// ToWire translates a VersionHistoryItem 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 *VersionHistoryItem) ToWire() (wire.Value, error) {
	var (
		fields [2]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.EventID != nil {
		w, err = wire.NewValueI64(*(v.EventID)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.Version != nil {
		w, err = wire.NewValueI64(*(v.Version)), 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
}

// FromWire deserializes a VersionHistoryItem 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 VersionHistoryItem struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v VersionHistoryItem
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *VersionHistoryItem) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			if field.Value.Type() == wire.TI64 {
				var x int64
				x, err = field.Value.GetI64(), error(nil)
				v.EventID = &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.Version = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a VersionHistoryItem
// struct.
func (v *VersionHistoryItem) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [2]string
	i := 0
	if v.EventID != nil {
		fields[i] = fmt.Sprintf("EventID: %v", *(v.EventID))
		i++
	}
	if v.Version != nil {
		fields[i] = fmt.Sprintf("Version: %v", *(v.Version))
		i++
	}

	return fmt.Sprintf("VersionHistoryItem{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this VersionHistoryItem match the
// provided VersionHistoryItem.
//
// This function performs a deep comparison.
func (v *VersionHistoryItem) Equals(rhs *VersionHistoryItem) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_I64_EqualsPtr(v.EventID, rhs.EventID) {
		return false
	}
	if !_I64_EqualsPtr(v.Version, rhs.Version) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of VersionHistoryItem.
func (v *VersionHistoryItem) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.EventID != nil {
		enc.AddInt64("eventID", *v.EventID)
	}
	if v.Version != nil {
		enc.AddInt64("version", *v.Version)
	}
	return err
}

// GetEventID returns the value of EventID if it is set or its
// zero value if it is unset.
func (v *VersionHistoryItem) GetEventID() (o int64) {
	if v != nil && v.EventID != nil {
		return *v.EventID
	}

	return
}

// IsSetEventID returns true if EventID is not nil.
func (v *VersionHistoryItem) IsSetEventID() bool {
	return v != nil && v.EventID != nil
}

// GetVersion returns the value of Version if it is set or its
// zero value if it is unset.
func (v *VersionHistoryItem) GetVersion() (o int64) {
	if v != nil && v.Version != nil {
		return *v.Version
	}

	return
}

// IsSetVersion returns true if Version is not nil.
func (v *VersionHistoryItem) IsSetVersion() bool {
	return v != nil && v.Version != nil
}

type VirtualQueueState struct {
	VirtualSliceStates []*VirtualSliceState `json:"virtualSliceStates,omitempty"`
}

type _List_VirtualSliceState_ValueList []*VirtualSliceState

func (v _List_VirtualSliceState_ValueList) ForEach(f func(wire.Value) error) error {
	for i, x := range v {
		if x == nil {
			return fmt.Errorf("invalid [%v]: value is nil", i)
		}
		w, err := x.ToWire()
		if err != nil {
			return err
		}
		err = f(w)
		if err != nil {
			return err
		}
	}
	return nil
}

func (v _List_VirtualSliceState_ValueList) Size() int {
	return len(v)
}

func (_List_VirtualSliceState_ValueList) ValueType() wire.Type {
	return wire.TStruct
}

func (_List_VirtualSliceState_ValueList) Close() {}

// ToWire translates a VirtualQueueState 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 *VirtualQueueState) ToWire() (wire.Value, error) {
	var (
		fields [1]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.VirtualSliceStates != nil {
		w, err = wire.NewValueList(_List_VirtualSliceState_ValueList(v.VirtualSliceStates)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

func _VirtualSliceState_Read(w wire.Value) (*VirtualSliceState, error) {
	var v VirtualSliceState
	err := v.FromWire(w)
	return &v, err
}

func _List_VirtualSliceState_Read(l wire.ValueList) ([]*VirtualSliceState, error) {
	if l.ValueType() != wire.TStruct {
		return nil, nil
	}

	o := make([]*VirtualSliceState, 0, l.Size())
	err := l.ForEach(func(x wire.Value) error {
		i, err := _VirtualSliceState_Read(x)
		if err != nil {
			return err
		}
		o = append(o, i)
		return nil
	})
	l.Close()
	return o, err
}

// FromWire deserializes a VirtualQueueState 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 VirtualQueueState struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v VirtualQueueState
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *VirtualQueueState) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			if field.Value.Type() == wire.TList {
				v.VirtualSliceStates, err = _List_VirtualSliceState_Read(field.Value.GetList())
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a VirtualQueueState
// struct.
func (v *VirtualQueueState) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [1]string
	i := 0
	if v.VirtualSliceStates != nil {
		fields[i] = fmt.Sprintf("VirtualSliceStates: %v", v.VirtualSliceStates)
		i++
	}

	return fmt.Sprintf("VirtualQueueState{%v}", strings.Join(fields[:i], ", "))
}

func _List_VirtualSliceState_Equals(lhs, rhs []*VirtualSliceState) bool {
	if len(lhs) != len(rhs) {
		return false
	}

	for i, lv := range lhs {
		rv := rhs[i]
		if !lv.Equals(rv) {
			return false
		}
	}

	return true
}

// Equals returns true if all the fields of this VirtualQueueState match the
// provided VirtualQueueState.
//
// This function performs a deep comparison.
func (v *VirtualQueueState) Equals(rhs *VirtualQueueState) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !((v.VirtualSliceStates == nil && rhs.VirtualSliceStates == nil) || (v.VirtualSliceStates != nil && rhs.VirtualSliceStates != nil && _List_VirtualSliceState_Equals(v.VirtualSliceStates, rhs.VirtualSliceStates))) {
		return false
	}

	return true
}

type _List_VirtualSliceState_Zapper []*VirtualSliceState

// MarshalLogArray implements zapcore.ArrayMarshaler, enabling
// fast logging of _List_VirtualSliceState_Zapper.
func (l _List_VirtualSliceState_Zapper) MarshalLogArray(enc zapcore.ArrayEncoder) (err error) {
	for _, v := range l {
		err = multierr.Append(err, enc.AppendObject(v))
	}
	return err
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of VirtualQueueState.
func (v *VirtualQueueState) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.VirtualSliceStates != nil {
		err = multierr.Append(err, enc.AddArray("virtualSliceStates", (_List_VirtualSliceState_Zapper)(v.VirtualSliceStates)))
	}
	return err
}

// GetVirtualSliceStates returns the value of VirtualSliceStates if it is set or its
// zero value if it is unset.
func (v *VirtualQueueState) GetVirtualSliceStates() (o []*VirtualSliceState) {
	if v != nil && v.VirtualSliceStates != nil {
		return v.VirtualSliceStates
	}

	return
}

// IsSetVirtualSliceStates returns true if VirtualSliceStates is not nil.
func (v *VirtualQueueState) IsSetVirtualSliceStates() bool {
	return v != nil && v.VirtualSliceStates != nil
}

type VirtualSliceState struct {
	TaskRange *TaskRange `json:"taskRange,omitempty"`
}

// ToWire translates a VirtualSliceState 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 *VirtualSliceState) ToWire() (wire.Value, error) {
	var (
		fields [1]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.TaskRange != nil {
		w, err = v.TaskRange.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

func _TaskRange_Read(w wire.Value) (*TaskRange, error) {
	var v TaskRange
	err := v.FromWire(w)
	return &v, err
}

// FromWire deserializes a VirtualSliceState 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 VirtualSliceState struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v VirtualSliceState
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *VirtualSliceState) 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.TaskRange, err = _TaskRange_Read(field.Value)
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a VirtualSliceState
// struct.
func (v *VirtualSliceState) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [1]string
	i := 0
	if v.TaskRange != nil {
		fields[i] = fmt.Sprintf("TaskRange: %v", v.TaskRange)
		i++
	}

	return fmt.Sprintf("VirtualSliceState{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this VirtualSliceState match the
// provided VirtualSliceState.
//
// This function performs a deep comparison.
func (v *VirtualSliceState) Equals(rhs *VirtualSliceState) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !((v.TaskRange == nil && rhs.TaskRange == nil) || (v.TaskRange != nil && rhs.TaskRange != nil && v.TaskRange.Equals(rhs.TaskRange))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of VirtualSliceState.
func (v *VirtualSliceState) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.TaskRange != nil {
		err = multierr.Append(err, enc.AddObject("taskRange", v.TaskRange))
	}
	return err
}

// GetTaskRange returns the value of TaskRange if it is set or its
// zero value if it is unset.
func (v *VirtualSliceState) GetTaskRange() (o *TaskRange) {
	if v != nil && v.TaskRange != nil {
		return v.TaskRange
	}

	return
}

// IsSetTaskRange returns true if TaskRange is not nil.
func (v *VirtualSliceState) IsSetTaskRange() bool {
	return v != nil && v.TaskRange != nil
}

type WorkerVersionInfo struct {
	Impl           *string `json:"impl,omitempty"`
	FeatureVersion *string `json:"featureVersion,omitempty"`
}

// ToWire translates a WorkerVersionInfo 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 *WorkerVersionInfo) ToWire() (wire.Value, error) {
	var (
		fields [2]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.Impl != nil {
		w, err = wire.NewValueString(*(v.Impl)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.FeatureVersion != nil {
		w, err = wire.NewValueString(*(v.FeatureVersion)), 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
}

// FromWire deserializes a WorkerVersionInfo 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 WorkerVersionInfo struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v WorkerVersionInfo
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *WorkerVersionInfo) 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.Impl = &x
				if err != nil {
					return err
				}

			}
		case 20:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.FeatureVersion = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a WorkerVersionInfo
// struct.
func (v *WorkerVersionInfo) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [2]string
	i := 0
	if v.Impl != nil {
		fields[i] = fmt.Sprintf("Impl: %v", *(v.Impl))
		i++
	}
	if v.FeatureVersion != nil {
		fields[i] = fmt.Sprintf("FeatureVersion: %v", *(v.FeatureVersion))
		i++
	}

	return fmt.Sprintf("WorkerVersionInfo{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this WorkerVersionInfo match the
// provided WorkerVersionInfo.
//
// This function performs a deep comparison.
func (v *WorkerVersionInfo) Equals(rhs *WorkerVersionInfo) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.Impl, rhs.Impl) {
		return false
	}
	if !_String_EqualsPtr(v.FeatureVersion, rhs.FeatureVersion) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of WorkerVersionInfo.
func (v *WorkerVersionInfo) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Impl != nil {
		enc.AddString("impl", *v.Impl)
	}
	if v.FeatureVersion != nil {
		enc.AddString("featureVersion", *v.FeatureVersion)
	}
	return err
}

// GetImpl returns the value of Impl if it is set or its
// zero value if it is unset.
func (v *WorkerVersionInfo) GetImpl() (o string) {
	if v != nil && v.Impl != nil {
		return *v.Impl
	}

	return
}

// IsSetImpl returns true if Impl is not nil.
func (v *WorkerVersionInfo) IsSetImpl() bool {
	return v != nil && v.Impl != nil
}

// GetFeatureVersion returns the value of FeatureVersion if it is set or its
// zero value if it is unset.
func (v *WorkerVersionInfo) GetFeatureVersion() (o string) {
	if v != nil && v.FeatureVersion != nil {
		return *v.FeatureVersion
	}

	return
}

// IsSetFeatureVersion returns true if FeatureVersion is not nil.
func (v *WorkerVersionInfo) IsSetFeatureVersion() bool {
	return v != nil && v.FeatureVersion != nil
}

type WorkflowExecution struct {
	WorkflowId *string `json:"workflowId,omitempty"`
	RunId      *string `json:"runId,omitempty"`
}

// ToWire translates a WorkflowExecution 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 *WorkflowExecution) ToWire() (wire.Value, error) {
	var (
		fields [2]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.WorkflowId != nil {
		w, err = wire.NewValueString(*(v.WorkflowId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.RunId != nil {
		w, err = wire.NewValueString(*(v.RunId)), 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
}

// FromWire deserializes a WorkflowExecution 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 WorkflowExecution struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v WorkflowExecution
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *WorkflowExecution) 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.WorkflowId = &x
				if err != nil {
					return err
				}

			}
		case 20:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.RunId = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a WorkflowExecution
// struct.
func (v *WorkflowExecution) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [2]string
	i := 0
	if v.WorkflowId != nil {
		fields[i] = fmt.Sprintf("WorkflowId: %v", *(v.WorkflowId))
		i++
	}
	if v.RunId != nil {
		fields[i] = fmt.Sprintf("RunId: %v", *(v.RunId))
		i++
	}

	return fmt.Sprintf("WorkflowExecution{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this WorkflowExecution match the
// provided WorkflowExecution.
//
// This function performs a deep comparison.
func (v *WorkflowExecution) Equals(rhs *WorkflowExecution) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.WorkflowId, rhs.WorkflowId) {
		return false
	}
	if !_String_EqualsPtr(v.RunId, rhs.RunId) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of WorkflowExecution.
func (v *WorkflowExecution) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.WorkflowId != nil {
		enc.AddString("workflowId", *v.WorkflowId)
	}
	if v.RunId != nil {
		enc.AddString("runId", *v.RunId)
	}
	return err
}

// GetWorkflowId returns the value of WorkflowId if it is set or its
// zero value if it is unset.
func (v *WorkflowExecution) GetWorkflowId() (o string) {
	if v != nil && v.WorkflowId != nil {
		return *v.WorkflowId
	}

	return
}

// IsSetWorkflowId returns true if WorkflowId is not nil.
func (v *WorkflowExecution) IsSetWorkflowId() bool {
	return v != nil && v.WorkflowId != nil
}

// GetRunId returns the value of RunId if it is set or its
// zero value if it is unset.
func (v *WorkflowExecution) GetRunId() (o string) {
	if v != nil && v.RunId != nil {
		return *v.RunId
	}

	return
}

// IsSetRunId returns true if RunId is not nil.
func (v *WorkflowExecution) IsSetRunId() bool {
	return v != nil && v.RunId != nil
}

type WorkflowExecutionAlreadyCompletedError struct {
	Message string `json:"message,required"`
}

// ToWire translates a WorkflowExecutionAlreadyCompletedError 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 *WorkflowExecutionAlreadyCompletedError) 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
}

// FromWire deserializes a WorkflowExecutionAlreadyCompletedError 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 WorkflowExecutionAlreadyCompletedError struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v WorkflowExecutionAlreadyCompletedError
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *WorkflowExecutionAlreadyCompletedError) 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 WorkflowExecutionAlreadyCompletedError is required")
	}

	return nil
}

// String returns a readable string representation of a WorkflowExecutionAlreadyCompletedError
// struct.
func (v *WorkflowExecutionAlreadyCompletedError) 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("WorkflowExecutionAlreadyCompletedError{%v}", strings.Join(fields[:i], ", "))
}

// ErrorName is the name of this type as defined in the Thrift
// file.
func (*WorkflowExecutionAlreadyCompletedError) ErrorName() string {
	return "WorkflowExecutionAlreadyCompletedError"
}

// Equals returns true if all the fields of this WorkflowExecutionAlreadyCompletedError match the
// provided WorkflowExecutionAlreadyCompletedError.
//
// This function performs a deep comparison.
func (v *WorkflowExecutionAlreadyCompletedError) Equals(rhs *WorkflowExecutionAlreadyCompletedError) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !(v.Message == rhs.Message) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of WorkflowExecutionAlreadyCompletedError.
func (v *WorkflowExecutionAlreadyCompletedError) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	enc.AddString("message", v.Message)
	return err
}

// GetMessage returns the value of Message if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionAlreadyCompletedError) GetMessage() (o string) {
	if v != nil {
		o = v.Message
	}
	return
}

func (v *WorkflowExecutionAlreadyCompletedError) Error() string {
	return v.String()
}

type WorkflowExecutionAlreadyStartedError struct {
	Message        *string `json:"message,omitempty"`
	StartRequestId *string `json:"startRequestId,omitempty"`
	RunId          *string `json:"runId,omitempty"`
}

// ToWire translates a WorkflowExecutionAlreadyStartedError 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 *WorkflowExecutionAlreadyStartedError) ToWire() (wire.Value, error) {
	var (
		fields [3]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.Message != nil {
		w, err = wire.NewValueString(*(v.Message)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.StartRequestId != nil {
		w, err = wire.NewValueString(*(v.StartRequestId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.RunId != nil {
		w, err = wire.NewValueString(*(v.RunId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

// FromWire deserializes a WorkflowExecutionAlreadyStartedError 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 WorkflowExecutionAlreadyStartedError struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v WorkflowExecutionAlreadyStartedError
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *WorkflowExecutionAlreadyStartedError) 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.Message = &x
				if err != nil {
					return err
				}

			}
		case 20:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.StartRequestId = &x
				if err != nil {
					return err
				}

			}
		case 30:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.RunId = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a WorkflowExecutionAlreadyStartedError
// struct.
func (v *WorkflowExecutionAlreadyStartedError) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [3]string
	i := 0
	if v.Message != nil {
		fields[i] = fmt.Sprintf("Message: %v", *(v.Message))
		i++
	}
	if v.StartRequestId != nil {
		fields[i] = fmt.Sprintf("StartRequestId: %v", *(v.StartRequestId))
		i++
	}
	if v.RunId != nil {
		fields[i] = fmt.Sprintf("RunId: %v", *(v.RunId))
		i++
	}

	return fmt.Sprintf("WorkflowExecutionAlreadyStartedError{%v}", strings.Join(fields[:i], ", "))
}

// ErrorName is the name of this type as defined in the Thrift
// file.
func (*WorkflowExecutionAlreadyStartedError) ErrorName() string {
	return "WorkflowExecutionAlreadyStartedError"
}

// Equals returns true if all the fields of this WorkflowExecutionAlreadyStartedError match the
// provided WorkflowExecutionAlreadyStartedError.
//
// This function performs a deep comparison.
func (v *WorkflowExecutionAlreadyStartedError) Equals(rhs *WorkflowExecutionAlreadyStartedError) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.Message, rhs.Message) {
		return false
	}
	if !_String_EqualsPtr(v.StartRequestId, rhs.StartRequestId) {
		return false
	}
	if !_String_EqualsPtr(v.RunId, rhs.RunId) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of WorkflowExecutionAlreadyStartedError.
func (v *WorkflowExecutionAlreadyStartedError) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Message != nil {
		enc.AddString("message", *v.Message)
	}
	if v.StartRequestId != nil {
		enc.AddString("startRequestId", *v.StartRequestId)
	}
	if v.RunId != nil {
		enc.AddString("runId", *v.RunId)
	}
	return err
}

// GetMessage returns the value of Message if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionAlreadyStartedError) GetMessage() (o string) {
	if v != nil && v.Message != nil {
		return *v.Message
	}

	return
}

// IsSetMessage returns true if Message is not nil.
func (v *WorkflowExecutionAlreadyStartedError) IsSetMessage() bool {
	return v != nil && v.Message != nil
}

// GetStartRequestId returns the value of StartRequestId if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionAlreadyStartedError) GetStartRequestId() (o string) {
	if v != nil && v.StartRequestId != nil {
		return *v.StartRequestId
	}

	return
}

// IsSetStartRequestId returns true if StartRequestId is not nil.
func (v *WorkflowExecutionAlreadyStartedError) IsSetStartRequestId() bool {
	return v != nil && v.StartRequestId != nil
}

// GetRunId returns the value of RunId if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionAlreadyStartedError) GetRunId() (o string) {
	if v != nil && v.RunId != nil {
		return *v.RunId
	}

	return
}

// IsSetRunId returns true if RunId is not nil.
func (v *WorkflowExecutionAlreadyStartedError) IsSetRunId() bool {
	return v != nil && v.RunId != nil
}

func (v *WorkflowExecutionAlreadyStartedError) Error() string {
	return v.String()
}

type WorkflowExecutionCancelRequestedEventAttributes struct {
	Cause                     *string            `json:"cause,omitempty"`
	ExternalInitiatedEventId  *int64             `json:"externalInitiatedEventId,omitempty"`
	ExternalWorkflowExecution *WorkflowExecution `json:"externalWorkflowExecution,omitempty"`
	Identity                  *string            `json:"identity,omitempty"`
	RequestId                 *string            `json:"requestId,omitempty"`
}

// ToWire translates a WorkflowExecutionCancelRequestedEventAttributes 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 *WorkflowExecutionCancelRequestedEventAttributes) ToWire() (wire.Value, error) {
	var (
		fields [5]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.Cause != nil {
		w, err = wire.NewValueString(*(v.Cause)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.ExternalInitiatedEventId != nil {
		w, err = wire.NewValueI64(*(v.ExternalInitiatedEventId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.ExternalWorkflowExecution != nil {
		w, err = v.ExternalWorkflowExecution.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, 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: 40, Value: w}
		i++
	}
	if v.RequestId != nil {
		w, err = wire.NewValueString(*(v.RequestId)), 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
}

// FromWire deserializes a WorkflowExecutionCancelRequestedEventAttributes 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 WorkflowExecutionCancelRequestedEventAttributes struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v WorkflowExecutionCancelRequestedEventAttributes
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *WorkflowExecutionCancelRequestedEventAttributes) 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.Cause = &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.ExternalInitiatedEventId = &x
				if err != nil {
					return err
				}

			}
		case 30:
			if field.Value.Type() == wire.TStruct {
				v.ExternalWorkflowExecution, err = _WorkflowExecution_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.Identity = &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.RequestId = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a WorkflowExecutionCancelRequestedEventAttributes
// struct.
func (v *WorkflowExecutionCancelRequestedEventAttributes) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [5]string
	i := 0
	if v.Cause != nil {
		fields[i] = fmt.Sprintf("Cause: %v", *(v.Cause))
		i++
	}
	if v.ExternalInitiatedEventId != nil {
		fields[i] = fmt.Sprintf("ExternalInitiatedEventId: %v", *(v.ExternalInitiatedEventId))
		i++
	}
	if v.ExternalWorkflowExecution != nil {
		fields[i] = fmt.Sprintf("ExternalWorkflowExecution: %v", v.ExternalWorkflowExecution)
		i++
	}
	if v.Identity != nil {
		fields[i] = fmt.Sprintf("Identity: %v", *(v.Identity))
		i++
	}
	if v.RequestId != nil {
		fields[i] = fmt.Sprintf("RequestId: %v", *(v.RequestId))
		i++
	}

	return fmt.Sprintf("WorkflowExecutionCancelRequestedEventAttributes{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this WorkflowExecutionCancelRequestedEventAttributes match the
// provided WorkflowExecutionCancelRequestedEventAttributes.
//
// This function performs a deep comparison.
func (v *WorkflowExecutionCancelRequestedEventAttributes) Equals(rhs *WorkflowExecutionCancelRequestedEventAttributes) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.Cause, rhs.Cause) {
		return false
	}
	if !_I64_EqualsPtr(v.ExternalInitiatedEventId, rhs.ExternalInitiatedEventId) {
		return false
	}
	if !((v.ExternalWorkflowExecution == nil && rhs.ExternalWorkflowExecution == nil) || (v.ExternalWorkflowExecution != nil && rhs.ExternalWorkflowExecution != nil && v.ExternalWorkflowExecution.Equals(rhs.ExternalWorkflowExecution))) {
		return false
	}
	if !_String_EqualsPtr(v.Identity, rhs.Identity) {
		return false
	}
	if !_String_EqualsPtr(v.RequestId, rhs.RequestId) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of WorkflowExecutionCancelRequestedEventAttributes.
func (v *WorkflowExecutionCancelRequestedEventAttributes) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Cause != nil {
		enc.AddString("cause", *v.Cause)
	}
	if v.ExternalInitiatedEventId != nil {
		enc.AddInt64("externalInitiatedEventId", *v.ExternalInitiatedEventId)
	}
	if v.ExternalWorkflowExecution != nil {
		err = multierr.Append(err, enc.AddObject("externalWorkflowExecution", v.ExternalWorkflowExecution))
	}
	if v.Identity != nil {
		enc.AddString("identity", *v.Identity)
	}
	if v.RequestId != nil {
		enc.AddString("requestId", *v.RequestId)
	}
	return err
}

// GetCause returns the value of Cause if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionCancelRequestedEventAttributes) GetCause() (o string) {
	if v != nil && v.Cause != nil {
		return *v.Cause
	}

	return
}

// IsSetCause returns true if Cause is not nil.
func (v *WorkflowExecutionCancelRequestedEventAttributes) IsSetCause() bool {
	return v != nil && v.Cause != nil
}

// GetExternalInitiatedEventId returns the value of ExternalInitiatedEventId if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionCancelRequestedEventAttributes) GetExternalInitiatedEventId() (o int64) {
	if v != nil && v.ExternalInitiatedEventId != nil {
		return *v.ExternalInitiatedEventId
	}

	return
}

// IsSetExternalInitiatedEventId returns true if ExternalInitiatedEventId is not nil.
func (v *WorkflowExecutionCancelRequestedEventAttributes) IsSetExternalInitiatedEventId() bool {
	return v != nil && v.ExternalInitiatedEventId != nil
}

// GetExternalWorkflowExecution returns the value of ExternalWorkflowExecution if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionCancelRequestedEventAttributes) GetExternalWorkflowExecution() (o *WorkflowExecution) {
	if v != nil && v.ExternalWorkflowExecution != nil {
		return v.ExternalWorkflowExecution
	}

	return
}

// IsSetExternalWorkflowExecution returns true if ExternalWorkflowExecution is not nil.
func (v *WorkflowExecutionCancelRequestedEventAttributes) IsSetExternalWorkflowExecution() bool {
	return v != nil && v.ExternalWorkflowExecution != nil
}

// GetIdentity returns the value of Identity if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionCancelRequestedEventAttributes) GetIdentity() (o string) {
	if v != nil && v.Identity != nil {
		return *v.Identity
	}

	return
}

// IsSetIdentity returns true if Identity is not nil.
func (v *WorkflowExecutionCancelRequestedEventAttributes) IsSetIdentity() bool {
	return v != nil && v.Identity != nil
}

// GetRequestId returns the value of RequestId if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionCancelRequestedEventAttributes) GetRequestId() (o string) {
	if v != nil && v.RequestId != nil {
		return *v.RequestId
	}

	return
}

// IsSetRequestId returns true if RequestId is not nil.
func (v *WorkflowExecutionCancelRequestedEventAttributes) IsSetRequestId() bool {
	return v != nil && v.RequestId != nil
}

type WorkflowExecutionCanceledEventAttributes struct {
	DecisionTaskCompletedEventId *int64 `json:"decisionTaskCompletedEventId,omitempty"`
	Details                      []byte `json:"details,omitempty"`
}

// ToWire translates a WorkflowExecutionCanceledEventAttributes 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 *WorkflowExecutionCanceledEventAttributes) ToWire() (wire.Value, error) {
	var (
		fields [2]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.DecisionTaskCompletedEventId != nil {
		w, err = wire.NewValueI64(*(v.DecisionTaskCompletedEventId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.Details != nil {
		w, err = wire.NewValueBinary(v.Details), 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
}

// FromWire deserializes a WorkflowExecutionCanceledEventAttributes 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 WorkflowExecutionCanceledEventAttributes struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v WorkflowExecutionCanceledEventAttributes
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *WorkflowExecutionCanceledEventAttributes) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			if field.Value.Type() == wire.TI64 {
				var x int64
				x, err = field.Value.GetI64(), error(nil)
				v.DecisionTaskCompletedEventId = &x
				if err != nil {
					return err
				}

			}
		case 20:
			if field.Value.Type() == wire.TBinary {
				v.Details, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a WorkflowExecutionCanceledEventAttributes
// struct.
func (v *WorkflowExecutionCanceledEventAttributes) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [2]string
	i := 0
	if v.DecisionTaskCompletedEventId != nil {
		fields[i] = fmt.Sprintf("DecisionTaskCompletedEventId: %v", *(v.DecisionTaskCompletedEventId))
		i++
	}
	if v.Details != nil {
		fields[i] = fmt.Sprintf("Details: %v", v.Details)
		i++
	}

	return fmt.Sprintf("WorkflowExecutionCanceledEventAttributes{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this WorkflowExecutionCanceledEventAttributes match the
// provided WorkflowExecutionCanceledEventAttributes.
//
// This function performs a deep comparison.
func (v *WorkflowExecutionCanceledEventAttributes) Equals(rhs *WorkflowExecutionCanceledEventAttributes) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_I64_EqualsPtr(v.DecisionTaskCompletedEventId, rhs.DecisionTaskCompletedEventId) {
		return false
	}
	if !((v.Details == nil && rhs.Details == nil) || (v.Details != nil && rhs.Details != nil && bytes.Equal(v.Details, rhs.Details))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of WorkflowExecutionCanceledEventAttributes.
func (v *WorkflowExecutionCanceledEventAttributes) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.DecisionTaskCompletedEventId != nil {
		enc.AddInt64("decisionTaskCompletedEventId", *v.DecisionTaskCompletedEventId)
	}
	if v.Details != nil {
		enc.AddString("details", base64.StdEncoding.EncodeToString(v.Details))
	}
	return err
}

// GetDecisionTaskCompletedEventId returns the value of DecisionTaskCompletedEventId if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionCanceledEventAttributes) GetDecisionTaskCompletedEventId() (o int64) {
	if v != nil && v.DecisionTaskCompletedEventId != nil {
		return *v.DecisionTaskCompletedEventId
	}

	return
}

// IsSetDecisionTaskCompletedEventId returns true if DecisionTaskCompletedEventId is not nil.
func (v *WorkflowExecutionCanceledEventAttributes) IsSetDecisionTaskCompletedEventId() bool {
	return v != nil && v.DecisionTaskCompletedEventId != nil
}

// GetDetails returns the value of Details if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionCanceledEventAttributes) GetDetails() (o []byte) {
	if v != nil && v.Details != nil {
		return v.Details
	}

	return
}

// IsSetDetails returns true if Details is not nil.
func (v *WorkflowExecutionCanceledEventAttributes) IsSetDetails() bool {
	return v != nil && v.Details != nil
}

type WorkflowExecutionCloseStatus int32

const (
	WorkflowExecutionCloseStatusCompleted      WorkflowExecutionCloseStatus = 0
	WorkflowExecutionCloseStatusFailed         WorkflowExecutionCloseStatus = 1
	WorkflowExecutionCloseStatusCanceled       WorkflowExecutionCloseStatus = 2
	WorkflowExecutionCloseStatusTerminated     WorkflowExecutionCloseStatus = 3
	WorkflowExecutionCloseStatusContinuedAsNew WorkflowExecutionCloseStatus = 4
	WorkflowExecutionCloseStatusTimedOut       WorkflowExecutionCloseStatus = 5
)

// WorkflowExecutionCloseStatus_Values returns all recognized values of WorkflowExecutionCloseStatus.
func WorkflowExecutionCloseStatus_Values() []WorkflowExecutionCloseStatus {
	return []WorkflowExecutionCloseStatus{
		WorkflowExecutionCloseStatusCompleted,
		WorkflowExecutionCloseStatusFailed,
		WorkflowExecutionCloseStatusCanceled,
		WorkflowExecutionCloseStatusTerminated,
		WorkflowExecutionCloseStatusContinuedAsNew,
		WorkflowExecutionCloseStatusTimedOut,
	}
}

// UnmarshalText tries to decode WorkflowExecutionCloseStatus from a byte slice
// containing its name.
//
//	var v WorkflowExecutionCloseStatus
//	err := v.UnmarshalText([]byte("COMPLETED"))
func (v *WorkflowExecutionCloseStatus) UnmarshalText(value []byte) error {
	switch s := string(value); s {
	case "COMPLETED":
		*v = WorkflowExecutionCloseStatusCompleted
		return nil
	case "FAILED":
		*v = WorkflowExecutionCloseStatusFailed
		return nil
	case "CANCELED":
		*v = WorkflowExecutionCloseStatusCanceled
		return nil
	case "TERMINATED":
		*v = WorkflowExecutionCloseStatusTerminated
		return nil
	case "CONTINUED_AS_NEW":
		*v = WorkflowExecutionCloseStatusContinuedAsNew
		return nil
	case "TIMED_OUT":
		*v = WorkflowExecutionCloseStatusTimedOut
		return nil
	default:
		val, err := strconv.ParseInt(s, 10, 32)
		if err != nil {
			return fmt.Errorf("unknown enum value %q for %q: %v", s, "WorkflowExecutionCloseStatus", err)
		}
		*v = WorkflowExecutionCloseStatus(val)
		return nil
	}
}

// MarshalText encodes WorkflowExecutionCloseStatus 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 WorkflowExecutionCloseStatus) MarshalText() ([]byte, error) {
	switch int32(v) {
	case 0:
		return []byte("COMPLETED"), nil
	case 1:
		return []byte("FAILED"), nil
	case 2:
		return []byte("CANCELED"), nil
	case 3:
		return []byte("TERMINATED"), nil
	case 4:
		return []byte("CONTINUED_AS_NEW"), nil
	case 5:
		return []byte("TIMED_OUT"), nil
	}
	return []byte(strconv.FormatInt(int64(v), 10)), nil
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of WorkflowExecutionCloseStatus.
// 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 WorkflowExecutionCloseStatus) MarshalLogObject(enc zapcore.ObjectEncoder) error {
	enc.AddInt32("value", int32(v))
	switch int32(v) {
	case 0:
		enc.AddString("name", "COMPLETED")
	case 1:
		enc.AddString("name", "FAILED")
	case 2:
		enc.AddString("name", "CANCELED")
	case 3:
		enc.AddString("name", "TERMINATED")
	case 4:
		enc.AddString("name", "CONTINUED_AS_NEW")
	case 5:
		enc.AddString("name", "TIMED_OUT")
	}
	return nil
}

// Ptr returns a pointer to this enum value.
func (v WorkflowExecutionCloseStatus) Ptr() *WorkflowExecutionCloseStatus {
	return &v
}

// ToWire translates WorkflowExecutionCloseStatus 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 WorkflowExecutionCloseStatus) ToWire() (wire.Value, error) {
	return wire.NewValueI32(int32(v)), nil
}

// FromWire deserializes WorkflowExecutionCloseStatus from its Thrift-level
// representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TI32)
//	if err != nil {
//	  return WorkflowExecutionCloseStatus(0), err
//	}
//
//	var v WorkflowExecutionCloseStatus
//	if err := v.FromWire(x); err != nil {
//	  return WorkflowExecutionCloseStatus(0), err
//	}
//	return v, nil
func (v *WorkflowExecutionCloseStatus) FromWire(w wire.Value) error {
	*v = (WorkflowExecutionCloseStatus)(w.GetI32())
	return nil
}

// String returns a readable string representation of WorkflowExecutionCloseStatus.
func (v WorkflowExecutionCloseStatus) String() string {
	w := int32(v)
	switch w {
	case 0:
		return "COMPLETED"
	case 1:
		return "FAILED"
	case 2:
		return "CANCELED"
	case 3:
		return "TERMINATED"
	case 4:
		return "CONTINUED_AS_NEW"
	case 5:
		return "TIMED_OUT"
	}
	return fmt.Sprintf("WorkflowExecutionCloseStatus(%d)", w)
}

// Equals returns true if this WorkflowExecutionCloseStatus value matches the provided
// value.
func (v WorkflowExecutionCloseStatus) Equals(rhs WorkflowExecutionCloseStatus) bool {
	return v == rhs
}

// MarshalJSON serializes WorkflowExecutionCloseStatus into JSON.
//
// If the enum value is recognized, its name is returned. Otherwise,
// its integer value is returned.
//
// This implements json.Marshaler.
func (v WorkflowExecutionCloseStatus) MarshalJSON() ([]byte, error) {
	switch int32(v) {
	case 0:
		return ([]byte)("\"COMPLETED\""), nil
	case 1:
		return ([]byte)("\"FAILED\""), nil
	case 2:
		return ([]byte)("\"CANCELED\""), nil
	case 3:
		return ([]byte)("\"TERMINATED\""), nil
	case 4:
		return ([]byte)("\"CONTINUED_AS_NEW\""), nil
	case 5:
		return ([]byte)("\"TIMED_OUT\""), nil
	}
	return ([]byte)(strconv.FormatInt(int64(v), 10)), nil
}

// UnmarshalJSON attempts to decode WorkflowExecutionCloseStatus 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 *WorkflowExecutionCloseStatus) 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, "WorkflowExecutionCloseStatus")
		}
		if x < math.MinInt32 {
			return fmt.Errorf("enum underflow from JSON %q for %q", text, "WorkflowExecutionCloseStatus")
		}
		*v = (WorkflowExecutionCloseStatus)(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, "WorkflowExecutionCloseStatus")
	}
}

type WorkflowExecutionCompletedEventAttributes struct {
	Result                       []byte `json:"result,omitempty"`
	DecisionTaskCompletedEventId *int64 `json:"decisionTaskCompletedEventId,omitempty"`
}

// ToWire translates a WorkflowExecutionCompletedEventAttributes 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 *WorkflowExecutionCompletedEventAttributes) ToWire() (wire.Value, error) {
	var (
		fields [2]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.Result != nil {
		w, err = wire.NewValueBinary(v.Result), 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
}

// FromWire deserializes a WorkflowExecutionCompletedEventAttributes 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 WorkflowExecutionCompletedEventAttributes struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v WorkflowExecutionCompletedEventAttributes
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *WorkflowExecutionCompletedEventAttributes) 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.Result, 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.DecisionTaskCompletedEventId = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a WorkflowExecutionCompletedEventAttributes
// struct.
func (v *WorkflowExecutionCompletedEventAttributes) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [2]string
	i := 0
	if v.Result != nil {
		fields[i] = fmt.Sprintf("Result: %v", v.Result)
		i++
	}
	if v.DecisionTaskCompletedEventId != nil {
		fields[i] = fmt.Sprintf("DecisionTaskCompletedEventId: %v", *(v.DecisionTaskCompletedEventId))
		i++
	}

	return fmt.Sprintf("WorkflowExecutionCompletedEventAttributes{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this WorkflowExecutionCompletedEventAttributes match the
// provided WorkflowExecutionCompletedEventAttributes.
//
// This function performs a deep comparison.
func (v *WorkflowExecutionCompletedEventAttributes) Equals(rhs *WorkflowExecutionCompletedEventAttributes) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !((v.Result == nil && rhs.Result == nil) || (v.Result != nil && rhs.Result != nil && bytes.Equal(v.Result, rhs.Result))) {
		return false
	}
	if !_I64_EqualsPtr(v.DecisionTaskCompletedEventId, rhs.DecisionTaskCompletedEventId) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of WorkflowExecutionCompletedEventAttributes.
func (v *WorkflowExecutionCompletedEventAttributes) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Result != nil {
		enc.AddString("result", base64.StdEncoding.EncodeToString(v.Result))
	}
	if v.DecisionTaskCompletedEventId != nil {
		enc.AddInt64("decisionTaskCompletedEventId", *v.DecisionTaskCompletedEventId)
	}
	return err
}

// GetResult returns the value of Result if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionCompletedEventAttributes) GetResult() (o []byte) {
	if v != nil && v.Result != nil {
		return v.Result
	}

	return
}

// IsSetResult returns true if Result is not nil.
func (v *WorkflowExecutionCompletedEventAttributes) IsSetResult() bool {
	return v != nil && v.Result != nil
}

// GetDecisionTaskCompletedEventId returns the value of DecisionTaskCompletedEventId if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionCompletedEventAttributes) GetDecisionTaskCompletedEventId() (o int64) {
	if v != nil && v.DecisionTaskCompletedEventId != nil {
		return *v.DecisionTaskCompletedEventId
	}

	return
}

// IsSetDecisionTaskCompletedEventId returns true if DecisionTaskCompletedEventId is not nil.
func (v *WorkflowExecutionCompletedEventAttributes) IsSetDecisionTaskCompletedEventId() bool {
	return v != nil && v.DecisionTaskCompletedEventId != nil
}

type WorkflowExecutionConfiguration struct {
	TaskList                            *TaskList `json:"taskList,omitempty"`
	ExecutionStartToCloseTimeoutSeconds *int32    `json:"executionStartToCloseTimeoutSeconds,omitempty"`
	TaskStartToCloseTimeoutSeconds      *int32    `json:"taskStartToCloseTimeoutSeconds,omitempty"`
}

// ToWire translates a WorkflowExecutionConfiguration 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 *WorkflowExecutionConfiguration) ToWire() (wire.Value, error) {
	var (
		fields [3]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.TaskList != nil {
		w, err = v.TaskList.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.ExecutionStartToCloseTimeoutSeconds != nil {
		w, err = wire.NewValueI32(*(v.ExecutionStartToCloseTimeoutSeconds)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.TaskStartToCloseTimeoutSeconds != nil {
		w, err = wire.NewValueI32(*(v.TaskStartToCloseTimeoutSeconds)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

// FromWire deserializes a WorkflowExecutionConfiguration 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 WorkflowExecutionConfiguration struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v WorkflowExecutionConfiguration
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *WorkflowExecutionConfiguration) 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.TaskList, err = _TaskList_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 20:
			if field.Value.Type() == wire.TI32 {
				var x int32
				x, err = field.Value.GetI32(), error(nil)
				v.ExecutionStartToCloseTimeoutSeconds = &x
				if err != nil {
					return err
				}

			}
		case 30:
			if field.Value.Type() == wire.TI32 {
				var x int32
				x, err = field.Value.GetI32(), error(nil)
				v.TaskStartToCloseTimeoutSeconds = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a WorkflowExecutionConfiguration
// struct.
func (v *WorkflowExecutionConfiguration) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [3]string
	i := 0
	if v.TaskList != nil {
		fields[i] = fmt.Sprintf("TaskList: %v", v.TaskList)
		i++
	}
	if v.ExecutionStartToCloseTimeoutSeconds != nil {
		fields[i] = fmt.Sprintf("ExecutionStartToCloseTimeoutSeconds: %v", *(v.ExecutionStartToCloseTimeoutSeconds))
		i++
	}
	if v.TaskStartToCloseTimeoutSeconds != nil {
		fields[i] = fmt.Sprintf("TaskStartToCloseTimeoutSeconds: %v", *(v.TaskStartToCloseTimeoutSeconds))
		i++
	}

	return fmt.Sprintf("WorkflowExecutionConfiguration{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this WorkflowExecutionConfiguration match the
// provided WorkflowExecutionConfiguration.
//
// This function performs a deep comparison.
func (v *WorkflowExecutionConfiguration) Equals(rhs *WorkflowExecutionConfiguration) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !((v.TaskList == nil && rhs.TaskList == nil) || (v.TaskList != nil && rhs.TaskList != nil && v.TaskList.Equals(rhs.TaskList))) {
		return false
	}
	if !_I32_EqualsPtr(v.ExecutionStartToCloseTimeoutSeconds, rhs.ExecutionStartToCloseTimeoutSeconds) {
		return false
	}
	if !_I32_EqualsPtr(v.TaskStartToCloseTimeoutSeconds, rhs.TaskStartToCloseTimeoutSeconds) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of WorkflowExecutionConfiguration.
func (v *WorkflowExecutionConfiguration) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.TaskList != nil {
		err = multierr.Append(err, enc.AddObject("taskList", v.TaskList))
	}
	if v.ExecutionStartToCloseTimeoutSeconds != nil {
		enc.AddInt32("executionStartToCloseTimeoutSeconds", *v.ExecutionStartToCloseTimeoutSeconds)
	}
	if v.TaskStartToCloseTimeoutSeconds != nil {
		enc.AddInt32("taskStartToCloseTimeoutSeconds", *v.TaskStartToCloseTimeoutSeconds)
	}
	return err
}

// GetTaskList returns the value of TaskList if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionConfiguration) GetTaskList() (o *TaskList) {
	if v != nil && v.TaskList != nil {
		return v.TaskList
	}

	return
}

// IsSetTaskList returns true if TaskList is not nil.
func (v *WorkflowExecutionConfiguration) IsSetTaskList() bool {
	return v != nil && v.TaskList != nil
}

// GetExecutionStartToCloseTimeoutSeconds returns the value of ExecutionStartToCloseTimeoutSeconds if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionConfiguration) GetExecutionStartToCloseTimeoutSeconds() (o int32) {
	if v != nil && v.ExecutionStartToCloseTimeoutSeconds != nil {
		return *v.ExecutionStartToCloseTimeoutSeconds
	}

	return
}

// IsSetExecutionStartToCloseTimeoutSeconds returns true if ExecutionStartToCloseTimeoutSeconds is not nil.
func (v *WorkflowExecutionConfiguration) IsSetExecutionStartToCloseTimeoutSeconds() bool {
	return v != nil && v.ExecutionStartToCloseTimeoutSeconds != nil
}

// GetTaskStartToCloseTimeoutSeconds returns the value of TaskStartToCloseTimeoutSeconds if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionConfiguration) GetTaskStartToCloseTimeoutSeconds() (o int32) {
	if v != nil && v.TaskStartToCloseTimeoutSeconds != nil {
		return *v.TaskStartToCloseTimeoutSeconds
	}

	return
}

// IsSetTaskStartToCloseTimeoutSeconds returns true if TaskStartToCloseTimeoutSeconds is not nil.
func (v *WorkflowExecutionConfiguration) IsSetTaskStartToCloseTimeoutSeconds() bool {
	return v != nil && v.TaskStartToCloseTimeoutSeconds != nil
}

type WorkflowExecutionContinuedAsNewEventAttributes struct {
	NewExecutionRunId                   *string                 `json:"newExecutionRunId,omitempty"`
	WorkflowType                        *WorkflowType           `json:"workflowType,omitempty"`
	TaskList                            *TaskList               `json:"taskList,omitempty"`
	Input                               []byte                  `json:"input,omitempty"`
	ExecutionStartToCloseTimeoutSeconds *int32                  `json:"executionStartToCloseTimeoutSeconds,omitempty"`
	TaskStartToCloseTimeoutSeconds      *int32                  `json:"taskStartToCloseTimeoutSeconds,omitempty"`
	DecisionTaskCompletedEventId        *int64                  `json:"decisionTaskCompletedEventId,omitempty"`
	BackoffStartIntervalInSeconds       *int32                  `json:"backoffStartIntervalInSeconds,omitempty"`
	Initiator                           *ContinueAsNewInitiator `json:"initiator,omitempty"`
	FailureReason                       *string                 `json:"failureReason,omitempty"`
	FailureDetails                      []byte                  `json:"failureDetails,omitempty"`
	LastCompletionResult                []byte                  `json:"lastCompletionResult,omitempty"`
	Header                              *Header                 `json:"header,omitempty"`
	Memo                                *Memo                   `json:"memo,omitempty"`
	SearchAttributes                    *SearchAttributes       `json:"searchAttributes,omitempty"`
}

// ToWire translates a WorkflowExecutionContinuedAsNewEventAttributes 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 *WorkflowExecutionContinuedAsNewEventAttributes) ToWire() (wire.Value, error) {
	var (
		fields [15]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.NewExecutionRunId != nil {
		w, err = wire.NewValueString(*(v.NewExecutionRunId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.WorkflowType != nil {
		w, err = v.WorkflowType.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.Input != nil {
		w, err = wire.NewValueBinary(v.Input), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 40, Value: w}
		i++
	}
	if v.ExecutionStartToCloseTimeoutSeconds != nil {
		w, err = wire.NewValueI32(*(v.ExecutionStartToCloseTimeoutSeconds)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 50, Value: w}
		i++
	}
	if v.TaskStartToCloseTimeoutSeconds != nil {
		w, err = wire.NewValueI32(*(v.TaskStartToCloseTimeoutSeconds)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 60, 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: 70, Value: w}
		i++
	}
	if v.BackoffStartIntervalInSeconds != nil {
		w, err = wire.NewValueI32(*(v.BackoffStartIntervalInSeconds)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 80, Value: w}
		i++
	}
	if v.Initiator != nil {
		w, err = v.Initiator.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 90, Value: w}
		i++
	}
	if v.FailureReason != nil {
		w, err = wire.NewValueString(*(v.FailureReason)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 100, Value: w}
		i++
	}
	if v.FailureDetails != nil {
		w, err = wire.NewValueBinary(v.FailureDetails), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 110, Value: w}
		i++
	}
	if v.LastCompletionResult != nil {
		w, err = wire.NewValueBinary(v.LastCompletionResult), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 120, Value: w}
		i++
	}
	if v.Header != nil {
		w, err = v.Header.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 130, Value: w}
		i++
	}
	if v.Memo != nil {
		w, err = v.Memo.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 140, Value: w}
		i++
	}
	if v.SearchAttributes != nil {
		w, err = v.SearchAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 150, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

// FromWire deserializes a WorkflowExecutionContinuedAsNewEventAttributes 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 WorkflowExecutionContinuedAsNewEventAttributes struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v WorkflowExecutionContinuedAsNewEventAttributes
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *WorkflowExecutionContinuedAsNewEventAttributes) 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.NewExecutionRunId = &x
				if err != nil {
					return err
				}

			}
		case 20:
			if field.Value.Type() == wire.TStruct {
				v.WorkflowType, err = _WorkflowType_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.TBinary {
				v.Input, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		case 50:
			if field.Value.Type() == wire.TI32 {
				var x int32
				x, err = field.Value.GetI32(), error(nil)
				v.ExecutionStartToCloseTimeoutSeconds = &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.TaskStartToCloseTimeoutSeconds = &x
				if err != nil {
					return err
				}

			}
		case 70:
			if field.Value.Type() == wire.TI64 {
				var x int64
				x, err = field.Value.GetI64(), error(nil)
				v.DecisionTaskCompletedEventId = &x
				if err != nil {
					return err
				}

			}
		case 80:
			if field.Value.Type() == wire.TI32 {
				var x int32
				x, err = field.Value.GetI32(), error(nil)
				v.BackoffStartIntervalInSeconds = &x
				if err != nil {
					return err
				}

			}
		case 90:
			if field.Value.Type() == wire.TI32 {
				var x ContinueAsNewInitiator
				x, err = _ContinueAsNewInitiator_Read(field.Value)
				v.Initiator = &x
				if err != nil {
					return err
				}

			}
		case 100:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.FailureReason = &x
				if err != nil {
					return err
				}

			}
		case 110:
			if field.Value.Type() == wire.TBinary {
				v.FailureDetails, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		case 120:
			if field.Value.Type() == wire.TBinary {
				v.LastCompletionResult, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		case 130:
			if field.Value.Type() == wire.TStruct {
				v.Header, err = _Header_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 140:
			if field.Value.Type() == wire.TStruct {
				v.Memo, err = _Memo_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 150:
			if field.Value.Type() == wire.TStruct {
				v.SearchAttributes, err = _SearchAttributes_Read(field.Value)
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a WorkflowExecutionContinuedAsNewEventAttributes
// struct.
func (v *WorkflowExecutionContinuedAsNewEventAttributes) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [15]string
	i := 0
	if v.NewExecutionRunId != nil {
		fields[i] = fmt.Sprintf("NewExecutionRunId: %v", *(v.NewExecutionRunId))
		i++
	}
	if v.WorkflowType != nil {
		fields[i] = fmt.Sprintf("WorkflowType: %v", v.WorkflowType)
		i++
	}
	if v.TaskList != nil {
		fields[i] = fmt.Sprintf("TaskList: %v", v.TaskList)
		i++
	}
	if v.Input != nil {
		fields[i] = fmt.Sprintf("Input: %v", v.Input)
		i++
	}
	if v.ExecutionStartToCloseTimeoutSeconds != nil {
		fields[i] = fmt.Sprintf("ExecutionStartToCloseTimeoutSeconds: %v", *(v.ExecutionStartToCloseTimeoutSeconds))
		i++
	}
	if v.TaskStartToCloseTimeoutSeconds != nil {
		fields[i] = fmt.Sprintf("TaskStartToCloseTimeoutSeconds: %v", *(v.TaskStartToCloseTimeoutSeconds))
		i++
	}
	if v.DecisionTaskCompletedEventId != nil {
		fields[i] = fmt.Sprintf("DecisionTaskCompletedEventId: %v", *(v.DecisionTaskCompletedEventId))
		i++
	}
	if v.BackoffStartIntervalInSeconds != nil {
		fields[i] = fmt.Sprintf("BackoffStartIntervalInSeconds: %v", *(v.BackoffStartIntervalInSeconds))
		i++
	}
	if v.Initiator != nil {
		fields[i] = fmt.Sprintf("Initiator: %v", *(v.Initiator))
		i++
	}
	if v.FailureReason != nil {
		fields[i] = fmt.Sprintf("FailureReason: %v", *(v.FailureReason))
		i++
	}
	if v.FailureDetails != nil {
		fields[i] = fmt.Sprintf("FailureDetails: %v", v.FailureDetails)
		i++
	}
	if v.LastCompletionResult != nil {
		fields[i] = fmt.Sprintf("LastCompletionResult: %v", v.LastCompletionResult)
		i++
	}
	if v.Header != nil {
		fields[i] = fmt.Sprintf("Header: %v", v.Header)
		i++
	}
	if v.Memo != nil {
		fields[i] = fmt.Sprintf("Memo: %v", v.Memo)
		i++
	}
	if v.SearchAttributes != nil {
		fields[i] = fmt.Sprintf("SearchAttributes: %v", v.SearchAttributes)
		i++
	}

	return fmt.Sprintf("WorkflowExecutionContinuedAsNewEventAttributes{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this WorkflowExecutionContinuedAsNewEventAttributes match the
// provided WorkflowExecutionContinuedAsNewEventAttributes.
//
// This function performs a deep comparison.
func (v *WorkflowExecutionContinuedAsNewEventAttributes) Equals(rhs *WorkflowExecutionContinuedAsNewEventAttributes) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.NewExecutionRunId, rhs.NewExecutionRunId) {
		return false
	}
	if !((v.WorkflowType == nil && rhs.WorkflowType == nil) || (v.WorkflowType != nil && rhs.WorkflowType != nil && v.WorkflowType.Equals(rhs.WorkflowType))) {
		return false
	}
	if !((v.TaskList == nil && rhs.TaskList == nil) || (v.TaskList != nil && rhs.TaskList != nil && v.TaskList.Equals(rhs.TaskList))) {
		return false
	}
	if !((v.Input == nil && rhs.Input == nil) || (v.Input != nil && rhs.Input != nil && bytes.Equal(v.Input, rhs.Input))) {
		return false
	}
	if !_I32_EqualsPtr(v.ExecutionStartToCloseTimeoutSeconds, rhs.ExecutionStartToCloseTimeoutSeconds) {
		return false
	}
	if !_I32_EqualsPtr(v.TaskStartToCloseTimeoutSeconds, rhs.TaskStartToCloseTimeoutSeconds) {
		return false
	}
	if !_I64_EqualsPtr(v.DecisionTaskCompletedEventId, rhs.DecisionTaskCompletedEventId) {
		return false
	}
	if !_I32_EqualsPtr(v.BackoffStartIntervalInSeconds, rhs.BackoffStartIntervalInSeconds) {
		return false
	}
	if !_ContinueAsNewInitiator_EqualsPtr(v.Initiator, rhs.Initiator) {
		return false
	}
	if !_String_EqualsPtr(v.FailureReason, rhs.FailureReason) {
		return false
	}
	if !((v.FailureDetails == nil && rhs.FailureDetails == nil) || (v.FailureDetails != nil && rhs.FailureDetails != nil && bytes.Equal(v.FailureDetails, rhs.FailureDetails))) {
		return false
	}
	if !((v.LastCompletionResult == nil && rhs.LastCompletionResult == nil) || (v.LastCompletionResult != nil && rhs.LastCompletionResult != nil && bytes.Equal(v.LastCompletionResult, rhs.LastCompletionResult))) {
		return false
	}
	if !((v.Header == nil && rhs.Header == nil) || (v.Header != nil && rhs.Header != nil && v.Header.Equals(rhs.Header))) {
		return false
	}
	if !((v.Memo == nil && rhs.Memo == nil) || (v.Memo != nil && rhs.Memo != nil && v.Memo.Equals(rhs.Memo))) {
		return false
	}
	if !((v.SearchAttributes == nil && rhs.SearchAttributes == nil) || (v.SearchAttributes != nil && rhs.SearchAttributes != nil && v.SearchAttributes.Equals(rhs.SearchAttributes))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of WorkflowExecutionContinuedAsNewEventAttributes.
func (v *WorkflowExecutionContinuedAsNewEventAttributes) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.NewExecutionRunId != nil {
		enc.AddString("newExecutionRunId", *v.NewExecutionRunId)
	}
	if v.WorkflowType != nil {
		err = multierr.Append(err, enc.AddObject("workflowType", v.WorkflowType))
	}
	if v.TaskList != nil {
		err = multierr.Append(err, enc.AddObject("taskList", v.TaskList))
	}
	if v.Input != nil {
		enc.AddString("input", base64.StdEncoding.EncodeToString(v.Input))
	}
	if v.ExecutionStartToCloseTimeoutSeconds != nil {
		enc.AddInt32("executionStartToCloseTimeoutSeconds", *v.ExecutionStartToCloseTimeoutSeconds)
	}
	if v.TaskStartToCloseTimeoutSeconds != nil {
		enc.AddInt32("taskStartToCloseTimeoutSeconds", *v.TaskStartToCloseTimeoutSeconds)
	}
	if v.DecisionTaskCompletedEventId != nil {
		enc.AddInt64("decisionTaskCompletedEventId", *v.DecisionTaskCompletedEventId)
	}
	if v.BackoffStartIntervalInSeconds != nil {
		enc.AddInt32("backoffStartIntervalInSeconds", *v.BackoffStartIntervalInSeconds)
	}
	if v.Initiator != nil {
		err = multierr.Append(err, enc.AddObject("initiator", *v.Initiator))
	}
	if v.FailureReason != nil {
		enc.AddString("failureReason", *v.FailureReason)
	}
	if v.FailureDetails != nil {
		enc.AddString("failureDetails", base64.StdEncoding.EncodeToString(v.FailureDetails))
	}
	if v.LastCompletionResult != nil {
		enc.AddString("lastCompletionResult", base64.StdEncoding.EncodeToString(v.LastCompletionResult))
	}
	if v.Header != nil {
		err = multierr.Append(err, enc.AddObject("header", v.Header))
	}
	if v.Memo != nil {
		err = multierr.Append(err, enc.AddObject("memo", v.Memo))
	}
	if v.SearchAttributes != nil {
		err = multierr.Append(err, enc.AddObject("searchAttributes", v.SearchAttributes))
	}
	return err
}

// GetNewExecutionRunId returns the value of NewExecutionRunId if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionContinuedAsNewEventAttributes) GetNewExecutionRunId() (o string) {
	if v != nil && v.NewExecutionRunId != nil {
		return *v.NewExecutionRunId
	}

	return
}

// IsSetNewExecutionRunId returns true if NewExecutionRunId is not nil.
func (v *WorkflowExecutionContinuedAsNewEventAttributes) IsSetNewExecutionRunId() bool {
	return v != nil && v.NewExecutionRunId != nil
}

// GetWorkflowType returns the value of WorkflowType if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionContinuedAsNewEventAttributes) GetWorkflowType() (o *WorkflowType) {
	if v != nil && v.WorkflowType != nil {
		return v.WorkflowType
	}

	return
}

// IsSetWorkflowType returns true if WorkflowType is not nil.
func (v *WorkflowExecutionContinuedAsNewEventAttributes) IsSetWorkflowType() bool {
	return v != nil && v.WorkflowType != nil
}

// GetTaskList returns the value of TaskList if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionContinuedAsNewEventAttributes) GetTaskList() (o *TaskList) {
	if v != nil && v.TaskList != nil {
		return v.TaskList
	}

	return
}

// IsSetTaskList returns true if TaskList is not nil.
func (v *WorkflowExecutionContinuedAsNewEventAttributes) IsSetTaskList() bool {
	return v != nil && v.TaskList != nil
}

// GetInput returns the value of Input if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionContinuedAsNewEventAttributes) GetInput() (o []byte) {
	if v != nil && v.Input != nil {
		return v.Input
	}

	return
}

// IsSetInput returns true if Input is not nil.
func (v *WorkflowExecutionContinuedAsNewEventAttributes) IsSetInput() bool {
	return v != nil && v.Input != nil
}

// GetExecutionStartToCloseTimeoutSeconds returns the value of ExecutionStartToCloseTimeoutSeconds if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionContinuedAsNewEventAttributes) GetExecutionStartToCloseTimeoutSeconds() (o int32) {
	if v != nil && v.ExecutionStartToCloseTimeoutSeconds != nil {
		return *v.ExecutionStartToCloseTimeoutSeconds
	}

	return
}

// IsSetExecutionStartToCloseTimeoutSeconds returns true if ExecutionStartToCloseTimeoutSeconds is not nil.
func (v *WorkflowExecutionContinuedAsNewEventAttributes) IsSetExecutionStartToCloseTimeoutSeconds() bool {
	return v != nil && v.ExecutionStartToCloseTimeoutSeconds != nil
}

// GetTaskStartToCloseTimeoutSeconds returns the value of TaskStartToCloseTimeoutSeconds if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionContinuedAsNewEventAttributes) GetTaskStartToCloseTimeoutSeconds() (o int32) {
	if v != nil && v.TaskStartToCloseTimeoutSeconds != nil {
		return *v.TaskStartToCloseTimeoutSeconds
	}

	return
}

// IsSetTaskStartToCloseTimeoutSeconds returns true if TaskStartToCloseTimeoutSeconds is not nil.
func (v *WorkflowExecutionContinuedAsNewEventAttributes) IsSetTaskStartToCloseTimeoutSeconds() bool {
	return v != nil && v.TaskStartToCloseTimeoutSeconds != nil
}

// GetDecisionTaskCompletedEventId returns the value of DecisionTaskCompletedEventId if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionContinuedAsNewEventAttributes) GetDecisionTaskCompletedEventId() (o int64) {
	if v != nil && v.DecisionTaskCompletedEventId != nil {
		return *v.DecisionTaskCompletedEventId
	}

	return
}

// IsSetDecisionTaskCompletedEventId returns true if DecisionTaskCompletedEventId is not nil.
func (v *WorkflowExecutionContinuedAsNewEventAttributes) IsSetDecisionTaskCompletedEventId() bool {
	return v != nil && v.DecisionTaskCompletedEventId != nil
}

// GetBackoffStartIntervalInSeconds returns the value of BackoffStartIntervalInSeconds if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionContinuedAsNewEventAttributes) GetBackoffStartIntervalInSeconds() (o int32) {
	if v != nil && v.BackoffStartIntervalInSeconds != nil {
		return *v.BackoffStartIntervalInSeconds
	}

	return
}

// IsSetBackoffStartIntervalInSeconds returns true if BackoffStartIntervalInSeconds is not nil.
func (v *WorkflowExecutionContinuedAsNewEventAttributes) IsSetBackoffStartIntervalInSeconds() bool {
	return v != nil && v.BackoffStartIntervalInSeconds != nil
}

// GetInitiator returns the value of Initiator if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionContinuedAsNewEventAttributes) GetInitiator() (o ContinueAsNewInitiator) {
	if v != nil && v.Initiator != nil {
		return *v.Initiator
	}

	return
}

// IsSetInitiator returns true if Initiator is not nil.
func (v *WorkflowExecutionContinuedAsNewEventAttributes) IsSetInitiator() bool {
	return v != nil && v.Initiator != nil
}

// GetFailureReason returns the value of FailureReason if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionContinuedAsNewEventAttributes) GetFailureReason() (o string) {
	if v != nil && v.FailureReason != nil {
		return *v.FailureReason
	}

	return
}

// IsSetFailureReason returns true if FailureReason is not nil.
func (v *WorkflowExecutionContinuedAsNewEventAttributes) IsSetFailureReason() bool {
	return v != nil && v.FailureReason != nil
}

// GetFailureDetails returns the value of FailureDetails if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionContinuedAsNewEventAttributes) GetFailureDetails() (o []byte) {
	if v != nil && v.FailureDetails != nil {
		return v.FailureDetails
	}

	return
}

// IsSetFailureDetails returns true if FailureDetails is not nil.
func (v *WorkflowExecutionContinuedAsNewEventAttributes) IsSetFailureDetails() bool {
	return v != nil && v.FailureDetails != nil
}

// GetLastCompletionResult returns the value of LastCompletionResult if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionContinuedAsNewEventAttributes) GetLastCompletionResult() (o []byte) {
	if v != nil && v.LastCompletionResult != nil {
		return v.LastCompletionResult
	}

	return
}

// IsSetLastCompletionResult returns true if LastCompletionResult is not nil.
func (v *WorkflowExecutionContinuedAsNewEventAttributes) IsSetLastCompletionResult() bool {
	return v != nil && v.LastCompletionResult != nil
}

// GetHeader returns the value of Header if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionContinuedAsNewEventAttributes) GetHeader() (o *Header) {
	if v != nil && v.Header != nil {
		return v.Header
	}

	return
}

// IsSetHeader returns true if Header is not nil.
func (v *WorkflowExecutionContinuedAsNewEventAttributes) IsSetHeader() bool {
	return v != nil && v.Header != nil
}

// GetMemo returns the value of Memo if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionContinuedAsNewEventAttributes) GetMemo() (o *Memo) {
	if v != nil && v.Memo != nil {
		return v.Memo
	}

	return
}

// IsSetMemo returns true if Memo is not nil.
func (v *WorkflowExecutionContinuedAsNewEventAttributes) IsSetMemo() bool {
	return v != nil && v.Memo != nil
}

// GetSearchAttributes returns the value of SearchAttributes if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionContinuedAsNewEventAttributes) GetSearchAttributes() (o *SearchAttributes) {
	if v != nil && v.SearchAttributes != nil {
		return v.SearchAttributes
	}

	return
}

// IsSetSearchAttributes returns true if SearchAttributes is not nil.
func (v *WorkflowExecutionContinuedAsNewEventAttributes) IsSetSearchAttributes() bool {
	return v != nil && v.SearchAttributes != nil
}

type WorkflowExecutionFailedEventAttributes struct {
	Reason                       *string `json:"reason,omitempty"`
	Details                      []byte  `json:"details,omitempty"`
	DecisionTaskCompletedEventId *int64  `json:"decisionTaskCompletedEventId,omitempty"`
}

// ToWire translates a WorkflowExecutionFailedEventAttributes 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 *WorkflowExecutionFailedEventAttributes) ToWire() (wire.Value, error) {
	var (
		fields [3]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.Reason != nil {
		w, err = wire.NewValueString(*(v.Reason)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.Details != nil {
		w, err = wire.NewValueBinary(v.Details), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, 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: 30, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

// FromWire deserializes a WorkflowExecutionFailedEventAttributes 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 WorkflowExecutionFailedEventAttributes struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v WorkflowExecutionFailedEventAttributes
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *WorkflowExecutionFailedEventAttributes) 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.Reason = &x
				if err != nil {
					return err
				}

			}
		case 20:
			if field.Value.Type() == wire.TBinary {
				v.Details, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		case 30:
			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
}

// String returns a readable string representation of a WorkflowExecutionFailedEventAttributes
// struct.
func (v *WorkflowExecutionFailedEventAttributes) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [3]string
	i := 0
	if v.Reason != nil {
		fields[i] = fmt.Sprintf("Reason: %v", *(v.Reason))
		i++
	}
	if v.Details != nil {
		fields[i] = fmt.Sprintf("Details: %v", v.Details)
		i++
	}
	if v.DecisionTaskCompletedEventId != nil {
		fields[i] = fmt.Sprintf("DecisionTaskCompletedEventId: %v", *(v.DecisionTaskCompletedEventId))
		i++
	}

	return fmt.Sprintf("WorkflowExecutionFailedEventAttributes{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this WorkflowExecutionFailedEventAttributes match the
// provided WorkflowExecutionFailedEventAttributes.
//
// This function performs a deep comparison.
func (v *WorkflowExecutionFailedEventAttributes) Equals(rhs *WorkflowExecutionFailedEventAttributes) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.Reason, rhs.Reason) {
		return false
	}
	if !((v.Details == nil && rhs.Details == nil) || (v.Details != nil && rhs.Details != nil && bytes.Equal(v.Details, rhs.Details))) {
		return false
	}
	if !_I64_EqualsPtr(v.DecisionTaskCompletedEventId, rhs.DecisionTaskCompletedEventId) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of WorkflowExecutionFailedEventAttributes.
func (v *WorkflowExecutionFailedEventAttributes) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Reason != nil {
		enc.AddString("reason", *v.Reason)
	}
	if v.Details != nil {
		enc.AddString("details", base64.StdEncoding.EncodeToString(v.Details))
	}
	if v.DecisionTaskCompletedEventId != nil {
		enc.AddInt64("decisionTaskCompletedEventId", *v.DecisionTaskCompletedEventId)
	}
	return err
}

// GetReason returns the value of Reason if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionFailedEventAttributes) GetReason() (o string) {
	if v != nil && v.Reason != nil {
		return *v.Reason
	}

	return
}

// IsSetReason returns true if Reason is not nil.
func (v *WorkflowExecutionFailedEventAttributes) IsSetReason() bool {
	return v != nil && v.Reason != nil
}

// GetDetails returns the value of Details if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionFailedEventAttributes) GetDetails() (o []byte) {
	if v != nil && v.Details != nil {
		return v.Details
	}

	return
}

// IsSetDetails returns true if Details is not nil.
func (v *WorkflowExecutionFailedEventAttributes) IsSetDetails() bool {
	return v != nil && v.Details != nil
}

// GetDecisionTaskCompletedEventId returns the value of DecisionTaskCompletedEventId if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionFailedEventAttributes) GetDecisionTaskCompletedEventId() (o int64) {
	if v != nil && v.DecisionTaskCompletedEventId != nil {
		return *v.DecisionTaskCompletedEventId
	}

	return
}

// IsSetDecisionTaskCompletedEventId returns true if DecisionTaskCompletedEventId is not nil.
func (v *WorkflowExecutionFailedEventAttributes) IsSetDecisionTaskCompletedEventId() bool {
	return v != nil && v.DecisionTaskCompletedEventId != nil
}

type WorkflowExecutionFilter struct {
	WorkflowId *string `json:"workflowId,omitempty"`
	RunId      *string `json:"runId,omitempty"`
}

// ToWire translates a WorkflowExecutionFilter 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 *WorkflowExecutionFilter) ToWire() (wire.Value, error) {
	var (
		fields [2]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.WorkflowId != nil {
		w, err = wire.NewValueString(*(v.WorkflowId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.RunId != nil {
		w, err = wire.NewValueString(*(v.RunId)), 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
}

// FromWire deserializes a WorkflowExecutionFilter 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 WorkflowExecutionFilter struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v WorkflowExecutionFilter
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *WorkflowExecutionFilter) 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.WorkflowId = &x
				if err != nil {
					return err
				}

			}
		case 20:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.RunId = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a WorkflowExecutionFilter
// struct.
func (v *WorkflowExecutionFilter) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [2]string
	i := 0
	if v.WorkflowId != nil {
		fields[i] = fmt.Sprintf("WorkflowId: %v", *(v.WorkflowId))
		i++
	}
	if v.RunId != nil {
		fields[i] = fmt.Sprintf("RunId: %v", *(v.RunId))
		i++
	}

	return fmt.Sprintf("WorkflowExecutionFilter{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this WorkflowExecutionFilter match the
// provided WorkflowExecutionFilter.
//
// This function performs a deep comparison.
func (v *WorkflowExecutionFilter) Equals(rhs *WorkflowExecutionFilter) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.WorkflowId, rhs.WorkflowId) {
		return false
	}
	if !_String_EqualsPtr(v.RunId, rhs.RunId) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of WorkflowExecutionFilter.
func (v *WorkflowExecutionFilter) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.WorkflowId != nil {
		enc.AddString("workflowId", *v.WorkflowId)
	}
	if v.RunId != nil {
		enc.AddString("runId", *v.RunId)
	}
	return err
}

// GetWorkflowId returns the value of WorkflowId if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionFilter) GetWorkflowId() (o string) {
	if v != nil && v.WorkflowId != nil {
		return *v.WorkflowId
	}

	return
}

// IsSetWorkflowId returns true if WorkflowId is not nil.
func (v *WorkflowExecutionFilter) IsSetWorkflowId() bool {
	return v != nil && v.WorkflowId != nil
}

// GetRunId returns the value of RunId if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionFilter) GetRunId() (o string) {
	if v != nil && v.RunId != nil {
		return *v.RunId
	}

	return
}

// IsSetRunId returns true if RunId is not nil.
func (v *WorkflowExecutionFilter) IsSetRunId() bool {
	return v != nil && v.RunId != nil
}

type WorkflowExecutionInfo struct {
	Execution                    *WorkflowExecution            `json:"execution,omitempty"`
	Type                         *WorkflowType                 `json:"type,omitempty"`
	StartTime                    *int64                        `json:"startTime,omitempty"`
	CloseTime                    *int64                        `json:"closeTime,omitempty"`
	CloseStatus                  *WorkflowExecutionCloseStatus `json:"closeStatus,omitempty"`
	HistoryLength                *int64                        `json:"historyLength,omitempty"`
	ParentDomainId               *string                       `json:"parentDomainId,omitempty"`
	ParentDomainName             *string                       `json:"parentDomainName,omitempty"`
	ParentInitatedId             *int64                        `json:"parentInitatedId,omitempty"`
	ParentExecution              *WorkflowExecution            `json:"parentExecution,omitempty"`
	ExecutionTime                *int64                        `json:"executionTime,omitempty"`
	Memo                         *Memo                         `json:"memo,omitempty"`
	SearchAttributes             *SearchAttributes             `json:"searchAttributes,omitempty"`
	AutoResetPoints              *ResetPoints                  `json:"autoResetPoints,omitempty"`
	TaskList                     *string                       `json:"taskList,omitempty"`
	TaskListInfo                 *TaskList                     `json:"taskListInfo,omitempty"`
	IsCron                       *bool                         `json:"isCron,omitempty"`
	UpdateTime                   *int64                        `json:"updateTime,omitempty"`
	PartitionConfig              map[string]string             `json:"partitionConfig,omitempty"`
	CronOverlapPolicy            *CronOverlapPolicy            `json:"cronOverlapPolicy,omitempty"`
	ActiveClusterSelectionPolicy *ActiveClusterSelectionPolicy `json:"activeClusterSelectionPolicy,omitempty"`
}

// ToWire translates a WorkflowExecutionInfo 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 *WorkflowExecutionInfo) ToWire() (wire.Value, error) {
	var (
		fields [21]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.Execution != nil {
		w, err = v.Execution.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.Type != nil {
		w, err = v.Type.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.StartTime != nil {
		w, err = wire.NewValueI64(*(v.StartTime)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.CloseTime != nil {
		w, err = wire.NewValueI64(*(v.CloseTime)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 40, Value: w}
		i++
	}
	if v.CloseStatus != nil {
		w, err = v.CloseStatus.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 50, Value: w}
		i++
	}
	if v.HistoryLength != nil {
		w, err = wire.NewValueI64(*(v.HistoryLength)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 60, Value: w}
		i++
	}
	if v.ParentDomainId != nil {
		w, err = wire.NewValueString(*(v.ParentDomainId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 70, Value: w}
		i++
	}
	if v.ParentDomainName != nil {
		w, err = wire.NewValueString(*(v.ParentDomainName)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 71, Value: w}
		i++
	}
	if v.ParentInitatedId != nil {
		w, err = wire.NewValueI64(*(v.ParentInitatedId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 72, Value: w}
		i++
	}
	if v.ParentExecution != nil {
		w, err = v.ParentExecution.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 80, Value: w}
		i++
	}
	if v.ExecutionTime != nil {
		w, err = wire.NewValueI64(*(v.ExecutionTime)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 90, Value: w}
		i++
	}
	if v.Memo != nil {
		w, err = v.Memo.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 100, Value: w}
		i++
	}
	if v.SearchAttributes != nil {
		w, err = v.SearchAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 101, Value: w}
		i++
	}
	if v.AutoResetPoints != nil {
		w, err = v.AutoResetPoints.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 110, Value: w}
		i++
	}
	if v.TaskList != nil {
		w, err = wire.NewValueString(*(v.TaskList)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 120, Value: w}
		i++
	}
	if v.TaskListInfo != nil {
		w, err = v.TaskListInfo.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 121, Value: w}
		i++
	}
	if v.IsCron != nil {
		w, err = wire.NewValueBool(*(v.IsCron)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 130, Value: w}
		i++
	}
	if v.UpdateTime != nil {
		w, err = wire.NewValueI64(*(v.UpdateTime)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 140, 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: 150, Value: w}
		i++
	}
	if v.CronOverlapPolicy != nil {
		w, err = v.CronOverlapPolicy.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 160, Value: w}
		i++
	}
	if v.ActiveClusterSelectionPolicy != nil {
		w, err = v.ActiveClusterSelectionPolicy.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 _ResetPoints_Read(w wire.Value) (*ResetPoints, error) {
	var v ResetPoints
	err := v.FromWire(w)
	return &v, err
}

// FromWire deserializes a WorkflowExecutionInfo 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 WorkflowExecutionInfo struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v WorkflowExecutionInfo
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *WorkflowExecutionInfo) 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.Execution, err = _WorkflowExecution_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 20:
			if field.Value.Type() == wire.TStruct {
				v.Type, err = _WorkflowType_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 30:
			if field.Value.Type() == wire.TI64 {
				var x int64
				x, err = field.Value.GetI64(), error(nil)
				v.StartTime = &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.CloseTime = &x
				if err != nil {
					return err
				}

			}
		case 50:
			if field.Value.Type() == wire.TI32 {
				var x WorkflowExecutionCloseStatus
				x, err = _WorkflowExecutionCloseStatus_Read(field.Value)
				v.CloseStatus = &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.HistoryLength = &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.ParentDomainId = &x
				if err != nil {
					return err
				}

			}
		case 71:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.ParentDomainName = &x
				if err != nil {
					return err
				}

			}
		case 72:
			if field.Value.Type() == wire.TI64 {
				var x int64
				x, err = field.Value.GetI64(), error(nil)
				v.ParentInitatedId = &x
				if err != nil {
					return err
				}

			}
		case 80:
			if field.Value.Type() == wire.TStruct {
				v.ParentExecution, err = _WorkflowExecution_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 90:
			if field.Value.Type() == wire.TI64 {
				var x int64
				x, err = field.Value.GetI64(), error(nil)
				v.ExecutionTime = &x
				if err != nil {
					return err
				}

			}
		case 100:
			if field.Value.Type() == wire.TStruct {
				v.Memo, err = _Memo_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 101:
			if field.Value.Type() == wire.TStruct {
				v.SearchAttributes, err = _SearchAttributes_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 110:
			if field.Value.Type() == wire.TStruct {
				v.AutoResetPoints, err = _ResetPoints_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 120:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.TaskList = &x
				if err != nil {
					return err
				}

			}
		case 121:
			if field.Value.Type() == wire.TStruct {
				v.TaskListInfo, err = _TaskList_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 130:
			if field.Value.Type() == wire.TBool {
				var x bool
				x, err = field.Value.GetBool(), error(nil)
				v.IsCron = &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.UpdateTime = &x
				if err != nil {
					return err
				}

			}
		case 150:
			if field.Value.Type() == wire.TMap {
				v.PartitionConfig, err = _Map_String_String_Read(field.Value.GetMap())
				if err != nil {
					return err
				}

			}
		case 160:
			if field.Value.Type() == wire.TI32 {
				var x CronOverlapPolicy
				x, err = _CronOverlapPolicy_Read(field.Value)
				v.CronOverlapPolicy = &x
				if err != nil {
					return err
				}

			}
		case 170:
			if field.Value.Type() == wire.TStruct {
				v.ActiveClusterSelectionPolicy, err = _ActiveClusterSelectionPolicy_Read(field.Value)
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a WorkflowExecutionInfo
// struct.
func (v *WorkflowExecutionInfo) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [21]string
	i := 0
	if v.Execution != nil {
		fields[i] = fmt.Sprintf("Execution: %v", v.Execution)
		i++
	}
	if v.Type != nil {
		fields[i] = fmt.Sprintf("Type: %v", v.Type)
		i++
	}
	if v.StartTime != nil {
		fields[i] = fmt.Sprintf("StartTime: %v", *(v.StartTime))
		i++
	}
	if v.CloseTime != nil {
		fields[i] = fmt.Sprintf("CloseTime: %v", *(v.CloseTime))
		i++
	}
	if v.CloseStatus != nil {
		fields[i] = fmt.Sprintf("CloseStatus: %v", *(v.CloseStatus))
		i++
	}
	if v.HistoryLength != nil {
		fields[i] = fmt.Sprintf("HistoryLength: %v", *(v.HistoryLength))
		i++
	}
	if v.ParentDomainId != nil {
		fields[i] = fmt.Sprintf("ParentDomainId: %v", *(v.ParentDomainId))
		i++
	}
	if v.ParentDomainName != nil {
		fields[i] = fmt.Sprintf("ParentDomainName: %v", *(v.ParentDomainName))
		i++
	}
	if v.ParentInitatedId != nil {
		fields[i] = fmt.Sprintf("ParentInitatedId: %v", *(v.ParentInitatedId))
		i++
	}
	if v.ParentExecution != nil {
		fields[i] = fmt.Sprintf("ParentExecution: %v", v.ParentExecution)
		i++
	}
	if v.ExecutionTime != nil {
		fields[i] = fmt.Sprintf("ExecutionTime: %v", *(v.ExecutionTime))
		i++
	}
	if v.Memo != nil {
		fields[i] = fmt.Sprintf("Memo: %v", v.Memo)
		i++
	}
	if v.SearchAttributes != nil {
		fields[i] = fmt.Sprintf("SearchAttributes: %v", v.SearchAttributes)
		i++
	}
	if v.AutoResetPoints != nil {
		fields[i] = fmt.Sprintf("AutoResetPoints: %v", v.AutoResetPoints)
		i++
	}
	if v.TaskList != nil {
		fields[i] = fmt.Sprintf("TaskList: %v", *(v.TaskList))
		i++
	}
	if v.TaskListInfo != nil {
		fields[i] = fmt.Sprintf("TaskListInfo: %v", v.TaskListInfo)
		i++
	}
	if v.IsCron != nil {
		fields[i] = fmt.Sprintf("IsCron: %v", *(v.IsCron))
		i++
	}
	if v.UpdateTime != nil {
		fields[i] = fmt.Sprintf("UpdateTime: %v", *(v.UpdateTime))
		i++
	}
	if v.PartitionConfig != nil {
		fields[i] = fmt.Sprintf("PartitionConfig: %v", v.PartitionConfig)
		i++
	}
	if v.CronOverlapPolicy != nil {
		fields[i] = fmt.Sprintf("CronOverlapPolicy: %v", *(v.CronOverlapPolicy))
		i++
	}
	if v.ActiveClusterSelectionPolicy != nil {
		fields[i] = fmt.Sprintf("ActiveClusterSelectionPolicy: %v", v.ActiveClusterSelectionPolicy)
		i++
	}

	return fmt.Sprintf("WorkflowExecutionInfo{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this WorkflowExecutionInfo match the
// provided WorkflowExecutionInfo.
//
// This function performs a deep comparison.
func (v *WorkflowExecutionInfo) Equals(rhs *WorkflowExecutionInfo) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !((v.Execution == nil && rhs.Execution == nil) || (v.Execution != nil && rhs.Execution != nil && v.Execution.Equals(rhs.Execution))) {
		return false
	}
	if !((v.Type == nil && rhs.Type == nil) || (v.Type != nil && rhs.Type != nil && v.Type.Equals(rhs.Type))) {
		return false
	}
	if !_I64_EqualsPtr(v.StartTime, rhs.StartTime) {
		return false
	}
	if !_I64_EqualsPtr(v.CloseTime, rhs.CloseTime) {
		return false
	}
	if !_WorkflowExecutionCloseStatus_EqualsPtr(v.CloseStatus, rhs.CloseStatus) {
		return false
	}
	if !_I64_EqualsPtr(v.HistoryLength, rhs.HistoryLength) {
		return false
	}
	if !_String_EqualsPtr(v.ParentDomainId, rhs.ParentDomainId) {
		return false
	}
	if !_String_EqualsPtr(v.ParentDomainName, rhs.ParentDomainName) {
		return false
	}
	if !_I64_EqualsPtr(v.ParentInitatedId, rhs.ParentInitatedId) {
		return false
	}
	if !((v.ParentExecution == nil && rhs.ParentExecution == nil) || (v.ParentExecution != nil && rhs.ParentExecution != nil && v.ParentExecution.Equals(rhs.ParentExecution))) {
		return false
	}
	if !_I64_EqualsPtr(v.ExecutionTime, rhs.ExecutionTime) {
		return false
	}
	if !((v.Memo == nil && rhs.Memo == nil) || (v.Memo != nil && rhs.Memo != nil && v.Memo.Equals(rhs.Memo))) {
		return false
	}
	if !((v.SearchAttributes == nil && rhs.SearchAttributes == nil) || (v.SearchAttributes != nil && rhs.SearchAttributes != nil && v.SearchAttributes.Equals(rhs.SearchAttributes))) {
		return false
	}
	if !((v.AutoResetPoints == nil && rhs.AutoResetPoints == nil) || (v.AutoResetPoints != nil && rhs.AutoResetPoints != nil && v.AutoResetPoints.Equals(rhs.AutoResetPoints))) {
		return false
	}
	if !_String_EqualsPtr(v.TaskList, rhs.TaskList) {
		return false
	}
	if !((v.TaskListInfo == nil && rhs.TaskListInfo == nil) || (v.TaskListInfo != nil && rhs.TaskListInfo != nil && v.TaskListInfo.Equals(rhs.TaskListInfo))) {
		return false
	}
	if !_Bool_EqualsPtr(v.IsCron, rhs.IsCron) {
		return false
	}
	if !_I64_EqualsPtr(v.UpdateTime, rhs.UpdateTime) {
		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
	}
	if !_CronOverlapPolicy_EqualsPtr(v.CronOverlapPolicy, rhs.CronOverlapPolicy) {
		return false
	}
	if !((v.ActiveClusterSelectionPolicy == nil && rhs.ActiveClusterSelectionPolicy == nil) || (v.ActiveClusterSelectionPolicy != nil && rhs.ActiveClusterSelectionPolicy != nil && v.ActiveClusterSelectionPolicy.Equals(rhs.ActiveClusterSelectionPolicy))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of WorkflowExecutionInfo.
func (v *WorkflowExecutionInfo) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Execution != nil {
		err = multierr.Append(err, enc.AddObject("execution", v.Execution))
	}
	if v.Type != nil {
		err = multierr.Append(err, enc.AddObject("type", v.Type))
	}
	if v.StartTime != nil {
		enc.AddInt64("startTime", *v.StartTime)
	}
	if v.CloseTime != nil {
		enc.AddInt64("closeTime", *v.CloseTime)
	}
	if v.CloseStatus != nil {
		err = multierr.Append(err, enc.AddObject("closeStatus", *v.CloseStatus))
	}
	if v.HistoryLength != nil {
		enc.AddInt64("historyLength", *v.HistoryLength)
	}
	if v.ParentDomainId != nil {
		enc.AddString("parentDomainId", *v.ParentDomainId)
	}
	if v.ParentDomainName != nil {
		enc.AddString("parentDomainName", *v.ParentDomainName)
	}
	if v.ParentInitatedId != nil {
		enc.AddInt64("parentInitatedId", *v.ParentInitatedId)
	}
	if v.ParentExecution != nil {
		err = multierr.Append(err, enc.AddObject("parentExecution", v.ParentExecution))
	}
	if v.ExecutionTime != nil {
		enc.AddInt64("executionTime", *v.ExecutionTime)
	}
	if v.Memo != nil {
		err = multierr.Append(err, enc.AddObject("memo", v.Memo))
	}
	if v.SearchAttributes != nil {
		err = multierr.Append(err, enc.AddObject("searchAttributes", v.SearchAttributes))
	}
	if v.AutoResetPoints != nil {
		err = multierr.Append(err, enc.AddObject("autoResetPoints", v.AutoResetPoints))
	}
	if v.TaskList != nil {
		enc.AddString("taskList", *v.TaskList)
	}
	if v.TaskListInfo != nil {
		err = multierr.Append(err, enc.AddObject("taskListInfo", v.TaskListInfo))
	}
	if v.IsCron != nil {
		enc.AddBool("isCron", *v.IsCron)
	}
	if v.UpdateTime != nil {
		enc.AddInt64("updateTime", *v.UpdateTime)
	}
	if v.PartitionConfig != nil {
		err = multierr.Append(err, enc.AddObject("partitionConfig", (_Map_String_String_Zapper)(v.PartitionConfig)))
	}
	if v.CronOverlapPolicy != nil {
		err = multierr.Append(err, enc.AddObject("cronOverlapPolicy", *v.CronOverlapPolicy))
	}
	if v.ActiveClusterSelectionPolicy != nil {
		err = multierr.Append(err, enc.AddObject("activeClusterSelectionPolicy", v.ActiveClusterSelectionPolicy))
	}
	return err
}

// GetExecution returns the value of Execution if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionInfo) GetExecution() (o *WorkflowExecution) {
	if v != nil && v.Execution != nil {
		return v.Execution
	}

	return
}

// IsSetExecution returns true if Execution is not nil.
func (v *WorkflowExecutionInfo) IsSetExecution() bool {
	return v != nil && v.Execution != nil
}

// GetType returns the value of Type if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionInfo) GetType() (o *WorkflowType) {
	if v != nil && v.Type != nil {
		return v.Type
	}

	return
}

// IsSetType returns true if Type is not nil.
func (v *WorkflowExecutionInfo) IsSetType() bool {
	return v != nil && v.Type != nil
}

// GetStartTime returns the value of StartTime if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionInfo) GetStartTime() (o int64) {
	if v != nil && v.StartTime != nil {
		return *v.StartTime
	}

	return
}

// IsSetStartTime returns true if StartTime is not nil.
func (v *WorkflowExecutionInfo) IsSetStartTime() bool {
	return v != nil && v.StartTime != nil
}

// GetCloseTime returns the value of CloseTime if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionInfo) GetCloseTime() (o int64) {
	if v != nil && v.CloseTime != nil {
		return *v.CloseTime
	}

	return
}

// IsSetCloseTime returns true if CloseTime is not nil.
func (v *WorkflowExecutionInfo) IsSetCloseTime() bool {
	return v != nil && v.CloseTime != nil
}

// GetCloseStatus returns the value of CloseStatus if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionInfo) GetCloseStatus() (o WorkflowExecutionCloseStatus) {
	if v != nil && v.CloseStatus != nil {
		return *v.CloseStatus
	}

	return
}

// IsSetCloseStatus returns true if CloseStatus is not nil.
func (v *WorkflowExecutionInfo) IsSetCloseStatus() bool {
	return v != nil && v.CloseStatus != nil
}

// GetHistoryLength returns the value of HistoryLength if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionInfo) GetHistoryLength() (o int64) {
	if v != nil && v.HistoryLength != nil {
		return *v.HistoryLength
	}

	return
}

// IsSetHistoryLength returns true if HistoryLength is not nil.
func (v *WorkflowExecutionInfo) IsSetHistoryLength() bool {
	return v != nil && v.HistoryLength != nil
}

// GetParentDomainId returns the value of ParentDomainId if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionInfo) GetParentDomainId() (o string) {
	if v != nil && v.ParentDomainId != nil {
		return *v.ParentDomainId
	}

	return
}

// IsSetParentDomainId returns true if ParentDomainId is not nil.
func (v *WorkflowExecutionInfo) IsSetParentDomainId() bool {
	return v != nil && v.ParentDomainId != nil
}

// GetParentDomainName returns the value of ParentDomainName if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionInfo) GetParentDomainName() (o string) {
	if v != nil && v.ParentDomainName != nil {
		return *v.ParentDomainName
	}

	return
}

// IsSetParentDomainName returns true if ParentDomainName is not nil.
func (v *WorkflowExecutionInfo) IsSetParentDomainName() bool {
	return v != nil && v.ParentDomainName != nil
}

// GetParentInitatedId returns the value of ParentInitatedId if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionInfo) GetParentInitatedId() (o int64) {
	if v != nil && v.ParentInitatedId != nil {
		return *v.ParentInitatedId
	}

	return
}

// IsSetParentInitatedId returns true if ParentInitatedId is not nil.
func (v *WorkflowExecutionInfo) IsSetParentInitatedId() bool {
	return v != nil && v.ParentInitatedId != nil
}

// GetParentExecution returns the value of ParentExecution if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionInfo) GetParentExecution() (o *WorkflowExecution) {
	if v != nil && v.ParentExecution != nil {
		return v.ParentExecution
	}

	return
}

// IsSetParentExecution returns true if ParentExecution is not nil.
func (v *WorkflowExecutionInfo) IsSetParentExecution() bool {
	return v != nil && v.ParentExecution != nil
}

// GetExecutionTime returns the value of ExecutionTime if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionInfo) GetExecutionTime() (o int64) {
	if v != nil && v.ExecutionTime != nil {
		return *v.ExecutionTime
	}

	return
}

// IsSetExecutionTime returns true if ExecutionTime is not nil.
func (v *WorkflowExecutionInfo) IsSetExecutionTime() bool {
	return v != nil && v.ExecutionTime != nil
}

// GetMemo returns the value of Memo if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionInfo) GetMemo() (o *Memo) {
	if v != nil && v.Memo != nil {
		return v.Memo
	}

	return
}

// IsSetMemo returns true if Memo is not nil.
func (v *WorkflowExecutionInfo) IsSetMemo() bool {
	return v != nil && v.Memo != nil
}

// GetSearchAttributes returns the value of SearchAttributes if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionInfo) GetSearchAttributes() (o *SearchAttributes) {
	if v != nil && v.SearchAttributes != nil {
		return v.SearchAttributes
	}

	return
}

// IsSetSearchAttributes returns true if SearchAttributes is not nil.
func (v *WorkflowExecutionInfo) IsSetSearchAttributes() bool {
	return v != nil && v.SearchAttributes != nil
}

// GetAutoResetPoints returns the value of AutoResetPoints if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionInfo) GetAutoResetPoints() (o *ResetPoints) {
	if v != nil && v.AutoResetPoints != nil {
		return v.AutoResetPoints
	}

	return
}

// IsSetAutoResetPoints returns true if AutoResetPoints is not nil.
func (v *WorkflowExecutionInfo) IsSetAutoResetPoints() bool {
	return v != nil && v.AutoResetPoints != nil
}

// GetTaskList returns the value of TaskList if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionInfo) GetTaskList() (o string) {
	if v != nil && v.TaskList != nil {
		return *v.TaskList
	}

	return
}

// IsSetTaskList returns true if TaskList is not nil.
func (v *WorkflowExecutionInfo) IsSetTaskList() bool {
	return v != nil && v.TaskList != nil
}

// GetTaskListInfo returns the value of TaskListInfo if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionInfo) GetTaskListInfo() (o *TaskList) {
	if v != nil && v.TaskListInfo != nil {
		return v.TaskListInfo
	}

	return
}

// IsSetTaskListInfo returns true if TaskListInfo is not nil.
func (v *WorkflowExecutionInfo) IsSetTaskListInfo() bool {
	return v != nil && v.TaskListInfo != nil
}

// GetIsCron returns the value of IsCron if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionInfo) GetIsCron() (o bool) {
	if v != nil && v.IsCron != nil {
		return *v.IsCron
	}

	return
}

// IsSetIsCron returns true if IsCron is not nil.
func (v *WorkflowExecutionInfo) IsSetIsCron() bool {
	return v != nil && v.IsCron != nil
}

// GetUpdateTime returns the value of UpdateTime if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionInfo) GetUpdateTime() (o int64) {
	if v != nil && v.UpdateTime != nil {
		return *v.UpdateTime
	}

	return
}

// IsSetUpdateTime returns true if UpdateTime is not nil.
func (v *WorkflowExecutionInfo) IsSetUpdateTime() bool {
	return v != nil && v.UpdateTime != nil
}

// GetPartitionConfig returns the value of PartitionConfig if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionInfo) 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 *WorkflowExecutionInfo) IsSetPartitionConfig() bool {
	return v != nil && v.PartitionConfig != nil
}

// GetCronOverlapPolicy returns the value of CronOverlapPolicy if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionInfo) GetCronOverlapPolicy() (o CronOverlapPolicy) {
	if v != nil && v.CronOverlapPolicy != nil {
		return *v.CronOverlapPolicy
	}

	return
}

// IsSetCronOverlapPolicy returns true if CronOverlapPolicy is not nil.
func (v *WorkflowExecutionInfo) IsSetCronOverlapPolicy() bool {
	return v != nil && v.CronOverlapPolicy != nil
}

// GetActiveClusterSelectionPolicy returns the value of ActiveClusterSelectionPolicy if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionInfo) GetActiveClusterSelectionPolicy() (o *ActiveClusterSelectionPolicy) {
	if v != nil && v.ActiveClusterSelectionPolicy != nil {
		return v.ActiveClusterSelectionPolicy
	}

	return
}

// IsSetActiveClusterSelectionPolicy returns true if ActiveClusterSelectionPolicy is not nil.
func (v *WorkflowExecutionInfo) IsSetActiveClusterSelectionPolicy() bool {
	return v != nil && v.ActiveClusterSelectionPolicy != nil
}

type WorkflowExecutionSignaledEventAttributes struct {
	SignalName *string `json:"signalName,omitempty"`
	Input      []byte  `json:"input,omitempty"`
	Identity   *string `json:"identity,omitempty"`
	RequestId  *string `json:"requestId,omitempty"`
}

// ToWire translates a WorkflowExecutionSignaledEventAttributes 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 *WorkflowExecutionSignaledEventAttributes) ToWire() (wire.Value, error) {
	var (
		fields [4]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.SignalName != nil {
		w, err = wire.NewValueString(*(v.SignalName)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.Input != nil {
		w, err = wire.NewValueBinary(v.Input), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, 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: 30, Value: w}
		i++
	}
	if v.RequestId != nil {
		w, err = wire.NewValueString(*(v.RequestId)), 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 WorkflowExecutionSignaledEventAttributes 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 WorkflowExecutionSignaledEventAttributes struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v WorkflowExecutionSignaledEventAttributes
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *WorkflowExecutionSignaledEventAttributes) 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.SignalName = &x
				if err != nil {
					return err
				}

			}
		case 20:
			if field.Value.Type() == wire.TBinary {
				v.Input, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		case 30:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.Identity = &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.RequestId = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a WorkflowExecutionSignaledEventAttributes
// struct.
func (v *WorkflowExecutionSignaledEventAttributes) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [4]string
	i := 0
	if v.SignalName != nil {
		fields[i] = fmt.Sprintf("SignalName: %v", *(v.SignalName))
		i++
	}
	if v.Input != nil {
		fields[i] = fmt.Sprintf("Input: %v", v.Input)
		i++
	}
	if v.Identity != nil {
		fields[i] = fmt.Sprintf("Identity: %v", *(v.Identity))
		i++
	}
	if v.RequestId != nil {
		fields[i] = fmt.Sprintf("RequestId: %v", *(v.RequestId))
		i++
	}

	return fmt.Sprintf("WorkflowExecutionSignaledEventAttributes{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this WorkflowExecutionSignaledEventAttributes match the
// provided WorkflowExecutionSignaledEventAttributes.
//
// This function performs a deep comparison.
func (v *WorkflowExecutionSignaledEventAttributes) Equals(rhs *WorkflowExecutionSignaledEventAttributes) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.SignalName, rhs.SignalName) {
		return false
	}
	if !((v.Input == nil && rhs.Input == nil) || (v.Input != nil && rhs.Input != nil && bytes.Equal(v.Input, rhs.Input))) {
		return false
	}
	if !_String_EqualsPtr(v.Identity, rhs.Identity) {
		return false
	}
	if !_String_EqualsPtr(v.RequestId, rhs.RequestId) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of WorkflowExecutionSignaledEventAttributes.
func (v *WorkflowExecutionSignaledEventAttributes) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.SignalName != nil {
		enc.AddString("signalName", *v.SignalName)
	}
	if v.Input != nil {
		enc.AddString("input", base64.StdEncoding.EncodeToString(v.Input))
	}
	if v.Identity != nil {
		enc.AddString("identity", *v.Identity)
	}
	if v.RequestId != nil {
		enc.AddString("requestId", *v.RequestId)
	}
	return err
}

// GetSignalName returns the value of SignalName if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionSignaledEventAttributes) GetSignalName() (o string) {
	if v != nil && v.SignalName != nil {
		return *v.SignalName
	}

	return
}

// IsSetSignalName returns true if SignalName is not nil.
func (v *WorkflowExecutionSignaledEventAttributes) IsSetSignalName() bool {
	return v != nil && v.SignalName != nil
}

// GetInput returns the value of Input if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionSignaledEventAttributes) GetInput() (o []byte) {
	if v != nil && v.Input != nil {
		return v.Input
	}

	return
}

// IsSetInput returns true if Input is not nil.
func (v *WorkflowExecutionSignaledEventAttributes) IsSetInput() bool {
	return v != nil && v.Input != nil
}

// GetIdentity returns the value of Identity if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionSignaledEventAttributes) GetIdentity() (o string) {
	if v != nil && v.Identity != nil {
		return *v.Identity
	}

	return
}

// IsSetIdentity returns true if Identity is not nil.
func (v *WorkflowExecutionSignaledEventAttributes) IsSetIdentity() bool {
	return v != nil && v.Identity != nil
}

// GetRequestId returns the value of RequestId if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionSignaledEventAttributes) GetRequestId() (o string) {
	if v != nil && v.RequestId != nil {
		return *v.RequestId
	}

	return
}

// IsSetRequestId returns true if RequestId is not nil.
func (v *WorkflowExecutionSignaledEventAttributes) IsSetRequestId() bool {
	return v != nil && v.RequestId != nil
}

type WorkflowExecutionStartedEventAttributes struct {
	WorkflowType                        *WorkflowType                 `json:"workflowType,omitempty"`
	ParentWorkflowDomain                *string                       `json:"parentWorkflowDomain,omitempty"`
	ParentWorkflowExecution             *WorkflowExecution            `json:"parentWorkflowExecution,omitempty"`
	ParentInitiatedEventId              *int64                        `json:"parentInitiatedEventId,omitempty"`
	TaskList                            *TaskList                     `json:"taskList,omitempty"`
	Input                               []byte                        `json:"input,omitempty"`
	ExecutionStartToCloseTimeoutSeconds *int32                        `json:"executionStartToCloseTimeoutSeconds,omitempty"`
	TaskStartToCloseTimeoutSeconds      *int32                        `json:"taskStartToCloseTimeoutSeconds,omitempty"`
	ContinuedExecutionRunId             *string                       `json:"continuedExecutionRunId,omitempty"`
	Initiator                           *ContinueAsNewInitiator       `json:"initiator,omitempty"`
	ContinuedFailureReason              *string                       `json:"continuedFailureReason,omitempty"`
	ContinuedFailureDetails             []byte                        `json:"continuedFailureDetails,omitempty"`
	LastCompletionResult                []byte                        `json:"lastCompletionResult,omitempty"`
	OriginalExecutionRunId              *string                       `json:"originalExecutionRunId,omitempty"`
	Identity                            *string                       `json:"identity,omitempty"`
	FirstExecutionRunId                 *string                       `json:"firstExecutionRunId,omitempty"`
	FirstScheduledTimeNano              *int64                        `json:"firstScheduledTimeNano,omitempty"`
	RetryPolicy                         *RetryPolicy                  `json:"retryPolicy,omitempty"`
	Attempt                             *int32                        `json:"attempt,omitempty"`
	ExpirationTimestamp                 *int64                        `json:"expirationTimestamp,omitempty"`
	CronSchedule                        *string                       `json:"cronSchedule,omitempty"`
	FirstDecisionTaskBackoffSeconds     *int32                        `json:"firstDecisionTaskBackoffSeconds,omitempty"`
	Memo                                *Memo                         `json:"memo,omitempty"`
	SearchAttributes                    *SearchAttributes             `json:"searchAttributes,omitempty"`
	PrevAutoResetPoints                 *ResetPoints                  `json:"prevAutoResetPoints,omitempty"`
	Header                              *Header                       `json:"header,omitempty"`
	PartitionConfig                     map[string]string             `json:"partitionConfig,omitempty"`
	RequestId                           *string                       `json:"requestId,omitempty"`
	CronOverlapPolicy                   *CronOverlapPolicy            `json:"cronOverlapPolicy,omitempty"`
	ActiveClusterSelectionPolicy        *ActiveClusterSelectionPolicy `json:"activeClusterSelectionPolicy,omitempty"`
}

// ToWire translates a WorkflowExecutionStartedEventAttributes 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 *WorkflowExecutionStartedEventAttributes) ToWire() (wire.Value, error) {
	var (
		fields [30]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.WorkflowType != nil {
		w, err = v.WorkflowType.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.ParentWorkflowDomain != nil {
		w, err = wire.NewValueString(*(v.ParentWorkflowDomain)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 12, Value: w}
		i++
	}
	if v.ParentWorkflowExecution != nil {
		w, err = v.ParentWorkflowExecution.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 14, Value: w}
		i++
	}
	if v.ParentInitiatedEventId != nil {
		w, err = wire.NewValueI64(*(v.ParentInitiatedEventId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 16, 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.Input != nil {
		w, err = wire.NewValueBinary(v.Input), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}
	if v.ExecutionStartToCloseTimeoutSeconds != nil {
		w, err = wire.NewValueI32(*(v.ExecutionStartToCloseTimeoutSeconds)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 40, Value: w}
		i++
	}
	if v.TaskStartToCloseTimeoutSeconds != nil {
		w, err = wire.NewValueI32(*(v.TaskStartToCloseTimeoutSeconds)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 50, Value: w}
		i++
	}
	if v.ContinuedExecutionRunId != nil {
		w, err = wire.NewValueString(*(v.ContinuedExecutionRunId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 54, Value: w}
		i++
	}
	if v.Initiator != nil {
		w, err = v.Initiator.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 55, Value: w}
		i++
	}
	if v.ContinuedFailureReason != nil {
		w, err = wire.NewValueString(*(v.ContinuedFailureReason)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 56, Value: w}
		i++
	}
	if v.ContinuedFailureDetails != nil {
		w, err = wire.NewValueBinary(v.ContinuedFailureDetails), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 57, Value: w}
		i++
	}
	if v.LastCompletionResult != nil {
		w, err = wire.NewValueBinary(v.LastCompletionResult), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 58, Value: w}
		i++
	}
	if v.OriginalExecutionRunId != nil {
		w, err = wire.NewValueString(*(v.OriginalExecutionRunId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 59, 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: 60, Value: w}
		i++
	}
	if v.FirstExecutionRunId != nil {
		w, err = wire.NewValueString(*(v.FirstExecutionRunId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 61, Value: w}
		i++
	}
	if v.FirstScheduledTimeNano != nil {
		w, err = wire.NewValueI64(*(v.FirstScheduledTimeNano)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 62, Value: w}
		i++
	}
	if v.RetryPolicy != nil {
		w, err = v.RetryPolicy.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 70, Value: w}
		i++
	}
	if v.Attempt != nil {
		w, err = wire.NewValueI32(*(v.Attempt)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 80, Value: w}
		i++
	}
	if v.ExpirationTimestamp != nil {
		w, err = wire.NewValueI64(*(v.ExpirationTimestamp)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 90, Value: w}
		i++
	}
	if v.CronSchedule != nil {
		w, err = wire.NewValueString(*(v.CronSchedule)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 100, Value: w}
		i++
	}
	if v.FirstDecisionTaskBackoffSeconds != nil {
		w, err = wire.NewValueI32(*(v.FirstDecisionTaskBackoffSeconds)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 110, Value: w}
		i++
	}
	if v.Memo != nil {
		w, err = v.Memo.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 120, Value: w}
		i++
	}
	if v.SearchAttributes != nil {
		w, err = v.SearchAttributes.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 121, Value: w}
		i++
	}
	if v.PrevAutoResetPoints != nil {
		w, err = v.PrevAutoResetPoints.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 130, Value: w}
		i++
	}
	if v.Header != nil {
		w, err = v.Header.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 140, 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: 150, Value: w}
		i++
	}
	if v.RequestId != nil {
		w, err = wire.NewValueString(*(v.RequestId)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 160, Value: w}
		i++
	}
	if v.CronOverlapPolicy != nil {
		w, err = v.CronOverlapPolicy.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 170, Value: w}
		i++
	}
	if v.ActiveClusterSelectionPolicy != nil {
		w, err = v.ActiveClusterSelectionPolicy.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 180, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

// FromWire deserializes a WorkflowExecutionStartedEventAttributes 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 WorkflowExecutionStartedEventAttributes struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v WorkflowExecutionStartedEventAttributes
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *WorkflowExecutionStartedEventAttributes) 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.WorkflowType, err = _WorkflowType_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 12:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.ParentWorkflowDomain = &x
				if err != nil {
					return err
				}

			}
		case 14:
			if field.Value.Type() == wire.TStruct {
				v.ParentWorkflowExecution, err = _WorkflowExecution_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 16:
			if field.Value.Type() == wire.TI64 {
				var x int64
				x, err = field.Value.GetI64(), error(nil)
				v.ParentInitiatedEventId = &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 {
				v.Input, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		case 40:
			if field.Value.Type() == wire.TI32 {
				var x int32
				x, err = field.Value.GetI32(), error(nil)
				v.ExecutionStartToCloseTimeoutSeconds = &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.TaskStartToCloseTimeoutSeconds = &x
				if err != nil {
					return err
				}

			}
		case 54:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.ContinuedExecutionRunId = &x
				if err != nil {
					return err
				}

			}
		case 55:
			if field.Value.Type() == wire.TI32 {
				var x ContinueAsNewInitiator
				x, err = _ContinueAsNewInitiator_Read(field.Value)
				v.Initiator = &x
				if err != nil {
					return err
				}

			}
		case 56:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.ContinuedFailureReason = &x
				if err != nil {
					return err
				}

			}
		case 57:
			if field.Value.Type() == wire.TBinary {
				v.ContinuedFailureDetails, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		case 58:
			if field.Value.Type() == wire.TBinary {
				v.LastCompletionResult, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		case 59:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.OriginalExecutionRunId = &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.Identity = &x
				if err != nil {
					return err
				}

			}
		case 61:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.FirstExecutionRunId = &x
				if err != nil {
					return err
				}

			}
		case 62:
			if field.Value.Type() == wire.TI64 {
				var x int64
				x, err = field.Value.GetI64(), error(nil)
				v.FirstScheduledTimeNano = &x
				if err != nil {
					return err
				}

			}
		case 70:
			if field.Value.Type() == wire.TStruct {
				v.RetryPolicy, err = _RetryPolicy_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 80:
			if field.Value.Type() == wire.TI32 {
				var x int32
				x, err = field.Value.GetI32(), error(nil)
				v.Attempt = &x
				if err != nil {
					return err
				}

			}
		case 90:
			if field.Value.Type() == wire.TI64 {
				var x int64
				x, err = field.Value.GetI64(), error(nil)
				v.ExpirationTimestamp = &x
				if err != nil {
					return err
				}

			}
		case 100:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.CronSchedule = &x
				if err != nil {
					return err
				}

			}
		case 110:
			if field.Value.Type() == wire.TI32 {
				var x int32
				x, err = field.Value.GetI32(), error(nil)
				v.FirstDecisionTaskBackoffSeconds = &x
				if err != nil {
					return err
				}

			}
		case 120:
			if field.Value.Type() == wire.TStruct {
				v.Memo, err = _Memo_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 121:
			if field.Value.Type() == wire.TStruct {
				v.SearchAttributes, err = _SearchAttributes_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 130:
			if field.Value.Type() == wire.TStruct {
				v.PrevAutoResetPoints, err = _ResetPoints_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 140:
			if field.Value.Type() == wire.TStruct {
				v.Header, err = _Header_Read(field.Value)
				if err != nil {
					return err
				}

			}
		case 150:
			if field.Value.Type() == wire.TMap {
				v.PartitionConfig, err = _Map_String_String_Read(field.Value.GetMap())
				if err != nil {
					return err
				}

			}
		case 160:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.RequestId = &x
				if err != nil {
					return err
				}

			}
		case 170:
			if field.Value.Type() == wire.TI32 {
				var x CronOverlapPolicy
				x, err = _CronOverlapPolicy_Read(field.Value)
				v.CronOverlapPolicy = &x
				if err != nil {
					return err
				}

			}
		case 180:
			if field.Value.Type() == wire.TStruct {
				v.ActiveClusterSelectionPolicy, err = _ActiveClusterSelectionPolicy_Read(field.Value)
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a WorkflowExecutionStartedEventAttributes
// struct.
func (v *WorkflowExecutionStartedEventAttributes) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [30]string
	i := 0
	if v.WorkflowType != nil {
		fields[i] = fmt.Sprintf("WorkflowType: %v", v.WorkflowType)
		i++
	}
	if v.ParentWorkflowDomain != nil {
		fields[i] = fmt.Sprintf("ParentWorkflowDomain: %v", *(v.ParentWorkflowDomain))
		i++
	}
	if v.ParentWorkflowExecution != nil {
		fields[i] = fmt.Sprintf("ParentWorkflowExecution: %v", v.ParentWorkflowExecution)
		i++
	}
	if v.ParentInitiatedEventId != nil {
		fields[i] = fmt.Sprintf("ParentInitiatedEventId: %v", *(v.ParentInitiatedEventId))
		i++
	}
	if v.TaskList != nil {
		fields[i] = fmt.Sprintf("TaskList: %v", v.TaskList)
		i++
	}
	if v.Input != nil {
		fields[i] = fmt.Sprintf("Input: %v", v.Input)
		i++
	}
	if v.ExecutionStartToCloseTimeoutSeconds != nil {
		fields[i] = fmt.Sprintf("ExecutionStartToCloseTimeoutSeconds: %v", *(v.ExecutionStartToCloseTimeoutSeconds))
		i++
	}
	if v.TaskStartToCloseTimeoutSeconds != nil {
		fields[i] = fmt.Sprintf("TaskStartToCloseTimeoutSeconds: %v", *(v.TaskStartToCloseTimeoutSeconds))
		i++
	}
	if v.ContinuedExecutionRunId != nil {
		fields[i] = fmt.Sprintf("ContinuedExecutionRunId: %v", *(v.ContinuedExecutionRunId))
		i++
	}
	if v.Initiator != nil {
		fields[i] = fmt.Sprintf("Initiator: %v", *(v.Initiator))
		i++
	}
	if v.ContinuedFailureReason != nil {
		fields[i] = fmt.Sprintf("ContinuedFailureReason: %v", *(v.ContinuedFailureReason))
		i++
	}
	if v.ContinuedFailureDetails != nil {
		fields[i] = fmt.Sprintf("ContinuedFailureDetails: %v", v.ContinuedFailureDetails)
		i++
	}
	if v.LastCompletionResult != nil {
		fields[i] = fmt.Sprintf("LastCompletionResult: %v", v.LastCompletionResult)
		i++
	}
	if v.OriginalExecutionRunId != nil {
		fields[i] = fmt.Sprintf("OriginalExecutionRunId: %v", *(v.OriginalExecutionRunId))
		i++
	}
	if v.Identity != nil {
		fields[i] = fmt.Sprintf("Identity: %v", *(v.Identity))
		i++
	}
	if v.FirstExecutionRunId != nil {
		fields[i] = fmt.Sprintf("FirstExecutionRunId: %v", *(v.FirstExecutionRunId))
		i++
	}
	if v.FirstScheduledTimeNano != nil {
		fields[i] = fmt.Sprintf("FirstScheduledTimeNano: %v", *(v.FirstScheduledTimeNano))
		i++
	}
	if v.RetryPolicy != nil {
		fields[i] = fmt.Sprintf("RetryPolicy: %v", v.RetryPolicy)
		i++
	}
	if v.Attempt != nil {
		fields[i] = fmt.Sprintf("Attempt: %v", *(v.Attempt))
		i++
	}
	if v.ExpirationTimestamp != nil {
		fields[i] = fmt.Sprintf("ExpirationTimestamp: %v", *(v.ExpirationTimestamp))
		i++
	}
	if v.CronSchedule != nil {
		fields[i] = fmt.Sprintf("CronSchedule: %v", *(v.CronSchedule))
		i++
	}
	if v.FirstDecisionTaskBackoffSeconds != nil {
		fields[i] = fmt.Sprintf("FirstDecisionTaskBackoffSeconds: %v", *(v.FirstDecisionTaskBackoffSeconds))
		i++
	}
	if v.Memo != nil {
		fields[i] = fmt.Sprintf("Memo: %v", v.Memo)
		i++
	}
	if v.SearchAttributes != nil {
		fields[i] = fmt.Sprintf("SearchAttributes: %v", v.SearchAttributes)
		i++
	}
	if v.PrevAutoResetPoints != nil {
		fields[i] = fmt.Sprintf("PrevAutoResetPoints: %v", v.PrevAutoResetPoints)
		i++
	}
	if v.Header != nil {
		fields[i] = fmt.Sprintf("Header: %v", v.Header)
		i++
	}
	if v.PartitionConfig != nil {
		fields[i] = fmt.Sprintf("PartitionConfig: %v", v.PartitionConfig)
		i++
	}
	if v.RequestId != nil {
		fields[i] = fmt.Sprintf("RequestId: %v", *(v.RequestId))
		i++
	}
	if v.CronOverlapPolicy != nil {
		fields[i] = fmt.Sprintf("CronOverlapPolicy: %v", *(v.CronOverlapPolicy))
		i++
	}
	if v.ActiveClusterSelectionPolicy != nil {
		fields[i] = fmt.Sprintf("ActiveClusterSelectionPolicy: %v", v.ActiveClusterSelectionPolicy)
		i++
	}

	return fmt.Sprintf("WorkflowExecutionStartedEventAttributes{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this WorkflowExecutionStartedEventAttributes match the
// provided WorkflowExecutionStartedEventAttributes.
//
// This function performs a deep comparison.
func (v *WorkflowExecutionStartedEventAttributes) Equals(rhs *WorkflowExecutionStartedEventAttributes) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		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.ParentWorkflowDomain, rhs.ParentWorkflowDomain) {
		return false
	}
	if !((v.ParentWorkflowExecution == nil && rhs.ParentWorkflowExecution == nil) || (v.ParentWorkflowExecution != nil && rhs.ParentWorkflowExecution != nil && v.ParentWorkflowExecution.Equals(rhs.ParentWorkflowExecution))) {
		return false
	}
	if !_I64_EqualsPtr(v.ParentInitiatedEventId, rhs.ParentInitiatedEventId) {
		return false
	}
	if !((v.TaskList == nil && rhs.TaskList == nil) || (v.TaskList != nil && rhs.TaskList != nil && v.TaskList.Equals(rhs.TaskList))) {
		return false
	}
	if !((v.Input == nil && rhs.Input == nil) || (v.Input != nil && rhs.Input != nil && bytes.Equal(v.Input, rhs.Input))) {
		return false
	}
	if !_I32_EqualsPtr(v.ExecutionStartToCloseTimeoutSeconds, rhs.ExecutionStartToCloseTimeoutSeconds) {
		return false
	}
	if !_I32_EqualsPtr(v.TaskStartToCloseTimeoutSeconds, rhs.TaskStartToCloseTimeoutSeconds) {
		return false
	}
	if !_String_EqualsPtr(v.ContinuedExecutionRunId, rhs.ContinuedExecutionRunId) {
		return false
	}
	if !_ContinueAsNewInitiator_EqualsPtr(v.Initiator, rhs.Initiator) {
		return false
	}
	if !_String_EqualsPtr(v.ContinuedFailureReason, rhs.ContinuedFailureReason) {
		return false
	}
	if !((v.ContinuedFailureDetails == nil && rhs.ContinuedFailureDetails == nil) || (v.ContinuedFailureDetails != nil && rhs.ContinuedFailureDetails != nil && bytes.Equal(v.ContinuedFailureDetails, rhs.ContinuedFailureDetails))) {
		return false
	}
	if !((v.LastCompletionResult == nil && rhs.LastCompletionResult == nil) || (v.LastCompletionResult != nil && rhs.LastCompletionResult != nil && bytes.Equal(v.LastCompletionResult, rhs.LastCompletionResult))) {
		return false
	}
	if !_String_EqualsPtr(v.OriginalExecutionRunId, rhs.OriginalExecutionRunId) {
		return false
	}
	if !_String_EqualsPtr(v.Identity, rhs.Identity) {
		return false
	}
	if !_String_EqualsPtr(v.FirstExecutionRunId, rhs.FirstExecutionRunId) {
		return false
	}
	if !_I64_EqualsPtr(v.FirstScheduledTimeNano, rhs.FirstScheduledTimeNano) {
		return false
	}
	if !((v.RetryPolicy == nil && rhs.RetryPolicy == nil) || (v.RetryPolicy != nil && rhs.RetryPolicy != nil && v.RetryPolicy.Equals(rhs.RetryPolicy))) {
		return false
	}
	if !_I32_EqualsPtr(v.Attempt, rhs.Attempt) {
		return false
	}
	if !_I64_EqualsPtr(v.ExpirationTimestamp, rhs.ExpirationTimestamp) {
		return false
	}
	if !_String_EqualsPtr(v.CronSchedule, rhs.CronSchedule) {
		return false
	}
	if !_I32_EqualsPtr(v.FirstDecisionTaskBackoffSeconds, rhs.FirstDecisionTaskBackoffSeconds) {
		return false
	}
	if !((v.Memo == nil && rhs.Memo == nil) || (v.Memo != nil && rhs.Memo != nil && v.Memo.Equals(rhs.Memo))) {
		return false
	}
	if !((v.SearchAttributes == nil && rhs.SearchAttributes == nil) || (v.SearchAttributes != nil && rhs.SearchAttributes != nil && v.SearchAttributes.Equals(rhs.SearchAttributes))) {
		return false
	}
	if !((v.PrevAutoResetPoints == nil && rhs.PrevAutoResetPoints == nil) || (v.PrevAutoResetPoints != nil && rhs.PrevAutoResetPoints != nil && v.PrevAutoResetPoints.Equals(rhs.PrevAutoResetPoints))) {
		return false
	}
	if !((v.Header == nil && rhs.Header == nil) || (v.Header != nil && rhs.Header != nil && v.Header.Equals(rhs.Header))) {
		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
	}
	if !_String_EqualsPtr(v.RequestId, rhs.RequestId) {
		return false
	}
	if !_CronOverlapPolicy_EqualsPtr(v.CronOverlapPolicy, rhs.CronOverlapPolicy) {
		return false
	}
	if !((v.ActiveClusterSelectionPolicy == nil && rhs.ActiveClusterSelectionPolicy == nil) || (v.ActiveClusterSelectionPolicy != nil && rhs.ActiveClusterSelectionPolicy != nil && v.ActiveClusterSelectionPolicy.Equals(rhs.ActiveClusterSelectionPolicy))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of WorkflowExecutionStartedEventAttributes.
func (v *WorkflowExecutionStartedEventAttributes) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.WorkflowType != nil {
		err = multierr.Append(err, enc.AddObject("workflowType", v.WorkflowType))
	}
	if v.ParentWorkflowDomain != nil {
		enc.AddString("parentWorkflowDomain", *v.ParentWorkflowDomain)
	}
	if v.ParentWorkflowExecution != nil {
		err = multierr.Append(err, enc.AddObject("parentWorkflowExecution", v.ParentWorkflowExecution))
	}
	if v.ParentInitiatedEventId != nil {
		enc.AddInt64("parentInitiatedEventId", *v.ParentInitiatedEventId)
	}
	if v.TaskList != nil {
		err = multierr.Append(err, enc.AddObject("taskList", v.TaskList))
	}
	if v.Input != nil {
		enc.AddString("input", base64.StdEncoding.EncodeToString(v.Input))
	}
	if v.ExecutionStartToCloseTimeoutSeconds != nil {
		enc.AddInt32("executionStartToCloseTimeoutSeconds", *v.ExecutionStartToCloseTimeoutSeconds)
	}
	if v.TaskStartToCloseTimeoutSeconds != nil {
		enc.AddInt32("taskStartToCloseTimeoutSeconds", *v.TaskStartToCloseTimeoutSeconds)
	}
	if v.ContinuedExecutionRunId != nil {
		enc.AddString("continuedExecutionRunId", *v.ContinuedExecutionRunId)
	}
	if v.Initiator != nil {
		err = multierr.Append(err, enc.AddObject("initiator", *v.Initiator))
	}
	if v.ContinuedFailureReason != nil {
		enc.AddString("continuedFailureReason", *v.ContinuedFailureReason)
	}
	if v.ContinuedFailureDetails != nil {
		enc.AddString("continuedFailureDetails", base64.StdEncoding.EncodeToString(v.ContinuedFailureDetails))
	}
	if v.LastCompletionResult != nil {
		enc.AddString("lastCompletionResult", base64.StdEncoding.EncodeToString(v.LastCompletionResult))
	}
	if v.OriginalExecutionRunId != nil {
		enc.AddString("originalExecutionRunId", *v.OriginalExecutionRunId)
	}
	if v.Identity != nil {
		enc.AddString("identity", *v.Identity)
	}
	if v.FirstExecutionRunId != nil {
		enc.AddString("firstExecutionRunId", *v.FirstExecutionRunId)
	}
	if v.FirstScheduledTimeNano != nil {
		enc.AddInt64("firstScheduledTimeNano", *v.FirstScheduledTimeNano)
	}
	if v.RetryPolicy != nil {
		err = multierr.Append(err, enc.AddObject("retryPolicy", v.RetryPolicy))
	}
	if v.Attempt != nil {
		enc.AddInt32("attempt", *v.Attempt)
	}
	if v.ExpirationTimestamp != nil {
		enc.AddInt64("expirationTimestamp", *v.ExpirationTimestamp)
	}
	if v.CronSchedule != nil {
		enc.AddString("cronSchedule", *v.CronSchedule)
	}
	if v.FirstDecisionTaskBackoffSeconds != nil {
		enc.AddInt32("firstDecisionTaskBackoffSeconds", *v.FirstDecisionTaskBackoffSeconds)
	}
	if v.Memo != nil {
		err = multierr.Append(err, enc.AddObject("memo", v.Memo))
	}
	if v.SearchAttributes != nil {
		err = multierr.Append(err, enc.AddObject("searchAttributes", v.SearchAttributes))
	}
	if v.PrevAutoResetPoints != nil {
		err = multierr.Append(err, enc.AddObject("prevAutoResetPoints", v.PrevAutoResetPoints))
	}
	if v.Header != nil {
		err = multierr.Append(err, enc.AddObject("header", v.Header))
	}
	if v.PartitionConfig != nil {
		err = multierr.Append(err, enc.AddObject("partitionConfig", (_Map_String_String_Zapper)(v.PartitionConfig)))
	}
	if v.RequestId != nil {
		enc.AddString("requestId", *v.RequestId)
	}
	if v.CronOverlapPolicy != nil {
		err = multierr.Append(err, enc.AddObject("cronOverlapPolicy", *v.CronOverlapPolicy))
	}
	if v.ActiveClusterSelectionPolicy != nil {
		err = multierr.Append(err, enc.AddObject("activeClusterSelectionPolicy", v.ActiveClusterSelectionPolicy))
	}
	return err
}

// GetWorkflowType returns the value of WorkflowType if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionStartedEventAttributes) GetWorkflowType() (o *WorkflowType) {
	if v != nil && v.WorkflowType != nil {
		return v.WorkflowType
	}

	return
}

// IsSetWorkflowType returns true if WorkflowType is not nil.
func (v *WorkflowExecutionStartedEventAttributes) IsSetWorkflowType() bool {
	return v != nil && v.WorkflowType != nil
}

// GetParentWorkflowDomain returns the value of ParentWorkflowDomain if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionStartedEventAttributes) GetParentWorkflowDomain() (o string) {
	if v != nil && v.ParentWorkflowDomain != nil {
		return *v.ParentWorkflowDomain
	}

	return
}

// IsSetParentWorkflowDomain returns true if ParentWorkflowDomain is not nil.
func (v *WorkflowExecutionStartedEventAttributes) IsSetParentWorkflowDomain() bool {
	return v != nil && v.ParentWorkflowDomain != nil
}

// GetParentWorkflowExecution returns the value of ParentWorkflowExecution if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionStartedEventAttributes) GetParentWorkflowExecution() (o *WorkflowExecution) {
	if v != nil && v.ParentWorkflowExecution != nil {
		return v.ParentWorkflowExecution
	}

	return
}

// IsSetParentWorkflowExecution returns true if ParentWorkflowExecution is not nil.
func (v *WorkflowExecutionStartedEventAttributes) IsSetParentWorkflowExecution() bool {
	return v != nil && v.ParentWorkflowExecution != nil
}

// GetParentInitiatedEventId returns the value of ParentInitiatedEventId if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionStartedEventAttributes) GetParentInitiatedEventId() (o int64) {
	if v != nil && v.ParentInitiatedEventId != nil {
		return *v.ParentInitiatedEventId
	}

	return
}

// IsSetParentInitiatedEventId returns true if ParentInitiatedEventId is not nil.
func (v *WorkflowExecutionStartedEventAttributes) IsSetParentInitiatedEventId() bool {
	return v != nil && v.ParentInitiatedEventId != nil
}

// GetTaskList returns the value of TaskList if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionStartedEventAttributes) GetTaskList() (o *TaskList) {
	if v != nil && v.TaskList != nil {
		return v.TaskList
	}

	return
}

// IsSetTaskList returns true if TaskList is not nil.
func (v *WorkflowExecutionStartedEventAttributes) IsSetTaskList() bool {
	return v != nil && v.TaskList != nil
}

// GetInput returns the value of Input if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionStartedEventAttributes) GetInput() (o []byte) {
	if v != nil && v.Input != nil {
		return v.Input
	}

	return
}

// IsSetInput returns true if Input is not nil.
func (v *WorkflowExecutionStartedEventAttributes) IsSetInput() bool {
	return v != nil && v.Input != nil
}

// GetExecutionStartToCloseTimeoutSeconds returns the value of ExecutionStartToCloseTimeoutSeconds if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionStartedEventAttributes) GetExecutionStartToCloseTimeoutSeconds() (o int32) {
	if v != nil && v.ExecutionStartToCloseTimeoutSeconds != nil {
		return *v.ExecutionStartToCloseTimeoutSeconds
	}

	return
}

// IsSetExecutionStartToCloseTimeoutSeconds returns true if ExecutionStartToCloseTimeoutSeconds is not nil.
func (v *WorkflowExecutionStartedEventAttributes) IsSetExecutionStartToCloseTimeoutSeconds() bool {
	return v != nil && v.ExecutionStartToCloseTimeoutSeconds != nil
}

// GetTaskStartToCloseTimeoutSeconds returns the value of TaskStartToCloseTimeoutSeconds if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionStartedEventAttributes) GetTaskStartToCloseTimeoutSeconds() (o int32) {
	if v != nil && v.TaskStartToCloseTimeoutSeconds != nil {
		return *v.TaskStartToCloseTimeoutSeconds
	}

	return
}

// IsSetTaskStartToCloseTimeoutSeconds returns true if TaskStartToCloseTimeoutSeconds is not nil.
func (v *WorkflowExecutionStartedEventAttributes) IsSetTaskStartToCloseTimeoutSeconds() bool {
	return v != nil && v.TaskStartToCloseTimeoutSeconds != nil
}

// GetContinuedExecutionRunId returns the value of ContinuedExecutionRunId if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionStartedEventAttributes) GetContinuedExecutionRunId() (o string) {
	if v != nil && v.ContinuedExecutionRunId != nil {
		return *v.ContinuedExecutionRunId
	}

	return
}

// IsSetContinuedExecutionRunId returns true if ContinuedExecutionRunId is not nil.
func (v *WorkflowExecutionStartedEventAttributes) IsSetContinuedExecutionRunId() bool {
	return v != nil && v.ContinuedExecutionRunId != nil
}

// GetInitiator returns the value of Initiator if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionStartedEventAttributes) GetInitiator() (o ContinueAsNewInitiator) {
	if v != nil && v.Initiator != nil {
		return *v.Initiator
	}

	return
}

// IsSetInitiator returns true if Initiator is not nil.
func (v *WorkflowExecutionStartedEventAttributes) IsSetInitiator() bool {
	return v != nil && v.Initiator != nil
}

// GetContinuedFailureReason returns the value of ContinuedFailureReason if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionStartedEventAttributes) GetContinuedFailureReason() (o string) {
	if v != nil && v.ContinuedFailureReason != nil {
		return *v.ContinuedFailureReason
	}

	return
}

// IsSetContinuedFailureReason returns true if ContinuedFailureReason is not nil.
func (v *WorkflowExecutionStartedEventAttributes) IsSetContinuedFailureReason() bool {
	return v != nil && v.ContinuedFailureReason != nil
}

// GetContinuedFailureDetails returns the value of ContinuedFailureDetails if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionStartedEventAttributes) GetContinuedFailureDetails() (o []byte) {
	if v != nil && v.ContinuedFailureDetails != nil {
		return v.ContinuedFailureDetails
	}

	return
}

// IsSetContinuedFailureDetails returns true if ContinuedFailureDetails is not nil.
func (v *WorkflowExecutionStartedEventAttributes) IsSetContinuedFailureDetails() bool {
	return v != nil && v.ContinuedFailureDetails != nil
}

// GetLastCompletionResult returns the value of LastCompletionResult if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionStartedEventAttributes) GetLastCompletionResult() (o []byte) {
	if v != nil && v.LastCompletionResult != nil {
		return v.LastCompletionResult
	}

	return
}

// IsSetLastCompletionResult returns true if LastCompletionResult is not nil.
func (v *WorkflowExecutionStartedEventAttributes) IsSetLastCompletionResult() bool {
	return v != nil && v.LastCompletionResult != nil
}

// GetOriginalExecutionRunId returns the value of OriginalExecutionRunId if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionStartedEventAttributes) GetOriginalExecutionRunId() (o string) {
	if v != nil && v.OriginalExecutionRunId != nil {
		return *v.OriginalExecutionRunId
	}

	return
}

// IsSetOriginalExecutionRunId returns true if OriginalExecutionRunId is not nil.
func (v *WorkflowExecutionStartedEventAttributes) IsSetOriginalExecutionRunId() bool {
	return v != nil && v.OriginalExecutionRunId != nil
}

// GetIdentity returns the value of Identity if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionStartedEventAttributes) GetIdentity() (o string) {
	if v != nil && v.Identity != nil {
		return *v.Identity
	}

	return
}

// IsSetIdentity returns true if Identity is not nil.
func (v *WorkflowExecutionStartedEventAttributes) IsSetIdentity() bool {
	return v != nil && v.Identity != nil
}

// GetFirstExecutionRunId returns the value of FirstExecutionRunId if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionStartedEventAttributes) GetFirstExecutionRunId() (o string) {
	if v != nil && v.FirstExecutionRunId != nil {
		return *v.FirstExecutionRunId
	}

	return
}

// IsSetFirstExecutionRunId returns true if FirstExecutionRunId is not nil.
func (v *WorkflowExecutionStartedEventAttributes) IsSetFirstExecutionRunId() bool {
	return v != nil && v.FirstExecutionRunId != nil
}

// GetFirstScheduledTimeNano returns the value of FirstScheduledTimeNano if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionStartedEventAttributes) GetFirstScheduledTimeNano() (o int64) {
	if v != nil && v.FirstScheduledTimeNano != nil {
		return *v.FirstScheduledTimeNano
	}

	return
}

// IsSetFirstScheduledTimeNano returns true if FirstScheduledTimeNano is not nil.
func (v *WorkflowExecutionStartedEventAttributes) IsSetFirstScheduledTimeNano() bool {
	return v != nil && v.FirstScheduledTimeNano != nil
}

// GetRetryPolicy returns the value of RetryPolicy if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionStartedEventAttributes) GetRetryPolicy() (o *RetryPolicy) {
	if v != nil && v.RetryPolicy != nil {
		return v.RetryPolicy
	}

	return
}

// IsSetRetryPolicy returns true if RetryPolicy is not nil.
func (v *WorkflowExecutionStartedEventAttributes) IsSetRetryPolicy() bool {
	return v != nil && v.RetryPolicy != nil
}

// GetAttempt returns the value of Attempt if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionStartedEventAttributes) GetAttempt() (o int32) {
	if v != nil && v.Attempt != nil {
		return *v.Attempt
	}

	return
}

// IsSetAttempt returns true if Attempt is not nil.
func (v *WorkflowExecutionStartedEventAttributes) IsSetAttempt() bool {
	return v != nil && v.Attempt != nil
}

// GetExpirationTimestamp returns the value of ExpirationTimestamp if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionStartedEventAttributes) GetExpirationTimestamp() (o int64) {
	if v != nil && v.ExpirationTimestamp != nil {
		return *v.ExpirationTimestamp
	}

	return
}

// IsSetExpirationTimestamp returns true if ExpirationTimestamp is not nil.
func (v *WorkflowExecutionStartedEventAttributes) IsSetExpirationTimestamp() bool {
	return v != nil && v.ExpirationTimestamp != nil
}

// GetCronSchedule returns the value of CronSchedule if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionStartedEventAttributes) GetCronSchedule() (o string) {
	if v != nil && v.CronSchedule != nil {
		return *v.CronSchedule
	}

	return
}

// IsSetCronSchedule returns true if CronSchedule is not nil.
func (v *WorkflowExecutionStartedEventAttributes) IsSetCronSchedule() bool {
	return v != nil && v.CronSchedule != nil
}

// GetFirstDecisionTaskBackoffSeconds returns the value of FirstDecisionTaskBackoffSeconds if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionStartedEventAttributes) GetFirstDecisionTaskBackoffSeconds() (o int32) {
	if v != nil && v.FirstDecisionTaskBackoffSeconds != nil {
		return *v.FirstDecisionTaskBackoffSeconds
	}

	return
}

// IsSetFirstDecisionTaskBackoffSeconds returns true if FirstDecisionTaskBackoffSeconds is not nil.
func (v *WorkflowExecutionStartedEventAttributes) IsSetFirstDecisionTaskBackoffSeconds() bool {
	return v != nil && v.FirstDecisionTaskBackoffSeconds != nil
}

// GetMemo returns the value of Memo if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionStartedEventAttributes) GetMemo() (o *Memo) {
	if v != nil && v.Memo != nil {
		return v.Memo
	}

	return
}

// IsSetMemo returns true if Memo is not nil.
func (v *WorkflowExecutionStartedEventAttributes) IsSetMemo() bool {
	return v != nil && v.Memo != nil
}

// GetSearchAttributes returns the value of SearchAttributes if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionStartedEventAttributes) GetSearchAttributes() (o *SearchAttributes) {
	if v != nil && v.SearchAttributes != nil {
		return v.SearchAttributes
	}

	return
}

// IsSetSearchAttributes returns true if SearchAttributes is not nil.
func (v *WorkflowExecutionStartedEventAttributes) IsSetSearchAttributes() bool {
	return v != nil && v.SearchAttributes != nil
}

// GetPrevAutoResetPoints returns the value of PrevAutoResetPoints if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionStartedEventAttributes) GetPrevAutoResetPoints() (o *ResetPoints) {
	if v != nil && v.PrevAutoResetPoints != nil {
		return v.PrevAutoResetPoints
	}

	return
}

// IsSetPrevAutoResetPoints returns true if PrevAutoResetPoints is not nil.
func (v *WorkflowExecutionStartedEventAttributes) IsSetPrevAutoResetPoints() bool {
	return v != nil && v.PrevAutoResetPoints != nil
}

// GetHeader returns the value of Header if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionStartedEventAttributes) GetHeader() (o *Header) {
	if v != nil && v.Header != nil {
		return v.Header
	}

	return
}

// IsSetHeader returns true if Header is not nil.
func (v *WorkflowExecutionStartedEventAttributes) IsSetHeader() bool {
	return v != nil && v.Header != nil
}

// GetPartitionConfig returns the value of PartitionConfig if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionStartedEventAttributes) 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 *WorkflowExecutionStartedEventAttributes) IsSetPartitionConfig() bool {
	return v != nil && v.PartitionConfig != nil
}

// GetRequestId returns the value of RequestId if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionStartedEventAttributes) GetRequestId() (o string) {
	if v != nil && v.RequestId != nil {
		return *v.RequestId
	}

	return
}

// IsSetRequestId returns true if RequestId is not nil.
func (v *WorkflowExecutionStartedEventAttributes) IsSetRequestId() bool {
	return v != nil && v.RequestId != nil
}

// GetCronOverlapPolicy returns the value of CronOverlapPolicy if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionStartedEventAttributes) GetCronOverlapPolicy() (o CronOverlapPolicy) {
	if v != nil && v.CronOverlapPolicy != nil {
		return *v.CronOverlapPolicy
	}

	return
}

// IsSetCronOverlapPolicy returns true if CronOverlapPolicy is not nil.
func (v *WorkflowExecutionStartedEventAttributes) IsSetCronOverlapPolicy() bool {
	return v != nil && v.CronOverlapPolicy != nil
}

// GetActiveClusterSelectionPolicy returns the value of ActiveClusterSelectionPolicy if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionStartedEventAttributes) GetActiveClusterSelectionPolicy() (o *ActiveClusterSelectionPolicy) {
	if v != nil && v.ActiveClusterSelectionPolicy != nil {
		return v.ActiveClusterSelectionPolicy
	}

	return
}

// IsSetActiveClusterSelectionPolicy returns true if ActiveClusterSelectionPolicy is not nil.
func (v *WorkflowExecutionStartedEventAttributes) IsSetActiveClusterSelectionPolicy() bool {
	return v != nil && v.ActiveClusterSelectionPolicy != nil
}

type WorkflowExecutionTerminatedEventAttributes struct {
	Reason   *string `json:"reason,omitempty"`
	Details  []byte  `json:"details,omitempty"`
	Identity *string `json:"identity,omitempty"`
}

// ToWire translates a WorkflowExecutionTerminatedEventAttributes 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 *WorkflowExecutionTerminatedEventAttributes) ToWire() (wire.Value, error) {
	var (
		fields [3]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.Reason != nil {
		w, err = wire.NewValueString(*(v.Reason)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.Details != nil {
		w, err = wire.NewValueBinary(v.Details), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, 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: 30, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

// FromWire deserializes a WorkflowExecutionTerminatedEventAttributes 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 WorkflowExecutionTerminatedEventAttributes struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v WorkflowExecutionTerminatedEventAttributes
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *WorkflowExecutionTerminatedEventAttributes) 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.Reason = &x
				if err != nil {
					return err
				}

			}
		case 20:
			if field.Value.Type() == wire.TBinary {
				v.Details, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		case 30:
			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
}

// String returns a readable string representation of a WorkflowExecutionTerminatedEventAttributes
// struct.
func (v *WorkflowExecutionTerminatedEventAttributes) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [3]string
	i := 0
	if v.Reason != nil {
		fields[i] = fmt.Sprintf("Reason: %v", *(v.Reason))
		i++
	}
	if v.Details != nil {
		fields[i] = fmt.Sprintf("Details: %v", v.Details)
		i++
	}
	if v.Identity != nil {
		fields[i] = fmt.Sprintf("Identity: %v", *(v.Identity))
		i++
	}

	return fmt.Sprintf("WorkflowExecutionTerminatedEventAttributes{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this WorkflowExecutionTerminatedEventAttributes match the
// provided WorkflowExecutionTerminatedEventAttributes.
//
// This function performs a deep comparison.
func (v *WorkflowExecutionTerminatedEventAttributes) Equals(rhs *WorkflowExecutionTerminatedEventAttributes) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.Reason, rhs.Reason) {
		return false
	}
	if !((v.Details == nil && rhs.Details == nil) || (v.Details != nil && rhs.Details != nil && bytes.Equal(v.Details, rhs.Details))) {
		return false
	}
	if !_String_EqualsPtr(v.Identity, rhs.Identity) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of WorkflowExecutionTerminatedEventAttributes.
func (v *WorkflowExecutionTerminatedEventAttributes) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Reason != nil {
		enc.AddString("reason", *v.Reason)
	}
	if v.Details != nil {
		enc.AddString("details", base64.StdEncoding.EncodeToString(v.Details))
	}
	if v.Identity != nil {
		enc.AddString("identity", *v.Identity)
	}
	return err
}

// GetReason returns the value of Reason if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionTerminatedEventAttributes) GetReason() (o string) {
	if v != nil && v.Reason != nil {
		return *v.Reason
	}

	return
}

// IsSetReason returns true if Reason is not nil.
func (v *WorkflowExecutionTerminatedEventAttributes) IsSetReason() bool {
	return v != nil && v.Reason != nil
}

// GetDetails returns the value of Details if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionTerminatedEventAttributes) GetDetails() (o []byte) {
	if v != nil && v.Details != nil {
		return v.Details
	}

	return
}

// IsSetDetails returns true if Details is not nil.
func (v *WorkflowExecutionTerminatedEventAttributes) IsSetDetails() bool {
	return v != nil && v.Details != nil
}

// GetIdentity returns the value of Identity if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionTerminatedEventAttributes) GetIdentity() (o string) {
	if v != nil && v.Identity != nil {
		return *v.Identity
	}

	return
}

// IsSetIdentity returns true if Identity is not nil.
func (v *WorkflowExecutionTerminatedEventAttributes) IsSetIdentity() bool {
	return v != nil && v.Identity != nil
}

type WorkflowExecutionTimedOutEventAttributes struct {
	TimeoutType *TimeoutType `json:"timeoutType,omitempty"`
}

// ToWire translates a WorkflowExecutionTimedOutEventAttributes 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 *WorkflowExecutionTimedOutEventAttributes) ToWire() (wire.Value, error) {
	var (
		fields [1]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.TimeoutType != nil {
		w, err = v.TimeoutType.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

// FromWire deserializes a WorkflowExecutionTimedOutEventAttributes 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 WorkflowExecutionTimedOutEventAttributes struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v WorkflowExecutionTimedOutEventAttributes
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *WorkflowExecutionTimedOutEventAttributes) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			if field.Value.Type() == wire.TI32 {
				var x TimeoutType
				x, err = _TimeoutType_Read(field.Value)
				v.TimeoutType = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a WorkflowExecutionTimedOutEventAttributes
// struct.
func (v *WorkflowExecutionTimedOutEventAttributes) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [1]string
	i := 0
	if v.TimeoutType != nil {
		fields[i] = fmt.Sprintf("TimeoutType: %v", *(v.TimeoutType))
		i++
	}

	return fmt.Sprintf("WorkflowExecutionTimedOutEventAttributes{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this WorkflowExecutionTimedOutEventAttributes match the
// provided WorkflowExecutionTimedOutEventAttributes.
//
// This function performs a deep comparison.
func (v *WorkflowExecutionTimedOutEventAttributes) Equals(rhs *WorkflowExecutionTimedOutEventAttributes) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_TimeoutType_EqualsPtr(v.TimeoutType, rhs.TimeoutType) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of WorkflowExecutionTimedOutEventAttributes.
func (v *WorkflowExecutionTimedOutEventAttributes) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.TimeoutType != nil {
		err = multierr.Append(err, enc.AddObject("timeoutType", *v.TimeoutType))
	}
	return err
}

// GetTimeoutType returns the value of TimeoutType if it is set or its
// zero value if it is unset.
func (v *WorkflowExecutionTimedOutEventAttributes) GetTimeoutType() (o TimeoutType) {
	if v != nil && v.TimeoutType != nil {
		return *v.TimeoutType
	}

	return
}

// IsSetTimeoutType returns true if TimeoutType is not nil.
func (v *WorkflowExecutionTimedOutEventAttributes) IsSetTimeoutType() bool {
	return v != nil && v.TimeoutType != nil
}

type WorkflowIdReusePolicy int32

const (
	WorkflowIdReusePolicyAllowDuplicateFailedOnly WorkflowIdReusePolicy = 0
	WorkflowIdReusePolicyAllowDuplicate           WorkflowIdReusePolicy = 1
	WorkflowIdReusePolicyRejectDuplicate          WorkflowIdReusePolicy = 2
	WorkflowIdReusePolicyTerminateIfRunning       WorkflowIdReusePolicy = 3
)

// WorkflowIdReusePolicy_Values returns all recognized values of WorkflowIdReusePolicy.
func WorkflowIdReusePolicy_Values() []WorkflowIdReusePolicy {
	return []WorkflowIdReusePolicy{
		WorkflowIdReusePolicyAllowDuplicateFailedOnly,
		WorkflowIdReusePolicyAllowDuplicate,
		WorkflowIdReusePolicyRejectDuplicate,
		WorkflowIdReusePolicyTerminateIfRunning,
	}
}

// UnmarshalText tries to decode WorkflowIdReusePolicy from a byte slice
// containing its name.
//
//	var v WorkflowIdReusePolicy
//	err := v.UnmarshalText([]byte("AllowDuplicateFailedOnly"))
func (v *WorkflowIdReusePolicy) UnmarshalText(value []byte) error {
	switch s := string(value); s {
	case "AllowDuplicateFailedOnly":
		*v = WorkflowIdReusePolicyAllowDuplicateFailedOnly
		return nil
	case "AllowDuplicate":
		*v = WorkflowIdReusePolicyAllowDuplicate
		return nil
	case "RejectDuplicate":
		*v = WorkflowIdReusePolicyRejectDuplicate
		return nil
	case "TerminateIfRunning":
		*v = WorkflowIdReusePolicyTerminateIfRunning
		return nil
	default:
		val, err := strconv.ParseInt(s, 10, 32)
		if err != nil {
			return fmt.Errorf("unknown enum value %q for %q: %v", s, "WorkflowIdReusePolicy", err)
		}
		*v = WorkflowIdReusePolicy(val)
		return nil
	}
}

// MarshalText encodes WorkflowIdReusePolicy 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 WorkflowIdReusePolicy) MarshalText() ([]byte, error) {
	switch int32(v) {
	case 0:
		return []byte("AllowDuplicateFailedOnly"), nil
	case 1:
		return []byte("AllowDuplicate"), nil
	case 2:
		return []byte("RejectDuplicate"), nil
	case 3:
		return []byte("TerminateIfRunning"), nil
	}
	return []byte(strconv.FormatInt(int64(v), 10)), nil
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of WorkflowIdReusePolicy.
// 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 WorkflowIdReusePolicy) MarshalLogObject(enc zapcore.ObjectEncoder) error {
	enc.AddInt32("value", int32(v))
	switch int32(v) {
	case 0:
		enc.AddString("name", "AllowDuplicateFailedOnly")
	case 1:
		enc.AddString("name", "AllowDuplicate")
	case 2:
		enc.AddString("name", "RejectDuplicate")
	case 3:
		enc.AddString("name", "TerminateIfRunning")
	}
	return nil
}

// Ptr returns a pointer to this enum value.
func (v WorkflowIdReusePolicy) Ptr() *WorkflowIdReusePolicy {
	return &v
}

// ToWire translates WorkflowIdReusePolicy 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 WorkflowIdReusePolicy) ToWire() (wire.Value, error) {
	return wire.NewValueI32(int32(v)), nil
}

// FromWire deserializes WorkflowIdReusePolicy from its Thrift-level
// representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TI32)
//	if err != nil {
//	  return WorkflowIdReusePolicy(0), err
//	}
//
//	var v WorkflowIdReusePolicy
//	if err := v.FromWire(x); err != nil {
//	  return WorkflowIdReusePolicy(0), err
//	}
//	return v, nil
func (v *WorkflowIdReusePolicy) FromWire(w wire.Value) error {
	*v = (WorkflowIdReusePolicy)(w.GetI32())
	return nil
}

// String returns a readable string representation of WorkflowIdReusePolicy.
func (v WorkflowIdReusePolicy) String() string {
	w := int32(v)
	switch w {
	case 0:
		return "AllowDuplicateFailedOnly"
	case 1:
		return "AllowDuplicate"
	case 2:
		return "RejectDuplicate"
	case 3:
		return "TerminateIfRunning"
	}
	return fmt.Sprintf("WorkflowIdReusePolicy(%d)", w)
}

// Equals returns true if this WorkflowIdReusePolicy value matches the provided
// value.
func (v WorkflowIdReusePolicy) Equals(rhs WorkflowIdReusePolicy) bool {
	return v == rhs
}

// MarshalJSON serializes WorkflowIdReusePolicy into JSON.
//
// If the enum value is recognized, its name is returned. Otherwise,
// its integer value is returned.
//
// This implements json.Marshaler.
func (v WorkflowIdReusePolicy) MarshalJSON() ([]byte, error) {
	switch int32(v) {
	case 0:
		return ([]byte)("\"AllowDuplicateFailedOnly\""), nil
	case 1:
		return ([]byte)("\"AllowDuplicate\""), nil
	case 2:
		return ([]byte)("\"RejectDuplicate\""), nil
	case 3:
		return ([]byte)("\"TerminateIfRunning\""), nil
	}
	return ([]byte)(strconv.FormatInt(int64(v), 10)), nil
}

// UnmarshalJSON attempts to decode WorkflowIdReusePolicy 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 *WorkflowIdReusePolicy) 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, "WorkflowIdReusePolicy")
		}
		if x < math.MinInt32 {
			return fmt.Errorf("enum underflow from JSON %q for %q", text, "WorkflowIdReusePolicy")
		}
		*v = (WorkflowIdReusePolicy)(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, "WorkflowIdReusePolicy")
	}
}

type WorkflowQuery struct {
	QueryType *string `json:"queryType,omitempty"`
	QueryArgs []byte  `json:"queryArgs,omitempty"`
}

// ToWire translates a WorkflowQuery 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 *WorkflowQuery) ToWire() (wire.Value, error) {
	var (
		fields [2]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.QueryType != nil {
		w, err = wire.NewValueString(*(v.QueryType)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.QueryArgs != nil {
		w, err = wire.NewValueBinary(v.QueryArgs), 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
}

// FromWire deserializes a WorkflowQuery 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 WorkflowQuery struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v WorkflowQuery
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *WorkflowQuery) 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.QueryType = &x
				if err != nil {
					return err
				}

			}
		case 20:
			if field.Value.Type() == wire.TBinary {
				v.QueryArgs, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a WorkflowQuery
// struct.
func (v *WorkflowQuery) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [2]string
	i := 0
	if v.QueryType != nil {
		fields[i] = fmt.Sprintf("QueryType: %v", *(v.QueryType))
		i++
	}
	if v.QueryArgs != nil {
		fields[i] = fmt.Sprintf("QueryArgs: %v", v.QueryArgs)
		i++
	}

	return fmt.Sprintf("WorkflowQuery{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this WorkflowQuery match the
// provided WorkflowQuery.
//
// This function performs a deep comparison.
func (v *WorkflowQuery) Equals(rhs *WorkflowQuery) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.QueryType, rhs.QueryType) {
		return false
	}
	if !((v.QueryArgs == nil && rhs.QueryArgs == nil) || (v.QueryArgs != nil && rhs.QueryArgs != nil && bytes.Equal(v.QueryArgs, rhs.QueryArgs))) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of WorkflowQuery.
func (v *WorkflowQuery) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.QueryType != nil {
		enc.AddString("queryType", *v.QueryType)
	}
	if v.QueryArgs != nil {
		enc.AddString("queryArgs", base64.StdEncoding.EncodeToString(v.QueryArgs))
	}
	return err
}

// GetQueryType returns the value of QueryType if it is set or its
// zero value if it is unset.
func (v *WorkflowQuery) GetQueryType() (o string) {
	if v != nil && v.QueryType != nil {
		return *v.QueryType
	}

	return
}

// IsSetQueryType returns true if QueryType is not nil.
func (v *WorkflowQuery) IsSetQueryType() bool {
	return v != nil && v.QueryType != nil
}

// GetQueryArgs returns the value of QueryArgs if it is set or its
// zero value if it is unset.
func (v *WorkflowQuery) GetQueryArgs() (o []byte) {
	if v != nil && v.QueryArgs != nil {
		return v.QueryArgs
	}

	return
}

// IsSetQueryArgs returns true if QueryArgs is not nil.
func (v *WorkflowQuery) IsSetQueryArgs() bool {
	return v != nil && v.QueryArgs != nil
}

type WorkflowQueryResult struct {
	ResultType   *QueryResultType `json:"resultType,omitempty"`
	Answer       []byte           `json:"answer,omitempty"`
	ErrorMessage *string          `json:"errorMessage,omitempty"`
}

// ToWire translates a WorkflowQueryResult 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 *WorkflowQueryResult) ToWire() (wire.Value, error) {
	var (
		fields [3]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.ResultType != nil {
		w, err = v.ResultType.ToWire()
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}
	if v.Answer != nil {
		w, err = wire.NewValueBinary(v.Answer), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 20, Value: w}
		i++
	}
	if v.ErrorMessage != nil {
		w, err = wire.NewValueString(*(v.ErrorMessage)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 30, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

func _QueryResultType_Read(w wire.Value) (QueryResultType, error) {
	var v QueryResultType
	err := v.FromWire(w)
	return v, err
}

// FromWire deserializes a WorkflowQueryResult 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 WorkflowQueryResult struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v WorkflowQueryResult
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *WorkflowQueryResult) FromWire(w wire.Value) error {
	var err error

	for _, field := range w.GetStruct().Fields {
		switch field.ID {
		case 10:
			if field.Value.Type() == wire.TI32 {
				var x QueryResultType
				x, err = _QueryResultType_Read(field.Value)
				v.ResultType = &x
				if err != nil {
					return err
				}

			}
		case 20:
			if field.Value.Type() == wire.TBinary {
				v.Answer, err = field.Value.GetBinary(), error(nil)
				if err != nil {
					return err
				}

			}
		case 30:
			if field.Value.Type() == wire.TBinary {
				var x string
				x, err = field.Value.GetString(), error(nil)
				v.ErrorMessage = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a WorkflowQueryResult
// struct.
func (v *WorkflowQueryResult) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [3]string
	i := 0
	if v.ResultType != nil {
		fields[i] = fmt.Sprintf("ResultType: %v", *(v.ResultType))
		i++
	}
	if v.Answer != nil {
		fields[i] = fmt.Sprintf("Answer: %v", v.Answer)
		i++
	}
	if v.ErrorMessage != nil {
		fields[i] = fmt.Sprintf("ErrorMessage: %v", *(v.ErrorMessage))
		i++
	}

	return fmt.Sprintf("WorkflowQueryResult{%v}", strings.Join(fields[:i], ", "))
}

func _QueryResultType_EqualsPtr(lhs, rhs *QueryResultType) bool {
	if lhs != nil && rhs != nil {

		x := *lhs
		y := *rhs
		return x.Equals(y)
	}
	return lhs == nil && rhs == nil
}

// Equals returns true if all the fields of this WorkflowQueryResult match the
// provided WorkflowQueryResult.
//
// This function performs a deep comparison.
func (v *WorkflowQueryResult) Equals(rhs *WorkflowQueryResult) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_QueryResultType_EqualsPtr(v.ResultType, rhs.ResultType) {
		return false
	}
	if !((v.Answer == nil && rhs.Answer == nil) || (v.Answer != nil && rhs.Answer != nil && bytes.Equal(v.Answer, rhs.Answer))) {
		return false
	}
	if !_String_EqualsPtr(v.ErrorMessage, rhs.ErrorMessage) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of WorkflowQueryResult.
func (v *WorkflowQueryResult) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.ResultType != nil {
		err = multierr.Append(err, enc.AddObject("resultType", *v.ResultType))
	}
	if v.Answer != nil {
		enc.AddString("answer", base64.StdEncoding.EncodeToString(v.Answer))
	}
	if v.ErrorMessage != nil {
		enc.AddString("errorMessage", *v.ErrorMessage)
	}
	return err
}

// GetResultType returns the value of ResultType if it is set or its
// zero value if it is unset.
func (v *WorkflowQueryResult) GetResultType() (o QueryResultType) {
	if v != nil && v.ResultType != nil {
		return *v.ResultType
	}

	return
}

// IsSetResultType returns true if ResultType is not nil.
func (v *WorkflowQueryResult) IsSetResultType() bool {
	return v != nil && v.ResultType != nil
}

// GetAnswer returns the value of Answer if it is set or its
// zero value if it is unset.
func (v *WorkflowQueryResult) GetAnswer() (o []byte) {
	if v != nil && v.Answer != nil {
		return v.Answer
	}

	return
}

// IsSetAnswer returns true if Answer is not nil.
func (v *WorkflowQueryResult) IsSetAnswer() bool {
	return v != nil && v.Answer != nil
}

// GetErrorMessage returns the value of ErrorMessage if it is set or its
// zero value if it is unset.
func (v *WorkflowQueryResult) GetErrorMessage() (o string) {
	if v != nil && v.ErrorMessage != nil {
		return *v.ErrorMessage
	}

	return
}

// IsSetErrorMessage returns true if ErrorMessage is not nil.
func (v *WorkflowQueryResult) IsSetErrorMessage() bool {
	return v != nil && v.ErrorMessage != nil
}

type WorkflowType struct {
	Name *string `json:"name,omitempty"`
}

// ToWire translates a WorkflowType 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 *WorkflowType) ToWire() (wire.Value, error) {
	var (
		fields [1]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.Name != nil {
		w, err = wire.NewValueString(*(v.Name)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

// FromWire deserializes a WorkflowType 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 WorkflowType struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v WorkflowType
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *WorkflowType) 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.Name = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a WorkflowType
// struct.
func (v *WorkflowType) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [1]string
	i := 0
	if v.Name != nil {
		fields[i] = fmt.Sprintf("Name: %v", *(v.Name))
		i++
	}

	return fmt.Sprintf("WorkflowType{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this WorkflowType match the
// provided WorkflowType.
//
// This function performs a deep comparison.
func (v *WorkflowType) Equals(rhs *WorkflowType) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.Name, rhs.Name) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of WorkflowType.
func (v *WorkflowType) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Name != nil {
		enc.AddString("name", *v.Name)
	}
	return err
}

// GetName returns the value of Name if it is set or its
// zero value if it is unset.
func (v *WorkflowType) GetName() (o string) {
	if v != nil && v.Name != nil {
		return *v.Name
	}

	return
}

// IsSetName returns true if Name is not nil.
func (v *WorkflowType) IsSetName() bool {
	return v != nil && v.Name != nil
}

type WorkflowTypeFilter struct {
	Name *string `json:"name,omitempty"`
}

// ToWire translates a WorkflowTypeFilter 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 *WorkflowTypeFilter) ToWire() (wire.Value, error) {
	var (
		fields [1]wire.Field
		i      int = 0
		w      wire.Value
		err    error
	)

	if v.Name != nil {
		w, err = wire.NewValueString(*(v.Name)), error(nil)
		if err != nil {
			return w, err
		}
		fields[i] = wire.Field{ID: 10, Value: w}
		i++
	}

	return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}

// FromWire deserializes a WorkflowTypeFilter 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 WorkflowTypeFilter struct
// from the provided intermediate representation.
//
//	x, err := binaryProtocol.Decode(reader, wire.TStruct)
//	if err != nil {
//	  return nil, err
//	}
//
//	var v WorkflowTypeFilter
//	if err := v.FromWire(x); err != nil {
//	  return nil, err
//	}
//	return &v, nil
func (v *WorkflowTypeFilter) 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.Name = &x
				if err != nil {
					return err
				}

			}
		}
	}

	return nil
}

// String returns a readable string representation of a WorkflowTypeFilter
// struct.
func (v *WorkflowTypeFilter) String() string {
	if v == nil {
		return "<nil>"
	}

	var fields [1]string
	i := 0
	if v.Name != nil {
		fields[i] = fmt.Sprintf("Name: %v", *(v.Name))
		i++
	}

	return fmt.Sprintf("WorkflowTypeFilter{%v}", strings.Join(fields[:i], ", "))
}

// Equals returns true if all the fields of this WorkflowTypeFilter match the
// provided WorkflowTypeFilter.
//
// This function performs a deep comparison.
func (v *WorkflowTypeFilter) Equals(rhs *WorkflowTypeFilter) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.Name, rhs.Name) {
		return false
	}

	return true
}

// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of WorkflowTypeFilter.
func (v *WorkflowTypeFilter) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
	if v == nil {
		return nil
	}
	if v.Name != nil {
		enc.AddString("name", *v.Name)
	}
	return err
}

// GetName returns the value of Name if it is set or its
// zero value if it is unset.
func (v *WorkflowTypeFilter) GetName() (o string) {
	if v != nil && v.Name != nil {
		return *v.Name
	}

	return
}

// IsSetName returns true if Name is not nil.
func (v *WorkflowTypeFilter) IsSetName() bool {
	return v != nil && v.Name != nil
}

// ThriftModule represents the IDL file used to generate this package.
var ThriftModule = &thriftreflect.ThriftModule{
	Name:     "shared",
	Package:  "go.uber.org/cadence/.gen/go/shared",
	FilePath: "shared.thrift",
	SHA1:     "6fef7aa6070aa7ef099f69b53f2741a379aafcb8",
	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\nnamespace java com.uber.cadence\n\nexception BadRequestError {\n  1: required string message\n}\n\nexception InternalServiceError {\n  1: required string message\n}\n\nexception InternalDataInconsistencyError {\n  1: required string message\n}\n\nexception DomainAlreadyExistsError {\n  1: required string message\n}\n\nexception WorkflowExecutionAlreadyStartedError {\n  10: optional string message\n  20: optional string startRequestId\n  30: optional string runId\n}\n\nexception WorkflowExecutionAlreadyCompletedError {\n  1: required string message\n}\n\nexception EntityNotExistsError {\n  1: required string message\n  2: optional string currentCluster\n  3: optional string activeCluster\n  // activeClusters is a list of active clusters for active-active domain\n  4: required list<string> activeClusters\n}\n\nexception ServiceBusyError {\n  1: required string message\n  2: optional string reason\n}\n\nexception CancellationAlreadyRequestedError {\n  1: required string message\n}\n\nexception QueryFailedError {\n  1: required string message\n}\n\nexception DomainNotActiveError {\n  1: required string message\n  2: required string domainName\n  3: required string currentCluster\n  4: required string activeCluster\n  // activeClusters is a list of active clusters for active-active domain\n  5: required list<string> activeClusters\n}\n\nexception LimitExceededError {\n  1: required string message\n}\n\nexception AccessDeniedError {\n  1: required string message\n}\n\nexception RetryTaskV2Error {\n  1: required string message\n  2: optional string domainId\n  3: optional string workflowId\n  4: optional string runId\n  5: optional i64 (js.type = \"Long\") startEventId\n  6: optional i64 (js.type = \"Long\") startEventVersion\n  7: optional i64 (js.type = \"Long\") endEventId\n  8: optional i64 (js.type = \"Long\") endEventVersion\n}\n\nexception ClientVersionNotSupportedError {\n  1: required string featureVersion\n  2: required string clientImpl\n  3: required string supportedVersions\n}\n\nexception FeatureNotEnabledError {\n  1: required string featureFlag\n}\n\nexception CurrentBranchChangedError {\n  10: required string message\n  20: required binary currentBranchToken\n}\n\nexception RemoteSyncMatchedError {\n  10: required string message\n}\n\nexception StickyWorkerUnavailableError {\n  1: required string message\n}\n\nexception TaskListNotOwnedByHostError {\n    1: required string ownedByIdentity\n    2: required string myIdentity\n    3: required string tasklistName\n}\n\nenum WorkflowIdReusePolicy {\n  /*\n   * allow start a workflow execution using the same workflow ID,\n   * when workflow not running, and the last execution close state is in\n   * [terminated, cancelled, timeouted, failed].\n   */\n  AllowDuplicateFailedOnly,\n  /*\n   * allow start a workflow execution using the same workflow ID,\n   * when workflow not running.\n   */\n  AllowDuplicate,\n  /*\n   * do not allow start a workflow execution using the same workflow ID at all\n   */\n  RejectDuplicate,\n  /*\n   * if a workflow is running using the same workflow ID, terminate it and start a new one\n   */\n  TerminateIfRunning,\n}\n\nenum DomainStatus {\n  REGISTERED,\n  DEPRECATED,\n  DELETED,\n}\n\nenum TimeoutType {\n  START_TO_CLOSE,\n  SCHEDULE_TO_START,\n  SCHEDULE_TO_CLOSE,\n  HEARTBEAT,\n}\n\nenum ParentClosePolicy {\n\tABANDON,\n\tREQUEST_CANCEL,\n\tTERMINATE,\n}\n\n\n// whenever this list of decision is changed\n// do change the mutableStateBuilder.go\n// function shouldBufferEvent\n// to make sure wo do the correct event ordering\nenum DecisionType {\n  ScheduleActivityTask,\n  RequestCancelActivityTask,\n  StartTimer,\n  CompleteWorkflowExecution,\n  FailWorkflowExecution,\n  CancelTimer,\n  CancelWorkflowExecution,\n  RequestCancelExternalWorkflowExecution,\n  RecordMarker,\n  ContinueAsNewWorkflowExecution,\n  StartChildWorkflowExecution,\n  SignalExternalWorkflowExecution,\n  UpsertWorkflowSearchAttributes,\n}\n\nenum EventType {\n  WorkflowExecutionStarted,\n  WorkflowExecutionCompleted,\n  WorkflowExecutionFailed,\n  WorkflowExecutionTimedOut,\n  DecisionTaskScheduled,\n  DecisionTaskStarted,\n  DecisionTaskCompleted,\n  DecisionTaskTimedOut\n  DecisionTaskFailed,\n  ActivityTaskScheduled,\n  ActivityTaskStarted,\n  ActivityTaskCompleted,\n  ActivityTaskFailed,\n  ActivityTaskTimedOut,\n  ActivityTaskCancelRequested,\n  RequestCancelActivityTaskFailed,\n  ActivityTaskCanceled,\n  TimerStarted,\n  TimerFired,\n  CancelTimerFailed,\n  TimerCanceled,\n  WorkflowExecutionCancelRequested,\n  WorkflowExecutionCanceled,\n  RequestCancelExternalWorkflowExecutionInitiated,\n  RequestCancelExternalWorkflowExecutionFailed,\n  ExternalWorkflowExecutionCancelRequested,\n  MarkerRecorded,\n  WorkflowExecutionSignaled,\n  WorkflowExecutionTerminated,\n  WorkflowExecutionContinuedAsNew,\n  StartChildWorkflowExecutionInitiated,\n  StartChildWorkflowExecutionFailed,\n  ChildWorkflowExecutionStarted,\n  ChildWorkflowExecutionCompleted,\n  ChildWorkflowExecutionFailed,\n  ChildWorkflowExecutionCanceled,\n  ChildWorkflowExecutionTimedOut,\n  ChildWorkflowExecutionTerminated,\n  SignalExternalWorkflowExecutionInitiated,\n  SignalExternalWorkflowExecutionFailed,\n  ExternalWorkflowExecutionSignaled,\n  UpsertWorkflowSearchAttributes,\n}\n\nenum DecisionTaskFailedCause {\n  UNHANDLED_DECISION,\n  BAD_SCHEDULE_ACTIVITY_ATTRIBUTES,\n  BAD_REQUEST_CANCEL_ACTIVITY_ATTRIBUTES,\n  BAD_START_TIMER_ATTRIBUTES,\n  BAD_CANCEL_TIMER_ATTRIBUTES,\n  BAD_RECORD_MARKER_ATTRIBUTES,\n  BAD_COMPLETE_WORKFLOW_EXECUTION_ATTRIBUTES,\n  BAD_FAIL_WORKFLOW_EXECUTION_ATTRIBUTES,\n  BAD_CANCEL_WORKFLOW_EXECUTION_ATTRIBUTES,\n  BAD_REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_ATTRIBUTES,\n  BAD_CONTINUE_AS_NEW_ATTRIBUTES,\n  START_TIMER_DUPLICATE_ID,\n  RESET_STICKY_TASKLIST,\n  WORKFLOW_WORKER_UNHANDLED_FAILURE,\n  BAD_SIGNAL_WORKFLOW_EXECUTION_ATTRIBUTES,\n  BAD_START_CHILD_EXECUTION_ATTRIBUTES,\n  FORCE_CLOSE_DECISION,\n  FAILOVER_CLOSE_DECISION,\n  BAD_SIGNAL_INPUT_SIZE,\n  RESET_WORKFLOW,\n  BAD_BINARY,\n  SCHEDULE_ACTIVITY_DUPLICATE_ID,\n  BAD_SEARCH_ATTRIBUTES,\n}\n\nenum DecisionTaskTimedOutCause {\n  TIMEOUT,\n  RESET,\n}\n\nenum CancelExternalWorkflowExecutionFailedCause {\n  UNKNOWN_EXTERNAL_WORKFLOW_EXECUTION,\n  WORKFLOW_ALREADY_COMPLETED,\n}\n\nenum SignalExternalWorkflowExecutionFailedCause {\n  UNKNOWN_EXTERNAL_WORKFLOW_EXECUTION,\n  WORKFLOW_ALREADY_COMPLETED,\n}\n\nenum ChildWorkflowExecutionFailedCause {\n  WORKFLOW_ALREADY_RUNNING,\n}\n\n// TODO: when migrating to gRPC, add a running / none status,\n//  currently, customer is using null / nil as an indication\n//  that workflow is still running\nenum WorkflowExecutionCloseStatus {\n  COMPLETED,\n  FAILED,\n  CANCELED,\n  TERMINATED,\n  CONTINUED_AS_NEW,\n  TIMED_OUT,\n}\n\nenum QueryTaskCompletedType {\n  COMPLETED,\n  FAILED,\n}\n\nenum QueryResultType {\n  ANSWERED,\n  FAILED,\n}\n\nenum PendingActivityState {\n  SCHEDULED,\n  STARTED,\n  CANCEL_REQUESTED,\n}\n\nenum PendingDecisionState {\n  SCHEDULED,\n  STARTED,\n}\n\nenum HistoryEventFilterType {\n  ALL_EVENT,\n  CLOSE_EVENT,\n}\n\nenum TaskListKind {\n  NORMAL,\n  STICKY,\n  EPHEMERAL,\n}\n\nenum ArchivalStatus {\n  DISABLED,\n  ENABLED,\n}\n\nenum CronOverlapPolicy {\n  SKIPPED,\n  BUFFERONE,\n}\n\nenum IndexedValueType {\n  STRING,\n  KEYWORD,\n  INT,\n  DOUBLE,\n  BOOL,\n  DATETIME,\n}\n\nstruct Header {\n    10: optional map<string, binary> fields\n}\n\nstruct WorkflowType {\n  10: optional string name\n}\n\nstruct ActivityType {\n  10: optional string name\n}\n\nstruct TaskList {\n  10: optional string name\n  20: optional TaskListKind kind\n}\n\nenum EncodingType {\n  ThriftRW,\n  JSON,\n}\n\nenum QueryRejectCondition {\n  // NOT_OPEN indicates that query should be rejected if workflow is not open\n  NOT_OPEN\n  // NOT_COMPLETED_CLEANLY indicates that query should be rejected if workflow did not complete cleanly\n  NOT_COMPLETED_CLEANLY\n}\n\nenum QueryConsistencyLevel {\n  // EVENTUAL indicates that query should be eventually consistent\n  EVENTUAL\n  // STRONG indicates that any events that came before query should be reflected in workflow state before running query\n  STRONG\n}\n\nstruct DataBlob {\n  10: optional EncodingType EncodingType\n  20: optional binary Data\n}\n\nstruct TaskListMetadata {\n  10: optional double maxTasksPerSecond\n}\n\nstruct WorkflowExecution {\n  10: optional string workflowId\n  20: optional string runId\n}\n\nstruct Memo {\n  10: optional map<string,binary> fields\n}\n\nstruct SearchAttributes {\n  10: optional map<string,binary> indexedFields\n}\n\nstruct WorkerVersionInfo {\n  10: optional string impl\n  20: optional string featureVersion\n}\n\nstruct WorkflowExecutionInfo {\n  10: optional WorkflowExecution execution\n  20: optional WorkflowType type\n  30: optional i64 (js.type = \"Long\") startTime\n  40: optional i64 (js.type = \"Long\") closeTime\n  50: optional WorkflowExecutionCloseStatus closeStatus\n  60: optional i64 (js.type = \"Long\") historyLength\n  70: optional string parentDomainId\n  71: optional string parentDomainName\n  72: optional i64 parentInitatedId\n  80: optional WorkflowExecution parentExecution\n  90: optional i64 (js.type = \"Long\") executionTime\n  100: optional Memo memo\n  101: optional SearchAttributes searchAttributes\n  110: optional ResetPoints autoResetPoints\n  120: optional string taskList\n  121: optional TaskList taskListInfo\n  130: optional bool isCron\n  140: optional i64 (js.type = \"Long\") updateTime\n  150: optional map<string, string> partitionConfig\n  160: optional CronOverlapPolicy cronOverlapPolicy\n  170: optional ActiveClusterSelectionPolicy activeClusterSelectionPolicy\n}\n\nstruct WorkflowExecutionConfiguration {\n  10: optional TaskList taskList\n  20: optional i32 executionStartToCloseTimeoutSeconds\n  30: optional i32 taskStartToCloseTimeoutSeconds\n//  40: optional ChildPolicy childPolicy -- Removed but reserve the IDL order number\n}\n\nstruct TransientDecisionInfo {\n  10: optional HistoryEvent scheduledEvent\n  20: optional HistoryEvent startedEvent\n}\n\nstruct ScheduleActivityTaskDecisionAttributes {\n  10: optional string activityId\n  20: optional ActivityType activityType\n  25: optional string domain\n  30: optional TaskList taskList\n  40: optional binary input\n  45: optional i32 scheduleToCloseTimeoutSeconds\n  50: optional i32 scheduleToStartTimeoutSeconds\n  55: optional i32 startToCloseTimeoutSeconds\n  60: optional i32 heartbeatTimeoutSeconds\n  70: optional RetryPolicy retryPolicy\n  80: optional Header header\n  90: optional bool requestLocalDispatch\n}\n\nstruct ActivityLocalDispatchInfo{\n  10: optional string activityId\n  20: optional i64 (js.type = \"Long\") scheduledTimestamp\n  30: optional i64 (js.type = \"Long\") startedTimestamp\n  40: optional i64 (js.type = \"Long\") scheduledTimestampOfThisAttempt\n  50: optional binary taskToken\n}\n\nstruct RequestCancelActivityTaskDecisionAttributes {\n  10: optional string activityId\n}\n\nstruct StartTimerDecisionAttributes {\n  10: optional string timerId\n  20: optional i64 (js.type = \"Long\") startToFireTimeoutSeconds\n}\n\nstruct CompleteWorkflowExecutionDecisionAttributes {\n  10: optional binary result\n}\n\nstruct FailWorkflowExecutionDecisionAttributes {\n  10: optional string reason\n  20: optional binary details\n}\n\nstruct CancelTimerDecisionAttributes {\n  10: optional string timerId\n}\n\nstruct CancelWorkflowExecutionDecisionAttributes {\n  10: optional binary details\n}\n\nstruct RequestCancelExternalWorkflowExecutionDecisionAttributes {\n  10: optional string domain\n  20: optional string workflowId\n  30: optional string runId\n  40: optional binary control\n  50: optional bool childWorkflowOnly\n}\n\nstruct SignalExternalWorkflowExecutionDecisionAttributes {\n  10: optional string domain\n  20: optional WorkflowExecution execution\n  30: optional string signalName\n  40: optional binary input\n  50: optional binary control\n  60: optional bool childWorkflowOnly\n}\n\nstruct UpsertWorkflowSearchAttributesDecisionAttributes {\n  10: optional SearchAttributes searchAttributes\n}\n\nstruct RecordMarkerDecisionAttributes {\n  10: optional string markerName\n  20: optional binary details\n  30: optional Header header\n}\n\nstruct ContinueAsNewWorkflowExecutionDecisionAttributes {\n  10: optional WorkflowType workflowType\n  20: optional TaskList taskList\n  30: optional binary input\n  40: optional i32 executionStartToCloseTimeoutSeconds\n  50: optional i32 taskStartToCloseTimeoutSeconds\n  60: optional i32 backoffStartIntervalInSeconds\n  70: optional RetryPolicy retryPolicy\n  80: optional ContinueAsNewInitiator initiator\n  90: optional string failureReason\n  100: optional binary failureDetails\n  110: optional binary lastCompletionResult\n  120: optional string cronSchedule\n  130: optional Header header\n  140: optional Memo memo\n  150: optional SearchAttributes searchAttributes\n  160: optional i32 jitterStartSeconds\n  170: optional CronOverlapPolicy cronOverlapPolicy\n  180: optional ActiveClusterSelectionPolicy activeClusterSelectionPolicy\n}\n\nstruct StartChildWorkflowExecutionDecisionAttributes {\n  10: optional string domain\n  20: optional string workflowId\n  30: optional WorkflowType workflowType\n  40: optional TaskList taskList\n  50: optional binary input\n  60: optional i32 executionStartToCloseTimeoutSeconds\n  70: optional i32 taskStartToCloseTimeoutSeconds\n//  80: optional ChildPolicy childPolicy -- Removed but reserve the IDL order number\n  81: optional ParentClosePolicy parentClosePolicy\n  90: optional binary control\n  100: optional WorkflowIdReusePolicy workflowIdReusePolicy\n  110: optional RetryPolicy retryPolicy\n  120: optional string cronSchedule\n  130: optional Header header\n  140: optional Memo memo\n  150: optional SearchAttributes searchAttributes\n  160: optional CronOverlapPolicy cronOverlapPolicy\n  170: optional ActiveClusterSelectionPolicy activeClusterSelectionPolicy\n}\n\nstruct Decision {\n  10:  optional DecisionType decisionType\n  20:  optional ScheduleActivityTaskDecisionAttributes scheduleActivityTaskDecisionAttributes\n  25:  optional StartTimerDecisionAttributes startTimerDecisionAttributes\n  30:  optional CompleteWorkflowExecutionDecisionAttributes completeWorkflowExecutionDecisionAttributes\n  35:  optional FailWorkflowExecutionDecisionAttributes failWorkflowExecutionDecisionAttributes\n  40:  optional RequestCancelActivityTaskDecisionAttributes requestCancelActivityTaskDecisionAttributes\n  50:  optional CancelTimerDecisionAttributes cancelTimerDecisionAttributes\n  60:  optional CancelWorkflowExecutionDecisionAttributes cancelWorkflowExecutionDecisionAttributes\n  70:  optional RequestCancelExternalWorkflowExecutionDecisionAttributes requestCancelExternalWorkflowExecutionDecisionAttributes\n  80:  optional RecordMarkerDecisionAttributes recordMarkerDecisionAttributes\n  90:  optional ContinueAsNewWorkflowExecutionDecisionAttributes continueAsNewWorkflowExecutionDecisionAttributes\n  100: optional StartChildWorkflowExecutionDecisionAttributes startChildWorkflowExecutionDecisionAttributes\n  110: optional SignalExternalWorkflowExecutionDecisionAttributes signalExternalWorkflowExecutionDecisionAttributes\n  120: optional UpsertWorkflowSearchAttributesDecisionAttributes upsertWorkflowSearchAttributesDecisionAttributes\n}\n\nstruct WorkflowExecutionStartedEventAttributes {\n  10: optional WorkflowType workflowType\n  12: optional string parentWorkflowDomain\n  14: optional WorkflowExecution parentWorkflowExecution\n  16: optional i64 (js.type = \"Long\") parentInitiatedEventId\n  20: optional TaskList taskList\n  30: optional binary input\n  40: optional i32 executionStartToCloseTimeoutSeconds\n  50: optional i32 taskStartToCloseTimeoutSeconds\n//  52: optional ChildPolicy childPolicy -- Removed but reserve the IDL order number\n  54: optional string continuedExecutionRunId\n  55: optional ContinueAsNewInitiator initiator\n  56: optional string continuedFailureReason\n  57: optional binary continuedFailureDetails\n  58: optional binary lastCompletionResult\n  59: optional string originalExecutionRunId // This is the runID when the WorkflowExecutionStarted event is written\n  60: optional string identity\n  61: optional string firstExecutionRunId // This is the very first runID along the chain of ContinueAsNew and Reset.\n  62: optional i64 (js.type = \"Long\") firstScheduledTimeNano\n  70: optional RetryPolicy retryPolicy\n  80: optional i32 attempt\n  90: optional i64 (js.type = \"Long\") expirationTimestamp\n  100: optional string cronSchedule\n  110: optional i32 firstDecisionTaskBackoffSeconds\n  120: optional Memo memo\n  121: optional SearchAttributes searchAttributes\n  130: optional ResetPoints prevAutoResetPoints\n  140: optional Header header\n  150: optional map<string, string> partitionConfig\n  160: optional string requestId\n  170: optional CronOverlapPolicy cronOverlapPolicy\n  180: optional ActiveClusterSelectionPolicy activeClusterSelectionPolicy\n}\n\nstruct ResetPoints{\n  10: optional list<ResetPointInfo> points\n}\n\n struct ResetPointInfo{\n  10: optional string binaryChecksum\n  20: optional string runId\n  30: optional i64 firstDecisionCompletedId\n  40: optional i64 (js.type = \"Long\") createdTimeNano\n  50: optional i64 (js.type = \"Long\") expiringTimeNano //the time that the run is deleted due to retention\n  60: optional bool resettable                         // false if the resset point has pending childWFs/reqCancels/signalExternals.\n}\n\nstruct WorkflowExecutionCompletedEventAttributes {\n  10: optional binary result\n  20: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n}\n\nstruct WorkflowExecutionFailedEventAttributes {\n  10: optional string reason\n  20: optional binary details\n  30: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n}\n\nstruct WorkflowExecutionTimedOutEventAttributes {\n  10: optional TimeoutType timeoutType\n}\n\nenum ContinueAsNewInitiator {\n  Decider,\n  RetryPolicy,\n  CronSchedule,\n}\n\nstruct WorkflowExecutionContinuedAsNewEventAttributes {\n  10: optional string newExecutionRunId\n  20: optional WorkflowType workflowType\n  30: optional TaskList taskList\n  40: optional binary input\n  50: optional i32 executionStartToCloseTimeoutSeconds\n  60: optional i32 taskStartToCloseTimeoutSeconds\n  70: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n  80: optional i32 backoffStartIntervalInSeconds\n  90: optional ContinueAsNewInitiator initiator\n  100: optional string failureReason\n  110: optional binary failureDetails\n  120: optional binary lastCompletionResult\n  130: optional Header header\n  140: optional Memo memo\n  150: optional SearchAttributes searchAttributes\n}\n\nstruct DecisionTaskScheduledEventAttributes {\n  10: optional TaskList taskList\n  20: optional i32 startToCloseTimeoutSeconds\n  30: optional i64 (js.type = \"Long\") attempt\n}\n\nstruct DecisionTaskStartedEventAttributes {\n  10: optional i64 (js.type = \"Long\") scheduledEventId\n  20: optional string identity\n  30: optional string requestId\n}\n\nstruct DecisionTaskCompletedEventAttributes {\n  10: optional binary executionContext\n  20: optional i64 (js.type = \"Long\") scheduledEventId\n  30: optional i64 (js.type = \"Long\") startedEventId\n  40: optional string identity\n  50: optional string binaryChecksum\n}\n\nstruct DecisionTaskTimedOutEventAttributes {\n  10: optional i64 (js.type = \"Long\") scheduledEventId\n  20: optional i64 (js.type = \"Long\") startedEventId\n  30: optional TimeoutType timeoutType\n  // for reset workflow\n  40: optional string baseRunId\n  50: optional string newRunId\n  60: optional i64 (js.type = \"Long\") forkEventVersion\n  70: optional string reason\n  80: optional DecisionTaskTimedOutCause cause\n  90: optional string requestId\n}\n\nstruct DecisionTaskFailedEventAttributes {\n  10: optional i64 (js.type = \"Long\") scheduledEventId\n  20: optional i64 (js.type = \"Long\") startedEventId\n  30: optional DecisionTaskFailedCause cause\n  35: optional binary details\n  40: optional string identity\n  50: optional string reason\n  // for reset workflow\n  60: optional string baseRunId\n  70: optional string newRunId\n  80: optional i64 (js.type = \"Long\") forkEventVersion\n  90: optional string binaryChecksum\n  100: optional string requestId\n}\n\nstruct ActivityTaskScheduledEventAttributes {\n  10: optional string activityId\n  20: optional ActivityType activityType\n  25: optional string domain\n  30: optional TaskList taskList\n  40: optional binary input\n  45: optional i32 scheduleToCloseTimeoutSeconds\n  50: optional i32 scheduleToStartTimeoutSeconds\n  55: optional i32 startToCloseTimeoutSeconds\n  60: optional i32 heartbeatTimeoutSeconds\n  90: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n  110: optional RetryPolicy retryPolicy\n  120: optional Header header\n}\n\nstruct ActivityTaskStartedEventAttributes {\n  10: optional i64 (js.type = \"Long\") scheduledEventId\n  20: optional string identity\n  30: optional string requestId\n  40: optional i32 attempt\n  50: optional string lastFailureReason\n  60: optional binary lastFailureDetails\n}\n\nstruct ActivityTaskCompletedEventAttributes {\n  10: optional binary result\n  20: optional i64 (js.type = \"Long\") scheduledEventId\n  30: optional i64 (js.type = \"Long\") startedEventId\n  40: optional string identity\n}\n\nstruct ActivityTaskFailedEventAttributes {\n  10: optional string reason\n  20: optional binary details\n  30: optional i64 (js.type = \"Long\") scheduledEventId\n  40: optional i64 (js.type = \"Long\") startedEventId\n  50: optional string identity\n}\n\nstruct ActivityTaskTimedOutEventAttributes {\n  05: optional binary details\n  10: optional i64 (js.type = \"Long\") scheduledEventId\n  20: optional i64 (js.type = \"Long\") startedEventId\n  30: optional TimeoutType timeoutType\n  // For retry activity, it may have a failure before timeout. It's important to keep those information for debug.\n  // Client can also provide the info for making next decision\n  40: optional string lastFailureReason\n  50: optional binary lastFailureDetails\n}\n\nstruct ActivityTaskCancelRequestedEventAttributes {\n  10: optional string activityId\n  20: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n}\n\nstruct RequestCancelActivityTaskFailedEventAttributes{\n  10: optional string activityId\n  20: optional string cause\n  30: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n}\n\nstruct ActivityTaskCanceledEventAttributes {\n  10: optional binary details\n  20: optional i64 (js.type = \"Long\") latestCancelRequestedEventId\n  30: optional i64 (js.type = \"Long\") scheduledEventId\n  40: optional i64 (js.type = \"Long\") startedEventId\n  50: optional string identity\n}\n\nstruct TimerStartedEventAttributes {\n  10: optional string timerId\n  20: optional i64 (js.type = \"Long\") startToFireTimeoutSeconds\n  30: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n}\n\nstruct TimerFiredEventAttributes {\n  10: optional string timerId\n  20: optional i64 (js.type = \"Long\") startedEventId\n}\n\nstruct TimerCanceledEventAttributes {\n  10: optional string timerId\n  20: optional i64 (js.type = \"Long\") startedEventId\n  30: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n  40: optional string identity\n}\n\nstruct CancelTimerFailedEventAttributes {\n  10: optional string timerId\n  20: optional string cause\n  30: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n  40: optional string identity\n}\n\nstruct WorkflowExecutionCancelRequestedEventAttributes {\n  10: optional string cause\n  20: optional i64 (js.type = \"Long\") externalInitiatedEventId\n  30: optional WorkflowExecution externalWorkflowExecution\n  40: optional string identity\n  50: optional string requestId\n}\n\nstruct WorkflowExecutionCanceledEventAttributes {\n  10: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n  20: optional binary details\n}\n\nstruct MarkerRecordedEventAttributes {\n  10: optional string markerName\n  20: optional binary details\n  30: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n  40: optional Header header\n}\n\nstruct WorkflowExecutionSignaledEventAttributes {\n  10: optional string signalName\n  20: optional binary input\n  30: optional string identity\n  40: optional string requestId\n}\n\nstruct WorkflowExecutionTerminatedEventAttributes {\n  10: optional string reason\n  20: optional binary details\n  30: optional string identity\n}\n\nstruct RequestCancelExternalWorkflowExecutionInitiatedEventAttributes {\n  10: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n  20: optional string domain\n  30: optional WorkflowExecution workflowExecution\n  40: optional binary control\n  50: optional bool childWorkflowOnly\n}\n\nstruct RequestCancelExternalWorkflowExecutionFailedEventAttributes {\n  10: optional CancelExternalWorkflowExecutionFailedCause cause\n  20: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n  30: optional string domain\n  40: optional WorkflowExecution workflowExecution\n  50: optional i64 (js.type = \"Long\") initiatedEventId\n  60: optional binary control\n}\n\nstruct ExternalWorkflowExecutionCancelRequestedEventAttributes {\n  10: optional i64 (js.type = \"Long\") initiatedEventId\n  20: optional string domain\n  30: optional WorkflowExecution workflowExecution\n}\n\nstruct SignalExternalWorkflowExecutionInitiatedEventAttributes {\n  10: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n  20: optional string domain\n  30: optional WorkflowExecution workflowExecution\n  40: optional string signalName\n  50: optional binary input\n  60: optional binary control\n  70: optional bool childWorkflowOnly\n}\n\nstruct SignalExternalWorkflowExecutionFailedEventAttributes {\n  10: optional SignalExternalWorkflowExecutionFailedCause cause\n  20: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n  30: optional string domain\n  40: optional WorkflowExecution workflowExecution\n  50: optional i64 (js.type = \"Long\") initiatedEventId\n  60: optional binary control\n}\n\nstruct ExternalWorkflowExecutionSignaledEventAttributes {\n  10: optional i64 (js.type = \"Long\") initiatedEventId\n  20: optional string domain\n  30: optional WorkflowExecution workflowExecution\n  40: optional binary control\n}\n\nstruct UpsertWorkflowSearchAttributesEventAttributes {\n  10: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n  20: optional SearchAttributes searchAttributes\n}\n\nstruct StartChildWorkflowExecutionInitiatedEventAttributes {\n  10:  optional string domain\n  20:  optional string workflowId\n  30:  optional WorkflowType workflowType\n  40:  optional TaskList taskList\n  50:  optional binary input\n  60:  optional i32 executionStartToCloseTimeoutSeconds\n  70:  optional i32 taskStartToCloseTimeoutSeconds\n//  80:  optional ChildPolicy childPolicy -- Removed but reserve the IDL order number\n  81:  optional ParentClosePolicy parentClosePolicy\n  90:  optional binary control\n  100: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n  110: optional WorkflowIdReusePolicy workflowIdReusePolicy\n  120: optional RetryPolicy retryPolicy\n  130: optional string cronSchedule\n  140: optional Header header\n  150: optional Memo memo\n  160: optional SearchAttributes searchAttributes\n  170: optional i32 delayStartSeconds\n  180: optional i32 jitterStartSeconds\n  190: optional i64 (js.type = \"Long\") firstRunAtTimestamp\n  200: optional CronOverlapPolicy cronOverlapPolicy\n  210: optional ActiveClusterSelectionPolicy activeClusterSelectionPolicy\n}\n\nstruct StartChildWorkflowExecutionFailedEventAttributes {\n  10: optional string domain\n  20: optional string workflowId\n  30: optional WorkflowType workflowType\n  40: optional ChildWorkflowExecutionFailedCause cause\n  50: optional binary control\n  60: optional i64 (js.type = \"Long\") initiatedEventId\n  70: optional i64 (js.type = \"Long\") decisionTaskCompletedEventId\n}\n\nstruct ChildWorkflowExecutionStartedEventAttributes {\n  10: optional string domain\n  20: optional i64 (js.type = \"Long\") initiatedEventId\n  30: optional WorkflowExecution workflowExecution\n  40: optional WorkflowType workflowType\n  50: optional Header header\n}\n\nstruct ChildWorkflowExecutionCompletedEventAttributes {\n  10: optional binary result\n  20: optional string domain\n  30: optional WorkflowExecution workflowExecution\n  40: optional WorkflowType workflowType\n  50: optional i64 (js.type = \"Long\") initiatedEventId\n  60: optional i64 (js.type = \"Long\") startedEventId\n}\n\nstruct ChildWorkflowExecutionFailedEventAttributes {\n  10: optional string reason\n  20: optional binary details\n  30: optional string domain\n  40: optional WorkflowExecution workflowExecution\n  50: optional WorkflowType workflowType\n  60: optional i64 (js.type = \"Long\") initiatedEventId\n  70: optional i64 (js.type = \"Long\") startedEventId\n}\n\nstruct ChildWorkflowExecutionCanceledEventAttributes {\n  10: optional binary details\n  20: optional string domain\n  30: optional WorkflowExecution workflowExecution\n  40: optional WorkflowType workflowType\n  50: optional i64 (js.type = \"Long\") initiatedEventId\n  60: optional i64 (js.type = \"Long\") startedEventId\n}\n\nstruct ChildWorkflowExecutionTimedOutEventAttributes {\n  10: optional TimeoutType timeoutType\n  20: optional string domain\n  30: optional WorkflowExecution workflowExecution\n  40: optional WorkflowType workflowType\n  50: optional i64 (js.type = \"Long\") initiatedEventId\n  60: optional i64 (js.type = \"Long\") startedEventId\n}\n\nstruct ChildWorkflowExecutionTerminatedEventAttributes {\n  10: optional string domain\n  20: optional WorkflowExecution workflowExecution\n  30: optional WorkflowType workflowType\n  40: optional i64 (js.type = \"Long\") initiatedEventId\n  50: optional i64 (js.type = \"Long\") startedEventId\n}\n\nstruct HistoryEvent {\n  10:  optional i64 (js.type = \"Long\") eventId\n  20:  optional i64 (js.type = \"Long\") timestamp\n  30:  optional EventType eventType\n  35:  optional i64 (js.type = \"Long\") version\n  36:  optional i64 (js.type = \"Long\") taskId\n  40:  optional WorkflowExecutionStartedEventAttributes workflowExecutionStartedEventAttributes\n  50:  optional WorkflowExecutionCompletedEventAttributes workflowExecutionCompletedEventAttributes\n  60:  optional WorkflowExecutionFailedEventAttributes workflowExecutionFailedEventAttributes\n  70:  optional WorkflowExecutionTimedOutEventAttributes workflowExecutionTimedOutEventAttributes\n  80:  optional DecisionTaskScheduledEventAttributes decisionTaskScheduledEventAttributes\n  90:  optional DecisionTaskStartedEventAttributes decisionTaskStartedEventAttributes\n  100: optional DecisionTaskCompletedEventAttributes decisionTaskCompletedEventAttributes\n  110: optional DecisionTaskTimedOutEventAttributes decisionTaskTimedOutEventAttributes\n  120: optional DecisionTaskFailedEventAttributes decisionTaskFailedEventAttributes\n  130: optional ActivityTaskScheduledEventAttributes activityTaskScheduledEventAttributes\n  140: optional ActivityTaskStartedEventAttributes activityTaskStartedEventAttributes\n  150: optional ActivityTaskCompletedEventAttributes activityTaskCompletedEventAttributes\n  160: optional ActivityTaskFailedEventAttributes activityTaskFailedEventAttributes\n  170: optional ActivityTaskTimedOutEventAttributes activityTaskTimedOutEventAttributes\n  180: optional TimerStartedEventAttributes timerStartedEventAttributes\n  190: optional TimerFiredEventAttributes timerFiredEventAttributes\n  200: optional ActivityTaskCancelRequestedEventAttributes activityTaskCancelRequestedEventAttributes\n  210: optional RequestCancelActivityTaskFailedEventAttributes requestCancelActivityTaskFailedEventAttributes\n  220: optional ActivityTaskCanceledEventAttributes activityTaskCanceledEventAttributes\n  230: optional TimerCanceledEventAttributes timerCanceledEventAttributes\n  240: optional CancelTimerFailedEventAttributes cancelTimerFailedEventAttributes\n  250: optional MarkerRecordedEventAttributes markerRecordedEventAttributes\n  260: optional WorkflowExecutionSignaledEventAttributes workflowExecutionSignaledEventAttributes\n  270: optional WorkflowExecutionTerminatedEventAttributes workflowExecutionTerminatedEventAttributes\n  280: optional WorkflowExecutionCancelRequestedEventAttributes workflowExecutionCancelRequestedEventAttributes\n  290: optional WorkflowExecutionCanceledEventAttributes workflowExecutionCanceledEventAttributes\n  300: optional RequestCancelExternalWorkflowExecutionInitiatedEventAttributes requestCancelExternalWorkflowExecutionInitiatedEventAttributes\n  310: optional RequestCancelExternalWorkflowExecutionFailedEventAttributes requestCancelExternalWorkflowExecutionFailedEventAttributes\n  320: optional ExternalWorkflowExecutionCancelRequestedEventAttributes externalWorkflowExecutionCancelRequestedEventAttributes\n  330: optional WorkflowExecutionContinuedAsNewEventAttributes workflowExecutionContinuedAsNewEventAttributes\n  340: optional StartChildWorkflowExecutionInitiatedEventAttributes startChildWorkflowExecutionInitiatedEventAttributes\n  350: optional StartChildWorkflowExecutionFailedEventAttributes startChildWorkflowExecutionFailedEventAttributes\n  360: optional ChildWorkflowExecutionStartedEventAttributes childWorkflowExecutionStartedEventAttributes\n  370: optional ChildWorkflowExecutionCompletedEventAttributes childWorkflowExecutionCompletedEventAttributes\n  380: optional ChildWorkflowExecutionFailedEventAttributes childWorkflowExecutionFailedEventAttributes\n  390: optional ChildWorkflowExecutionCanceledEventAttributes childWorkflowExecutionCanceledEventAttributes\n  400: optional ChildWorkflowExecutionTimedOutEventAttributes childWorkflowExecutionTimedOutEventAttributes\n  410: optional ChildWorkflowExecutionTerminatedEventAttributes childWorkflowExecutionTerminatedEventAttributes\n  420: optional SignalExternalWorkflowExecutionInitiatedEventAttributes signalExternalWorkflowExecutionInitiatedEventAttributes\n  430: optional SignalExternalWorkflowExecutionFailedEventAttributes signalExternalWorkflowExecutionFailedEventAttributes\n  440: optional ExternalWorkflowExecutionSignaledEventAttributes externalWorkflowExecutionSignaledEventAttributes\n  450: optional UpsertWorkflowSearchAttributesEventAttributes upsertWorkflowSearchAttributesEventAttributes\n}\n\nstruct History {\n  10: optional list<HistoryEvent> events\n}\n\nstruct WorkflowExecutionFilter {\n  10: optional string workflowId\n  20: optional string runId\n}\n\nstruct WorkflowTypeFilter {\n  10: optional string name\n}\n\nstruct StartTimeFilter {\n  10: optional i64 (js.type = \"Long\") earliestTime\n  20: optional i64 (js.type = \"Long\") latestTime\n}\n\nstruct DomainInfo {\n  10: optional string name\n  20: optional DomainStatus status\n  30: optional string description\n  40: optional string ownerEmail\n  // A key-value map for any customized purpose\n  50: optional map<string,string> data\n  60: optional string uuid\n}\n\nstruct DomainConfiguration {\n  10: optional i32 workflowExecutionRetentionPeriodInDays\n  20: optional bool emitMetric\n  60: optional IsolationGroupConfiguration isolationgroups\n  70: optional BadBinaries badBinaries\n  80: optional ArchivalStatus historyArchivalStatus\n  90: optional string historyArchivalURI\n  100: optional ArchivalStatus visibilityArchivalStatus\n  110: optional string visibilityArchivalURI\n  120: optional AsyncWorkflowConfiguration AsyncWorkflowConfiguration\n}\n\nstruct FailoverInfo {\n    10: optional i64 (js.type = \"Long\") failoverVersion\n    20: optional i64 (js.type = \"Long\") failoverStartTimestamp\n    30: optional i64 (js.type = \"Long\") failoverExpireTimestamp\n    40: optional i32 completedShardCount\n    50: optional list<i32> pendingShards\n}\n\nstruct BadBinaries{\n  10: optional map<string, BadBinaryInfo> binaries\n}\n\nstruct BadBinaryInfo{\n  10: optional string reason\n  20: optional string operator\n  30: optional i64 (js.type = \"Long\") createdTimeNano\n}\n\nstruct UpdateDomainInfo {\n  10: optional string description\n  20: optional string ownerEmail\n  // A key-value map for any customized purpose\n  30: optional map<string,string> data\n}\n\nstruct ClusterReplicationConfiguration {\n 10: optional string clusterName\n}\n\nstruct DomainReplicationConfiguration {\n // activeClusterName is the name of the active cluster for active-passive domain\n 10: optional string activeClusterName\n\n //  clusters is list of all active and passive clusters of domain\n 20: optional list<ClusterReplicationConfiguration> clusters\n\n // activeClusters contains active cluster(s) information for active-active domain\n 30: optional ActiveClusters activeClusters\n}\n\nstruct ActiveClusters {\n  // activeClustersByRegion is a map of region name to active cluster info for active-active domain\n  10: optional map<string, ActiveClusterInfo> activeClustersByRegion\n}\n\n// ActiveClusterInfo contains the configuration of active-active domain's active cluster & failover version for a specific region\nstruct ActiveClusterInfo {\n  10: optional string activeClusterName\n  20: optional i64 (js.type = \"Long\") failoverVersion\n}\n\nstruct RegisterDomainRequest {\n  10: optional string name\n  20: optional string description\n  30: optional string ownerEmail\n  40: optional i32 workflowExecutionRetentionPeriodInDays\n  50: optional bool emitMetric = true\n  60: optional list<ClusterReplicationConfiguration> clusters\n  70: optional string activeClusterName\n  // activeClusters is a map of region name to active cluster name for active-active domain\n  75: optional map<string, string> activeClustersByRegion\n  // A key-value map for any customized purpose\n  80: optional map<string,string> data\n  90: optional string securityToken\n  120: optional bool isGlobalDomain\n  130: optional ArchivalStatus historyArchivalStatus\n  140: optional string historyArchivalURI\n  150: optional ArchivalStatus visibilityArchivalStatus\n  160: optional string visibilityArchivalURI\n}\n\nstruct ListDomainsRequest {\n  10: optional i32 pageSize\n  20: optional binary nextPageToken\n}\n\nstruct ListDomainsResponse {\n  10: optional list<DescribeDomainResponse> domains\n  20: optional binary nextPageToken\n}\n\nstruct DescribeDomainRequest {\n  10: optional string name\n  20: optional string uuid\n}\n\nstruct DescribeDomainResponse {\n  10: optional DomainInfo domainInfo\n  20: optional DomainConfiguration configuration\n  30: optional DomainReplicationConfiguration replicationConfiguration\n  40: optional i64 (js.type = \"Long\") failoverVersion\n  50: optional bool isGlobalDomain\n  60: optional FailoverInfo failoverInfo\n}\n\nstruct UpdateDomainRequest {\n 10: optional string name\n 20: optional UpdateDomainInfo updatedInfo\n 30: optional DomainConfiguration configuration\n 40: optional DomainReplicationConfiguration replicationConfiguration\n 50: optional string securityToken\n 60: optional string deleteBadBinary\n 70: optional i32 failoverTimeoutInSeconds\n}\n\nstruct UpdateDomainResponse {\n  10: optional DomainInfo domainInfo\n  20: optional DomainConfiguration configuration\n  30: optional DomainReplicationConfiguration replicationConfiguration\n  40: optional i64 (js.type = \"Long\") failoverVersion\n  50: optional bool isGlobalDomain\n}\n\nstruct DeprecateDomainRequest {\n 10: optional string name\n 20: optional string securityToken\n}\n\nstruct DeleteDomainRequest {\n 10: optional string name\n 20: optional string securityToken\n}\n\nstruct StartWorkflowExecutionRequest {\n  10: optional string domain\n  20: optional string workflowId\n  30: optional WorkflowType workflowType\n  40: optional TaskList taskList\n  50: optional binary input\n  60: optional i32 executionStartToCloseTimeoutSeconds\n  70: optional i32 taskStartToCloseTimeoutSeconds\n  80: optional string identity\n  90: optional string requestId\n  100: optional WorkflowIdReusePolicy workflowIdReusePolicy\n//  110: optional ChildPolicy childPolicy -- Removed but reserve the IDL order number\n  120: optional RetryPolicy retryPolicy\n  130: optional string cronSchedule\n  140: optional Memo memo\n  141: optional SearchAttributes searchAttributes\n  150: optional Header header\n  160: optional i32 delayStartSeconds\n  170: optional i32 jitterStartSeconds\n  180: optional i64 (js.type = \"Long\") firstRunAtTimestamp\n  190: optional CronOverlapPolicy cronOverlapPolicy\n  200: optional ActiveClusterSelectionPolicy activeClusterSelectionPolicy\n}\n\nstruct StartWorkflowExecutionResponse {\n  10: optional string runId\n}\n\nstruct StartWorkflowExecutionAsyncRequest {\n  10: optional StartWorkflowExecutionRequest request\n}\n\nstruct StartWorkflowExecutionAsyncResponse {\n}\n\nstruct RestartWorkflowExecutionResponse {\n  10: optional string runId\n}\n\nstruct DiagnoseWorkflowExecutionRequest {\n  10: optional string domain\n  20: optional WorkflowExecution workflowExecution\n  30: optional string identity\n}\n\nstruct DiagnoseWorkflowExecutionResponse {\n  10: optional string domain\n  20: optional WorkflowExecution diagnosticWorkflowExecution\n}\n\nstruct PollForDecisionTaskRequest {\n  10: optional string domain\n  20: optional TaskList taskList\n  30: optional string identity\n  40: optional string binaryChecksum\n}\n\nstruct PollForDecisionTaskResponse {\n  10: optional binary taskToken\n  20: optional WorkflowExecution workflowExecution\n  30: optional 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  54: optional i64 (js.type = \"Long\") backlogCountHint\n  60: optional History history\n  70: optional binary nextPageToken\n  80: optional WorkflowQuery query\n  90: optional TaskList WorkflowExecutionTaskList\n  100: optional i64 (js.type = \"Long\") scheduledTimestamp\n  110: optional i64 (js.type = \"Long\") startedTimestamp\n  120: optional map<string, WorkflowQuery> queries\n  130: optional i64 (js.type = 'Long') nextEventId\n  140: optional i64 (js.type = 'Long') totalHistoryBytes\n  150: optional AutoConfigHint autoConfigHint\n}\n\nstruct StickyExecutionAttributes {\n  10: optional TaskList workerTaskList\n  20: optional i32 scheduleToStartTimeoutSeconds\n}\n\nstruct RespondDecisionTaskCompletedRequest {\n  10: optional binary taskToken\n  20: optional list<Decision> decisions\n  30: optional binary executionContext\n  40: optional string identity\n  50: optional StickyExecutionAttributes stickyAttributes\n  60: optional bool returnNewDecisionTask\n  70: optional bool forceCreateNewDecisionTask\n  80: optional string binaryChecksum\n  90: optional map<string, WorkflowQueryResult> queryResults\n}\n\nstruct RespondDecisionTaskCompletedResponse {\n  10: optional PollForDecisionTaskResponse decisionTask\n  20: optional map<string,ActivityLocalDispatchInfo> activitiesToDispatchLocally\n}\n\nstruct RespondDecisionTaskFailedRequest {\n  10: optional binary taskToken\n  20: optional DecisionTaskFailedCause cause\n  30: optional binary details\n  40: optional string identity\n  50: optional string binaryChecksum\n}\n\nstruct PollForActivityTaskRequest {\n  10: optional string domain\n  20: optional TaskList taskList\n  30: optional string identity\n  40: optional TaskListMetadata taskListMetadata\n}\n\nstruct PollForActivityTaskResponse {\n  10:  optional binary taskToken\n  20:  optional WorkflowExecution workflowExecution\n  30:  optional string activityId\n  40:  optional ActivityType activityType\n  50:  optional binary input\n  70:  optional i64 (js.type = \"Long\") scheduledTimestamp\n  80:  optional i32 scheduleToCloseTimeoutSeconds\n  90:  optional i64 (js.type = \"Long\") startedTimestamp\n  100: optional i32 startToCloseTimeoutSeconds\n  110: optional i32 heartbeatTimeoutSeconds\n  120: optional i32 attempt\n  130: optional i64 (js.type = \"Long\") scheduledTimestampOfThisAttempt\n  140: optional binary heartbeatDetails\n  150: optional WorkflowType workflowType\n  160: optional string workflowDomain\n  170: optional Header header\n  180: optional AutoConfigHint autoConfigHint\n}\n\nstruct RecordActivityTaskHeartbeatRequest {\n  10: optional binary taskToken\n  20: optional binary details\n  30: optional string identity\n}\n\nstruct RecordActivityTaskHeartbeatByIDRequest {\n  10: optional string domain\n  20: optional string workflowID\n  30: optional string runID\n  40: optional string activityID\n  50: optional binary details\n  60: optional string identity\n}\n\nstruct RecordActivityTaskHeartbeatResponse {\n  10: optional bool cancelRequested\n}\n\nstruct RespondActivityTaskCompletedRequest {\n  10: optional binary taskToken\n  20: optional binary result\n  30: optional string identity\n}\n\nstruct RespondActivityTaskFailedRequest {\n  10: optional binary taskToken\n  20: optional string reason\n  30: optional binary details\n  40: optional string identity\n}\n\nstruct RespondActivityTaskCanceledRequest {\n  10: optional binary taskToken\n  20: optional binary details\n  30: optional string identity\n}\n\nstruct RespondActivityTaskCompletedByIDRequest {\n  10: optional string domain\n  20: optional string workflowID\n  30: optional string runID\n  40: optional string activityID\n  50: optional binary result\n  60: optional string identity\n}\n\nstruct RespondActivityTaskFailedByIDRequest {\n  10: optional string domain\n  20: optional string workflowID\n  30: optional string runID\n  40: optional string activityID\n  50: optional string reason\n  60: optional binary details\n  70: optional string identity\n}\n\nstruct RespondActivityTaskCanceledByIDRequest {\n  10: optional string domain\n  20: optional string workflowID\n  30: optional string runID\n  40: optional string activityID\n  50: optional binary details\n  60: optional string identity\n}\n\nstruct RequestCancelWorkflowExecutionRequest {\n  10: optional string domain\n  20: optional WorkflowExecution workflowExecution\n  30: optional string identity\n  40: optional string requestId\n  50: optional string cause\n  60: optional string firstExecutionRunID\n}\n\nstruct GetWorkflowExecutionHistoryRequest {\n  10: optional string domain\n  20: optional WorkflowExecution execution\n  30: optional i32 maximumPageSize\n  40: optional binary nextPageToken\n  50: optional bool waitForNewEvent\n  60: optional HistoryEventFilterType HistoryEventFilterType\n  70: optional bool skipArchival\n  80: optional QueryConsistencyLevel queryConsistencyLevel\n}\n\nstruct GetWorkflowExecutionHistoryResponse {\n  10: optional History history\n  11: optional list<DataBlob> rawHistory\n  20: optional binary nextPageToken\n  30: optional bool archived\n}\n\nstruct SignalWorkflowExecutionRequest {\n  10: optional string domain\n  20: optional WorkflowExecution workflowExecution\n  30: optional string signalName\n  40: optional binary input\n  50: optional string identity\n  60: optional string requestId\n  70: optional binary control\n}\n\nstruct SignalWithStartWorkflowExecutionRequest {\n  10: optional string domain\n  20: optional string workflowId\n  30: optional WorkflowType workflowType\n  40: optional TaskList taskList\n  50: optional binary input\n  60: optional i32 executionStartToCloseTimeoutSeconds\n  70: optional i32 taskStartToCloseTimeoutSeconds\n  80: optional string identity\n  90: optional string requestId\n  100: optional WorkflowIdReusePolicy workflowIdReusePolicy\n  110: optional string signalName\n  120: optional binary signalInput\n  130: optional binary control\n  140: optional RetryPolicy retryPolicy\n  150: optional string cronSchedule\n  160: optional Memo memo\n  161: optional SearchAttributes searchAttributes\n  170: optional Header header\n  180: optional i32 delayStartSeconds\n  190: optional i32 jitterStartSeconds\n  200: optional i64 (js.type = \"Long\") firstRunAtTimestamp\n  210: optional CronOverlapPolicy cronOverlapPolicy\n  220: optional ActiveClusterSelectionPolicy activeClusterSelectionPolicy\n}\n\nstruct SignalWithStartWorkflowExecutionAsyncRequest {\n  10: optional SignalWithStartWorkflowExecutionRequest request\n}\n\nstruct SignalWithStartWorkflowExecutionAsyncResponse {\n}\n\nstruct RestartWorkflowExecutionRequest {\n  10: optional string domain\n  20: optional WorkflowExecution workflowExecution\n  30: optional string reason\n  40: optional string identity\n}\nstruct TerminateWorkflowExecutionRequest {\n  10: optional string domain\n  20: optional WorkflowExecution workflowExecution\n  30: optional string reason\n  40: optional binary details\n  50: optional string identity\n  60: optional string firstExecutionRunID\n}\n\nstruct ResetWorkflowExecutionRequest {\n  10: optional string domain\n  20: optional WorkflowExecution workflowExecution\n  30: optional string reason\n  40: optional i64 (js.type = \"Long\") decisionFinishEventId\n  50: optional string requestId\n  60: optional bool skipSignalReapply\n}\n\nstruct ResetWorkflowExecutionResponse {\n  10: optional string runId\n}\n\nstruct ListOpenWorkflowExecutionsRequest {\n  10: optional string domain\n  20: optional i32 maximumPageSize\n  30: optional binary nextPageToken\n  40: optional StartTimeFilter StartTimeFilter\n  50: optional WorkflowExecutionFilter executionFilter\n  60: optional WorkflowTypeFilter typeFilter\n}\n\nstruct ListOpenWorkflowExecutionsResponse {\n  10: optional list<WorkflowExecutionInfo> executions\n  20: optional binary nextPageToken\n}\n\nstruct ListClosedWorkflowExecutionsRequest {\n  10: optional string domain\n  20: optional i32 maximumPageSize\n  30: optional binary nextPageToken\n  40: optional StartTimeFilter StartTimeFilter\n  50: optional WorkflowExecutionFilter executionFilter\n  60: optional WorkflowTypeFilter typeFilter\n  70: optional WorkflowExecutionCloseStatus statusFilter\n}\n\nstruct ListClosedWorkflowExecutionsResponse {\n  10: optional list<WorkflowExecutionInfo> executions\n  20: optional binary nextPageToken\n}\n\nstruct ListWorkflowExecutionsRequest {\n  10: optional string domain\n  20: optional i32 pageSize\n  30: optional binary nextPageToken\n  40: optional string query\n}\n\nstruct ListWorkflowExecutionsResponse {\n  10: optional list<WorkflowExecutionInfo> executions\n  20: optional binary nextPageToken\n}\n\nstruct ListArchivedWorkflowExecutionsRequest {\n  10: optional string domain\n  20: optional i32 pageSize\n  30: optional binary nextPageToken\n  40: optional string query\n}\n\nstruct ListArchivedWorkflowExecutionsResponse {\n  10: optional list<WorkflowExecutionInfo> executions\n  20: optional binary nextPageToken\n}\n\nstruct CountWorkflowExecutionsRequest {\n  10: optional string domain\n  20: optional string query\n}\n\nstruct CountWorkflowExecutionsResponse {\n  10: optional i64 count\n}\n\nstruct GetSearchAttributesResponse {\n  10: optional map<string, IndexedValueType> keys\n}\n\nstruct QueryWorkflowRequest {\n  10: optional string domain\n  20: optional WorkflowExecution execution\n  30: optional WorkflowQuery query\n  // QueryRejectCondition can used to reject the query if workflow state does not satisify condition\n  40: optional QueryRejectCondition queryRejectCondition\n  50: optional QueryConsistencyLevel queryConsistencyLevel\n}\n\nstruct QueryRejected {\n  10: optional WorkflowExecutionCloseStatus closeStatus\n}\n\nstruct QueryWorkflowResponse {\n  10: optional binary queryResult\n  20: optional QueryRejected queryRejected\n}\n\nstruct WorkflowQuery {\n  10: optional string queryType\n  20: optional binary queryArgs\n}\n\nstruct ResetStickyTaskListRequest {\n  10: optional string domain\n  20: optional WorkflowExecution execution\n}\n\nstruct ResetStickyTaskListResponse {\n    // The reason to keep this response is to allow returning\n    // information in the future.\n}\n\nstruct RespondQueryTaskCompletedRequest {\n  10: optional binary taskToken\n  20: optional QueryTaskCompletedType completedType\n  30: optional binary queryResult\n  40: optional string errorMessage\n  50: optional WorkerVersionInfo workerVersionInfo\n}\n\nstruct WorkflowQueryResult {\n  10: optional QueryResultType resultType\n  20: optional binary answer\n  30: optional string errorMessage\n}\n\nstruct DescribeWorkflowExecutionRequest {\n  10: optional string domain\n  20: optional WorkflowExecution execution\n  30: optional QueryConsistencyLevel queryConsistencyLevel\n}\n\nstruct PendingActivityInfo {\n  10: optional string activityID\n  20: optional ActivityType activityType\n  30: optional PendingActivityState state\n  40: optional binary heartbeatDetails\n  50: optional i64 (js.type = \"Long\") lastHeartbeatTimestamp\n  60: optional i64 (js.type = \"Long\") lastStartedTimestamp\n  70: optional i32 attempt\n  80: optional i32 maximumAttempts\n  90: optional i64 (js.type = \"Long\") scheduledTimestamp\n  100: optional i64 (js.type = \"Long\") expirationTimestamp\n  110: optional string lastFailureReason\n  120: optional string lastWorkerIdentity\n  130: optional binary lastFailureDetails\n  140: optional string startedWorkerIdentity\n  150: optional i64 (js.type = \"Long\") scheduleID\n}\n\nstruct PendingDecisionInfo {\n  10: optional PendingDecisionState state\n  20: optional i64 (js.type = \"Long\") scheduledTimestamp\n  30: optional i64 (js.type = \"Long\") startedTimestamp\n  40: optional i64 attempt\n  50: optional i64 (js.type = \"Long\") originalScheduledTimestamp\n  60: optional i64 (js.type = \"Long\") scheduleID\n}\n\nstruct PendingChildExecutionInfo {\n  1: optional string domain\n  10: optional string workflowID\n  20: optional string runID\n  30: optional string workflowTypName\n  40: optional i64 (js.type = \"Long\") initiatedID\n  50: optional ParentClosePolicy parentClosePolicy\n}\n\nstruct DescribeWorkflowExecutionResponse {\n  10: optional WorkflowExecutionConfiguration executionConfiguration\n  20: optional WorkflowExecutionInfo workflowExecutionInfo\n  30: optional list<PendingActivityInfo> pendingActivities\n  40: optional list<PendingChildExecutionInfo> pendingChildren\n  50: optional PendingDecisionInfo pendingDecision\n}\n\nstruct DescribeTaskListRequest {\n  10: optional string domain\n  20: optional TaskList taskList\n  30: optional TaskListType taskListType\n  40: optional bool includeTaskListStatus\n}\n\nstruct DescribeTaskListResponse {\n  10: optional list<PollerInfo> pollers\n  20: optional TaskListStatus taskListStatus\n  // The TaskList being described\n  30: optional TaskList taskList\n}\n\nstruct GetTaskListsByDomainRequest {\n  10: optional string domainName\n}\n\nstruct GetTaskListsByDomainResponse {\n  10: optional map<string,DescribeTaskListResponse> decisionTaskListMap\n  20: optional map<string,DescribeTaskListResponse> activityTaskListMap\n}\n\nstruct ListTaskListPartitionsRequest {\n  10: optional string domain\n  20: optional TaskList taskList\n}\n\nstruct TaskListPartitionMetadata {\n  10: optional string key\n  20: optional string ownerHostName\n}\n\nstruct ListTaskListPartitionsResponse {\n  10: optional list<TaskListPartitionMetadata> activityTaskListPartitions\n  20: optional list<TaskListPartitionMetadata> decisionTaskListPartitions\n}\n\nstruct IsolationGroupMetrics {\n  10: optional double newTasksPerSecond\n  20: optional i64 (js.type = \"Long\") pollerCount\n}\n\nstruct TaskListStatus {\n  10: optional i64 (js.type = \"Long\") backlogCountHint\n  20: optional i64 (js.type = \"Long\") readLevel\n  30: optional i64 (js.type = \"Long\") ackLevel\n  35: optional double ratePerSecond\n  40: optional TaskIDBlock taskIDBlock\n  50: optional map<string, IsolationGroupMetrics> isolationGroupMetrics\n  60: optional double newTasksPerSecond\n}\n\nstruct TaskIDBlock {\n  10: optional i64 (js.type = \"Long\")  startID\n  20: optional i64 (js.type = \"Long\")  endID\n}\n\n//At least one of the parameters needs to be provided\nstruct DescribeHistoryHostRequest {\n  10: optional string               hostAddress //ip:port\n  20: optional i32                  shardIdForHost\n  30: optional WorkflowExecution    executionForHost\n}\n\nstruct RemoveTaskRequest {\n  10: optional i32                      shardID\n  20: optional i32                      type\n  30: optional i64 (js.type = \"Long\")   taskID\n  40: optional i64 (js.type = \"Long\")   visibilityTimestamp\n  50: optional string                   clusterName\n}\n\nstruct CloseShardRequest {\n  10: optional i32               shardID\n}\n\nstruct ResetQueueRequest {\n  10: optional i32    shardID\n  20: optional string clusterName\n  30: optional i32    type\n}\n\nstruct DescribeQueueRequest {\n  10: optional i32    shardID\n  20: optional string clusterName\n  30: optional i32    type\n}\n\nstruct DescribeQueueResponse {\n  10: optional list<string> processingQueueStates\n}\n\nstruct DescribeShardDistributionRequest {\n  10: optional i32 pageSize\n  20: optional i32 pageID\n}\n\nstruct DescribeShardDistributionResponse {\n  10: optional i32              numberOfShards\n\n  // ShardID to Address (ip:port) map\n  20: optional map<i32, string> shards\n}\n\nstruct DescribeHistoryHostResponse{\n  10: optional i32                  numberOfShards\n  20: optional list<i32>            shardIDs\n  30: optional DomainCacheInfo      domainCache\n  40: optional string               shardControllerStatus\n  50: optional string               address\n}\n\nstruct DomainCacheInfo{\n  10: optional i64 numOfItemsInCacheByID\n  20: optional i64 numOfItemsInCacheByName\n}\n\nenum TaskListType {\n  /*\n   * Decision type of tasklist\n   */\n  Decision,\n  /*\n   * Activity type of tasklist\n   */\n  Activity,\n}\n\nstruct PollerInfo {\n  // Unix Nano\n  10: optional i64 (js.type = \"Long\")  lastAccessTime\n  20: optional string identity\n  30: optional double ratePerSecond\n}\n\nstruct RetryPolicy {\n  // Interval of the first retry. If coefficient is 1.0 then it is used for all retries.\n  10: optional i32 initialIntervalInSeconds\n\n  // Coefficient used to calculate the next retry interval.\n  // The next retry interval is previous interval multiplied by the coefficient.\n  // Must be 1 or larger.\n  20: optional double backoffCoefficient\n\n  // Maximum interval between retries. Exponential backoff leads to interval increase.\n  // This value is the cap of the increase. Default is 100x of initial interval.\n  30: optional i32 maximumIntervalInSeconds\n\n  // Maximum number of attempts. When exceeded the retries stop even if not expired yet.\n  // Must be 1 or bigger. Default is unlimited.\n  40: optional i32 maximumAttempts\n\n  // Non-Retriable errors. Will stop retrying if error matches this list.\n  50: optional list<string> nonRetriableErrorReasons\n\n  // Expiration time for the whole retry process.\n  60: optional i32 expirationIntervalInSeconds\n}\n\n// HistoryBranchRange represents a piece of range for a branch.\nstruct HistoryBranchRange{\n  // branchID of original branch forked from\n  10: optional string branchID\n  // beinning node for the range, inclusive\n  20: optional i64 beginNodeID\n  // ending node for the range, exclusive\n  30: optional i64 endNodeID\n}\n\n// For history persistence to serialize/deserialize branch details\nstruct HistoryBranch{\n  10: optional string treeID\n  20: optional string branchID\n  30: optional list<HistoryBranchRange> ancestors\n}\n\n// VersionHistoryItem contains signal eventID and the corresponding version\nstruct VersionHistoryItem{\n  10: optional i64 (js.type = \"Long\") eventID\n  20: optional i64 (js.type = \"Long\") version\n}\n\n// VersionHistory contains the version history of a branch\nstruct VersionHistory{\n  10: optional binary branchToken\n  20: optional list<VersionHistoryItem> items\n}\n\n// VersionHistories contains all version histories from all branches\nstruct VersionHistories{\n  10: optional i32 currentVersionHistoryIndex\n  20: optional list<VersionHistory> histories\n}\n\n// ReapplyEventsRequest is the request for reapply events API\nstruct ReapplyEventsRequest{\n  10: optional string domainName\n  20: optional WorkflowExecution workflowExecution\n  30: optional DataBlob events\n}\n\n// SupportedClientVersions contains the support versions for client library\nstruct SupportedClientVersions{\n  10: optional string goSdk\n  20: optional string javaSdk\n}\n\n// ClusterInfo contains information about cadence cluster\nstruct ClusterInfo{\n  10: optional SupportedClientVersions supportedClientVersions\n}\n\nstruct RefreshWorkflowTasksRequest {\n  10: optional string domain\n  20: optional WorkflowExecution execution\n}\n\nstruct FeatureFlags {\n\t10: optional bool WorkflowExecutionAlreadyCompletedErrorEnabled\n}\n\nenum CrossClusterTaskType {\n  StartChildExecution\n  CancelExecution\n  SignalExecution\n  RecordChildWorkflowExecutionComplete\n  ApplyParentClosePolicy\n}\n\nenum CrossClusterTaskFailedCause {\n  DOMAIN_NOT_ACTIVE\n  DOMAIN_NOT_EXISTS\n  WORKFLOW_ALREADY_RUNNING\n  WORKFLOW_NOT_EXISTS\n  WORKFLOW_ALREADY_COMPLETED\n  UNCATEGORIZED\n}\n\nenum GetTaskFailedCause {\n  SERVICE_BUSY\n  TIMEOUT\n  SHARD_OWNERSHIP_LOST\n  UNCATEGORIZED\n}\n\nstruct CrossClusterTaskInfo {\n  10: optional string domainID\n  20: optional string workflowID\n  30: optional string runID\n  40: optional CrossClusterTaskType taskType\n  50: optional i16 taskState\n  60: optional i64 (js.type = \"Long\") taskID\n  70: optional i64 (js.type = \"Long\") visibilityTimestamp\n}\n\nstruct CrossClusterStartChildExecutionRequestAttributes {\n  10: optional string targetDomainID\n  20: optional string requestID\n  30: optional i64 (js.type = \"Long\") initiatedEventID\n  40: optional StartChildWorkflowExecutionInitiatedEventAttributes initiatedEventAttributes\n  // targetRunID is for scheduling first decision task\n  // targetWorkflowID is available in initiatedEventAttributes\n  50: optional string targetRunID\n  60: optional map<string, string> partitionConfig\n}\n\nstruct CrossClusterStartChildExecutionResponseAttributes {\n  10: optional string runID\n}\n\nstruct CrossClusterCancelExecutionRequestAttributes {\n  10: optional string targetDomainID\n  20: optional string targetWorkflowID\n  30: optional string targetRunID\n  40: optional string requestID\n  50: optional i64 (js.type = \"Long\") initiatedEventID\n  60: optional bool childWorkflowOnly\n}\n\nstruct CrossClusterCancelExecutionResponseAttributes {\n}\n\nstruct CrossClusterSignalExecutionRequestAttributes {\n  10: optional string targetDomainID\n  20: optional string targetWorkflowID\n  30: optional string targetRunID\n  40: optional string requestID\n  50: optional i64 (js.type = \"Long\") initiatedEventID\n  60: optional bool childWorkflowOnly\n  70: optional string signalName\n  80: optional binary signalInput\n  90: optional binary control\n}\n\nstruct CrossClusterSignalExecutionResponseAttributes {\n}\n\nstruct CrossClusterRecordChildWorkflowExecutionCompleteRequestAttributes {\n  10: optional string targetDomainID\n  20: optional string targetWorkflowID\n  30: optional string targetRunID\n  40: optional i64 (js.type = \"Long\") initiatedEventID\n  50: optional HistoryEvent completionEvent\n}\n\nstruct CrossClusterRecordChildWorkflowExecutionCompleteResponseAttributes {\n}\n\nstruct ApplyParentClosePolicyAttributes {\n  10: optional string childDomainID\n  20: optional string childWorkflowID\n  30: optional string childRunID\n  40: optional ParentClosePolicy parentClosePolicy\n}\n\nstruct ApplyParentClosePolicyStatus {\n  10: optional bool completed\n  20: optional CrossClusterTaskFailedCause failedCause\n}\n\nstruct ApplyParentClosePolicyRequest {\n  10: optional ApplyParentClosePolicyAttributes child\n  20: optional ApplyParentClosePolicyStatus status\n}\n\nstruct CrossClusterApplyParentClosePolicyRequestAttributes {\n  10: optional list<ApplyParentClosePolicyRequest> children\n}\n\nstruct ApplyParentClosePolicyResult {\n  10: optional ApplyParentClosePolicyAttributes child\n  20: optional CrossClusterTaskFailedCause failedCause\n}\n\nstruct CrossClusterApplyParentClosePolicyResponseAttributes {\n  10: optional list<ApplyParentClosePolicyResult> childrenStatus\n}\n\nstruct CrossClusterTaskRequest {\n  10: optional CrossClusterTaskInfo taskInfo\n  20: optional CrossClusterStartChildExecutionRequestAttributes startChildExecutionAttributes\n  30: optional CrossClusterCancelExecutionRequestAttributes cancelExecutionAttributes\n  40: optional CrossClusterSignalExecutionRequestAttributes signalExecutionAttributes\n  50: optional CrossClusterRecordChildWorkflowExecutionCompleteRequestAttributes recordChildWorkflowExecutionCompleteAttributes\n  60: optional CrossClusterApplyParentClosePolicyRequestAttributes applyParentClosePolicyAttributes\n}\n\nstruct CrossClusterTaskResponse {\n  10: optional i64 (js.type = \"Long\") taskID\n  20: optional CrossClusterTaskType taskType\n  30: optional i16 taskState\n  40: optional CrossClusterTaskFailedCause failedCause\n  50: optional CrossClusterStartChildExecutionResponseAttributes startChildExecutionAttributes\n  60: optional CrossClusterCancelExecutionResponseAttributes cancelExecutionAttributes\n  70: optional CrossClusterSignalExecutionResponseAttributes signalExecutionAttributes\n  80: optional CrossClusterRecordChildWorkflowExecutionCompleteResponseAttributes recordChildWorkflowExecutionCompleteAttributes\n  90: optional CrossClusterApplyParentClosePolicyResponseAttributes applyParentClosePolicyAttributes\n}\n\nstruct GetCrossClusterTasksRequest {\n  10: optional list<i32> shardIDs\n  20: optional string targetCluster\n}\n\nstruct GetCrossClusterTasksResponse {\n  10: optional map<i32, list<CrossClusterTaskRequest>> tasksByShard\n  20: optional map<i32, GetTaskFailedCause> failedCauseByShard\n}\n\nstruct RespondCrossClusterTasksCompletedRequest {\n  10: optional i32 shardID\n  20: optional string targetCluster\n  30: optional list<CrossClusterTaskResponse> taskResponses\n  40: optional bool fetchNewTasks\n}\n\nstruct RespondCrossClusterTasksCompletedResponse {\n  10: optional list<CrossClusterTaskRequest> tasks\n}\n\nenum IsolationGroupState {\n  INVALID,\n  HEALTHY,\n  DRAINED,\n}\n\nstruct IsolationGroupPartition {\n  10: optional string name\n  20: optional IsolationGroupState state\n}\n\nstruct IsolationGroupConfiguration {\n  10: optional list<IsolationGroupPartition> isolationGroups\n}\n\nstruct AsyncWorkflowConfiguration {\n  10: optional bool enabled\n  // PredefinedQueueName is the name of the predefined queue in cadence server config's asyncWorkflowQueues\n  20: optional string predefinedQueueName\n  // queueType is the type of the queue if predefined_queue_name is not used\n  30: optional string queueType\n  // queueConfig is the configuration for the queue if predefined_queue_name is not used\n  40: optional DataBlob queueConfig\n}\n\n/**\n* Any is a logical duplicate of google.protobuf.Any.\n*\n* The intent of the type is the same, but it is not intended to be directly\n* compatible with google.protobuf.Any or any Thrift equivalent - this blob is\n* RPC-type agnostic by design (as the underlying data may be transported over\n* proto or thrift), and the data-bytes may be in any encoding.\n*\n* This is intentionally different from DataBlob, which supports only a handful\n* of known encodings so it can be interpreted everywhere.  Any supports literally\n* any contents, and needs to be considered opaque until it is given to something\n* that is expecting it.\n*\n* See ValueType to interpret the contents.\n**/\nstruct Any {\n  // Type-string describing value's contents, and intentionally avoiding the\n  // name \"type\" as it is often a special term.\n  // This should usually be a hard-coded string of some kind.\n  10: optional string ValueType\n  // Arbitrarily-encoded bytes, to be deserialized by a runtime implementation.\n  // The contents are described by ValueType.\n  20: optional binary Value\n}\n\nstruct AutoConfigHint {\n  10: optional bool enableAutoConfig\n  20: optional i64 pollerWaitTimeInMs\n}\n\nstruct QueueState {\n  10: optional map<i64, VirtualQueueState> virtualQueueStates\n  20: optional TaskKey exclusiveMaxReadLevel\n}\n\nstruct VirtualQueueState {\n  10: optional list<VirtualSliceState> virtualSliceStates\n}\n\nstruct VirtualSliceState {\n  10: optional TaskRange taskRange\n}\n\nstruct TaskRange {\n  10: optional TaskKey inclusiveMin\n  20: optional TaskKey exclusiveMax\n}\n\nstruct TaskKey {\n  10: optional i64 scheduledTimeNano\n  20: optional i64 taskID\n}\n\nstruct ActiveClusterSelectionPolicy {\n  10: optional ActiveClusterSelectionStrategy strategy\n\n  // sticky_region is the region sticky if strategy is ACTIVE_CLUSTER_SELECTION_STRATEGY_REGION_STICKY\n  // This is the default strategy for active-active domains and region would be set to receiver cluster's region if not specified.\n  20: optional string stickyRegion\n\n  // external_entity_type/external_entity_key is the type/key of the external entity if strategy is ACTIVE_CLUSTER_SELECTION_STRATEGY_EXTERNAL_ENTITY\n  // external entity type must be one of the supported types in active cluster manager. Custom ones can be added by implementing the corresponding interface.\n  30: optional string externalEntityType\n  40: optional string externalEntityKey\n}\n\nenum ActiveClusterSelectionStrategy {\n  REGION_STICKY,\n  EXTERNAL_ENTITY,\n}\n"
