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

package component

import (
	context "context"

	membership "opencsg.com/csghub-server/builder/git/membership"
	database "opencsg.com/csghub-server/builder/store/database"

	mock "github.com/stretchr/testify/mock"

	types "opencsg.com/csghub-server/common/types"
)

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

type MockMemberComponent_Expecter struct {
	mock *mock.Mock
}

func (_m *MockMemberComponent) EXPECT() *MockMemberComponent_Expecter {
	return &MockMemberComponent_Expecter{mock: &_m.Mock}
}

// AddMember provides a mock function with given fields: ctx, orgName, userName, operatorName, role
func (_m *MockMemberComponent) AddMember(ctx context.Context, orgName string, userName string, operatorName string, role string) error {
	ret := _m.Called(ctx, orgName, userName, operatorName, role)

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

	var r0 error
	if rf, ok := ret.Get(0).(func(context.Context, string, string, string, string) error); ok {
		r0 = rf(ctx, orgName, userName, operatorName, role)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

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

// AddMember is a helper method to define mock.On call
//   - ctx context.Context
//   - orgName string
//   - userName string
//   - operatorName string
//   - role string
func (_e *MockMemberComponent_Expecter) AddMember(ctx interface{}, orgName interface{}, userName interface{}, operatorName interface{}, role interface{}) *MockMemberComponent_AddMember_Call {
	return &MockMemberComponent_AddMember_Call{Call: _e.mock.On("AddMember", ctx, orgName, userName, operatorName, role)}
}

func (_c *MockMemberComponent_AddMember_Call) Run(run func(ctx context.Context, orgName string, userName string, operatorName string, role string)) *MockMemberComponent_AddMember_Call {
	_c.Call.Run(func(args mock.Arguments) {
		run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(string), args[4].(string))
	})
	return _c
}

func (_c *MockMemberComponent_AddMember_Call) Return(_a0 error) *MockMemberComponent_AddMember_Call {
	_c.Call.Return(_a0)
	return _c
}

func (_c *MockMemberComponent_AddMember_Call) RunAndReturn(run func(context.Context, string, string, string, string) error) *MockMemberComponent_AddMember_Call {
	_c.Call.Return(run)
	return _c
}

// AddMembers provides a mock function with given fields: ctx, orgName, users, operatorName, role
func (_m *MockMemberComponent) AddMembers(ctx context.Context, orgName string, users []string, operatorName string, role string) error {
	ret := _m.Called(ctx, orgName, users, operatorName, role)

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

	var r0 error
	if rf, ok := ret.Get(0).(func(context.Context, string, []string, string, string) error); ok {
		r0 = rf(ctx, orgName, users, operatorName, role)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

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

// AddMembers is a helper method to define mock.On call
//   - ctx context.Context
//   - orgName string
//   - users []string
//   - operatorName string
//   - role string
func (_e *MockMemberComponent_Expecter) AddMembers(ctx interface{}, orgName interface{}, users interface{}, operatorName interface{}, role interface{}) *MockMemberComponent_AddMembers_Call {
	return &MockMemberComponent_AddMembers_Call{Call: _e.mock.On("AddMembers", ctx, orgName, users, operatorName, role)}
}

func (_c *MockMemberComponent_AddMembers_Call) Run(run func(ctx context.Context, orgName string, users []string, operatorName string, role string)) *MockMemberComponent_AddMembers_Call {
	_c.Call.Run(func(args mock.Arguments) {
		run(args[0].(context.Context), args[1].(string), args[2].([]string), args[3].(string), args[4].(string))
	})
	return _c
}

func (_c *MockMemberComponent_AddMembers_Call) Return(_a0 error) *MockMemberComponent_AddMembers_Call {
	_c.Call.Return(_a0)
	return _c
}

func (_c *MockMemberComponent_AddMembers_Call) RunAndReturn(run func(context.Context, string, []string, string, string) error) *MockMemberComponent_AddMembers_Call {
	_c.Call.Return(run)
	return _c
}

// ChangeMemberRole provides a mock function with given fields: ctx, orgName, userName, operatorName, oldRole, newRole
func (_m *MockMemberComponent) ChangeMemberRole(ctx context.Context, orgName string, userName string, operatorName string, oldRole string, newRole string) error {
	ret := _m.Called(ctx, orgName, userName, operatorName, oldRole, newRole)

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

	var r0 error
	if rf, ok := ret.Get(0).(func(context.Context, string, string, string, string, string) error); ok {
		r0 = rf(ctx, orgName, userName, operatorName, oldRole, newRole)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

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

// ChangeMemberRole is a helper method to define mock.On call
//   - ctx context.Context
//   - orgName string
//   - userName string
//   - operatorName string
//   - oldRole string
//   - newRole string
func (_e *MockMemberComponent_Expecter) ChangeMemberRole(ctx interface{}, orgName interface{}, userName interface{}, operatorName interface{}, oldRole interface{}, newRole interface{}) *MockMemberComponent_ChangeMemberRole_Call {
	return &MockMemberComponent_ChangeMemberRole_Call{Call: _e.mock.On("ChangeMemberRole", ctx, orgName, userName, operatorName, oldRole, newRole)}
}

func (_c *MockMemberComponent_ChangeMemberRole_Call) Run(run func(ctx context.Context, orgName string, userName string, operatorName string, oldRole string, newRole string)) *MockMemberComponent_ChangeMemberRole_Call {
	_c.Call.Run(func(args mock.Arguments) {
		run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(string), args[4].(string), args[5].(string))
	})
	return _c
}

func (_c *MockMemberComponent_ChangeMemberRole_Call) Return(_a0 error) *MockMemberComponent_ChangeMemberRole_Call {
	_c.Call.Return(_a0)
	return _c
}

func (_c *MockMemberComponent_ChangeMemberRole_Call) RunAndReturn(run func(context.Context, string, string, string, string, string) error) *MockMemberComponent_ChangeMemberRole_Call {
	_c.Call.Return(run)
	return _c
}

// Delete provides a mock function with given fields: ctx, orgName, userName, operatorName, role
func (_m *MockMemberComponent) Delete(ctx context.Context, orgName string, userName string, operatorName string, role string) error {
	ret := _m.Called(ctx, orgName, userName, operatorName, role)

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

	var r0 error
	if rf, ok := ret.Get(0).(func(context.Context, string, string, string, string) error); ok {
		r0 = rf(ctx, orgName, userName, operatorName, role)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

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

// Delete is a helper method to define mock.On call
//   - ctx context.Context
//   - orgName string
//   - userName string
//   - operatorName string
//   - role string
func (_e *MockMemberComponent_Expecter) Delete(ctx interface{}, orgName interface{}, userName interface{}, operatorName interface{}, role interface{}) *MockMemberComponent_Delete_Call {
	return &MockMemberComponent_Delete_Call{Call: _e.mock.On("Delete", ctx, orgName, userName, operatorName, role)}
}

func (_c *MockMemberComponent_Delete_Call) Run(run func(ctx context.Context, orgName string, userName string, operatorName string, role string)) *MockMemberComponent_Delete_Call {
	_c.Call.Run(func(args mock.Arguments) {
		run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(string), args[4].(string))
	})
	return _c
}

func (_c *MockMemberComponent_Delete_Call) Return(_a0 error) *MockMemberComponent_Delete_Call {
	_c.Call.Return(_a0)
	return _c
}

func (_c *MockMemberComponent_Delete_Call) RunAndReturn(run func(context.Context, string, string, string, string) error) *MockMemberComponent_Delete_Call {
	_c.Call.Return(run)
	return _c
}

// GetMemberRole provides a mock function with given fields: ctx, orgName, userName
func (_m *MockMemberComponent) GetMemberRole(ctx context.Context, orgName string, userName string) (membership.Role, error) {
	ret := _m.Called(ctx, orgName, userName)

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

	var r0 membership.Role
	var r1 error
	if rf, ok := ret.Get(0).(func(context.Context, string, string) (membership.Role, error)); ok {
		return rf(ctx, orgName, userName)
	}
	if rf, ok := ret.Get(0).(func(context.Context, string, string) membership.Role); ok {
		r0 = rf(ctx, orgName, userName)
	} else {
		r0 = ret.Get(0).(membership.Role)
	}

	if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok {
		r1 = rf(ctx, orgName, userName)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

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

// GetMemberRole is a helper method to define mock.On call
//   - ctx context.Context
//   - orgName string
//   - userName string
func (_e *MockMemberComponent_Expecter) GetMemberRole(ctx interface{}, orgName interface{}, userName interface{}) *MockMemberComponent_GetMemberRole_Call {
	return &MockMemberComponent_GetMemberRole_Call{Call: _e.mock.On("GetMemberRole", ctx, orgName, userName)}
}

func (_c *MockMemberComponent_GetMemberRole_Call) Run(run func(ctx context.Context, orgName string, userName string)) *MockMemberComponent_GetMemberRole_Call {
	_c.Call.Run(func(args mock.Arguments) {
		run(args[0].(context.Context), args[1].(string), args[2].(string))
	})
	return _c
}

func (_c *MockMemberComponent_GetMemberRole_Call) Return(_a0 membership.Role, _a1 error) *MockMemberComponent_GetMemberRole_Call {
	_c.Call.Return(_a0, _a1)
	return _c
}

func (_c *MockMemberComponent_GetMemberRole_Call) RunAndReturn(run func(context.Context, string, string) (membership.Role, error)) *MockMemberComponent_GetMemberRole_Call {
	_c.Call.Return(run)
	return _c
}

// InitRoles provides a mock function with given fields: ctx, org
func (_m *MockMemberComponent) InitRoles(ctx context.Context, org *database.Organization) error {
	ret := _m.Called(ctx, org)

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

	var r0 error
	if rf, ok := ret.Get(0).(func(context.Context, *database.Organization) error); ok {
		r0 = rf(ctx, org)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

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

// InitRoles is a helper method to define mock.On call
//   - ctx context.Context
//   - org *database.Organization
func (_e *MockMemberComponent_Expecter) InitRoles(ctx interface{}, org interface{}) *MockMemberComponent_InitRoles_Call {
	return &MockMemberComponent_InitRoles_Call{Call: _e.mock.On("InitRoles", ctx, org)}
}

func (_c *MockMemberComponent_InitRoles_Call) Run(run func(ctx context.Context, org *database.Organization)) *MockMemberComponent_InitRoles_Call {
	_c.Call.Run(func(args mock.Arguments) {
		run(args[0].(context.Context), args[1].(*database.Organization))
	})
	return _c
}

func (_c *MockMemberComponent_InitRoles_Call) Return(_a0 error) *MockMemberComponent_InitRoles_Call {
	_c.Call.Return(_a0)
	return _c
}

func (_c *MockMemberComponent_InitRoles_Call) RunAndReturn(run func(context.Context, *database.Organization) error) *MockMemberComponent_InitRoles_Call {
	_c.Call.Return(run)
	return _c
}

// OrgMembers provides a mock function with given fields: ctx, orgName, currentUser, pageSize, page
func (_m *MockMemberComponent) OrgMembers(ctx context.Context, orgName string, currentUser string, pageSize int, page int) ([]types.Member, int, error) {
	ret := _m.Called(ctx, orgName, currentUser, pageSize, page)

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

	var r0 []types.Member
	var r1 int
	var r2 error
	if rf, ok := ret.Get(0).(func(context.Context, string, string, int, int) ([]types.Member, int, error)); ok {
		return rf(ctx, orgName, currentUser, pageSize, page)
	}
	if rf, ok := ret.Get(0).(func(context.Context, string, string, int, int) []types.Member); ok {
		r0 = rf(ctx, orgName, currentUser, pageSize, page)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).([]types.Member)
		}
	}

	if rf, ok := ret.Get(1).(func(context.Context, string, string, int, int) int); ok {
		r1 = rf(ctx, orgName, currentUser, pageSize, page)
	} else {
		r1 = ret.Get(1).(int)
	}

	if rf, ok := ret.Get(2).(func(context.Context, string, string, int, int) error); ok {
		r2 = rf(ctx, orgName, currentUser, pageSize, page)
	} else {
		r2 = ret.Error(2)
	}

	return r0, r1, r2
}

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

// OrgMembers is a helper method to define mock.On call
//   - ctx context.Context
//   - orgName string
//   - currentUser string
//   - pageSize int
//   - page int
func (_e *MockMemberComponent_Expecter) OrgMembers(ctx interface{}, orgName interface{}, currentUser interface{}, pageSize interface{}, page interface{}) *MockMemberComponent_OrgMembers_Call {
	return &MockMemberComponent_OrgMembers_Call{Call: _e.mock.On("OrgMembers", ctx, orgName, currentUser, pageSize, page)}
}

func (_c *MockMemberComponent_OrgMembers_Call) Run(run func(ctx context.Context, orgName string, currentUser string, pageSize int, page int)) *MockMemberComponent_OrgMembers_Call {
	_c.Call.Run(func(args mock.Arguments) {
		run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(int), args[4].(int))
	})
	return _c
}

func (_c *MockMemberComponent_OrgMembers_Call) Return(_a0 []types.Member, _a1 int, _a2 error) *MockMemberComponent_OrgMembers_Call {
	_c.Call.Return(_a0, _a1, _a2)
	return _c
}

func (_c *MockMemberComponent_OrgMembers_Call) RunAndReturn(run func(context.Context, string, string, int, int) ([]types.Member, int, error)) *MockMemberComponent_OrgMembers_Call {
	_c.Call.Return(run)
	return _c
}

// SetAdmin provides a mock function with given fields: ctx, org, user
func (_m *MockMemberComponent) SetAdmin(ctx context.Context, org *database.Organization, user *database.User) error {
	ret := _m.Called(ctx, org, user)

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

	var r0 error
	if rf, ok := ret.Get(0).(func(context.Context, *database.Organization, *database.User) error); ok {
		r0 = rf(ctx, org, user)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

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

// SetAdmin is a helper method to define mock.On call
//   - ctx context.Context
//   - org *database.Organization
//   - user *database.User
func (_e *MockMemberComponent_Expecter) SetAdmin(ctx interface{}, org interface{}, user interface{}) *MockMemberComponent_SetAdmin_Call {
	return &MockMemberComponent_SetAdmin_Call{Call: _e.mock.On("SetAdmin", ctx, org, user)}
}

func (_c *MockMemberComponent_SetAdmin_Call) Run(run func(ctx context.Context, org *database.Organization, user *database.User)) *MockMemberComponent_SetAdmin_Call {
	_c.Call.Run(func(args mock.Arguments) {
		run(args[0].(context.Context), args[1].(*database.Organization), args[2].(*database.User))
	})
	return _c
}

func (_c *MockMemberComponent_SetAdmin_Call) Return(_a0 error) *MockMemberComponent_SetAdmin_Call {
	_c.Call.Return(_a0)
	return _c
}

func (_c *MockMemberComponent_SetAdmin_Call) RunAndReturn(run func(context.Context, *database.Organization, *database.User) error) *MockMemberComponent_SetAdmin_Call {
	_c.Call.Return(run)
	return _c
}

// Update provides a mock function with given fields: ctx
func (_m *MockMemberComponent) Update(ctx context.Context) (*database.Member, error) {
	ret := _m.Called(ctx)

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

	var r0 *database.Member
	var r1 error
	if rf, ok := ret.Get(0).(func(context.Context) (*database.Member, error)); ok {
		return rf(ctx)
	}
	if rf, ok := ret.Get(0).(func(context.Context) *database.Member); ok {
		r0 = rf(ctx)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*database.Member)
		}
	}

	if rf, ok := ret.Get(1).(func(context.Context) error); ok {
		r1 = rf(ctx)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}

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

// Update is a helper method to define mock.On call
//   - ctx context.Context
func (_e *MockMemberComponent_Expecter) Update(ctx interface{}) *MockMemberComponent_Update_Call {
	return &MockMemberComponent_Update_Call{Call: _e.mock.On("Update", ctx)}
}

func (_c *MockMemberComponent_Update_Call) Run(run func(ctx context.Context)) *MockMemberComponent_Update_Call {
	_c.Call.Run(func(args mock.Arguments) {
		run(args[0].(context.Context))
	})
	return _c
}

func (_c *MockMemberComponent_Update_Call) Return(org *database.Member, err error) *MockMemberComponent_Update_Call {
	_c.Call.Return(org, err)
	return _c
}

func (_c *MockMemberComponent_Update_Call) RunAndReturn(run func(context.Context) (*database.Member, error)) *MockMemberComponent_Update_Call {
	_c.Call.Return(run)
	return _c
}

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

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

	return mock
}
