// 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/certs/v1"
	mock "github.com/stretchr/testify/mock"
	"google.golang.org/grpc"
	"google.golang.org/protobuf/types/known/emptypb"
)

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

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

	return mock
}

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

type CertsServiceClient_Expecter struct {
	mock *mock.Mock
}

func (_m *CertsServiceClient) EXPECT() *CertsServiceClient_Expecter {
	return &CertsServiceClient_Expecter{mock: &_m.Mock}
}

// GetEntityID provides a mock function for the type CertsServiceClient
func (_mock *CertsServiceClient) GetEntityID(ctx context.Context, in *v1.EntityReq, opts ...grpc.CallOption) (*v1.EntityRes, 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 GetEntityID")
	}

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

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

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

func (_c *CertsServiceClient_GetEntityID_Call) Run(run func(ctx context.Context, in *v1.EntityReq, opts ...grpc.CallOption)) *CertsServiceClient_GetEntityID_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 context.Context
		if args[0] != nil {
			arg0 = args[0].(context.Context)
		}
		var arg1 *v1.EntityReq
		if args[1] != nil {
			arg1 = args[1].(*v1.EntityReq)
		}
		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 *CertsServiceClient_GetEntityID_Call) Return(entityRes *v1.EntityRes, err error) *CertsServiceClient_GetEntityID_Call {
	_c.Call.Return(entityRes, err)
	return _c
}

func (_c *CertsServiceClient_GetEntityID_Call) RunAndReturn(run func(ctx context.Context, in *v1.EntityReq, opts ...grpc.CallOption) (*v1.EntityRes, error)) *CertsServiceClient_GetEntityID_Call {
	_c.Call.Return(run)
	return _c
}

// RevokeCerts provides a mock function for the type CertsServiceClient
func (_mock *CertsServiceClient) RevokeCerts(ctx context.Context, in *v1.RevokeReq, opts ...grpc.CallOption) (*emptypb.Empty, 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 RevokeCerts")
	}

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

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

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

func (_c *CertsServiceClient_RevokeCerts_Call) Run(run func(ctx context.Context, in *v1.RevokeReq, opts ...grpc.CallOption)) *CertsServiceClient_RevokeCerts_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 context.Context
		if args[0] != nil {
			arg0 = args[0].(context.Context)
		}
		var arg1 *v1.RevokeReq
		if args[1] != nil {
			arg1 = args[1].(*v1.RevokeReq)
		}
		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 *CertsServiceClient_RevokeCerts_Call) Return(empty *emptypb.Empty, err error) *CertsServiceClient_RevokeCerts_Call {
	_c.Call.Return(empty, err)
	return _c
}

func (_c *CertsServiceClient_RevokeCerts_Call) RunAndReturn(run func(ctx context.Context, in *v1.RevokeReq, opts ...grpc.CallOption) (*emptypb.Empty, error)) *CertsServiceClient_RevokeCerts_Call {
	_c.Call.Return(run)
	return _c
}
