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

package mocks

import (
	context "context"

	catalog_cattle_iov1 "github.com/rancher/rancher/pkg/apis/catalog.cattle.io/v1"
	cache "k8s.io/client-go/tools/cache"

	generic "github.com/rancher/wrangler/v3/pkg/generic"

	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

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

	rest "k8s.io/client-go/rest"

	schema "k8s.io/apimachinery/pkg/runtime/schema"

	time "time"

	types "k8s.io/apimachinery/pkg/types"

	watch "k8s.io/apimachinery/pkg/watch"
)

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

// AddGenericHandler provides a mock function with given fields: ctx, name, handler
func (_m *ClusterRepoController) AddGenericHandler(ctx context.Context, name string, handler generic.Handler) {
	_m.Called(ctx, name, handler)
}

// AddGenericRemoveHandler provides a mock function with given fields: ctx, name, handler
func (_m *ClusterRepoController) AddGenericRemoveHandler(ctx context.Context, name string, handler generic.Handler) {
	_m.Called(ctx, name, handler)
}

// Cache provides a mock function with given fields:
func (_m *ClusterRepoController) Cache() generic.NonNamespacedCacheInterface[*catalog_cattle_iov1.ClusterRepo] {
	ret := _m.Called()

	var r0 generic.NonNamespacedCacheInterface[*catalog_cattle_iov1.ClusterRepo]
	if rf, ok := ret.Get(0).(func() generic.NonNamespacedCacheInterface[*catalog_cattle_iov1.ClusterRepo]); ok {
		r0 = rf()
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(generic.NonNamespacedCacheInterface[*catalog_cattle_iov1.ClusterRepo])
		}
	}

	return r0
}

// Create provides a mock function with given fields: _a0
func (_m *ClusterRepoController) Create(_a0 *catalog_cattle_iov1.ClusterRepo) (*catalog_cattle_iov1.ClusterRepo, error) {
	ret := _m.Called(_a0)

	var r0 *catalog_cattle_iov1.ClusterRepo
	var r1 error
	if rf, ok := ret.Get(0).(func(*catalog_cattle_iov1.ClusterRepo) (*catalog_cattle_iov1.ClusterRepo, error)); ok {
		return rf(_a0)
	}
	if rf, ok := ret.Get(0).(func(*catalog_cattle_iov1.ClusterRepo) *catalog_cattle_iov1.ClusterRepo); ok {
		r0 = rf(_a0)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*catalog_cattle_iov1.ClusterRepo)
		}
	}

	if rf, ok := ret.Get(1).(func(*catalog_cattle_iov1.ClusterRepo) error); ok {
		r1 = rf(_a0)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// Delete provides a mock function with given fields: name, options
func (_m *ClusterRepoController) Delete(name string, options *metav1.DeleteOptions) error {
	ret := _m.Called(name, options)

	var r0 error
	if rf, ok := ret.Get(0).(func(string, *metav1.DeleteOptions) error); ok {
		r0 = rf(name, options)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// Enqueue provides a mock function with given fields: name
func (_m *ClusterRepoController) Enqueue(name string) {
	_m.Called(name)
}

// EnqueueAfter provides a mock function with given fields: name, duration
func (_m *ClusterRepoController) EnqueueAfter(name string, duration time.Duration) {
	_m.Called(name, duration)
}

// Get provides a mock function with given fields: name, options
func (_m *ClusterRepoController) Get(name string, options metav1.GetOptions) (*catalog_cattle_iov1.ClusterRepo, error) {
	ret := _m.Called(name, options)

	var r0 *catalog_cattle_iov1.ClusterRepo
	var r1 error
	if rf, ok := ret.Get(0).(func(string, metav1.GetOptions) (*catalog_cattle_iov1.ClusterRepo, error)); ok {
		return rf(name, options)
	}
	if rf, ok := ret.Get(0).(func(string, metav1.GetOptions) *catalog_cattle_iov1.ClusterRepo); ok {
		r0 = rf(name, options)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*catalog_cattle_iov1.ClusterRepo)
		}
	}

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

	return r0, r1
}

// GroupVersionKind provides a mock function with given fields:
func (_m *ClusterRepoController) GroupVersionKind() schema.GroupVersionKind {
	ret := _m.Called()

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

	return r0
}

// Informer provides a mock function with given fields:
func (_m *ClusterRepoController) Informer() cache.SharedIndexInformer {
	ret := _m.Called()

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

	return r0
}

// List provides a mock function with given fields: opts
func (_m *ClusterRepoController) List(opts metav1.ListOptions) (*catalog_cattle_iov1.ClusterRepoList, error) {
	ret := _m.Called(opts)

	var r0 *catalog_cattle_iov1.ClusterRepoList
	var r1 error
	if rf, ok := ret.Get(0).(func(metav1.ListOptions) (*catalog_cattle_iov1.ClusterRepoList, error)); ok {
		return rf(opts)
	}
	if rf, ok := ret.Get(0).(func(metav1.ListOptions) *catalog_cattle_iov1.ClusterRepoList); ok {
		r0 = rf(opts)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*catalog_cattle_iov1.ClusterRepoList)
		}
	}

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

	return r0, r1
}

// OnChange provides a mock function with given fields: ctx, name, sync
func (_m *ClusterRepoController) OnChange(ctx context.Context, name string, sync generic.ObjectHandler[*catalog_cattle_iov1.ClusterRepo]) {
	_m.Called(ctx, name, sync)
}

// OnRemove provides a mock function with given fields: ctx, name, sync
func (_m *ClusterRepoController) OnRemove(ctx context.Context, name string, sync generic.ObjectHandler[*catalog_cattle_iov1.ClusterRepo]) {
	_m.Called(ctx, name, sync)
}

// Patch provides a mock function with given fields: name, pt, data, subresources
func (_m *ClusterRepoController) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (*catalog_cattle_iov1.ClusterRepo, error) {
	_va := make([]interface{}, len(subresources))
	for _i := range subresources {
		_va[_i] = subresources[_i]
	}
	var _ca []interface{}
	_ca = append(_ca, name, pt, data)
	_ca = append(_ca, _va...)
	ret := _m.Called(_ca...)

	var r0 *catalog_cattle_iov1.ClusterRepo
	var r1 error
	if rf, ok := ret.Get(0).(func(string, types.PatchType, []byte, ...string) (*catalog_cattle_iov1.ClusterRepo, error)); ok {
		return rf(name, pt, data, subresources...)
	}
	if rf, ok := ret.Get(0).(func(string, types.PatchType, []byte, ...string) *catalog_cattle_iov1.ClusterRepo); ok {
		r0 = rf(name, pt, data, subresources...)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*catalog_cattle_iov1.ClusterRepo)
		}
	}

	if rf, ok := ret.Get(1).(func(string, types.PatchType, []byte, ...string) error); ok {
		r1 = rf(name, pt, data, subresources...)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// Update provides a mock function with given fields: _a0
func (_m *ClusterRepoController) Update(_a0 *catalog_cattle_iov1.ClusterRepo) (*catalog_cattle_iov1.ClusterRepo, error) {
	ret := _m.Called(_a0)

	var r0 *catalog_cattle_iov1.ClusterRepo
	var r1 error
	if rf, ok := ret.Get(0).(func(*catalog_cattle_iov1.ClusterRepo) (*catalog_cattle_iov1.ClusterRepo, error)); ok {
		return rf(_a0)
	}
	if rf, ok := ret.Get(0).(func(*catalog_cattle_iov1.ClusterRepo) *catalog_cattle_iov1.ClusterRepo); ok {
		r0 = rf(_a0)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*catalog_cattle_iov1.ClusterRepo)
		}
	}

	if rf, ok := ret.Get(1).(func(*catalog_cattle_iov1.ClusterRepo) error); ok {
		r1 = rf(_a0)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// UpdateStatus provides a mock function with given fields: _a0
func (_m *ClusterRepoController) UpdateStatus(_a0 *catalog_cattle_iov1.ClusterRepo) (*catalog_cattle_iov1.ClusterRepo, error) {
	ret := _m.Called(_a0)

	var r0 *catalog_cattle_iov1.ClusterRepo
	var r1 error
	if rf, ok := ret.Get(0).(func(*catalog_cattle_iov1.ClusterRepo) (*catalog_cattle_iov1.ClusterRepo, error)); ok {
		return rf(_a0)
	}
	if rf, ok := ret.Get(0).(func(*catalog_cattle_iov1.ClusterRepo) *catalog_cattle_iov1.ClusterRepo); ok {
		r0 = rf(_a0)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*catalog_cattle_iov1.ClusterRepo)
		}
	}

	if rf, ok := ret.Get(1).(func(*catalog_cattle_iov1.ClusterRepo) error); ok {
		r1 = rf(_a0)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

// Updater provides a mock function with given fields:
func (_m *ClusterRepoController) Updater() generic.Updater {
	ret := _m.Called()

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

	return r0
}

// Watch provides a mock function with given fields: opts
func (_m *ClusterRepoController) Watch(opts metav1.ListOptions) (watch.Interface, error) {
	ret := _m.Called(opts)

	var r0 watch.Interface
	var r1 error
	if rf, ok := ret.Get(0).(func(metav1.ListOptions) (watch.Interface, error)); ok {
		return rf(opts)
	}
	if rf, ok := ret.Get(0).(func(metav1.ListOptions) watch.Interface); ok {
		r0 = rf(opts)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(watch.Interface)
		}
	}

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

	return r0, r1
}

// WithImpersonation provides a mock function with given fields: impersonate
func (_m *ClusterRepoController) WithImpersonation(impersonate rest.ImpersonationConfig) (generic.NonNamespacedClientInterface[*catalog_cattle_iov1.ClusterRepo, *catalog_cattle_iov1.ClusterRepoList], error) {
	ret := _m.Called(impersonate)

	var r0 generic.NonNamespacedClientInterface[*catalog_cattle_iov1.ClusterRepo, *catalog_cattle_iov1.ClusterRepoList]
	var r1 error
	if rf, ok := ret.Get(0).(func(rest.ImpersonationConfig) (generic.NonNamespacedClientInterface[*catalog_cattle_iov1.ClusterRepo, *catalog_cattle_iov1.ClusterRepoList], error)); ok {
		return rf(impersonate)
	}
	if rf, ok := ret.Get(0).(func(rest.ImpersonationConfig) generic.NonNamespacedClientInterface[*catalog_cattle_iov1.ClusterRepo, *catalog_cattle_iov1.ClusterRepoList]); ok {
		r0 = rf(impersonate)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(generic.NonNamespacedClientInterface[*catalog_cattle_iov1.ClusterRepo, *catalog_cattle_iov1.ClusterRepoList])
		}
	}

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

	return r0, r1
}

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

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

	return mock
}
