// 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/pkg/authz"
	mock "github.com/stretchr/testify/mock"
)

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

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

	return mock
}

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

type Authorization_Expecter struct {
	mock *mock.Mock
}

func (_m *Authorization) EXPECT() *Authorization_Expecter {
	return &Authorization_Expecter{mock: &_m.Mock}
}

// Authorize provides a mock function for the type Authorization
func (_mock *Authorization) Authorize(ctx context.Context, pr authz.PolicyReq, pat *authz.PATReq) error {
	ret := _mock.Called(ctx, pr, pat)

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

	var r0 error
	if returnFunc, ok := ret.Get(0).(func(context.Context, authz.PolicyReq, *authz.PATReq) error); ok {
		r0 = returnFunc(ctx, pr, pat)
	} else {
		r0 = ret.Error(0)
	}
	return r0
}

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

// Authorize is a helper method to define mock.On call
//   - ctx context.Context
//   - pr authz.PolicyReq
//   - pat *authz.PATReq
func (_e *Authorization_Expecter) Authorize(ctx interface{}, pr interface{}, pat interface{}) *Authorization_Authorize_Call {
	return &Authorization_Authorize_Call{Call: _e.mock.On("Authorize", ctx, pr, pat)}
}

func (_c *Authorization_Authorize_Call) Run(run func(ctx context.Context, pr authz.PolicyReq, pat *authz.PATReq)) *Authorization_Authorize_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 context.Context
		if args[0] != nil {
			arg0 = args[0].(context.Context)
		}
		var arg1 authz.PolicyReq
		if args[1] != nil {
			arg1 = args[1].(authz.PolicyReq)
		}
		var arg2 *authz.PATReq
		if args[2] != nil {
			arg2 = args[2].(*authz.PATReq)
		}
		run(
			arg0,
			arg1,
			arg2,
		)
	})
	return _c
}

func (_c *Authorization_Authorize_Call) Return(err error) *Authorization_Authorize_Call {
	_c.Call.Return(err)
	return _c
}

func (_c *Authorization_Authorize_Call) RunAndReturn(run func(ctx context.Context, pr authz.PolicyReq, pat *authz.PATReq) error) *Authorization_Authorize_Call {
	_c.Call.Return(run)
	return _c
}
