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

package dao

import (
	context "context"

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

	model "github.com/goharbor/harbor/src/pkg/immutable/dao/model"

	q "github.com/goharbor/harbor/src/lib/q"
)

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

// Count provides a mock function with given fields: ctx, query
func (_m *DAO) Count(ctx context.Context, query *q.Query) (int64, error) {
	ret := _m.Called(ctx, query)

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

	var r0 int64
	var r1 error
	if rf, ok := ret.Get(0).(func(context.Context, *q.Query) (int64, error)); ok {
		return rf(ctx, query)
	}
	if rf, ok := ret.Get(0).(func(context.Context, *q.Query) int64); ok {
		r0 = rf(ctx, query)
	} else {
		r0 = ret.Get(0).(int64)
	}

	if rf, ok := ret.Get(1).(func(context.Context, *q.Query) error); ok {
		r1 = rf(ctx, query)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// CreateImmutableRule provides a mock function with given fields: ctx, ir
func (_m *DAO) CreateImmutableRule(ctx context.Context, ir *model.ImmutableRule) (int64, error) {
	ret := _m.Called(ctx, ir)

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

	var r0 int64
	var r1 error
	if rf, ok := ret.Get(0).(func(context.Context, *model.ImmutableRule) (int64, error)); ok {
		return rf(ctx, ir)
	}
	if rf, ok := ret.Get(0).(func(context.Context, *model.ImmutableRule) int64); ok {
		r0 = rf(ctx, ir)
	} else {
		r0 = ret.Get(0).(int64)
	}

	if rf, ok := ret.Get(1).(func(context.Context, *model.ImmutableRule) error); ok {
		r1 = rf(ctx, ir)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// DeleteImmutableRule provides a mock function with given fields: ctx, id
func (_m *DAO) DeleteImmutableRule(ctx context.Context, id int64) error {
	ret := _m.Called(ctx, id)

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

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

	return r0
}

// GetImmutableRule provides a mock function with given fields: ctx, id
func (_m *DAO) GetImmutableRule(ctx context.Context, id int64) (*model.ImmutableRule, error) {
	ret := _m.Called(ctx, id)

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

	var r0 *model.ImmutableRule
	var r1 error
	if rf, ok := ret.Get(0).(func(context.Context, int64) (*model.ImmutableRule, error)); ok {
		return rf(ctx, id)
	}
	if rf, ok := ret.Get(0).(func(context.Context, int64) *model.ImmutableRule); ok {
		r0 = rf(ctx, id)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*model.ImmutableRule)
		}
	}

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

	return r0, r1
}

// ListImmutableRules provides a mock function with given fields: ctx, query
func (_m *DAO) ListImmutableRules(ctx context.Context, query *q.Query) ([]*model.ImmutableRule, error) {
	ret := _m.Called(ctx, query)

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

	var r0 []*model.ImmutableRule
	var r1 error
	if rf, ok := ret.Get(0).(func(context.Context, *q.Query) ([]*model.ImmutableRule, error)); ok {
		return rf(ctx, query)
	}
	if rf, ok := ret.Get(0).(func(context.Context, *q.Query) []*model.ImmutableRule); ok {
		r0 = rf(ctx, query)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).([]*model.ImmutableRule)
		}
	}

	if rf, ok := ret.Get(1).(func(context.Context, *q.Query) error); ok {
		r1 = rf(ctx, query)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// ToggleImmutableRule provides a mock function with given fields: ctx, id, status
func (_m *DAO) ToggleImmutableRule(ctx context.Context, id int64, status bool) error {
	ret := _m.Called(ctx, id, status)

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

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

	return r0
}

// UpdateImmutableRule provides a mock function with given fields: ctx, projectID, ir
func (_m *DAO) UpdateImmutableRule(ctx context.Context, projectID int64, ir *model.ImmutableRule) error {
	ret := _m.Called(ctx, projectID, ir)

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

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

	return r0
}

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

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

	return mock
}
