// 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"
)

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

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

	return mock
}

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

type RuleRepository_Expecter struct {
	mock *mock.Mock
}

func (_m *RuleRepository) EXPECT() *RuleRepository_Expecter {
	return &RuleRepository_Expecter{mock: &_m.Mock}
}

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

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

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

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

// Create is a helper method to define mock.On call
//   - ctx context.Context
//   - rule *types.Rule
func (_e *RuleRepository_Expecter) Create(ctx interface{}, rule interface{}) *RuleRepository_Create_Call {
	return &RuleRepository_Create_Call{Call: _e.mock.On("Create", ctx, rule)}
}

func (_c *RuleRepository_Create_Call) Run(run func(ctx context.Context, rule *types.Rule)) *RuleRepository_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.Rule
		if args[1] != nil {
			arg1 = args[1].(*types.Rule)
		}
		run(
			arg0,
			arg1,
		)
	})
	return _c
}

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

func (_c *RuleRepository_Create_Call) RunAndReturn(run func(ctx context.Context, rule *types.Rule) error) *RuleRepository_Create_Call {
	_c.Call.Return(run)
	return _c
}

// Delete provides a mock function for the type RuleRepository
func (_mock *RuleRepository) Delete(ctx context.Context, rules ...*types.Rule) error {
	// *types.Rule
	_va := make([]interface{}, len(rules))
	for _i := range rules {
		_va[_i] = rules[_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.Rule) error); ok {
		r0 = returnFunc(ctx, rules...)
	} else {
		r0 = ret.Error(0)
	}
	return r0
}

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

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

func (_c *RuleRepository_Delete_Call) Run(run func(ctx context.Context, rules ...*types.Rule)) *RuleRepository_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.Rule
		variadicArgs := make([]*types.Rule, len(args)-1)
		for i, a := range args[1:] {
			if a != nil {
				variadicArgs[i] = a.(*types.Rule)
			}
		}
		arg1 = variadicArgs
		run(
			arg0,
			arg1...,
		)
	})
	return _c
}

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

func (_c *RuleRepository_Delete_Call) RunAndReturn(run func(ctx context.Context, rules ...*types.Rule) error) *RuleRepository_Delete_Call {
	_c.Call.Return(run)
	return _c
}

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

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

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

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

// GetAll is a helper method to define mock.On call
//   - ctx context.Context
//   - policyID string
//   - paginationFilter pagination.PaginationFilter
//   - query *string
func (_e *RuleRepository_Expecter) GetAll(ctx interface{}, policyID interface{}, paginationFilter interface{}, query interface{}) *RuleRepository_GetAll_Call {
	return &RuleRepository_GetAll_Call{Call: _e.mock.On("GetAll", ctx, policyID, paginationFilter, query)}
}

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

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

func (_c *RuleRepository_GetAll_Call) RunAndReturn(run func(ctx context.Context, policyID string, paginationFilter pagination.PaginationFilter, query *string) (*pagination.Pageable[types.Rule], error)) *RuleRepository_GetAll_Call {
	_c.Call.Return(run)
	return _c
}

// GetByID provides a mock function for the type RuleRepository
func (_mock *RuleRepository) GetByID(ctx context.Context, ruleID string, policyID string) (*types.Rule, error) {
	ret := _mock.Called(ctx, ruleID, policyID)

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

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

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

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

func (_c *RuleRepository_GetByID_Call) Run(run func(ctx context.Context, ruleID string, policyID string)) *RuleRepository_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)
		}
		var arg2 string
		if args[2] != nil {
			arg2 = args[2].(string)
		}
		run(
			arg0,
			arg1,
			arg2,
		)
	})
	return _c
}

func (_c *RuleRepository_GetByID_Call) Return(rule *types.Rule, err error) *RuleRepository_GetByID_Call {
	_c.Call.Return(rule, err)
	return _c
}

func (_c *RuleRepository_GetByID_Call) RunAndReturn(run func(ctx context.Context, ruleID string, policyID string) (*types.Rule, error)) *RuleRepository_GetByID_Call {
	_c.Call.Return(run)
	return _c
}

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

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

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

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

// Update is a helper method to define mock.On call
//   - ctx context.Context
//   - rule *types.Rule
func (_e *RuleRepository_Expecter) Update(ctx interface{}, rule interface{}) *RuleRepository_Update_Call {
	return &RuleRepository_Update_Call{Call: _e.mock.On("Update", ctx, rule)}
}

func (_c *RuleRepository_Update_Call) Run(run func(ctx context.Context, rule *types.Rule)) *RuleRepository_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.Rule
		if args[1] != nil {
			arg1 = args[1].(*types.Rule)
		}
		run(
			arg0,
			arg1,
		)
	})
	return _c
}

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

func (_c *RuleRepository_Update_Call) RunAndReturn(run func(ctx context.Context, rule *types.Rule) error) *RuleRepository_Update_Call {
	_c.Call.Return(run)
	return _c
}
