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

package sync

import (
	context "context"

	v0alpha1 "github.com/grafana/grafana/apps/provisioning/pkg/apis/provisioning/v0alpha1"
	mock "github.com/stretchr/testify/mock"
)

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

type MockRepositoryPatchFn_Expecter struct {
	mock *mock.Mock
}

func (_m *MockRepositoryPatchFn) EXPECT() *MockRepositoryPatchFn_Expecter {
	return &MockRepositoryPatchFn_Expecter{mock: &_m.Mock}
}

// Execute provides a mock function with given fields: ctx, repo, patchOperations
func (_m *MockRepositoryPatchFn) Execute(ctx context.Context, repo *v0alpha1.Repository, patchOperations ...map[string]interface{}) error {
	_va := make([]interface{}, len(patchOperations))
	for _i := range patchOperations {
		_va[_i] = patchOperations[_i]
	}
	var _ca []interface{}
	_ca = append(_ca, ctx, repo)
	_ca = append(_ca, _va...)
	ret := _m.Called(_ca...)

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

	var r0 error
	if rf, ok := ret.Get(0).(func(context.Context, *v0alpha1.Repository, ...map[string]interface{}) error); ok {
		r0 = rf(ctx, repo, patchOperations...)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

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

// Execute is a helper method to define mock.On call
//   - ctx context.Context
//   - repo *v0alpha1.Repository
//   - patchOperations ...map[string]interface{}
func (_e *MockRepositoryPatchFn_Expecter) Execute(ctx interface{}, repo interface{}, patchOperations ...interface{}) *MockRepositoryPatchFn_Execute_Call {
	return &MockRepositoryPatchFn_Execute_Call{Call: _e.mock.On("Execute",
		append([]interface{}{ctx, repo}, patchOperations...)...)}
}

func (_c *MockRepositoryPatchFn_Execute_Call) Run(run func(ctx context.Context, repo *v0alpha1.Repository, patchOperations ...map[string]interface{})) *MockRepositoryPatchFn_Execute_Call {
	_c.Call.Run(func(args mock.Arguments) {
		variadicArgs := make([]map[string]interface{}, len(args)-2)
		for i, a := range args[2:] {
			if a != nil {
				variadicArgs[i] = a.(map[string]interface{})
			}
		}
		run(args[0].(context.Context), args[1].(*v0alpha1.Repository), variadicArgs...)
	})
	return _c
}

func (_c *MockRepositoryPatchFn_Execute_Call) Return(_a0 error) *MockRepositoryPatchFn_Execute_Call {
	_c.Call.Return(_a0)
	return _c
}

func (_c *MockRepositoryPatchFn_Execute_Call) RunAndReturn(run func(context.Context, *v0alpha1.Repository, ...map[string]interface{}) error) *MockRepositoryPatchFn_Execute_Call {
	_c.Call.Return(run)
	return _c
}

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

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

	return mock
}
