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

package mocks

import (
	"context"

	mock "github.com/stretchr/testify/mock"
	"sigs.k8s.io/controller-runtime/pkg/client"
)

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

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

	return mock
}

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

type MockSubResourceWriter_Expecter struct {
	mock *mock.Mock
}

func (_m *MockSubResourceWriter) EXPECT() *MockSubResourceWriter_Expecter {
	return &MockSubResourceWriter_Expecter{mock: &_m.Mock}
}

// Create provides a mock function for the type MockSubResourceWriter
func (_mock *MockSubResourceWriter) Create(ctx context.Context, obj client.Object, subResource client.Object, opts ...client.SubResourceCreateOption) error {
	// client.SubResourceCreateOption
	_va := make([]interface{}, len(opts))
	for _i := range opts {
		_va[_i] = opts[_i]
	}
	var _ca []interface{}
	_ca = append(_ca, ctx, obj, subResource)
	_ca = append(_ca, _va...)
	ret := _mock.Called(_ca...)

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

	var r0 error
	if returnFunc, ok := ret.Get(0).(func(context.Context, client.Object, client.Object, ...client.SubResourceCreateOption) error); ok {
		r0 = returnFunc(ctx, obj, subResource, opts...)
	} else {
		r0 = ret.Error(0)
	}
	return r0
}

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

// Create is a helper method to define mock.On call
//   - ctx context.Context
//   - obj client.Object
//   - subResource client.Object
//   - opts ...client.SubResourceCreateOption
func (_e *MockSubResourceWriter_Expecter) Create(ctx interface{}, obj interface{}, subResource interface{}, opts ...interface{}) *MockSubResourceWriter_Create_Call {
	return &MockSubResourceWriter_Create_Call{Call: _e.mock.On("Create",
		append([]interface{}{ctx, obj, subResource}, opts...)...)}
}

func (_c *MockSubResourceWriter_Create_Call) Run(run func(ctx context.Context, obj client.Object, subResource client.Object, opts ...client.SubResourceCreateOption)) *MockSubResourceWriter_Create_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 context.Context
		if args[0] != nil {
			arg0 = args[0].(context.Context)
		}
		var arg1 client.Object
		if args[1] != nil {
			arg1 = args[1].(client.Object)
		}
		var arg2 client.Object
		if args[2] != nil {
			arg2 = args[2].(client.Object)
		}
		var arg3 []client.SubResourceCreateOption
		variadicArgs := make([]client.SubResourceCreateOption, len(args)-3)
		for i, a := range args[3:] {
			if a != nil {
				variadicArgs[i] = a.(client.SubResourceCreateOption)
			}
		}
		arg3 = variadicArgs
		run(
			arg0,
			arg1,
			arg2,
			arg3...,
		)
	})
	return _c
}

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

func (_c *MockSubResourceWriter_Create_Call) RunAndReturn(run func(ctx context.Context, obj client.Object, subResource client.Object, opts ...client.SubResourceCreateOption) error) *MockSubResourceWriter_Create_Call {
	_c.Call.Return(run)
	return _c
}

// Patch provides a mock function for the type MockSubResourceWriter
func (_mock *MockSubResourceWriter) Patch(ctx context.Context, obj client.Object, patch client.Patch, opts ...client.SubResourcePatchOption) error {
	// client.SubResourcePatchOption
	_va := make([]interface{}, len(opts))
	for _i := range opts {
		_va[_i] = opts[_i]
	}
	var _ca []interface{}
	_ca = append(_ca, ctx, obj, patch)
	_ca = append(_ca, _va...)
	ret := _mock.Called(_ca...)

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

	var r0 error
	if returnFunc, ok := ret.Get(0).(func(context.Context, client.Object, client.Patch, ...client.SubResourcePatchOption) error); ok {
		r0 = returnFunc(ctx, obj, patch, opts...)
	} else {
		r0 = ret.Error(0)
	}
	return r0
}

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

// Patch is a helper method to define mock.On call
//   - ctx context.Context
//   - obj client.Object
//   - patch client.Patch
//   - opts ...client.SubResourcePatchOption
func (_e *MockSubResourceWriter_Expecter) Patch(ctx interface{}, obj interface{}, patch interface{}, opts ...interface{}) *MockSubResourceWriter_Patch_Call {
	return &MockSubResourceWriter_Patch_Call{Call: _e.mock.On("Patch",
		append([]interface{}{ctx, obj, patch}, opts...)...)}
}

func (_c *MockSubResourceWriter_Patch_Call) Run(run func(ctx context.Context, obj client.Object, patch client.Patch, opts ...client.SubResourcePatchOption)) *MockSubResourceWriter_Patch_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 context.Context
		if args[0] != nil {
			arg0 = args[0].(context.Context)
		}
		var arg1 client.Object
		if args[1] != nil {
			arg1 = args[1].(client.Object)
		}
		var arg2 client.Patch
		if args[2] != nil {
			arg2 = args[2].(client.Patch)
		}
		var arg3 []client.SubResourcePatchOption
		variadicArgs := make([]client.SubResourcePatchOption, len(args)-3)
		for i, a := range args[3:] {
			if a != nil {
				variadicArgs[i] = a.(client.SubResourcePatchOption)
			}
		}
		arg3 = variadicArgs
		run(
			arg0,
			arg1,
			arg2,
			arg3...,
		)
	})
	return _c
}

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

func (_c *MockSubResourceWriter_Patch_Call) RunAndReturn(run func(ctx context.Context, obj client.Object, patch client.Patch, opts ...client.SubResourcePatchOption) error) *MockSubResourceWriter_Patch_Call {
	_c.Call.Return(run)
	return _c
}

// Update provides a mock function for the type MockSubResourceWriter
func (_mock *MockSubResourceWriter) Update(ctx context.Context, obj client.Object, opts ...client.SubResourceUpdateOption) error {
	// client.SubResourceUpdateOption
	_va := make([]interface{}, len(opts))
	for _i := range opts {
		_va[_i] = opts[_i]
	}
	var _ca []interface{}
	_ca = append(_ca, ctx, obj)
	_ca = append(_ca, _va...)
	ret := _mock.Called(_ca...)

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

	var r0 error
	if returnFunc, ok := ret.Get(0).(func(context.Context, client.Object, ...client.SubResourceUpdateOption) error); ok {
		r0 = returnFunc(ctx, obj, opts...)
	} else {
		r0 = ret.Error(0)
	}
	return r0
}

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

// Update is a helper method to define mock.On call
//   - ctx context.Context
//   - obj client.Object
//   - opts ...client.SubResourceUpdateOption
func (_e *MockSubResourceWriter_Expecter) Update(ctx interface{}, obj interface{}, opts ...interface{}) *MockSubResourceWriter_Update_Call {
	return &MockSubResourceWriter_Update_Call{Call: _e.mock.On("Update",
		append([]interface{}{ctx, obj}, opts...)...)}
}

func (_c *MockSubResourceWriter_Update_Call) Run(run func(ctx context.Context, obj client.Object, opts ...client.SubResourceUpdateOption)) *MockSubResourceWriter_Update_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 context.Context
		if args[0] != nil {
			arg0 = args[0].(context.Context)
		}
		var arg1 client.Object
		if args[1] != nil {
			arg1 = args[1].(client.Object)
		}
		var arg2 []client.SubResourceUpdateOption
		variadicArgs := make([]client.SubResourceUpdateOption, len(args)-2)
		for i, a := range args[2:] {
			if a != nil {
				variadicArgs[i] = a.(client.SubResourceUpdateOption)
			}
		}
		arg2 = variadicArgs
		run(
			arg0,
			arg1,
			arg2...,
		)
	})
	return _c
}

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

func (_c *MockSubResourceWriter_Update_Call) RunAndReturn(run func(ctx context.Context, obj client.Object, opts ...client.SubResourceUpdateOption) error) *MockSubResourceWriter_Update_Call {
	_c.Call.Return(run)
	return _c
}
