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

package mockpbdns

import (
	"context"

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

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

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

	return mock
}

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

type DNSServiceClient_Expecter struct {
	mock *mock.Mock
}

func (_m *DNSServiceClient) EXPECT() *DNSServiceClient_Expecter {
	return &DNSServiceClient_Expecter{mock: &_m.Mock}
}

// Query provides a mock function for the type DNSServiceClient
func (_mock *DNSServiceClient) Query(ctx context.Context, in *pbdns.QueryRequest, opts ...grpc.CallOption) (*pbdns.QueryResponse, 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 Query")
	}

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

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

// Query is a helper method to define mock.On call
//   - ctx context.Context
//   - in *pbdns.QueryRequest
//   - opts ...grpc.CallOption
func (_e *DNSServiceClient_Expecter) Query(ctx interface{}, in interface{}, opts ...interface{}) *DNSServiceClient_Query_Call {
	return &DNSServiceClient_Query_Call{Call: _e.mock.On("Query",
		append([]interface{}{ctx, in}, opts...)...)}
}

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

func (_c *DNSServiceClient_Query_Call) RunAndReturn(run func(ctx context.Context, in *pbdns.QueryRequest, opts ...grpc.CallOption) (*pbdns.QueryResponse, error)) *DNSServiceClient_Query_Call {
	_c.Call.Return(run)
	return _c
}
