// Code generated by mockery. DO NOT EDIT.

package smartblock

import (
	context "context"

	domain "github.com/anyproto/anytype-heart/core/domain"
	mock "github.com/stretchr/testify/mock"

	objecttreebuilder "github.com/anyproto/any-sync/commonspace/objecttreebuilder"

	threads "github.com/anyproto/anytype-heart/pkg/lib/threads"
)

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

type MockSpace_Expecter struct {
	mock *mock.Mock
}

func (_m *MockSpace) EXPECT() *MockSpace_Expecter {
	return &MockSpace_Expecter{mock: &_m.Mock}
}

// DeriveObjectID provides a mock function with given fields: ctx, uniqueKey
func (_m *MockSpace) DeriveObjectID(ctx context.Context, uniqueKey domain.UniqueKey) (string, error) {
	ret := _m.Called(ctx, uniqueKey)

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

	var r0 string
	var r1 error
	if rf, ok := ret.Get(0).(func(context.Context, domain.UniqueKey) (string, error)); ok {
		return rf(ctx, uniqueKey)
	}
	if rf, ok := ret.Get(0).(func(context.Context, domain.UniqueKey) string); ok {
		r0 = rf(ctx, uniqueKey)
	} else {
		r0 = ret.Get(0).(string)
	}

	if rf, ok := ret.Get(1).(func(context.Context, domain.UniqueKey) error); ok {
		r1 = rf(ctx, uniqueKey)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// MockSpace_DeriveObjectID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeriveObjectID'
type MockSpace_DeriveObjectID_Call struct {
	*mock.Call
}

// DeriveObjectID is a helper method to define mock.On call
//   - ctx context.Context
//   - uniqueKey domain.UniqueKey
func (_e *MockSpace_Expecter) DeriveObjectID(ctx interface{}, uniqueKey interface{}) *MockSpace_DeriveObjectID_Call {
	return &MockSpace_DeriveObjectID_Call{Call: _e.mock.On("DeriveObjectID", ctx, uniqueKey)}
}

func (_c *MockSpace_DeriveObjectID_Call) Run(run func(ctx context.Context, uniqueKey domain.UniqueKey)) *MockSpace_DeriveObjectID_Call {
	_c.Call.Run(func(args mock.Arguments) {
		run(args[0].(context.Context), args[1].(domain.UniqueKey))
	})
	return _c
}

func (_c *MockSpace_DeriveObjectID_Call) Return(id string, err error) *MockSpace_DeriveObjectID_Call {
	_c.Call.Return(id, err)
	return _c
}

func (_c *MockSpace_DeriveObjectID_Call) RunAndReturn(run func(context.Context, domain.UniqueKey) (string, error)) *MockSpace_DeriveObjectID_Call {
	_c.Call.Return(run)
	return _c
}

// DerivedIDs provides a mock function with given fields:
func (_m *MockSpace) DerivedIDs() threads.DerivedSmartblockIds {
	ret := _m.Called()

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

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

	return r0
}

// MockSpace_DerivedIDs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DerivedIDs'
type MockSpace_DerivedIDs_Call struct {
	*mock.Call
}

// DerivedIDs is a helper method to define mock.On call
func (_e *MockSpace_Expecter) DerivedIDs() *MockSpace_DerivedIDs_Call {
	return &MockSpace_DerivedIDs_Call{Call: _e.mock.On("DerivedIDs")}
}

func (_c *MockSpace_DerivedIDs_Call) Run(run func()) *MockSpace_DerivedIDs_Call {
	_c.Call.Run(func(args mock.Arguments) {
		run()
	})
	return _c
}

func (_c *MockSpace_DerivedIDs_Call) Return(_a0 threads.DerivedSmartblockIds) *MockSpace_DerivedIDs_Call {
	_c.Call.Return(_a0)
	return _c
}

func (_c *MockSpace_DerivedIDs_Call) RunAndReturn(run func() threads.DerivedSmartblockIds) *MockSpace_DerivedIDs_Call {
	_c.Call.Return(run)
	return _c
}

// Do provides a mock function with given fields: objectId, apply
func (_m *MockSpace) Do(objectId string, apply func(SmartBlock) error) error {
	ret := _m.Called(objectId, apply)

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

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

	return r0
}

// MockSpace_Do_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Do'
type MockSpace_Do_Call struct {
	*mock.Call
}

// Do is a helper method to define mock.On call
//   - objectId string
//   - apply func(SmartBlock) error
func (_e *MockSpace_Expecter) Do(objectId interface{}, apply interface{}) *MockSpace_Do_Call {
	return &MockSpace_Do_Call{Call: _e.mock.On("Do", objectId, apply)}
}

func (_c *MockSpace_Do_Call) Run(run func(objectId string, apply func(SmartBlock) error)) *MockSpace_Do_Call {
	_c.Call.Run(func(args mock.Arguments) {
		run(args[0].(string), args[1].(func(SmartBlock) error))
	})
	return _c
}

func (_c *MockSpace_Do_Call) Return(_a0 error) *MockSpace_Do_Call {
	_c.Call.Return(_a0)
	return _c
}

func (_c *MockSpace_Do_Call) RunAndReturn(run func(string, func(SmartBlock) error) error) *MockSpace_Do_Call {
	_c.Call.Return(run)
	return _c
}

// DoLockedIfNotExists provides a mock function with given fields: objectID, proc
func (_m *MockSpace) DoLockedIfNotExists(objectID string, proc func() error) error {
	ret := _m.Called(objectID, proc)

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

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

	return r0
}

// MockSpace_DoLockedIfNotExists_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DoLockedIfNotExists'
type MockSpace_DoLockedIfNotExists_Call struct {
	*mock.Call
}

// DoLockedIfNotExists is a helper method to define mock.On call
//   - objectID string
//   - proc func() error
func (_e *MockSpace_Expecter) DoLockedIfNotExists(objectID interface{}, proc interface{}) *MockSpace_DoLockedIfNotExists_Call {
	return &MockSpace_DoLockedIfNotExists_Call{Call: _e.mock.On("DoLockedIfNotExists", objectID, proc)}
}

func (_c *MockSpace_DoLockedIfNotExists_Call) Run(run func(objectID string, proc func() error)) *MockSpace_DoLockedIfNotExists_Call {
	_c.Call.Run(func(args mock.Arguments) {
		run(args[0].(string), args[1].(func() error))
	})
	return _c
}

func (_c *MockSpace_DoLockedIfNotExists_Call) Return(_a0 error) *MockSpace_DoLockedIfNotExists_Call {
	_c.Call.Return(_a0)
	return _c
}

func (_c *MockSpace_DoLockedIfNotExists_Call) RunAndReturn(run func(string, func() error) error) *MockSpace_DoLockedIfNotExists_Call {
	_c.Call.Return(run)
	return _c
}

// GetRelationIdByKey provides a mock function with given fields: ctx, key
func (_m *MockSpace) GetRelationIdByKey(ctx context.Context, key domain.RelationKey) (string, error) {
	ret := _m.Called(ctx, key)

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

	var r0 string
	var r1 error
	if rf, ok := ret.Get(0).(func(context.Context, domain.RelationKey) (string, error)); ok {
		return rf(ctx, key)
	}
	if rf, ok := ret.Get(0).(func(context.Context, domain.RelationKey) string); ok {
		r0 = rf(ctx, key)
	} else {
		r0 = ret.Get(0).(string)
	}

	if rf, ok := ret.Get(1).(func(context.Context, domain.RelationKey) error); ok {
		r1 = rf(ctx, key)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// MockSpace_GetRelationIdByKey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRelationIdByKey'
type MockSpace_GetRelationIdByKey_Call struct {
	*mock.Call
}

// GetRelationIdByKey is a helper method to define mock.On call
//   - ctx context.Context
//   - key domain.RelationKey
func (_e *MockSpace_Expecter) GetRelationIdByKey(ctx interface{}, key interface{}) *MockSpace_GetRelationIdByKey_Call {
	return &MockSpace_GetRelationIdByKey_Call{Call: _e.mock.On("GetRelationIdByKey", ctx, key)}
}

func (_c *MockSpace_GetRelationIdByKey_Call) Run(run func(ctx context.Context, key domain.RelationKey)) *MockSpace_GetRelationIdByKey_Call {
	_c.Call.Run(func(args mock.Arguments) {
		run(args[0].(context.Context), args[1].(domain.RelationKey))
	})
	return _c
}

func (_c *MockSpace_GetRelationIdByKey_Call) Return(id string, err error) *MockSpace_GetRelationIdByKey_Call {
	_c.Call.Return(id, err)
	return _c
}

func (_c *MockSpace_GetRelationIdByKey_Call) RunAndReturn(run func(context.Context, domain.RelationKey) (string, error)) *MockSpace_GetRelationIdByKey_Call {
	_c.Call.Return(run)
	return _c
}

// GetTypeIdByKey provides a mock function with given fields: ctx, key
func (_m *MockSpace) GetTypeIdByKey(ctx context.Context, key domain.TypeKey) (string, error) {
	ret := _m.Called(ctx, key)

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

	var r0 string
	var r1 error
	if rf, ok := ret.Get(0).(func(context.Context, domain.TypeKey) (string, error)); ok {
		return rf(ctx, key)
	}
	if rf, ok := ret.Get(0).(func(context.Context, domain.TypeKey) string); ok {
		r0 = rf(ctx, key)
	} else {
		r0 = ret.Get(0).(string)
	}

	if rf, ok := ret.Get(1).(func(context.Context, domain.TypeKey) error); ok {
		r1 = rf(ctx, key)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// MockSpace_GetTypeIdByKey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTypeIdByKey'
type MockSpace_GetTypeIdByKey_Call struct {
	*mock.Call
}

// GetTypeIdByKey is a helper method to define mock.On call
//   - ctx context.Context
//   - key domain.TypeKey
func (_e *MockSpace_Expecter) GetTypeIdByKey(ctx interface{}, key interface{}) *MockSpace_GetTypeIdByKey_Call {
	return &MockSpace_GetTypeIdByKey_Call{Call: _e.mock.On("GetTypeIdByKey", ctx, key)}
}

func (_c *MockSpace_GetTypeIdByKey_Call) Run(run func(ctx context.Context, key domain.TypeKey)) *MockSpace_GetTypeIdByKey_Call {
	_c.Call.Run(func(args mock.Arguments) {
		run(args[0].(context.Context), args[1].(domain.TypeKey))
	})
	return _c
}

func (_c *MockSpace_GetTypeIdByKey_Call) Return(id string, err error) *MockSpace_GetTypeIdByKey_Call {
	_c.Call.Return(id, err)
	return _c
}

func (_c *MockSpace_GetTypeIdByKey_Call) RunAndReturn(run func(context.Context, domain.TypeKey) (string, error)) *MockSpace_GetTypeIdByKey_Call {
	_c.Call.Return(run)
	return _c
}

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

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

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

	return r0
}

// MockSpace_Id_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Id'
type MockSpace_Id_Call struct {
	*mock.Call
}

// Id is a helper method to define mock.On call
func (_e *MockSpace_Expecter) Id() *MockSpace_Id_Call {
	return &MockSpace_Id_Call{Call: _e.mock.On("Id")}
}

func (_c *MockSpace_Id_Call) Run(run func()) *MockSpace_Id_Call {
	_c.Call.Run(func(args mock.Arguments) {
		run()
	})
	return _c
}

func (_c *MockSpace_Id_Call) Return(_a0 string) *MockSpace_Id_Call {
	_c.Call.Return(_a0)
	return _c
}

func (_c *MockSpace_Id_Call) RunAndReturn(run func() string) *MockSpace_Id_Call {
	_c.Call.Return(run)
	return _c
}

// IsPersonal provides a mock function with given fields:
func (_m *MockSpace) IsPersonal() bool {
	ret := _m.Called()

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

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

	return r0
}

// MockSpace_IsPersonal_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsPersonal'
type MockSpace_IsPersonal_Call struct {
	*mock.Call
}

// IsPersonal is a helper method to define mock.On call
func (_e *MockSpace_Expecter) IsPersonal() *MockSpace_IsPersonal_Call {
	return &MockSpace_IsPersonal_Call{Call: _e.mock.On("IsPersonal")}
}

func (_c *MockSpace_IsPersonal_Call) Run(run func()) *MockSpace_IsPersonal_Call {
	_c.Call.Run(func(args mock.Arguments) {
		run()
	})
	return _c
}

func (_c *MockSpace_IsPersonal_Call) Return(_a0 bool) *MockSpace_IsPersonal_Call {
	_c.Call.Return(_a0)
	return _c
}

func (_c *MockSpace_IsPersonal_Call) RunAndReturn(run func() bool) *MockSpace_IsPersonal_Call {
	_c.Call.Return(run)
	return _c
}

// RefreshObjects provides a mock function with given fields: objectIds
func (_m *MockSpace) RefreshObjects(objectIds []string) error {
	ret := _m.Called(objectIds)

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

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

	return r0
}

// MockSpace_RefreshObjects_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RefreshObjects'
type MockSpace_RefreshObjects_Call struct {
	*mock.Call
}

// RefreshObjects is a helper method to define mock.On call
//   - objectIds []string
func (_e *MockSpace_Expecter) RefreshObjects(objectIds interface{}) *MockSpace_RefreshObjects_Call {
	return &MockSpace_RefreshObjects_Call{Call: _e.mock.On("RefreshObjects", objectIds)}
}

func (_c *MockSpace_RefreshObjects_Call) Run(run func(objectIds []string)) *MockSpace_RefreshObjects_Call {
	_c.Call.Run(func(args mock.Arguments) {
		run(args[0].([]string))
	})
	return _c
}

func (_c *MockSpace_RefreshObjects_Call) Return(err error) *MockSpace_RefreshObjects_Call {
	_c.Call.Return(err)
	return _c
}

func (_c *MockSpace_RefreshObjects_Call) RunAndReturn(run func([]string) error) *MockSpace_RefreshObjects_Call {
	_c.Call.Return(run)
	return _c
}

// StoredIds provides a mock function with given fields:
func (_m *MockSpace) StoredIds() []string {
	ret := _m.Called()

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

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

	return r0
}

// MockSpace_StoredIds_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StoredIds'
type MockSpace_StoredIds_Call struct {
	*mock.Call
}

// StoredIds is a helper method to define mock.On call
func (_e *MockSpace_Expecter) StoredIds() *MockSpace_StoredIds_Call {
	return &MockSpace_StoredIds_Call{Call: _e.mock.On("StoredIds")}
}

func (_c *MockSpace_StoredIds_Call) Run(run func()) *MockSpace_StoredIds_Call {
	_c.Call.Run(func(args mock.Arguments) {
		run()
	})
	return _c
}

func (_c *MockSpace_StoredIds_Call) Return(_a0 []string) *MockSpace_StoredIds_Call {
	_c.Call.Return(_a0)
	return _c
}

func (_c *MockSpace_StoredIds_Call) RunAndReturn(run func() []string) *MockSpace_StoredIds_Call {
	_c.Call.Return(run)
	return _c
}

// TreeBuilder provides a mock function with given fields:
func (_m *MockSpace) TreeBuilder() objecttreebuilder.TreeBuilder {
	ret := _m.Called()

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

	var r0 objecttreebuilder.TreeBuilder
	if rf, ok := ret.Get(0).(func() objecttreebuilder.TreeBuilder); ok {
		r0 = rf()
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(objecttreebuilder.TreeBuilder)
		}
	}

	return r0
}

// MockSpace_TreeBuilder_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TreeBuilder'
type MockSpace_TreeBuilder_Call struct {
	*mock.Call
}

// TreeBuilder is a helper method to define mock.On call
func (_e *MockSpace_Expecter) TreeBuilder() *MockSpace_TreeBuilder_Call {
	return &MockSpace_TreeBuilder_Call{Call: _e.mock.On("TreeBuilder")}
}

func (_c *MockSpace_TreeBuilder_Call) Run(run func()) *MockSpace_TreeBuilder_Call {
	_c.Call.Run(func(args mock.Arguments) {
		run()
	})
	return _c
}

func (_c *MockSpace_TreeBuilder_Call) Return(_a0 objecttreebuilder.TreeBuilder) *MockSpace_TreeBuilder_Call {
	_c.Call.Return(_a0)
	return _c
}

func (_c *MockSpace_TreeBuilder_Call) RunAndReturn(run func() objecttreebuilder.TreeBuilder) *MockSpace_TreeBuilder_Call {
	_c.Call.Return(run)
	return _c
}

// TryRemove provides a mock function with given fields: objectId
func (_m *MockSpace) TryRemove(objectId string) (bool, error) {
	ret := _m.Called(objectId)

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

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

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

	return r0, r1
}

// MockSpace_TryRemove_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TryRemove'
type MockSpace_TryRemove_Call struct {
	*mock.Call
}

// TryRemove is a helper method to define mock.On call
//   - objectId string
func (_e *MockSpace_Expecter) TryRemove(objectId interface{}) *MockSpace_TryRemove_Call {
	return &MockSpace_TryRemove_Call{Call: _e.mock.On("TryRemove", objectId)}
}

func (_c *MockSpace_TryRemove_Call) Run(run func(objectId string)) *MockSpace_TryRemove_Call {
	_c.Call.Run(func(args mock.Arguments) {
		run(args[0].(string))
	})
	return _c
}

func (_c *MockSpace_TryRemove_Call) Return(_a0 bool, _a1 error) *MockSpace_TryRemove_Call {
	_c.Call.Return(_a0, _a1)
	return _c
}

func (_c *MockSpace_TryRemove_Call) RunAndReturn(run func(string) (bool, error)) *MockSpace_TryRemove_Call {
	_c.Call.Return(run)
	return _c
}

// NewMockSpace creates a new instance of MockSpace. 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 NewMockSpace(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockSpace {
	mock := &MockSpace{}
	mock.Mock.Test(t)

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

	return mock
}
