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

package mocks

import (
	context "context"
	json "encoding/json"

	jsonrpc2 "github.com/smartcontractkit/chainlink-common/pkg/jsonrpc2"
	mock "github.com/stretchr/testify/mock"
)

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

type RequestAuthorizer_Expecter struct {
	mock *mock.Mock
}

func (_m *RequestAuthorizer) EXPECT() *RequestAuthorizer_Expecter {
	return &RequestAuthorizer_Expecter{mock: &_m.Mock}
}

// AuthorizeRequest provides a mock function with given fields: ctx, req
func (_m *RequestAuthorizer) AuthorizeRequest(ctx context.Context, req jsonrpc2.Request[json.RawMessage]) (bool, string, error) {
	ret := _m.Called(ctx, req)

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

	var r0 bool
	var r1 string
	var r2 error
	if rf, ok := ret.Get(0).(func(context.Context, jsonrpc2.Request[json.RawMessage]) (bool, string, error)); ok {
		return rf(ctx, req)
	}
	if rf, ok := ret.Get(0).(func(context.Context, jsonrpc2.Request[json.RawMessage]) bool); ok {
		r0 = rf(ctx, req)
	} else {
		r0 = ret.Get(0).(bool)
	}

	if rf, ok := ret.Get(1).(func(context.Context, jsonrpc2.Request[json.RawMessage]) string); ok {
		r1 = rf(ctx, req)
	} else {
		r1 = ret.Get(1).(string)
	}

	if rf, ok := ret.Get(2).(func(context.Context, jsonrpc2.Request[json.RawMessage]) error); ok {
		r2 = rf(ctx, req)
	} else {
		r2 = ret.Error(2)
	}

	return r0, r1, r2
}

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

// AuthorizeRequest is a helper method to define mock.On call
//   - ctx context.Context
//   - req jsonrpc2.Request[json.RawMessage]
func (_e *RequestAuthorizer_Expecter) AuthorizeRequest(ctx interface{}, req interface{}) *RequestAuthorizer_AuthorizeRequest_Call {
	return &RequestAuthorizer_AuthorizeRequest_Call{Call: _e.mock.On("AuthorizeRequest", ctx, req)}
}

func (_c *RequestAuthorizer_AuthorizeRequest_Call) Run(run func(ctx context.Context, req jsonrpc2.Request[json.RawMessage])) *RequestAuthorizer_AuthorizeRequest_Call {
	_c.Call.Run(func(args mock.Arguments) {
		run(args[0].(context.Context), args[1].(jsonrpc2.Request[json.RawMessage]))
	})
	return _c
}

func (_c *RequestAuthorizer_AuthorizeRequest_Call) Return(isAuthorized bool, owner string, err error) *RequestAuthorizer_AuthorizeRequest_Call {
	_c.Call.Return(isAuthorized, owner, err)
	return _c
}

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

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

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

	return mock
}
