// Code generated by mockery; DO NOT EDIT.
// github.com/vektra/mockery
// template: testify
// Copyright (c) Abstract Machines

// SPDX-License-Identifier: Apache-2.0

package mocks

import (
	"context"

	"github.com/absmach/magistrala/provision"
	mock "github.com/stretchr/testify/mock"
)

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

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

	return mock
}

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

type Service_Expecter struct {
	mock *mock.Mock
}

func (_m *Service) EXPECT() *Service_Expecter {
	return &Service_Expecter{mock: &_m.Mock}
}

// Cert provides a mock function for the type Service
func (_mock *Service) Cert(ctx context.Context, domainID string, token string, clientID string, duration string) (string, string, error) {
	ret := _mock.Called(ctx, domainID, token, clientID, duration)

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

	var r0 string
	var r1 string
	var r2 error
	if returnFunc, ok := ret.Get(0).(func(context.Context, string, string, string, string) (string, string, error)); ok {
		return returnFunc(ctx, domainID, token, clientID, duration)
	}
	if returnFunc, ok := ret.Get(0).(func(context.Context, string, string, string, string) string); ok {
		r0 = returnFunc(ctx, domainID, token, clientID, duration)
	} else {
		r0 = ret.Get(0).(string)
	}
	if returnFunc, ok := ret.Get(1).(func(context.Context, string, string, string, string) string); ok {
		r1 = returnFunc(ctx, domainID, token, clientID, duration)
	} else {
		r1 = ret.Get(1).(string)
	}
	if returnFunc, ok := ret.Get(2).(func(context.Context, string, string, string, string) error); ok {
		r2 = returnFunc(ctx, domainID, token, clientID, duration)
	} else {
		r2 = ret.Error(2)
	}
	return r0, r1, r2
}

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

// Cert is a helper method to define mock.On call
//   - ctx context.Context
//   - domainID string
//   - token string
//   - clientID string
//   - duration string
func (_e *Service_Expecter) Cert(ctx interface{}, domainID interface{}, token interface{}, clientID interface{}, duration interface{}) *Service_Cert_Call {
	return &Service_Cert_Call{Call: _e.mock.On("Cert", ctx, domainID, token, clientID, duration)}
}

func (_c *Service_Cert_Call) Run(run func(ctx context.Context, domainID string, token string, clientID string, duration string)) *Service_Cert_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 context.Context
		if args[0] != nil {
			arg0 = args[0].(context.Context)
		}
		var arg1 string
		if args[1] != nil {
			arg1 = args[1].(string)
		}
		var arg2 string
		if args[2] != nil {
			arg2 = args[2].(string)
		}
		var arg3 string
		if args[3] != nil {
			arg3 = args[3].(string)
		}
		var arg4 string
		if args[4] != nil {
			arg4 = args[4].(string)
		}
		run(
			arg0,
			arg1,
			arg2,
			arg3,
			arg4,
		)
	})
	return _c
}

func (_c *Service_Cert_Call) Return(s string, s1 string, err error) *Service_Cert_Call {
	_c.Call.Return(s, s1, err)
	return _c
}

func (_c *Service_Cert_Call) RunAndReturn(run func(ctx context.Context, domainID string, token string, clientID string, duration string) (string, string, error)) *Service_Cert_Call {
	_c.Call.Return(run)
	return _c
}

// Mapping provides a mock function for the type Service
func (_mock *Service) Mapping(ctx context.Context, token string) (map[string]any, error) {
	ret := _mock.Called(ctx, token)

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

	var r0 map[string]any
	var r1 error
	if returnFunc, ok := ret.Get(0).(func(context.Context, string) (map[string]any, error)); ok {
		return returnFunc(ctx, token)
	}
	if returnFunc, ok := ret.Get(0).(func(context.Context, string) map[string]any); ok {
		r0 = returnFunc(ctx, token)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(map[string]any)
		}
	}
	if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok {
		r1 = returnFunc(ctx, token)
	} else {
		r1 = ret.Error(1)
	}
	return r0, r1
}

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

// Mapping is a helper method to define mock.On call
//   - ctx context.Context
//   - token string
func (_e *Service_Expecter) Mapping(ctx interface{}, token interface{}) *Service_Mapping_Call {
	return &Service_Mapping_Call{Call: _e.mock.On("Mapping", ctx, token)}
}

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

func (_c *Service_Mapping_Call) Return(stringToV map[string]any, err error) *Service_Mapping_Call {
	_c.Call.Return(stringToV, err)
	return _c
}

func (_c *Service_Mapping_Call) RunAndReturn(run func(ctx context.Context, token string) (map[string]any, error)) *Service_Mapping_Call {
	_c.Call.Return(run)
	return _c
}

// Provision provides a mock function for the type Service
func (_mock *Service) Provision(ctx context.Context, domainID string, token string, name string, externalID string, externalKey string) (provision.Result, error) {
	ret := _mock.Called(ctx, domainID, token, name, externalID, externalKey)

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

	var r0 provision.Result
	var r1 error
	if returnFunc, ok := ret.Get(0).(func(context.Context, string, string, string, string, string) (provision.Result, error)); ok {
		return returnFunc(ctx, domainID, token, name, externalID, externalKey)
	}
	if returnFunc, ok := ret.Get(0).(func(context.Context, string, string, string, string, string) provision.Result); ok {
		r0 = returnFunc(ctx, domainID, token, name, externalID, externalKey)
	} else {
		r0 = ret.Get(0).(provision.Result)
	}
	if returnFunc, ok := ret.Get(1).(func(context.Context, string, string, string, string, string) error); ok {
		r1 = returnFunc(ctx, domainID, token, name, externalID, externalKey)
	} else {
		r1 = ret.Error(1)
	}
	return r0, r1
}

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

// Provision is a helper method to define mock.On call
//   - ctx context.Context
//   - domainID string
//   - token string
//   - name string
//   - externalID string
//   - externalKey string
func (_e *Service_Expecter) Provision(ctx interface{}, domainID interface{}, token interface{}, name interface{}, externalID interface{}, externalKey interface{}) *Service_Provision_Call {
	return &Service_Provision_Call{Call: _e.mock.On("Provision", ctx, domainID, token, name, externalID, externalKey)}
}

func (_c *Service_Provision_Call) Run(run func(ctx context.Context, domainID string, token string, name string, externalID string, externalKey string)) *Service_Provision_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 context.Context
		if args[0] != nil {
			arg0 = args[0].(context.Context)
		}
		var arg1 string
		if args[1] != nil {
			arg1 = args[1].(string)
		}
		var arg2 string
		if args[2] != nil {
			arg2 = args[2].(string)
		}
		var arg3 string
		if args[3] != nil {
			arg3 = args[3].(string)
		}
		var arg4 string
		if args[4] != nil {
			arg4 = args[4].(string)
		}
		var arg5 string
		if args[5] != nil {
			arg5 = args[5].(string)
		}
		run(
			arg0,
			arg1,
			arg2,
			arg3,
			arg4,
			arg5,
		)
	})
	return _c
}

func (_c *Service_Provision_Call) Return(result provision.Result, err error) *Service_Provision_Call {
	_c.Call.Return(result, err)
	return _c
}

func (_c *Service_Provision_Call) RunAndReturn(run func(ctx context.Context, domainID string, token string, name string, externalID string, externalKey string) (provision.Result, error)) *Service_Provision_Call {
	_c.Call.Return(run)
	return _c
}
