package metadata

import (
	"context"
)

type triggerSubscriptionRuntimeTxManagerStub struct {
	active bool
}

func (*triggerSubscriptionRuntimeTxManagerStub) WithTransaction(context.Context, func(context.Context) error) error {
	return nil
}

func (*triggerSubscriptionRuntimeTxManagerStub) WithPessimisticTransaction(context.Context, func(context.Context) error) error {
	return nil
}

func (*triggerSubscriptionRuntimeTxManagerStub) WithRetry(context.Context, func(context.Context) error, int) error {
	return nil
}

func (*triggerSubscriptionRuntimeTxManagerStub) WithPessimisticRetry(context.Context, func(context.Context) error, int) error {
	return nil
}

func (s *triggerSubscriptionRuntimeTxManagerStub) IsTransactionActive(context.Context) bool {
	return s.active
}

func (*triggerSubscriptionRuntimeTxManagerStub) IsPessimisticTx(context.Context) bool {
	return false
}

func (*triggerSubscriptionRuntimeTxManagerStub) ExtractTx(context.Context) interface{} {
	return nil
}

func (*triggerSubscriptionRuntimeTxManagerStub) DetachTx(ctx context.Context) context.Context {
	return ctx
}

type assertiveError string

func (e assertiveError) Error() string { return string(e) }

func runtimeStringPtr(v string) *string {
	return &v
}
