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

package mocks

import (
	context "context"

	data "github.com/ergomake/layerform/pkg/data"

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

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

type Backend_Expecter struct {
	mock *mock.Mock
}

func (_m *Backend) EXPECT() *Backend_Expecter {
	return &Backend_Expecter{mock: &_m.Mock}
}

// DeleteInstance provides a mock function with given fields: ctx, layerName, instanceName
func (_m *Backend) DeleteInstance(ctx context.Context, layerName string, instanceName string) error {
	ret := _m.Called(ctx, layerName, instanceName)

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

	return r0
}

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

// DeleteInstance is a helper method to define mock.On call
//   - ctx context.Context
//   - layerName string
//   - instanceName string
func (_e *Backend_Expecter) DeleteInstance(ctx interface{}, layerName interface{}, instanceName interface{}) *Backend_DeleteInstance_Call {
	return &Backend_DeleteInstance_Call{Call: _e.mock.On("DeleteInstance", ctx, layerName, instanceName)}
}

func (_c *Backend_DeleteInstance_Call) Run(run func(ctx context.Context, layerName string, instanceName string)) *Backend_DeleteInstance_Call {
	_c.Call.Run(func(args mock.Arguments) {
		run(args[0].(context.Context), args[1].(string), args[2].(string))
	})
	return _c
}

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

func (_c *Backend_DeleteInstance_Call) RunAndReturn(run func(context.Context, string, string) error) *Backend_DeleteInstance_Call {
	_c.Call.Return(run)
	return _c
}

// GetInstance provides a mock function with given fields: ctx, layerName, instanceName
func (_m *Backend) GetInstance(ctx context.Context, layerName string, instanceName string) (*data.LayerInstance, error) {
	ret := _m.Called(ctx, layerName, instanceName)

	var r0 *data.LayerInstance
	var r1 error
	if rf, ok := ret.Get(0).(func(context.Context, string, string) (*data.LayerInstance, error)); ok {
		return rf(ctx, layerName, instanceName)
	}
	if rf, ok := ret.Get(0).(func(context.Context, string, string) *data.LayerInstance); ok {
		r0 = rf(ctx, layerName, instanceName)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*data.LayerInstance)
		}
	}

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

	return r0, r1
}

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

// GetInstance is a helper method to define mock.On call
//   - ctx context.Context
//   - layerName string
//   - instanceName string
func (_e *Backend_Expecter) GetInstance(ctx interface{}, layerName interface{}, instanceName interface{}) *Backend_GetInstance_Call {
	return &Backend_GetInstance_Call{Call: _e.mock.On("GetInstance", ctx, layerName, instanceName)}
}

func (_c *Backend_GetInstance_Call) Run(run func(ctx context.Context, layerName string, instanceName string)) *Backend_GetInstance_Call {
	_c.Call.Run(func(args mock.Arguments) {
		run(args[0].(context.Context), args[1].(string), args[2].(string))
	})
	return _c
}

func (_c *Backend_GetInstance_Call) Return(_a0 *data.LayerInstance, _a1 error) *Backend_GetInstance_Call {
	_c.Call.Return(_a0, _a1)
	return _c
}

func (_c *Backend_GetInstance_Call) RunAndReturn(run func(context.Context, string, string) (*data.LayerInstance, error)) *Backend_GetInstance_Call {
	_c.Call.Return(run)
	return _c
}

// ListInstances provides a mock function with given fields: ctx
func (_m *Backend) ListInstances(ctx context.Context) ([]*data.LayerInstance, error) {
	ret := _m.Called(ctx)

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

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

	return r0, r1
}

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

// ListInstances is a helper method to define mock.On call
//   - ctx context.Context
func (_e *Backend_Expecter) ListInstances(ctx interface{}) *Backend_ListInstances_Call {
	return &Backend_ListInstances_Call{Call: _e.mock.On("ListInstances", ctx)}
}

func (_c *Backend_ListInstances_Call) Run(run func(ctx context.Context)) *Backend_ListInstances_Call {
	_c.Call.Run(func(args mock.Arguments) {
		run(args[0].(context.Context))
	})
	return _c
}

func (_c *Backend_ListInstances_Call) Return(_a0 []*data.LayerInstance, _a1 error) *Backend_ListInstances_Call {
	_c.Call.Return(_a0, _a1)
	return _c
}

func (_c *Backend_ListInstances_Call) RunAndReturn(run func(context.Context) ([]*data.LayerInstance, error)) *Backend_ListInstances_Call {
	_c.Call.Return(run)
	return _c
}

// ListInstancesByLayer provides a mock function with given fields: ctx, layerName
func (_m *Backend) ListInstancesByLayer(ctx context.Context, layerName string) ([]*data.LayerInstance, error) {
	ret := _m.Called(ctx, layerName)

	var r0 []*data.LayerInstance
	var r1 error
	if rf, ok := ret.Get(0).(func(context.Context, string) ([]*data.LayerInstance, error)); ok {
		return rf(ctx, layerName)
	}
	if rf, ok := ret.Get(0).(func(context.Context, string) []*data.LayerInstance); ok {
		r0 = rf(ctx, layerName)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).([]*data.LayerInstance)
		}
	}

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

	return r0, r1
}

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

// ListInstancesByLayer is a helper method to define mock.On call
//   - ctx context.Context
//   - layerName string
func (_e *Backend_Expecter) ListInstancesByLayer(ctx interface{}, layerName interface{}) *Backend_ListInstancesByLayer_Call {
	return &Backend_ListInstancesByLayer_Call{Call: _e.mock.On("ListInstancesByLayer", ctx, layerName)}
}

func (_c *Backend_ListInstancesByLayer_Call) Run(run func(ctx context.Context, layerName string)) *Backend_ListInstancesByLayer_Call {
	_c.Call.Run(func(args mock.Arguments) {
		run(args[0].(context.Context), args[1].(string))
	})
	return _c
}

func (_c *Backend_ListInstancesByLayer_Call) Return(_a0 []*data.LayerInstance, _a1 error) *Backend_ListInstancesByLayer_Call {
	_c.Call.Return(_a0, _a1)
	return _c
}

func (_c *Backend_ListInstancesByLayer_Call) RunAndReturn(run func(context.Context, string) ([]*data.LayerInstance, error)) *Backend_ListInstancesByLayer_Call {
	_c.Call.Return(run)
	return _c
}

// SaveInstance provides a mock function with given fields: ctx, instance
func (_m *Backend) SaveInstance(ctx context.Context, instance *data.LayerInstance) error {
	ret := _m.Called(ctx, instance)

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

	return r0
}

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

// SaveInstance is a helper method to define mock.On call
//   - ctx context.Context
//   - instance *data.LayerInstance
func (_e *Backend_Expecter) SaveInstance(ctx interface{}, instance interface{}) *Backend_SaveInstance_Call {
	return &Backend_SaveInstance_Call{Call: _e.mock.On("SaveInstance", ctx, instance)}
}

func (_c *Backend_SaveInstance_Call) Run(run func(ctx context.Context, instance *data.LayerInstance)) *Backend_SaveInstance_Call {
	_c.Call.Run(func(args mock.Arguments) {
		run(args[0].(context.Context), args[1].(*data.LayerInstance))
	})
	return _c
}

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

func (_c *Backend_SaveInstance_Call) RunAndReturn(run func(context.Context, *data.LayerInstance) error) *Backend_SaveInstance_Call {
	_c.Call.Return(run)
	return _c
}

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

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

	return mock
}
