// Code generated by mockery v2.53.0. DO NOT EDIT.

package mocks

import (
	context "context"

	api "github.com/smartcontractkit/chainlink/v2/core/services/gateway/api"

	handlers "github.com/smartcontractkit/chainlink/v2/core/services/gateway/handlers"

	json "encoding/json"

	jsonrpc2 "github.com/smartcontractkit/chainlink-common/pkg/jsonrpc2"

	mock "github.com/stretchr/testify/mock"
)

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

type Handler_Expecter struct {
	mock *mock.Mock
}

func (_m *Handler) EXPECT() *Handler_Expecter {
	return &Handler_Expecter{mock: &_m.Mock}
}

// Close provides a mock function with no fields
func (_m *Handler) Close() error {
	ret := _m.Called()

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

	var r0 error
	if rf, ok := ret.Get(0).(func() error); ok {
		r0 = rf()
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

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

// Close is a helper method to define mock.On call
func (_e *Handler_Expecter) Close() *Handler_Close_Call {
	return &Handler_Close_Call{Call: _e.mock.On("Close")}
}

func (_c *Handler_Close_Call) Run(run func()) *Handler_Close_Call {
	_c.Call.Run(func(args mock.Arguments) {
		run()
	})
	return _c
}

func (_c *Handler_Close_Call) Return(_a0 error) *Handler_Close_Call {
	_c.Call.Return(_a0)
	return _c
}

func (_c *Handler_Close_Call) RunAndReturn(run func() error) *Handler_Close_Call {
	_c.Call.Return(run)
	return _c
}

// HandleJSONRPCUserMessage provides a mock function with given fields: ctx, jsonRequest, callback
func (_m *Handler) HandleJSONRPCUserMessage(ctx context.Context, jsonRequest jsonrpc2.Request[json.RawMessage], callback handlers.Callback) error {
	ret := _m.Called(ctx, jsonRequest, callback)

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

	var r0 error
	if rf, ok := ret.Get(0).(func(context.Context, jsonrpc2.Request[json.RawMessage], handlers.Callback) error); ok {
		r0 = rf(ctx, jsonRequest, callback)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

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

// HandleJSONRPCUserMessage is a helper method to define mock.On call
//   - ctx context.Context
//   - jsonRequest jsonrpc2.Request[json.RawMessage]
//   - callback handlers.Callback
func (_e *Handler_Expecter) HandleJSONRPCUserMessage(ctx interface{}, jsonRequest interface{}, callback interface{}) *Handler_HandleJSONRPCUserMessage_Call {
	return &Handler_HandleJSONRPCUserMessage_Call{Call: _e.mock.On("HandleJSONRPCUserMessage", ctx, jsonRequest, callback)}
}

func (_c *Handler_HandleJSONRPCUserMessage_Call) Run(run func(ctx context.Context, jsonRequest jsonrpc2.Request[json.RawMessage], callback handlers.Callback)) *Handler_HandleJSONRPCUserMessage_Call {
	_c.Call.Run(func(args mock.Arguments) {
		run(args[0].(context.Context), args[1].(jsonrpc2.Request[json.RawMessage]), args[2].(handlers.Callback))
	})
	return _c
}

func (_c *Handler_HandleJSONRPCUserMessage_Call) Return(_a0 error) *Handler_HandleJSONRPCUserMessage_Call {
	_c.Call.Return(_a0)
	return _c
}

func (_c *Handler_HandleJSONRPCUserMessage_Call) RunAndReturn(run func(context.Context, jsonrpc2.Request[json.RawMessage], handlers.Callback) error) *Handler_HandleJSONRPCUserMessage_Call {
	_c.Call.Return(run)
	return _c
}

// HandleLegacyUserMessage provides a mock function with given fields: ctx, msg, callback
func (_m *Handler) HandleLegacyUserMessage(ctx context.Context, msg *api.Message, callback handlers.Callback) error {
	ret := _m.Called(ctx, msg, callback)

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

	var r0 error
	if rf, ok := ret.Get(0).(func(context.Context, *api.Message, handlers.Callback) error); ok {
		r0 = rf(ctx, msg, callback)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

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

// HandleLegacyUserMessage is a helper method to define mock.On call
//   - ctx context.Context
//   - msg *api.Message
//   - callback handlers.Callback
func (_e *Handler_Expecter) HandleLegacyUserMessage(ctx interface{}, msg interface{}, callback interface{}) *Handler_HandleLegacyUserMessage_Call {
	return &Handler_HandleLegacyUserMessage_Call{Call: _e.mock.On("HandleLegacyUserMessage", ctx, msg, callback)}
}

func (_c *Handler_HandleLegacyUserMessage_Call) Run(run func(ctx context.Context, msg *api.Message, callback handlers.Callback)) *Handler_HandleLegacyUserMessage_Call {
	_c.Call.Run(func(args mock.Arguments) {
		run(args[0].(context.Context), args[1].(*api.Message), args[2].(handlers.Callback))
	})
	return _c
}

func (_c *Handler_HandleLegacyUserMessage_Call) Return(_a0 error) *Handler_HandleLegacyUserMessage_Call {
	_c.Call.Return(_a0)
	return _c
}

func (_c *Handler_HandleLegacyUserMessage_Call) RunAndReturn(run func(context.Context, *api.Message, handlers.Callback) error) *Handler_HandleLegacyUserMessage_Call {
	_c.Call.Return(run)
	return _c
}

// HandleNodeMessage provides a mock function with given fields: ctx, resp, nodeAddr
func (_m *Handler) HandleNodeMessage(ctx context.Context, resp *jsonrpc2.Response[json.RawMessage], nodeAddr string) error {
	ret := _m.Called(ctx, resp, nodeAddr)

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

	var r0 error
	if rf, ok := ret.Get(0).(func(context.Context, *jsonrpc2.Response[json.RawMessage], string) error); ok {
		r0 = rf(ctx, resp, nodeAddr)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

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

// HandleNodeMessage is a helper method to define mock.On call
//   - ctx context.Context
//   - resp *jsonrpc2.Response[json.RawMessage]
//   - nodeAddr string
func (_e *Handler_Expecter) HandleNodeMessage(ctx interface{}, resp interface{}, nodeAddr interface{}) *Handler_HandleNodeMessage_Call {
	return &Handler_HandleNodeMessage_Call{Call: _e.mock.On("HandleNodeMessage", ctx, resp, nodeAddr)}
}

func (_c *Handler_HandleNodeMessage_Call) Run(run func(ctx context.Context, resp *jsonrpc2.Response[json.RawMessage], nodeAddr string)) *Handler_HandleNodeMessage_Call {
	_c.Call.Run(func(args mock.Arguments) {
		run(args[0].(context.Context), args[1].(*jsonrpc2.Response[json.RawMessage]), args[2].(string))
	})
	return _c
}

func (_c *Handler_HandleNodeMessage_Call) Return(_a0 error) *Handler_HandleNodeMessage_Call {
	_c.Call.Return(_a0)
	return _c
}

func (_c *Handler_HandleNodeMessage_Call) RunAndReturn(run func(context.Context, *jsonrpc2.Response[json.RawMessage], string) error) *Handler_HandleNodeMessage_Call {
	_c.Call.Return(run)
	return _c
}

// Methods provides a mock function with no fields
func (_m *Handler) Methods() []string {
	ret := _m.Called()

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

	var r0 []string
	if rf, ok := ret.Get(0).(func() []string); ok {
		r0 = rf()
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).([]string)
		}
	}

	return r0
}

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

// Methods is a helper method to define mock.On call
func (_e *Handler_Expecter) Methods() *Handler_Methods_Call {
	return &Handler_Methods_Call{Call: _e.mock.On("Methods")}
}

func (_c *Handler_Methods_Call) Run(run func()) *Handler_Methods_Call {
	_c.Call.Run(func(args mock.Arguments) {
		run()
	})
	return _c
}

func (_c *Handler_Methods_Call) Return(_a0 []string) *Handler_Methods_Call {
	_c.Call.Return(_a0)
	return _c
}

func (_c *Handler_Methods_Call) RunAndReturn(run func() []string) *Handler_Methods_Call {
	_c.Call.Return(run)
	return _c
}

// Start provides a mock function with given fields: _a0
func (_m *Handler) Start(_a0 context.Context) error {
	ret := _m.Called(_a0)

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

	var r0 error
	if rf, ok := ret.Get(0).(func(context.Context) error); ok {
		r0 = rf(_a0)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

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

// Start is a helper method to define mock.On call
//   - _a0 context.Context
func (_e *Handler_Expecter) Start(_a0 interface{}) *Handler_Start_Call {
	return &Handler_Start_Call{Call: _e.mock.On("Start", _a0)}
}

func (_c *Handler_Start_Call) Run(run func(_a0 context.Context)) *Handler_Start_Call {
	_c.Call.Run(func(args mock.Arguments) {
		run(args[0].(context.Context))
	})
	return _c
}

func (_c *Handler_Start_Call) Return(_a0 error) *Handler_Start_Call {
	_c.Call.Return(_a0)
	return _c
}

func (_c *Handler_Start_Call) RunAndReturn(run func(context.Context) error) *Handler_Start_Call {
	_c.Call.Return(run)
	return _c
}

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

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

	return mock
}
