// Code generated by mockery v2.50.0. DO NOT EDIT.

package mocks

import (
	broker "github.com/anycable/anycable-go/broker"
	common "github.com/anycable/anycable-go/common"

	context "context"

	mock "github.com/stretchr/testify/mock"
)

// Broker is an autogenerated mock type for the Broker type
type Broker struct {
	mock.Mock
}

// Announce provides a mock function with no fields
func (_m *Broker) Announce() string {
	ret := _m.Called()

	if len(ret) == 0 {
		panic("no return value specified for Announce")
	}

	var r0 string
	if rf, ok := ret.Get(0).(func() string); ok {
		r0 = rf()
	} else {
		r0 = ret.Get(0).(string)
	}

	return r0
}

// CommitSession provides a mock function with given fields: sid, session
func (_m *Broker) CommitSession(sid string, session broker.Cacheable) error {
	ret := _m.Called(sid, session)

	if len(ret) == 0 {
		panic("no return value specified for CommitSession")
	}

	var r0 error
	if rf, ok := ret.Get(0).(func(string, broker.Cacheable) error); ok {
		r0 = rf(sid, session)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// HandleBroadcast provides a mock function with given fields: msg
func (_m *Broker) HandleBroadcast(msg *common.StreamMessage) {
	_m.Called(msg)
}

// HandleCommand provides a mock function with given fields: msg
func (_m *Broker) HandleCommand(msg *common.RemoteCommandMessage) {
	_m.Called(msg)
}

// HistoryFrom provides a mock function with given fields: stream, epoch, offset
func (_m *Broker) HistoryFrom(stream string, epoch string, offset uint64) ([]common.StreamMessage, error) {
	ret := _m.Called(stream, epoch, offset)

	if len(ret) == 0 {
		panic("no return value specified for HistoryFrom")
	}

	var r0 []common.StreamMessage
	var r1 error
	if rf, ok := ret.Get(0).(func(string, string, uint64) ([]common.StreamMessage, error)); ok {
		return rf(stream, epoch, offset)
	}
	if rf, ok := ret.Get(0).(func(string, string, uint64) []common.StreamMessage); ok {
		r0 = rf(stream, epoch, offset)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).([]common.StreamMessage)
		}
	}

	if rf, ok := ret.Get(1).(func(string, string, uint64) error); ok {
		r1 = rf(stream, epoch, offset)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// HistorySince provides a mock function with given fields: stream, ts
func (_m *Broker) HistorySince(stream string, ts int64) ([]common.StreamMessage, error) {
	ret := _m.Called(stream, ts)

	if len(ret) == 0 {
		panic("no return value specified for HistorySince")
	}

	var r0 []common.StreamMessage
	var r1 error
	if rf, ok := ret.Get(0).(func(string, int64) ([]common.StreamMessage, error)); ok {
		return rf(stream, ts)
	}
	if rf, ok := ret.Get(0).(func(string, int64) []common.StreamMessage); ok {
		r0 = rf(stream, ts)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).([]common.StreamMessage)
		}
	}

	if rf, ok := ret.Get(1).(func(string, int64) error); ok {
		r1 = rf(stream, ts)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// PresenceAdd provides a mock function with given fields: stream, sid, pid, info
func (_m *Broker) PresenceAdd(stream string, sid string, pid string, info interface{}) (*common.PresenceEvent, error) {
	ret := _m.Called(stream, sid, pid, info)

	if len(ret) == 0 {
		panic("no return value specified for PresenceAdd")
	}

	var r0 *common.PresenceEvent
	var r1 error
	if rf, ok := ret.Get(0).(func(string, string, string, interface{}) (*common.PresenceEvent, error)); ok {
		return rf(stream, sid, pid, info)
	}
	if rf, ok := ret.Get(0).(func(string, string, string, interface{}) *common.PresenceEvent); ok {
		r0 = rf(stream, sid, pid, info)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*common.PresenceEvent)
		}
	}

	if rf, ok := ret.Get(1).(func(string, string, string, interface{}) error); ok {
		r1 = rf(stream, sid, pid, info)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// PresenceInfo provides a mock function with given fields: stream, opts
func (_m *Broker) PresenceInfo(stream string, opts ...broker.PresenceInfoOption) (*common.PresenceInfo, error) {
	_va := make([]interface{}, len(opts))
	for _i := range opts {
		_va[_i] = opts[_i]
	}
	var _ca []interface{}
	_ca = append(_ca, stream)
	_ca = append(_ca, _va...)
	ret := _m.Called(_ca...)

	if len(ret) == 0 {
		panic("no return value specified for PresenceInfo")
	}

	var r0 *common.PresenceInfo
	var r1 error
	if rf, ok := ret.Get(0).(func(string, ...broker.PresenceInfoOption) (*common.PresenceInfo, error)); ok {
		return rf(stream, opts...)
	}
	if rf, ok := ret.Get(0).(func(string, ...broker.PresenceInfoOption) *common.PresenceInfo); ok {
		r0 = rf(stream, opts...)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*common.PresenceInfo)
		}
	}

	if rf, ok := ret.Get(1).(func(string, ...broker.PresenceInfoOption) error); ok {
		r1 = rf(stream, opts...)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// PresenceRemove provides a mock function with given fields: stream, sid
func (_m *Broker) PresenceRemove(stream string, sid string) (*common.PresenceEvent, error) {
	ret := _m.Called(stream, sid)

	if len(ret) == 0 {
		panic("no return value specified for PresenceRemove")
	}

	var r0 *common.PresenceEvent
	var r1 error
	if rf, ok := ret.Get(0).(func(string, string) (*common.PresenceEvent, error)); ok {
		return rf(stream, sid)
	}
	if rf, ok := ret.Get(0).(func(string, string) *common.PresenceEvent); ok {
		r0 = rf(stream, sid)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*common.PresenceEvent)
		}
	}

	if rf, ok := ret.Get(1).(func(string, string) error); ok {
		r1 = rf(stream, sid)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// RestoreSession provides a mock function with given fields: from
func (_m *Broker) RestoreSession(from string) ([]byte, error) {
	ret := _m.Called(from)

	if len(ret) == 0 {
		panic("no return value specified for RestoreSession")
	}

	var r0 []byte
	var r1 error
	if rf, ok := ret.Get(0).(func(string) ([]byte, error)); ok {
		return rf(from)
	}
	if rf, ok := ret.Get(0).(func(string) []byte); ok {
		r0 = rf(from)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).([]byte)
		}
	}

	if rf, ok := ret.Get(1).(func(string) error); ok {
		r1 = rf(from)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// Shutdown provides a mock function with given fields: ctx
func (_m *Broker) Shutdown(ctx context.Context) error {
	ret := _m.Called(ctx)

	if len(ret) == 0 {
		panic("no return value specified for Shutdown")
	}

	var r0 error
	if rf, ok := ret.Get(0).(func(context.Context) error); ok {
		r0 = rf(ctx)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// Start provides a mock function with given fields: done
func (_m *Broker) Start(done chan error) error {
	ret := _m.Called(done)

	if len(ret) == 0 {
		panic("no return value specified for Start")
	}

	var r0 error
	if rf, ok := ret.Get(0).(func(chan error) error); ok {
		r0 = rf(done)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// Subscribe provides a mock function with given fields: stream
func (_m *Broker) Subscribe(stream string) string {
	ret := _m.Called(stream)

	if len(ret) == 0 {
		panic("no return value specified for Subscribe")
	}

	var r0 string
	if rf, ok := ret.Get(0).(func(string) string); ok {
		r0 = rf(stream)
	} else {
		r0 = ret.Get(0).(string)
	}

	return r0
}

// TouchPresence provides a mock function with given fields: sid
func (_m *Broker) TouchPresence(sid string) error {
	ret := _m.Called(sid)

	if len(ret) == 0 {
		panic("no return value specified for TouchPresence")
	}

	var r0 error
	if rf, ok := ret.Get(0).(func(string) error); ok {
		r0 = rf(sid)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// TouchSession provides a mock function with given fields: sid
func (_m *Broker) TouchSession(sid string) error {
	ret := _m.Called(sid)

	if len(ret) == 0 {
		panic("no return value specified for TouchSession")
	}

	var r0 error
	if rf, ok := ret.Get(0).(func(string) error); ok {
		r0 = rf(sid)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// Unsubscribe provides a mock function with given fields: stream
func (_m *Broker) Unsubscribe(stream string) string {
	ret := _m.Called(stream)

	if len(ret) == 0 {
		panic("no return value specified for Unsubscribe")
	}

	var r0 string
	if rf, ok := ret.Get(0).(func(string) string); ok {
		r0 = rf(stream)
	} else {
		r0 = ret.Get(0).(string)
	}

	return r0
}

// NewBroker creates a new instance of Broker. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewBroker(t interface {
	mock.TestingT
	Cleanup(func())
}) *Broker {
	mock := &Broker{}
	mock.Mock.Test(t)

	t.Cleanup(func() { mock.AssertExpectations(t) })

	return mock
}
