// Code generated by mockery; DO NOT EDIT.
// github.com/vektra/mockery
// template: testify

package mocks

import (
	"context"

	"github.com/agntcy/identity-service/internal/core/app/types"
	"github.com/agntcy/identity-service/internal/pkg/pagination"
	"github.com/agntcy/identity-service/internal/pkg/sorting"
	mock "github.com/stretchr/testify/mock"
)

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

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

	return mock
}

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

type Repository_Expecter struct {
	mock *mock.Mock
}

func (_m *Repository) EXPECT() *Repository_Expecter {
	return &Repository_Expecter{mock: &_m.Mock}
}

// CountAllApps provides a mock function for the type Repository
func (_mock *Repository) CountAllApps(ctx context.Context) (int64, error) {
	ret := _mock.Called(ctx)

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

	var r0 int64
	var r1 error
	if returnFunc, ok := ret.Get(0).(func(context.Context) (int64, error)); ok {
		return returnFunc(ctx)
	}
	if returnFunc, ok := ret.Get(0).(func(context.Context) int64); ok {
		r0 = returnFunc(ctx)
	} else {
		r0 = ret.Get(0).(int64)
	}
	if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok {
		r1 = returnFunc(ctx)
	} else {
		r1 = ret.Error(1)
	}
	return r0, r1
}

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

// CountAllApps is a helper method to define mock.On call
//   - ctx context.Context
func (_e *Repository_Expecter) CountAllApps(ctx interface{}) *Repository_CountAllApps_Call {
	return &Repository_CountAllApps_Call{Call: _e.mock.On("CountAllApps", ctx)}
}

func (_c *Repository_CountAllApps_Call) Run(run func(ctx context.Context)) *Repository_CountAllApps_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 context.Context
		if args[0] != nil {
			arg0 = args[0].(context.Context)
		}
		run(
			arg0,
		)
	})
	return _c
}

func (_c *Repository_CountAllApps_Call) Return(n int64, err error) *Repository_CountAllApps_Call {
	_c.Call.Return(n, err)
	return _c
}

func (_c *Repository_CountAllApps_Call) RunAndReturn(run func(ctx context.Context) (int64, error)) *Repository_CountAllApps_Call {
	_c.Call.Return(run)
	return _c
}

// CreateApp provides a mock function for the type Repository
func (_mock *Repository) CreateApp(ctx context.Context, app *types.App) (*types.App, error) {
	ret := _mock.Called(ctx, app)

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

	var r0 *types.App
	var r1 error
	if returnFunc, ok := ret.Get(0).(func(context.Context, *types.App) (*types.App, error)); ok {
		return returnFunc(ctx, app)
	}
	if returnFunc, ok := ret.Get(0).(func(context.Context, *types.App) *types.App); ok {
		r0 = returnFunc(ctx, app)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*types.App)
		}
	}
	if returnFunc, ok := ret.Get(1).(func(context.Context, *types.App) error); ok {
		r1 = returnFunc(ctx, app)
	} else {
		r1 = ret.Error(1)
	}
	return r0, r1
}

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

// CreateApp is a helper method to define mock.On call
//   - ctx context.Context
//   - app *types.App
func (_e *Repository_Expecter) CreateApp(ctx interface{}, app interface{}) *Repository_CreateApp_Call {
	return &Repository_CreateApp_Call{Call: _e.mock.On("CreateApp", ctx, app)}
}

func (_c *Repository_CreateApp_Call) Run(run func(ctx context.Context, app *types.App)) *Repository_CreateApp_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 context.Context
		if args[0] != nil {
			arg0 = args[0].(context.Context)
		}
		var arg1 *types.App
		if args[1] != nil {
			arg1 = args[1].(*types.App)
		}
		run(
			arg0,
			arg1,
		)
	})
	return _c
}

func (_c *Repository_CreateApp_Call) Return(app1 *types.App, err error) *Repository_CreateApp_Call {
	_c.Call.Return(app1, err)
	return _c
}

func (_c *Repository_CreateApp_Call) RunAndReturn(run func(ctx context.Context, app *types.App) (*types.App, error)) *Repository_CreateApp_Call {
	_c.Call.Return(run)
	return _c
}

// DeleteApp provides a mock function for the type Repository
func (_mock *Repository) DeleteApp(ctx context.Context, app *types.App) error {
	ret := _mock.Called(ctx, app)

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

	var r0 error
	if returnFunc, ok := ret.Get(0).(func(context.Context, *types.App) error); ok {
		r0 = returnFunc(ctx, app)
	} else {
		r0 = ret.Error(0)
	}
	return r0
}

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

// DeleteApp is a helper method to define mock.On call
//   - ctx context.Context
//   - app *types.App
func (_e *Repository_Expecter) DeleteApp(ctx interface{}, app interface{}) *Repository_DeleteApp_Call {
	return &Repository_DeleteApp_Call{Call: _e.mock.On("DeleteApp", ctx, app)}
}

func (_c *Repository_DeleteApp_Call) Run(run func(ctx context.Context, app *types.App)) *Repository_DeleteApp_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 context.Context
		if args[0] != nil {
			arg0 = args[0].(context.Context)
		}
		var arg1 *types.App
		if args[1] != nil {
			arg1 = args[1].(*types.App)
		}
		run(
			arg0,
			arg1,
		)
	})
	return _c
}

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

func (_c *Repository_DeleteApp_Call) RunAndReturn(run func(ctx context.Context, app *types.App) error) *Repository_DeleteApp_Call {
	_c.Call.Return(run)
	return _c
}

// GetAllApps provides a mock function for the type Repository
func (_mock *Repository) GetAllApps(ctx context.Context, paginationFilter pagination.PaginationFilter, query *string, appTypes []types.AppType, sortBy sorting.Sorting) (*pagination.Pageable[types.App], error) {
	ret := _mock.Called(ctx, paginationFilter, query, appTypes, sortBy)

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

	var r0 *pagination.Pageable[types.App]
	var r1 error
	if returnFunc, ok := ret.Get(0).(func(context.Context, pagination.PaginationFilter, *string, []types.AppType, sorting.Sorting) (*pagination.Pageable[types.App], error)); ok {
		return returnFunc(ctx, paginationFilter, query, appTypes, sortBy)
	}
	if returnFunc, ok := ret.Get(0).(func(context.Context, pagination.PaginationFilter, *string, []types.AppType, sorting.Sorting) *pagination.Pageable[types.App]); ok {
		r0 = returnFunc(ctx, paginationFilter, query, appTypes, sortBy)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*pagination.Pageable[types.App])
		}
	}
	if returnFunc, ok := ret.Get(1).(func(context.Context, pagination.PaginationFilter, *string, []types.AppType, sorting.Sorting) error); ok {
		r1 = returnFunc(ctx, paginationFilter, query, appTypes, sortBy)
	} else {
		r1 = ret.Error(1)
	}
	return r0, r1
}

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

// GetAllApps is a helper method to define mock.On call
//   - ctx context.Context
//   - paginationFilter pagination.PaginationFilter
//   - query *string
//   - appTypes []types.AppType
//   - sortBy sorting.Sorting
func (_e *Repository_Expecter) GetAllApps(ctx interface{}, paginationFilter interface{}, query interface{}, appTypes interface{}, sortBy interface{}) *Repository_GetAllApps_Call {
	return &Repository_GetAllApps_Call{Call: _e.mock.On("GetAllApps", ctx, paginationFilter, query, appTypes, sortBy)}
}

func (_c *Repository_GetAllApps_Call) Run(run func(ctx context.Context, paginationFilter pagination.PaginationFilter, query *string, appTypes []types.AppType, sortBy sorting.Sorting)) *Repository_GetAllApps_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 context.Context
		if args[0] != nil {
			arg0 = args[0].(context.Context)
		}
		var arg1 pagination.PaginationFilter
		if args[1] != nil {
			arg1 = args[1].(pagination.PaginationFilter)
		}
		var arg2 *string
		if args[2] != nil {
			arg2 = args[2].(*string)
		}
		var arg3 []types.AppType
		if args[3] != nil {
			arg3 = args[3].([]types.AppType)
		}
		var arg4 sorting.Sorting
		if args[4] != nil {
			arg4 = args[4].(sorting.Sorting)
		}
		run(
			arg0,
			arg1,
			arg2,
			arg3,
			arg4,
		)
	})
	return _c
}

func (_c *Repository_GetAllApps_Call) Return(pageable *pagination.Pageable[types.App], err error) *Repository_GetAllApps_Call {
	_c.Call.Return(pageable, err)
	return _c
}

func (_c *Repository_GetAllApps_Call) RunAndReturn(run func(ctx context.Context, paginationFilter pagination.PaginationFilter, query *string, appTypes []types.AppType, sortBy sorting.Sorting) (*pagination.Pageable[types.App], error)) *Repository_GetAllApps_Call {
	_c.Call.Return(run)
	return _c
}

// GetApp provides a mock function for the type Repository
func (_mock *Repository) GetApp(ctx context.Context, id string) (*types.App, error) {
	ret := _mock.Called(ctx, id)

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

	var r0 *types.App
	var r1 error
	if returnFunc, ok := ret.Get(0).(func(context.Context, string) (*types.App, error)); ok {
		return returnFunc(ctx, id)
	}
	if returnFunc, ok := ret.Get(0).(func(context.Context, string) *types.App); ok {
		r0 = returnFunc(ctx, id)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*types.App)
		}
	}
	if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok {
		r1 = returnFunc(ctx, id)
	} else {
		r1 = ret.Error(1)
	}
	return r0, r1
}

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

// GetApp is a helper method to define mock.On call
//   - ctx context.Context
//   - id string
func (_e *Repository_Expecter) GetApp(ctx interface{}, id interface{}) *Repository_GetApp_Call {
	return &Repository_GetApp_Call{Call: _e.mock.On("GetApp", ctx, id)}
}

func (_c *Repository_GetApp_Call) Run(run func(ctx context.Context, id string)) *Repository_GetApp_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 context.Context
		if args[0] != nil {
			arg0 = args[0].(context.Context)
		}
		var arg1 string
		if args[1] != nil {
			arg1 = args[1].(string)
		}
		run(
			arg0,
			arg1,
		)
	})
	return _c
}

func (_c *Repository_GetApp_Call) Return(app *types.App, err error) *Repository_GetApp_Call {
	_c.Call.Return(app, err)
	return _c
}

func (_c *Repository_GetApp_Call) RunAndReturn(run func(ctx context.Context, id string) (*types.App, error)) *Repository_GetApp_Call {
	_c.Call.Return(run)
	return _c
}

// GetAppByResolverMetadataID provides a mock function for the type Repository
func (_mock *Repository) GetAppByResolverMetadataID(ctx context.Context, resolverMetadataID string) (*types.App, error) {
	ret := _mock.Called(ctx, resolverMetadataID)

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

	var r0 *types.App
	var r1 error
	if returnFunc, ok := ret.Get(0).(func(context.Context, string) (*types.App, error)); ok {
		return returnFunc(ctx, resolverMetadataID)
	}
	if returnFunc, ok := ret.Get(0).(func(context.Context, string) *types.App); ok {
		r0 = returnFunc(ctx, resolverMetadataID)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*types.App)
		}
	}
	if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok {
		r1 = returnFunc(ctx, resolverMetadataID)
	} else {
		r1 = ret.Error(1)
	}
	return r0, r1
}

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

// GetAppByResolverMetadataID is a helper method to define mock.On call
//   - ctx context.Context
//   - resolverMetadataID string
func (_e *Repository_Expecter) GetAppByResolverMetadataID(ctx interface{}, resolverMetadataID interface{}) *Repository_GetAppByResolverMetadataID_Call {
	return &Repository_GetAppByResolverMetadataID_Call{Call: _e.mock.On("GetAppByResolverMetadataID", ctx, resolverMetadataID)}
}

func (_c *Repository_GetAppByResolverMetadataID_Call) Run(run func(ctx context.Context, resolverMetadataID string)) *Repository_GetAppByResolverMetadataID_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 context.Context
		if args[0] != nil {
			arg0 = args[0].(context.Context)
		}
		var arg1 string
		if args[1] != nil {
			arg1 = args[1].(string)
		}
		run(
			arg0,
			arg1,
		)
	})
	return _c
}

func (_c *Repository_GetAppByResolverMetadataID_Call) Return(app *types.App, err error) *Repository_GetAppByResolverMetadataID_Call {
	_c.Call.Return(app, err)
	return _c
}

func (_c *Repository_GetAppByResolverMetadataID_Call) RunAndReturn(run func(ctx context.Context, resolverMetadataID string) (*types.App, error)) *Repository_GetAppByResolverMetadataID_Call {
	_c.Call.Return(run)
	return _c
}

// GetAppStatuses provides a mock function for the type Repository
func (_mock *Repository) GetAppStatuses(ctx context.Context, appIDs ...string) (map[string]types.AppStatus, error) {
	// string
	_va := make([]interface{}, len(appIDs))
	for _i := range appIDs {
		_va[_i] = appIDs[_i]
	}
	var _ca []interface{}
	_ca = append(_ca, ctx)
	_ca = append(_ca, _va...)
	ret := _mock.Called(_ca...)

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

	var r0 map[string]types.AppStatus
	var r1 error
	if returnFunc, ok := ret.Get(0).(func(context.Context, ...string) (map[string]types.AppStatus, error)); ok {
		return returnFunc(ctx, appIDs...)
	}
	if returnFunc, ok := ret.Get(0).(func(context.Context, ...string) map[string]types.AppStatus); ok {
		r0 = returnFunc(ctx, appIDs...)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(map[string]types.AppStatus)
		}
	}
	if returnFunc, ok := ret.Get(1).(func(context.Context, ...string) error); ok {
		r1 = returnFunc(ctx, appIDs...)
	} else {
		r1 = ret.Error(1)
	}
	return r0, r1
}

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

// GetAppStatuses is a helper method to define mock.On call
//   - ctx context.Context
//   - appIDs ...string
func (_e *Repository_Expecter) GetAppStatuses(ctx interface{}, appIDs ...interface{}) *Repository_GetAppStatuses_Call {
	return &Repository_GetAppStatuses_Call{Call: _e.mock.On("GetAppStatuses",
		append([]interface{}{ctx}, appIDs...)...)}
}

func (_c *Repository_GetAppStatuses_Call) Run(run func(ctx context.Context, appIDs ...string)) *Repository_GetAppStatuses_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 context.Context
		if args[0] != nil {
			arg0 = args[0].(context.Context)
		}
		var arg1 []string
		variadicArgs := make([]string, len(args)-1)
		for i, a := range args[1:] {
			if a != nil {
				variadicArgs[i] = a.(string)
			}
		}
		arg1 = variadicArgs
		run(
			arg0,
			arg1...,
		)
	})
	return _c
}

func (_c *Repository_GetAppStatuses_Call) Return(stringToAppStatus map[string]types.AppStatus, err error) *Repository_GetAppStatuses_Call {
	_c.Call.Return(stringToAppStatus, err)
	return _c
}

func (_c *Repository_GetAppStatuses_Call) RunAndReturn(run func(ctx context.Context, appIDs ...string) (map[string]types.AppStatus, error)) *Repository_GetAppStatuses_Call {
	_c.Call.Return(run)
	return _c
}

// GetAppsByID provides a mock function for the type Repository
func (_mock *Repository) GetAppsByID(ctx context.Context, ids []string) ([]*types.App, error) {
	ret := _mock.Called(ctx, ids)

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

	var r0 []*types.App
	var r1 error
	if returnFunc, ok := ret.Get(0).(func(context.Context, []string) ([]*types.App, error)); ok {
		return returnFunc(ctx, ids)
	}
	if returnFunc, ok := ret.Get(0).(func(context.Context, []string) []*types.App); ok {
		r0 = returnFunc(ctx, ids)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).([]*types.App)
		}
	}
	if returnFunc, ok := ret.Get(1).(func(context.Context, []string) error); ok {
		r1 = returnFunc(ctx, ids)
	} else {
		r1 = ret.Error(1)
	}
	return r0, r1
}

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

// GetAppsByID is a helper method to define mock.On call
//   - ctx context.Context
//   - ids []string
func (_e *Repository_Expecter) GetAppsByID(ctx interface{}, ids interface{}) *Repository_GetAppsByID_Call {
	return &Repository_GetAppsByID_Call{Call: _e.mock.On("GetAppsByID", ctx, ids)}
}

func (_c *Repository_GetAppsByID_Call) Run(run func(ctx context.Context, ids []string)) *Repository_GetAppsByID_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 context.Context
		if args[0] != nil {
			arg0 = args[0].(context.Context)
		}
		var arg1 []string
		if args[1] != nil {
			arg1 = args[1].([]string)
		}
		run(
			arg0,
			arg1,
		)
	})
	return _c
}

func (_c *Repository_GetAppsByID_Call) Return(apps []*types.App, err error) *Repository_GetAppsByID_Call {
	_c.Call.Return(apps, err)
	return _c
}

func (_c *Repository_GetAppsByID_Call) RunAndReturn(run func(ctx context.Context, ids []string) ([]*types.App, error)) *Repository_GetAppsByID_Call {
	_c.Call.Return(run)
	return _c
}

// UpdateApp provides a mock function for the type Repository
func (_mock *Repository) UpdateApp(ctx context.Context, app *types.App) error {
	ret := _mock.Called(ctx, app)

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

	var r0 error
	if returnFunc, ok := ret.Get(0).(func(context.Context, *types.App) error); ok {
		r0 = returnFunc(ctx, app)
	} else {
		r0 = ret.Error(0)
	}
	return r0
}

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

// UpdateApp is a helper method to define mock.On call
//   - ctx context.Context
//   - app *types.App
func (_e *Repository_Expecter) UpdateApp(ctx interface{}, app interface{}) *Repository_UpdateApp_Call {
	return &Repository_UpdateApp_Call{Call: _e.mock.On("UpdateApp", ctx, app)}
}

func (_c *Repository_UpdateApp_Call) Run(run func(ctx context.Context, app *types.App)) *Repository_UpdateApp_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 context.Context
		if args[0] != nil {
			arg0 = args[0].(context.Context)
		}
		var arg1 *types.App
		if args[1] != nil {
			arg1 = args[1].(*types.App)
		}
		run(
			arg0,
			arg1,
		)
	})
	return _c
}

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

func (_c *Repository_UpdateApp_Call) RunAndReturn(run func(ctx context.Context, app *types.App) error) *Repository_UpdateApp_Call {
	_c.Call.Return(run)
	return _c
}
