// Code generated by mockery v2.53.5. DO NOT EDIT. package mocks import ( context "context" client "go-micro.dev/v4/client" mock "github.com/stretchr/testify/mock" v0 "github.com/owncloud/ocis/v2/protogen/gen/ocis/services/settings/v0" ) // 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 with given fields: ctx, request, opts func (_m *Permissions) GetPermissionByID(ctx context.Context, request *v0.GetPermissionByIDRequest, opts ...client.CallOption) (*v0.GetPermissionByIDResponse, error) { _va := make([]interface{}, len(opts)) for _i := range opts { _va[_i] = opts[_i] } var _ca []interface{} _ca = append(_ca, ctx, request) _ca = append(_ca, _va...) ret := _m.Called(_ca...) if len(ret) == 0 { panic("no return value specified for GetPermissionByID") } var r0 *v0.GetPermissionByIDResponse var r1 error if rf, ok := ret.Get(0).(func(context.Context, *v0.GetPermissionByIDRequest, ...client.CallOption) (*v0.GetPermissionByIDResponse, error)); ok { return rf(ctx, request, opts...) } if rf, ok := ret.Get(0).(func(context.Context, *v0.GetPermissionByIDRequest, ...client.CallOption) *v0.GetPermissionByIDResponse); ok { r0 = rf(ctx, request, opts...) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*v0.GetPermissionByIDResponse) } } if rf, ok := ret.Get(1).(func(context.Context, *v0.GetPermissionByIDRequest, ...client.CallOption) error); ok { r1 = rf(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) { variadicArgs := make([]client.CallOption, len(args)-2) for i, a := range args[2:] { if a != nil { variadicArgs[i] = a.(client.CallOption) } } run(args[0].(context.Context), args[1].(*v0.GetPermissionByIDRequest), variadicArgs...) }) return _c } func (_c *Permissions_GetPermissionByID_Call) Return(_a0 *v0.GetPermissionByIDResponse, _a1 error) *Permissions_GetPermissionByID_Call { _c.Call.Return(_a0, _a1) return _c } func (_c *Permissions_GetPermissionByID_Call) RunAndReturn(run func(context.Context, *v0.GetPermissionByIDRequest, ...client.CallOption) (*v0.GetPermissionByIDResponse, error)) *Permissions_GetPermissionByID_Call { _c.Call.Return(run) return _c } // ListPermissions provides a mock function with given fields: ctx, req, opts func (_m *Permissions) ListPermissions(ctx context.Context, req *v0.ListPermissionsRequest, opts ...client.CallOption) (*v0.ListPermissionsResponse, error) { _va := make([]interface{}, len(opts)) for _i := range opts { _va[_i] = opts[_i] } var _ca []interface{} _ca = append(_ca, ctx, req) _ca = append(_ca, _va...) ret := _m.Called(_ca...) if len(ret) == 0 { panic("no return value specified for ListPermissions") } var r0 *v0.ListPermissionsResponse var r1 error if rf, ok := ret.Get(0).(func(context.Context, *v0.ListPermissionsRequest, ...client.CallOption) (*v0.ListPermissionsResponse, error)); ok { return rf(ctx, req, opts...) } if rf, ok := ret.Get(0).(func(context.Context, *v0.ListPermissionsRequest, ...client.CallOption) *v0.ListPermissionsResponse); ok { r0 = rf(ctx, req, opts...) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*v0.ListPermissionsResponse) } } if rf, ok := ret.Get(1).(func(context.Context, *v0.ListPermissionsRequest, ...client.CallOption) error); ok { r1 = rf(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) { variadicArgs := make([]client.CallOption, len(args)-2) for i, a := range args[2:] { if a != nil { variadicArgs[i] = a.(client.CallOption) } } run(args[0].(context.Context), args[1].(*v0.ListPermissionsRequest), variadicArgs...) }) return _c } func (_c *Permissions_ListPermissions_Call) Return(_a0 *v0.ListPermissionsResponse, _a1 error) *Permissions_ListPermissions_Call { _c.Call.Return(_a0, _a1) return _c } func (_c *Permissions_ListPermissions_Call) RunAndReturn(run func(context.Context, *v0.ListPermissionsRequest, ...client.CallOption) (*v0.ListPermissionsResponse, error)) *Permissions_ListPermissions_Call { _c.Call.Return(run) return _c } // ListPermissionsByResource provides a mock function with given fields: ctx, in, opts func (_m *Permissions) ListPermissionsByResource(ctx context.Context, in *v0.ListPermissionsByResourceRequest, opts ...client.CallOption) (*v0.ListPermissionsByResourceResponse, error) { _va := make([]interface{}, len(opts)) for _i := range opts { _va[_i] = opts[_i] } var _ca []interface{} _ca = append(_ca, ctx, in) _ca = append(_ca, _va...) ret := _m.Called(_ca...) if len(ret) == 0 { panic("no return value specified for ListPermissionsByResource") } var r0 *v0.ListPermissionsByResourceResponse var r1 error if rf, ok := ret.Get(0).(func(context.Context, *v0.ListPermissionsByResourceRequest, ...client.CallOption) (*v0.ListPermissionsByResourceResponse, error)); ok { return rf(ctx, in, opts...) } if rf, ok := ret.Get(0).(func(context.Context, *v0.ListPermissionsByResourceRequest, ...client.CallOption) *v0.ListPermissionsByResourceResponse); ok { r0 = rf(ctx, in, opts...) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*v0.ListPermissionsByResourceResponse) } } if rf, ok := ret.Get(1).(func(context.Context, *v0.ListPermissionsByResourceRequest, ...client.CallOption) error); ok { r1 = rf(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) { variadicArgs := make([]client.CallOption, len(args)-2) for i, a := range args[2:] { if a != nil { variadicArgs[i] = a.(client.CallOption) } } run(args[0].(context.Context), args[1].(*v0.ListPermissionsByResourceRequest), variadicArgs...) }) return _c } func (_c *Permissions_ListPermissionsByResource_Call) Return(_a0 *v0.ListPermissionsByResourceResponse, _a1 error) *Permissions_ListPermissionsByResource_Call { _c.Call.Return(_a0, _a1) return _c } func (_c *Permissions_ListPermissionsByResource_Call) RunAndReturn(run func(context.Context, *v0.ListPermissionsByResourceRequest, ...client.CallOption) (*v0.ListPermissionsByResourceResponse, error)) *Permissions_ListPermissionsByResource_Call { _c.Call.Return(run) return _c } // 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 }