// 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/supermq/pkg/policies"
	"github.com/absmach/supermq/pkg/roles"
	mock "github.com/stretchr/testify/mock"
)

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

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

	return mock
}

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

type Provisioner_Expecter struct {
	mock *mock.Mock
}

func (_m *Provisioner) EXPECT() *Provisioner_Expecter {
	return &Provisioner_Expecter{mock: &_m.Mock}
}

// AddNewEntitiesRoles provides a mock function for the type Provisioner
func (_mock *Provisioner) AddNewEntitiesRoles(ctx context.Context, domainID string, userID string, entityIDs []string, optionalEntityPolicies []policies.Policy, newBuiltInRoleMembers map[roles.BuiltInRoleName][]roles.Member) ([]roles.RoleProvision, error) {
	ret := _mock.Called(ctx, domainID, userID, entityIDs, optionalEntityPolicies, newBuiltInRoleMembers)

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

	var r0 []roles.RoleProvision
	var r1 error
	if returnFunc, ok := ret.Get(0).(func(context.Context, string, string, []string, []policies.Policy, map[roles.BuiltInRoleName][]roles.Member) ([]roles.RoleProvision, error)); ok {
		return returnFunc(ctx, domainID, userID, entityIDs, optionalEntityPolicies, newBuiltInRoleMembers)
	}
	if returnFunc, ok := ret.Get(0).(func(context.Context, string, string, []string, []policies.Policy, map[roles.BuiltInRoleName][]roles.Member) []roles.RoleProvision); ok {
		r0 = returnFunc(ctx, domainID, userID, entityIDs, optionalEntityPolicies, newBuiltInRoleMembers)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).([]roles.RoleProvision)
		}
	}
	if returnFunc, ok := ret.Get(1).(func(context.Context, string, string, []string, []policies.Policy, map[roles.BuiltInRoleName][]roles.Member) error); ok {
		r1 = returnFunc(ctx, domainID, userID, entityIDs, optionalEntityPolicies, newBuiltInRoleMembers)
	} else {
		r1 = ret.Error(1)
	}
	return r0, r1
}

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

// AddNewEntitiesRoles is a helper method to define mock.On call
//   - ctx context.Context
//   - domainID string
//   - userID string
//   - entityIDs []string
//   - optionalEntityPolicies []policies.Policy
//   - newBuiltInRoleMembers map[roles.BuiltInRoleName][]roles.Member
func (_e *Provisioner_Expecter) AddNewEntitiesRoles(ctx interface{}, domainID interface{}, userID interface{}, entityIDs interface{}, optionalEntityPolicies interface{}, newBuiltInRoleMembers interface{}) *Provisioner_AddNewEntitiesRoles_Call {
	return &Provisioner_AddNewEntitiesRoles_Call{Call: _e.mock.On("AddNewEntitiesRoles", ctx, domainID, userID, entityIDs, optionalEntityPolicies, newBuiltInRoleMembers)}
}

func (_c *Provisioner_AddNewEntitiesRoles_Call) Run(run func(ctx context.Context, domainID string, userID string, entityIDs []string, optionalEntityPolicies []policies.Policy, newBuiltInRoleMembers map[roles.BuiltInRoleName][]roles.Member)) *Provisioner_AddNewEntitiesRoles_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 []policies.Policy
		if args[4] != nil {
			arg4 = args[4].([]policies.Policy)
		}
		var arg5 map[roles.BuiltInRoleName][]roles.Member
		if args[5] != nil {
			arg5 = args[5].(map[roles.BuiltInRoleName][]roles.Member)
		}
		run(
			arg0,
			arg1,
			arg2,
			arg3,
			arg4,
			arg5,
		)
	})
	return _c
}

func (_c *Provisioner_AddNewEntitiesRoles_Call) Return(roleProvisions []roles.RoleProvision, err error) *Provisioner_AddNewEntitiesRoles_Call {
	_c.Call.Return(roleProvisions, err)
	return _c
}

func (_c *Provisioner_AddNewEntitiesRoles_Call) RunAndReturn(run func(ctx context.Context, domainID string, userID string, entityIDs []string, optionalEntityPolicies []policies.Policy, newBuiltInRoleMembers map[roles.BuiltInRoleName][]roles.Member) ([]roles.RoleProvision, error)) *Provisioner_AddNewEntitiesRoles_Call {
	_c.Call.Return(run)
	return _c
}

// RemoveEntitiesRoles provides a mock function for the type Provisioner
func (_mock *Provisioner) RemoveEntitiesRoles(ctx context.Context, domainID string, userID string, entityIDs []string, optionalFilterDeletePolicies []policies.Policy, optionalDeletePolicies []policies.Policy) error {
	ret := _mock.Called(ctx, domainID, userID, entityIDs, optionalFilterDeletePolicies, optionalDeletePolicies)

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

	var r0 error
	if returnFunc, ok := ret.Get(0).(func(context.Context, string, string, []string, []policies.Policy, []policies.Policy) error); ok {
		r0 = returnFunc(ctx, domainID, userID, entityIDs, optionalFilterDeletePolicies, optionalDeletePolicies)
	} else {
		r0 = ret.Error(0)
	}
	return r0
}

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

// RemoveEntitiesRoles is a helper method to define mock.On call
//   - ctx context.Context
//   - domainID string
//   - userID string
//   - entityIDs []string
//   - optionalFilterDeletePolicies []policies.Policy
//   - optionalDeletePolicies []policies.Policy
func (_e *Provisioner_Expecter) RemoveEntitiesRoles(ctx interface{}, domainID interface{}, userID interface{}, entityIDs interface{}, optionalFilterDeletePolicies interface{}, optionalDeletePolicies interface{}) *Provisioner_RemoveEntitiesRoles_Call {
	return &Provisioner_RemoveEntitiesRoles_Call{Call: _e.mock.On("RemoveEntitiesRoles", ctx, domainID, userID, entityIDs, optionalFilterDeletePolicies, optionalDeletePolicies)}
}

func (_c *Provisioner_RemoveEntitiesRoles_Call) Run(run func(ctx context.Context, domainID string, userID string, entityIDs []string, optionalFilterDeletePolicies []policies.Policy, optionalDeletePolicies []policies.Policy)) *Provisioner_RemoveEntitiesRoles_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 []policies.Policy
		if args[4] != nil {
			arg4 = args[4].([]policies.Policy)
		}
		var arg5 []policies.Policy
		if args[5] != nil {
			arg5 = args[5].([]policies.Policy)
		}
		run(
			arg0,
			arg1,
			arg2,
			arg3,
			arg4,
			arg5,
		)
	})
	return _c
}

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

func (_c *Provisioner_RemoveEntitiesRoles_Call) RunAndReturn(run func(ctx context.Context, domainID string, userID string, entityIDs []string, optionalFilterDeletePolicies []policies.Policy, optionalDeletePolicies []policies.Policy) error) *Provisioner_RemoveEntitiesRoles_Call {
	_c.Call.Return(run)
	return _c
}
