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

package mockpbserverdiscovery

import (
	"context"

	"github.com/hashicorp/consul/proto-public/pbserverdiscovery"
	mock "github.com/stretchr/testify/mock"
	"google.golang.org/grpc"
)

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

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

	return mock
}

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

type ServerDiscoveryServiceClient_Expecter struct {
	mock *mock.Mock
}

func (_m *ServerDiscoveryServiceClient) EXPECT() *ServerDiscoveryServiceClient_Expecter {
	return &ServerDiscoveryServiceClient_Expecter{mock: &_m.Mock}
}

// WatchServers provides a mock function for the type ServerDiscoveryServiceClient
func (_mock *ServerDiscoveryServiceClient) WatchServers(ctx context.Context, in *pbserverdiscovery.WatchServersRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[pbserverdiscovery.WatchServersResponse], error) {
	// grpc.CallOption
	_va := make([]interface{}, len(opts))
	for _i := range opts {
		_va[_i] = opts[_i]
	}
	var _ca []interface{}
	_ca = append(_ca, ctx, in)
	_ca = append(_ca, _va...)
	ret := _mock.Called(_ca...)

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

	var r0 grpc.ServerStreamingClient[pbserverdiscovery.WatchServersResponse]
	var r1 error
	if returnFunc, ok := ret.Get(0).(func(context.Context, *pbserverdiscovery.WatchServersRequest, ...grpc.CallOption) (grpc.ServerStreamingClient[pbserverdiscovery.WatchServersResponse], error)); ok {
		return returnFunc(ctx, in, opts...)
	}
	if returnFunc, ok := ret.Get(0).(func(context.Context, *pbserverdiscovery.WatchServersRequest, ...grpc.CallOption) grpc.ServerStreamingClient[pbserverdiscovery.WatchServersResponse]); ok {
		r0 = returnFunc(ctx, in, opts...)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(grpc.ServerStreamingClient[pbserverdiscovery.WatchServersResponse])
		}
	}
	if returnFunc, ok := ret.Get(1).(func(context.Context, *pbserverdiscovery.WatchServersRequest, ...grpc.CallOption) error); ok {
		r1 = returnFunc(ctx, in, opts...)
	} else {
		r1 = ret.Error(1)
	}
	return r0, r1
}

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

// WatchServers is a helper method to define mock.On call
//   - ctx context.Context
//   - in *pbserverdiscovery.WatchServersRequest
//   - opts ...grpc.CallOption
func (_e *ServerDiscoveryServiceClient_Expecter) WatchServers(ctx interface{}, in interface{}, opts ...interface{}) *ServerDiscoveryServiceClient_WatchServers_Call {
	return &ServerDiscoveryServiceClient_WatchServers_Call{Call: _e.mock.On("WatchServers",
		append([]interface{}{ctx, in}, opts...)...)}
}

func (_c *ServerDiscoveryServiceClient_WatchServers_Call) Run(run func(ctx context.Context, in *pbserverdiscovery.WatchServersRequest, opts ...grpc.CallOption)) *ServerDiscoveryServiceClient_WatchServers_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 context.Context
		if args[0] != nil {
			arg0 = args[0].(context.Context)
		}
		var arg1 *pbserverdiscovery.WatchServersRequest
		if args[1] != nil {
			arg1 = args[1].(*pbserverdiscovery.WatchServersRequest)
		}
		var arg2 []grpc.CallOption
		variadicArgs := make([]grpc.CallOption, len(args)-2)
		for i, a := range args[2:] {
			if a != nil {
				variadicArgs[i] = a.(grpc.CallOption)
			}
		}
		arg2 = variadicArgs
		run(
			arg0,
			arg1,
			arg2...,
		)
	})
	return _c
}

func (_c *ServerDiscoveryServiceClient_WatchServers_Call) Return(serverStreamingClient grpc.ServerStreamingClient[pbserverdiscovery.WatchServersResponse], err error) *ServerDiscoveryServiceClient_WatchServers_Call {
	_c.Call.Return(serverStreamingClient, err)
	return _c
}

func (_c *ServerDiscoveryServiceClient_WatchServers_Call) RunAndReturn(run func(ctx context.Context, in *pbserverdiscovery.WatchServersRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[pbserverdiscovery.WatchServersResponse], error)) *ServerDiscoveryServiceClient_WatchServers_Call {
	_c.Call.Return(run)
	return _c
}
