Files
opencloud/services/graph/mocks/permissions.go
06kellyjac 2a3a20693a build: Modify mockery config to work with v3
Maintaining the positioning of the files from v2 to reduce cognitive
load.
Indentation of yaml files now matches `.editorconfig`.
All mock files regenerated.
Added empty `{}` following convention from `mockery init` etc.
Removed directory specification where it would already match.
2025-06-19 16:25:39 +01:00

290 lines
9.9 KiB
Go

// Code generated by mockery; DO NOT EDIT.
// github.com/vektra/mockery
// template: testify
package mocks
import (
"context"
"github.com/opencloud-eu/opencloud/protogen/gen/opencloud/services/settings/v0"
mock "github.com/stretchr/testify/mock"
"go-micro.dev/v4/client"
)
// NewPermissions creates a new instance of Permissions. 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 NewPermissions(t interface {
mock.TestingT
Cleanup(func())
}) *Permissions {
mock := &Permissions{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}
// Permissions is an autogenerated mock type for the Permissions type
type Permissions struct {
mock.Mock
}
type Permissions_Expecter struct {
mock *mock.Mock
}
func (_m *Permissions) EXPECT() *Permissions_Expecter {
return &Permissions_Expecter{mock: &_m.Mock}
}
// GetPermissionByID provides a mock function for the type Permissions
func (_mock *Permissions) GetPermissionByID(ctx context.Context, request *v0.GetPermissionByIDRequest, opts ...client.CallOption) (*v0.GetPermissionByIDResponse, error) {
var tmpRet mock.Arguments
if len(opts) > 0 {
tmpRet = _mock.Called(ctx, request, opts)
} else {
tmpRet = _mock.Called(ctx, request)
}
ret := tmpRet
if len(ret) == 0 {
panic("no return value specified for GetPermissionByID")
}
var r0 *v0.GetPermissionByIDResponse
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.GetPermissionByIDRequest, ...client.CallOption) (*v0.GetPermissionByIDResponse, error)); ok {
return returnFunc(ctx, request, opts...)
}
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.GetPermissionByIDRequest, ...client.CallOption) *v0.GetPermissionByIDResponse); ok {
r0 = returnFunc(ctx, request, opts...)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*v0.GetPermissionByIDResponse)
}
}
if returnFunc, ok := ret.Get(1).(func(context.Context, *v0.GetPermissionByIDRequest, ...client.CallOption) error); ok {
r1 = returnFunc(ctx, request, opts...)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Permissions_GetPermissionByID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPermissionByID'
type Permissions_GetPermissionByID_Call struct {
*mock.Call
}
// GetPermissionByID is a helper method to define mock.On call
// - ctx context.Context
// - request *v0.GetPermissionByIDRequest
// - opts ...client.CallOption
func (_e *Permissions_Expecter) GetPermissionByID(ctx interface{}, request interface{}, opts ...interface{}) *Permissions_GetPermissionByID_Call {
return &Permissions_GetPermissionByID_Call{Call: _e.mock.On("GetPermissionByID",
append([]interface{}{ctx, request}, opts...)...)}
}
func (_c *Permissions_GetPermissionByID_Call) Run(run func(ctx context.Context, request *v0.GetPermissionByIDRequest, opts ...client.CallOption)) *Permissions_GetPermissionByID_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 *v0.GetPermissionByIDRequest
if args[1] != nil {
arg1 = args[1].(*v0.GetPermissionByIDRequest)
}
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 *Permissions_GetPermissionByID_Call) Return(getPermissionByIDResponse *v0.GetPermissionByIDResponse, err error) *Permissions_GetPermissionByID_Call {
_c.Call.Return(getPermissionByIDResponse, err)
return _c
}
func (_c *Permissions_GetPermissionByID_Call) RunAndReturn(run func(ctx context.Context, request *v0.GetPermissionByIDRequest, opts ...client.CallOption) (*v0.GetPermissionByIDResponse, error)) *Permissions_GetPermissionByID_Call {
_c.Call.Return(run)
return _c
}
// ListPermissions provides a mock function for the type Permissions
func (_mock *Permissions) ListPermissions(ctx context.Context, req *v0.ListPermissionsRequest, opts ...client.CallOption) (*v0.ListPermissionsResponse, error) {
var tmpRet mock.Arguments
if len(opts) > 0 {
tmpRet = _mock.Called(ctx, req, opts)
} else {
tmpRet = _mock.Called(ctx, req)
}
ret := tmpRet
if len(ret) == 0 {
panic("no return value specified for ListPermissions")
}
var r0 *v0.ListPermissionsResponse
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.ListPermissionsRequest, ...client.CallOption) (*v0.ListPermissionsResponse, error)); ok {
return returnFunc(ctx, req, opts...)
}
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.ListPermissionsRequest, ...client.CallOption) *v0.ListPermissionsResponse); ok {
r0 = returnFunc(ctx, req, opts...)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*v0.ListPermissionsResponse)
}
}
if returnFunc, ok := ret.Get(1).(func(context.Context, *v0.ListPermissionsRequest, ...client.CallOption) error); ok {
r1 = returnFunc(ctx, req, opts...)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Permissions_ListPermissions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListPermissions'
type Permissions_ListPermissions_Call struct {
*mock.Call
}
// ListPermissions is a helper method to define mock.On call
// - ctx context.Context
// - req *v0.ListPermissionsRequest
// - opts ...client.CallOption
func (_e *Permissions_Expecter) ListPermissions(ctx interface{}, req interface{}, opts ...interface{}) *Permissions_ListPermissions_Call {
return &Permissions_ListPermissions_Call{Call: _e.mock.On("ListPermissions",
append([]interface{}{ctx, req}, opts...)...)}
}
func (_c *Permissions_ListPermissions_Call) Run(run func(ctx context.Context, req *v0.ListPermissionsRequest, opts ...client.CallOption)) *Permissions_ListPermissions_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 *v0.ListPermissionsRequest
if args[1] != nil {
arg1 = args[1].(*v0.ListPermissionsRequest)
}
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 *Permissions_ListPermissions_Call) Return(listPermissionsResponse *v0.ListPermissionsResponse, err error) *Permissions_ListPermissions_Call {
_c.Call.Return(listPermissionsResponse, err)
return _c
}
func (_c *Permissions_ListPermissions_Call) RunAndReturn(run func(ctx context.Context, req *v0.ListPermissionsRequest, opts ...client.CallOption) (*v0.ListPermissionsResponse, error)) *Permissions_ListPermissions_Call {
_c.Call.Return(run)
return _c
}
// ListPermissionsByResource provides a mock function for the type Permissions
func (_mock *Permissions) ListPermissionsByResource(ctx context.Context, in *v0.ListPermissionsByResourceRequest, opts ...client.CallOption) (*v0.ListPermissionsByResourceResponse, 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 ListPermissionsByResource")
}
var r0 *v0.ListPermissionsByResourceResponse
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.ListPermissionsByResourceRequest, ...client.CallOption) (*v0.ListPermissionsByResourceResponse, error)); ok {
return returnFunc(ctx, in, opts...)
}
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.ListPermissionsByResourceRequest, ...client.CallOption) *v0.ListPermissionsByResourceResponse); ok {
r0 = returnFunc(ctx, in, opts...)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*v0.ListPermissionsByResourceResponse)
}
}
if returnFunc, ok := ret.Get(1).(func(context.Context, *v0.ListPermissionsByResourceRequest, ...client.CallOption) error); ok {
r1 = returnFunc(ctx, in, opts...)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Permissions_ListPermissionsByResource_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListPermissionsByResource'
type Permissions_ListPermissionsByResource_Call struct {
*mock.Call
}
// ListPermissionsByResource is a helper method to define mock.On call
// - ctx context.Context
// - in *v0.ListPermissionsByResourceRequest
// - opts ...client.CallOption
func (_e *Permissions_Expecter) ListPermissionsByResource(ctx interface{}, in interface{}, opts ...interface{}) *Permissions_ListPermissionsByResource_Call {
return &Permissions_ListPermissionsByResource_Call{Call: _e.mock.On("ListPermissionsByResource",
append([]interface{}{ctx, in}, opts...)...)}
}
func (_c *Permissions_ListPermissionsByResource_Call) Run(run func(ctx context.Context, in *v0.ListPermissionsByResourceRequest, opts ...client.CallOption)) *Permissions_ListPermissionsByResource_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 *v0.ListPermissionsByResourceRequest
if args[1] != nil {
arg1 = args[1].(*v0.ListPermissionsByResourceRequest)
}
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 *Permissions_ListPermissionsByResource_Call) Return(listPermissionsByResourceResponse *v0.ListPermissionsByResourceResponse, err error) *Permissions_ListPermissionsByResource_Call {
_c.Call.Return(listPermissionsByResourceResponse, err)
return _c
}
func (_c *Permissions_ListPermissionsByResource_Call) RunAndReturn(run func(ctx context.Context, in *v0.ListPermissionsByResourceRequest, opts ...client.CallOption) (*v0.ListPermissionsByResourceResponse, error)) *Permissions_ListPermissionsByResource_Call {
_c.Call.Return(run)
return _c
}