mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-24 13:58:12 -05:00
314 lines
8.5 KiB
Go
314 lines
8.5 KiB
Go
// Code generated by mockery v2.22.1. DO NOT EDIT.
|
|
|
|
package mocks
|
|
|
|
import (
|
|
context "context"
|
|
|
|
godata "github.com/CiscoM31/godata"
|
|
|
|
libregraph "github.com/owncloud/libre-graph-api-go"
|
|
|
|
mock "github.com/stretchr/testify/mock"
|
|
|
|
url "net/url"
|
|
)
|
|
|
|
// Backend is an autogenerated mock type for the Backend type
|
|
type Backend struct {
|
|
mock.Mock
|
|
}
|
|
|
|
// AddMembersToGroup provides a mock function with given fields: ctx, groupID, memberID
|
|
func (_m *Backend) AddMembersToGroup(ctx context.Context, groupID string, memberID []string) error {
|
|
ret := _m.Called(ctx, groupID, memberID)
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, string, []string) error); ok {
|
|
r0 = rf(ctx, groupID, memberID)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// CreateGroup provides a mock function with given fields: ctx, group
|
|
func (_m *Backend) CreateGroup(ctx context.Context, group libregraph.Group) (*libregraph.Group, error) {
|
|
ret := _m.Called(ctx, group)
|
|
|
|
var r0 *libregraph.Group
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, libregraph.Group) (*libregraph.Group, error)); ok {
|
|
return rf(ctx, group)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(context.Context, libregraph.Group) *libregraph.Group); ok {
|
|
r0 = rf(ctx, group)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*libregraph.Group)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(context.Context, libregraph.Group) error); ok {
|
|
r1 = rf(ctx, group)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// CreateUser provides a mock function with given fields: ctx, user
|
|
func (_m *Backend) CreateUser(ctx context.Context, user libregraph.User) (*libregraph.User, error) {
|
|
ret := _m.Called(ctx, user)
|
|
|
|
var r0 *libregraph.User
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, libregraph.User) (*libregraph.User, error)); ok {
|
|
return rf(ctx, user)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(context.Context, libregraph.User) *libregraph.User); ok {
|
|
r0 = rf(ctx, user)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*libregraph.User)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(context.Context, libregraph.User) error); ok {
|
|
r1 = rf(ctx, user)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// DeleteGroup provides a mock function with given fields: ctx, id
|
|
func (_m *Backend) DeleteGroup(ctx context.Context, id string) error {
|
|
ret := _m.Called(ctx, id)
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, string) error); ok {
|
|
r0 = rf(ctx, id)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// DeleteUser provides a mock function with given fields: ctx, nameOrID
|
|
func (_m *Backend) DeleteUser(ctx context.Context, nameOrID string) error {
|
|
ret := _m.Called(ctx, nameOrID)
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, string) error); ok {
|
|
r0 = rf(ctx, nameOrID)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// GetGroup provides a mock function with given fields: ctx, nameOrID, queryParam
|
|
func (_m *Backend) GetGroup(ctx context.Context, nameOrID string, queryParam url.Values) (*libregraph.Group, error) {
|
|
ret := _m.Called(ctx, nameOrID, queryParam)
|
|
|
|
var r0 *libregraph.Group
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, string, url.Values) (*libregraph.Group, error)); ok {
|
|
return rf(ctx, nameOrID, queryParam)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(context.Context, string, url.Values) *libregraph.Group); ok {
|
|
r0 = rf(ctx, nameOrID, queryParam)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*libregraph.Group)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(context.Context, string, url.Values) error); ok {
|
|
r1 = rf(ctx, nameOrID, queryParam)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// GetGroupMembers provides a mock function with given fields: ctx, id, oreq
|
|
func (_m *Backend) GetGroupMembers(ctx context.Context, id string, oreq *godata.GoDataRequest) ([]*libregraph.User, error) {
|
|
ret := _m.Called(ctx, id, oreq)
|
|
|
|
var r0 []*libregraph.User
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, string, *godata.GoDataRequest) ([]*libregraph.User, error)); ok {
|
|
return rf(ctx, id, oreq)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(context.Context, string, *godata.GoDataRequest) []*libregraph.User); ok {
|
|
r0 = rf(ctx, id, oreq)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).([]*libregraph.User)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(context.Context, string, *godata.GoDataRequest) error); ok {
|
|
r1 = rf(ctx, id, oreq)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// GetGroups provides a mock function with given fields: ctx, queryParam
|
|
func (_m *Backend) GetGroups(ctx context.Context, queryParam url.Values) ([]*libregraph.Group, error) {
|
|
ret := _m.Called(ctx, queryParam)
|
|
|
|
var r0 []*libregraph.Group
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, url.Values) ([]*libregraph.Group, error)); ok {
|
|
return rf(ctx, queryParam)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(context.Context, url.Values) []*libregraph.Group); ok {
|
|
r0 = rf(ctx, queryParam)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).([]*libregraph.Group)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(context.Context, url.Values) error); ok {
|
|
r1 = rf(ctx, queryParam)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// GetUser provides a mock function with given fields: ctx, nameOrID, oreq
|
|
func (_m *Backend) GetUser(ctx context.Context, nameOrID string, oreq *godata.GoDataRequest) (*libregraph.User, error) {
|
|
ret := _m.Called(ctx, nameOrID, oreq)
|
|
|
|
var r0 *libregraph.User
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, string, *godata.GoDataRequest) (*libregraph.User, error)); ok {
|
|
return rf(ctx, nameOrID, oreq)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(context.Context, string, *godata.GoDataRequest) *libregraph.User); ok {
|
|
r0 = rf(ctx, nameOrID, oreq)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*libregraph.User)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(context.Context, string, *godata.GoDataRequest) error); ok {
|
|
r1 = rf(ctx, nameOrID, oreq)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// GetUsers provides a mock function with given fields: ctx, oreq
|
|
func (_m *Backend) GetUsers(ctx context.Context, oreq *godata.GoDataRequest) ([]*libregraph.User, error) {
|
|
ret := _m.Called(ctx, oreq)
|
|
|
|
var r0 []*libregraph.User
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, *godata.GoDataRequest) ([]*libregraph.User, error)); ok {
|
|
return rf(ctx, oreq)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(context.Context, *godata.GoDataRequest) []*libregraph.User); ok {
|
|
r0 = rf(ctx, oreq)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).([]*libregraph.User)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(context.Context, *godata.GoDataRequest) error); ok {
|
|
r1 = rf(ctx, oreq)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// RemoveMemberFromGroup provides a mock function with given fields: ctx, groupID, memberID
|
|
func (_m *Backend) RemoveMemberFromGroup(ctx context.Context, groupID string, memberID string) error {
|
|
ret := _m.Called(ctx, groupID, memberID)
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, string, string) error); ok {
|
|
r0 = rf(ctx, groupID, memberID)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// UpdateGroupName provides a mock function with given fields: ctx, groupID, groupName
|
|
func (_m *Backend) UpdateGroupName(ctx context.Context, groupID string, groupName string) error {
|
|
ret := _m.Called(ctx, groupID, groupName)
|
|
|
|
var r0 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, string, string) error); ok {
|
|
r0 = rf(ctx, groupID, groupName)
|
|
} else {
|
|
r0 = ret.Error(0)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// UpdateUser provides a mock function with given fields: ctx, nameOrID, user
|
|
func (_m *Backend) UpdateUser(ctx context.Context, nameOrID string, user libregraph.User) (*libregraph.User, error) {
|
|
ret := _m.Called(ctx, nameOrID, user)
|
|
|
|
var r0 *libregraph.User
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, string, libregraph.User) (*libregraph.User, error)); ok {
|
|
return rf(ctx, nameOrID, user)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(context.Context, string, libregraph.User) *libregraph.User); ok {
|
|
r0 = rf(ctx, nameOrID, user)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*libregraph.User)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(context.Context, string, libregraph.User) error); ok {
|
|
r1 = rf(ctx, nameOrID, user)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
type mockConstructorTestingTNewBackend interface {
|
|
mock.TestingT
|
|
Cleanup(func())
|
|
}
|
|
|
|
// NewBackend creates a new instance of Backend. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
|
func NewBackend(t mockConstructorTestingTNewBackend) *Backend {
|
|
mock := &Backend{}
|
|
mock.Mock.Test(t)
|
|
|
|
t.Cleanup(func() { mock.AssertExpectations(t) })
|
|
|
|
return mock
|
|
}
|