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

package mocks

import (
	"context"

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

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

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

	return mock
}

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

type PolicyRepository_Expecter struct {
	mock *mock.Mock
}

func (_m *PolicyRepository) EXPECT() *PolicyRepository_Expecter {
	return &PolicyRepository_Expecter{mock: &_m.Mock}
}

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

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

	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
}

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

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

func (_c *PolicyRepository_CountAll_Call) Run(run func(ctx context.Context)) *PolicyRepository_CountAll_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 *PolicyRepository_CountAll_Call) Return(n int64, err error) *PolicyRepository_CountAll_Call {
	_c.Call.Return(n, err)
	return _c
}

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

// Create provides a mock function for the type PolicyRepository
func (_mock *PolicyRepository) Create(ctx context.Context, policy *types.Policy) error {
	ret := _mock.Called(ctx, policy)

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

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

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

// Create is a helper method to define mock.On call
//   - ctx context.Context
//   - policy *types.Policy
func (_e *PolicyRepository_Expecter) Create(ctx interface{}, policy interface{}) *PolicyRepository_Create_Call {
	return &PolicyRepository_Create_Call{Call: _e.mock.On("Create", ctx, policy)}
}

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

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

func (_c *PolicyRepository_Create_Call) RunAndReturn(run func(ctx context.Context, policy *types.Policy) error) *PolicyRepository_Create_Call {
	_c.Call.Return(run)
	return _c
}

// Delete provides a mock function for the type PolicyRepository
func (_mock *PolicyRepository) Delete(ctx context.Context, policies ...*types.Policy) error {
	// *types.Policy
	_va := make([]interface{}, len(policies))
	for _i := range policies {
		_va[_i] = policies[_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 Delete")
	}

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

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

// Delete is a helper method to define mock.On call
//   - ctx context.Context
//   - policies ...*types.Policy
func (_e *PolicyRepository_Expecter) Delete(ctx interface{}, policies ...interface{}) *PolicyRepository_Delete_Call {
	return &PolicyRepository_Delete_Call{Call: _e.mock.On("Delete",
		append([]interface{}{ctx}, policies...)...)}
}

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

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

func (_c *PolicyRepository_Delete_Call) RunAndReturn(run func(ctx context.Context, policies ...*types.Policy) error) *PolicyRepository_Delete_Call {
	_c.Call.Return(run)
	return _c
}

// DeleteByAppID provides a mock function for the type PolicyRepository
func (_mock *PolicyRepository) DeleteByAppID(ctx context.Context, appID string) error {
	ret := _mock.Called(ctx, appID)

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

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

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

// DeleteByAppID is a helper method to define mock.On call
//   - ctx context.Context
//   - appID string
func (_e *PolicyRepository_Expecter) DeleteByAppID(ctx interface{}, appID interface{}) *PolicyRepository_DeleteByAppID_Call {
	return &PolicyRepository_DeleteByAppID_Call{Call: _e.mock.On("DeleteByAppID", ctx, appID)}
}

func (_c *PolicyRepository_DeleteByAppID_Call) Run(run func(ctx context.Context, appID string)) *PolicyRepository_DeleteByAppID_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 *PolicyRepository_DeleteByAppID_Call) Return(err error) *PolicyRepository_DeleteByAppID_Call {
	_c.Call.Return(err)
	return _c
}

func (_c *PolicyRepository_DeleteByAppID_Call) RunAndReturn(run func(ctx context.Context, appID string) error) *PolicyRepository_DeleteByAppID_Call {
	_c.Call.Return(run)
	return _c
}

// GetAll provides a mock function for the type PolicyRepository
func (_mock *PolicyRepository) GetAll(ctx context.Context, paginationFilter pagination.PaginationFilter, query *string, appIDs []string, rulesForAppIDs []string) (*pagination.Pageable[types.Policy], error) {
	ret := _mock.Called(ctx, paginationFilter, query, appIDs, rulesForAppIDs)

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

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

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

// GetAll is a helper method to define mock.On call
//   - ctx context.Context
//   - paginationFilter pagination.PaginationFilter
//   - query *string
//   - appIDs []string
//   - rulesForAppIDs []string
func (_e *PolicyRepository_Expecter) GetAll(ctx interface{}, paginationFilter interface{}, query interface{}, appIDs interface{}, rulesForAppIDs interface{}) *PolicyRepository_GetAll_Call {
	return &PolicyRepository_GetAll_Call{Call: _e.mock.On("GetAll", ctx, paginationFilter, query, appIDs, rulesForAppIDs)}
}

func (_c *PolicyRepository_GetAll_Call) Run(run func(ctx context.Context, paginationFilter pagination.PaginationFilter, query *string, appIDs []string, rulesForAppIDs []string)) *PolicyRepository_GetAll_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 []string
		if args[3] != nil {
			arg3 = args[3].([]string)
		}
		var arg4 []string
		if args[4] != nil {
			arg4 = args[4].([]string)
		}
		run(
			arg0,
			arg1,
			arg2,
			arg3,
			arg4,
		)
	})
	return _c
}

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

func (_c *PolicyRepository_GetAll_Call) RunAndReturn(run func(ctx context.Context, paginationFilter pagination.PaginationFilter, query *string, appIDs []string, rulesForAppIDs []string) (*pagination.Pageable[types.Policy], error)) *PolicyRepository_GetAll_Call {
	_c.Call.Return(run)
	return _c
}

// GetByAppID provides a mock function for the type PolicyRepository
func (_mock *PolicyRepository) GetByAppID(ctx context.Context, appID string) ([]*types.Policy, error) {
	ret := _mock.Called(ctx, appID)

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

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

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

// GetByAppID is a helper method to define mock.On call
//   - ctx context.Context
//   - appID string
func (_e *PolicyRepository_Expecter) GetByAppID(ctx interface{}, appID interface{}) *PolicyRepository_GetByAppID_Call {
	return &PolicyRepository_GetByAppID_Call{Call: _e.mock.On("GetByAppID", ctx, appID)}
}

func (_c *PolicyRepository_GetByAppID_Call) Run(run func(ctx context.Context, appID string)) *PolicyRepository_GetByAppID_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 *PolicyRepository_GetByAppID_Call) Return(policys []*types.Policy, err error) *PolicyRepository_GetByAppID_Call {
	_c.Call.Return(policys, err)
	return _c
}

func (_c *PolicyRepository_GetByAppID_Call) RunAndReturn(run func(ctx context.Context, appID string) ([]*types.Policy, error)) *PolicyRepository_GetByAppID_Call {
	_c.Call.Return(run)
	return _c
}

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

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

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

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

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

func (_c *PolicyRepository_GetByID_Call) Run(run func(ctx context.Context, id string)) *PolicyRepository_GetByID_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 *PolicyRepository_GetByID_Call) Return(policy *types.Policy, err error) *PolicyRepository_GetByID_Call {
	_c.Call.Return(policy, err)
	return _c
}

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

// Update provides a mock function for the type PolicyRepository
func (_mock *PolicyRepository) Update(ctx context.Context, policy *types.Policy) error {
	ret := _mock.Called(ctx, policy)

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

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

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

// Update is a helper method to define mock.On call
//   - ctx context.Context
//   - policy *types.Policy
func (_e *PolicyRepository_Expecter) Update(ctx interface{}, policy interface{}) *PolicyRepository_Update_Call {
	return &PolicyRepository_Update_Call{Call: _e.mock.On("Update", ctx, policy)}
}

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

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

func (_c *PolicyRepository_Update_Call) RunAndReturn(run func(ctx context.Context, policy *types.Policy) error) *PolicyRepository_Update_Call {
	_c.Call.Return(run)
	return _c
}
