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

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

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

	return mock
}

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

type Callout_Expecter struct {
	mock *mock.Mock
}

func (_m *Callout) EXPECT() *Callout_Expecter {
	return &Callout_Expecter{mock: &_m.Mock}
}

// Callout provides a mock function for the type Callout
func (_mock *Callout) Callout(ctx context.Context, req callout.Request) error {
	ret := _mock.Called(ctx, req)

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

	var r0 error
	if returnFunc, ok := ret.Get(0).(func(context.Context, callout.Request) error); ok {
		r0 = returnFunc(ctx, req)
	} else {
		r0 = ret.Error(0)
	}
	return r0
}

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

// Callout is a helper method to define mock.On call
//   - ctx context.Context
//   - req callout.Request
func (_e *Callout_Expecter) Callout(ctx interface{}, req interface{}) *Callout_Callout_Call {
	return &Callout_Callout_Call{Call: _e.mock.On("Callout", ctx, req)}
}

func (_c *Callout_Callout_Call) Run(run func(ctx context.Context, req callout.Request)) *Callout_Callout_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 context.Context
		if args[0] != nil {
			arg0 = args[0].(context.Context)
		}
		var arg1 callout.Request
		if args[1] != nil {
			arg1 = args[1].(callout.Request)
		}
		run(
			arg0,
			arg1,
		)
	})
	return _c
}

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

func (_c *Callout_Callout_Call) RunAndReturn(run func(ctx context.Context, req callout.Request) error) *Callout_Callout_Call {
	_c.Call.Return(run)
	return _c
}
