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

package mocks

import (
	"context"
	"io"

	"github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1"
	mock "github.com/stretchr/testify/mock"
)

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

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

	return mock
}

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

type Retriever_Expecter struct {
	mock *mock.Mock
}

func (_m *Retriever) EXPECT() *Retriever_Expecter {
	return &Retriever_Expecter{mock: &_m.Mock}
}

// Retrieve provides a mock function for the type Retriever
func (_mock *Retriever) Retrieve(ctx context.Context, rID *providerv1beta1.ResourceId) (io.ReadCloser, error) {
	ret := _mock.Called(ctx, rID)

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

	var r0 io.ReadCloser
	var r1 error
	if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId) (io.ReadCloser, error)); ok {
		return returnFunc(ctx, rID)
	}
	if returnFunc, ok := ret.Get(0).(func(context.Context, *providerv1beta1.ResourceId) io.ReadCloser); ok {
		r0 = returnFunc(ctx, rID)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(io.ReadCloser)
		}
	}
	if returnFunc, ok := ret.Get(1).(func(context.Context, *providerv1beta1.ResourceId) error); ok {
		r1 = returnFunc(ctx, rID)
	} else {
		r1 = ret.Error(1)
	}
	return r0, r1
}

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

// Retrieve is a helper method to define mock.On call
//   - ctx context.Context
//   - rID *providerv1beta1.ResourceId
func (_e *Retriever_Expecter) Retrieve(ctx interface{}, rID interface{}) *Retriever_Retrieve_Call {
	return &Retriever_Retrieve_Call{Call: _e.mock.On("Retrieve", ctx, rID)}
}

func (_c *Retriever_Retrieve_Call) Run(run func(ctx context.Context, rID *providerv1beta1.ResourceId)) *Retriever_Retrieve_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 context.Context
		if args[0] != nil {
			arg0 = args[0].(context.Context)
		}
		var arg1 *providerv1beta1.ResourceId
		if args[1] != nil {
			arg1 = args[1].(*providerv1beta1.ResourceId)
		}
		run(
			arg0,
			arg1,
		)
	})
	return _c
}

func (_c *Retriever_Retrieve_Call) Return(readCloser io.ReadCloser, err error) *Retriever_Retrieve_Call {
	_c.Call.Return(readCloser, err)
	return _c
}

func (_c *Retriever_Retrieve_Call) RunAndReturn(run func(ctx context.Context, rID *providerv1beta1.ResourceId) (io.ReadCloser, error)) *Retriever_Retrieve_Call {
	_c.Call.Return(run)
	return _c
}
