// Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: testify package mocks import ( "context" "github.com/qsfera/server/protogen/gen/qsfera/services/settings/v0" mock "github.com/stretchr/testify/mock" "go-micro.dev/v4/client" "google.golang.org/protobuf/types/known/emptypb" ) // NewRoleService creates a new instance of RoleService. 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 NewRoleService(t interface { mock.TestingT Cleanup(func()) }) *RoleService { mock := &RoleService{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // RoleService is an autogenerated mock type for the RoleService type type RoleService struct { mock.Mock } type RoleService_Expecter struct { mock *mock.Mock } func (_m *RoleService) EXPECT() *RoleService_Expecter { return &RoleService_Expecter{mock: &_m.Mock} } // AssignRoleToUser provides a mock function for the type RoleService func (_mock *RoleService) AssignRoleToUser(ctx context.Context, in *v0.AssignRoleToUserRequest, opts ...client.CallOption) (*v0.AssignRoleToUserResponse, error) { var tmpRet mock.Arguments if len(opts) > 0 { tmpRet = _mock.Called(ctx, in, opts) } else { tmpRet = _mock.Called(ctx, in) } ret := tmpRet if len(ret) == 0 { panic("no return value specified for AssignRoleToUser") } var r0 *v0.AssignRoleToUserResponse var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.AssignRoleToUserRequest, ...client.CallOption) (*v0.AssignRoleToUserResponse, error)); ok { return returnFunc(ctx, in, opts...) } if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.AssignRoleToUserRequest, ...client.CallOption) *v0.AssignRoleToUserResponse); ok { r0 = returnFunc(ctx, in, opts...) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*v0.AssignRoleToUserResponse) } } if returnFunc, ok := ret.Get(1).(func(context.Context, *v0.AssignRoleToUserRequest, ...client.CallOption) error); ok { r1 = returnFunc(ctx, in, opts...) } else { r1 = ret.Error(1) } return r0, r1 } // RoleService_AssignRoleToUser_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AssignRoleToUser' type RoleService_AssignRoleToUser_Call struct { *mock.Call } // AssignRoleToUser is a helper method to define mock.On call // - ctx context.Context // - in *v0.AssignRoleToUserRequest // - opts ...client.CallOption func (_e *RoleService_Expecter) AssignRoleToUser(ctx interface{}, in interface{}, opts ...interface{}) *RoleService_AssignRoleToUser_Call { return &RoleService_AssignRoleToUser_Call{Call: _e.mock.On("AssignRoleToUser", append([]interface{}{ctx, in}, opts...)...)} } func (_c *RoleService_AssignRoleToUser_Call) Run(run func(ctx context.Context, in *v0.AssignRoleToUserRequest, opts ...client.CallOption)) *RoleService_AssignRoleToUser_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 *v0.AssignRoleToUserRequest if args[1] != nil { arg1 = args[1].(*v0.AssignRoleToUserRequest) } var arg2 []client.CallOption var variadicArgs []client.CallOption if len(args) > 2 { variadicArgs = args[2].([]client.CallOption) } arg2 = variadicArgs run( arg0, arg1, arg2..., ) }) return _c } func (_c *RoleService_AssignRoleToUser_Call) Return(assignRoleToUserResponse *v0.AssignRoleToUserResponse, err error) *RoleService_AssignRoleToUser_Call { _c.Call.Return(assignRoleToUserResponse, err) return _c } func (_c *RoleService_AssignRoleToUser_Call) RunAndReturn(run func(ctx context.Context, in *v0.AssignRoleToUserRequest, opts ...client.CallOption) (*v0.AssignRoleToUserResponse, error)) *RoleService_AssignRoleToUser_Call { _c.Call.Return(run) return _c } // ListRoleAssignments provides a mock function for the type RoleService func (_mock *RoleService) ListRoleAssignments(ctx context.Context, in *v0.ListRoleAssignmentsRequest, opts ...client.CallOption) (*v0.ListRoleAssignmentsResponse, error) { var tmpRet mock.Arguments if len(opts) > 0 { tmpRet = _mock.Called(ctx, in, opts) } else { tmpRet = _mock.Called(ctx, in) } ret := tmpRet if len(ret) == 0 { panic("no return value specified for ListRoleAssignments") } var r0 *v0.ListRoleAssignmentsResponse var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.ListRoleAssignmentsRequest, ...client.CallOption) (*v0.ListRoleAssignmentsResponse, error)); ok { return returnFunc(ctx, in, opts...) } if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.ListRoleAssignmentsRequest, ...client.CallOption) *v0.ListRoleAssignmentsResponse); ok { r0 = returnFunc(ctx, in, opts...) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*v0.ListRoleAssignmentsResponse) } } if returnFunc, ok := ret.Get(1).(func(context.Context, *v0.ListRoleAssignmentsRequest, ...client.CallOption) error); ok { r1 = returnFunc(ctx, in, opts...) } else { r1 = ret.Error(1) } return r0, r1 } // RoleService_ListRoleAssignments_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListRoleAssignments' type RoleService_ListRoleAssignments_Call struct { *mock.Call } // ListRoleAssignments is a helper method to define mock.On call // - ctx context.Context // - in *v0.ListRoleAssignmentsRequest // - opts ...client.CallOption func (_e *RoleService_Expecter) ListRoleAssignments(ctx interface{}, in interface{}, opts ...interface{}) *RoleService_ListRoleAssignments_Call { return &RoleService_ListRoleAssignments_Call{Call: _e.mock.On("ListRoleAssignments", append([]interface{}{ctx, in}, opts...)...)} } func (_c *RoleService_ListRoleAssignments_Call) Run(run func(ctx context.Context, in *v0.ListRoleAssignmentsRequest, opts ...client.CallOption)) *RoleService_ListRoleAssignments_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 *v0.ListRoleAssignmentsRequest if args[1] != nil { arg1 = args[1].(*v0.ListRoleAssignmentsRequest) } var arg2 []client.CallOption var variadicArgs []client.CallOption if len(args) > 2 { variadicArgs = args[2].([]client.CallOption) } arg2 = variadicArgs run( arg0, arg1, arg2..., ) }) return _c } func (_c *RoleService_ListRoleAssignments_Call) Return(listRoleAssignmentsResponse *v0.ListRoleAssignmentsResponse, err error) *RoleService_ListRoleAssignments_Call { _c.Call.Return(listRoleAssignmentsResponse, err) return _c } func (_c *RoleService_ListRoleAssignments_Call) RunAndReturn(run func(ctx context.Context, in *v0.ListRoleAssignmentsRequest, opts ...client.CallOption) (*v0.ListRoleAssignmentsResponse, error)) *RoleService_ListRoleAssignments_Call { _c.Call.Return(run) return _c } // ListRoleAssignmentsFiltered provides a mock function for the type RoleService func (_mock *RoleService) ListRoleAssignmentsFiltered(ctx context.Context, in *v0.ListRoleAssignmentsFilteredRequest, opts ...client.CallOption) (*v0.ListRoleAssignmentsResponse, error) { var tmpRet mock.Arguments if len(opts) > 0 { tmpRet = _mock.Called(ctx, in, opts) } else { tmpRet = _mock.Called(ctx, in) } ret := tmpRet if len(ret) == 0 { panic("no return value specified for ListRoleAssignmentsFiltered") } var r0 *v0.ListRoleAssignmentsResponse var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.ListRoleAssignmentsFilteredRequest, ...client.CallOption) (*v0.ListRoleAssignmentsResponse, error)); ok { return returnFunc(ctx, in, opts...) } if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.ListRoleAssignmentsFilteredRequest, ...client.CallOption) *v0.ListRoleAssignmentsResponse); ok { r0 = returnFunc(ctx, in, opts...) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*v0.ListRoleAssignmentsResponse) } } if returnFunc, ok := ret.Get(1).(func(context.Context, *v0.ListRoleAssignmentsFilteredRequest, ...client.CallOption) error); ok { r1 = returnFunc(ctx, in, opts...) } else { r1 = ret.Error(1) } return r0, r1 } // RoleService_ListRoleAssignmentsFiltered_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListRoleAssignmentsFiltered' type RoleService_ListRoleAssignmentsFiltered_Call struct { *mock.Call } // ListRoleAssignmentsFiltered is a helper method to define mock.On call // - ctx context.Context // - in *v0.ListRoleAssignmentsFilteredRequest // - opts ...client.CallOption func (_e *RoleService_Expecter) ListRoleAssignmentsFiltered(ctx interface{}, in interface{}, opts ...interface{}) *RoleService_ListRoleAssignmentsFiltered_Call { return &RoleService_ListRoleAssignmentsFiltered_Call{Call: _e.mock.On("ListRoleAssignmentsFiltered", append([]interface{}{ctx, in}, opts...)...)} } func (_c *RoleService_ListRoleAssignmentsFiltered_Call) Run(run func(ctx context.Context, in *v0.ListRoleAssignmentsFilteredRequest, opts ...client.CallOption)) *RoleService_ListRoleAssignmentsFiltered_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 *v0.ListRoleAssignmentsFilteredRequest if args[1] != nil { arg1 = args[1].(*v0.ListRoleAssignmentsFilteredRequest) } var arg2 []client.CallOption var variadicArgs []client.CallOption if len(args) > 2 { variadicArgs = args[2].([]client.CallOption) } arg2 = variadicArgs run( arg0, arg1, arg2..., ) }) return _c } func (_c *RoleService_ListRoleAssignmentsFiltered_Call) Return(listRoleAssignmentsResponse *v0.ListRoleAssignmentsResponse, err error) *RoleService_ListRoleAssignmentsFiltered_Call { _c.Call.Return(listRoleAssignmentsResponse, err) return _c } func (_c *RoleService_ListRoleAssignmentsFiltered_Call) RunAndReturn(run func(ctx context.Context, in *v0.ListRoleAssignmentsFilteredRequest, opts ...client.CallOption) (*v0.ListRoleAssignmentsResponse, error)) *RoleService_ListRoleAssignmentsFiltered_Call { _c.Call.Return(run) return _c } // ListRoles provides a mock function for the type RoleService func (_mock *RoleService) ListRoles(ctx context.Context, in *v0.ListBundlesRequest, opts ...client.CallOption) (*v0.ListBundlesResponse, error) { var tmpRet mock.Arguments if len(opts) > 0 { tmpRet = _mock.Called(ctx, in, opts) } else { tmpRet = _mock.Called(ctx, in) } ret := tmpRet if len(ret) == 0 { panic("no return value specified for ListRoles") } var r0 *v0.ListBundlesResponse var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.ListBundlesRequest, ...client.CallOption) (*v0.ListBundlesResponse, error)); ok { return returnFunc(ctx, in, opts...) } if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.ListBundlesRequest, ...client.CallOption) *v0.ListBundlesResponse); ok { r0 = returnFunc(ctx, in, opts...) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*v0.ListBundlesResponse) } } if returnFunc, ok := ret.Get(1).(func(context.Context, *v0.ListBundlesRequest, ...client.CallOption) error); ok { r1 = returnFunc(ctx, in, opts...) } else { r1 = ret.Error(1) } return r0, r1 } // RoleService_ListRoles_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListRoles' type RoleService_ListRoles_Call struct { *mock.Call } // ListRoles is a helper method to define mock.On call // - ctx context.Context // - in *v0.ListBundlesRequest // - opts ...client.CallOption func (_e *RoleService_Expecter) ListRoles(ctx interface{}, in interface{}, opts ...interface{}) *RoleService_ListRoles_Call { return &RoleService_ListRoles_Call{Call: _e.mock.On("ListRoles", append([]interface{}{ctx, in}, opts...)...)} } func (_c *RoleService_ListRoles_Call) Run(run func(ctx context.Context, in *v0.ListBundlesRequest, opts ...client.CallOption)) *RoleService_ListRoles_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 *v0.ListBundlesRequest if args[1] != nil { arg1 = args[1].(*v0.ListBundlesRequest) } var arg2 []client.CallOption var variadicArgs []client.CallOption if len(args) > 2 { variadicArgs = args[2].([]client.CallOption) } arg2 = variadicArgs run( arg0, arg1, arg2..., ) }) return _c } func (_c *RoleService_ListRoles_Call) Return(listBundlesResponse *v0.ListBundlesResponse, err error) *RoleService_ListRoles_Call { _c.Call.Return(listBundlesResponse, err) return _c } func (_c *RoleService_ListRoles_Call) RunAndReturn(run func(ctx context.Context, in *v0.ListBundlesRequest, opts ...client.CallOption) (*v0.ListBundlesResponse, error)) *RoleService_ListRoles_Call { _c.Call.Return(run) return _c } // RemoveRoleFromUser provides a mock function for the type RoleService func (_mock *RoleService) RemoveRoleFromUser(ctx context.Context, in *v0.RemoveRoleFromUserRequest, opts ...client.CallOption) (*emptypb.Empty, error) { var tmpRet mock.Arguments if len(opts) > 0 { tmpRet = _mock.Called(ctx, in, opts) } else { tmpRet = _mock.Called(ctx, in) } ret := tmpRet if len(ret) == 0 { panic("no return value specified for RemoveRoleFromUser") } var r0 *emptypb.Empty var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.RemoveRoleFromUserRequest, ...client.CallOption) (*emptypb.Empty, error)); ok { return returnFunc(ctx, in, opts...) } if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.RemoveRoleFromUserRequest, ...client.CallOption) *emptypb.Empty); ok { r0 = returnFunc(ctx, in, opts...) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*emptypb.Empty) } } if returnFunc, ok := ret.Get(1).(func(context.Context, *v0.RemoveRoleFromUserRequest, ...client.CallOption) error); ok { r1 = returnFunc(ctx, in, opts...) } else { r1 = ret.Error(1) } return r0, r1 } // RoleService_RemoveRoleFromUser_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveRoleFromUser' type RoleService_RemoveRoleFromUser_Call struct { *mock.Call } // RemoveRoleFromUser is a helper method to define mock.On call // - ctx context.Context // - in *v0.RemoveRoleFromUserRequest // - opts ...client.CallOption func (_e *RoleService_Expecter) RemoveRoleFromUser(ctx interface{}, in interface{}, opts ...interface{}) *RoleService_RemoveRoleFromUser_Call { return &RoleService_RemoveRoleFromUser_Call{Call: _e.mock.On("RemoveRoleFromUser", append([]interface{}{ctx, in}, opts...)...)} } func (_c *RoleService_RemoveRoleFromUser_Call) Run(run func(ctx context.Context, in *v0.RemoveRoleFromUserRequest, opts ...client.CallOption)) *RoleService_RemoveRoleFromUser_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 *v0.RemoveRoleFromUserRequest if args[1] != nil { arg1 = args[1].(*v0.RemoveRoleFromUserRequest) } var arg2 []client.CallOption var variadicArgs []client.CallOption if len(args) > 2 { variadicArgs = args[2].([]client.CallOption) } arg2 = variadicArgs run( arg0, arg1, arg2..., ) }) return _c } func (_c *RoleService_RemoveRoleFromUser_Call) Return(empty *emptypb.Empty, err error) *RoleService_RemoveRoleFromUser_Call { _c.Call.Return(empty, err) return _c } func (_c *RoleService_RemoveRoleFromUser_Call) RunAndReturn(run func(ctx context.Context, in *v0.RemoveRoleFromUserRequest, opts ...client.CallOption) (*emptypb.Empty, error)) *RoleService_RemoveRoleFromUser_Call { _c.Call.Return(run) return _c }