// Copyright (c) Abstract Machines

// SPDX-License-Identifier: Apache-2.0

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

package mocks

import (
	"context"

	"github.com/absmach/magistrala/api/grpc/readers/v1"
	mock "github.com/stretchr/testify/mock"
	"google.golang.org/grpc"
)

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

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

	return mock
}

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

type ReadersServiceClient_Expecter struct {
	mock *mock.Mock
}

func (_m *ReadersServiceClient) EXPECT() *ReadersServiceClient_Expecter {
	return &ReadersServiceClient_Expecter{mock: &_m.Mock}
}

// ReadMessages provides a mock function for the type ReadersServiceClient
func (_mock *ReadersServiceClient) ReadMessages(ctx context.Context, in *v1.ReadMessagesReq, opts ...grpc.CallOption) (*v1.ReadMessagesRes, error) {
	var tmpRet mock.Arguments
	if len(opts) > 0 {
		tmpRet = _mock.Called(ctx, in, opts)
	} else {
		tmpRet = _mock.Called(ctx, in)
	}
	ret := tmpRet

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

	var r0 *v1.ReadMessagesRes
	var r1 error
	if returnFunc, ok := ret.Get(0).(func(context.Context, *v1.ReadMessagesReq, ...grpc.CallOption) (*v1.ReadMessagesRes, error)); ok {
		return returnFunc(ctx, in, opts...)
	}
	if returnFunc, ok := ret.Get(0).(func(context.Context, *v1.ReadMessagesReq, ...grpc.CallOption) *v1.ReadMessagesRes); ok {
		r0 = returnFunc(ctx, in, opts...)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*v1.ReadMessagesRes)
		}
	}
	if returnFunc, ok := ret.Get(1).(func(context.Context, *v1.ReadMessagesReq, ...grpc.CallOption) error); ok {
		r1 = returnFunc(ctx, in, opts...)
	} else {
		r1 = ret.Error(1)
	}
	return r0, r1
}

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

// ReadMessages is a helper method to define mock.On call
//   - ctx context.Context
//   - in *v1.ReadMessagesReq
//   - opts ...grpc.CallOption
func (_e *ReadersServiceClient_Expecter) ReadMessages(ctx interface{}, in interface{}, opts ...interface{}) *ReadersServiceClient_ReadMessages_Call {
	return &ReadersServiceClient_ReadMessages_Call{Call: _e.mock.On("ReadMessages",
		append([]interface{}{ctx, in}, opts...)...)}
}

func (_c *ReadersServiceClient_ReadMessages_Call) Run(run func(ctx context.Context, in *v1.ReadMessagesReq, opts ...grpc.CallOption)) *ReadersServiceClient_ReadMessages_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 context.Context
		if args[0] != nil {
			arg0 = args[0].(context.Context)
		}
		var arg1 *v1.ReadMessagesReq
		if args[1] != nil {
			arg1 = args[1].(*v1.ReadMessagesReq)
		}
		var arg2 []grpc.CallOption
		var variadicArgs []grpc.CallOption
		if len(args) > 2 {
			variadicArgs = args[2].([]grpc.CallOption)
		}
		arg2 = variadicArgs
		run(
			arg0,
			arg1,
			arg2...,
		)
	})
	return _c
}

func (_c *ReadersServiceClient_ReadMessages_Call) Return(readMessagesRes *v1.ReadMessagesRes, err error) *ReadersServiceClient_ReadMessages_Call {
	_c.Call.Return(readMessagesRes, err)
	return _c
}

func (_c *ReadersServiceClient_ReadMessages_Call) RunAndReturn(run func(ctx context.Context, in *v1.ReadMessagesReq, opts ...grpc.CallOption) (*v1.ReadMessagesRes, error)) *ReadersServiceClient_ReadMessages_Call {
	_c.Call.Return(run)
	return _c
}
