// Code generated by gtrace. DO NOT EDIT.

package trace

import (
	"context"
	"time"

	"github.com/ydb-platform/ydb-go-genproto/protos/Ydb_Coordination"
)

// coordinationComposeOptions is a holder of options
type coordinationComposeOptions struct {
	panicCallback func(e interface{})
}

// CoordinationOption specified Coordination compose option
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
type CoordinationComposeOption func(o *coordinationComposeOptions)

// WithCoordinationPanicCallback specified behavior on panic
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func WithCoordinationPanicCallback(cb func(e interface{})) CoordinationComposeOption {
	return func(o *coordinationComposeOptions) {
		o.panicCallback = cb
	}
}

// Compose returns a new Coordination which has functional fields composed both from t and x.
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func (t *Coordination) Compose(x *Coordination, opts ...CoordinationComposeOption) *Coordination {
	if t == nil {
		return x
	}
	var ret Coordination
	options := coordinationComposeOptions{}
	for _, opt := range opts {
		if opt != nil {
			opt(&options)
		}
	}
	{
		h1 := t.OnNew
		h2 := x.OnNew
		ret.OnNew = func(c CoordinationNewStartInfo) func(CoordinationNewDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(CoordinationNewDoneInfo)
			if h1 != nil {
				r = h1(c)
			}
			if h2 != nil {
				r1 = h2(c)
			}
			return func(c CoordinationNewDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(c)
				}
				if r1 != nil {
					r1(c)
				}
			}
		}
	}
	{
		h1 := t.OnCreateNode
		h2 := x.OnCreateNode
		ret.OnCreateNode = func(c CoordinationCreateNodeStartInfo) func(CoordinationCreateNodeDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(CoordinationCreateNodeDoneInfo)
			if h1 != nil {
				r = h1(c)
			}
			if h2 != nil {
				r1 = h2(c)
			}
			return func(c CoordinationCreateNodeDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(c)
				}
				if r1 != nil {
					r1(c)
				}
			}
		}
	}
	{
		h1 := t.OnAlterNode
		h2 := x.OnAlterNode
		ret.OnAlterNode = func(c CoordinationAlterNodeStartInfo) func(CoordinationAlterNodeDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(CoordinationAlterNodeDoneInfo)
			if h1 != nil {
				r = h1(c)
			}
			if h2 != nil {
				r1 = h2(c)
			}
			return func(c CoordinationAlterNodeDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(c)
				}
				if r1 != nil {
					r1(c)
				}
			}
		}
	}
	{
		h1 := t.OnDropNode
		h2 := x.OnDropNode
		ret.OnDropNode = func(c CoordinationDropNodeStartInfo) func(CoordinationDropNodeDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(CoordinationDropNodeDoneInfo)
			if h1 != nil {
				r = h1(c)
			}
			if h2 != nil {
				r1 = h2(c)
			}
			return func(c CoordinationDropNodeDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(c)
				}
				if r1 != nil {
					r1(c)
				}
			}
		}
	}
	{
		h1 := t.OnDescribeNode
		h2 := x.OnDescribeNode
		ret.OnDescribeNode = func(c CoordinationDescribeNodeStartInfo) func(CoordinationDescribeNodeDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(CoordinationDescribeNodeDoneInfo)
			if h1 != nil {
				r = h1(c)
			}
			if h2 != nil {
				r1 = h2(c)
			}
			return func(c CoordinationDescribeNodeDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(c)
				}
				if r1 != nil {
					r1(c)
				}
			}
		}
	}
	{
		h1 := t.OnSession
		h2 := x.OnSession
		ret.OnSession = func(c CoordinationSessionStartInfo) func(CoordinationSessionDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(CoordinationSessionDoneInfo)
			if h1 != nil {
				r = h1(c)
			}
			if h2 != nil {
				r1 = h2(c)
			}
			return func(c CoordinationSessionDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(c)
				}
				if r1 != nil {
					r1(c)
				}
			}
		}
	}
	{
		h1 := t.OnClose
		h2 := x.OnClose
		ret.OnClose = func(c CoordinationCloseStartInfo) func(CoordinationCloseDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(CoordinationCloseDoneInfo)
			if h1 != nil {
				r = h1(c)
			}
			if h2 != nil {
				r1 = h2(c)
			}
			return func(c CoordinationCloseDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(c)
				}
				if r1 != nil {
					r1(c)
				}
			}
		}
	}
	{
		h1 := t.OnSessionNewStream
		h2 := x.OnSessionNewStream
		ret.OnSessionNewStream = func(c CoordinationSessionNewStreamStartInfo) func(CoordinationSessionNewStreamDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(CoordinationSessionNewStreamDoneInfo)
			if h1 != nil {
				r = h1(c)
			}
			if h2 != nil {
				r1 = h2(c)
			}
			return func(c CoordinationSessionNewStreamDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(c)
				}
				if r1 != nil {
					r1(c)
				}
			}
		}
	}
	{
		h1 := t.OnSessionStarted
		h2 := x.OnSessionStarted
		ret.OnSessionStarted = func(c CoordinationSessionStartedInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			if h1 != nil {
				h1(c)
			}
			if h2 != nil {
				h2(c)
			}
		}
	}
	{
		h1 := t.OnSessionStartTimeout
		h2 := x.OnSessionStartTimeout
		ret.OnSessionStartTimeout = func(c CoordinationSessionStartTimeoutInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			if h1 != nil {
				h1(c)
			}
			if h2 != nil {
				h2(c)
			}
		}
	}
	{
		h1 := t.OnSessionKeepAliveTimeout
		h2 := x.OnSessionKeepAliveTimeout
		ret.OnSessionKeepAliveTimeout = func(c CoordinationSessionKeepAliveTimeoutInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			if h1 != nil {
				h1(c)
			}
			if h2 != nil {
				h2(c)
			}
		}
	}
	{
		h1 := t.OnSessionStopped
		h2 := x.OnSessionStopped
		ret.OnSessionStopped = func(c CoordinationSessionStoppedInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			if h1 != nil {
				h1(c)
			}
			if h2 != nil {
				h2(c)
			}
		}
	}
	{
		h1 := t.OnSessionStopTimeout
		h2 := x.OnSessionStopTimeout
		ret.OnSessionStopTimeout = func(c CoordinationSessionStopTimeoutInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			if h1 != nil {
				h1(c)
			}
			if h2 != nil {
				h2(c)
			}
		}
	}
	{
		h1 := t.OnSessionClientTimeout
		h2 := x.OnSessionClientTimeout
		ret.OnSessionClientTimeout = func(c CoordinationSessionClientTimeoutInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			if h1 != nil {
				h1(c)
			}
			if h2 != nil {
				h2(c)
			}
		}
	}
	{
		h1 := t.OnSessionServerExpire
		h2 := x.OnSessionServerExpire
		ret.OnSessionServerExpire = func(c CoordinationSessionServerExpireInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			if h1 != nil {
				h1(c)
			}
			if h2 != nil {
				h2(c)
			}
		}
	}
	{
		h1 := t.OnSessionServerError
		h2 := x.OnSessionServerError
		ret.OnSessionServerError = func(c CoordinationSessionServerErrorInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			if h1 != nil {
				h1(c)
			}
			if h2 != nil {
				h2(c)
			}
		}
	}
	{
		h1 := t.OnSessionReceive
		h2 := x.OnSessionReceive
		ret.OnSessionReceive = func(c CoordinationSessionReceiveStartInfo) func(CoordinationSessionReceiveDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(CoordinationSessionReceiveDoneInfo)
			if h1 != nil {
				r = h1(c)
			}
			if h2 != nil {
				r1 = h2(c)
			}
			return func(c CoordinationSessionReceiveDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(c)
				}
				if r1 != nil {
					r1(c)
				}
			}
		}
	}
	{
		h1 := t.OnSessionReceiveUnexpected
		h2 := x.OnSessionReceiveUnexpected
		ret.OnSessionReceiveUnexpected = func(c CoordinationSessionReceiveUnexpectedInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			if h1 != nil {
				h1(c)
			}
			if h2 != nil {
				h2(c)
			}
		}
	}
	{
		h1 := t.OnSessionStop
		h2 := x.OnSessionStop
		ret.OnSessionStop = func(c CoordinationSessionStopInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			if h1 != nil {
				h1(c)
			}
			if h2 != nil {
				h2(c)
			}
		}
	}
	{
		h1 := t.OnSessionStart
		h2 := x.OnSessionStart
		ret.OnSessionStart = func(c CoordinationSessionStartStartInfo) func(CoordinationSessionStartDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(CoordinationSessionStartDoneInfo)
			if h1 != nil {
				r = h1(c)
			}
			if h2 != nil {
				r1 = h2(c)
			}
			return func(c CoordinationSessionStartDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(c)
				}
				if r1 != nil {
					r1(c)
				}
			}
		}
	}
	{
		h1 := t.OnSessionSend
		h2 := x.OnSessionSend
		ret.OnSessionSend = func(c CoordinationSessionSendStartInfo) func(CoordinationSessionSendDoneInfo) {
			if options.panicCallback != nil {
				defer func() {
					if e := recover(); e != nil {
						options.panicCallback(e)
					}
				}()
			}
			var r, r1 func(CoordinationSessionSendDoneInfo)
			if h1 != nil {
				r = h1(c)
			}
			if h2 != nil {
				r1 = h2(c)
			}
			return func(c CoordinationSessionSendDoneInfo) {
				if options.panicCallback != nil {
					defer func() {
						if e := recover(); e != nil {
							options.panicCallback(e)
						}
					}()
				}
				if r != nil {
					r(c)
				}
				if r1 != nil {
					r1(c)
				}
			}
		}
	}
	return &ret
}
func (t *Coordination) onNew(c CoordinationNewStartInfo) func(CoordinationNewDoneInfo) {
	fn := t.OnNew
	if fn == nil {
		return func(CoordinationNewDoneInfo) {
			return
		}
	}
	res := fn(c)
	if res == nil {
		return func(CoordinationNewDoneInfo) {
			return
		}
	}
	return res
}
func (t *Coordination) onCreateNode(c CoordinationCreateNodeStartInfo) func(CoordinationCreateNodeDoneInfo) {
	fn := t.OnCreateNode
	if fn == nil {
		return func(CoordinationCreateNodeDoneInfo) {
			return
		}
	}
	res := fn(c)
	if res == nil {
		return func(CoordinationCreateNodeDoneInfo) {
			return
		}
	}
	return res
}
func (t *Coordination) onAlterNode(c CoordinationAlterNodeStartInfo) func(CoordinationAlterNodeDoneInfo) {
	fn := t.OnAlterNode
	if fn == nil {
		return func(CoordinationAlterNodeDoneInfo) {
			return
		}
	}
	res := fn(c)
	if res == nil {
		return func(CoordinationAlterNodeDoneInfo) {
			return
		}
	}
	return res
}
func (t *Coordination) onDropNode(c CoordinationDropNodeStartInfo) func(CoordinationDropNodeDoneInfo) {
	fn := t.OnDropNode
	if fn == nil {
		return func(CoordinationDropNodeDoneInfo) {
			return
		}
	}
	res := fn(c)
	if res == nil {
		return func(CoordinationDropNodeDoneInfo) {
			return
		}
	}
	return res
}
func (t *Coordination) onDescribeNode(c CoordinationDescribeNodeStartInfo) func(CoordinationDescribeNodeDoneInfo) {
	fn := t.OnDescribeNode
	if fn == nil {
		return func(CoordinationDescribeNodeDoneInfo) {
			return
		}
	}
	res := fn(c)
	if res == nil {
		return func(CoordinationDescribeNodeDoneInfo) {
			return
		}
	}
	return res
}
func (t *Coordination) onSession(c CoordinationSessionStartInfo) func(CoordinationSessionDoneInfo) {
	fn := t.OnSession
	if fn == nil {
		return func(CoordinationSessionDoneInfo) {
			return
		}
	}
	res := fn(c)
	if res == nil {
		return func(CoordinationSessionDoneInfo) {
			return
		}
	}
	return res
}
func (t *Coordination) onClose(c CoordinationCloseStartInfo) func(CoordinationCloseDoneInfo) {
	fn := t.OnClose
	if fn == nil {
		return func(CoordinationCloseDoneInfo) {
			return
		}
	}
	res := fn(c)
	if res == nil {
		return func(CoordinationCloseDoneInfo) {
			return
		}
	}
	return res
}
func (t *Coordination) onSessionNewStream(c CoordinationSessionNewStreamStartInfo) func(CoordinationSessionNewStreamDoneInfo) {
	fn := t.OnSessionNewStream
	if fn == nil {
		return func(CoordinationSessionNewStreamDoneInfo) {
			return
		}
	}
	res := fn(c)
	if res == nil {
		return func(CoordinationSessionNewStreamDoneInfo) {
			return
		}
	}
	return res
}
func (t *Coordination) onSessionStarted(c CoordinationSessionStartedInfo) {
	fn := t.OnSessionStarted
	if fn == nil {
		return
	}
	fn(c)
}
func (t *Coordination) onSessionStartTimeout(c CoordinationSessionStartTimeoutInfo) {
	fn := t.OnSessionStartTimeout
	if fn == nil {
		return
	}
	fn(c)
}
func (t *Coordination) onSessionKeepAliveTimeout(c CoordinationSessionKeepAliveTimeoutInfo) {
	fn := t.OnSessionKeepAliveTimeout
	if fn == nil {
		return
	}
	fn(c)
}
func (t *Coordination) onSessionStopped(c CoordinationSessionStoppedInfo) {
	fn := t.OnSessionStopped
	if fn == nil {
		return
	}
	fn(c)
}
func (t *Coordination) onSessionStopTimeout(c CoordinationSessionStopTimeoutInfo) {
	fn := t.OnSessionStopTimeout
	if fn == nil {
		return
	}
	fn(c)
}
func (t *Coordination) onSessionClientTimeout(c CoordinationSessionClientTimeoutInfo) {
	fn := t.OnSessionClientTimeout
	if fn == nil {
		return
	}
	fn(c)
}
func (t *Coordination) onSessionServerExpire(c CoordinationSessionServerExpireInfo) {
	fn := t.OnSessionServerExpire
	if fn == nil {
		return
	}
	fn(c)
}
func (t *Coordination) onSessionServerError(c CoordinationSessionServerErrorInfo) {
	fn := t.OnSessionServerError
	if fn == nil {
		return
	}
	fn(c)
}
func (t *Coordination) onSessionReceive(c CoordinationSessionReceiveStartInfo) func(CoordinationSessionReceiveDoneInfo) {
	fn := t.OnSessionReceive
	if fn == nil {
		return func(CoordinationSessionReceiveDoneInfo) {
			return
		}
	}
	res := fn(c)
	if res == nil {
		return func(CoordinationSessionReceiveDoneInfo) {
			return
		}
	}
	return res
}
func (t *Coordination) onSessionReceiveUnexpected(c CoordinationSessionReceiveUnexpectedInfo) {
	fn := t.OnSessionReceiveUnexpected
	if fn == nil {
		return
	}
	fn(c)
}
func (t *Coordination) onSessionStop(c CoordinationSessionStopInfo) {
	fn := t.OnSessionStop
	if fn == nil {
		return
	}
	fn(c)
}
func (t *Coordination) onSessionStart(c CoordinationSessionStartStartInfo) func(CoordinationSessionStartDoneInfo) {
	fn := t.OnSessionStart
	if fn == nil {
		return func(CoordinationSessionStartDoneInfo) {
			return
		}
	}
	res := fn(c)
	if res == nil {
		return func(CoordinationSessionStartDoneInfo) {
			return
		}
	}
	return res
}
func (t *Coordination) onSessionSend(c CoordinationSessionSendStartInfo) func(CoordinationSessionSendDoneInfo) {
	fn := t.OnSessionSend
	if fn == nil {
		return func(CoordinationSessionSendDoneInfo) {
			return
		}
	}
	res := fn(c)
	if res == nil {
		return func(CoordinationSessionSendDoneInfo) {
			return
		}
	}
	return res
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func CoordinationOnNew(t *Coordination, c *context.Context, call call) func() {
	var p CoordinationNewStartInfo
	p.Context = c
	p.Call = call
	res := t.onNew(p)
	return func() {
		var p CoordinationNewDoneInfo
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func CoordinationOnCreateNode(t *Coordination, c *context.Context, call call, path string) func(error) {
	var p CoordinationCreateNodeStartInfo
	p.Context = c
	p.Call = call
	p.Path = path
	res := t.onCreateNode(p)
	return func(e error) {
		var p CoordinationCreateNodeDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func CoordinationOnAlterNode(t *Coordination, c *context.Context, call call, path string) func(error) {
	var p CoordinationAlterNodeStartInfo
	p.Context = c
	p.Call = call
	p.Path = path
	res := t.onAlterNode(p)
	return func(e error) {
		var p CoordinationAlterNodeDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func CoordinationOnDropNode(t *Coordination, c *context.Context, call call, path string) func(error) {
	var p CoordinationDropNodeStartInfo
	p.Context = c
	p.Call = call
	p.Path = path
	res := t.onDropNode(p)
	return func(e error) {
		var p CoordinationDropNodeDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func CoordinationOnDescribeNode(t *Coordination, c *context.Context, call call, path string) func(error) {
	var p CoordinationDescribeNodeStartInfo
	p.Context = c
	p.Call = call
	p.Path = path
	res := t.onDescribeNode(p)
	return func(e error) {
		var p CoordinationDescribeNodeDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func CoordinationOnSession(t *Coordination, c *context.Context, call call, path string) func(error) {
	var p CoordinationSessionStartInfo
	p.Context = c
	p.Call = call
	p.Path = path
	res := t.onSession(p)
	return func(e error) {
		var p CoordinationSessionDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func CoordinationOnClose(t *Coordination, c *context.Context, call call) func(error) {
	var p CoordinationCloseStartInfo
	p.Context = c
	p.Call = call
	res := t.onClose(p)
	return func(e error) {
		var p CoordinationCloseDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func CoordinationOnSessionNewStream(t *Coordination, c *context.Context, call call) func(error) {
	var p CoordinationSessionNewStreamStartInfo
	p.Context = c
	p.Call = call
	res := t.onSessionNewStream(p)
	return func(e error) {
		var p CoordinationSessionNewStreamDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func CoordinationOnSessionStarted(t *Coordination, sessionID uint64, expectedSessionID uint64) {
	var p CoordinationSessionStartedInfo
	p.SessionID = sessionID
	p.ExpectedSessionID = expectedSessionID
	t.onSessionStarted(p)
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func CoordinationOnSessionStartTimeout(t *Coordination, timeout time.Duration) {
	var p CoordinationSessionStartTimeoutInfo
	p.Timeout = timeout
	t.onSessionStartTimeout(p)
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func CoordinationOnSessionKeepAliveTimeout(t *Coordination, lastGoodResponseTime time.Time, timeout time.Duration) {
	var p CoordinationSessionKeepAliveTimeoutInfo
	p.LastGoodResponseTime = lastGoodResponseTime
	p.Timeout = timeout
	t.onSessionKeepAliveTimeout(p)
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func CoordinationOnSessionStopped(t *Coordination, sessionID uint64, expectedSessionID uint64) {
	var p CoordinationSessionStoppedInfo
	p.SessionID = sessionID
	p.ExpectedSessionID = expectedSessionID
	t.onSessionStopped(p)
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func CoordinationOnSessionStopTimeout(t *Coordination, timeout time.Duration) {
	var p CoordinationSessionStopTimeoutInfo
	p.Timeout = timeout
	t.onSessionStopTimeout(p)
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func CoordinationOnSessionClientTimeout(t *Coordination, lastGoodResponseTime time.Time, timeout time.Duration) {
	var p CoordinationSessionClientTimeoutInfo
	p.LastGoodResponseTime = lastGoodResponseTime
	p.Timeout = timeout
	t.onSessionClientTimeout(p)
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func CoordinationOnSessionServerExpire(t *Coordination, failure *Ydb_Coordination.SessionResponse_Failure) {
	var p CoordinationSessionServerExpireInfo
	p.Failure = failure
	t.onSessionServerExpire(p)
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func CoordinationOnSessionServerError(t *Coordination, failure *Ydb_Coordination.SessionResponse_Failure) {
	var p CoordinationSessionServerErrorInfo
	p.Failure = failure
	t.onSessionServerError(p)
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func CoordinationOnSessionReceive(t *Coordination) func(response *Ydb_Coordination.SessionResponse, _ error) {
	var p CoordinationSessionReceiveStartInfo
	res := t.onSessionReceive(p)
	return func(response *Ydb_Coordination.SessionResponse, e error) {
		var p CoordinationSessionReceiveDoneInfo
		p.Response = response
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func CoordinationOnSessionReceiveUnexpected(t *Coordination, response *Ydb_Coordination.SessionResponse) {
	var p CoordinationSessionReceiveUnexpectedInfo
	p.Response = response
	t.onSessionReceiveUnexpected(p)
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func CoordinationOnSessionStop(t *Coordination, sessionID uint64) {
	var p CoordinationSessionStopInfo
	p.SessionID = sessionID
	t.onSessionStop(p)
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func CoordinationOnSessionStart(t *Coordination) func(error) {
	var p CoordinationSessionStartStartInfo
	res := t.onSessionStart(p)
	return func(e error) {
		var p CoordinationSessionStartDoneInfo
		p.Error = e
		res(p)
	}
}
// Internals: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#internals
func CoordinationOnSessionSend(t *Coordination, request *Ydb_Coordination.SessionRequest) func(error) {
	var p CoordinationSessionSendStartInfo
	p.Request = request
	res := t.onSessionSend(p)
	return func(e error) {
		var p CoordinationSessionSendDoneInfo
		p.Error = e
		res(p)
	}
}
