2025-06-10 14:04:57 -04:00
|
|
|
// Code generated by mockery v2.53.4. DO NOT EDIT.
|
2017-10-25 12:33:19 -04:00
|
|
|
|
2018-05-15 16:33:47 -04:00
|
|
|
// Regenerate this file using `make plugin-mocks`.
|
2017-08-16 18:23:38 -04:00
|
|
|
|
2018-05-15 16:33:47 -04:00
|
|
|
package plugintest
|
2017-08-16 18:23:38 -04:00
|
|
|
|
2019-09-03 18:41:52 -04:00
|
|
|
import (
|
2019-10-17 14:57:55 -04:00
|
|
|
io "io"
|
2019-11-04 20:35:58 -05:00
|
|
|
http "net/http"
|
2019-10-17 14:57:55 -04:00
|
|
|
|
2025-06-25 20:37:32 -04:00
|
|
|
logr "github.com/mattermost/logr/v2"
|
|
|
|
|
|
2019-09-03 18:41:52 -04:00
|
|
|
mock "github.com/stretchr/testify/mock"
|
2019-11-04 20:35:58 -05:00
|
|
|
|
2023-06-11 01:24:35 -04:00
|
|
|
model "github.com/mattermost/mattermost/server/public/model"
|
2019-09-03 18:41:52 -04:00
|
|
|
)
|
2017-08-16 18:23:38 -04:00
|
|
|
|
2018-06-25 15:33:13 -04:00
|
|
|
// API is an autogenerated mock type for the API type
|
|
|
|
|
type API struct {
|
2017-08-16 18:23:38 -04:00
|
|
|
mock.Mock
|
2017-11-27 17:23:35 -05:00
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
// AddChannelMember provides a mock function with given fields: channelId, userID
|
|
|
|
|
func (_m *API) AddChannelMember(channelId string, userID string) (*model.ChannelMember, *model.AppError) {
|
|
|
|
|
ret := _m.Called(channelId, userID)
|
2017-08-16 18:23:38 -04:00
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for AddChannelMember")
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-15 16:33:47 -04:00
|
|
|
var r0 *model.ChannelMember
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, string) (*model.ChannelMember, *model.AppError)); ok {
|
|
|
|
|
return rf(channelId, userID)
|
|
|
|
|
}
|
2018-05-15 16:33:47 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(string, string) *model.ChannelMember); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r0 = rf(channelId, userID)
|
2018-05-15 16:33:47 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.ChannelMember)
|
|
|
|
|
}
|
|
|
|
|
}
|
2017-08-16 18:23:38 -04:00
|
|
|
|
2018-05-15 16:33:47 -04:00
|
|
|
if rf, ok := ret.Get(1).(func(string, string) *model.AppError); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r1 = rf(channelId, userID)
|
2018-05-15 16:33:47 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
2017-12-01 12:26:05 -05:00
|
|
|
}
|
2018-05-15 16:33:47 -04:00
|
|
|
|
|
|
|
|
return r0, r1
|
2017-08-16 18:23:38 -04:00
|
|
|
}
|
2017-08-28 15:19:00 -04:00
|
|
|
|
2018-08-20 12:22:08 -04:00
|
|
|
// AddReaction provides a mock function with given fields: reaction
|
|
|
|
|
func (_m *API) AddReaction(reaction *model.Reaction) (*model.Reaction, *model.AppError) {
|
|
|
|
|
ret := _m.Called(reaction)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for AddReaction")
|
|
|
|
|
}
|
|
|
|
|
|
2018-08-20 12:22:08 -04:00
|
|
|
var r0 *model.Reaction
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(*model.Reaction) (*model.Reaction, *model.AppError)); ok {
|
|
|
|
|
return rf(reaction)
|
|
|
|
|
}
|
2018-08-20 12:22:08 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(*model.Reaction) *model.Reaction); ok {
|
|
|
|
|
r0 = rf(reaction)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.Reaction)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(*model.Reaction) *model.AppError); ok {
|
|
|
|
|
r1 = rf(reaction)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
// AddUserToChannel provides a mock function with given fields: channelId, userID, asUserId
|
|
|
|
|
func (_m *API) AddUserToChannel(channelId string, userID string, asUserId string) (*model.ChannelMember, *model.AppError) {
|
|
|
|
|
ret := _m.Called(channelId, userID, asUserId)
|
2019-10-17 19:11:26 -04:00
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for AddUserToChannel")
|
|
|
|
|
}
|
|
|
|
|
|
2019-10-17 19:11:26 -04:00
|
|
|
var r0 *model.ChannelMember
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, string, string) (*model.ChannelMember, *model.AppError)); ok {
|
|
|
|
|
return rf(channelId, userID, asUserId)
|
|
|
|
|
}
|
2019-10-17 19:11:26 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(string, string, string) *model.ChannelMember); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r0 = rf(channelId, userID, asUserId)
|
2019-10-17 19:11:26 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.ChannelMember)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string, string, string) *model.AppError); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r1 = rf(channelId, userID, asUserId)
|
2019-10-17 19:11:26 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
// CopyFileInfos provides a mock function with given fields: userID, fileIds
|
|
|
|
|
func (_m *API) CopyFileInfos(userID string, fileIds []string) ([]string, *model.AppError) {
|
|
|
|
|
ret := _m.Called(userID, fileIds)
|
2018-08-02 10:37:31 -04:00
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for CopyFileInfos")
|
|
|
|
|
}
|
|
|
|
|
|
2018-08-02 10:37:31 -04:00
|
|
|
var r0 []string
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, []string) ([]string, *model.AppError)); ok {
|
|
|
|
|
return rf(userID, fileIds)
|
|
|
|
|
}
|
2018-08-02 10:37:31 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(string, []string) []string); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r0 = rf(userID, fileIds)
|
2018-08-02 10:37:31 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).([]string)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string, []string) *model.AppError); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r1 = rf(userID, fileIds)
|
2018-08-02 10:37:31 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2025-09-11 15:49:14 -04:00
|
|
|
// CountPropertyFields provides a mock function with given fields: groupID, includeDeleted
|
|
|
|
|
func (_m *API) CountPropertyFields(groupID string, includeDeleted bool) (int64, error) {
|
|
|
|
|
ret := _m.Called(groupID, includeDeleted)
|
|
|
|
|
|
|
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for CountPropertyFields")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var r0 int64
|
|
|
|
|
var r1 error
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, bool) (int64, error)); ok {
|
|
|
|
|
return rf(groupID, includeDeleted)
|
|
|
|
|
}
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, bool) int64); ok {
|
|
|
|
|
r0 = rf(groupID, includeDeleted)
|
|
|
|
|
} else {
|
|
|
|
|
r0 = ret.Get(0).(int64)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string, bool) error); ok {
|
|
|
|
|
r1 = rf(groupID, includeDeleted)
|
|
|
|
|
} else {
|
|
|
|
|
r1 = ret.Error(1)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// CountPropertyFieldsForTarget provides a mock function with given fields: groupID, targetType, targetID, includeDeleted
|
|
|
|
|
func (_m *API) CountPropertyFieldsForTarget(groupID string, targetType string, targetID string, includeDeleted bool) (int64, error) {
|
|
|
|
|
ret := _m.Called(groupID, targetType, targetID, includeDeleted)
|
|
|
|
|
|
|
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for CountPropertyFieldsForTarget")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var r0 int64
|
|
|
|
|
var r1 error
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, string, string, bool) (int64, error)); ok {
|
|
|
|
|
return rf(groupID, targetType, targetID, includeDeleted)
|
|
|
|
|
}
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, string, string, bool) int64); ok {
|
|
|
|
|
r0 = rf(groupID, targetType, targetID, includeDeleted)
|
|
|
|
|
} else {
|
|
|
|
|
r0 = ret.Get(0).(int64)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string, string, string, bool) error); ok {
|
|
|
|
|
r1 = rf(groupID, targetType, targetID, includeDeleted)
|
|
|
|
|
} else {
|
|
|
|
|
r1 = ret.Error(1)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
MM-12393 Server side of bot accounts. (#10378)
* bots model, store and api (#9903)
* bots model, store and api
Fixes: MM-13100, MM-13101, MM-13103, MM-13105, MMM-13119
* uncomment tests incorrectly commented, and fix merge issues
* add etags support
* add missing licenses
* remove unused sqlbuilder.go (for now...)
* rejig permissions
* split out READ_BOTS into READ_BOTS and READ_OTHERS_BOTS, the latter
implicitly allowing the former
* make MANAGE_OTHERS_BOTS imply MANAGE_BOTS
* conform to general rest api pattern
* eliminate redundant http.StatusOK
* Update api4/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* s/model.UserFromBotModel/model.UserFromBot/g
* Update model/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* Update model/client4.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* move sessionHasPermissionToManageBot to app/authorization.go
* use api.ApiSessionRequired for createBot
* introduce BOT_DESCRIPTION_MAX_RUNES constant
* MM-13512 Prevent getting a user by email based on privacy settings (#10021)
* MM-13512 Prevent getting a user by email based on privacy settings
* Add additional config settings to tests
* upgrade db to 5.7 (#10019)
* MM-13526 Add validation when setting a user's Locale field (#10022)
* Fix typos (#10024)
* Fixing first user being created with system admin privilages without being explicity specified. (#10014)
* Revert "Support for Embeded chat (#9129)" (#10017)
This reverts commit 3fcecd521a5c6ccfdb52fb4c3fb1f8c6ea528a4e.
* s/DisableBot/UpdateBotActive
* add permissions on upgrade
* Update NOTICE.txt (#10054)
- add new dependency (text)
- handle switch to forked dependency (go-gomail -> go-mail)
- misc copyright owner updates
* avoid leaking bot knowledge without permission
* [GH-6798] added a new api endpoint to get the bulk reactions for posts (#10049)
* 6798 added a new api to get the bulk reactions for posts
* 6798 added the permsission check before getting the reactions
* GH-6798 added a new app function for the new endpoint
* 6798 added a store method to get reactions for multiple posts
* 6798 connected the app function with the new store function
* 6798 fixed the review comments
* MM-13559 Update model.post.is_valid.file_ids.app_error text per report (#10055)
Ticket: https://mattermost.atlassian.net/browse/MM-13559
Report: https://github.com/mattermost/mattermost-server/issues/10023
* Trigger Login Hooks with OAuth (#10061)
* make BotStore.GetAll deterministic even on duplicate CreateAt
* fix spurious TestMuteCommandSpecificChannel test failure
See
https://community-daily.mattermost.com/core/pl/px9p8s3dzbg1pf3ddrm5cr36uw
* fix race in TestExportUserChannels
* TestExportUserChannels: remove SaveMember call, as it is redundant and used to be silently failing anyway
* MM-13117: bot tokens (#10111)
* eliminate redundant Client/AdminClient declarations
* harden TestUpdateChannelScheme to API failures
* eliminate unnecessary config restoration
* minor cleanup
* make TestGenerateMfaSecret config dependency explicit
* TestCreateUserAccessToken for bots
* TestGetUserAccessToken* for bots
* leverage SessionHasPermissionToUserOrBot for user token APIs
* Test(Revoke|Disable|Enable)UserAccessToken
* make EnableUserAccessTokens explicit, so as to not rely on local config.json
* uncomment TestResetPassword, but still skip
* mark assert(Invalid)Token as helper
* fix whitespace issues
* fix mangled comments
* MM-13116: bot plugin api (#10113)
* MM-13117: expose bot API to plugins
This also changes the `CreatorId` column definition to allow for plugin
ids, as the default unless the plugin overrides is to use the plugin id
here. This branch hasn't hit master yet, so no migration needed.
* gofmt issues
* expunge use of BotList in plugin/client API
* introduce model.BotGetOptions
* use botUserId term for clarity
* MM-13129 Adding functionality to deal with orphaned bots (#10238)
* Add way to list orphaned bots.
* Add /assign route to modify ownership of bot accounts.
* Apply suggestions from code review
Co-Authored-By: crspeller <crspeller@gmail.com>
* MM-13120: add IsBot field to returned user objects (#10103)
* MM-13104: forbid bot login (#10251)
* MM-13104: disallow bot login
* fix shadowing
* MM-13136 Disable user bots when user is disabled. (#10293)
* Disable user bots when user is disabled.
* Grammer.
Co-Authored-By: crspeller <crspeller@gmail.com>
* Fixing bot branch for test changes.
* Don't use external dependancies in bot plugin tests.
* Rename bot CreatorId to OwnerId
* Adding ability to re-enable bots
* Fixing IsBot to not attempt to be saved to DB.
* Adding diagnostics and licencing counting for bot accounts.
* Modifying gorp to allow reading of '-' fields.
* Removing unnessisary nil values from UserCountOptions.
* Changing comment to GoDoc format
* Improving user count SQL
* Some improvments from feedback.
* Omit empty on User.IsBot
2019-03-05 10:06:45 -05:00
|
|
|
// CreateBot provides a mock function with given fields: bot
|
|
|
|
|
func (_m *API) CreateBot(bot *model.Bot) (*model.Bot, *model.AppError) {
|
|
|
|
|
ret := _m.Called(bot)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for CreateBot")
|
|
|
|
|
}
|
|
|
|
|
|
MM-12393 Server side of bot accounts. (#10378)
* bots model, store and api (#9903)
* bots model, store and api
Fixes: MM-13100, MM-13101, MM-13103, MM-13105, MMM-13119
* uncomment tests incorrectly commented, and fix merge issues
* add etags support
* add missing licenses
* remove unused sqlbuilder.go (for now...)
* rejig permissions
* split out READ_BOTS into READ_BOTS and READ_OTHERS_BOTS, the latter
implicitly allowing the former
* make MANAGE_OTHERS_BOTS imply MANAGE_BOTS
* conform to general rest api pattern
* eliminate redundant http.StatusOK
* Update api4/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* s/model.UserFromBotModel/model.UserFromBot/g
* Update model/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* Update model/client4.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* move sessionHasPermissionToManageBot to app/authorization.go
* use api.ApiSessionRequired for createBot
* introduce BOT_DESCRIPTION_MAX_RUNES constant
* MM-13512 Prevent getting a user by email based on privacy settings (#10021)
* MM-13512 Prevent getting a user by email based on privacy settings
* Add additional config settings to tests
* upgrade db to 5.7 (#10019)
* MM-13526 Add validation when setting a user's Locale field (#10022)
* Fix typos (#10024)
* Fixing first user being created with system admin privilages without being explicity specified. (#10014)
* Revert "Support for Embeded chat (#9129)" (#10017)
This reverts commit 3fcecd521a5c6ccfdb52fb4c3fb1f8c6ea528a4e.
* s/DisableBot/UpdateBotActive
* add permissions on upgrade
* Update NOTICE.txt (#10054)
- add new dependency (text)
- handle switch to forked dependency (go-gomail -> go-mail)
- misc copyright owner updates
* avoid leaking bot knowledge without permission
* [GH-6798] added a new api endpoint to get the bulk reactions for posts (#10049)
* 6798 added a new api to get the bulk reactions for posts
* 6798 added the permsission check before getting the reactions
* GH-6798 added a new app function for the new endpoint
* 6798 added a store method to get reactions for multiple posts
* 6798 connected the app function with the new store function
* 6798 fixed the review comments
* MM-13559 Update model.post.is_valid.file_ids.app_error text per report (#10055)
Ticket: https://mattermost.atlassian.net/browse/MM-13559
Report: https://github.com/mattermost/mattermost-server/issues/10023
* Trigger Login Hooks with OAuth (#10061)
* make BotStore.GetAll deterministic even on duplicate CreateAt
* fix spurious TestMuteCommandSpecificChannel test failure
See
https://community-daily.mattermost.com/core/pl/px9p8s3dzbg1pf3ddrm5cr36uw
* fix race in TestExportUserChannels
* TestExportUserChannels: remove SaveMember call, as it is redundant and used to be silently failing anyway
* MM-13117: bot tokens (#10111)
* eliminate redundant Client/AdminClient declarations
* harden TestUpdateChannelScheme to API failures
* eliminate unnecessary config restoration
* minor cleanup
* make TestGenerateMfaSecret config dependency explicit
* TestCreateUserAccessToken for bots
* TestGetUserAccessToken* for bots
* leverage SessionHasPermissionToUserOrBot for user token APIs
* Test(Revoke|Disable|Enable)UserAccessToken
* make EnableUserAccessTokens explicit, so as to not rely on local config.json
* uncomment TestResetPassword, but still skip
* mark assert(Invalid)Token as helper
* fix whitespace issues
* fix mangled comments
* MM-13116: bot plugin api (#10113)
* MM-13117: expose bot API to plugins
This also changes the `CreatorId` column definition to allow for plugin
ids, as the default unless the plugin overrides is to use the plugin id
here. This branch hasn't hit master yet, so no migration needed.
* gofmt issues
* expunge use of BotList in plugin/client API
* introduce model.BotGetOptions
* use botUserId term for clarity
* MM-13129 Adding functionality to deal with orphaned bots (#10238)
* Add way to list orphaned bots.
* Add /assign route to modify ownership of bot accounts.
* Apply suggestions from code review
Co-Authored-By: crspeller <crspeller@gmail.com>
* MM-13120: add IsBot field to returned user objects (#10103)
* MM-13104: forbid bot login (#10251)
* MM-13104: disallow bot login
* fix shadowing
* MM-13136 Disable user bots when user is disabled. (#10293)
* Disable user bots when user is disabled.
* Grammer.
Co-Authored-By: crspeller <crspeller@gmail.com>
* Fixing bot branch for test changes.
* Don't use external dependancies in bot plugin tests.
* Rename bot CreatorId to OwnerId
* Adding ability to re-enable bots
* Fixing IsBot to not attempt to be saved to DB.
* Adding diagnostics and licencing counting for bot accounts.
* Modifying gorp to allow reading of '-' fields.
* Removing unnessisary nil values from UserCountOptions.
* Changing comment to GoDoc format
* Improving user count SQL
* Some improvments from feedback.
* Omit empty on User.IsBot
2019-03-05 10:06:45 -05:00
|
|
|
var r0 *model.Bot
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(*model.Bot) (*model.Bot, *model.AppError)); ok {
|
|
|
|
|
return rf(bot)
|
|
|
|
|
}
|
MM-12393 Server side of bot accounts. (#10378)
* bots model, store and api (#9903)
* bots model, store and api
Fixes: MM-13100, MM-13101, MM-13103, MM-13105, MMM-13119
* uncomment tests incorrectly commented, and fix merge issues
* add etags support
* add missing licenses
* remove unused sqlbuilder.go (for now...)
* rejig permissions
* split out READ_BOTS into READ_BOTS and READ_OTHERS_BOTS, the latter
implicitly allowing the former
* make MANAGE_OTHERS_BOTS imply MANAGE_BOTS
* conform to general rest api pattern
* eliminate redundant http.StatusOK
* Update api4/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* s/model.UserFromBotModel/model.UserFromBot/g
* Update model/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* Update model/client4.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* move sessionHasPermissionToManageBot to app/authorization.go
* use api.ApiSessionRequired for createBot
* introduce BOT_DESCRIPTION_MAX_RUNES constant
* MM-13512 Prevent getting a user by email based on privacy settings (#10021)
* MM-13512 Prevent getting a user by email based on privacy settings
* Add additional config settings to tests
* upgrade db to 5.7 (#10019)
* MM-13526 Add validation when setting a user's Locale field (#10022)
* Fix typos (#10024)
* Fixing first user being created with system admin privilages without being explicity specified. (#10014)
* Revert "Support for Embeded chat (#9129)" (#10017)
This reverts commit 3fcecd521a5c6ccfdb52fb4c3fb1f8c6ea528a4e.
* s/DisableBot/UpdateBotActive
* add permissions on upgrade
* Update NOTICE.txt (#10054)
- add new dependency (text)
- handle switch to forked dependency (go-gomail -> go-mail)
- misc copyright owner updates
* avoid leaking bot knowledge without permission
* [GH-6798] added a new api endpoint to get the bulk reactions for posts (#10049)
* 6798 added a new api to get the bulk reactions for posts
* 6798 added the permsission check before getting the reactions
* GH-6798 added a new app function for the new endpoint
* 6798 added a store method to get reactions for multiple posts
* 6798 connected the app function with the new store function
* 6798 fixed the review comments
* MM-13559 Update model.post.is_valid.file_ids.app_error text per report (#10055)
Ticket: https://mattermost.atlassian.net/browse/MM-13559
Report: https://github.com/mattermost/mattermost-server/issues/10023
* Trigger Login Hooks with OAuth (#10061)
* make BotStore.GetAll deterministic even on duplicate CreateAt
* fix spurious TestMuteCommandSpecificChannel test failure
See
https://community-daily.mattermost.com/core/pl/px9p8s3dzbg1pf3ddrm5cr36uw
* fix race in TestExportUserChannels
* TestExportUserChannels: remove SaveMember call, as it is redundant and used to be silently failing anyway
* MM-13117: bot tokens (#10111)
* eliminate redundant Client/AdminClient declarations
* harden TestUpdateChannelScheme to API failures
* eliminate unnecessary config restoration
* minor cleanup
* make TestGenerateMfaSecret config dependency explicit
* TestCreateUserAccessToken for bots
* TestGetUserAccessToken* for bots
* leverage SessionHasPermissionToUserOrBot for user token APIs
* Test(Revoke|Disable|Enable)UserAccessToken
* make EnableUserAccessTokens explicit, so as to not rely on local config.json
* uncomment TestResetPassword, but still skip
* mark assert(Invalid)Token as helper
* fix whitespace issues
* fix mangled comments
* MM-13116: bot plugin api (#10113)
* MM-13117: expose bot API to plugins
This also changes the `CreatorId` column definition to allow for plugin
ids, as the default unless the plugin overrides is to use the plugin id
here. This branch hasn't hit master yet, so no migration needed.
* gofmt issues
* expunge use of BotList in plugin/client API
* introduce model.BotGetOptions
* use botUserId term for clarity
* MM-13129 Adding functionality to deal with orphaned bots (#10238)
* Add way to list orphaned bots.
* Add /assign route to modify ownership of bot accounts.
* Apply suggestions from code review
Co-Authored-By: crspeller <crspeller@gmail.com>
* MM-13120: add IsBot field to returned user objects (#10103)
* MM-13104: forbid bot login (#10251)
* MM-13104: disallow bot login
* fix shadowing
* MM-13136 Disable user bots when user is disabled. (#10293)
* Disable user bots when user is disabled.
* Grammer.
Co-Authored-By: crspeller <crspeller@gmail.com>
* Fixing bot branch for test changes.
* Don't use external dependancies in bot plugin tests.
* Rename bot CreatorId to OwnerId
* Adding ability to re-enable bots
* Fixing IsBot to not attempt to be saved to DB.
* Adding diagnostics and licencing counting for bot accounts.
* Modifying gorp to allow reading of '-' fields.
* Removing unnessisary nil values from UserCountOptions.
* Changing comment to GoDoc format
* Improving user count SQL
* Some improvments from feedback.
* Omit empty on User.IsBot
2019-03-05 10:06:45 -05:00
|
|
|
if rf, ok := ret.Get(0).(func(*model.Bot) *model.Bot); ok {
|
|
|
|
|
r0 = rf(bot)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.Bot)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(*model.Bot) *model.AppError); ok {
|
|
|
|
|
r1 = rf(bot)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-15 16:33:47 -04:00
|
|
|
// CreateChannel provides a mock function with given fields: channel
|
2018-06-25 15:33:13 -04:00
|
|
|
func (_m *API) CreateChannel(channel *model.Channel) (*model.Channel, *model.AppError) {
|
2018-05-15 16:33:47 -04:00
|
|
|
ret := _m.Called(channel)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for CreateChannel")
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-15 16:33:47 -04:00
|
|
|
var r0 *model.Channel
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(*model.Channel) (*model.Channel, *model.AppError)); ok {
|
|
|
|
|
return rf(channel)
|
|
|
|
|
}
|
2018-05-15 16:33:47 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(*model.Channel) *model.Channel); ok {
|
|
|
|
|
r0 = rf(channel)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.Channel)
|
|
|
|
|
}
|
2017-12-08 14:55:41 -05:00
|
|
|
}
|
|
|
|
|
|
2018-05-15 16:33:47 -04:00
|
|
|
if rf, ok := ret.Get(1).(func(*model.Channel) *model.AppError); ok {
|
|
|
|
|
r1 = rf(channel)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
2017-12-08 14:55:41 -05:00
|
|
|
}
|
2018-05-15 16:33:47 -04:00
|
|
|
|
|
|
|
|
return r0, r1
|
2017-12-08 14:55:41 -05:00
|
|
|
}
|
|
|
|
|
|
2021-06-25 12:52:09 -04:00
|
|
|
// CreateChannelSidebarCategory provides a mock function with given fields: userID, teamID, newCategory
|
|
|
|
|
func (_m *API) CreateChannelSidebarCategory(userID string, teamID string, newCategory *model.SidebarCategoryWithChannels) (*model.SidebarCategoryWithChannels, *model.AppError) {
|
|
|
|
|
ret := _m.Called(userID, teamID, newCategory)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for CreateChannelSidebarCategory")
|
|
|
|
|
}
|
|
|
|
|
|
2021-06-25 12:52:09 -04:00
|
|
|
var r0 *model.SidebarCategoryWithChannels
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, string, *model.SidebarCategoryWithChannels) (*model.SidebarCategoryWithChannels, *model.AppError)); ok {
|
|
|
|
|
return rf(userID, teamID, newCategory)
|
|
|
|
|
}
|
2021-06-25 12:52:09 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(string, string, *model.SidebarCategoryWithChannels) *model.SidebarCategoryWithChannels); ok {
|
|
|
|
|
r0 = rf(userID, teamID, newCategory)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.SidebarCategoryWithChannels)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string, string, *model.SidebarCategoryWithChannels) *model.AppError); ok {
|
|
|
|
|
r1 = rf(userID, teamID, newCategory)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2020-07-31 11:40:15 -04:00
|
|
|
// CreateCommand provides a mock function with given fields: cmd
|
|
|
|
|
func (_m *API) CreateCommand(cmd *model.Command) (*model.Command, error) {
|
|
|
|
|
ret := _m.Called(cmd)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for CreateCommand")
|
|
|
|
|
}
|
|
|
|
|
|
2020-07-31 11:40:15 -04:00
|
|
|
var r0 *model.Command
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 error
|
|
|
|
|
if rf, ok := ret.Get(0).(func(*model.Command) (*model.Command, error)); ok {
|
|
|
|
|
return rf(cmd)
|
|
|
|
|
}
|
2020-07-31 11:40:15 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(*model.Command) *model.Command); ok {
|
|
|
|
|
r0 = rf(cmd)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.Command)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(*model.Command) error); ok {
|
|
|
|
|
r1 = rf(cmd)
|
|
|
|
|
} else {
|
|
|
|
|
r1 = ret.Error(1)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2025-05-21 14:44:34 -04:00
|
|
|
// CreateDefaultSyncableMemberships provides a mock function with given fields: params
|
|
|
|
|
func (_m *API) CreateDefaultSyncableMemberships(params model.CreateDefaultMembershipParams) *model.AppError {
|
|
|
|
|
ret := _m.Called(params)
|
|
|
|
|
|
|
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for CreateDefaultSyncableMemberships")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var r0 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(model.CreateDefaultMembershipParams) *model.AppError); ok {
|
|
|
|
|
r0 = rf(params)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0
|
|
|
|
|
}
|
|
|
|
|
|
2025-03-13 12:00:15 -04:00
|
|
|
// CreateGroup provides a mock function with given fields: group
|
|
|
|
|
func (_m *API) CreateGroup(group *model.Group) (*model.Group, *model.AppError) {
|
|
|
|
|
ret := _m.Called(group)
|
|
|
|
|
|
|
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for CreateGroup")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var r0 *model.Group
|
|
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(*model.Group) (*model.Group, *model.AppError)); ok {
|
|
|
|
|
return rf(group)
|
|
|
|
|
}
|
|
|
|
|
if rf, ok := ret.Get(0).(func(*model.Group) *model.Group); ok {
|
|
|
|
|
r0 = rf(group)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.Group)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(*model.Group) *model.AppError); ok {
|
|
|
|
|
r1 = rf(group)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2021-07-14 09:08:22 -04:00
|
|
|
// CreateOAuthApp provides a mock function with given fields: app
|
|
|
|
|
func (_m *API) CreateOAuthApp(app *model.OAuthApp) (*model.OAuthApp, *model.AppError) {
|
|
|
|
|
ret := _m.Called(app)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for CreateOAuthApp")
|
|
|
|
|
}
|
|
|
|
|
|
2021-07-14 09:08:22 -04:00
|
|
|
var r0 *model.OAuthApp
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(*model.OAuthApp) (*model.OAuthApp, *model.AppError)); ok {
|
|
|
|
|
return rf(app)
|
|
|
|
|
}
|
2021-07-14 09:08:22 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(*model.OAuthApp) *model.OAuthApp); ok {
|
|
|
|
|
r0 = rf(app)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.OAuthApp)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(*model.OAuthApp) *model.AppError); ok {
|
|
|
|
|
r1 = rf(app)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-15 16:33:47 -04:00
|
|
|
// CreatePost provides a mock function with given fields: post
|
2018-06-25 15:33:13 -04:00
|
|
|
func (_m *API) CreatePost(post *model.Post) (*model.Post, *model.AppError) {
|
2018-05-15 16:33:47 -04:00
|
|
|
ret := _m.Called(post)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for CreatePost")
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-15 16:33:47 -04:00
|
|
|
var r0 *model.Post
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(*model.Post) (*model.Post, *model.AppError)); ok {
|
|
|
|
|
return rf(post)
|
|
|
|
|
}
|
2018-05-15 16:33:47 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(*model.Post) *model.Post); ok {
|
|
|
|
|
r0 = rf(post)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.Post)
|
|
|
|
|
}
|
2017-08-28 15:19:00 -04:00
|
|
|
}
|
2017-09-21 15:00:14 -04:00
|
|
|
|
2018-05-15 16:33:47 -04:00
|
|
|
if rf, ok := ret.Get(1).(func(*model.Post) *model.AppError); ok {
|
|
|
|
|
r1 = rf(post)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
2017-09-21 15:00:14 -04:00
|
|
|
}
|
2018-05-15 16:33:47 -04:00
|
|
|
|
|
|
|
|
return r0, r1
|
2017-09-21 15:00:14 -04:00
|
|
|
}
|
|
|
|
|
|
2025-06-10 19:10:28 -04:00
|
|
|
// CreatePropertyField provides a mock function with given fields: field
|
|
|
|
|
func (_m *API) CreatePropertyField(field *model.PropertyField) (*model.PropertyField, error) {
|
|
|
|
|
ret := _m.Called(field)
|
|
|
|
|
|
|
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for CreatePropertyField")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var r0 *model.PropertyField
|
|
|
|
|
var r1 error
|
|
|
|
|
if rf, ok := ret.Get(0).(func(*model.PropertyField) (*model.PropertyField, error)); ok {
|
|
|
|
|
return rf(field)
|
|
|
|
|
}
|
|
|
|
|
if rf, ok := ret.Get(0).(func(*model.PropertyField) *model.PropertyField); ok {
|
|
|
|
|
r0 = rf(field)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.PropertyField)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(*model.PropertyField) error); ok {
|
|
|
|
|
r1 = rf(field)
|
|
|
|
|
} else {
|
|
|
|
|
r1 = ret.Error(1)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// CreatePropertyValue provides a mock function with given fields: value
|
|
|
|
|
func (_m *API) CreatePropertyValue(value *model.PropertyValue) (*model.PropertyValue, error) {
|
|
|
|
|
ret := _m.Called(value)
|
|
|
|
|
|
|
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for CreatePropertyValue")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var r0 *model.PropertyValue
|
|
|
|
|
var r1 error
|
|
|
|
|
if rf, ok := ret.Get(0).(func(*model.PropertyValue) (*model.PropertyValue, error)); ok {
|
|
|
|
|
return rf(value)
|
|
|
|
|
}
|
|
|
|
|
if rf, ok := ret.Get(0).(func(*model.PropertyValue) *model.PropertyValue); ok {
|
|
|
|
|
r0 = rf(value)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.PropertyValue)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(*model.PropertyValue) error); ok {
|
|
|
|
|
r1 = rf(value)
|
|
|
|
|
} else {
|
|
|
|
|
r1 = ret.Error(1)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2021-11-16 09:08:20 -05:00
|
|
|
// CreateSession provides a mock function with given fields: session
|
|
|
|
|
func (_m *API) CreateSession(session *model.Session) (*model.Session, *model.AppError) {
|
|
|
|
|
ret := _m.Called(session)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for CreateSession")
|
|
|
|
|
}
|
|
|
|
|
|
2021-11-16 09:08:20 -05:00
|
|
|
var r0 *model.Session
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(*model.Session) (*model.Session, *model.AppError)); ok {
|
|
|
|
|
return rf(session)
|
|
|
|
|
}
|
2021-11-16 09:08:20 -05:00
|
|
|
if rf, ok := ret.Get(0).(func(*model.Session) *model.Session); ok {
|
|
|
|
|
r0 = rf(session)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.Session)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(*model.Session) *model.AppError); ok {
|
|
|
|
|
r1 = rf(session)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-15 16:33:47 -04:00
|
|
|
// CreateTeam provides a mock function with given fields: team
|
2018-06-25 15:33:13 -04:00
|
|
|
func (_m *API) CreateTeam(team *model.Team) (*model.Team, *model.AppError) {
|
2018-05-15 16:33:47 -04:00
|
|
|
ret := _m.Called(team)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for CreateTeam")
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-15 16:33:47 -04:00
|
|
|
var r0 *model.Team
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(*model.Team) (*model.Team, *model.AppError)); ok {
|
|
|
|
|
return rf(team)
|
|
|
|
|
}
|
2018-05-15 16:33:47 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(*model.Team) *model.Team); ok {
|
|
|
|
|
r0 = rf(team)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.Team)
|
|
|
|
|
}
|
2017-09-21 15:00:14 -04:00
|
|
|
}
|
|
|
|
|
|
2018-05-15 16:33:47 -04:00
|
|
|
if rf, ok := ret.Get(1).(func(*model.Team) *model.AppError); ok {
|
|
|
|
|
r1 = rf(team)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
2017-09-21 15:00:14 -04:00
|
|
|
}
|
2018-05-15 16:33:47 -04:00
|
|
|
|
|
|
|
|
return r0, r1
|
2017-08-28 15:19:00 -04:00
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
// CreateTeamMember provides a mock function with given fields: teamID, userID
|
|
|
|
|
func (_m *API) CreateTeamMember(teamID string, userID string) (*model.TeamMember, *model.AppError) {
|
|
|
|
|
ret := _m.Called(teamID, userID)
|
2018-07-06 18:32:55 -04:00
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for CreateTeamMember")
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-06 18:32:55 -04:00
|
|
|
var r0 *model.TeamMember
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, string) (*model.TeamMember, *model.AppError)); ok {
|
|
|
|
|
return rf(teamID, userID)
|
|
|
|
|
}
|
2018-07-06 18:32:55 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(string, string) *model.TeamMember); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r0 = rf(teamID, userID)
|
2018-07-06 18:32:55 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.TeamMember)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string, string) *model.AppError); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r1 = rf(teamID, userID)
|
2018-07-06 18:32:55 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
// CreateTeamMembers provides a mock function with given fields: teamID, userIds, requestorId
|
|
|
|
|
func (_m *API) CreateTeamMembers(teamID string, userIds []string, requestorId string) ([]*model.TeamMember, *model.AppError) {
|
|
|
|
|
ret := _m.Called(teamID, userIds, requestorId)
|
2018-07-06 18:32:55 -04:00
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for CreateTeamMembers")
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-06 18:32:55 -04:00
|
|
|
var r0 []*model.TeamMember
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, []string, string) ([]*model.TeamMember, *model.AppError)); ok {
|
|
|
|
|
return rf(teamID, userIds, requestorId)
|
|
|
|
|
}
|
2018-07-06 18:32:55 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(string, []string, string) []*model.TeamMember); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r0 = rf(teamID, userIds, requestorId)
|
2018-07-06 18:32:55 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).([]*model.TeamMember)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string, []string, string) *model.AppError); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r1 = rf(teamID, userIds, requestorId)
|
2018-07-06 18:32:55 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
// CreateTeamMembersGracefully provides a mock function with given fields: teamID, userIds, requestorId
|
|
|
|
|
func (_m *API) CreateTeamMembersGracefully(teamID string, userIds []string, requestorId string) ([]*model.TeamMemberWithError, *model.AppError) {
|
|
|
|
|
ret := _m.Called(teamID, userIds, requestorId)
|
2020-01-14 08:29:50 -05:00
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for CreateTeamMembersGracefully")
|
|
|
|
|
}
|
|
|
|
|
|
2020-01-14 08:29:50 -05:00
|
|
|
var r0 []*model.TeamMemberWithError
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, []string, string) ([]*model.TeamMemberWithError, *model.AppError)); ok {
|
|
|
|
|
return rf(teamID, userIds, requestorId)
|
|
|
|
|
}
|
2020-01-14 08:29:50 -05:00
|
|
|
if rf, ok := ret.Get(0).(func(string, []string, string) []*model.TeamMemberWithError); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r0 = rf(teamID, userIds, requestorId)
|
2020-01-14 08:29:50 -05:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).([]*model.TeamMemberWithError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string, []string, string) *model.AppError); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r1 = rf(teamID, userIds, requestorId)
|
2020-01-14 08:29:50 -05:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-22 16:26:22 -05:00
|
|
|
// CreateUploadSession provides a mock function with given fields: us
|
|
|
|
|
func (_m *API) CreateUploadSession(us *model.UploadSession) (*model.UploadSession, error) {
|
|
|
|
|
ret := _m.Called(us)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for CreateUploadSession")
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-22 16:26:22 -05:00
|
|
|
var r0 *model.UploadSession
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 error
|
|
|
|
|
if rf, ok := ret.Get(0).(func(*model.UploadSession) (*model.UploadSession, error)); ok {
|
|
|
|
|
return rf(us)
|
|
|
|
|
}
|
2022-11-22 16:26:22 -05:00
|
|
|
if rf, ok := ret.Get(0).(func(*model.UploadSession) *model.UploadSession); ok {
|
|
|
|
|
r0 = rf(us)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.UploadSession)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(*model.UploadSession) error); ok {
|
|
|
|
|
r1 = rf(us)
|
|
|
|
|
} else {
|
|
|
|
|
r1 = ret.Error(1)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-15 16:33:47 -04:00
|
|
|
// CreateUser provides a mock function with given fields: user
|
2018-06-25 15:33:13 -04:00
|
|
|
func (_m *API) CreateUser(user *model.User) (*model.User, *model.AppError) {
|
2018-05-15 16:33:47 -04:00
|
|
|
ret := _m.Called(user)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for CreateUser")
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-15 16:33:47 -04:00
|
|
|
var r0 *model.User
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(*model.User) (*model.User, *model.AppError)); ok {
|
|
|
|
|
return rf(user)
|
|
|
|
|
}
|
2018-05-15 16:33:47 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(*model.User) *model.User); ok {
|
|
|
|
|
r0 = rf(user)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.User)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(*model.User) *model.AppError); ok {
|
|
|
|
|
r1 = rf(user)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
2017-08-28 15:19:00 -04:00
|
|
|
}
|
2018-05-15 16:33:47 -04:00
|
|
|
|
|
|
|
|
return r0, r1
|
2017-08-28 15:19:00 -04:00
|
|
|
}
|
|
|
|
|
|
2021-07-14 09:08:22 -04:00
|
|
|
// CreateUserAccessToken provides a mock function with given fields: token
|
|
|
|
|
func (_m *API) CreateUserAccessToken(token *model.UserAccessToken) (*model.UserAccessToken, *model.AppError) {
|
|
|
|
|
ret := _m.Called(token)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for CreateUserAccessToken")
|
|
|
|
|
}
|
|
|
|
|
|
2021-07-14 09:08:22 -04:00
|
|
|
var r0 *model.UserAccessToken
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(*model.UserAccessToken) (*model.UserAccessToken, *model.AppError)); ok {
|
|
|
|
|
return rf(token)
|
|
|
|
|
}
|
2021-07-14 09:08:22 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(*model.UserAccessToken) *model.UserAccessToken); ok {
|
|
|
|
|
r0 = rf(token)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.UserAccessToken)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(*model.UserAccessToken) *model.AppError); ok {
|
|
|
|
|
r1 = rf(token)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-15 16:33:47 -04:00
|
|
|
// DeleteChannel provides a mock function with given fields: channelId
|
2018-06-25 15:33:13 -04:00
|
|
|
func (_m *API) DeleteChannel(channelId string) *model.AppError {
|
2018-05-15 16:33:47 -04:00
|
|
|
ret := _m.Called(channelId)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for DeleteChannel")
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-15 16:33:47 -04:00
|
|
|
var r0 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string) *model.AppError); ok {
|
|
|
|
|
r0 = rf(channelId)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.AppError)
|
|
|
|
|
}
|
2017-09-21 15:00:14 -04:00
|
|
|
}
|
2018-05-15 16:33:47 -04:00
|
|
|
|
|
|
|
|
return r0
|
2017-09-21 15:00:14 -04:00
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
// DeleteChannelMember provides a mock function with given fields: channelId, userID
|
|
|
|
|
func (_m *API) DeleteChannelMember(channelId string, userID string) *model.AppError {
|
|
|
|
|
ret := _m.Called(channelId, userID)
|
2018-05-15 16:33:47 -04:00
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for DeleteChannelMember")
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-15 16:33:47 -04:00
|
|
|
var r0 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, string) *model.AppError); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r0 = rf(channelId, userID)
|
2018-05-15 16:33:47 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.AppError)
|
|
|
|
|
}
|
2017-09-21 15:00:14 -04:00
|
|
|
}
|
2018-05-15 16:33:47 -04:00
|
|
|
|
|
|
|
|
return r0
|
2017-09-21 15:00:14 -04:00
|
|
|
}
|
|
|
|
|
|
2020-07-31 11:40:15 -04:00
|
|
|
// DeleteCommand provides a mock function with given fields: commandID
|
|
|
|
|
func (_m *API) DeleteCommand(commandID string) error {
|
|
|
|
|
ret := _m.Called(commandID)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for DeleteCommand")
|
|
|
|
|
}
|
|
|
|
|
|
2020-07-31 11:40:15 -04:00
|
|
|
var r0 error
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string) error); ok {
|
|
|
|
|
r0 = rf(commandID)
|
|
|
|
|
} else {
|
|
|
|
|
r0 = ret.Error(0)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
// DeleteEphemeralPost provides a mock function with given fields: userID, postId
|
|
|
|
|
func (_m *API) DeleteEphemeralPost(userID string, postId string) {
|
|
|
|
|
_m.Called(userID, postId)
|
2019-03-13 12:31:47 -04:00
|
|
|
}
|
|
|
|
|
|
2025-03-13 12:00:15 -04:00
|
|
|
// DeleteGroup provides a mock function with given fields: groupID
|
|
|
|
|
func (_m *API) DeleteGroup(groupID string) (*model.Group, *model.AppError) {
|
|
|
|
|
ret := _m.Called(groupID)
|
|
|
|
|
|
|
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for DeleteGroup")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var r0 *model.Group
|
|
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string) (*model.Group, *model.AppError)); ok {
|
|
|
|
|
return rf(groupID)
|
|
|
|
|
}
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string) *model.Group); ok {
|
|
|
|
|
r0 = rf(groupID)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.Group)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string) *model.AppError); ok {
|
|
|
|
|
r1 = rf(groupID)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-10 14:04:57 -04:00
|
|
|
// DeleteGroupConstrainedMemberships provides a mock function with no fields
|
2025-05-21 14:44:34 -04:00
|
|
|
func (_m *API) DeleteGroupConstrainedMemberships() *model.AppError {
|
|
|
|
|
ret := _m.Called()
|
|
|
|
|
|
|
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for DeleteGroupConstrainedMemberships")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var r0 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func() *model.AppError); ok {
|
|
|
|
|
r0 = rf()
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0
|
|
|
|
|
}
|
|
|
|
|
|
2025-03-13 12:00:15 -04:00
|
|
|
// DeleteGroupMember provides a mock function with given fields: groupID, userID
|
|
|
|
|
func (_m *API) DeleteGroupMember(groupID string, userID string) (*model.GroupMember, *model.AppError) {
|
|
|
|
|
ret := _m.Called(groupID, userID)
|
|
|
|
|
|
|
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for DeleteGroupMember")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var r0 *model.GroupMember
|
|
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, string) (*model.GroupMember, *model.AppError)); ok {
|
|
|
|
|
return rf(groupID, userID)
|
|
|
|
|
}
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, string) *model.GroupMember); ok {
|
|
|
|
|
r0 = rf(groupID, userID)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.GroupMember)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string, string) *model.AppError); ok {
|
|
|
|
|
r1 = rf(groupID, userID)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// DeleteGroupSyncable provides a mock function with given fields: groupID, syncableID, syncableType
|
|
|
|
|
func (_m *API) DeleteGroupSyncable(groupID string, syncableID string, syncableType model.GroupSyncableType) (*model.GroupSyncable, *model.AppError) {
|
|
|
|
|
ret := _m.Called(groupID, syncableID, syncableType)
|
|
|
|
|
|
|
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for DeleteGroupSyncable")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var r0 *model.GroupSyncable
|
|
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, string, model.GroupSyncableType) (*model.GroupSyncable, *model.AppError)); ok {
|
|
|
|
|
return rf(groupID, syncableID, syncableType)
|
|
|
|
|
}
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, string, model.GroupSyncableType) *model.GroupSyncable); ok {
|
|
|
|
|
r0 = rf(groupID, syncableID, syncableType)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.GroupSyncable)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string, string, model.GroupSyncableType) *model.AppError); ok {
|
|
|
|
|
r1 = rf(groupID, syncableID, syncableType)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2021-07-14 09:08:22 -04:00
|
|
|
// DeleteOAuthApp provides a mock function with given fields: appID
|
|
|
|
|
func (_m *API) DeleteOAuthApp(appID string) *model.AppError {
|
|
|
|
|
ret := _m.Called(appID)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for DeleteOAuthApp")
|
|
|
|
|
}
|
|
|
|
|
|
2021-07-14 09:08:22 -04:00
|
|
|
var r0 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string) *model.AppError); ok {
|
|
|
|
|
r0 = rf(appID)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-15 16:33:47 -04:00
|
|
|
// DeletePost provides a mock function with given fields: postId
|
2018-06-25 15:33:13 -04:00
|
|
|
func (_m *API) DeletePost(postId string) *model.AppError {
|
2018-05-15 16:33:47 -04:00
|
|
|
ret := _m.Called(postId)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for DeletePost")
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-15 16:33:47 -04:00
|
|
|
var r0 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string) *model.AppError); ok {
|
|
|
|
|
r0 = rf(postId)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.AppError)
|
|
|
|
|
}
|
2017-09-21 15:00:14 -04:00
|
|
|
}
|
2018-05-15 16:33:47 -04:00
|
|
|
|
|
|
|
|
return r0
|
2017-09-21 15:00:14 -04:00
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
// DeletePreferencesForUser provides a mock function with given fields: userID, preferences
|
|
|
|
|
func (_m *API) DeletePreferencesForUser(userID string, preferences []model.Preference) *model.AppError {
|
|
|
|
|
ret := _m.Called(userID, preferences)
|
2020-05-28 13:15:47 -04:00
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for DeletePreferencesForUser")
|
|
|
|
|
}
|
|
|
|
|
|
2020-05-28 13:15:47 -04:00
|
|
|
var r0 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, []model.Preference) *model.AppError); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r0 = rf(userID, preferences)
|
2020-05-28 13:15:47 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-10 19:10:28 -04:00
|
|
|
// DeletePropertyField provides a mock function with given fields: groupID, fieldID
|
|
|
|
|
func (_m *API) DeletePropertyField(groupID string, fieldID string) error {
|
|
|
|
|
ret := _m.Called(groupID, fieldID)
|
|
|
|
|
|
|
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for DeletePropertyField")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var r0 error
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, string) error); ok {
|
|
|
|
|
r0 = rf(groupID, fieldID)
|
|
|
|
|
} else {
|
|
|
|
|
r0 = ret.Error(0)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// DeletePropertyValue provides a mock function with given fields: groupID, valueID
|
|
|
|
|
func (_m *API) DeletePropertyValue(groupID string, valueID string) error {
|
|
|
|
|
ret := _m.Called(groupID, valueID)
|
|
|
|
|
|
|
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for DeletePropertyValue")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var r0 error
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, string) error); ok {
|
|
|
|
|
r0 = rf(groupID, valueID)
|
|
|
|
|
} else {
|
|
|
|
|
r0 = ret.Error(0)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// DeletePropertyValuesForField provides a mock function with given fields: groupID, fieldID
|
|
|
|
|
func (_m *API) DeletePropertyValuesForField(groupID string, fieldID string) error {
|
|
|
|
|
ret := _m.Called(groupID, fieldID)
|
|
|
|
|
|
|
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for DeletePropertyValuesForField")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var r0 error
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, string) error); ok {
|
|
|
|
|
r0 = rf(groupID, fieldID)
|
|
|
|
|
} else {
|
|
|
|
|
r0 = ret.Error(0)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// DeletePropertyValuesForTarget provides a mock function with given fields: groupID, targetType, targetID
|
|
|
|
|
func (_m *API) DeletePropertyValuesForTarget(groupID string, targetType string, targetID string) error {
|
|
|
|
|
ret := _m.Called(groupID, targetType, targetID)
|
|
|
|
|
|
|
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for DeletePropertyValuesForTarget")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var r0 error
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, string, string) error); ok {
|
|
|
|
|
r0 = rf(groupID, targetType, targetID)
|
|
|
|
|
} else {
|
|
|
|
|
r0 = ret.Error(0)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
// DeleteTeam provides a mock function with given fields: teamID
|
|
|
|
|
func (_m *API) DeleteTeam(teamID string) *model.AppError {
|
|
|
|
|
ret := _m.Called(teamID)
|
2018-05-15 16:33:47 -04:00
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for DeleteTeam")
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-15 16:33:47 -04:00
|
|
|
var r0 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string) *model.AppError); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r0 = rf(teamID)
|
2018-05-15 16:33:47 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.AppError)
|
|
|
|
|
}
|
2017-09-21 15:00:14 -04:00
|
|
|
}
|
2018-05-15 16:33:47 -04:00
|
|
|
|
|
|
|
|
return r0
|
2017-09-21 15:00:14 -04:00
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
// DeleteTeamMember provides a mock function with given fields: teamID, userID, requestorId
|
|
|
|
|
func (_m *API) DeleteTeamMember(teamID string, userID string, requestorId string) *model.AppError {
|
|
|
|
|
ret := _m.Called(teamID, userID, requestorId)
|
2018-07-06 18:32:55 -04:00
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for DeleteTeamMember")
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-06 18:32:55 -04:00
|
|
|
var r0 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, string, string) *model.AppError); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r0 = rf(teamID, userID, requestorId)
|
2018-07-06 18:32:55 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
// DeleteUser provides a mock function with given fields: userID
|
|
|
|
|
func (_m *API) DeleteUser(userID string) *model.AppError {
|
|
|
|
|
ret := _m.Called(userID)
|
2018-05-15 16:33:47 -04:00
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for DeleteUser")
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-15 16:33:47 -04:00
|
|
|
var r0 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string) *model.AppError); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r0 = rf(userID)
|
2018-05-15 16:33:47 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.AppError)
|
|
|
|
|
}
|
2017-09-21 15:00:14 -04:00
|
|
|
}
|
2018-05-15 16:33:47 -04:00
|
|
|
|
|
|
|
|
return r0
|
2017-09-21 15:00:14 -04:00
|
|
|
}
|
|
|
|
|
|
2018-11-08 13:17:07 -05:00
|
|
|
// DisablePlugin provides a mock function with given fields: id
|
|
|
|
|
func (_m *API) DisablePlugin(id string) *model.AppError {
|
|
|
|
|
ret := _m.Called(id)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for DisablePlugin")
|
|
|
|
|
}
|
|
|
|
|
|
2018-11-08 13:17:07 -05:00
|
|
|
var r0 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string) *model.AppError); ok {
|
|
|
|
|
r0 = rf(id)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// EnablePlugin provides a mock function with given fields: id
|
|
|
|
|
func (_m *API) EnablePlugin(id string) *model.AppError {
|
|
|
|
|
ret := _m.Called(id)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for EnablePlugin")
|
|
|
|
|
}
|
|
|
|
|
|
2018-11-08 13:17:07 -05:00
|
|
|
var r0 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string) *model.AppError); ok {
|
|
|
|
|
r0 = rf(id)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0
|
|
|
|
|
}
|
|
|
|
|
|
2022-06-22 04:36:00 -04:00
|
|
|
// EnsureBotUser provides a mock function with given fields: bot
|
|
|
|
|
func (_m *API) EnsureBotUser(bot *model.Bot) (string, error) {
|
|
|
|
|
ret := _m.Called(bot)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for EnsureBotUser")
|
|
|
|
|
}
|
|
|
|
|
|
2022-06-22 04:36:00 -04:00
|
|
|
var r0 string
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 error
|
|
|
|
|
if rf, ok := ret.Get(0).(func(*model.Bot) (string, error)); ok {
|
|
|
|
|
return rf(bot)
|
|
|
|
|
}
|
2022-06-22 04:36:00 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(*model.Bot) string); ok {
|
|
|
|
|
r0 = rf(bot)
|
|
|
|
|
} else {
|
|
|
|
|
r0 = ret.Get(0).(string)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(*model.Bot) error); ok {
|
|
|
|
|
r1 = rf(bot)
|
|
|
|
|
} else {
|
|
|
|
|
r1 = ret.Error(1)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2020-07-07 12:31:03 -04:00
|
|
|
// ExecuteSlashCommand provides a mock function with given fields: commandArgs
|
|
|
|
|
func (_m *API) ExecuteSlashCommand(commandArgs *model.CommandArgs) (*model.CommandResponse, error) {
|
|
|
|
|
ret := _m.Called(commandArgs)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for ExecuteSlashCommand")
|
|
|
|
|
}
|
|
|
|
|
|
2020-07-07 12:31:03 -04:00
|
|
|
var r0 *model.CommandResponse
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 error
|
|
|
|
|
if rf, ok := ret.Get(0).(func(*model.CommandArgs) (*model.CommandResponse, error)); ok {
|
|
|
|
|
return rf(commandArgs)
|
|
|
|
|
}
|
2020-07-07 12:31:03 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(*model.CommandArgs) *model.CommandResponse); ok {
|
|
|
|
|
r0 = rf(commandArgs)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.CommandResponse)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(*model.CommandArgs) error); ok {
|
|
|
|
|
r1 = rf(commandArgs)
|
|
|
|
|
} else {
|
|
|
|
|
r1 = ret.Error(1)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2021-11-16 09:08:20 -05:00
|
|
|
// ExtendSessionExpiry provides a mock function with given fields: sessionID, newExpiry
|
|
|
|
|
func (_m *API) ExtendSessionExpiry(sessionID string, newExpiry int64) *model.AppError {
|
|
|
|
|
ret := _m.Called(sessionID, newExpiry)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for ExtendSessionExpiry")
|
|
|
|
|
}
|
|
|
|
|
|
2021-11-16 09:08:20 -05:00
|
|
|
var r0 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, int64) *model.AppError); ok {
|
|
|
|
|
r0 = rf(sessionID, newExpiry)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0
|
|
|
|
|
}
|
|
|
|
|
|
MM-12393 Server side of bot accounts. (#10378)
* bots model, store and api (#9903)
* bots model, store and api
Fixes: MM-13100, MM-13101, MM-13103, MM-13105, MMM-13119
* uncomment tests incorrectly commented, and fix merge issues
* add etags support
* add missing licenses
* remove unused sqlbuilder.go (for now...)
* rejig permissions
* split out READ_BOTS into READ_BOTS and READ_OTHERS_BOTS, the latter
implicitly allowing the former
* make MANAGE_OTHERS_BOTS imply MANAGE_BOTS
* conform to general rest api pattern
* eliminate redundant http.StatusOK
* Update api4/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* s/model.UserFromBotModel/model.UserFromBot/g
* Update model/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* Update model/client4.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* move sessionHasPermissionToManageBot to app/authorization.go
* use api.ApiSessionRequired for createBot
* introduce BOT_DESCRIPTION_MAX_RUNES constant
* MM-13512 Prevent getting a user by email based on privacy settings (#10021)
* MM-13512 Prevent getting a user by email based on privacy settings
* Add additional config settings to tests
* upgrade db to 5.7 (#10019)
* MM-13526 Add validation when setting a user's Locale field (#10022)
* Fix typos (#10024)
* Fixing first user being created with system admin privilages without being explicity specified. (#10014)
* Revert "Support for Embeded chat (#9129)" (#10017)
This reverts commit 3fcecd521a5c6ccfdb52fb4c3fb1f8c6ea528a4e.
* s/DisableBot/UpdateBotActive
* add permissions on upgrade
* Update NOTICE.txt (#10054)
- add new dependency (text)
- handle switch to forked dependency (go-gomail -> go-mail)
- misc copyright owner updates
* avoid leaking bot knowledge without permission
* [GH-6798] added a new api endpoint to get the bulk reactions for posts (#10049)
* 6798 added a new api to get the bulk reactions for posts
* 6798 added the permsission check before getting the reactions
* GH-6798 added a new app function for the new endpoint
* 6798 added a store method to get reactions for multiple posts
* 6798 connected the app function with the new store function
* 6798 fixed the review comments
* MM-13559 Update model.post.is_valid.file_ids.app_error text per report (#10055)
Ticket: https://mattermost.atlassian.net/browse/MM-13559
Report: https://github.com/mattermost/mattermost-server/issues/10023
* Trigger Login Hooks with OAuth (#10061)
* make BotStore.GetAll deterministic even on duplicate CreateAt
* fix spurious TestMuteCommandSpecificChannel test failure
See
https://community-daily.mattermost.com/core/pl/px9p8s3dzbg1pf3ddrm5cr36uw
* fix race in TestExportUserChannels
* TestExportUserChannels: remove SaveMember call, as it is redundant and used to be silently failing anyway
* MM-13117: bot tokens (#10111)
* eliminate redundant Client/AdminClient declarations
* harden TestUpdateChannelScheme to API failures
* eliminate unnecessary config restoration
* minor cleanup
* make TestGenerateMfaSecret config dependency explicit
* TestCreateUserAccessToken for bots
* TestGetUserAccessToken* for bots
* leverage SessionHasPermissionToUserOrBot for user token APIs
* Test(Revoke|Disable|Enable)UserAccessToken
* make EnableUserAccessTokens explicit, so as to not rely on local config.json
* uncomment TestResetPassword, but still skip
* mark assert(Invalid)Token as helper
* fix whitespace issues
* fix mangled comments
* MM-13116: bot plugin api (#10113)
* MM-13117: expose bot API to plugins
This also changes the `CreatorId` column definition to allow for plugin
ids, as the default unless the plugin overrides is to use the plugin id
here. This branch hasn't hit master yet, so no migration needed.
* gofmt issues
* expunge use of BotList in plugin/client API
* introduce model.BotGetOptions
* use botUserId term for clarity
* MM-13129 Adding functionality to deal with orphaned bots (#10238)
* Add way to list orphaned bots.
* Add /assign route to modify ownership of bot accounts.
* Apply suggestions from code review
Co-Authored-By: crspeller <crspeller@gmail.com>
* MM-13120: add IsBot field to returned user objects (#10103)
* MM-13104: forbid bot login (#10251)
* MM-13104: disallow bot login
* fix shadowing
* MM-13136 Disable user bots when user is disabled. (#10293)
* Disable user bots when user is disabled.
* Grammer.
Co-Authored-By: crspeller <crspeller@gmail.com>
* Fixing bot branch for test changes.
* Don't use external dependancies in bot plugin tests.
* Rename bot CreatorId to OwnerId
* Adding ability to re-enable bots
* Fixing IsBot to not attempt to be saved to DB.
* Adding diagnostics and licencing counting for bot accounts.
* Modifying gorp to allow reading of '-' fields.
* Removing unnessisary nil values from UserCountOptions.
* Changing comment to GoDoc format
* Improving user count SQL
* Some improvments from feedback.
* Omit empty on User.IsBot
2019-03-05 10:06:45 -05:00
|
|
|
// GetBot provides a mock function with given fields: botUserId, includeDeleted
|
|
|
|
|
func (_m *API) GetBot(botUserId string, includeDeleted bool) (*model.Bot, *model.AppError) {
|
|
|
|
|
ret := _m.Called(botUserId, includeDeleted)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetBot")
|
|
|
|
|
}
|
|
|
|
|
|
MM-12393 Server side of bot accounts. (#10378)
* bots model, store and api (#9903)
* bots model, store and api
Fixes: MM-13100, MM-13101, MM-13103, MM-13105, MMM-13119
* uncomment tests incorrectly commented, and fix merge issues
* add etags support
* add missing licenses
* remove unused sqlbuilder.go (for now...)
* rejig permissions
* split out READ_BOTS into READ_BOTS and READ_OTHERS_BOTS, the latter
implicitly allowing the former
* make MANAGE_OTHERS_BOTS imply MANAGE_BOTS
* conform to general rest api pattern
* eliminate redundant http.StatusOK
* Update api4/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* s/model.UserFromBotModel/model.UserFromBot/g
* Update model/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* Update model/client4.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* move sessionHasPermissionToManageBot to app/authorization.go
* use api.ApiSessionRequired for createBot
* introduce BOT_DESCRIPTION_MAX_RUNES constant
* MM-13512 Prevent getting a user by email based on privacy settings (#10021)
* MM-13512 Prevent getting a user by email based on privacy settings
* Add additional config settings to tests
* upgrade db to 5.7 (#10019)
* MM-13526 Add validation when setting a user's Locale field (#10022)
* Fix typos (#10024)
* Fixing first user being created with system admin privilages without being explicity specified. (#10014)
* Revert "Support for Embeded chat (#9129)" (#10017)
This reverts commit 3fcecd521a5c6ccfdb52fb4c3fb1f8c6ea528a4e.
* s/DisableBot/UpdateBotActive
* add permissions on upgrade
* Update NOTICE.txt (#10054)
- add new dependency (text)
- handle switch to forked dependency (go-gomail -> go-mail)
- misc copyright owner updates
* avoid leaking bot knowledge without permission
* [GH-6798] added a new api endpoint to get the bulk reactions for posts (#10049)
* 6798 added a new api to get the bulk reactions for posts
* 6798 added the permsission check before getting the reactions
* GH-6798 added a new app function for the new endpoint
* 6798 added a store method to get reactions for multiple posts
* 6798 connected the app function with the new store function
* 6798 fixed the review comments
* MM-13559 Update model.post.is_valid.file_ids.app_error text per report (#10055)
Ticket: https://mattermost.atlassian.net/browse/MM-13559
Report: https://github.com/mattermost/mattermost-server/issues/10023
* Trigger Login Hooks with OAuth (#10061)
* make BotStore.GetAll deterministic even on duplicate CreateAt
* fix spurious TestMuteCommandSpecificChannel test failure
See
https://community-daily.mattermost.com/core/pl/px9p8s3dzbg1pf3ddrm5cr36uw
* fix race in TestExportUserChannels
* TestExportUserChannels: remove SaveMember call, as it is redundant and used to be silently failing anyway
* MM-13117: bot tokens (#10111)
* eliminate redundant Client/AdminClient declarations
* harden TestUpdateChannelScheme to API failures
* eliminate unnecessary config restoration
* minor cleanup
* make TestGenerateMfaSecret config dependency explicit
* TestCreateUserAccessToken for bots
* TestGetUserAccessToken* for bots
* leverage SessionHasPermissionToUserOrBot for user token APIs
* Test(Revoke|Disable|Enable)UserAccessToken
* make EnableUserAccessTokens explicit, so as to not rely on local config.json
* uncomment TestResetPassword, but still skip
* mark assert(Invalid)Token as helper
* fix whitespace issues
* fix mangled comments
* MM-13116: bot plugin api (#10113)
* MM-13117: expose bot API to plugins
This also changes the `CreatorId` column definition to allow for plugin
ids, as the default unless the plugin overrides is to use the plugin id
here. This branch hasn't hit master yet, so no migration needed.
* gofmt issues
* expunge use of BotList in plugin/client API
* introduce model.BotGetOptions
* use botUserId term for clarity
* MM-13129 Adding functionality to deal with orphaned bots (#10238)
* Add way to list orphaned bots.
* Add /assign route to modify ownership of bot accounts.
* Apply suggestions from code review
Co-Authored-By: crspeller <crspeller@gmail.com>
* MM-13120: add IsBot field to returned user objects (#10103)
* MM-13104: forbid bot login (#10251)
* MM-13104: disallow bot login
* fix shadowing
* MM-13136 Disable user bots when user is disabled. (#10293)
* Disable user bots when user is disabled.
* Grammer.
Co-Authored-By: crspeller <crspeller@gmail.com>
* Fixing bot branch for test changes.
* Don't use external dependancies in bot plugin tests.
* Rename bot CreatorId to OwnerId
* Adding ability to re-enable bots
* Fixing IsBot to not attempt to be saved to DB.
* Adding diagnostics and licencing counting for bot accounts.
* Modifying gorp to allow reading of '-' fields.
* Removing unnessisary nil values from UserCountOptions.
* Changing comment to GoDoc format
* Improving user count SQL
* Some improvments from feedback.
* Omit empty on User.IsBot
2019-03-05 10:06:45 -05:00
|
|
|
var r0 *model.Bot
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, bool) (*model.Bot, *model.AppError)); ok {
|
|
|
|
|
return rf(botUserId, includeDeleted)
|
|
|
|
|
}
|
MM-12393 Server side of bot accounts. (#10378)
* bots model, store and api (#9903)
* bots model, store and api
Fixes: MM-13100, MM-13101, MM-13103, MM-13105, MMM-13119
* uncomment tests incorrectly commented, and fix merge issues
* add etags support
* add missing licenses
* remove unused sqlbuilder.go (for now...)
* rejig permissions
* split out READ_BOTS into READ_BOTS and READ_OTHERS_BOTS, the latter
implicitly allowing the former
* make MANAGE_OTHERS_BOTS imply MANAGE_BOTS
* conform to general rest api pattern
* eliminate redundant http.StatusOK
* Update api4/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* s/model.UserFromBotModel/model.UserFromBot/g
* Update model/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* Update model/client4.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* move sessionHasPermissionToManageBot to app/authorization.go
* use api.ApiSessionRequired for createBot
* introduce BOT_DESCRIPTION_MAX_RUNES constant
* MM-13512 Prevent getting a user by email based on privacy settings (#10021)
* MM-13512 Prevent getting a user by email based on privacy settings
* Add additional config settings to tests
* upgrade db to 5.7 (#10019)
* MM-13526 Add validation when setting a user's Locale field (#10022)
* Fix typos (#10024)
* Fixing first user being created with system admin privilages without being explicity specified. (#10014)
* Revert "Support for Embeded chat (#9129)" (#10017)
This reverts commit 3fcecd521a5c6ccfdb52fb4c3fb1f8c6ea528a4e.
* s/DisableBot/UpdateBotActive
* add permissions on upgrade
* Update NOTICE.txt (#10054)
- add new dependency (text)
- handle switch to forked dependency (go-gomail -> go-mail)
- misc copyright owner updates
* avoid leaking bot knowledge without permission
* [GH-6798] added a new api endpoint to get the bulk reactions for posts (#10049)
* 6798 added a new api to get the bulk reactions for posts
* 6798 added the permsission check before getting the reactions
* GH-6798 added a new app function for the new endpoint
* 6798 added a store method to get reactions for multiple posts
* 6798 connected the app function with the new store function
* 6798 fixed the review comments
* MM-13559 Update model.post.is_valid.file_ids.app_error text per report (#10055)
Ticket: https://mattermost.atlassian.net/browse/MM-13559
Report: https://github.com/mattermost/mattermost-server/issues/10023
* Trigger Login Hooks with OAuth (#10061)
* make BotStore.GetAll deterministic even on duplicate CreateAt
* fix spurious TestMuteCommandSpecificChannel test failure
See
https://community-daily.mattermost.com/core/pl/px9p8s3dzbg1pf3ddrm5cr36uw
* fix race in TestExportUserChannels
* TestExportUserChannels: remove SaveMember call, as it is redundant and used to be silently failing anyway
* MM-13117: bot tokens (#10111)
* eliminate redundant Client/AdminClient declarations
* harden TestUpdateChannelScheme to API failures
* eliminate unnecessary config restoration
* minor cleanup
* make TestGenerateMfaSecret config dependency explicit
* TestCreateUserAccessToken for bots
* TestGetUserAccessToken* for bots
* leverage SessionHasPermissionToUserOrBot for user token APIs
* Test(Revoke|Disable|Enable)UserAccessToken
* make EnableUserAccessTokens explicit, so as to not rely on local config.json
* uncomment TestResetPassword, but still skip
* mark assert(Invalid)Token as helper
* fix whitespace issues
* fix mangled comments
* MM-13116: bot plugin api (#10113)
* MM-13117: expose bot API to plugins
This also changes the `CreatorId` column definition to allow for plugin
ids, as the default unless the plugin overrides is to use the plugin id
here. This branch hasn't hit master yet, so no migration needed.
* gofmt issues
* expunge use of BotList in plugin/client API
* introduce model.BotGetOptions
* use botUserId term for clarity
* MM-13129 Adding functionality to deal with orphaned bots (#10238)
* Add way to list orphaned bots.
* Add /assign route to modify ownership of bot accounts.
* Apply suggestions from code review
Co-Authored-By: crspeller <crspeller@gmail.com>
* MM-13120: add IsBot field to returned user objects (#10103)
* MM-13104: forbid bot login (#10251)
* MM-13104: disallow bot login
* fix shadowing
* MM-13136 Disable user bots when user is disabled. (#10293)
* Disable user bots when user is disabled.
* Grammer.
Co-Authored-By: crspeller <crspeller@gmail.com>
* Fixing bot branch for test changes.
* Don't use external dependancies in bot plugin tests.
* Rename bot CreatorId to OwnerId
* Adding ability to re-enable bots
* Fixing IsBot to not attempt to be saved to DB.
* Adding diagnostics and licencing counting for bot accounts.
* Modifying gorp to allow reading of '-' fields.
* Removing unnessisary nil values from UserCountOptions.
* Changing comment to GoDoc format
* Improving user count SQL
* Some improvments from feedback.
* Omit empty on User.IsBot
2019-03-05 10:06:45 -05:00
|
|
|
if rf, ok := ret.Get(0).(func(string, bool) *model.Bot); ok {
|
|
|
|
|
r0 = rf(botUserId, includeDeleted)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.Bot)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string, bool) *model.AppError); ok {
|
|
|
|
|
r1 = rf(botUserId, includeDeleted)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// GetBots provides a mock function with given fields: options
|
|
|
|
|
func (_m *API) GetBots(options *model.BotGetOptions) ([]*model.Bot, *model.AppError) {
|
|
|
|
|
ret := _m.Called(options)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetBots")
|
|
|
|
|
}
|
|
|
|
|
|
MM-12393 Server side of bot accounts. (#10378)
* bots model, store and api (#9903)
* bots model, store and api
Fixes: MM-13100, MM-13101, MM-13103, MM-13105, MMM-13119
* uncomment tests incorrectly commented, and fix merge issues
* add etags support
* add missing licenses
* remove unused sqlbuilder.go (for now...)
* rejig permissions
* split out READ_BOTS into READ_BOTS and READ_OTHERS_BOTS, the latter
implicitly allowing the former
* make MANAGE_OTHERS_BOTS imply MANAGE_BOTS
* conform to general rest api pattern
* eliminate redundant http.StatusOK
* Update api4/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* s/model.UserFromBotModel/model.UserFromBot/g
* Update model/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* Update model/client4.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* move sessionHasPermissionToManageBot to app/authorization.go
* use api.ApiSessionRequired for createBot
* introduce BOT_DESCRIPTION_MAX_RUNES constant
* MM-13512 Prevent getting a user by email based on privacy settings (#10021)
* MM-13512 Prevent getting a user by email based on privacy settings
* Add additional config settings to tests
* upgrade db to 5.7 (#10019)
* MM-13526 Add validation when setting a user's Locale field (#10022)
* Fix typos (#10024)
* Fixing first user being created with system admin privilages without being explicity specified. (#10014)
* Revert "Support for Embeded chat (#9129)" (#10017)
This reverts commit 3fcecd521a5c6ccfdb52fb4c3fb1f8c6ea528a4e.
* s/DisableBot/UpdateBotActive
* add permissions on upgrade
* Update NOTICE.txt (#10054)
- add new dependency (text)
- handle switch to forked dependency (go-gomail -> go-mail)
- misc copyright owner updates
* avoid leaking bot knowledge without permission
* [GH-6798] added a new api endpoint to get the bulk reactions for posts (#10049)
* 6798 added a new api to get the bulk reactions for posts
* 6798 added the permsission check before getting the reactions
* GH-6798 added a new app function for the new endpoint
* 6798 added a store method to get reactions for multiple posts
* 6798 connected the app function with the new store function
* 6798 fixed the review comments
* MM-13559 Update model.post.is_valid.file_ids.app_error text per report (#10055)
Ticket: https://mattermost.atlassian.net/browse/MM-13559
Report: https://github.com/mattermost/mattermost-server/issues/10023
* Trigger Login Hooks with OAuth (#10061)
* make BotStore.GetAll deterministic even on duplicate CreateAt
* fix spurious TestMuteCommandSpecificChannel test failure
See
https://community-daily.mattermost.com/core/pl/px9p8s3dzbg1pf3ddrm5cr36uw
* fix race in TestExportUserChannels
* TestExportUserChannels: remove SaveMember call, as it is redundant and used to be silently failing anyway
* MM-13117: bot tokens (#10111)
* eliminate redundant Client/AdminClient declarations
* harden TestUpdateChannelScheme to API failures
* eliminate unnecessary config restoration
* minor cleanup
* make TestGenerateMfaSecret config dependency explicit
* TestCreateUserAccessToken for bots
* TestGetUserAccessToken* for bots
* leverage SessionHasPermissionToUserOrBot for user token APIs
* Test(Revoke|Disable|Enable)UserAccessToken
* make EnableUserAccessTokens explicit, so as to not rely on local config.json
* uncomment TestResetPassword, but still skip
* mark assert(Invalid)Token as helper
* fix whitespace issues
* fix mangled comments
* MM-13116: bot plugin api (#10113)
* MM-13117: expose bot API to plugins
This also changes the `CreatorId` column definition to allow for plugin
ids, as the default unless the plugin overrides is to use the plugin id
here. This branch hasn't hit master yet, so no migration needed.
* gofmt issues
* expunge use of BotList in plugin/client API
* introduce model.BotGetOptions
* use botUserId term for clarity
* MM-13129 Adding functionality to deal with orphaned bots (#10238)
* Add way to list orphaned bots.
* Add /assign route to modify ownership of bot accounts.
* Apply suggestions from code review
Co-Authored-By: crspeller <crspeller@gmail.com>
* MM-13120: add IsBot field to returned user objects (#10103)
* MM-13104: forbid bot login (#10251)
* MM-13104: disallow bot login
* fix shadowing
* MM-13136 Disable user bots when user is disabled. (#10293)
* Disable user bots when user is disabled.
* Grammer.
Co-Authored-By: crspeller <crspeller@gmail.com>
* Fixing bot branch for test changes.
* Don't use external dependancies in bot plugin tests.
* Rename bot CreatorId to OwnerId
* Adding ability to re-enable bots
* Fixing IsBot to not attempt to be saved to DB.
* Adding diagnostics and licencing counting for bot accounts.
* Modifying gorp to allow reading of '-' fields.
* Removing unnessisary nil values from UserCountOptions.
* Changing comment to GoDoc format
* Improving user count SQL
* Some improvments from feedback.
* Omit empty on User.IsBot
2019-03-05 10:06:45 -05:00
|
|
|
var r0 []*model.Bot
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(*model.BotGetOptions) ([]*model.Bot, *model.AppError)); ok {
|
|
|
|
|
return rf(options)
|
|
|
|
|
}
|
MM-12393 Server side of bot accounts. (#10378)
* bots model, store and api (#9903)
* bots model, store and api
Fixes: MM-13100, MM-13101, MM-13103, MM-13105, MMM-13119
* uncomment tests incorrectly commented, and fix merge issues
* add etags support
* add missing licenses
* remove unused sqlbuilder.go (for now...)
* rejig permissions
* split out READ_BOTS into READ_BOTS and READ_OTHERS_BOTS, the latter
implicitly allowing the former
* make MANAGE_OTHERS_BOTS imply MANAGE_BOTS
* conform to general rest api pattern
* eliminate redundant http.StatusOK
* Update api4/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* s/model.UserFromBotModel/model.UserFromBot/g
* Update model/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* Update model/client4.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* move sessionHasPermissionToManageBot to app/authorization.go
* use api.ApiSessionRequired for createBot
* introduce BOT_DESCRIPTION_MAX_RUNES constant
* MM-13512 Prevent getting a user by email based on privacy settings (#10021)
* MM-13512 Prevent getting a user by email based on privacy settings
* Add additional config settings to tests
* upgrade db to 5.7 (#10019)
* MM-13526 Add validation when setting a user's Locale field (#10022)
* Fix typos (#10024)
* Fixing first user being created with system admin privilages without being explicity specified. (#10014)
* Revert "Support for Embeded chat (#9129)" (#10017)
This reverts commit 3fcecd521a5c6ccfdb52fb4c3fb1f8c6ea528a4e.
* s/DisableBot/UpdateBotActive
* add permissions on upgrade
* Update NOTICE.txt (#10054)
- add new dependency (text)
- handle switch to forked dependency (go-gomail -> go-mail)
- misc copyright owner updates
* avoid leaking bot knowledge without permission
* [GH-6798] added a new api endpoint to get the bulk reactions for posts (#10049)
* 6798 added a new api to get the bulk reactions for posts
* 6798 added the permsission check before getting the reactions
* GH-6798 added a new app function for the new endpoint
* 6798 added a store method to get reactions for multiple posts
* 6798 connected the app function with the new store function
* 6798 fixed the review comments
* MM-13559 Update model.post.is_valid.file_ids.app_error text per report (#10055)
Ticket: https://mattermost.atlassian.net/browse/MM-13559
Report: https://github.com/mattermost/mattermost-server/issues/10023
* Trigger Login Hooks with OAuth (#10061)
* make BotStore.GetAll deterministic even on duplicate CreateAt
* fix spurious TestMuteCommandSpecificChannel test failure
See
https://community-daily.mattermost.com/core/pl/px9p8s3dzbg1pf3ddrm5cr36uw
* fix race in TestExportUserChannels
* TestExportUserChannels: remove SaveMember call, as it is redundant and used to be silently failing anyway
* MM-13117: bot tokens (#10111)
* eliminate redundant Client/AdminClient declarations
* harden TestUpdateChannelScheme to API failures
* eliminate unnecessary config restoration
* minor cleanup
* make TestGenerateMfaSecret config dependency explicit
* TestCreateUserAccessToken for bots
* TestGetUserAccessToken* for bots
* leverage SessionHasPermissionToUserOrBot for user token APIs
* Test(Revoke|Disable|Enable)UserAccessToken
* make EnableUserAccessTokens explicit, so as to not rely on local config.json
* uncomment TestResetPassword, but still skip
* mark assert(Invalid)Token as helper
* fix whitespace issues
* fix mangled comments
* MM-13116: bot plugin api (#10113)
* MM-13117: expose bot API to plugins
This also changes the `CreatorId` column definition to allow for plugin
ids, as the default unless the plugin overrides is to use the plugin id
here. This branch hasn't hit master yet, so no migration needed.
* gofmt issues
* expunge use of BotList in plugin/client API
* introduce model.BotGetOptions
* use botUserId term for clarity
* MM-13129 Adding functionality to deal with orphaned bots (#10238)
* Add way to list orphaned bots.
* Add /assign route to modify ownership of bot accounts.
* Apply suggestions from code review
Co-Authored-By: crspeller <crspeller@gmail.com>
* MM-13120: add IsBot field to returned user objects (#10103)
* MM-13104: forbid bot login (#10251)
* MM-13104: disallow bot login
* fix shadowing
* MM-13136 Disable user bots when user is disabled. (#10293)
* Disable user bots when user is disabled.
* Grammer.
Co-Authored-By: crspeller <crspeller@gmail.com>
* Fixing bot branch for test changes.
* Don't use external dependancies in bot plugin tests.
* Rename bot CreatorId to OwnerId
* Adding ability to re-enable bots
* Fixing IsBot to not attempt to be saved to DB.
* Adding diagnostics and licencing counting for bot accounts.
* Modifying gorp to allow reading of '-' fields.
* Removing unnessisary nil values from UserCountOptions.
* Changing comment to GoDoc format
* Improving user count SQL
* Some improvments from feedback.
* Omit empty on User.IsBot
2019-03-05 10:06:45 -05:00
|
|
|
if rf, ok := ret.Get(0).(func(*model.BotGetOptions) []*model.Bot); ok {
|
|
|
|
|
r0 = rf(options)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).([]*model.Bot)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(*model.BotGetOptions) *model.AppError); ok {
|
|
|
|
|
r1 = rf(options)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-10 14:04:57 -04:00
|
|
|
// GetBundlePath provides a mock function with no fields
|
2019-03-18 18:01:26 -04:00
|
|
|
func (_m *API) GetBundlePath() (string, error) {
|
|
|
|
|
ret := _m.Called()
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetBundlePath")
|
|
|
|
|
}
|
|
|
|
|
|
2019-03-18 18:01:26 -04:00
|
|
|
var r0 string
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 error
|
|
|
|
|
if rf, ok := ret.Get(0).(func() (string, error)); ok {
|
|
|
|
|
return rf()
|
|
|
|
|
}
|
2019-03-18 18:01:26 -04:00
|
|
|
if rf, ok := ret.Get(0).(func() string); ok {
|
|
|
|
|
r0 = rf()
|
|
|
|
|
} else {
|
|
|
|
|
r0 = ret.Get(0).(string)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func() error); ok {
|
|
|
|
|
r1 = rf()
|
|
|
|
|
} else {
|
|
|
|
|
r1 = ret.Error(1)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-15 16:33:47 -04:00
|
|
|
// GetChannel provides a mock function with given fields: channelId
|
2018-06-25 15:33:13 -04:00
|
|
|
func (_m *API) GetChannel(channelId string) (*model.Channel, *model.AppError) {
|
2018-05-15 16:33:47 -04:00
|
|
|
ret := _m.Called(channelId)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetChannel")
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-15 16:33:47 -04:00
|
|
|
var r0 *model.Channel
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string) (*model.Channel, *model.AppError)); ok {
|
|
|
|
|
return rf(channelId)
|
|
|
|
|
}
|
2018-05-15 16:33:47 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(string) *model.Channel); ok {
|
|
|
|
|
r0 = rf(channelId)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.Channel)
|
|
|
|
|
}
|
2017-09-21 15:00:14 -04:00
|
|
|
}
|
2018-05-15 16:33:47 -04:00
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string) *model.AppError); ok {
|
|
|
|
|
r1 = rf(channelId)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
2017-09-21 15:00:14 -04:00
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
// GetChannelByName provides a mock function with given fields: teamID, name, includeDeleted
|
|
|
|
|
func (_m *API) GetChannelByName(teamID string, name string, includeDeleted bool) (*model.Channel, *model.AppError) {
|
|
|
|
|
ret := _m.Called(teamID, name, includeDeleted)
|
2018-05-15 16:33:47 -04:00
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetChannelByName")
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-15 16:33:47 -04:00
|
|
|
var r0 *model.Channel
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, string, bool) (*model.Channel, *model.AppError)); ok {
|
|
|
|
|
return rf(teamID, name, includeDeleted)
|
|
|
|
|
}
|
2018-07-30 15:06:08 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(string, string, bool) *model.Channel); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r0 = rf(teamID, name, includeDeleted)
|
2018-05-15 16:33:47 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.Channel)
|
|
|
|
|
}
|
2017-09-21 15:00:14 -04:00
|
|
|
}
|
2018-05-15 16:33:47 -04:00
|
|
|
|
2018-07-30 15:06:08 -04:00
|
|
|
if rf, ok := ret.Get(1).(func(string, string, bool) *model.AppError); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r1 = rf(teamID, name, includeDeleted)
|
2018-07-20 12:03:08 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-30 15:06:08 -04:00
|
|
|
// GetChannelByNameForTeamName provides a mock function with given fields: teamName, channelName, includeDeleted
|
|
|
|
|
func (_m *API) GetChannelByNameForTeamName(teamName string, channelName string, includeDeleted bool) (*model.Channel, *model.AppError) {
|
|
|
|
|
ret := _m.Called(teamName, channelName, includeDeleted)
|
2018-07-20 12:03:08 -04:00
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetChannelByNameForTeamName")
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-20 12:03:08 -04:00
|
|
|
var r0 *model.Channel
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, string, bool) (*model.Channel, *model.AppError)); ok {
|
|
|
|
|
return rf(teamName, channelName, includeDeleted)
|
|
|
|
|
}
|
2018-07-30 15:06:08 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(string, string, bool) *model.Channel); ok {
|
|
|
|
|
r0 = rf(teamName, channelName, includeDeleted)
|
2018-07-20 12:03:08 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.Channel)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-30 15:06:08 -04:00
|
|
|
if rf, ok := ret.Get(1).(func(string, string, bool) *model.AppError); ok {
|
|
|
|
|
r1 = rf(teamName, channelName, includeDeleted)
|
2018-05-15 16:33:47 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
2017-09-21 15:00:14 -04:00
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
// GetChannelMember provides a mock function with given fields: channelId, userID
|
|
|
|
|
func (_m *API) GetChannelMember(channelId string, userID string) (*model.ChannelMember, *model.AppError) {
|
|
|
|
|
ret := _m.Called(channelId, userID)
|
2018-05-15 16:33:47 -04:00
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetChannelMember")
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-15 16:33:47 -04:00
|
|
|
var r0 *model.ChannelMember
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, string) (*model.ChannelMember, *model.AppError)); ok {
|
|
|
|
|
return rf(channelId, userID)
|
|
|
|
|
}
|
2018-05-15 16:33:47 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(string, string) *model.ChannelMember); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r0 = rf(channelId, userID)
|
2018-05-15 16:33:47 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.ChannelMember)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string, string) *model.AppError); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r1 = rf(channelId, userID)
|
2018-05-15 16:33:47 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
2017-09-21 15:00:14 -04:00
|
|
|
}
|
2018-05-15 16:33:47 -04:00
|
|
|
|
|
|
|
|
return r0, r1
|
2017-09-21 15:00:14 -04:00
|
|
|
}
|
|
|
|
|
|
2018-10-03 16:07:54 -04:00
|
|
|
// GetChannelMembers provides a mock function with given fields: channelId, page, perPage
|
2021-08-17 05:18:33 -04:00
|
|
|
func (_m *API) GetChannelMembers(channelId string, page int, perPage int) (model.ChannelMembers, *model.AppError) {
|
2018-10-03 16:07:54 -04:00
|
|
|
ret := _m.Called(channelId, page, perPage)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetChannelMembers")
|
|
|
|
|
}
|
|
|
|
|
|
2021-08-17 05:18:33 -04:00
|
|
|
var r0 model.ChannelMembers
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, int, int) (model.ChannelMembers, *model.AppError)); ok {
|
|
|
|
|
return rf(channelId, page, perPage)
|
|
|
|
|
}
|
2021-08-17 05:18:33 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(string, int, int) model.ChannelMembers); ok {
|
2018-10-03 16:07:54 -04:00
|
|
|
r0 = rf(channelId, page, perPage)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
2021-08-17 05:18:33 -04:00
|
|
|
r0 = ret.Get(0).(model.ChannelMembers)
|
2018-10-03 16:07:54 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string, int, int) *model.AppError); ok {
|
|
|
|
|
r1 = rf(channelId, page, perPage)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2018-10-31 09:29:20 -04:00
|
|
|
// GetChannelMembersByIds provides a mock function with given fields: channelId, userIds
|
2021-08-17 05:18:33 -04:00
|
|
|
func (_m *API) GetChannelMembersByIds(channelId string, userIds []string) (model.ChannelMembers, *model.AppError) {
|
2018-10-31 09:29:20 -04:00
|
|
|
ret := _m.Called(channelId, userIds)
|
2018-10-15 12:27:45 -04:00
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetChannelMembersByIds")
|
|
|
|
|
}
|
|
|
|
|
|
2021-08-17 05:18:33 -04:00
|
|
|
var r0 model.ChannelMembers
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, []string) (model.ChannelMembers, *model.AppError)); ok {
|
|
|
|
|
return rf(channelId, userIds)
|
|
|
|
|
}
|
2021-08-17 05:18:33 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(string, []string) model.ChannelMembers); ok {
|
2018-10-31 09:29:20 -04:00
|
|
|
r0 = rf(channelId, userIds)
|
2018-10-15 12:27:45 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
2021-08-17 05:18:33 -04:00
|
|
|
r0 = ret.Get(0).(model.ChannelMembers)
|
2018-10-15 12:27:45 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2018-10-31 09:29:20 -04:00
|
|
|
if rf, ok := ret.Get(1).(func(string, []string) *model.AppError); ok {
|
|
|
|
|
r1 = rf(channelId, userIds)
|
2018-10-15 12:27:45 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
// GetChannelMembersForUser provides a mock function with given fields: teamID, userID, page, perPage
|
|
|
|
|
func (_m *API) GetChannelMembersForUser(teamID string, userID string, page int, perPage int) ([]*model.ChannelMember, *model.AppError) {
|
|
|
|
|
ret := _m.Called(teamID, userID, page, perPage)
|
2019-02-23 14:41:19 -05:00
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetChannelMembersForUser")
|
|
|
|
|
}
|
|
|
|
|
|
2019-02-23 14:41:19 -05:00
|
|
|
var r0 []*model.ChannelMember
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, string, int, int) ([]*model.ChannelMember, *model.AppError)); ok {
|
|
|
|
|
return rf(teamID, userID, page, perPage)
|
|
|
|
|
}
|
2019-02-23 14:41:19 -05:00
|
|
|
if rf, ok := ret.Get(0).(func(string, string, int, int) []*model.ChannelMember); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r0 = rf(teamID, userID, page, perPage)
|
2019-02-23 14:41:19 -05:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).([]*model.ChannelMember)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string, string, int, int) *model.AppError); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r1 = rf(teamID, userID, page, perPage)
|
2019-02-23 14:41:19 -05:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2021-06-25 12:52:09 -04:00
|
|
|
// GetChannelSidebarCategories provides a mock function with given fields: userID, teamID
|
|
|
|
|
func (_m *API) GetChannelSidebarCategories(userID string, teamID string) (*model.OrderedSidebarCategories, *model.AppError) {
|
|
|
|
|
ret := _m.Called(userID, teamID)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetChannelSidebarCategories")
|
|
|
|
|
}
|
|
|
|
|
|
2021-06-25 12:52:09 -04:00
|
|
|
var r0 *model.OrderedSidebarCategories
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, string) (*model.OrderedSidebarCategories, *model.AppError)); ok {
|
|
|
|
|
return rf(userID, teamID)
|
|
|
|
|
}
|
2021-06-25 12:52:09 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(string, string) *model.OrderedSidebarCategories); ok {
|
|
|
|
|
r0 = rf(userID, teamID)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.OrderedSidebarCategories)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string, string) *model.AppError); ok {
|
|
|
|
|
r1 = rf(userID, teamID)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2018-10-25 13:24:43 -04:00
|
|
|
// GetChannelStats provides a mock function with given fields: channelId
|
|
|
|
|
func (_m *API) GetChannelStats(channelId string) (*model.ChannelStats, *model.AppError) {
|
|
|
|
|
ret := _m.Called(channelId)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetChannelStats")
|
|
|
|
|
}
|
|
|
|
|
|
2018-10-25 13:24:43 -04:00
|
|
|
var r0 *model.ChannelStats
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string) (*model.ChannelStats, *model.AppError)); ok {
|
|
|
|
|
return rf(channelId)
|
|
|
|
|
}
|
2018-10-25 13:24:43 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(string) *model.ChannelStats); ok {
|
|
|
|
|
r0 = rf(channelId)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.ChannelStats)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string) *model.AppError); ok {
|
|
|
|
|
r1 = rf(channelId)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
// GetChannelsForTeamForUser provides a mock function with given fields: teamID, userID, includeDeleted
|
|
|
|
|
func (_m *API) GetChannelsForTeamForUser(teamID string, userID string, includeDeleted bool) ([]*model.Channel, *model.AppError) {
|
|
|
|
|
ret := _m.Called(teamID, userID, includeDeleted)
|
2018-10-31 09:29:20 -04:00
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetChannelsForTeamForUser")
|
|
|
|
|
}
|
|
|
|
|
|
2018-11-20 08:50:34 -05:00
|
|
|
var r0 []*model.Channel
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, string, bool) ([]*model.Channel, *model.AppError)); ok {
|
|
|
|
|
return rf(teamID, userID, includeDeleted)
|
|
|
|
|
}
|
2018-11-20 08:50:34 -05:00
|
|
|
if rf, ok := ret.Get(0).(func(string, string, bool) []*model.Channel); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r0 = rf(teamID, userID, includeDeleted)
|
2018-10-31 09:29:20 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
2018-11-20 08:50:34 -05:00
|
|
|
r0 = ret.Get(0).([]*model.Channel)
|
2018-10-31 09:29:20 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string, string, bool) *model.AppError); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r1 = rf(teamID, userID, includeDeleted)
|
2018-10-31 09:29:20 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-10 14:04:57 -04:00
|
|
|
// GetCloudLimits provides a mock function with no fields
|
2022-05-09 09:05:50 -04:00
|
|
|
func (_m *API) GetCloudLimits() (*model.ProductLimits, error) {
|
|
|
|
|
ret := _m.Called()
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetCloudLimits")
|
|
|
|
|
}
|
|
|
|
|
|
2022-05-09 09:05:50 -04:00
|
|
|
var r0 *model.ProductLimits
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 error
|
|
|
|
|
if rf, ok := ret.Get(0).(func() (*model.ProductLimits, error)); ok {
|
|
|
|
|
return rf()
|
|
|
|
|
}
|
2022-05-09 09:05:50 -04:00
|
|
|
if rf, ok := ret.Get(0).(func() *model.ProductLimits); ok {
|
|
|
|
|
r0 = rf()
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.ProductLimits)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func() error); ok {
|
|
|
|
|
r1 = rf()
|
|
|
|
|
} else {
|
|
|
|
|
r1 = ret.Error(1)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2020-07-31 11:40:15 -04:00
|
|
|
// GetCommand provides a mock function with given fields: commandID
|
|
|
|
|
func (_m *API) GetCommand(commandID string) (*model.Command, error) {
|
|
|
|
|
ret := _m.Called(commandID)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetCommand")
|
|
|
|
|
}
|
|
|
|
|
|
2020-07-31 11:40:15 -04:00
|
|
|
var r0 *model.Command
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 error
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string) (*model.Command, error)); ok {
|
|
|
|
|
return rf(commandID)
|
|
|
|
|
}
|
2020-07-31 11:40:15 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(string) *model.Command); ok {
|
|
|
|
|
r0 = rf(commandID)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.Command)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string) error); ok {
|
|
|
|
|
r1 = rf(commandID)
|
|
|
|
|
} else {
|
|
|
|
|
r1 = ret.Error(1)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-10 14:04:57 -04:00
|
|
|
// GetConfig provides a mock function with no fields
|
2018-07-06 18:32:55 -04:00
|
|
|
func (_m *API) GetConfig() *model.Config {
|
|
|
|
|
ret := _m.Called()
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetConfig")
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-06 18:32:55 -04:00
|
|
|
var r0 *model.Config
|
|
|
|
|
if rf, ok := ret.Get(0).(func() *model.Config); ok {
|
|
|
|
|
r0 = rf()
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.Config)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-10 14:04:57 -04:00
|
|
|
// GetDiagnosticId provides a mock function with no fields
|
2019-03-13 12:31:47 -04:00
|
|
|
func (_m *API) GetDiagnosticId() string {
|
|
|
|
|
ret := _m.Called()
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetDiagnosticId")
|
|
|
|
|
}
|
|
|
|
|
|
2019-03-13 12:31:47 -04:00
|
|
|
var r0 string
|
|
|
|
|
if rf, ok := ret.Get(0).(func() string); ok {
|
|
|
|
|
r0 = rf()
|
|
|
|
|
} else {
|
|
|
|
|
r0 = ret.Get(0).(string)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-15 16:33:47 -04:00
|
|
|
// GetDirectChannel provides a mock function with given fields: userId1, userId2
|
2018-06-25 15:33:13 -04:00
|
|
|
func (_m *API) GetDirectChannel(userId1 string, userId2 string) (*model.Channel, *model.AppError) {
|
2018-05-15 16:33:47 -04:00
|
|
|
ret := _m.Called(userId1, userId2)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetDirectChannel")
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-15 16:33:47 -04:00
|
|
|
var r0 *model.Channel
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, string) (*model.Channel, *model.AppError)); ok {
|
|
|
|
|
return rf(userId1, userId2)
|
|
|
|
|
}
|
2018-05-15 16:33:47 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(string, string) *model.Channel); ok {
|
|
|
|
|
r0 = rf(userId1, userId2)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.Channel)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string, string) *model.AppError); ok {
|
|
|
|
|
r1 = rf(userId1, userId2)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
2017-09-21 15:00:14 -04:00
|
|
|
}
|
2018-05-15 16:33:47 -04:00
|
|
|
|
|
|
|
|
return r0, r1
|
2017-09-21 15:00:14 -04:00
|
|
|
}
|
|
|
|
|
|
2018-10-31 09:29:20 -04:00
|
|
|
// GetEmoji provides a mock function with given fields: emojiId
|
|
|
|
|
func (_m *API) GetEmoji(emojiId string) (*model.Emoji, *model.AppError) {
|
|
|
|
|
ret := _m.Called(emojiId)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetEmoji")
|
|
|
|
|
}
|
|
|
|
|
|
2018-10-31 09:29:20 -04:00
|
|
|
var r0 *model.Emoji
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string) (*model.Emoji, *model.AppError)); ok {
|
|
|
|
|
return rf(emojiId)
|
|
|
|
|
}
|
2018-10-31 09:29:20 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(string) *model.Emoji); ok {
|
|
|
|
|
r0 = rf(emojiId)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.Emoji)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string) *model.AppError); ok {
|
|
|
|
|
r1 = rf(emojiId)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2018-10-15 17:09:30 -04:00
|
|
|
// GetEmojiByName provides a mock function with given fields: name
|
|
|
|
|
func (_m *API) GetEmojiByName(name string) (*model.Emoji, *model.AppError) {
|
|
|
|
|
ret := _m.Called(name)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetEmojiByName")
|
|
|
|
|
}
|
|
|
|
|
|
2018-10-15 17:09:30 -04:00
|
|
|
var r0 *model.Emoji
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string) (*model.Emoji, *model.AppError)); ok {
|
|
|
|
|
return rf(name)
|
|
|
|
|
}
|
2018-10-15 17:09:30 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(string) *model.Emoji); ok {
|
|
|
|
|
r0 = rf(name)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.Emoji)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string) *model.AppError); ok {
|
|
|
|
|
r1 = rf(name)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2018-10-18 16:07:21 -04:00
|
|
|
// GetEmojiImage provides a mock function with given fields: emojiId
|
|
|
|
|
func (_m *API) GetEmojiImage(emojiId string) ([]byte, string, *model.AppError) {
|
|
|
|
|
ret := _m.Called(emojiId)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetEmojiImage")
|
|
|
|
|
}
|
|
|
|
|
|
2018-10-18 16:07:21 -04:00
|
|
|
var r0 []byte
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 string
|
|
|
|
|
var r2 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string) ([]byte, string, *model.AppError)); ok {
|
|
|
|
|
return rf(emojiId)
|
|
|
|
|
}
|
2018-10-18 16:07:21 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(string) []byte); ok {
|
|
|
|
|
r0 = rf(emojiId)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).([]byte)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string) string); ok {
|
|
|
|
|
r1 = rf(emojiId)
|
|
|
|
|
} else {
|
|
|
|
|
r1 = ret.Get(1).(string)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(2).(func(string) *model.AppError); ok {
|
|
|
|
|
r2 = rf(emojiId)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(2) != nil {
|
|
|
|
|
r2 = ret.Get(2).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1, r2
|
|
|
|
|
}
|
|
|
|
|
|
2018-11-05 08:50:08 -05:00
|
|
|
// GetEmojiList provides a mock function with given fields: sortBy, page, perPage
|
|
|
|
|
func (_m *API) GetEmojiList(sortBy string, page int, perPage int) ([]*model.Emoji, *model.AppError) {
|
|
|
|
|
ret := _m.Called(sortBy, page, perPage)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetEmojiList")
|
|
|
|
|
}
|
|
|
|
|
|
2018-11-05 08:50:08 -05:00
|
|
|
var r0 []*model.Emoji
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, int, int) ([]*model.Emoji, *model.AppError)); ok {
|
|
|
|
|
return rf(sortBy, page, perPage)
|
|
|
|
|
}
|
2018-11-05 08:50:08 -05:00
|
|
|
if rf, ok := ret.Get(0).(func(string, int, int) []*model.Emoji); ok {
|
|
|
|
|
r0 = rf(sortBy, page, perPage)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).([]*model.Emoji)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string, int, int) *model.AppError); ok {
|
|
|
|
|
r1 = rf(sortBy, page, perPage)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2018-12-13 04:46:42 -05:00
|
|
|
// GetFile provides a mock function with given fields: fileId
|
|
|
|
|
func (_m *API) GetFile(fileId string) ([]byte, *model.AppError) {
|
|
|
|
|
ret := _m.Called(fileId)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetFile")
|
|
|
|
|
}
|
|
|
|
|
|
2018-12-13 04:46:42 -05:00
|
|
|
var r0 []byte
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string) ([]byte, *model.AppError)); ok {
|
|
|
|
|
return rf(fileId)
|
|
|
|
|
}
|
2018-12-13 04:46:42 -05:00
|
|
|
if rf, ok := ret.Get(0).(func(string) []byte); ok {
|
|
|
|
|
r0 = rf(fileId)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).([]byte)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string) *model.AppError); ok {
|
|
|
|
|
r1 = rf(fileId)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2018-08-20 12:18:25 -04:00
|
|
|
// GetFileInfo provides a mock function with given fields: fileId
|
|
|
|
|
func (_m *API) GetFileInfo(fileId string) (*model.FileInfo, *model.AppError) {
|
|
|
|
|
ret := _m.Called(fileId)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetFileInfo")
|
|
|
|
|
}
|
|
|
|
|
|
2018-08-20 12:18:25 -04:00
|
|
|
var r0 *model.FileInfo
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string) (*model.FileInfo, *model.AppError)); ok {
|
|
|
|
|
return rf(fileId)
|
|
|
|
|
}
|
2018-08-20 12:18:25 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(string) *model.FileInfo); ok {
|
|
|
|
|
r0 = rf(fileId)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.FileInfo)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string) *model.AppError); ok {
|
|
|
|
|
r1 = rf(fileId)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2020-02-14 15:21:54 -05:00
|
|
|
// GetFileInfos provides a mock function with given fields: page, perPage, opt
|
|
|
|
|
func (_m *API) GetFileInfos(page int, perPage int, opt *model.GetFileInfosOptions) ([]*model.FileInfo, *model.AppError) {
|
|
|
|
|
ret := _m.Called(page, perPage, opt)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetFileInfos")
|
|
|
|
|
}
|
|
|
|
|
|
2020-02-14 15:21:54 -05:00
|
|
|
var r0 []*model.FileInfo
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(int, int, *model.GetFileInfosOptions) ([]*model.FileInfo, *model.AppError)); ok {
|
|
|
|
|
return rf(page, perPage, opt)
|
|
|
|
|
}
|
2020-02-14 15:21:54 -05:00
|
|
|
if rf, ok := ret.Get(0).(func(int, int, *model.GetFileInfosOptions) []*model.FileInfo); ok {
|
|
|
|
|
r0 = rf(page, perPage, opt)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).([]*model.FileInfo)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(int, int, *model.GetFileInfosOptions) *model.AppError); ok {
|
|
|
|
|
r1 = rf(page, perPage, opt)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2018-10-17 20:31:51 -04:00
|
|
|
// GetFileLink provides a mock function with given fields: fileId
|
|
|
|
|
func (_m *API) GetFileLink(fileId string) (string, *model.AppError) {
|
|
|
|
|
ret := _m.Called(fileId)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetFileLink")
|
|
|
|
|
}
|
|
|
|
|
|
2018-10-17 20:31:51 -04:00
|
|
|
var r0 string
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string) (string, *model.AppError)); ok {
|
|
|
|
|
return rf(fileId)
|
|
|
|
|
}
|
2018-10-17 20:31:51 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(string) string); ok {
|
|
|
|
|
r0 = rf(fileId)
|
|
|
|
|
} else {
|
|
|
|
|
r0 = ret.Get(0).(string)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string) *model.AppError); ok {
|
|
|
|
|
r1 = rf(fileId)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2019-10-22 14:38:08 -04:00
|
|
|
// GetGroup provides a mock function with given fields: groupId
|
|
|
|
|
func (_m *API) GetGroup(groupId string) (*model.Group, *model.AppError) {
|
|
|
|
|
ret := _m.Called(groupId)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetGroup")
|
|
|
|
|
}
|
|
|
|
|
|
2019-10-22 14:38:08 -04:00
|
|
|
var r0 *model.Group
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string) (*model.Group, *model.AppError)); ok {
|
|
|
|
|
return rf(groupId)
|
|
|
|
|
}
|
2019-10-22 14:38:08 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(string) *model.Group); ok {
|
|
|
|
|
r0 = rf(groupId)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.Group)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string) *model.AppError); ok {
|
|
|
|
|
r1 = rf(groupId)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2020-06-18 14:17:36 -04:00
|
|
|
// GetGroupByName provides a mock function with given fields: name
|
|
|
|
|
func (_m *API) GetGroupByName(name string) (*model.Group, *model.AppError) {
|
|
|
|
|
ret := _m.Called(name)
|
2019-10-22 14:38:08 -04:00
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetGroupByName")
|
|
|
|
|
}
|
|
|
|
|
|
2019-10-22 14:38:08 -04:00
|
|
|
var r0 *model.Group
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string) (*model.Group, *model.AppError)); ok {
|
|
|
|
|
return rf(name)
|
|
|
|
|
}
|
2020-06-18 14:17:36 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(string) *model.Group); ok {
|
|
|
|
|
r0 = rf(name)
|
2019-10-22 14:38:08 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.Group)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-06-18 14:17:36 -04:00
|
|
|
if rf, ok := ret.Get(1).(func(string) *model.AppError); ok {
|
|
|
|
|
r1 = rf(name)
|
2019-10-22 14:38:08 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2025-03-13 12:00:15 -04:00
|
|
|
// GetGroupByRemoteID provides a mock function with given fields: remoteID, groupSource
|
|
|
|
|
func (_m *API) GetGroupByRemoteID(remoteID string, groupSource model.GroupSource) (*model.Group, *model.AppError) {
|
|
|
|
|
ret := _m.Called(remoteID, groupSource)
|
|
|
|
|
|
|
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetGroupByRemoteID")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var r0 *model.Group
|
|
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, model.GroupSource) (*model.Group, *model.AppError)); ok {
|
|
|
|
|
return rf(remoteID, groupSource)
|
|
|
|
|
}
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, model.GroupSource) *model.Group); ok {
|
|
|
|
|
r0 = rf(remoteID, groupSource)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.Group)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string, model.GroupSource) *model.AppError); ok {
|
|
|
|
|
r1 = rf(remoteID, groupSource)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-15 16:33:47 -04:00
|
|
|
// GetGroupChannel provides a mock function with given fields: userIds
|
2018-06-25 15:33:13 -04:00
|
|
|
func (_m *API) GetGroupChannel(userIds []string) (*model.Channel, *model.AppError) {
|
2018-05-15 16:33:47 -04:00
|
|
|
ret := _m.Called(userIds)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetGroupChannel")
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-15 16:33:47 -04:00
|
|
|
var r0 *model.Channel
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func([]string) (*model.Channel, *model.AppError)); ok {
|
|
|
|
|
return rf(userIds)
|
|
|
|
|
}
|
2018-05-15 16:33:47 -04:00
|
|
|
if rf, ok := ret.Get(0).(func([]string) *model.Channel); ok {
|
|
|
|
|
r0 = rf(userIds)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.Channel)
|
|
|
|
|
}
|
2017-08-28 15:19:00 -04:00
|
|
|
}
|
2018-05-15 16:33:47 -04:00
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func([]string) *model.AppError); ok {
|
|
|
|
|
r1 = rf(userIds)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-08-29 14:07:27 -04:00
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-12 13:01:28 -04:00
|
|
|
// GetGroupMemberUsers provides a mock function with given fields: groupID, page, perPage
|
|
|
|
|
func (_m *API) GetGroupMemberUsers(groupID string, page int, perPage int) ([]*model.User, *model.AppError) {
|
|
|
|
|
ret := _m.Called(groupID, page, perPage)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetGroupMemberUsers")
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-12 13:01:28 -04:00
|
|
|
var r0 []*model.User
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, int, int) ([]*model.User, *model.AppError)); ok {
|
|
|
|
|
return rf(groupID, page, perPage)
|
|
|
|
|
}
|
2021-04-12 13:01:28 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(string, int, int) []*model.User); ok {
|
|
|
|
|
r0 = rf(groupID, page, perPage)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).([]*model.User)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string, int, int) *model.AppError); ok {
|
|
|
|
|
r1 = rf(groupID, page, perPage)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2025-03-13 12:00:15 -04:00
|
|
|
// GetGroupSyncable provides a mock function with given fields: groupID, syncableID, syncableType
|
|
|
|
|
func (_m *API) GetGroupSyncable(groupID string, syncableID string, syncableType model.GroupSyncableType) (*model.GroupSyncable, *model.AppError) {
|
|
|
|
|
ret := _m.Called(groupID, syncableID, syncableType)
|
|
|
|
|
|
|
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetGroupSyncable")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var r0 *model.GroupSyncable
|
|
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, string, model.GroupSyncableType) (*model.GroupSyncable, *model.AppError)); ok {
|
|
|
|
|
return rf(groupID, syncableID, syncableType)
|
|
|
|
|
}
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, string, model.GroupSyncableType) *model.GroupSyncable); ok {
|
|
|
|
|
r0 = rf(groupID, syncableID, syncableType)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.GroupSyncable)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string, string, model.GroupSyncableType) *model.AppError); ok {
|
|
|
|
|
r1 = rf(groupID, syncableID, syncableType)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// GetGroupSyncables provides a mock function with given fields: groupID, syncableType
|
|
|
|
|
func (_m *API) GetGroupSyncables(groupID string, syncableType model.GroupSyncableType) ([]*model.GroupSyncable, *model.AppError) {
|
|
|
|
|
ret := _m.Called(groupID, syncableType)
|
|
|
|
|
|
|
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetGroupSyncables")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var r0 []*model.GroupSyncable
|
|
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, model.GroupSyncableType) ([]*model.GroupSyncable, *model.AppError)); ok {
|
|
|
|
|
return rf(groupID, syncableType)
|
|
|
|
|
}
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, model.GroupSyncableType) []*model.GroupSyncable); ok {
|
|
|
|
|
r0 = rf(groupID, syncableType)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).([]*model.GroupSyncable)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string, model.GroupSyncableType) *model.AppError); ok {
|
|
|
|
|
r1 = rf(groupID, syncableType)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// GetGroups provides a mock function with given fields: page, perPage, opts, viewRestrictions
|
|
|
|
|
func (_m *API) GetGroups(page int, perPage int, opts model.GroupSearchOpts, viewRestrictions *model.ViewUsersRestrictions) ([]*model.Group, *model.AppError) {
|
|
|
|
|
ret := _m.Called(page, perPage, opts, viewRestrictions)
|
|
|
|
|
|
|
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetGroups")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var r0 []*model.Group
|
|
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(int, int, model.GroupSearchOpts, *model.ViewUsersRestrictions) ([]*model.Group, *model.AppError)); ok {
|
|
|
|
|
return rf(page, perPage, opts, viewRestrictions)
|
|
|
|
|
}
|
|
|
|
|
if rf, ok := ret.Get(0).(func(int, int, model.GroupSearchOpts, *model.ViewUsersRestrictions) []*model.Group); ok {
|
|
|
|
|
r0 = rf(page, perPage, opts, viewRestrictions)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).([]*model.Group)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(int, int, model.GroupSearchOpts, *model.ViewUsersRestrictions) *model.AppError); ok {
|
|
|
|
|
r1 = rf(page, perPage, opts, viewRestrictions)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-12 13:01:28 -04:00
|
|
|
// GetGroupsBySource provides a mock function with given fields: groupSource
|
|
|
|
|
func (_m *API) GetGroupsBySource(groupSource model.GroupSource) ([]*model.Group, *model.AppError) {
|
|
|
|
|
ret := _m.Called(groupSource)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetGroupsBySource")
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-12 13:01:28 -04:00
|
|
|
var r0 []*model.Group
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(model.GroupSource) ([]*model.Group, *model.AppError)); ok {
|
|
|
|
|
return rf(groupSource)
|
|
|
|
|
}
|
2021-04-12 13:01:28 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(model.GroupSource) []*model.Group); ok {
|
|
|
|
|
r0 = rf(groupSource)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).([]*model.Group)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(model.GroupSource) *model.AppError); ok {
|
|
|
|
|
r1 = rf(groupSource)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
// GetGroupsForUser provides a mock function with given fields: userID
|
|
|
|
|
func (_m *API) GetGroupsForUser(userID string) ([]*model.Group, *model.AppError) {
|
|
|
|
|
ret := _m.Called(userID)
|
2019-10-22 14:38:08 -04:00
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetGroupsForUser")
|
|
|
|
|
}
|
|
|
|
|
|
2019-10-22 14:38:08 -04:00
|
|
|
var r0 []*model.Group
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string) ([]*model.Group, *model.AppError)); ok {
|
|
|
|
|
return rf(userID)
|
|
|
|
|
}
|
2019-10-22 14:38:08 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(string) []*model.Group); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r0 = rf(userID)
|
2019-10-22 14:38:08 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).([]*model.Group)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string) *model.AppError); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r1 = rf(userID)
|
2019-10-22 14:38:08 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
// GetLDAPUserAttributes provides a mock function with given fields: userID, attributes
|
|
|
|
|
func (_m *API) GetLDAPUserAttributes(userID string, attributes []string) (map[string]string, *model.AppError) {
|
|
|
|
|
ret := _m.Called(userID, attributes)
|
2018-08-29 14:07:27 -04:00
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetLDAPUserAttributes")
|
|
|
|
|
}
|
|
|
|
|
|
2018-08-29 14:07:27 -04:00
|
|
|
var r0 map[string]string
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, []string) (map[string]string, *model.AppError)); ok {
|
|
|
|
|
return rf(userID, attributes)
|
|
|
|
|
}
|
2018-08-29 14:07:27 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(string, []string) map[string]string); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r0 = rf(userID, attributes)
|
2018-08-29 14:07:27 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(map[string]string)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string, []string) *model.AppError); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r1 = rf(userID, attributes)
|
2018-08-29 14:07:27 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-05-15 16:33:47 -04:00
|
|
|
|
|
|
|
|
return r0, r1
|
2017-08-28 15:19:00 -04:00
|
|
|
}
|
|
|
|
|
|
2025-06-10 14:04:57 -04:00
|
|
|
// GetLicense provides a mock function with no fields
|
2019-03-13 12:31:47 -04:00
|
|
|
func (_m *API) GetLicense() *model.License {
|
|
|
|
|
ret := _m.Called()
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetLicense")
|
|
|
|
|
}
|
|
|
|
|
|
2019-03-13 12:31:47 -04:00
|
|
|
var r0 *model.License
|
|
|
|
|
if rf, ok := ret.Get(0).(func() *model.License); ok {
|
|
|
|
|
r0 = rf()
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.License)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0
|
|
|
|
|
}
|
|
|
|
|
|
2021-07-14 09:08:22 -04:00
|
|
|
// GetOAuthApp provides a mock function with given fields: appID
|
|
|
|
|
func (_m *API) GetOAuthApp(appID string) (*model.OAuthApp, *model.AppError) {
|
|
|
|
|
ret := _m.Called(appID)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetOAuthApp")
|
|
|
|
|
}
|
|
|
|
|
|
2021-07-14 09:08:22 -04:00
|
|
|
var r0 *model.OAuthApp
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string) (*model.OAuthApp, *model.AppError)); ok {
|
|
|
|
|
return rf(appID)
|
|
|
|
|
}
|
2021-07-14 09:08:22 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(string) *model.OAuthApp); ok {
|
|
|
|
|
r0 = rf(appID)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.OAuthApp)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string) *model.AppError); ok {
|
|
|
|
|
r1 = rf(appID)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-10 14:04:57 -04:00
|
|
|
// GetPluginConfig provides a mock function with no fields
|
2018-11-28 12:01:49 -05:00
|
|
|
func (_m *API) GetPluginConfig() map[string]interface{} {
|
|
|
|
|
ret := _m.Called()
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetPluginConfig")
|
|
|
|
|
}
|
|
|
|
|
|
2018-11-28 12:01:49 -05:00
|
|
|
var r0 map[string]interface{}
|
|
|
|
|
if rf, ok := ret.Get(0).(func() map[string]interface{}); ok {
|
|
|
|
|
r0 = rf()
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(map[string]interface{})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-10 14:04:57 -04:00
|
|
|
// GetPluginID provides a mock function with no fields
|
2024-08-26 07:39:29 -04:00
|
|
|
func (_m *API) GetPluginID() string {
|
|
|
|
|
ret := _m.Called()
|
|
|
|
|
|
|
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetPluginID")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var r0 string
|
|
|
|
|
if rf, ok := ret.Get(0).(func() string); ok {
|
|
|
|
|
r0 = rf()
|
|
|
|
|
} else {
|
|
|
|
|
r0 = ret.Get(0).(string)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0
|
|
|
|
|
}
|
|
|
|
|
|
2018-11-08 13:17:07 -05:00
|
|
|
// GetPluginStatus provides a mock function with given fields: id
|
|
|
|
|
func (_m *API) GetPluginStatus(id string) (*model.PluginStatus, *model.AppError) {
|
|
|
|
|
ret := _m.Called(id)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetPluginStatus")
|
|
|
|
|
}
|
|
|
|
|
|
2018-11-08 13:17:07 -05:00
|
|
|
var r0 *model.PluginStatus
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string) (*model.PluginStatus, *model.AppError)); ok {
|
|
|
|
|
return rf(id)
|
|
|
|
|
}
|
2018-11-08 13:17:07 -05:00
|
|
|
if rf, ok := ret.Get(0).(func(string) *model.PluginStatus); ok {
|
|
|
|
|
r0 = rf(id)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.PluginStatus)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string) *model.AppError); ok {
|
|
|
|
|
r1 = rf(id)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-10 14:04:57 -04:00
|
|
|
// GetPlugins provides a mock function with no fields
|
2018-11-08 13:17:07 -05:00
|
|
|
func (_m *API) GetPlugins() ([]*model.Manifest, *model.AppError) {
|
|
|
|
|
ret := _m.Called()
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetPlugins")
|
|
|
|
|
}
|
|
|
|
|
|
2018-11-08 13:17:07 -05:00
|
|
|
var r0 []*model.Manifest
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func() ([]*model.Manifest, *model.AppError)); ok {
|
|
|
|
|
return rf()
|
|
|
|
|
}
|
2018-11-08 13:17:07 -05:00
|
|
|
if rf, ok := ret.Get(0).(func() []*model.Manifest); ok {
|
|
|
|
|
r0 = rf()
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).([]*model.Manifest)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func() *model.AppError); ok {
|
|
|
|
|
r1 = rf()
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-15 16:33:47 -04:00
|
|
|
// GetPost provides a mock function with given fields: postId
|
2018-06-25 15:33:13 -04:00
|
|
|
func (_m *API) GetPost(postId string) (*model.Post, *model.AppError) {
|
2018-05-15 16:33:47 -04:00
|
|
|
ret := _m.Called(postId)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetPost")
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-15 16:33:47 -04:00
|
|
|
var r0 *model.Post
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string) (*model.Post, *model.AppError)); ok {
|
|
|
|
|
return rf(postId)
|
|
|
|
|
}
|
2018-05-15 16:33:47 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(string) *model.Post); ok {
|
|
|
|
|
r0 = rf(postId)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.Post)
|
|
|
|
|
}
|
2017-09-21 15:00:14 -04:00
|
|
|
}
|
2018-05-15 16:33:47 -04:00
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string) *model.AppError); ok {
|
|
|
|
|
r1 = rf(postId)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
2017-09-21 15:00:14 -04:00
|
|
|
}
|
|
|
|
|
|
2018-10-15 09:19:36 -04:00
|
|
|
// GetPostThread provides a mock function with given fields: postId
|
|
|
|
|
func (_m *API) GetPostThread(postId string) (*model.PostList, *model.AppError) {
|
|
|
|
|
ret := _m.Called(postId)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetPostThread")
|
|
|
|
|
}
|
|
|
|
|
|
2018-10-15 09:19:36 -04:00
|
|
|
var r0 *model.PostList
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string) (*model.PostList, *model.AppError)); ok {
|
|
|
|
|
return rf(postId)
|
|
|
|
|
}
|
2018-10-15 09:19:36 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(string) *model.PostList); ok {
|
|
|
|
|
r0 = rf(postId)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.PostList)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string) *model.AppError); ok {
|
|
|
|
|
r1 = rf(postId)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2018-10-18 12:11:15 -04:00
|
|
|
// GetPostsAfter provides a mock function with given fields: channelId, postId, page, perPage
|
|
|
|
|
func (_m *API) GetPostsAfter(channelId string, postId string, page int, perPage int) (*model.PostList, *model.AppError) {
|
|
|
|
|
ret := _m.Called(channelId, postId, page, perPage)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetPostsAfter")
|
|
|
|
|
}
|
|
|
|
|
|
2018-10-18 12:11:15 -04:00
|
|
|
var r0 *model.PostList
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, string, int, int) (*model.PostList, *model.AppError)); ok {
|
|
|
|
|
return rf(channelId, postId, page, perPage)
|
|
|
|
|
}
|
2018-10-18 12:11:15 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(string, string, int, int) *model.PostList); ok {
|
|
|
|
|
r0 = rf(channelId, postId, page, perPage)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.PostList)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string, string, int, int) *model.AppError); ok {
|
|
|
|
|
r1 = rf(channelId, postId, page, perPage)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2018-10-15 13:18:23 -04:00
|
|
|
// GetPostsBefore provides a mock function with given fields: channelId, postId, page, perPage
|
|
|
|
|
func (_m *API) GetPostsBefore(channelId string, postId string, page int, perPage int) (*model.PostList, *model.AppError) {
|
|
|
|
|
ret := _m.Called(channelId, postId, page, perPage)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetPostsBefore")
|
|
|
|
|
}
|
|
|
|
|
|
2018-10-15 13:18:23 -04:00
|
|
|
var r0 *model.PostList
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, string, int, int) (*model.PostList, *model.AppError)); ok {
|
|
|
|
|
return rf(channelId, postId, page, perPage)
|
|
|
|
|
}
|
2018-10-15 13:18:23 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(string, string, int, int) *model.PostList); ok {
|
|
|
|
|
r0 = rf(channelId, postId, page, perPage)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.PostList)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string, string, int, int) *model.AppError); ok {
|
|
|
|
|
r1 = rf(channelId, postId, page, perPage)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2018-10-10 09:23:36 -04:00
|
|
|
// GetPostsForChannel provides a mock function with given fields: channelId, page, perPage
|
|
|
|
|
func (_m *API) GetPostsForChannel(channelId string, page int, perPage int) (*model.PostList, *model.AppError) {
|
|
|
|
|
ret := _m.Called(channelId, page, perPage)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetPostsForChannel")
|
|
|
|
|
}
|
|
|
|
|
|
2018-10-10 09:23:36 -04:00
|
|
|
var r0 *model.PostList
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, int, int) (*model.PostList, *model.AppError)); ok {
|
|
|
|
|
return rf(channelId, page, perPage)
|
|
|
|
|
}
|
2018-10-10 09:23:36 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(string, int, int) *model.PostList); ok {
|
|
|
|
|
r0 = rf(channelId, page, perPage)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.PostList)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string, int, int) *model.AppError); ok {
|
|
|
|
|
r1 = rf(channelId, page, perPage)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2018-10-15 10:04:22 -04:00
|
|
|
// GetPostsSince provides a mock function with given fields: channelId, time
|
|
|
|
|
func (_m *API) GetPostsSince(channelId string, time int64) (*model.PostList, *model.AppError) {
|
|
|
|
|
ret := _m.Called(channelId, time)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetPostsSince")
|
|
|
|
|
}
|
|
|
|
|
|
2018-10-15 10:04:22 -04:00
|
|
|
var r0 *model.PostList
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, int64) (*model.PostList, *model.AppError)); ok {
|
|
|
|
|
return rf(channelId, time)
|
|
|
|
|
}
|
2018-10-15 10:04:22 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(string, int64) *model.PostList); ok {
|
|
|
|
|
r0 = rf(channelId, time)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.PostList)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string, int64) *model.AppError); ok {
|
|
|
|
|
r1 = rf(channelId, time)
|
2024-01-04 13:50:19 -05:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// GetPreferenceForUser provides a mock function with given fields: userID, category, name
|
|
|
|
|
func (_m *API) GetPreferenceForUser(userID string, category string, name string) (model.Preference, *model.AppError) {
|
|
|
|
|
ret := _m.Called(userID, category, name)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetPreferenceForUser")
|
|
|
|
|
}
|
|
|
|
|
|
2024-01-04 13:50:19 -05:00
|
|
|
var r0 model.Preference
|
|
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, string, string) (model.Preference, *model.AppError)); ok {
|
|
|
|
|
return rf(userID, category, name)
|
|
|
|
|
}
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, string, string) model.Preference); ok {
|
|
|
|
|
r0 = rf(userID, category, name)
|
|
|
|
|
} else {
|
|
|
|
|
r0 = ret.Get(0).(model.Preference)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string, string, string) *model.AppError); ok {
|
|
|
|
|
r1 = rf(userID, category, name)
|
2018-10-15 10:04:22 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
// GetPreferencesForUser provides a mock function with given fields: userID
|
|
|
|
|
func (_m *API) GetPreferencesForUser(userID string) ([]model.Preference, *model.AppError) {
|
|
|
|
|
ret := _m.Called(userID)
|
2020-05-28 13:15:47 -04:00
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetPreferencesForUser")
|
|
|
|
|
}
|
|
|
|
|
|
2020-05-28 13:15:47 -04:00
|
|
|
var r0 []model.Preference
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string) ([]model.Preference, *model.AppError)); ok {
|
|
|
|
|
return rf(userID)
|
|
|
|
|
}
|
2020-05-28 13:15:47 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(string) []model.Preference); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r0 = rf(userID)
|
2020-05-28 13:15:47 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).([]model.Preference)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string) *model.AppError); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r1 = rf(userID)
|
2020-05-28 13:15:47 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
// GetProfileImage provides a mock function with given fields: userID
|
|
|
|
|
func (_m *API) GetProfileImage(userID string) ([]byte, *model.AppError) {
|
|
|
|
|
ret := _m.Called(userID)
|
2018-10-15 10:23:41 -04:00
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetProfileImage")
|
|
|
|
|
}
|
|
|
|
|
|
2018-10-15 10:23:41 -04:00
|
|
|
var r0 []byte
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string) ([]byte, *model.AppError)); ok {
|
|
|
|
|
return rf(userID)
|
|
|
|
|
}
|
2018-10-15 10:23:41 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(string) []byte); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r0 = rf(userID)
|
2018-10-15 10:23:41 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).([]byte)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string) *model.AppError); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r1 = rf(userID)
|
2018-10-15 10:23:41 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-10 19:10:28 -04:00
|
|
|
// GetPropertyField provides a mock function with given fields: groupID, fieldID
|
|
|
|
|
func (_m *API) GetPropertyField(groupID string, fieldID string) (*model.PropertyField, error) {
|
|
|
|
|
ret := _m.Called(groupID, fieldID)
|
|
|
|
|
|
|
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetPropertyField")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var r0 *model.PropertyField
|
|
|
|
|
var r1 error
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, string) (*model.PropertyField, error)); ok {
|
|
|
|
|
return rf(groupID, fieldID)
|
|
|
|
|
}
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, string) *model.PropertyField); ok {
|
|
|
|
|
r0 = rf(groupID, fieldID)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.PropertyField)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string, string) error); ok {
|
|
|
|
|
r1 = rf(groupID, fieldID)
|
|
|
|
|
} else {
|
|
|
|
|
r1 = ret.Error(1)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// GetPropertyFieldByName provides a mock function with given fields: groupID, targetID, name
|
|
|
|
|
func (_m *API) GetPropertyFieldByName(groupID string, targetID string, name string) (*model.PropertyField, error) {
|
|
|
|
|
ret := _m.Called(groupID, targetID, name)
|
|
|
|
|
|
|
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetPropertyFieldByName")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var r0 *model.PropertyField
|
|
|
|
|
var r1 error
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, string, string) (*model.PropertyField, error)); ok {
|
|
|
|
|
return rf(groupID, targetID, name)
|
|
|
|
|
}
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, string, string) *model.PropertyField); ok {
|
|
|
|
|
r0 = rf(groupID, targetID, name)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.PropertyField)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string, string, string) error); ok {
|
|
|
|
|
r1 = rf(groupID, targetID, name)
|
|
|
|
|
} else {
|
|
|
|
|
r1 = ret.Error(1)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// GetPropertyFields provides a mock function with given fields: groupID, ids
|
|
|
|
|
func (_m *API) GetPropertyFields(groupID string, ids []string) ([]*model.PropertyField, error) {
|
|
|
|
|
ret := _m.Called(groupID, ids)
|
|
|
|
|
|
|
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetPropertyFields")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var r0 []*model.PropertyField
|
|
|
|
|
var r1 error
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, []string) ([]*model.PropertyField, error)); ok {
|
|
|
|
|
return rf(groupID, ids)
|
|
|
|
|
}
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, []string) []*model.PropertyField); ok {
|
|
|
|
|
r0 = rf(groupID, ids)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).([]*model.PropertyField)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string, []string) error); ok {
|
|
|
|
|
r1 = rf(groupID, ids)
|
|
|
|
|
} else {
|
|
|
|
|
r1 = ret.Error(1)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// GetPropertyGroup provides a mock function with given fields: name
|
|
|
|
|
func (_m *API) GetPropertyGroup(name string) (*model.PropertyGroup, error) {
|
|
|
|
|
ret := _m.Called(name)
|
|
|
|
|
|
|
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetPropertyGroup")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var r0 *model.PropertyGroup
|
|
|
|
|
var r1 error
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string) (*model.PropertyGroup, error)); ok {
|
|
|
|
|
return rf(name)
|
|
|
|
|
}
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string) *model.PropertyGroup); ok {
|
|
|
|
|
r0 = rf(name)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.PropertyGroup)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string) error); ok {
|
|
|
|
|
r1 = rf(name)
|
|
|
|
|
} else {
|
|
|
|
|
r1 = ret.Error(1)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// GetPropertyValue provides a mock function with given fields: groupID, valueID
|
|
|
|
|
func (_m *API) GetPropertyValue(groupID string, valueID string) (*model.PropertyValue, error) {
|
|
|
|
|
ret := _m.Called(groupID, valueID)
|
|
|
|
|
|
|
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetPropertyValue")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var r0 *model.PropertyValue
|
|
|
|
|
var r1 error
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, string) (*model.PropertyValue, error)); ok {
|
|
|
|
|
return rf(groupID, valueID)
|
|
|
|
|
}
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, string) *model.PropertyValue); ok {
|
|
|
|
|
r0 = rf(groupID, valueID)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.PropertyValue)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string, string) error); ok {
|
|
|
|
|
r1 = rf(groupID, valueID)
|
|
|
|
|
} else {
|
|
|
|
|
r1 = ret.Error(1)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// GetPropertyValues provides a mock function with given fields: groupID, ids
|
|
|
|
|
func (_m *API) GetPropertyValues(groupID string, ids []string) ([]*model.PropertyValue, error) {
|
|
|
|
|
ret := _m.Called(groupID, ids)
|
|
|
|
|
|
|
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetPropertyValues")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var r0 []*model.PropertyValue
|
|
|
|
|
var r1 error
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, []string) ([]*model.PropertyValue, error)); ok {
|
|
|
|
|
return rf(groupID, ids)
|
|
|
|
|
}
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, []string) []*model.PropertyValue); ok {
|
|
|
|
|
r0 = rf(groupID, ids)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).([]*model.PropertyValue)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string, []string) error); ok {
|
|
|
|
|
r1 = rf(groupID, ids)
|
|
|
|
|
} else {
|
|
|
|
|
r1 = ret.Error(1)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
// GetPublicChannelsForTeam provides a mock function with given fields: teamID, page, perPage
|
|
|
|
|
func (_m *API) GetPublicChannelsForTeam(teamID string, page int, perPage int) ([]*model.Channel, *model.AppError) {
|
|
|
|
|
ret := _m.Called(teamID, page, perPage)
|
2018-07-06 18:32:55 -04:00
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetPublicChannelsForTeam")
|
|
|
|
|
}
|
|
|
|
|
|
2018-11-19 08:43:49 -05:00
|
|
|
var r0 []*model.Channel
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, int, int) ([]*model.Channel, *model.AppError)); ok {
|
|
|
|
|
return rf(teamID, page, perPage)
|
|
|
|
|
}
|
2018-11-19 08:43:49 -05:00
|
|
|
if rf, ok := ret.Get(0).(func(string, int, int) []*model.Channel); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r0 = rf(teamID, page, perPage)
|
2018-07-06 18:32:55 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
2018-11-19 08:43:49 -05:00
|
|
|
r0 = ret.Get(0).([]*model.Channel)
|
2018-07-06 18:32:55 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string, int, int) *model.AppError); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r1 = rf(teamID, page, perPage)
|
2018-07-06 18:32:55 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2018-08-20 12:22:08 -04:00
|
|
|
// GetReactions provides a mock function with given fields: postId
|
|
|
|
|
func (_m *API) GetReactions(postId string) ([]*model.Reaction, *model.AppError) {
|
|
|
|
|
ret := _m.Called(postId)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetReactions")
|
|
|
|
|
}
|
|
|
|
|
|
2018-08-20 12:22:08 -04:00
|
|
|
var r0 []*model.Reaction
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string) ([]*model.Reaction, *model.AppError)); ok {
|
|
|
|
|
return rf(postId)
|
|
|
|
|
}
|
2018-08-20 12:22:08 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(string) []*model.Reaction); ok {
|
|
|
|
|
r0 = rf(postId)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).([]*model.Reaction)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string) *model.AppError); ok {
|
|
|
|
|
r1 = rf(postId)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-10 14:04:57 -04:00
|
|
|
// GetServerVersion provides a mock function with no fields
|
2018-09-27 12:56:47 -04:00
|
|
|
func (_m *API) GetServerVersion() string {
|
|
|
|
|
ret := _m.Called()
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetServerVersion")
|
|
|
|
|
}
|
|
|
|
|
|
2018-09-27 12:56:47 -04:00
|
|
|
var r0 string
|
|
|
|
|
if rf, ok := ret.Get(0).(func() string); ok {
|
|
|
|
|
r0 = rf()
|
|
|
|
|
} else {
|
|
|
|
|
r0 = ret.Get(0).(string)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
// GetSession provides a mock function with given fields: sessionID
|
|
|
|
|
func (_m *API) GetSession(sessionID string) (*model.Session, *model.AppError) {
|
|
|
|
|
ret := _m.Called(sessionID)
|
2018-08-01 18:16:04 -04:00
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetSession")
|
|
|
|
|
}
|
|
|
|
|
|
2018-08-01 18:16:04 -04:00
|
|
|
var r0 *model.Session
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string) (*model.Session, *model.AppError)); ok {
|
|
|
|
|
return rf(sessionID)
|
|
|
|
|
}
|
2018-08-01 18:16:04 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(string) *model.Session); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r0 = rf(sessionID)
|
2018-08-01 18:16:04 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.Session)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string) *model.AppError); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r1 = rf(sessionID)
|
2018-08-01 18:16:04 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-10 14:04:57 -04:00
|
|
|
// GetSystemInstallDate provides a mock function with no fields
|
2019-03-13 12:31:47 -04:00
|
|
|
func (_m *API) GetSystemInstallDate() (int64, *model.AppError) {
|
|
|
|
|
ret := _m.Called()
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetSystemInstallDate")
|
|
|
|
|
}
|
|
|
|
|
|
2019-03-13 12:31:47 -04:00
|
|
|
var r0 int64
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func() (int64, *model.AppError)); ok {
|
|
|
|
|
return rf()
|
|
|
|
|
}
|
2019-03-13 12:31:47 -04:00
|
|
|
if rf, ok := ret.Get(0).(func() int64); ok {
|
|
|
|
|
r0 = rf()
|
|
|
|
|
} else {
|
|
|
|
|
r0 = ret.Get(0).(int64)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func() *model.AppError); ok {
|
|
|
|
|
r1 = rf()
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
// GetTeam provides a mock function with given fields: teamID
|
|
|
|
|
func (_m *API) GetTeam(teamID string) (*model.Team, *model.AppError) {
|
|
|
|
|
ret := _m.Called(teamID)
|
2018-05-15 16:33:47 -04:00
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetTeam")
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-15 16:33:47 -04:00
|
|
|
var r0 *model.Team
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string) (*model.Team, *model.AppError)); ok {
|
|
|
|
|
return rf(teamID)
|
|
|
|
|
}
|
2018-05-15 16:33:47 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(string) *model.Team); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r0 = rf(teamID)
|
2018-05-15 16:33:47 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.Team)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string) *model.AppError); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r1 = rf(teamID)
|
2018-05-15 16:33:47 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
2017-09-21 15:00:14 -04:00
|
|
|
}
|
2018-05-15 16:33:47 -04:00
|
|
|
|
|
|
|
|
return r0, r1
|
2017-09-21 15:00:14 -04:00
|
|
|
}
|
|
|
|
|
|
2018-05-15 16:33:47 -04:00
|
|
|
// GetTeamByName provides a mock function with given fields: name
|
2018-06-25 15:33:13 -04:00
|
|
|
func (_m *API) GetTeamByName(name string) (*model.Team, *model.AppError) {
|
2018-05-15 16:33:47 -04:00
|
|
|
ret := _m.Called(name)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetTeamByName")
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-15 16:33:47 -04:00
|
|
|
var r0 *model.Team
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string) (*model.Team, *model.AppError)); ok {
|
|
|
|
|
return rf(name)
|
|
|
|
|
}
|
2018-05-15 16:33:47 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(string) *model.Team); ok {
|
|
|
|
|
r0 = rf(name)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.Team)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string) *model.AppError); ok {
|
|
|
|
|
r1 = rf(name)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
2017-09-21 15:00:14 -04:00
|
|
|
}
|
2018-05-15 16:33:47 -04:00
|
|
|
|
|
|
|
|
return r0, r1
|
2017-09-21 15:00:14 -04:00
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
// GetTeamIcon provides a mock function with given fields: teamID
|
|
|
|
|
func (_m *API) GetTeamIcon(teamID string) ([]byte, *model.AppError) {
|
|
|
|
|
ret := _m.Called(teamID)
|
2018-11-16 08:17:42 -05:00
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetTeamIcon")
|
|
|
|
|
}
|
|
|
|
|
|
2018-11-16 08:17:42 -05:00
|
|
|
var r0 []byte
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string) ([]byte, *model.AppError)); ok {
|
|
|
|
|
return rf(teamID)
|
|
|
|
|
}
|
2018-11-16 08:17:42 -05:00
|
|
|
if rf, ok := ret.Get(0).(func(string) []byte); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r0 = rf(teamID)
|
2018-11-16 08:17:42 -05:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).([]byte)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string) *model.AppError); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r1 = rf(teamID)
|
2018-11-16 08:17:42 -05:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
// GetTeamMember provides a mock function with given fields: teamID, userID
|
|
|
|
|
func (_m *API) GetTeamMember(teamID string, userID string) (*model.TeamMember, *model.AppError) {
|
|
|
|
|
ret := _m.Called(teamID, userID)
|
2018-07-06 18:32:55 -04:00
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetTeamMember")
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-06 18:32:55 -04:00
|
|
|
var r0 *model.TeamMember
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, string) (*model.TeamMember, *model.AppError)); ok {
|
|
|
|
|
return rf(teamID, userID)
|
|
|
|
|
}
|
2018-07-06 18:32:55 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(string, string) *model.TeamMember); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r0 = rf(teamID, userID)
|
2018-07-06 18:32:55 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.TeamMember)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string, string) *model.AppError); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r1 = rf(teamID, userID)
|
2018-07-06 18:32:55 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
// GetTeamMembers provides a mock function with given fields: teamID, page, perPage
|
|
|
|
|
func (_m *API) GetTeamMembers(teamID string, page int, perPage int) ([]*model.TeamMember, *model.AppError) {
|
|
|
|
|
ret := _m.Called(teamID, page, perPage)
|
2018-07-06 18:32:55 -04:00
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetTeamMembers")
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-06 18:32:55 -04:00
|
|
|
var r0 []*model.TeamMember
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, int, int) ([]*model.TeamMember, *model.AppError)); ok {
|
|
|
|
|
return rf(teamID, page, perPage)
|
|
|
|
|
}
|
2018-07-06 18:32:55 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(string, int, int) []*model.TeamMember); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r0 = rf(teamID, page, perPage)
|
2018-07-06 18:32:55 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).([]*model.TeamMember)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string, int, int) *model.AppError); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r1 = rf(teamID, page, perPage)
|
2019-02-23 14:41:19 -05:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
// GetTeamMembersForUser provides a mock function with given fields: userID, page, perPage
|
|
|
|
|
func (_m *API) GetTeamMembersForUser(userID string, page int, perPage int) ([]*model.TeamMember, *model.AppError) {
|
|
|
|
|
ret := _m.Called(userID, page, perPage)
|
2019-02-23 14:41:19 -05:00
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetTeamMembersForUser")
|
|
|
|
|
}
|
|
|
|
|
|
2019-02-23 14:41:19 -05:00
|
|
|
var r0 []*model.TeamMember
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, int, int) ([]*model.TeamMember, *model.AppError)); ok {
|
|
|
|
|
return rf(userID, page, perPage)
|
|
|
|
|
}
|
2019-02-23 14:41:19 -05:00
|
|
|
if rf, ok := ret.Get(0).(func(string, int, int) []*model.TeamMember); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r0 = rf(userID, page, perPage)
|
2019-02-23 14:41:19 -05:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).([]*model.TeamMember)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string, int, int) *model.AppError); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r1 = rf(userID, page, perPage)
|
2018-07-06 18:32:55 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
// GetTeamStats provides a mock function with given fields: teamID
|
|
|
|
|
func (_m *API) GetTeamStats(teamID string) (*model.TeamStats, *model.AppError) {
|
|
|
|
|
ret := _m.Called(teamID)
|
2019-01-15 04:22:04 -05:00
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetTeamStats")
|
|
|
|
|
}
|
|
|
|
|
|
2019-01-15 04:22:04 -05:00
|
|
|
var r0 *model.TeamStats
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string) (*model.TeamStats, *model.AppError)); ok {
|
|
|
|
|
return rf(teamID)
|
|
|
|
|
}
|
2019-01-15 04:22:04 -05:00
|
|
|
if rf, ok := ret.Get(0).(func(string) *model.TeamStats); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r0 = rf(teamID)
|
2019-01-15 04:22:04 -05:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.TeamStats)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string) *model.AppError); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r1 = rf(teamID)
|
2019-01-15 04:22:04 -05:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-10 14:04:57 -04:00
|
|
|
// GetTeams provides a mock function with no fields
|
2018-07-06 18:32:55 -04:00
|
|
|
func (_m *API) GetTeams() ([]*model.Team, *model.AppError) {
|
|
|
|
|
ret := _m.Called()
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetTeams")
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-06 18:32:55 -04:00
|
|
|
var r0 []*model.Team
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func() ([]*model.Team, *model.AppError)); ok {
|
|
|
|
|
return rf()
|
|
|
|
|
}
|
2018-07-06 18:32:55 -04:00
|
|
|
if rf, ok := ret.Get(0).(func() []*model.Team); ok {
|
|
|
|
|
r0 = rf()
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).([]*model.Team)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func() *model.AppError); ok {
|
|
|
|
|
r1 = rf()
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
// GetTeamsForUser provides a mock function with given fields: userID
|
|
|
|
|
func (_m *API) GetTeamsForUser(userID string) ([]*model.Team, *model.AppError) {
|
|
|
|
|
ret := _m.Called(userID)
|
2018-10-17 10:37:52 -04:00
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetTeamsForUser")
|
|
|
|
|
}
|
|
|
|
|
|
2018-10-17 10:37:52 -04:00
|
|
|
var r0 []*model.Team
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string) ([]*model.Team, *model.AppError)); ok {
|
|
|
|
|
return rf(userID)
|
|
|
|
|
}
|
2018-10-17 10:37:52 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(string) []*model.Team); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r0 = rf(userID)
|
2018-10-17 10:37:52 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).([]*model.Team)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string) *model.AppError); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r1 = rf(userID)
|
2018-10-17 10:37:52 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
// GetTeamsUnreadForUser provides a mock function with given fields: userID
|
|
|
|
|
func (_m *API) GetTeamsUnreadForUser(userID string) ([]*model.TeamUnread, *model.AppError) {
|
|
|
|
|
ret := _m.Called(userID)
|
2018-11-07 14:23:02 -05:00
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetTeamsUnreadForUser")
|
|
|
|
|
}
|
|
|
|
|
|
2018-11-07 14:23:02 -05:00
|
|
|
var r0 []*model.TeamUnread
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string) ([]*model.TeamUnread, *model.AppError)); ok {
|
|
|
|
|
return rf(userID)
|
|
|
|
|
}
|
2018-11-07 14:23:02 -05:00
|
|
|
if rf, ok := ret.Get(0).(func(string) []*model.TeamUnread); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r0 = rf(userID)
|
2018-11-07 14:23:02 -05:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).([]*model.TeamUnread)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string) *model.AppError); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r1 = rf(userID)
|
2018-11-07 14:23:02 -05:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-10 14:04:57 -04:00
|
|
|
// GetTelemetryId provides a mock function with no fields
|
2020-09-08 14:30:54 -04:00
|
|
|
func (_m *API) GetTelemetryId() string {
|
|
|
|
|
ret := _m.Called()
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetTelemetryId")
|
|
|
|
|
}
|
|
|
|
|
|
2020-09-08 14:30:54 -04:00
|
|
|
var r0 string
|
|
|
|
|
if rf, ok := ret.Get(0).(func() string); ok {
|
|
|
|
|
r0 = rf()
|
|
|
|
|
} else {
|
|
|
|
|
r0 = ret.Get(0).(string)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-10 14:04:57 -04:00
|
|
|
// GetUnsanitizedConfig provides a mock function with no fields
|
2019-09-03 18:41:52 -04:00
|
|
|
func (_m *API) GetUnsanitizedConfig() *model.Config {
|
|
|
|
|
ret := _m.Called()
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetUnsanitizedConfig")
|
|
|
|
|
}
|
|
|
|
|
|
2019-09-03 18:41:52 -04:00
|
|
|
var r0 *model.Config
|
|
|
|
|
if rf, ok := ret.Get(0).(func() *model.Config); ok {
|
|
|
|
|
r0 = rf()
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.Config)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-22 16:26:22 -05:00
|
|
|
// GetUploadSession provides a mock function with given fields: uploadID
|
|
|
|
|
func (_m *API) GetUploadSession(uploadID string) (*model.UploadSession, error) {
|
|
|
|
|
ret := _m.Called(uploadID)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetUploadSession")
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-22 16:26:22 -05:00
|
|
|
var r0 *model.UploadSession
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 error
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string) (*model.UploadSession, error)); ok {
|
|
|
|
|
return rf(uploadID)
|
|
|
|
|
}
|
2022-11-22 16:26:22 -05:00
|
|
|
if rf, ok := ret.Get(0).(func(string) *model.UploadSession); ok {
|
|
|
|
|
r0 = rf(uploadID)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.UploadSession)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string) error); ok {
|
|
|
|
|
r1 = rf(uploadID)
|
|
|
|
|
} else {
|
|
|
|
|
r1 = ret.Error(1)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
// GetUser provides a mock function with given fields: userID
|
|
|
|
|
func (_m *API) GetUser(userID string) (*model.User, *model.AppError) {
|
|
|
|
|
ret := _m.Called(userID)
|
2018-05-15 16:33:47 -04:00
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetUser")
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-15 16:33:47 -04:00
|
|
|
var r0 *model.User
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string) (*model.User, *model.AppError)); ok {
|
|
|
|
|
return rf(userID)
|
|
|
|
|
}
|
2018-05-15 16:33:47 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(string) *model.User); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r0 = rf(userID)
|
2018-05-15 16:33:47 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.User)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string) *model.AppError); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r1 = rf(userID)
|
2018-05-15 16:33:47 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
2018-04-06 17:08:57 -04:00
|
|
|
}
|
2018-05-15 16:33:47 -04:00
|
|
|
|
|
|
|
|
return r0, r1
|
2018-04-06 17:08:57 -04:00
|
|
|
}
|
|
|
|
|
|
2018-05-15 16:33:47 -04:00
|
|
|
// GetUserByEmail provides a mock function with given fields: email
|
2018-06-25 15:33:13 -04:00
|
|
|
func (_m *API) GetUserByEmail(email string) (*model.User, *model.AppError) {
|
2018-05-15 16:33:47 -04:00
|
|
|
ret := _m.Called(email)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetUserByEmail")
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-15 16:33:47 -04:00
|
|
|
var r0 *model.User
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string) (*model.User, *model.AppError)); ok {
|
|
|
|
|
return rf(email)
|
|
|
|
|
}
|
2018-05-15 16:33:47 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(string) *model.User); ok {
|
|
|
|
|
r0 = rf(email)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.User)
|
|
|
|
|
}
|
2017-12-05 09:14:03 -05:00
|
|
|
}
|
2018-05-15 16:33:47 -04:00
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string) *model.AppError); ok {
|
|
|
|
|
r1 = rf(email)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
2017-12-05 09:14:03 -05:00
|
|
|
}
|
|
|
|
|
|
2018-05-15 16:33:47 -04:00
|
|
|
// GetUserByUsername provides a mock function with given fields: name
|
2018-06-25 15:33:13 -04:00
|
|
|
func (_m *API) GetUserByUsername(name string) (*model.User, *model.AppError) {
|
2018-05-15 16:33:47 -04:00
|
|
|
ret := _m.Called(name)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetUserByUsername")
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-15 16:33:47 -04:00
|
|
|
var r0 *model.User
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string) (*model.User, *model.AppError)); ok {
|
|
|
|
|
return rf(name)
|
|
|
|
|
}
|
2018-05-15 16:33:47 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(string) *model.User); ok {
|
|
|
|
|
r0 = rf(name)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.User)
|
|
|
|
|
}
|
2018-04-06 17:08:57 -04:00
|
|
|
}
|
2018-05-15 16:33:47 -04:00
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string) *model.AppError); ok {
|
|
|
|
|
r1 = rf(name)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
2018-04-06 17:08:57 -04:00
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
// GetUserStatus provides a mock function with given fields: userID
|
|
|
|
|
func (_m *API) GetUserStatus(userID string) (*model.Status, *model.AppError) {
|
|
|
|
|
ret := _m.Called(userID)
|
2018-07-16 15:49:26 -04:00
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetUserStatus")
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-16 15:49:26 -04:00
|
|
|
var r0 *model.Status
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string) (*model.Status, *model.AppError)); ok {
|
|
|
|
|
return rf(userID)
|
|
|
|
|
}
|
2018-07-16 15:49:26 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(string) *model.Status); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r0 = rf(userID)
|
2018-07-16 15:49:26 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.Status)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string) *model.AppError); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r1 = rf(userID)
|
2018-07-16 15:49:26 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// GetUserStatusesByIds provides a mock function with given fields: userIds
|
|
|
|
|
func (_m *API) GetUserStatusesByIds(userIds []string) ([]*model.Status, *model.AppError) {
|
|
|
|
|
ret := _m.Called(userIds)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetUserStatusesByIds")
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-16 15:49:26 -04:00
|
|
|
var r0 []*model.Status
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func([]string) ([]*model.Status, *model.AppError)); ok {
|
|
|
|
|
return rf(userIds)
|
|
|
|
|
}
|
2018-07-16 15:49:26 -04:00
|
|
|
if rf, ok := ret.Get(0).(func([]string) []*model.Status); ok {
|
|
|
|
|
r0 = rf(userIds)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).([]*model.Status)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func([]string) *model.AppError); ok {
|
|
|
|
|
r1 = rf(userIds)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2019-03-18 18:01:26 -04:00
|
|
|
// GetUsers provides a mock function with given fields: options
|
|
|
|
|
func (_m *API) GetUsers(options *model.UserGetOptions) ([]*model.User, *model.AppError) {
|
|
|
|
|
ret := _m.Called(options)
|
2019-01-30 12:55:02 -05:00
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetUsers")
|
|
|
|
|
}
|
|
|
|
|
|
2019-01-30 12:55:02 -05:00
|
|
|
var r0 []*model.User
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(*model.UserGetOptions) ([]*model.User, *model.AppError)); ok {
|
|
|
|
|
return rf(options)
|
|
|
|
|
}
|
2019-01-30 12:55:02 -05:00
|
|
|
if rf, ok := ret.Get(0).(func(*model.UserGetOptions) []*model.User); ok {
|
2019-03-18 18:01:26 -04:00
|
|
|
r0 = rf(options)
|
2019-01-30 12:55:02 -05:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).([]*model.User)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(*model.UserGetOptions) *model.AppError); ok {
|
2019-03-18 18:01:26 -04:00
|
|
|
r1 = rf(options)
|
2019-01-30 12:55:02 -05:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2024-05-15 10:06:40 -04:00
|
|
|
// GetUsersByIds provides a mock function with given fields: userIDs
|
|
|
|
|
func (_m *API) GetUsersByIds(userIDs []string) ([]*model.User, *model.AppError) {
|
|
|
|
|
ret := _m.Called(userIDs)
|
|
|
|
|
|
|
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetUsersByIds")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var r0 []*model.User
|
|
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func([]string) ([]*model.User, *model.AppError)); ok {
|
|
|
|
|
return rf(userIDs)
|
|
|
|
|
}
|
|
|
|
|
if rf, ok := ret.Get(0).(func([]string) []*model.User); ok {
|
|
|
|
|
r0 = rf(userIDs)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).([]*model.User)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func([]string) *model.AppError); ok {
|
|
|
|
|
r1 = rf(userIDs)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2018-10-18 09:11:30 -04:00
|
|
|
// GetUsersByUsernames provides a mock function with given fields: usernames
|
|
|
|
|
func (_m *API) GetUsersByUsernames(usernames []string) ([]*model.User, *model.AppError) {
|
|
|
|
|
ret := _m.Called(usernames)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetUsersByUsernames")
|
|
|
|
|
}
|
|
|
|
|
|
2018-10-18 09:11:30 -04:00
|
|
|
var r0 []*model.User
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func([]string) ([]*model.User, *model.AppError)); ok {
|
|
|
|
|
return rf(usernames)
|
|
|
|
|
}
|
2018-10-18 09:11:30 -04:00
|
|
|
if rf, ok := ret.Get(0).(func([]string) []*model.User); ok {
|
|
|
|
|
r0 = rf(usernames)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).([]*model.User)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func([]string) *model.AppError); ok {
|
|
|
|
|
r1 = rf(usernames)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
// GetUsersInChannel provides a mock function with given fields: channelID, sortBy, page, perPage
|
|
|
|
|
func (_m *API) GetUsersInChannel(channelID string, sortBy string, page int, perPage int) ([]*model.User, *model.AppError) {
|
|
|
|
|
ret := _m.Called(channelID, sortBy, page, perPage)
|
2018-10-15 12:24:26 -04:00
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetUsersInChannel")
|
|
|
|
|
}
|
|
|
|
|
|
2018-10-15 12:24:26 -04:00
|
|
|
var r0 []*model.User
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, string, int, int) ([]*model.User, *model.AppError)); ok {
|
|
|
|
|
return rf(channelID, sortBy, page, perPage)
|
|
|
|
|
}
|
2018-10-22 08:49:50 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(string, string, int, int) []*model.User); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r0 = rf(channelID, sortBy, page, perPage)
|
2018-10-15 12:24:26 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).([]*model.User)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2018-10-22 08:49:50 -04:00
|
|
|
if rf, ok := ret.Get(1).(func(string, string, int, int) *model.AppError); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r1 = rf(channelID, sortBy, page, perPage)
|
2018-10-15 12:24:26 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
// GetUsersInTeam provides a mock function with given fields: teamID, page, perPage
|
|
|
|
|
func (_m *API) GetUsersInTeam(teamID string, page int, perPage int) ([]*model.User, *model.AppError) {
|
|
|
|
|
ret := _m.Called(teamID, page, perPage)
|
2018-10-17 17:06:14 -04:00
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for GetUsersInTeam")
|
|
|
|
|
}
|
|
|
|
|
|
2018-10-17 17:06:14 -04:00
|
|
|
var r0 []*model.User
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, int, int) ([]*model.User, *model.AppError)); ok {
|
|
|
|
|
return rf(teamID, page, perPage)
|
|
|
|
|
}
|
2018-10-17 17:06:14 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(string, int, int) []*model.User); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r0 = rf(teamID, page, perPage)
|
2018-10-17 17:06:14 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).([]*model.User)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string, int, int) *model.AppError); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r1 = rf(teamID, page, perPage)
|
2018-10-17 17:06:14 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
// HasPermissionTo provides a mock function with given fields: userID, permission
|
|
|
|
|
func (_m *API) HasPermissionTo(userID string, permission *model.Permission) bool {
|
|
|
|
|
ret := _m.Called(userID, permission)
|
2018-08-20 12:22:08 -04:00
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for HasPermissionTo")
|
|
|
|
|
}
|
|
|
|
|
|
2018-08-20 12:22:08 -04:00
|
|
|
var r0 bool
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, *model.Permission) bool); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r0 = rf(userID, permission)
|
2018-08-20 12:22:08 -04:00
|
|
|
} else {
|
|
|
|
|
r0 = ret.Get(0).(bool)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
// HasPermissionToChannel provides a mock function with given fields: userID, channelId, permission
|
|
|
|
|
func (_m *API) HasPermissionToChannel(userID string, channelId string, permission *model.Permission) bool {
|
|
|
|
|
ret := _m.Called(userID, channelId, permission)
|
2018-08-20 12:22:08 -04:00
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for HasPermissionToChannel")
|
|
|
|
|
}
|
|
|
|
|
|
2018-08-20 12:22:08 -04:00
|
|
|
var r0 bool
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, string, *model.Permission) bool); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r0 = rf(userID, channelId, permission)
|
2018-08-20 12:22:08 -04:00
|
|
|
} else {
|
|
|
|
|
r0 = ret.Get(0).(bool)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
// HasPermissionToTeam provides a mock function with given fields: userID, teamID, permission
|
|
|
|
|
func (_m *API) HasPermissionToTeam(userID string, teamID string, permission *model.Permission) bool {
|
|
|
|
|
ret := _m.Called(userID, teamID, permission)
|
2018-08-20 12:22:08 -04:00
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for HasPermissionToTeam")
|
|
|
|
|
}
|
|
|
|
|
|
2018-08-20 12:22:08 -04:00
|
|
|
var r0 bool
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, string, *model.Permission) bool); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r0 = rf(userID, teamID, permission)
|
2018-08-20 12:22:08 -04:00
|
|
|
} else {
|
|
|
|
|
r0 = ret.Get(0).(bool)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0
|
|
|
|
|
}
|
|
|
|
|
|
2019-11-04 07:49:54 -05:00
|
|
|
// InstallPlugin provides a mock function with given fields: file, replace
|
|
|
|
|
func (_m *API) InstallPlugin(file io.Reader, replace bool) (*model.Manifest, *model.AppError) {
|
|
|
|
|
ret := _m.Called(file, replace)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for InstallPlugin")
|
|
|
|
|
}
|
|
|
|
|
|
2019-11-04 07:49:54 -05:00
|
|
|
var r0 *model.Manifest
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(io.Reader, bool) (*model.Manifest, *model.AppError)); ok {
|
|
|
|
|
return rf(file, replace)
|
|
|
|
|
}
|
2019-11-04 07:49:54 -05:00
|
|
|
if rf, ok := ret.Get(0).(func(io.Reader, bool) *model.Manifest); ok {
|
|
|
|
|
r0 = rf(file, replace)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.Manifest)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(io.Reader, bool) *model.AppError); ok {
|
|
|
|
|
r1 = rf(file, replace)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2024-02-09 10:47:12 -05:00
|
|
|
// InviteRemoteToChannel provides a mock function with given fields: channelID, remoteID, userID, shareIfNotShared
|
|
|
|
|
func (_m *API) InviteRemoteToChannel(channelID string, remoteID string, userID string, shareIfNotShared bool) error {
|
|
|
|
|
ret := _m.Called(channelID, remoteID, userID, shareIfNotShared)
|
Shared channels plugin APIs for MS Teams plugin (#25805)
New plugin APIs and hooks for accessing Shared Channels service via plugin.
- RegisterPluginForSharedChannels(opts model.RegisterPluginOpts) (remoteID string, err error)
- UnregisterPluginForSharedChannels(pluginID string) error
- ShareChannel(sc *model.SharedChannel) (*model.SharedChannel, error)
- UpdateSharedChannel(sc *model.SharedChannel) (*model.SharedChannel, error)
- UnshareChannel(channelID string) (unshared bool, err error)
- UpdateSharedChannelCursor(channelID, remoteID string, cusror model.GetPostsSinceForSyncCursor) error
- SyncSharedChannel(channelID string) error
- InviteRemoteToChannel(channelID string, remoteID string, userID string) error
- UninviteRemoteFromChannel(channelID string, remoteID string) error
Hooks
- OnSharedChannelsSyncMsg(msg *model.SyncMsg, rc *model.RemoteCluster) (model.SyncResponse, error)
- OnSharedChannelsPing(rc *model.RemoteCluster) bool
2023-12-22 17:00:27 -05:00
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for InviteRemoteToChannel")
|
|
|
|
|
}
|
|
|
|
|
|
Shared channels plugin APIs for MS Teams plugin (#25805)
New plugin APIs and hooks for accessing Shared Channels service via plugin.
- RegisterPluginForSharedChannels(opts model.RegisterPluginOpts) (remoteID string, err error)
- UnregisterPluginForSharedChannels(pluginID string) error
- ShareChannel(sc *model.SharedChannel) (*model.SharedChannel, error)
- UpdateSharedChannel(sc *model.SharedChannel) (*model.SharedChannel, error)
- UnshareChannel(channelID string) (unshared bool, err error)
- UpdateSharedChannelCursor(channelID, remoteID string, cusror model.GetPostsSinceForSyncCursor) error
- SyncSharedChannel(channelID string) error
- InviteRemoteToChannel(channelID string, remoteID string, userID string) error
- UninviteRemoteFromChannel(channelID string, remoteID string) error
Hooks
- OnSharedChannelsSyncMsg(msg *model.SyncMsg, rc *model.RemoteCluster) (model.SyncResponse, error)
- OnSharedChannelsPing(rc *model.RemoteCluster) bool
2023-12-22 17:00:27 -05:00
|
|
|
var r0 error
|
2024-02-09 10:47:12 -05:00
|
|
|
if rf, ok := ret.Get(0).(func(string, string, string, bool) error); ok {
|
|
|
|
|
r0 = rf(channelID, remoteID, userID, shareIfNotShared)
|
Shared channels plugin APIs for MS Teams plugin (#25805)
New plugin APIs and hooks for accessing Shared Channels service via plugin.
- RegisterPluginForSharedChannels(opts model.RegisterPluginOpts) (remoteID string, err error)
- UnregisterPluginForSharedChannels(pluginID string) error
- ShareChannel(sc *model.SharedChannel) (*model.SharedChannel, error)
- UpdateSharedChannel(sc *model.SharedChannel) (*model.SharedChannel, error)
- UnshareChannel(channelID string) (unshared bool, err error)
- UpdateSharedChannelCursor(channelID, remoteID string, cusror model.GetPostsSinceForSyncCursor) error
- SyncSharedChannel(channelID string) error
- InviteRemoteToChannel(channelID string, remoteID string, userID string) error
- UninviteRemoteFromChannel(channelID string, remoteID string) error
Hooks
- OnSharedChannelsSyncMsg(msg *model.SyncMsg, rc *model.RemoteCluster) (model.SyncResponse, error)
- OnSharedChannelsPing(rc *model.RemoteCluster) bool
2023-12-22 17:00:27 -05:00
|
|
|
} else {
|
|
|
|
|
r0 = ret.Error(0)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-10 14:04:57 -04:00
|
|
|
// IsEnterpriseReady provides a mock function with no fields
|
2021-10-20 06:12:58 -04:00
|
|
|
func (_m *API) IsEnterpriseReady() bool {
|
|
|
|
|
ret := _m.Called()
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for IsEnterpriseReady")
|
|
|
|
|
}
|
|
|
|
|
|
2021-10-20 06:12:58 -04:00
|
|
|
var r0 bool
|
|
|
|
|
if rf, ok := ret.Get(0).(func() bool); ok {
|
|
|
|
|
r0 = rf()
|
|
|
|
|
} else {
|
|
|
|
|
r0 = ret.Get(0).(bool)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0
|
|
|
|
|
}
|
|
|
|
|
|
2019-08-21 22:25:38 -04:00
|
|
|
// KVCompareAndDelete provides a mock function with given fields: key, oldValue
|
|
|
|
|
func (_m *API) KVCompareAndDelete(key string, oldValue []byte) (bool, *model.AppError) {
|
|
|
|
|
ret := _m.Called(key, oldValue)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for KVCompareAndDelete")
|
|
|
|
|
}
|
|
|
|
|
|
2019-08-21 22:25:38 -04:00
|
|
|
var r0 bool
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, []byte) (bool, *model.AppError)); ok {
|
|
|
|
|
return rf(key, oldValue)
|
|
|
|
|
}
|
2019-08-21 22:25:38 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(string, []byte) bool); ok {
|
|
|
|
|
r0 = rf(key, oldValue)
|
|
|
|
|
} else {
|
|
|
|
|
r0 = ret.Get(0).(bool)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string, []byte) *model.AppError); ok {
|
|
|
|
|
r1 = rf(key, oldValue)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2019-04-23 13:35:17 -04:00
|
|
|
// KVCompareAndSet provides a mock function with given fields: key, oldValue, newValue
|
|
|
|
|
func (_m *API) KVCompareAndSet(key string, oldValue []byte, newValue []byte) (bool, *model.AppError) {
|
|
|
|
|
ret := _m.Called(key, oldValue, newValue)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for KVCompareAndSet")
|
|
|
|
|
}
|
|
|
|
|
|
2019-04-23 13:35:17 -04:00
|
|
|
var r0 bool
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, []byte, []byte) (bool, *model.AppError)); ok {
|
|
|
|
|
return rf(key, oldValue, newValue)
|
|
|
|
|
}
|
2019-04-23 13:35:17 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(string, []byte, []byte) bool); ok {
|
|
|
|
|
r0 = rf(key, oldValue, newValue)
|
|
|
|
|
} else {
|
|
|
|
|
r0 = ret.Get(0).(bool)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string, []byte, []byte) *model.AppError); ok {
|
|
|
|
|
r1 = rf(key, oldValue, newValue)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2018-06-25 15:33:13 -04:00
|
|
|
// KVDelete provides a mock function with given fields: key
|
|
|
|
|
func (_m *API) KVDelete(key string) *model.AppError {
|
|
|
|
|
ret := _m.Called(key)
|
2018-05-15 16:33:47 -04:00
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for KVDelete")
|
|
|
|
|
}
|
|
|
|
|
|
2018-06-25 15:33:13 -04:00
|
|
|
var r0 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string) *model.AppError); ok {
|
|
|
|
|
r0 = rf(key)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-10 14:04:57 -04:00
|
|
|
// KVDeleteAll provides a mock function with no fields
|
2018-10-10 13:55:12 -04:00
|
|
|
func (_m *API) KVDeleteAll() *model.AppError {
|
|
|
|
|
ret := _m.Called()
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for KVDeleteAll")
|
|
|
|
|
}
|
|
|
|
|
|
2018-10-10 13:55:12 -04:00
|
|
|
var r0 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func() *model.AppError); ok {
|
|
|
|
|
r0 = rf()
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0
|
|
|
|
|
}
|
|
|
|
|
|
2018-06-25 15:33:13 -04:00
|
|
|
// KVGet provides a mock function with given fields: key
|
|
|
|
|
func (_m *API) KVGet(key string) ([]byte, *model.AppError) {
|
|
|
|
|
ret := _m.Called(key)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for KVGet")
|
|
|
|
|
}
|
|
|
|
|
|
2018-06-25 15:33:13 -04:00
|
|
|
var r0 []byte
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string) ([]byte, *model.AppError)); ok {
|
|
|
|
|
return rf(key)
|
|
|
|
|
}
|
2018-06-25 15:33:13 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(string) []byte); ok {
|
|
|
|
|
r0 = rf(key)
|
2018-05-15 16:33:47 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
2018-06-25 15:33:13 -04:00
|
|
|
r0 = ret.Get(0).([]byte)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string) *model.AppError); ok {
|
|
|
|
|
r1 = rf(key)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2018-10-03 16:04:37 -04:00
|
|
|
// KVList provides a mock function with given fields: page, perPage
|
|
|
|
|
func (_m *API) KVList(page int, perPage int) ([]string, *model.AppError) {
|
|
|
|
|
ret := _m.Called(page, perPage)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for KVList")
|
|
|
|
|
}
|
|
|
|
|
|
2018-10-03 16:04:37 -04:00
|
|
|
var r0 []string
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(int, int) ([]string, *model.AppError)); ok {
|
|
|
|
|
return rf(page, perPage)
|
|
|
|
|
}
|
2018-10-03 16:04:37 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(int, int) []string); ok {
|
|
|
|
|
r0 = rf(page, perPage)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).([]string)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(int, int) *model.AppError); ok {
|
|
|
|
|
r1 = rf(page, perPage)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2018-06-25 15:33:13 -04:00
|
|
|
// KVSet provides a mock function with given fields: key, value
|
|
|
|
|
func (_m *API) KVSet(key string, value []byte) *model.AppError {
|
|
|
|
|
ret := _m.Called(key, value)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for KVSet")
|
|
|
|
|
}
|
|
|
|
|
|
2018-06-25 15:33:13 -04:00
|
|
|
var r0 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, []byte) *model.AppError); ok {
|
|
|
|
|
r0 = rf(key, value)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.AppError)
|
2018-05-15 16:33:47 -04:00
|
|
|
}
|
2018-04-06 17:08:57 -04:00
|
|
|
}
|
2018-05-15 16:33:47 -04:00
|
|
|
|
|
|
|
|
return r0
|
2018-04-06 17:08:57 -04:00
|
|
|
}
|
|
|
|
|
|
2018-10-10 13:55:12 -04:00
|
|
|
// KVSetWithExpiry provides a mock function with given fields: key, value, expireInSeconds
|
|
|
|
|
func (_m *API) KVSetWithExpiry(key string, value []byte, expireInSeconds int64) *model.AppError {
|
|
|
|
|
ret := _m.Called(key, value, expireInSeconds)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for KVSetWithExpiry")
|
|
|
|
|
}
|
|
|
|
|
|
2018-10-10 13:55:12 -04:00
|
|
|
var r0 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, []byte, int64) *model.AppError); ok {
|
|
|
|
|
r0 = rf(key, value, expireInSeconds)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0
|
|
|
|
|
}
|
|
|
|
|
|
2019-12-03 04:46:15 -05:00
|
|
|
// KVSetWithOptions provides a mock function with given fields: key, value, options
|
|
|
|
|
func (_m *API) KVSetWithOptions(key string, value []byte, options model.PluginKVSetOptions) (bool, *model.AppError) {
|
|
|
|
|
ret := _m.Called(key, value, options)
|
2019-11-04 07:49:54 -05:00
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for KVSetWithOptions")
|
|
|
|
|
}
|
|
|
|
|
|
2019-11-04 07:49:54 -05:00
|
|
|
var r0 bool
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, []byte, model.PluginKVSetOptions) (bool, *model.AppError)); ok {
|
|
|
|
|
return rf(key, value, options)
|
|
|
|
|
}
|
2019-12-03 04:46:15 -05:00
|
|
|
if rf, ok := ret.Get(0).(func(string, []byte, model.PluginKVSetOptions) bool); ok {
|
|
|
|
|
r0 = rf(key, value, options)
|
2019-11-04 07:49:54 -05:00
|
|
|
} else {
|
|
|
|
|
r0 = ret.Get(0).(bool)
|
|
|
|
|
}
|
|
|
|
|
|
2019-12-03 04:46:15 -05:00
|
|
|
if rf, ok := ret.Get(1).(func(string, []byte, model.PluginKVSetOptions) *model.AppError); ok {
|
|
|
|
|
r1 = rf(key, value, options)
|
2019-11-04 07:49:54 -05:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-10 14:04:57 -04:00
|
|
|
// ListBuiltInCommands provides a mock function with no fields
|
2020-07-31 11:40:15 -04:00
|
|
|
func (_m *API) ListBuiltInCommands() ([]*model.Command, error) {
|
|
|
|
|
ret := _m.Called()
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for ListBuiltInCommands")
|
|
|
|
|
}
|
|
|
|
|
|
2020-07-31 11:40:15 -04:00
|
|
|
var r0 []*model.Command
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 error
|
|
|
|
|
if rf, ok := ret.Get(0).(func() ([]*model.Command, error)); ok {
|
|
|
|
|
return rf()
|
|
|
|
|
}
|
2020-07-31 11:40:15 -04:00
|
|
|
if rf, ok := ret.Get(0).(func() []*model.Command); ok {
|
|
|
|
|
r0 = rf()
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).([]*model.Command)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func() error); ok {
|
|
|
|
|
r1 = rf()
|
|
|
|
|
} else {
|
|
|
|
|
r1 = ret.Error(1)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ListCommands provides a mock function with given fields: teamID
|
|
|
|
|
func (_m *API) ListCommands(teamID string) ([]*model.Command, error) {
|
|
|
|
|
ret := _m.Called(teamID)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for ListCommands")
|
|
|
|
|
}
|
|
|
|
|
|
2020-07-31 11:40:15 -04:00
|
|
|
var r0 []*model.Command
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 error
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string) ([]*model.Command, error)); ok {
|
|
|
|
|
return rf(teamID)
|
|
|
|
|
}
|
2020-07-31 11:40:15 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(string) []*model.Command); ok {
|
|
|
|
|
r0 = rf(teamID)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).([]*model.Command)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string) error); ok {
|
|
|
|
|
r1 = rf(teamID)
|
|
|
|
|
} else {
|
|
|
|
|
r1 = ret.Error(1)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ListCustomCommands provides a mock function with given fields: teamID
|
|
|
|
|
func (_m *API) ListCustomCommands(teamID string) ([]*model.Command, error) {
|
|
|
|
|
ret := _m.Called(teamID)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for ListCustomCommands")
|
|
|
|
|
}
|
|
|
|
|
|
2020-07-31 11:40:15 -04:00
|
|
|
var r0 []*model.Command
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 error
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string) ([]*model.Command, error)); ok {
|
|
|
|
|
return rf(teamID)
|
|
|
|
|
}
|
2020-07-31 11:40:15 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(string) []*model.Command); ok {
|
|
|
|
|
r0 = rf(teamID)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).([]*model.Command)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string) error); ok {
|
|
|
|
|
r1 = rf(teamID)
|
|
|
|
|
} else {
|
|
|
|
|
r1 = ret.Error(1)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ListPluginCommands provides a mock function with given fields: teamID
|
|
|
|
|
func (_m *API) ListPluginCommands(teamID string) ([]*model.Command, error) {
|
|
|
|
|
ret := _m.Called(teamID)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for ListPluginCommands")
|
|
|
|
|
}
|
|
|
|
|
|
2020-07-31 11:40:15 -04:00
|
|
|
var r0 []*model.Command
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 error
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string) ([]*model.Command, error)); ok {
|
|
|
|
|
return rf(teamID)
|
|
|
|
|
}
|
2020-07-31 11:40:15 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(string) []*model.Command); ok {
|
|
|
|
|
r0 = rf(teamID)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).([]*model.Command)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string) error); ok {
|
|
|
|
|
r1 = rf(teamID)
|
|
|
|
|
} else {
|
|
|
|
|
r1 = ret.Error(1)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-15 16:33:47 -04:00
|
|
|
// LoadPluginConfiguration provides a mock function with given fields: dest
|
2018-06-25 15:33:13 -04:00
|
|
|
func (_m *API) LoadPluginConfiguration(dest interface{}) error {
|
2018-05-15 16:33:47 -04:00
|
|
|
ret := _m.Called(dest)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for LoadPluginConfiguration")
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-15 16:33:47 -04:00
|
|
|
var r0 error
|
|
|
|
|
if rf, ok := ret.Get(0).(func(interface{}) error); ok {
|
|
|
|
|
r0 = rf(dest)
|
|
|
|
|
} else {
|
|
|
|
|
r0 = ret.Error(0)
|
2018-04-06 17:08:57 -04:00
|
|
|
}
|
2018-05-15 16:33:47 -04:00
|
|
|
|
|
|
|
|
return r0
|
2018-04-06 17:08:57 -04:00
|
|
|
}
|
|
|
|
|
|
2025-06-25 20:37:32 -04:00
|
|
|
// LogAuditRec provides a mock function with given fields: rec
|
|
|
|
|
func (_m *API) LogAuditRec(rec *model.AuditRecord) {
|
|
|
|
|
_m.Called(rec)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// LogAuditRecWithLevel provides a mock function with given fields: rec, level
|
|
|
|
|
func (_m *API) LogAuditRecWithLevel(rec *model.AuditRecord, level logr.Level) {
|
|
|
|
|
_m.Called(rec, level)
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-03 12:58:28 -04:00
|
|
|
// LogDebug provides a mock function with given fields: msg, keyValuePairs
|
|
|
|
|
func (_m *API) LogDebug(msg string, keyValuePairs ...interface{}) {
|
|
|
|
|
var _ca []interface{}
|
|
|
|
|
_ca = append(_ca, msg)
|
|
|
|
|
_ca = append(_ca, keyValuePairs...)
|
|
|
|
|
_m.Called(_ca...)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// LogError provides a mock function with given fields: msg, keyValuePairs
|
|
|
|
|
func (_m *API) LogError(msg string, keyValuePairs ...interface{}) {
|
|
|
|
|
var _ca []interface{}
|
|
|
|
|
_ca = append(_ca, msg)
|
|
|
|
|
_ca = append(_ca, keyValuePairs...)
|
|
|
|
|
_m.Called(_ca...)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// LogInfo provides a mock function with given fields: msg, keyValuePairs
|
|
|
|
|
func (_m *API) LogInfo(msg string, keyValuePairs ...interface{}) {
|
|
|
|
|
var _ca []interface{}
|
|
|
|
|
_ca = append(_ca, msg)
|
|
|
|
|
_ca = append(_ca, keyValuePairs...)
|
|
|
|
|
_m.Called(_ca...)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// LogWarn provides a mock function with given fields: msg, keyValuePairs
|
|
|
|
|
func (_m *API) LogWarn(msg string, keyValuePairs ...interface{}) {
|
|
|
|
|
var _ca []interface{}
|
|
|
|
|
_ca = append(_ca, msg)
|
|
|
|
|
_ca = append(_ca, keyValuePairs...)
|
|
|
|
|
_m.Called(_ca...)
|
|
|
|
|
}
|
|
|
|
|
|
2018-11-19 15:27:17 -05:00
|
|
|
// OpenInteractiveDialog provides a mock function with given fields: dialog
|
|
|
|
|
func (_m *API) OpenInteractiveDialog(dialog model.OpenDialogRequest) *model.AppError {
|
|
|
|
|
ret := _m.Called(dialog)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for OpenInteractiveDialog")
|
|
|
|
|
}
|
|
|
|
|
|
2018-11-19 15:27:17 -05:00
|
|
|
var r0 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(model.OpenDialogRequest) *model.AppError); ok {
|
|
|
|
|
r0 = rf(dialog)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0
|
|
|
|
|
}
|
|
|
|
|
|
MM-12393 Server side of bot accounts. (#10378)
* bots model, store and api (#9903)
* bots model, store and api
Fixes: MM-13100, MM-13101, MM-13103, MM-13105, MMM-13119
* uncomment tests incorrectly commented, and fix merge issues
* add etags support
* add missing licenses
* remove unused sqlbuilder.go (for now...)
* rejig permissions
* split out READ_BOTS into READ_BOTS and READ_OTHERS_BOTS, the latter
implicitly allowing the former
* make MANAGE_OTHERS_BOTS imply MANAGE_BOTS
* conform to general rest api pattern
* eliminate redundant http.StatusOK
* Update api4/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* s/model.UserFromBotModel/model.UserFromBot/g
* Update model/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* Update model/client4.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* move sessionHasPermissionToManageBot to app/authorization.go
* use api.ApiSessionRequired for createBot
* introduce BOT_DESCRIPTION_MAX_RUNES constant
* MM-13512 Prevent getting a user by email based on privacy settings (#10021)
* MM-13512 Prevent getting a user by email based on privacy settings
* Add additional config settings to tests
* upgrade db to 5.7 (#10019)
* MM-13526 Add validation when setting a user's Locale field (#10022)
* Fix typos (#10024)
* Fixing first user being created with system admin privilages without being explicity specified. (#10014)
* Revert "Support for Embeded chat (#9129)" (#10017)
This reverts commit 3fcecd521a5c6ccfdb52fb4c3fb1f8c6ea528a4e.
* s/DisableBot/UpdateBotActive
* add permissions on upgrade
* Update NOTICE.txt (#10054)
- add new dependency (text)
- handle switch to forked dependency (go-gomail -> go-mail)
- misc copyright owner updates
* avoid leaking bot knowledge without permission
* [GH-6798] added a new api endpoint to get the bulk reactions for posts (#10049)
* 6798 added a new api to get the bulk reactions for posts
* 6798 added the permsission check before getting the reactions
* GH-6798 added a new app function for the new endpoint
* 6798 added a store method to get reactions for multiple posts
* 6798 connected the app function with the new store function
* 6798 fixed the review comments
* MM-13559 Update model.post.is_valid.file_ids.app_error text per report (#10055)
Ticket: https://mattermost.atlassian.net/browse/MM-13559
Report: https://github.com/mattermost/mattermost-server/issues/10023
* Trigger Login Hooks with OAuth (#10061)
* make BotStore.GetAll deterministic even on duplicate CreateAt
* fix spurious TestMuteCommandSpecificChannel test failure
See
https://community-daily.mattermost.com/core/pl/px9p8s3dzbg1pf3ddrm5cr36uw
* fix race in TestExportUserChannels
* TestExportUserChannels: remove SaveMember call, as it is redundant and used to be silently failing anyway
* MM-13117: bot tokens (#10111)
* eliminate redundant Client/AdminClient declarations
* harden TestUpdateChannelScheme to API failures
* eliminate unnecessary config restoration
* minor cleanup
* make TestGenerateMfaSecret config dependency explicit
* TestCreateUserAccessToken for bots
* TestGetUserAccessToken* for bots
* leverage SessionHasPermissionToUserOrBot for user token APIs
* Test(Revoke|Disable|Enable)UserAccessToken
* make EnableUserAccessTokens explicit, so as to not rely on local config.json
* uncomment TestResetPassword, but still skip
* mark assert(Invalid)Token as helper
* fix whitespace issues
* fix mangled comments
* MM-13116: bot plugin api (#10113)
* MM-13117: expose bot API to plugins
This also changes the `CreatorId` column definition to allow for plugin
ids, as the default unless the plugin overrides is to use the plugin id
here. This branch hasn't hit master yet, so no migration needed.
* gofmt issues
* expunge use of BotList in plugin/client API
* introduce model.BotGetOptions
* use botUserId term for clarity
* MM-13129 Adding functionality to deal with orphaned bots (#10238)
* Add way to list orphaned bots.
* Add /assign route to modify ownership of bot accounts.
* Apply suggestions from code review
Co-Authored-By: crspeller <crspeller@gmail.com>
* MM-13120: add IsBot field to returned user objects (#10103)
* MM-13104: forbid bot login (#10251)
* MM-13104: disallow bot login
* fix shadowing
* MM-13136 Disable user bots when user is disabled. (#10293)
* Disable user bots when user is disabled.
* Grammer.
Co-Authored-By: crspeller <crspeller@gmail.com>
* Fixing bot branch for test changes.
* Don't use external dependancies in bot plugin tests.
* Rename bot CreatorId to OwnerId
* Adding ability to re-enable bots
* Fixing IsBot to not attempt to be saved to DB.
* Adding diagnostics and licencing counting for bot accounts.
* Modifying gorp to allow reading of '-' fields.
* Removing unnessisary nil values from UserCountOptions.
* Changing comment to GoDoc format
* Improving user count SQL
* Some improvments from feedback.
* Omit empty on User.IsBot
2019-03-05 10:06:45 -05:00
|
|
|
// PatchBot provides a mock function with given fields: botUserId, botPatch
|
|
|
|
|
func (_m *API) PatchBot(botUserId string, botPatch *model.BotPatch) (*model.Bot, *model.AppError) {
|
|
|
|
|
ret := _m.Called(botUserId, botPatch)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for PatchBot")
|
|
|
|
|
}
|
|
|
|
|
|
MM-12393 Server side of bot accounts. (#10378)
* bots model, store and api (#9903)
* bots model, store and api
Fixes: MM-13100, MM-13101, MM-13103, MM-13105, MMM-13119
* uncomment tests incorrectly commented, and fix merge issues
* add etags support
* add missing licenses
* remove unused sqlbuilder.go (for now...)
* rejig permissions
* split out READ_BOTS into READ_BOTS and READ_OTHERS_BOTS, the latter
implicitly allowing the former
* make MANAGE_OTHERS_BOTS imply MANAGE_BOTS
* conform to general rest api pattern
* eliminate redundant http.StatusOK
* Update api4/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* s/model.UserFromBotModel/model.UserFromBot/g
* Update model/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* Update model/client4.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* move sessionHasPermissionToManageBot to app/authorization.go
* use api.ApiSessionRequired for createBot
* introduce BOT_DESCRIPTION_MAX_RUNES constant
* MM-13512 Prevent getting a user by email based on privacy settings (#10021)
* MM-13512 Prevent getting a user by email based on privacy settings
* Add additional config settings to tests
* upgrade db to 5.7 (#10019)
* MM-13526 Add validation when setting a user's Locale field (#10022)
* Fix typos (#10024)
* Fixing first user being created with system admin privilages without being explicity specified. (#10014)
* Revert "Support for Embeded chat (#9129)" (#10017)
This reverts commit 3fcecd521a5c6ccfdb52fb4c3fb1f8c6ea528a4e.
* s/DisableBot/UpdateBotActive
* add permissions on upgrade
* Update NOTICE.txt (#10054)
- add new dependency (text)
- handle switch to forked dependency (go-gomail -> go-mail)
- misc copyright owner updates
* avoid leaking bot knowledge without permission
* [GH-6798] added a new api endpoint to get the bulk reactions for posts (#10049)
* 6798 added a new api to get the bulk reactions for posts
* 6798 added the permsission check before getting the reactions
* GH-6798 added a new app function for the new endpoint
* 6798 added a store method to get reactions for multiple posts
* 6798 connected the app function with the new store function
* 6798 fixed the review comments
* MM-13559 Update model.post.is_valid.file_ids.app_error text per report (#10055)
Ticket: https://mattermost.atlassian.net/browse/MM-13559
Report: https://github.com/mattermost/mattermost-server/issues/10023
* Trigger Login Hooks with OAuth (#10061)
* make BotStore.GetAll deterministic even on duplicate CreateAt
* fix spurious TestMuteCommandSpecificChannel test failure
See
https://community-daily.mattermost.com/core/pl/px9p8s3dzbg1pf3ddrm5cr36uw
* fix race in TestExportUserChannels
* TestExportUserChannels: remove SaveMember call, as it is redundant and used to be silently failing anyway
* MM-13117: bot tokens (#10111)
* eliminate redundant Client/AdminClient declarations
* harden TestUpdateChannelScheme to API failures
* eliminate unnecessary config restoration
* minor cleanup
* make TestGenerateMfaSecret config dependency explicit
* TestCreateUserAccessToken for bots
* TestGetUserAccessToken* for bots
* leverage SessionHasPermissionToUserOrBot for user token APIs
* Test(Revoke|Disable|Enable)UserAccessToken
* make EnableUserAccessTokens explicit, so as to not rely on local config.json
* uncomment TestResetPassword, but still skip
* mark assert(Invalid)Token as helper
* fix whitespace issues
* fix mangled comments
* MM-13116: bot plugin api (#10113)
* MM-13117: expose bot API to plugins
This also changes the `CreatorId` column definition to allow for plugin
ids, as the default unless the plugin overrides is to use the plugin id
here. This branch hasn't hit master yet, so no migration needed.
* gofmt issues
* expunge use of BotList in plugin/client API
* introduce model.BotGetOptions
* use botUserId term for clarity
* MM-13129 Adding functionality to deal with orphaned bots (#10238)
* Add way to list orphaned bots.
* Add /assign route to modify ownership of bot accounts.
* Apply suggestions from code review
Co-Authored-By: crspeller <crspeller@gmail.com>
* MM-13120: add IsBot field to returned user objects (#10103)
* MM-13104: forbid bot login (#10251)
* MM-13104: disallow bot login
* fix shadowing
* MM-13136 Disable user bots when user is disabled. (#10293)
* Disable user bots when user is disabled.
* Grammer.
Co-Authored-By: crspeller <crspeller@gmail.com>
* Fixing bot branch for test changes.
* Don't use external dependancies in bot plugin tests.
* Rename bot CreatorId to OwnerId
* Adding ability to re-enable bots
* Fixing IsBot to not attempt to be saved to DB.
* Adding diagnostics and licencing counting for bot accounts.
* Modifying gorp to allow reading of '-' fields.
* Removing unnessisary nil values from UserCountOptions.
* Changing comment to GoDoc format
* Improving user count SQL
* Some improvments from feedback.
* Omit empty on User.IsBot
2019-03-05 10:06:45 -05:00
|
|
|
var r0 *model.Bot
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, *model.BotPatch) (*model.Bot, *model.AppError)); ok {
|
|
|
|
|
return rf(botUserId, botPatch)
|
|
|
|
|
}
|
MM-12393 Server side of bot accounts. (#10378)
* bots model, store and api (#9903)
* bots model, store and api
Fixes: MM-13100, MM-13101, MM-13103, MM-13105, MMM-13119
* uncomment tests incorrectly commented, and fix merge issues
* add etags support
* add missing licenses
* remove unused sqlbuilder.go (for now...)
* rejig permissions
* split out READ_BOTS into READ_BOTS and READ_OTHERS_BOTS, the latter
implicitly allowing the former
* make MANAGE_OTHERS_BOTS imply MANAGE_BOTS
* conform to general rest api pattern
* eliminate redundant http.StatusOK
* Update api4/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* s/model.UserFromBotModel/model.UserFromBot/g
* Update model/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* Update model/client4.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* move sessionHasPermissionToManageBot to app/authorization.go
* use api.ApiSessionRequired for createBot
* introduce BOT_DESCRIPTION_MAX_RUNES constant
* MM-13512 Prevent getting a user by email based on privacy settings (#10021)
* MM-13512 Prevent getting a user by email based on privacy settings
* Add additional config settings to tests
* upgrade db to 5.7 (#10019)
* MM-13526 Add validation when setting a user's Locale field (#10022)
* Fix typos (#10024)
* Fixing first user being created with system admin privilages without being explicity specified. (#10014)
* Revert "Support for Embeded chat (#9129)" (#10017)
This reverts commit 3fcecd521a5c6ccfdb52fb4c3fb1f8c6ea528a4e.
* s/DisableBot/UpdateBotActive
* add permissions on upgrade
* Update NOTICE.txt (#10054)
- add new dependency (text)
- handle switch to forked dependency (go-gomail -> go-mail)
- misc copyright owner updates
* avoid leaking bot knowledge without permission
* [GH-6798] added a new api endpoint to get the bulk reactions for posts (#10049)
* 6798 added a new api to get the bulk reactions for posts
* 6798 added the permsission check before getting the reactions
* GH-6798 added a new app function for the new endpoint
* 6798 added a store method to get reactions for multiple posts
* 6798 connected the app function with the new store function
* 6798 fixed the review comments
* MM-13559 Update model.post.is_valid.file_ids.app_error text per report (#10055)
Ticket: https://mattermost.atlassian.net/browse/MM-13559
Report: https://github.com/mattermost/mattermost-server/issues/10023
* Trigger Login Hooks with OAuth (#10061)
* make BotStore.GetAll deterministic even on duplicate CreateAt
* fix spurious TestMuteCommandSpecificChannel test failure
See
https://community-daily.mattermost.com/core/pl/px9p8s3dzbg1pf3ddrm5cr36uw
* fix race in TestExportUserChannels
* TestExportUserChannels: remove SaveMember call, as it is redundant and used to be silently failing anyway
* MM-13117: bot tokens (#10111)
* eliminate redundant Client/AdminClient declarations
* harden TestUpdateChannelScheme to API failures
* eliminate unnecessary config restoration
* minor cleanup
* make TestGenerateMfaSecret config dependency explicit
* TestCreateUserAccessToken for bots
* TestGetUserAccessToken* for bots
* leverage SessionHasPermissionToUserOrBot for user token APIs
* Test(Revoke|Disable|Enable)UserAccessToken
* make EnableUserAccessTokens explicit, so as to not rely on local config.json
* uncomment TestResetPassword, but still skip
* mark assert(Invalid)Token as helper
* fix whitespace issues
* fix mangled comments
* MM-13116: bot plugin api (#10113)
* MM-13117: expose bot API to plugins
This also changes the `CreatorId` column definition to allow for plugin
ids, as the default unless the plugin overrides is to use the plugin id
here. This branch hasn't hit master yet, so no migration needed.
* gofmt issues
* expunge use of BotList in plugin/client API
* introduce model.BotGetOptions
* use botUserId term for clarity
* MM-13129 Adding functionality to deal with orphaned bots (#10238)
* Add way to list orphaned bots.
* Add /assign route to modify ownership of bot accounts.
* Apply suggestions from code review
Co-Authored-By: crspeller <crspeller@gmail.com>
* MM-13120: add IsBot field to returned user objects (#10103)
* MM-13104: forbid bot login (#10251)
* MM-13104: disallow bot login
* fix shadowing
* MM-13136 Disable user bots when user is disabled. (#10293)
* Disable user bots when user is disabled.
* Grammer.
Co-Authored-By: crspeller <crspeller@gmail.com>
* Fixing bot branch for test changes.
* Don't use external dependancies in bot plugin tests.
* Rename bot CreatorId to OwnerId
* Adding ability to re-enable bots
* Fixing IsBot to not attempt to be saved to DB.
* Adding diagnostics and licencing counting for bot accounts.
* Modifying gorp to allow reading of '-' fields.
* Removing unnessisary nil values from UserCountOptions.
* Changing comment to GoDoc format
* Improving user count SQL
* Some improvments from feedback.
* Omit empty on User.IsBot
2019-03-05 10:06:45 -05:00
|
|
|
if rf, ok := ret.Get(0).(func(string, *model.BotPatch) *model.Bot); ok {
|
|
|
|
|
r0 = rf(botUserId, botPatch)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.Bot)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string, *model.BotPatch) *model.AppError); ok {
|
|
|
|
|
r1 = rf(botUserId, botPatch)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2024-01-11 13:24:52 -05:00
|
|
|
// PatchChannelMembersNotifications provides a mock function with given fields: members, notifyProps
|
|
|
|
|
func (_m *API) PatchChannelMembersNotifications(members []*model.ChannelMemberIdentifier, notifyProps map[string]string) *model.AppError {
|
|
|
|
|
ret := _m.Called(members, notifyProps)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for PatchChannelMembersNotifications")
|
|
|
|
|
}
|
|
|
|
|
|
2024-01-11 13:24:52 -05:00
|
|
|
var r0 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func([]*model.ChannelMemberIdentifier, map[string]string) *model.AppError); ok {
|
|
|
|
|
r0 = rf(members, notifyProps)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0
|
|
|
|
|
}
|
|
|
|
|
|
MM-12393 Server side of bot accounts. (#10378)
* bots model, store and api (#9903)
* bots model, store and api
Fixes: MM-13100, MM-13101, MM-13103, MM-13105, MMM-13119
* uncomment tests incorrectly commented, and fix merge issues
* add etags support
* add missing licenses
* remove unused sqlbuilder.go (for now...)
* rejig permissions
* split out READ_BOTS into READ_BOTS and READ_OTHERS_BOTS, the latter
implicitly allowing the former
* make MANAGE_OTHERS_BOTS imply MANAGE_BOTS
* conform to general rest api pattern
* eliminate redundant http.StatusOK
* Update api4/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* s/model.UserFromBotModel/model.UserFromBot/g
* Update model/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* Update model/client4.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* move sessionHasPermissionToManageBot to app/authorization.go
* use api.ApiSessionRequired for createBot
* introduce BOT_DESCRIPTION_MAX_RUNES constant
* MM-13512 Prevent getting a user by email based on privacy settings (#10021)
* MM-13512 Prevent getting a user by email based on privacy settings
* Add additional config settings to tests
* upgrade db to 5.7 (#10019)
* MM-13526 Add validation when setting a user's Locale field (#10022)
* Fix typos (#10024)
* Fixing first user being created with system admin privilages without being explicity specified. (#10014)
* Revert "Support for Embeded chat (#9129)" (#10017)
This reverts commit 3fcecd521a5c6ccfdb52fb4c3fb1f8c6ea528a4e.
* s/DisableBot/UpdateBotActive
* add permissions on upgrade
* Update NOTICE.txt (#10054)
- add new dependency (text)
- handle switch to forked dependency (go-gomail -> go-mail)
- misc copyright owner updates
* avoid leaking bot knowledge without permission
* [GH-6798] added a new api endpoint to get the bulk reactions for posts (#10049)
* 6798 added a new api to get the bulk reactions for posts
* 6798 added the permsission check before getting the reactions
* GH-6798 added a new app function for the new endpoint
* 6798 added a store method to get reactions for multiple posts
* 6798 connected the app function with the new store function
* 6798 fixed the review comments
* MM-13559 Update model.post.is_valid.file_ids.app_error text per report (#10055)
Ticket: https://mattermost.atlassian.net/browse/MM-13559
Report: https://github.com/mattermost/mattermost-server/issues/10023
* Trigger Login Hooks with OAuth (#10061)
* make BotStore.GetAll deterministic even on duplicate CreateAt
* fix spurious TestMuteCommandSpecificChannel test failure
See
https://community-daily.mattermost.com/core/pl/px9p8s3dzbg1pf3ddrm5cr36uw
* fix race in TestExportUserChannels
* TestExportUserChannels: remove SaveMember call, as it is redundant and used to be silently failing anyway
* MM-13117: bot tokens (#10111)
* eliminate redundant Client/AdminClient declarations
* harden TestUpdateChannelScheme to API failures
* eliminate unnecessary config restoration
* minor cleanup
* make TestGenerateMfaSecret config dependency explicit
* TestCreateUserAccessToken for bots
* TestGetUserAccessToken* for bots
* leverage SessionHasPermissionToUserOrBot for user token APIs
* Test(Revoke|Disable|Enable)UserAccessToken
* make EnableUserAccessTokens explicit, so as to not rely on local config.json
* uncomment TestResetPassword, but still skip
* mark assert(Invalid)Token as helper
* fix whitespace issues
* fix mangled comments
* MM-13116: bot plugin api (#10113)
* MM-13117: expose bot API to plugins
This also changes the `CreatorId` column definition to allow for plugin
ids, as the default unless the plugin overrides is to use the plugin id
here. This branch hasn't hit master yet, so no migration needed.
* gofmt issues
* expunge use of BotList in plugin/client API
* introduce model.BotGetOptions
* use botUserId term for clarity
* MM-13129 Adding functionality to deal with orphaned bots (#10238)
* Add way to list orphaned bots.
* Add /assign route to modify ownership of bot accounts.
* Apply suggestions from code review
Co-Authored-By: crspeller <crspeller@gmail.com>
* MM-13120: add IsBot field to returned user objects (#10103)
* MM-13104: forbid bot login (#10251)
* MM-13104: disallow bot login
* fix shadowing
* MM-13136 Disable user bots when user is disabled. (#10293)
* Disable user bots when user is disabled.
* Grammer.
Co-Authored-By: crspeller <crspeller@gmail.com>
* Fixing bot branch for test changes.
* Don't use external dependancies in bot plugin tests.
* Rename bot CreatorId to OwnerId
* Adding ability to re-enable bots
* Fixing IsBot to not attempt to be saved to DB.
* Adding diagnostics and licencing counting for bot accounts.
* Modifying gorp to allow reading of '-' fields.
* Removing unnessisary nil values from UserCountOptions.
* Changing comment to GoDoc format
* Improving user count SQL
* Some improvments from feedback.
* Omit empty on User.IsBot
2019-03-05 10:06:45 -05:00
|
|
|
// PermanentDeleteBot provides a mock function with given fields: botUserId
|
|
|
|
|
func (_m *API) PermanentDeleteBot(botUserId string) *model.AppError {
|
|
|
|
|
ret := _m.Called(botUserId)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for PermanentDeleteBot")
|
|
|
|
|
}
|
|
|
|
|
|
MM-12393 Server side of bot accounts. (#10378)
* bots model, store and api (#9903)
* bots model, store and api
Fixes: MM-13100, MM-13101, MM-13103, MM-13105, MMM-13119
* uncomment tests incorrectly commented, and fix merge issues
* add etags support
* add missing licenses
* remove unused sqlbuilder.go (for now...)
* rejig permissions
* split out READ_BOTS into READ_BOTS and READ_OTHERS_BOTS, the latter
implicitly allowing the former
* make MANAGE_OTHERS_BOTS imply MANAGE_BOTS
* conform to general rest api pattern
* eliminate redundant http.StatusOK
* Update api4/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* s/model.UserFromBotModel/model.UserFromBot/g
* Update model/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* Update model/client4.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* move sessionHasPermissionToManageBot to app/authorization.go
* use api.ApiSessionRequired for createBot
* introduce BOT_DESCRIPTION_MAX_RUNES constant
* MM-13512 Prevent getting a user by email based on privacy settings (#10021)
* MM-13512 Prevent getting a user by email based on privacy settings
* Add additional config settings to tests
* upgrade db to 5.7 (#10019)
* MM-13526 Add validation when setting a user's Locale field (#10022)
* Fix typos (#10024)
* Fixing first user being created with system admin privilages without being explicity specified. (#10014)
* Revert "Support for Embeded chat (#9129)" (#10017)
This reverts commit 3fcecd521a5c6ccfdb52fb4c3fb1f8c6ea528a4e.
* s/DisableBot/UpdateBotActive
* add permissions on upgrade
* Update NOTICE.txt (#10054)
- add new dependency (text)
- handle switch to forked dependency (go-gomail -> go-mail)
- misc copyright owner updates
* avoid leaking bot knowledge without permission
* [GH-6798] added a new api endpoint to get the bulk reactions for posts (#10049)
* 6798 added a new api to get the bulk reactions for posts
* 6798 added the permsission check before getting the reactions
* GH-6798 added a new app function for the new endpoint
* 6798 added a store method to get reactions for multiple posts
* 6798 connected the app function with the new store function
* 6798 fixed the review comments
* MM-13559 Update model.post.is_valid.file_ids.app_error text per report (#10055)
Ticket: https://mattermost.atlassian.net/browse/MM-13559
Report: https://github.com/mattermost/mattermost-server/issues/10023
* Trigger Login Hooks with OAuth (#10061)
* make BotStore.GetAll deterministic even on duplicate CreateAt
* fix spurious TestMuteCommandSpecificChannel test failure
See
https://community-daily.mattermost.com/core/pl/px9p8s3dzbg1pf3ddrm5cr36uw
* fix race in TestExportUserChannels
* TestExportUserChannels: remove SaveMember call, as it is redundant and used to be silently failing anyway
* MM-13117: bot tokens (#10111)
* eliminate redundant Client/AdminClient declarations
* harden TestUpdateChannelScheme to API failures
* eliminate unnecessary config restoration
* minor cleanup
* make TestGenerateMfaSecret config dependency explicit
* TestCreateUserAccessToken for bots
* TestGetUserAccessToken* for bots
* leverage SessionHasPermissionToUserOrBot for user token APIs
* Test(Revoke|Disable|Enable)UserAccessToken
* make EnableUserAccessTokens explicit, so as to not rely on local config.json
* uncomment TestResetPassword, but still skip
* mark assert(Invalid)Token as helper
* fix whitespace issues
* fix mangled comments
* MM-13116: bot plugin api (#10113)
* MM-13117: expose bot API to plugins
This also changes the `CreatorId` column definition to allow for plugin
ids, as the default unless the plugin overrides is to use the plugin id
here. This branch hasn't hit master yet, so no migration needed.
* gofmt issues
* expunge use of BotList in plugin/client API
* introduce model.BotGetOptions
* use botUserId term for clarity
* MM-13129 Adding functionality to deal with orphaned bots (#10238)
* Add way to list orphaned bots.
* Add /assign route to modify ownership of bot accounts.
* Apply suggestions from code review
Co-Authored-By: crspeller <crspeller@gmail.com>
* MM-13120: add IsBot field to returned user objects (#10103)
* MM-13104: forbid bot login (#10251)
* MM-13104: disallow bot login
* fix shadowing
* MM-13136 Disable user bots when user is disabled. (#10293)
* Disable user bots when user is disabled.
* Grammer.
Co-Authored-By: crspeller <crspeller@gmail.com>
* Fixing bot branch for test changes.
* Don't use external dependancies in bot plugin tests.
* Rename bot CreatorId to OwnerId
* Adding ability to re-enable bots
* Fixing IsBot to not attempt to be saved to DB.
* Adding diagnostics and licencing counting for bot accounts.
* Modifying gorp to allow reading of '-' fields.
* Removing unnessisary nil values from UserCountOptions.
* Changing comment to GoDoc format
* Improving user count SQL
* Some improvments from feedback.
* Omit empty on User.IsBot
2019-03-05 10:06:45 -05:00
|
|
|
var r0 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string) *model.AppError); ok {
|
|
|
|
|
r0 = rf(botUserId)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0
|
|
|
|
|
}
|
|
|
|
|
|
2019-11-04 20:35:58 -05:00
|
|
|
// PluginHTTP provides a mock function with given fields: request
|
|
|
|
|
func (_m *API) PluginHTTP(request *http.Request) *http.Response {
|
|
|
|
|
ret := _m.Called(request)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for PluginHTTP")
|
|
|
|
|
}
|
|
|
|
|
|
2019-11-04 20:35:58 -05:00
|
|
|
var r0 *http.Response
|
|
|
|
|
if rf, ok := ret.Get(0).(func(*http.Request) *http.Response); ok {
|
|
|
|
|
r0 = rf(request)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*http.Response)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-28 13:59:32 -04:00
|
|
|
// PublishPluginClusterEvent provides a mock function with given fields: ev, opts
|
|
|
|
|
func (_m *API) PublishPluginClusterEvent(ev model.PluginClusterEvent, opts model.PluginClusterEventSendOptions) error {
|
|
|
|
|
ret := _m.Called(ev, opts)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for PublishPluginClusterEvent")
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-28 13:59:32 -04:00
|
|
|
var r0 error
|
|
|
|
|
if rf, ok := ret.Get(0).(func(model.PluginClusterEvent, model.PluginClusterEventSendOptions) error); ok {
|
|
|
|
|
r0 = rf(ev, opts)
|
|
|
|
|
} else {
|
|
|
|
|
r0 = ret.Error(0)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
// PublishUserTyping provides a mock function with given fields: userID, channelId, parentId
|
|
|
|
|
func (_m *API) PublishUserTyping(userID string, channelId string, parentId string) *model.AppError {
|
|
|
|
|
ret := _m.Called(userID, channelId, parentId)
|
2020-06-16 05:41:05 -04:00
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for PublishUserTyping")
|
|
|
|
|
}
|
|
|
|
|
|
2020-06-16 05:41:05 -04:00
|
|
|
var r0 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, string, string) *model.AppError); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r0 = rf(userID, channelId, parentId)
|
2020-06-16 05:41:05 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0
|
|
|
|
|
}
|
|
|
|
|
|
2018-06-27 08:46:38 -04:00
|
|
|
// PublishWebSocketEvent provides a mock function with given fields: event, payload, broadcast
|
|
|
|
|
func (_m *API) PublishWebSocketEvent(event string, payload map[string]interface{}, broadcast *model.WebsocketBroadcast) {
|
|
|
|
|
_m.Called(event, payload, broadcast)
|
|
|
|
|
}
|
|
|
|
|
|
2018-08-20 12:18:25 -04:00
|
|
|
// ReadFile provides a mock function with given fields: path
|
|
|
|
|
func (_m *API) ReadFile(path string) ([]byte, *model.AppError) {
|
|
|
|
|
ret := _m.Called(path)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for ReadFile")
|
|
|
|
|
}
|
|
|
|
|
|
2018-08-20 12:18:25 -04:00
|
|
|
var r0 []byte
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string) ([]byte, *model.AppError)); ok {
|
|
|
|
|
return rf(path)
|
|
|
|
|
}
|
2018-08-20 12:18:25 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(string) []byte); ok {
|
|
|
|
|
r0 = rf(path)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).([]byte)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string) *model.AppError); ok {
|
|
|
|
|
r1 = rf(path)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-03 14:43:30 -04:00
|
|
|
// RegisterCollectionAndTopic provides a mock function with given fields: collectionType, topicType
|
|
|
|
|
func (_m *API) RegisterCollectionAndTopic(collectionType string, topicType string) error {
|
|
|
|
|
ret := _m.Called(collectionType, topicType)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for RegisterCollectionAndTopic")
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-03 14:43:30 -04:00
|
|
|
var r0 error
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, string) error); ok {
|
|
|
|
|
r0 = rf(collectionType, topicType)
|
|
|
|
|
} else {
|
|
|
|
|
r0 = ret.Error(0)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-15 16:33:47 -04:00
|
|
|
// RegisterCommand provides a mock function with given fields: command
|
2018-06-25 15:33:13 -04:00
|
|
|
func (_m *API) RegisterCommand(command *model.Command) error {
|
2018-05-15 16:33:47 -04:00
|
|
|
ret := _m.Called(command)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for RegisterCommand")
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-15 16:33:47 -04:00
|
|
|
var r0 error
|
|
|
|
|
if rf, ok := ret.Get(0).(func(*model.Command) error); ok {
|
|
|
|
|
r0 = rf(command)
|
|
|
|
|
} else {
|
|
|
|
|
r0 = ret.Error(0)
|
2017-08-28 15:19:00 -04:00
|
|
|
}
|
2018-05-15 16:33:47 -04:00
|
|
|
|
|
|
|
|
return r0
|
2017-08-28 15:19:00 -04:00
|
|
|
}
|
2017-09-21 15:00:14 -04:00
|
|
|
|
Shared channels plugin APIs for MS Teams plugin (#25805)
New plugin APIs and hooks for accessing Shared Channels service via plugin.
- RegisterPluginForSharedChannels(opts model.RegisterPluginOpts) (remoteID string, err error)
- UnregisterPluginForSharedChannels(pluginID string) error
- ShareChannel(sc *model.SharedChannel) (*model.SharedChannel, error)
- UpdateSharedChannel(sc *model.SharedChannel) (*model.SharedChannel, error)
- UnshareChannel(channelID string) (unshared bool, err error)
- UpdateSharedChannelCursor(channelID, remoteID string, cusror model.GetPostsSinceForSyncCursor) error
- SyncSharedChannel(channelID string) error
- InviteRemoteToChannel(channelID string, remoteID string, userID string) error
- UninviteRemoteFromChannel(channelID string, remoteID string) error
Hooks
- OnSharedChannelsSyncMsg(msg *model.SyncMsg, rc *model.RemoteCluster) (model.SyncResponse, error)
- OnSharedChannelsPing(rc *model.RemoteCluster) bool
2023-12-22 17:00:27 -05:00
|
|
|
// RegisterPluginForSharedChannels provides a mock function with given fields: opts
|
|
|
|
|
func (_m *API) RegisterPluginForSharedChannels(opts model.RegisterPluginOpts) (string, error) {
|
|
|
|
|
ret := _m.Called(opts)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for RegisterPluginForSharedChannels")
|
|
|
|
|
}
|
|
|
|
|
|
Shared channels plugin APIs for MS Teams plugin (#25805)
New plugin APIs and hooks for accessing Shared Channels service via plugin.
- RegisterPluginForSharedChannels(opts model.RegisterPluginOpts) (remoteID string, err error)
- UnregisterPluginForSharedChannels(pluginID string) error
- ShareChannel(sc *model.SharedChannel) (*model.SharedChannel, error)
- UpdateSharedChannel(sc *model.SharedChannel) (*model.SharedChannel, error)
- UnshareChannel(channelID string) (unshared bool, err error)
- UpdateSharedChannelCursor(channelID, remoteID string, cusror model.GetPostsSinceForSyncCursor) error
- SyncSharedChannel(channelID string) error
- InviteRemoteToChannel(channelID string, remoteID string, userID string) error
- UninviteRemoteFromChannel(channelID string, remoteID string) error
Hooks
- OnSharedChannelsSyncMsg(msg *model.SyncMsg, rc *model.RemoteCluster) (model.SyncResponse, error)
- OnSharedChannelsPing(rc *model.RemoteCluster) bool
2023-12-22 17:00:27 -05:00
|
|
|
var r0 string
|
|
|
|
|
var r1 error
|
|
|
|
|
if rf, ok := ret.Get(0).(func(model.RegisterPluginOpts) (string, error)); ok {
|
|
|
|
|
return rf(opts)
|
|
|
|
|
}
|
|
|
|
|
if rf, ok := ret.Get(0).(func(model.RegisterPluginOpts) string); ok {
|
|
|
|
|
r0 = rf(opts)
|
|
|
|
|
} else {
|
|
|
|
|
r0 = ret.Get(0).(string)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(model.RegisterPluginOpts) error); ok {
|
|
|
|
|
r1 = rf(opts)
|
|
|
|
|
} else {
|
|
|
|
|
r1 = ret.Error(1)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-10 19:10:28 -04:00
|
|
|
// RegisterPropertyGroup provides a mock function with given fields: name
|
|
|
|
|
func (_m *API) RegisterPropertyGroup(name string) (*model.PropertyGroup, error) {
|
|
|
|
|
ret := _m.Called(name)
|
|
|
|
|
|
|
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for RegisterPropertyGroup")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var r0 *model.PropertyGroup
|
|
|
|
|
var r1 error
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string) (*model.PropertyGroup, error)); ok {
|
|
|
|
|
return rf(name)
|
|
|
|
|
}
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string) *model.PropertyGroup); ok {
|
|
|
|
|
r0 = rf(name)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.PropertyGroup)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string) error); ok {
|
|
|
|
|
r1 = rf(name)
|
|
|
|
|
} else {
|
|
|
|
|
r1 = ret.Error(1)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2018-11-08 13:17:07 -05:00
|
|
|
// RemovePlugin provides a mock function with given fields: id
|
|
|
|
|
func (_m *API) RemovePlugin(id string) *model.AppError {
|
|
|
|
|
ret := _m.Called(id)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for RemovePlugin")
|
|
|
|
|
}
|
|
|
|
|
|
2018-11-08 13:17:07 -05:00
|
|
|
var r0 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string) *model.AppError); ok {
|
|
|
|
|
r0 = rf(id)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0
|
|
|
|
|
}
|
|
|
|
|
|
2018-08-20 12:22:08 -04:00
|
|
|
// RemoveReaction provides a mock function with given fields: reaction
|
|
|
|
|
func (_m *API) RemoveReaction(reaction *model.Reaction) *model.AppError {
|
|
|
|
|
ret := _m.Called(reaction)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for RemoveReaction")
|
|
|
|
|
}
|
|
|
|
|
|
2018-08-20 12:22:08 -04:00
|
|
|
var r0 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(*model.Reaction) *model.AppError); ok {
|
|
|
|
|
r0 = rf(reaction)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
// RemoveTeamIcon provides a mock function with given fields: teamID
|
|
|
|
|
func (_m *API) RemoveTeamIcon(teamID string) *model.AppError {
|
|
|
|
|
ret := _m.Called(teamID)
|
2018-11-20 09:43:42 -05:00
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for RemoveTeamIcon")
|
|
|
|
|
}
|
|
|
|
|
|
2018-11-20 09:43:42 -05:00
|
|
|
var r0 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string) *model.AppError); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r0 = rf(teamID)
|
2018-11-20 09:43:42 -05:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-05-14 04:35:59 -04:00
|
|
|
return r0
|
|
|
|
|
}
|
|
|
|
|
|
2021-11-10 11:11:20 -05:00
|
|
|
// RemoveUserCustomStatus provides a mock function with given fields: userID
|
|
|
|
|
func (_m *API) RemoveUserCustomStatus(userID string) *model.AppError {
|
|
|
|
|
ret := _m.Called(userID)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for RemoveUserCustomStatus")
|
|
|
|
|
}
|
|
|
|
|
|
2021-11-10 11:11:20 -05:00
|
|
|
var r0 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string) *model.AppError); ok {
|
|
|
|
|
r0 = rf(userID)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0
|
|
|
|
|
}
|
|
|
|
|
|
2021-05-14 04:35:59 -04:00
|
|
|
// RequestTrialLicense provides a mock function with given fields: requesterID, users, termsAccepted, receiveEmailsAccepted
|
|
|
|
|
func (_m *API) RequestTrialLicense(requesterID string, users int, termsAccepted bool, receiveEmailsAccepted bool) *model.AppError {
|
|
|
|
|
ret := _m.Called(requesterID, users, termsAccepted, receiveEmailsAccepted)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for RequestTrialLicense")
|
|
|
|
|
}
|
|
|
|
|
|
2021-05-14 04:35:59 -04:00
|
|
|
var r0 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, int, bool, bool) *model.AppError); ok {
|
|
|
|
|
r0 = rf(requesterID, users, termsAccepted, receiveEmailsAccepted)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2018-11-20 09:43:42 -05:00
|
|
|
return r0
|
|
|
|
|
}
|
|
|
|
|
|
2025-03-13 12:00:15 -04:00
|
|
|
// RestoreGroup provides a mock function with given fields: groupID
|
|
|
|
|
func (_m *API) RestoreGroup(groupID string) (*model.Group, *model.AppError) {
|
|
|
|
|
ret := _m.Called(groupID)
|
|
|
|
|
|
|
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for RestoreGroup")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var r0 *model.Group
|
|
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string) (*model.Group, *model.AppError)); ok {
|
|
|
|
|
return rf(groupID)
|
|
|
|
|
}
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string) *model.Group); ok {
|
|
|
|
|
r0 = rf(groupID)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.Group)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string) *model.AppError); ok {
|
|
|
|
|
r1 = rf(groupID)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2021-11-16 09:08:20 -05:00
|
|
|
// RevokeSession provides a mock function with given fields: sessionID
|
|
|
|
|
func (_m *API) RevokeSession(sessionID string) *model.AppError {
|
|
|
|
|
ret := _m.Called(sessionID)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for RevokeSession")
|
|
|
|
|
}
|
|
|
|
|
|
2021-11-16 09:08:20 -05:00
|
|
|
var r0 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string) *model.AppError); ok {
|
|
|
|
|
r0 = rf(sessionID)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0
|
|
|
|
|
}
|
|
|
|
|
|
2021-07-14 09:08:22 -04:00
|
|
|
// RevokeUserAccessToken provides a mock function with given fields: tokenID
|
|
|
|
|
func (_m *API) RevokeUserAccessToken(tokenID string) *model.AppError {
|
|
|
|
|
ret := _m.Called(tokenID)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for RevokeUserAccessToken")
|
|
|
|
|
}
|
|
|
|
|
|
2021-07-14 09:08:22 -04:00
|
|
|
var r0 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string) *model.AppError); ok {
|
|
|
|
|
r0 = rf(tokenID)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0
|
|
|
|
|
}
|
|
|
|
|
|
2021-12-07 12:43:33 -05:00
|
|
|
// RolesGrantPermission provides a mock function with given fields: roleNames, permissionId
|
|
|
|
|
func (_m *API) RolesGrantPermission(roleNames []string, permissionId string) bool {
|
|
|
|
|
ret := _m.Called(roleNames, permissionId)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for RolesGrantPermission")
|
|
|
|
|
}
|
|
|
|
|
|
2021-12-07 12:43:33 -05:00
|
|
|
var r0 bool
|
|
|
|
|
if rf, ok := ret.Get(0).(func([]string, string) bool); ok {
|
|
|
|
|
r0 = rf(roleNames, permissionId)
|
|
|
|
|
} else {
|
|
|
|
|
r0 = ret.Get(0).(bool)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-06 18:32:55 -04:00
|
|
|
// SaveConfig provides a mock function with given fields: config
|
|
|
|
|
func (_m *API) SaveConfig(config *model.Config) *model.AppError {
|
|
|
|
|
ret := _m.Called(config)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for SaveConfig")
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-06 18:32:55 -04:00
|
|
|
var r0 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(*model.Config) *model.AppError); ok {
|
|
|
|
|
r0 = rf(config)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0
|
|
|
|
|
}
|
|
|
|
|
|
2018-11-28 12:01:49 -05:00
|
|
|
// SavePluginConfig provides a mock function with given fields: config
|
|
|
|
|
func (_m *API) SavePluginConfig(config map[string]interface{}) *model.AppError {
|
|
|
|
|
ret := _m.Called(config)
|
2018-11-19 12:27:15 -05:00
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for SavePluginConfig")
|
|
|
|
|
}
|
|
|
|
|
|
2018-11-19 12:27:15 -05:00
|
|
|
var r0 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(map[string]interface{}) *model.AppError); ok {
|
2018-11-28 12:01:49 -05:00
|
|
|
r0 = rf(config)
|
2018-11-19 12:27:15 -05:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
// SearchChannels provides a mock function with given fields: teamID, term
|
|
|
|
|
func (_m *API) SearchChannels(teamID string, term string) ([]*model.Channel, *model.AppError) {
|
|
|
|
|
ret := _m.Called(teamID, term)
|
2018-10-15 12:23:46 -04:00
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for SearchChannels")
|
|
|
|
|
}
|
|
|
|
|
|
2018-11-20 08:50:34 -05:00
|
|
|
var r0 []*model.Channel
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, string) ([]*model.Channel, *model.AppError)); ok {
|
|
|
|
|
return rf(teamID, term)
|
|
|
|
|
}
|
2018-11-20 08:50:34 -05:00
|
|
|
if rf, ok := ret.Get(0).(func(string, string) []*model.Channel); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r0 = rf(teamID, term)
|
2018-10-15 12:23:46 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
2018-11-20 08:50:34 -05:00
|
|
|
r0 = ret.Get(0).([]*model.Channel)
|
2018-10-15 12:23:46 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string, string) *model.AppError); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r1 = rf(teamID, term)
|
2018-10-15 12:23:46 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
// SearchPostsInTeam provides a mock function with given fields: teamID, paramsList
|
|
|
|
|
func (_m *API) SearchPostsInTeam(teamID string, paramsList []*model.SearchParams) ([]*model.Post, *model.AppError) {
|
|
|
|
|
ret := _m.Called(teamID, paramsList)
|
2019-02-13 01:41:32 -05:00
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for SearchPostsInTeam")
|
|
|
|
|
}
|
|
|
|
|
|
2019-02-13 01:41:32 -05:00
|
|
|
var r0 []*model.Post
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, []*model.SearchParams) ([]*model.Post, *model.AppError)); ok {
|
|
|
|
|
return rf(teamID, paramsList)
|
|
|
|
|
}
|
2019-02-13 01:41:32 -05:00
|
|
|
if rf, ok := ret.Get(0).(func(string, []*model.SearchParams) []*model.Post); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r0 = rf(teamID, paramsList)
|
2019-02-13 01:41:32 -05:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).([]*model.Post)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string, []*model.SearchParams) *model.AppError); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r1 = rf(teamID, paramsList)
|
2019-02-13 01:41:32 -05:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
2020-06-23 21:58:44 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
// SearchPostsInTeamForUser provides a mock function with given fields: teamID, userID, searchParams
|
|
|
|
|
func (_m *API) SearchPostsInTeamForUser(teamID string, userID string, searchParams model.SearchParameter) (*model.PostSearchResults, *model.AppError) {
|
|
|
|
|
ret := _m.Called(teamID, userID, searchParams)
|
2020-06-23 21:58:44 -04:00
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for SearchPostsInTeamForUser")
|
|
|
|
|
}
|
|
|
|
|
|
2020-06-23 21:58:44 -04:00
|
|
|
var r0 *model.PostSearchResults
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, string, model.SearchParameter) (*model.PostSearchResults, *model.AppError)); ok {
|
|
|
|
|
return rf(teamID, userID, searchParams)
|
|
|
|
|
}
|
2020-06-23 21:58:44 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(string, string, model.SearchParameter) *model.PostSearchResults); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r0 = rf(teamID, userID, searchParams)
|
2020-06-23 21:58:44 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.PostSearchResults)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string, string, model.SearchParameter) *model.AppError); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r1 = rf(teamID, userID, searchParams)
|
2020-06-23 21:58:44 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
2019-02-13 01:41:32 -05:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2025-09-11 18:56:01 -04:00
|
|
|
// SearchPropertyFields provides a mock function with given fields: groupID, opts
|
|
|
|
|
func (_m *API) SearchPropertyFields(groupID string, opts model.PropertyFieldSearchOpts) ([]*model.PropertyField, error) {
|
|
|
|
|
ret := _m.Called(groupID, opts)
|
2025-06-10 19:10:28 -04:00
|
|
|
|
|
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for SearchPropertyFields")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var r0 []*model.PropertyField
|
|
|
|
|
var r1 error
|
2025-09-11 18:56:01 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(string, model.PropertyFieldSearchOpts) ([]*model.PropertyField, error)); ok {
|
|
|
|
|
return rf(groupID, opts)
|
2025-06-10 19:10:28 -04:00
|
|
|
}
|
2025-09-11 18:56:01 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(string, model.PropertyFieldSearchOpts) []*model.PropertyField); ok {
|
|
|
|
|
r0 = rf(groupID, opts)
|
2025-06-10 19:10:28 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).([]*model.PropertyField)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2025-09-11 18:56:01 -04:00
|
|
|
if rf, ok := ret.Get(1).(func(string, model.PropertyFieldSearchOpts) error); ok {
|
|
|
|
|
r1 = rf(groupID, opts)
|
2025-06-10 19:10:28 -04:00
|
|
|
} else {
|
|
|
|
|
r1 = ret.Error(1)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2025-09-11 18:56:01 -04:00
|
|
|
// SearchPropertyValues provides a mock function with given fields: groupID, opts
|
|
|
|
|
func (_m *API) SearchPropertyValues(groupID string, opts model.PropertyValueSearchOpts) ([]*model.PropertyValue, error) {
|
|
|
|
|
ret := _m.Called(groupID, opts)
|
2025-06-10 19:10:28 -04:00
|
|
|
|
|
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for SearchPropertyValues")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var r0 []*model.PropertyValue
|
|
|
|
|
var r1 error
|
2025-09-11 18:56:01 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(string, model.PropertyValueSearchOpts) ([]*model.PropertyValue, error)); ok {
|
|
|
|
|
return rf(groupID, opts)
|
2025-06-10 19:10:28 -04:00
|
|
|
}
|
2025-09-11 18:56:01 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(string, model.PropertyValueSearchOpts) []*model.PropertyValue); ok {
|
|
|
|
|
r0 = rf(groupID, opts)
|
2025-06-10 19:10:28 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).([]*model.PropertyValue)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2025-09-11 18:56:01 -04:00
|
|
|
if rf, ok := ret.Get(1).(func(string, model.PropertyValueSearchOpts) error); ok {
|
|
|
|
|
r1 = rf(groupID, opts)
|
2025-06-10 19:10:28 -04:00
|
|
|
} else {
|
|
|
|
|
r1 = ret.Error(1)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2019-01-16 03:13:15 -05:00
|
|
|
// SearchTeams provides a mock function with given fields: term
|
|
|
|
|
func (_m *API) SearchTeams(term string) ([]*model.Team, *model.AppError) {
|
|
|
|
|
ret := _m.Called(term)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for SearchTeams")
|
|
|
|
|
}
|
|
|
|
|
|
2019-01-16 03:13:15 -05:00
|
|
|
var r0 []*model.Team
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string) ([]*model.Team, *model.AppError)); ok {
|
|
|
|
|
return rf(term)
|
|
|
|
|
}
|
2019-01-16 03:13:15 -05:00
|
|
|
if rf, ok := ret.Get(0).(func(string) []*model.Team); ok {
|
|
|
|
|
r0 = rf(term)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).([]*model.Team)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string) *model.AppError); ok {
|
|
|
|
|
r1 = rf(term)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2018-11-30 10:47:17 -05:00
|
|
|
// SearchUsers provides a mock function with given fields: search
|
|
|
|
|
func (_m *API) SearchUsers(search *model.UserSearch) ([]*model.User, *model.AppError) {
|
|
|
|
|
ret := _m.Called(search)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for SearchUsers")
|
|
|
|
|
}
|
|
|
|
|
|
2018-11-30 10:47:17 -05:00
|
|
|
var r0 []*model.User
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(*model.UserSearch) ([]*model.User, *model.AppError)); ok {
|
|
|
|
|
return rf(search)
|
|
|
|
|
}
|
2018-11-30 10:47:17 -05:00
|
|
|
if rf, ok := ret.Get(0).(func(*model.UserSearch) []*model.User); ok {
|
|
|
|
|
r0 = rf(search)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).([]*model.User)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(*model.UserSearch) *model.AppError); ok {
|
|
|
|
|
r1 = rf(search)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
// SendEphemeralPost provides a mock function with given fields: userID, post
|
|
|
|
|
func (_m *API) SendEphemeralPost(userID string, post *model.Post) *model.Post {
|
|
|
|
|
ret := _m.Called(userID, post)
|
2018-07-06 18:32:55 -04:00
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for SendEphemeralPost")
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-06 18:32:55 -04:00
|
|
|
var r0 *model.Post
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, *model.Post) *model.Post); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r0 = rf(userID, post)
|
2018-07-06 18:32:55 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.Post)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0
|
|
|
|
|
}
|
|
|
|
|
|
2019-01-10 04:06:14 -05:00
|
|
|
// SendMail provides a mock function with given fields: to, subject, htmlBody
|
|
|
|
|
func (_m *API) SendMail(to string, subject string, htmlBody string) *model.AppError {
|
|
|
|
|
ret := _m.Called(to, subject, htmlBody)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for SendMail")
|
|
|
|
|
}
|
|
|
|
|
|
2019-01-10 04:06:14 -05:00
|
|
|
var r0 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, string, string) *model.AppError); ok {
|
|
|
|
|
r0 = rf(to, subject, htmlBody)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0
|
|
|
|
|
}
|
|
|
|
|
|
2023-08-24 12:33:53 -04:00
|
|
|
// SendPushNotification provides a mock function with given fields: notification, userID
|
|
|
|
|
func (_m *API) SendPushNotification(notification *model.PushNotification, userID string) *model.AppError {
|
|
|
|
|
ret := _m.Called(notification, userID)
|
2023-08-18 13:05:26 -04:00
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for SendPushNotification")
|
|
|
|
|
}
|
|
|
|
|
|
2023-08-24 12:33:53 -04:00
|
|
|
var r0 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(*model.PushNotification, string) *model.AppError); ok {
|
|
|
|
|
r0 = rf(notification, userID)
|
2023-08-18 13:05:26 -04:00
|
|
|
} else {
|
2023-08-24 12:33:53 -04:00
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.AppError)
|
|
|
|
|
}
|
2023-08-18 13:05:26 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0
|
|
|
|
|
}
|
|
|
|
|
|
2023-08-30 16:43:40 -04:00
|
|
|
// SetFileSearchableContent provides a mock function with given fields: fileID, content
|
|
|
|
|
func (_m *API) SetFileSearchableContent(fileID string, content string) *model.AppError {
|
|
|
|
|
ret := _m.Called(fileID, content)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for SetFileSearchableContent")
|
|
|
|
|
}
|
|
|
|
|
|
2023-08-30 16:43:40 -04:00
|
|
|
var r0 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, string) *model.AppError); ok {
|
|
|
|
|
r0 = rf(fileID, content)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
// SetProfileImage provides a mock function with given fields: userID, data
|
|
|
|
|
func (_m *API) SetProfileImage(userID string, data []byte) *model.AppError {
|
|
|
|
|
ret := _m.Called(userID, data)
|
2018-11-15 15:23:03 -05:00
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for SetProfileImage")
|
|
|
|
|
}
|
|
|
|
|
|
2018-11-15 15:23:03 -05:00
|
|
|
var r0 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, []byte) *model.AppError); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r0 = rf(userID, data)
|
2018-11-15 15:23:03 -05:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
// SetTeamIcon provides a mock function with given fields: teamID, data
|
|
|
|
|
func (_m *API) SetTeamIcon(teamID string, data []byte) *model.AppError {
|
|
|
|
|
ret := _m.Called(teamID, data)
|
2018-11-16 10:52:07 -05:00
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for SetTeamIcon")
|
|
|
|
|
}
|
|
|
|
|
|
2018-11-16 10:52:07 -05:00
|
|
|
var r0 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, []byte) *model.AppError); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r0 = rf(teamID, data)
|
2018-11-16 10:52:07 -05:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0
|
|
|
|
|
}
|
|
|
|
|
|
2021-06-16 14:38:26 -04:00
|
|
|
// SetUserStatusTimedDND provides a mock function with given fields: userId, endtime
|
|
|
|
|
func (_m *API) SetUserStatusTimedDND(userId string, endtime int64) (*model.Status, *model.AppError) {
|
|
|
|
|
ret := _m.Called(userId, endtime)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for SetUserStatusTimedDND")
|
|
|
|
|
}
|
|
|
|
|
|
2021-06-16 14:38:26 -04:00
|
|
|
var r0 *model.Status
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, int64) (*model.Status, *model.AppError)); ok {
|
|
|
|
|
return rf(userId, endtime)
|
|
|
|
|
}
|
2021-06-16 14:38:26 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(string, int64) *model.Status); ok {
|
|
|
|
|
r0 = rf(userId, endtime)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.Status)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string, int64) *model.AppError); ok {
|
|
|
|
|
r1 = rf(userId, endtime)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
Shared channels plugin APIs for MS Teams plugin (#25805)
New plugin APIs and hooks for accessing Shared Channels service via plugin.
- RegisterPluginForSharedChannels(opts model.RegisterPluginOpts) (remoteID string, err error)
- UnregisterPluginForSharedChannels(pluginID string) error
- ShareChannel(sc *model.SharedChannel) (*model.SharedChannel, error)
- UpdateSharedChannel(sc *model.SharedChannel) (*model.SharedChannel, error)
- UnshareChannel(channelID string) (unshared bool, err error)
- UpdateSharedChannelCursor(channelID, remoteID string, cusror model.GetPostsSinceForSyncCursor) error
- SyncSharedChannel(channelID string) error
- InviteRemoteToChannel(channelID string, remoteID string, userID string) error
- UninviteRemoteFromChannel(channelID string, remoteID string) error
Hooks
- OnSharedChannelsSyncMsg(msg *model.SyncMsg, rc *model.RemoteCluster) (model.SyncResponse, error)
- OnSharedChannelsPing(rc *model.RemoteCluster) bool
2023-12-22 17:00:27 -05:00
|
|
|
// ShareChannel provides a mock function with given fields: sc
|
|
|
|
|
func (_m *API) ShareChannel(sc *model.SharedChannel) (*model.SharedChannel, error) {
|
|
|
|
|
ret := _m.Called(sc)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for ShareChannel")
|
|
|
|
|
}
|
|
|
|
|
|
Shared channels plugin APIs for MS Teams plugin (#25805)
New plugin APIs and hooks for accessing Shared Channels service via plugin.
- RegisterPluginForSharedChannels(opts model.RegisterPluginOpts) (remoteID string, err error)
- UnregisterPluginForSharedChannels(pluginID string) error
- ShareChannel(sc *model.SharedChannel) (*model.SharedChannel, error)
- UpdateSharedChannel(sc *model.SharedChannel) (*model.SharedChannel, error)
- UnshareChannel(channelID string) (unshared bool, err error)
- UpdateSharedChannelCursor(channelID, remoteID string, cusror model.GetPostsSinceForSyncCursor) error
- SyncSharedChannel(channelID string) error
- InviteRemoteToChannel(channelID string, remoteID string, userID string) error
- UninviteRemoteFromChannel(channelID string, remoteID string) error
Hooks
- OnSharedChannelsSyncMsg(msg *model.SyncMsg, rc *model.RemoteCluster) (model.SyncResponse, error)
- OnSharedChannelsPing(rc *model.RemoteCluster) bool
2023-12-22 17:00:27 -05:00
|
|
|
var r0 *model.SharedChannel
|
|
|
|
|
var r1 error
|
|
|
|
|
if rf, ok := ret.Get(0).(func(*model.SharedChannel) (*model.SharedChannel, error)); ok {
|
|
|
|
|
return rf(sc)
|
|
|
|
|
}
|
|
|
|
|
if rf, ok := ret.Get(0).(func(*model.SharedChannel) *model.SharedChannel); ok {
|
|
|
|
|
r0 = rf(sc)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.SharedChannel)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(*model.SharedChannel) error); ok {
|
|
|
|
|
r1 = rf(sc)
|
|
|
|
|
} else {
|
|
|
|
|
r1 = ret.Error(1)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// SyncSharedChannel provides a mock function with given fields: channelID
|
|
|
|
|
func (_m *API) SyncSharedChannel(channelID string) error {
|
|
|
|
|
ret := _m.Called(channelID)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for SyncSharedChannel")
|
|
|
|
|
}
|
|
|
|
|
|
Shared channels plugin APIs for MS Teams plugin (#25805)
New plugin APIs and hooks for accessing Shared Channels service via plugin.
- RegisterPluginForSharedChannels(opts model.RegisterPluginOpts) (remoteID string, err error)
- UnregisterPluginForSharedChannels(pluginID string) error
- ShareChannel(sc *model.SharedChannel) (*model.SharedChannel, error)
- UpdateSharedChannel(sc *model.SharedChannel) (*model.SharedChannel, error)
- UnshareChannel(channelID string) (unshared bool, err error)
- UpdateSharedChannelCursor(channelID, remoteID string, cusror model.GetPostsSinceForSyncCursor) error
- SyncSharedChannel(channelID string) error
- InviteRemoteToChannel(channelID string, remoteID string, userID string) error
- UninviteRemoteFromChannel(channelID string, remoteID string) error
Hooks
- OnSharedChannelsSyncMsg(msg *model.SyncMsg, rc *model.RemoteCluster) (model.SyncResponse, error)
- OnSharedChannelsPing(rc *model.RemoteCluster) bool
2023-12-22 17:00:27 -05:00
|
|
|
var r0 error
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string) error); ok {
|
|
|
|
|
r0 = rf(channelID)
|
|
|
|
|
} else {
|
|
|
|
|
r0 = ret.Error(0)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// UninviteRemoteFromChannel provides a mock function with given fields: channelID, remoteID
|
|
|
|
|
func (_m *API) UninviteRemoteFromChannel(channelID string, remoteID string) error {
|
|
|
|
|
ret := _m.Called(channelID, remoteID)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for UninviteRemoteFromChannel")
|
|
|
|
|
}
|
|
|
|
|
|
Shared channels plugin APIs for MS Teams plugin (#25805)
New plugin APIs and hooks for accessing Shared Channels service via plugin.
- RegisterPluginForSharedChannels(opts model.RegisterPluginOpts) (remoteID string, err error)
- UnregisterPluginForSharedChannels(pluginID string) error
- ShareChannel(sc *model.SharedChannel) (*model.SharedChannel, error)
- UpdateSharedChannel(sc *model.SharedChannel) (*model.SharedChannel, error)
- UnshareChannel(channelID string) (unshared bool, err error)
- UpdateSharedChannelCursor(channelID, remoteID string, cusror model.GetPostsSinceForSyncCursor) error
- SyncSharedChannel(channelID string) error
- InviteRemoteToChannel(channelID string, remoteID string, userID string) error
- UninviteRemoteFromChannel(channelID string, remoteID string) error
Hooks
- OnSharedChannelsSyncMsg(msg *model.SyncMsg, rc *model.RemoteCluster) (model.SyncResponse, error)
- OnSharedChannelsPing(rc *model.RemoteCluster) bool
2023-12-22 17:00:27 -05:00
|
|
|
var r0 error
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, string) error); ok {
|
|
|
|
|
r0 = rf(channelID, remoteID)
|
|
|
|
|
} else {
|
|
|
|
|
r0 = ret.Error(0)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
// UnregisterCommand provides a mock function with given fields: teamID, trigger
|
|
|
|
|
func (_m *API) UnregisterCommand(teamID string, trigger string) error {
|
|
|
|
|
ret := _m.Called(teamID, trigger)
|
2018-05-15 16:33:47 -04:00
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for UnregisterCommand")
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-15 16:33:47 -04:00
|
|
|
var r0 error
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, string) error); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r0 = rf(teamID, trigger)
|
2018-05-15 16:33:47 -04:00
|
|
|
} else {
|
|
|
|
|
r0 = ret.Error(0)
|
2017-09-21 15:00:14 -04:00
|
|
|
}
|
2018-05-15 16:33:47 -04:00
|
|
|
|
|
|
|
|
return r0
|
2017-09-21 15:00:14 -04:00
|
|
|
}
|
|
|
|
|
|
Shared channels plugin APIs for MS Teams plugin (#25805)
New plugin APIs and hooks for accessing Shared Channels service via plugin.
- RegisterPluginForSharedChannels(opts model.RegisterPluginOpts) (remoteID string, err error)
- UnregisterPluginForSharedChannels(pluginID string) error
- ShareChannel(sc *model.SharedChannel) (*model.SharedChannel, error)
- UpdateSharedChannel(sc *model.SharedChannel) (*model.SharedChannel, error)
- UnshareChannel(channelID string) (unshared bool, err error)
- UpdateSharedChannelCursor(channelID, remoteID string, cusror model.GetPostsSinceForSyncCursor) error
- SyncSharedChannel(channelID string) error
- InviteRemoteToChannel(channelID string, remoteID string, userID string) error
- UninviteRemoteFromChannel(channelID string, remoteID string) error
Hooks
- OnSharedChannelsSyncMsg(msg *model.SyncMsg, rc *model.RemoteCluster) (model.SyncResponse, error)
- OnSharedChannelsPing(rc *model.RemoteCluster) bool
2023-12-22 17:00:27 -05:00
|
|
|
// UnregisterPluginForSharedChannels provides a mock function with given fields: pluginID
|
|
|
|
|
func (_m *API) UnregisterPluginForSharedChannels(pluginID string) error {
|
|
|
|
|
ret := _m.Called(pluginID)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for UnregisterPluginForSharedChannels")
|
|
|
|
|
}
|
|
|
|
|
|
Shared channels plugin APIs for MS Teams plugin (#25805)
New plugin APIs and hooks for accessing Shared Channels service via plugin.
- RegisterPluginForSharedChannels(opts model.RegisterPluginOpts) (remoteID string, err error)
- UnregisterPluginForSharedChannels(pluginID string) error
- ShareChannel(sc *model.SharedChannel) (*model.SharedChannel, error)
- UpdateSharedChannel(sc *model.SharedChannel) (*model.SharedChannel, error)
- UnshareChannel(channelID string) (unshared bool, err error)
- UpdateSharedChannelCursor(channelID, remoteID string, cusror model.GetPostsSinceForSyncCursor) error
- SyncSharedChannel(channelID string) error
- InviteRemoteToChannel(channelID string, remoteID string, userID string) error
- UninviteRemoteFromChannel(channelID string, remoteID string) error
Hooks
- OnSharedChannelsSyncMsg(msg *model.SyncMsg, rc *model.RemoteCluster) (model.SyncResponse, error)
- OnSharedChannelsPing(rc *model.RemoteCluster) bool
2023-12-22 17:00:27 -05:00
|
|
|
var r0 error
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string) error); ok {
|
|
|
|
|
r0 = rf(pluginID)
|
|
|
|
|
} else {
|
|
|
|
|
r0 = ret.Error(0)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// UnshareChannel provides a mock function with given fields: channelID
|
|
|
|
|
func (_m *API) UnshareChannel(channelID string) (bool, error) {
|
|
|
|
|
ret := _m.Called(channelID)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for UnshareChannel")
|
|
|
|
|
}
|
|
|
|
|
|
Shared channels plugin APIs for MS Teams plugin (#25805)
New plugin APIs and hooks for accessing Shared Channels service via plugin.
- RegisterPluginForSharedChannels(opts model.RegisterPluginOpts) (remoteID string, err error)
- UnregisterPluginForSharedChannels(pluginID string) error
- ShareChannel(sc *model.SharedChannel) (*model.SharedChannel, error)
- UpdateSharedChannel(sc *model.SharedChannel) (*model.SharedChannel, error)
- UnshareChannel(channelID string) (unshared bool, err error)
- UpdateSharedChannelCursor(channelID, remoteID string, cusror model.GetPostsSinceForSyncCursor) error
- SyncSharedChannel(channelID string) error
- InviteRemoteToChannel(channelID string, remoteID string, userID string) error
- UninviteRemoteFromChannel(channelID string, remoteID string) error
Hooks
- OnSharedChannelsSyncMsg(msg *model.SyncMsg, rc *model.RemoteCluster) (model.SyncResponse, error)
- OnSharedChannelsPing(rc *model.RemoteCluster) bool
2023-12-22 17:00:27 -05:00
|
|
|
var r0 bool
|
|
|
|
|
var r1 error
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string) (bool, error)); ok {
|
|
|
|
|
return rf(channelID)
|
|
|
|
|
}
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string) bool); ok {
|
|
|
|
|
r0 = rf(channelID)
|
|
|
|
|
} else {
|
|
|
|
|
r0 = ret.Get(0).(bool)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string) error); ok {
|
|
|
|
|
r1 = rf(channelID)
|
|
|
|
|
} else {
|
|
|
|
|
r1 = ret.Error(1)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
MM-12393 Server side of bot accounts. (#10378)
* bots model, store and api (#9903)
* bots model, store and api
Fixes: MM-13100, MM-13101, MM-13103, MM-13105, MMM-13119
* uncomment tests incorrectly commented, and fix merge issues
* add etags support
* add missing licenses
* remove unused sqlbuilder.go (for now...)
* rejig permissions
* split out READ_BOTS into READ_BOTS and READ_OTHERS_BOTS, the latter
implicitly allowing the former
* make MANAGE_OTHERS_BOTS imply MANAGE_BOTS
* conform to general rest api pattern
* eliminate redundant http.StatusOK
* Update api4/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* s/model.UserFromBotModel/model.UserFromBot/g
* Update model/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* Update model/client4.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* move sessionHasPermissionToManageBot to app/authorization.go
* use api.ApiSessionRequired for createBot
* introduce BOT_DESCRIPTION_MAX_RUNES constant
* MM-13512 Prevent getting a user by email based on privacy settings (#10021)
* MM-13512 Prevent getting a user by email based on privacy settings
* Add additional config settings to tests
* upgrade db to 5.7 (#10019)
* MM-13526 Add validation when setting a user's Locale field (#10022)
* Fix typos (#10024)
* Fixing first user being created with system admin privilages without being explicity specified. (#10014)
* Revert "Support for Embeded chat (#9129)" (#10017)
This reverts commit 3fcecd521a5c6ccfdb52fb4c3fb1f8c6ea528a4e.
* s/DisableBot/UpdateBotActive
* add permissions on upgrade
* Update NOTICE.txt (#10054)
- add new dependency (text)
- handle switch to forked dependency (go-gomail -> go-mail)
- misc copyright owner updates
* avoid leaking bot knowledge without permission
* [GH-6798] added a new api endpoint to get the bulk reactions for posts (#10049)
* 6798 added a new api to get the bulk reactions for posts
* 6798 added the permsission check before getting the reactions
* GH-6798 added a new app function for the new endpoint
* 6798 added a store method to get reactions for multiple posts
* 6798 connected the app function with the new store function
* 6798 fixed the review comments
* MM-13559 Update model.post.is_valid.file_ids.app_error text per report (#10055)
Ticket: https://mattermost.atlassian.net/browse/MM-13559
Report: https://github.com/mattermost/mattermost-server/issues/10023
* Trigger Login Hooks with OAuth (#10061)
* make BotStore.GetAll deterministic even on duplicate CreateAt
* fix spurious TestMuteCommandSpecificChannel test failure
See
https://community-daily.mattermost.com/core/pl/px9p8s3dzbg1pf3ddrm5cr36uw
* fix race in TestExportUserChannels
* TestExportUserChannels: remove SaveMember call, as it is redundant and used to be silently failing anyway
* MM-13117: bot tokens (#10111)
* eliminate redundant Client/AdminClient declarations
* harden TestUpdateChannelScheme to API failures
* eliminate unnecessary config restoration
* minor cleanup
* make TestGenerateMfaSecret config dependency explicit
* TestCreateUserAccessToken for bots
* TestGetUserAccessToken* for bots
* leverage SessionHasPermissionToUserOrBot for user token APIs
* Test(Revoke|Disable|Enable)UserAccessToken
* make EnableUserAccessTokens explicit, so as to not rely on local config.json
* uncomment TestResetPassword, but still skip
* mark assert(Invalid)Token as helper
* fix whitespace issues
* fix mangled comments
* MM-13116: bot plugin api (#10113)
* MM-13117: expose bot API to plugins
This also changes the `CreatorId` column definition to allow for plugin
ids, as the default unless the plugin overrides is to use the plugin id
here. This branch hasn't hit master yet, so no migration needed.
* gofmt issues
* expunge use of BotList in plugin/client API
* introduce model.BotGetOptions
* use botUserId term for clarity
* MM-13129 Adding functionality to deal with orphaned bots (#10238)
* Add way to list orphaned bots.
* Add /assign route to modify ownership of bot accounts.
* Apply suggestions from code review
Co-Authored-By: crspeller <crspeller@gmail.com>
* MM-13120: add IsBot field to returned user objects (#10103)
* MM-13104: forbid bot login (#10251)
* MM-13104: disallow bot login
* fix shadowing
* MM-13136 Disable user bots when user is disabled. (#10293)
* Disable user bots when user is disabled.
* Grammer.
Co-Authored-By: crspeller <crspeller@gmail.com>
* Fixing bot branch for test changes.
* Don't use external dependancies in bot plugin tests.
* Rename bot CreatorId to OwnerId
* Adding ability to re-enable bots
* Fixing IsBot to not attempt to be saved to DB.
* Adding diagnostics and licencing counting for bot accounts.
* Modifying gorp to allow reading of '-' fields.
* Removing unnessisary nil values from UserCountOptions.
* Changing comment to GoDoc format
* Improving user count SQL
* Some improvments from feedback.
* Omit empty on User.IsBot
2019-03-05 10:06:45 -05:00
|
|
|
// UpdateBotActive provides a mock function with given fields: botUserId, active
|
|
|
|
|
func (_m *API) UpdateBotActive(botUserId string, active bool) (*model.Bot, *model.AppError) {
|
|
|
|
|
ret := _m.Called(botUserId, active)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for UpdateBotActive")
|
|
|
|
|
}
|
|
|
|
|
|
MM-12393 Server side of bot accounts. (#10378)
* bots model, store and api (#9903)
* bots model, store and api
Fixes: MM-13100, MM-13101, MM-13103, MM-13105, MMM-13119
* uncomment tests incorrectly commented, and fix merge issues
* add etags support
* add missing licenses
* remove unused sqlbuilder.go (for now...)
* rejig permissions
* split out READ_BOTS into READ_BOTS and READ_OTHERS_BOTS, the latter
implicitly allowing the former
* make MANAGE_OTHERS_BOTS imply MANAGE_BOTS
* conform to general rest api pattern
* eliminate redundant http.StatusOK
* Update api4/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* s/model.UserFromBotModel/model.UserFromBot/g
* Update model/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* Update model/client4.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* move sessionHasPermissionToManageBot to app/authorization.go
* use api.ApiSessionRequired for createBot
* introduce BOT_DESCRIPTION_MAX_RUNES constant
* MM-13512 Prevent getting a user by email based on privacy settings (#10021)
* MM-13512 Prevent getting a user by email based on privacy settings
* Add additional config settings to tests
* upgrade db to 5.7 (#10019)
* MM-13526 Add validation when setting a user's Locale field (#10022)
* Fix typos (#10024)
* Fixing first user being created with system admin privilages without being explicity specified. (#10014)
* Revert "Support for Embeded chat (#9129)" (#10017)
This reverts commit 3fcecd521a5c6ccfdb52fb4c3fb1f8c6ea528a4e.
* s/DisableBot/UpdateBotActive
* add permissions on upgrade
* Update NOTICE.txt (#10054)
- add new dependency (text)
- handle switch to forked dependency (go-gomail -> go-mail)
- misc copyright owner updates
* avoid leaking bot knowledge without permission
* [GH-6798] added a new api endpoint to get the bulk reactions for posts (#10049)
* 6798 added a new api to get the bulk reactions for posts
* 6798 added the permsission check before getting the reactions
* GH-6798 added a new app function for the new endpoint
* 6798 added a store method to get reactions for multiple posts
* 6798 connected the app function with the new store function
* 6798 fixed the review comments
* MM-13559 Update model.post.is_valid.file_ids.app_error text per report (#10055)
Ticket: https://mattermost.atlassian.net/browse/MM-13559
Report: https://github.com/mattermost/mattermost-server/issues/10023
* Trigger Login Hooks with OAuth (#10061)
* make BotStore.GetAll deterministic even on duplicate CreateAt
* fix spurious TestMuteCommandSpecificChannel test failure
See
https://community-daily.mattermost.com/core/pl/px9p8s3dzbg1pf3ddrm5cr36uw
* fix race in TestExportUserChannels
* TestExportUserChannels: remove SaveMember call, as it is redundant and used to be silently failing anyway
* MM-13117: bot tokens (#10111)
* eliminate redundant Client/AdminClient declarations
* harden TestUpdateChannelScheme to API failures
* eliminate unnecessary config restoration
* minor cleanup
* make TestGenerateMfaSecret config dependency explicit
* TestCreateUserAccessToken for bots
* TestGetUserAccessToken* for bots
* leverage SessionHasPermissionToUserOrBot for user token APIs
* Test(Revoke|Disable|Enable)UserAccessToken
* make EnableUserAccessTokens explicit, so as to not rely on local config.json
* uncomment TestResetPassword, but still skip
* mark assert(Invalid)Token as helper
* fix whitespace issues
* fix mangled comments
* MM-13116: bot plugin api (#10113)
* MM-13117: expose bot API to plugins
This also changes the `CreatorId` column definition to allow for plugin
ids, as the default unless the plugin overrides is to use the plugin id
here. This branch hasn't hit master yet, so no migration needed.
* gofmt issues
* expunge use of BotList in plugin/client API
* introduce model.BotGetOptions
* use botUserId term for clarity
* MM-13129 Adding functionality to deal with orphaned bots (#10238)
* Add way to list orphaned bots.
* Add /assign route to modify ownership of bot accounts.
* Apply suggestions from code review
Co-Authored-By: crspeller <crspeller@gmail.com>
* MM-13120: add IsBot field to returned user objects (#10103)
* MM-13104: forbid bot login (#10251)
* MM-13104: disallow bot login
* fix shadowing
* MM-13136 Disable user bots when user is disabled. (#10293)
* Disable user bots when user is disabled.
* Grammer.
Co-Authored-By: crspeller <crspeller@gmail.com>
* Fixing bot branch for test changes.
* Don't use external dependancies in bot plugin tests.
* Rename bot CreatorId to OwnerId
* Adding ability to re-enable bots
* Fixing IsBot to not attempt to be saved to DB.
* Adding diagnostics and licencing counting for bot accounts.
* Modifying gorp to allow reading of '-' fields.
* Removing unnessisary nil values from UserCountOptions.
* Changing comment to GoDoc format
* Improving user count SQL
* Some improvments from feedback.
* Omit empty on User.IsBot
2019-03-05 10:06:45 -05:00
|
|
|
var r0 *model.Bot
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, bool) (*model.Bot, *model.AppError)); ok {
|
|
|
|
|
return rf(botUserId, active)
|
|
|
|
|
}
|
MM-12393 Server side of bot accounts. (#10378)
* bots model, store and api (#9903)
* bots model, store and api
Fixes: MM-13100, MM-13101, MM-13103, MM-13105, MMM-13119
* uncomment tests incorrectly commented, and fix merge issues
* add etags support
* add missing licenses
* remove unused sqlbuilder.go (for now...)
* rejig permissions
* split out READ_BOTS into READ_BOTS and READ_OTHERS_BOTS, the latter
implicitly allowing the former
* make MANAGE_OTHERS_BOTS imply MANAGE_BOTS
* conform to general rest api pattern
* eliminate redundant http.StatusOK
* Update api4/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* s/model.UserFromBotModel/model.UserFromBot/g
* Update model/bot.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* Update model/client4.go
Co-Authored-By: lieut-data <jesse.hallam@gmail.com>
* move sessionHasPermissionToManageBot to app/authorization.go
* use api.ApiSessionRequired for createBot
* introduce BOT_DESCRIPTION_MAX_RUNES constant
* MM-13512 Prevent getting a user by email based on privacy settings (#10021)
* MM-13512 Prevent getting a user by email based on privacy settings
* Add additional config settings to tests
* upgrade db to 5.7 (#10019)
* MM-13526 Add validation when setting a user's Locale field (#10022)
* Fix typos (#10024)
* Fixing first user being created with system admin privilages without being explicity specified. (#10014)
* Revert "Support for Embeded chat (#9129)" (#10017)
This reverts commit 3fcecd521a5c6ccfdb52fb4c3fb1f8c6ea528a4e.
* s/DisableBot/UpdateBotActive
* add permissions on upgrade
* Update NOTICE.txt (#10054)
- add new dependency (text)
- handle switch to forked dependency (go-gomail -> go-mail)
- misc copyright owner updates
* avoid leaking bot knowledge without permission
* [GH-6798] added a new api endpoint to get the bulk reactions for posts (#10049)
* 6798 added a new api to get the bulk reactions for posts
* 6798 added the permsission check before getting the reactions
* GH-6798 added a new app function for the new endpoint
* 6798 added a store method to get reactions for multiple posts
* 6798 connected the app function with the new store function
* 6798 fixed the review comments
* MM-13559 Update model.post.is_valid.file_ids.app_error text per report (#10055)
Ticket: https://mattermost.atlassian.net/browse/MM-13559
Report: https://github.com/mattermost/mattermost-server/issues/10023
* Trigger Login Hooks with OAuth (#10061)
* make BotStore.GetAll deterministic even on duplicate CreateAt
* fix spurious TestMuteCommandSpecificChannel test failure
See
https://community-daily.mattermost.com/core/pl/px9p8s3dzbg1pf3ddrm5cr36uw
* fix race in TestExportUserChannels
* TestExportUserChannels: remove SaveMember call, as it is redundant and used to be silently failing anyway
* MM-13117: bot tokens (#10111)
* eliminate redundant Client/AdminClient declarations
* harden TestUpdateChannelScheme to API failures
* eliminate unnecessary config restoration
* minor cleanup
* make TestGenerateMfaSecret config dependency explicit
* TestCreateUserAccessToken for bots
* TestGetUserAccessToken* for bots
* leverage SessionHasPermissionToUserOrBot for user token APIs
* Test(Revoke|Disable|Enable)UserAccessToken
* make EnableUserAccessTokens explicit, so as to not rely on local config.json
* uncomment TestResetPassword, but still skip
* mark assert(Invalid)Token as helper
* fix whitespace issues
* fix mangled comments
* MM-13116: bot plugin api (#10113)
* MM-13117: expose bot API to plugins
This also changes the `CreatorId` column definition to allow for plugin
ids, as the default unless the plugin overrides is to use the plugin id
here. This branch hasn't hit master yet, so no migration needed.
* gofmt issues
* expunge use of BotList in plugin/client API
* introduce model.BotGetOptions
* use botUserId term for clarity
* MM-13129 Adding functionality to deal with orphaned bots (#10238)
* Add way to list orphaned bots.
* Add /assign route to modify ownership of bot accounts.
* Apply suggestions from code review
Co-Authored-By: crspeller <crspeller@gmail.com>
* MM-13120: add IsBot field to returned user objects (#10103)
* MM-13104: forbid bot login (#10251)
* MM-13104: disallow bot login
* fix shadowing
* MM-13136 Disable user bots when user is disabled. (#10293)
* Disable user bots when user is disabled.
* Grammer.
Co-Authored-By: crspeller <crspeller@gmail.com>
* Fixing bot branch for test changes.
* Don't use external dependancies in bot plugin tests.
* Rename bot CreatorId to OwnerId
* Adding ability to re-enable bots
* Fixing IsBot to not attempt to be saved to DB.
* Adding diagnostics and licencing counting for bot accounts.
* Modifying gorp to allow reading of '-' fields.
* Removing unnessisary nil values from UserCountOptions.
* Changing comment to GoDoc format
* Improving user count SQL
* Some improvments from feedback.
* Omit empty on User.IsBot
2019-03-05 10:06:45 -05:00
|
|
|
if rf, ok := ret.Get(0).(func(string, bool) *model.Bot); ok {
|
|
|
|
|
r0 = rf(botUserId, active)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.Bot)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string, bool) *model.AppError); ok {
|
|
|
|
|
r1 = rf(botUserId, active)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-15 16:33:47 -04:00
|
|
|
// UpdateChannel provides a mock function with given fields: channel
|
2018-06-25 15:33:13 -04:00
|
|
|
func (_m *API) UpdateChannel(channel *model.Channel) (*model.Channel, *model.AppError) {
|
2018-05-15 16:33:47 -04:00
|
|
|
ret := _m.Called(channel)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for UpdateChannel")
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-15 16:33:47 -04:00
|
|
|
var r0 *model.Channel
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(*model.Channel) (*model.Channel, *model.AppError)); ok {
|
|
|
|
|
return rf(channel)
|
|
|
|
|
}
|
2018-05-15 16:33:47 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(*model.Channel) *model.Channel); ok {
|
|
|
|
|
r0 = rf(channel)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.Channel)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(*model.Channel) *model.AppError); ok {
|
|
|
|
|
r1 = rf(channel)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
2017-09-21 15:00:14 -04:00
|
|
|
}
|
2018-05-15 16:33:47 -04:00
|
|
|
|
|
|
|
|
return r0, r1
|
2017-09-21 15:00:14 -04:00
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
// UpdateChannelMemberNotifications provides a mock function with given fields: channelId, userID, notifications
|
|
|
|
|
func (_m *API) UpdateChannelMemberNotifications(channelId string, userID string, notifications map[string]string) (*model.ChannelMember, *model.AppError) {
|
|
|
|
|
ret := _m.Called(channelId, userID, notifications)
|
2018-05-15 16:33:47 -04:00
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for UpdateChannelMemberNotifications")
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-15 16:33:47 -04:00
|
|
|
var r0 *model.ChannelMember
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, string, map[string]string) (*model.ChannelMember, *model.AppError)); ok {
|
|
|
|
|
return rf(channelId, userID, notifications)
|
|
|
|
|
}
|
2018-05-15 16:33:47 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(string, string, map[string]string) *model.ChannelMember); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r0 = rf(channelId, userID, notifications)
|
2018-05-15 16:33:47 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.ChannelMember)
|
|
|
|
|
}
|
2017-09-21 15:00:14 -04:00
|
|
|
}
|
2018-05-15 16:33:47 -04:00
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string, string, map[string]string) *model.AppError); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r1 = rf(channelId, userID, notifications)
|
2018-05-15 16:33:47 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
2017-09-21 15:00:14 -04:00
|
|
|
}
|
2017-11-27 17:23:35 -05:00
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
// UpdateChannelMemberRoles provides a mock function with given fields: channelId, userID, newRoles
|
|
|
|
|
func (_m *API) UpdateChannelMemberRoles(channelId string, userID string, newRoles string) (*model.ChannelMember, *model.AppError) {
|
|
|
|
|
ret := _m.Called(channelId, userID, newRoles)
|
2018-05-15 16:33:47 -04:00
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for UpdateChannelMemberRoles")
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-15 16:33:47 -04:00
|
|
|
var r0 *model.ChannelMember
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, string, string) (*model.ChannelMember, *model.AppError)); ok {
|
|
|
|
|
return rf(channelId, userID, newRoles)
|
|
|
|
|
}
|
2018-05-15 16:33:47 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(string, string, string) *model.ChannelMember); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r0 = rf(channelId, userID, newRoles)
|
2018-05-15 16:33:47 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.ChannelMember)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string, string, string) *model.AppError); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r1 = rf(channelId, userID, newRoles)
|
2018-05-15 16:33:47 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
2017-11-27 17:23:35 -05:00
|
|
|
}
|
|
|
|
|
|
2021-06-25 12:52:09 -04:00
|
|
|
// UpdateChannelSidebarCategories provides a mock function with given fields: userID, teamID, categories
|
|
|
|
|
func (_m *API) UpdateChannelSidebarCategories(userID string, teamID string, categories []*model.SidebarCategoryWithChannels) ([]*model.SidebarCategoryWithChannels, *model.AppError) {
|
|
|
|
|
ret := _m.Called(userID, teamID, categories)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for UpdateChannelSidebarCategories")
|
|
|
|
|
}
|
|
|
|
|
|
2021-06-25 12:52:09 -04:00
|
|
|
var r0 []*model.SidebarCategoryWithChannels
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, string, []*model.SidebarCategoryWithChannels) ([]*model.SidebarCategoryWithChannels, *model.AppError)); ok {
|
|
|
|
|
return rf(userID, teamID, categories)
|
|
|
|
|
}
|
2021-06-25 12:52:09 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(string, string, []*model.SidebarCategoryWithChannels) []*model.SidebarCategoryWithChannels); ok {
|
|
|
|
|
r0 = rf(userID, teamID, categories)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).([]*model.SidebarCategoryWithChannels)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string, string, []*model.SidebarCategoryWithChannels) *model.AppError); ok {
|
|
|
|
|
r1 = rf(userID, teamID, categories)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2020-07-31 11:40:15 -04:00
|
|
|
// UpdateCommand provides a mock function with given fields: commandID, updatedCmd
|
|
|
|
|
func (_m *API) UpdateCommand(commandID string, updatedCmd *model.Command) (*model.Command, error) {
|
|
|
|
|
ret := _m.Called(commandID, updatedCmd)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for UpdateCommand")
|
|
|
|
|
}
|
|
|
|
|
|
2020-07-31 11:40:15 -04:00
|
|
|
var r0 *model.Command
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 error
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, *model.Command) (*model.Command, error)); ok {
|
|
|
|
|
return rf(commandID, updatedCmd)
|
|
|
|
|
}
|
2020-07-31 11:40:15 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(string, *model.Command) *model.Command); ok {
|
|
|
|
|
r0 = rf(commandID, updatedCmd)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.Command)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string, *model.Command) error); ok {
|
|
|
|
|
r1 = rf(commandID, updatedCmd)
|
|
|
|
|
} else {
|
|
|
|
|
r1 = ret.Error(1)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
// UpdateEphemeralPost provides a mock function with given fields: userID, post
|
|
|
|
|
func (_m *API) UpdateEphemeralPost(userID string, post *model.Post) *model.Post {
|
|
|
|
|
ret := _m.Called(userID, post)
|
2019-03-13 12:31:47 -04:00
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for UpdateEphemeralPost")
|
|
|
|
|
}
|
|
|
|
|
|
2019-03-13 12:31:47 -04:00
|
|
|
var r0 *model.Post
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, *model.Post) *model.Post); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r0 = rf(userID, post)
|
2019-03-13 12:31:47 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.Post)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0
|
|
|
|
|
}
|
|
|
|
|
|
2025-03-13 12:00:15 -04:00
|
|
|
// UpdateGroup provides a mock function with given fields: group
|
|
|
|
|
func (_m *API) UpdateGroup(group *model.Group) (*model.Group, *model.AppError) {
|
|
|
|
|
ret := _m.Called(group)
|
|
|
|
|
|
|
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for UpdateGroup")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var r0 *model.Group
|
|
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(*model.Group) (*model.Group, *model.AppError)); ok {
|
|
|
|
|
return rf(group)
|
|
|
|
|
}
|
|
|
|
|
if rf, ok := ret.Get(0).(func(*model.Group) *model.Group); ok {
|
|
|
|
|
r0 = rf(group)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.Group)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(*model.Group) *model.AppError); ok {
|
|
|
|
|
r1 = rf(group)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// UpdateGroupSyncable provides a mock function with given fields: groupSyncable
|
|
|
|
|
func (_m *API) UpdateGroupSyncable(groupSyncable *model.GroupSyncable) (*model.GroupSyncable, *model.AppError) {
|
|
|
|
|
ret := _m.Called(groupSyncable)
|
|
|
|
|
|
|
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for UpdateGroupSyncable")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var r0 *model.GroupSyncable
|
|
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(*model.GroupSyncable) (*model.GroupSyncable, *model.AppError)); ok {
|
|
|
|
|
return rf(groupSyncable)
|
|
|
|
|
}
|
|
|
|
|
if rf, ok := ret.Get(0).(func(*model.GroupSyncable) *model.GroupSyncable); ok {
|
|
|
|
|
r0 = rf(groupSyncable)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.GroupSyncable)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(*model.GroupSyncable) *model.AppError); ok {
|
|
|
|
|
r1 = rf(groupSyncable)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2021-07-14 09:08:22 -04:00
|
|
|
// UpdateOAuthApp provides a mock function with given fields: app
|
|
|
|
|
func (_m *API) UpdateOAuthApp(app *model.OAuthApp) (*model.OAuthApp, *model.AppError) {
|
|
|
|
|
ret := _m.Called(app)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for UpdateOAuthApp")
|
|
|
|
|
}
|
|
|
|
|
|
2021-07-14 09:08:22 -04:00
|
|
|
var r0 *model.OAuthApp
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(*model.OAuthApp) (*model.OAuthApp, *model.AppError)); ok {
|
|
|
|
|
return rf(app)
|
|
|
|
|
}
|
2021-07-14 09:08:22 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(*model.OAuthApp) *model.OAuthApp); ok {
|
|
|
|
|
r0 = rf(app)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.OAuthApp)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(*model.OAuthApp) *model.AppError); ok {
|
|
|
|
|
r1 = rf(app)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-15 16:33:47 -04:00
|
|
|
// UpdatePost provides a mock function with given fields: post
|
2018-06-25 15:33:13 -04:00
|
|
|
func (_m *API) UpdatePost(post *model.Post) (*model.Post, *model.AppError) {
|
2018-05-15 16:33:47 -04:00
|
|
|
ret := _m.Called(post)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for UpdatePost")
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-15 16:33:47 -04:00
|
|
|
var r0 *model.Post
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(*model.Post) (*model.Post, *model.AppError)); ok {
|
|
|
|
|
return rf(post)
|
|
|
|
|
}
|
2018-05-15 16:33:47 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(*model.Post) *model.Post); ok {
|
|
|
|
|
r0 = rf(post)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.Post)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(*model.Post) *model.AppError); ok {
|
|
|
|
|
r1 = rf(post)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
2017-11-27 17:23:35 -05:00
|
|
|
}
|
2018-05-15 16:33:47 -04:00
|
|
|
|
|
|
|
|
return r0, r1
|
2017-11-27 17:23:35 -05:00
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
// UpdatePreferencesForUser provides a mock function with given fields: userID, preferences
|
|
|
|
|
func (_m *API) UpdatePreferencesForUser(userID string, preferences []model.Preference) *model.AppError {
|
|
|
|
|
ret := _m.Called(userID, preferences)
|
2020-05-28 13:15:47 -04:00
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for UpdatePreferencesForUser")
|
|
|
|
|
}
|
|
|
|
|
|
2020-05-28 13:15:47 -04:00
|
|
|
var r0 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, []model.Preference) *model.AppError); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r0 = rf(userID, preferences)
|
2020-05-28 13:15:47 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-10 19:10:28 -04:00
|
|
|
// UpdatePropertyField provides a mock function with given fields: groupID, field
|
|
|
|
|
func (_m *API) UpdatePropertyField(groupID string, field *model.PropertyField) (*model.PropertyField, error) {
|
|
|
|
|
ret := _m.Called(groupID, field)
|
|
|
|
|
|
|
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for UpdatePropertyField")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var r0 *model.PropertyField
|
|
|
|
|
var r1 error
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, *model.PropertyField) (*model.PropertyField, error)); ok {
|
|
|
|
|
return rf(groupID, field)
|
|
|
|
|
}
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, *model.PropertyField) *model.PropertyField); ok {
|
|
|
|
|
r0 = rf(groupID, field)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.PropertyField)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string, *model.PropertyField) error); ok {
|
|
|
|
|
r1 = rf(groupID, field)
|
|
|
|
|
} else {
|
|
|
|
|
r1 = ret.Error(1)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// UpdatePropertyFields provides a mock function with given fields: groupID, fields
|
|
|
|
|
func (_m *API) UpdatePropertyFields(groupID string, fields []*model.PropertyField) ([]*model.PropertyField, error) {
|
|
|
|
|
ret := _m.Called(groupID, fields)
|
|
|
|
|
|
|
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for UpdatePropertyFields")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var r0 []*model.PropertyField
|
|
|
|
|
var r1 error
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, []*model.PropertyField) ([]*model.PropertyField, error)); ok {
|
|
|
|
|
return rf(groupID, fields)
|
|
|
|
|
}
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, []*model.PropertyField) []*model.PropertyField); ok {
|
|
|
|
|
r0 = rf(groupID, fields)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).([]*model.PropertyField)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string, []*model.PropertyField) error); ok {
|
|
|
|
|
r1 = rf(groupID, fields)
|
|
|
|
|
} else {
|
|
|
|
|
r1 = ret.Error(1)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// UpdatePropertyValue provides a mock function with given fields: groupID, value
|
|
|
|
|
func (_m *API) UpdatePropertyValue(groupID string, value *model.PropertyValue) (*model.PropertyValue, error) {
|
|
|
|
|
ret := _m.Called(groupID, value)
|
|
|
|
|
|
|
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for UpdatePropertyValue")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var r0 *model.PropertyValue
|
|
|
|
|
var r1 error
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, *model.PropertyValue) (*model.PropertyValue, error)); ok {
|
|
|
|
|
return rf(groupID, value)
|
|
|
|
|
}
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, *model.PropertyValue) *model.PropertyValue); ok {
|
|
|
|
|
r0 = rf(groupID, value)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.PropertyValue)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string, *model.PropertyValue) error); ok {
|
|
|
|
|
r1 = rf(groupID, value)
|
|
|
|
|
} else {
|
|
|
|
|
r1 = ret.Error(1)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// UpdatePropertyValues provides a mock function with given fields: groupID, values
|
|
|
|
|
func (_m *API) UpdatePropertyValues(groupID string, values []*model.PropertyValue) ([]*model.PropertyValue, error) {
|
|
|
|
|
ret := _m.Called(groupID, values)
|
|
|
|
|
|
|
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for UpdatePropertyValues")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var r0 []*model.PropertyValue
|
|
|
|
|
var r1 error
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, []*model.PropertyValue) ([]*model.PropertyValue, error)); ok {
|
|
|
|
|
return rf(groupID, values)
|
|
|
|
|
}
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, []*model.PropertyValue) []*model.PropertyValue); ok {
|
|
|
|
|
r0 = rf(groupID, values)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).([]*model.PropertyValue)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string, []*model.PropertyValue) error); ok {
|
|
|
|
|
r1 = rf(groupID, values)
|
|
|
|
|
} else {
|
|
|
|
|
r1 = ret.Error(1)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
Shared channels plugin APIs for MS Teams plugin (#25805)
New plugin APIs and hooks for accessing Shared Channels service via plugin.
- RegisterPluginForSharedChannels(opts model.RegisterPluginOpts) (remoteID string, err error)
- UnregisterPluginForSharedChannels(pluginID string) error
- ShareChannel(sc *model.SharedChannel) (*model.SharedChannel, error)
- UpdateSharedChannel(sc *model.SharedChannel) (*model.SharedChannel, error)
- UnshareChannel(channelID string) (unshared bool, err error)
- UpdateSharedChannelCursor(channelID, remoteID string, cusror model.GetPostsSinceForSyncCursor) error
- SyncSharedChannel(channelID string) error
- InviteRemoteToChannel(channelID string, remoteID string, userID string) error
- UninviteRemoteFromChannel(channelID string, remoteID string) error
Hooks
- OnSharedChannelsSyncMsg(msg *model.SyncMsg, rc *model.RemoteCluster) (model.SyncResponse, error)
- OnSharedChannelsPing(rc *model.RemoteCluster) bool
2023-12-22 17:00:27 -05:00
|
|
|
// UpdateSharedChannel provides a mock function with given fields: sc
|
|
|
|
|
func (_m *API) UpdateSharedChannel(sc *model.SharedChannel) (*model.SharedChannel, error) {
|
|
|
|
|
ret := _m.Called(sc)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for UpdateSharedChannel")
|
|
|
|
|
}
|
|
|
|
|
|
Shared channels plugin APIs for MS Teams plugin (#25805)
New plugin APIs and hooks for accessing Shared Channels service via plugin.
- RegisterPluginForSharedChannels(opts model.RegisterPluginOpts) (remoteID string, err error)
- UnregisterPluginForSharedChannels(pluginID string) error
- ShareChannel(sc *model.SharedChannel) (*model.SharedChannel, error)
- UpdateSharedChannel(sc *model.SharedChannel) (*model.SharedChannel, error)
- UnshareChannel(channelID string) (unshared bool, err error)
- UpdateSharedChannelCursor(channelID, remoteID string, cusror model.GetPostsSinceForSyncCursor) error
- SyncSharedChannel(channelID string) error
- InviteRemoteToChannel(channelID string, remoteID string, userID string) error
- UninviteRemoteFromChannel(channelID string, remoteID string) error
Hooks
- OnSharedChannelsSyncMsg(msg *model.SyncMsg, rc *model.RemoteCluster) (model.SyncResponse, error)
- OnSharedChannelsPing(rc *model.RemoteCluster) bool
2023-12-22 17:00:27 -05:00
|
|
|
var r0 *model.SharedChannel
|
|
|
|
|
var r1 error
|
|
|
|
|
if rf, ok := ret.Get(0).(func(*model.SharedChannel) (*model.SharedChannel, error)); ok {
|
|
|
|
|
return rf(sc)
|
|
|
|
|
}
|
|
|
|
|
if rf, ok := ret.Get(0).(func(*model.SharedChannel) *model.SharedChannel); ok {
|
|
|
|
|
r0 = rf(sc)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.SharedChannel)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(*model.SharedChannel) error); ok {
|
|
|
|
|
r1 = rf(sc)
|
|
|
|
|
} else {
|
|
|
|
|
r1 = ret.Error(1)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// UpdateSharedChannelCursor provides a mock function with given fields: channelID, remoteID, cusror
|
|
|
|
|
func (_m *API) UpdateSharedChannelCursor(channelID string, remoteID string, cusror model.GetPostsSinceForSyncCursor) error {
|
|
|
|
|
ret := _m.Called(channelID, remoteID, cusror)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for UpdateSharedChannelCursor")
|
|
|
|
|
}
|
|
|
|
|
|
Shared channels plugin APIs for MS Teams plugin (#25805)
New plugin APIs and hooks for accessing Shared Channels service via plugin.
- RegisterPluginForSharedChannels(opts model.RegisterPluginOpts) (remoteID string, err error)
- UnregisterPluginForSharedChannels(pluginID string) error
- ShareChannel(sc *model.SharedChannel) (*model.SharedChannel, error)
- UpdateSharedChannel(sc *model.SharedChannel) (*model.SharedChannel, error)
- UnshareChannel(channelID string) (unshared bool, err error)
- UpdateSharedChannelCursor(channelID, remoteID string, cusror model.GetPostsSinceForSyncCursor) error
- SyncSharedChannel(channelID string) error
- InviteRemoteToChannel(channelID string, remoteID string, userID string) error
- UninviteRemoteFromChannel(channelID string, remoteID string) error
Hooks
- OnSharedChannelsSyncMsg(msg *model.SyncMsg, rc *model.RemoteCluster) (model.SyncResponse, error)
- OnSharedChannelsPing(rc *model.RemoteCluster) bool
2023-12-22 17:00:27 -05:00
|
|
|
var r0 error
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, string, model.GetPostsSinceForSyncCursor) error); ok {
|
|
|
|
|
r0 = rf(channelID, remoteID, cusror)
|
|
|
|
|
} else {
|
|
|
|
|
r0 = ret.Error(0)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-15 16:33:47 -04:00
|
|
|
// UpdateTeam provides a mock function with given fields: team
|
2018-06-25 15:33:13 -04:00
|
|
|
func (_m *API) UpdateTeam(team *model.Team) (*model.Team, *model.AppError) {
|
2018-05-15 16:33:47 -04:00
|
|
|
ret := _m.Called(team)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for UpdateTeam")
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-15 16:33:47 -04:00
|
|
|
var r0 *model.Team
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(*model.Team) (*model.Team, *model.AppError)); ok {
|
|
|
|
|
return rf(team)
|
|
|
|
|
}
|
2018-05-15 16:33:47 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(*model.Team) *model.Team); ok {
|
|
|
|
|
r0 = rf(team)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.Team)
|
|
|
|
|
}
|
2017-11-27 17:23:35 -05:00
|
|
|
}
|
2018-05-15 16:33:47 -04:00
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(*model.Team) *model.AppError); ok {
|
|
|
|
|
r1 = rf(team)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
2017-11-27 17:23:35 -05:00
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
// UpdateTeamMemberRoles provides a mock function with given fields: teamID, userID, newRoles
|
|
|
|
|
func (_m *API) UpdateTeamMemberRoles(teamID string, userID string, newRoles string) (*model.TeamMember, *model.AppError) {
|
|
|
|
|
ret := _m.Called(teamID, userID, newRoles)
|
2018-07-06 18:32:55 -04:00
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for UpdateTeamMemberRoles")
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-06 18:32:55 -04:00
|
|
|
var r0 *model.TeamMember
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, string, string) (*model.TeamMember, *model.AppError)); ok {
|
|
|
|
|
return rf(teamID, userID, newRoles)
|
|
|
|
|
}
|
2018-07-06 18:32:55 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(string, string, string) *model.TeamMember); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r0 = rf(teamID, userID, newRoles)
|
2018-07-06 18:32:55 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.TeamMember)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string, string, string) *model.AppError); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r1 = rf(teamID, userID, newRoles)
|
2018-07-06 18:32:55 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-15 16:33:47 -04:00
|
|
|
// UpdateUser provides a mock function with given fields: user
|
2018-06-25 15:33:13 -04:00
|
|
|
func (_m *API) UpdateUser(user *model.User) (*model.User, *model.AppError) {
|
2018-05-15 16:33:47 -04:00
|
|
|
ret := _m.Called(user)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for UpdateUser")
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-15 16:33:47 -04:00
|
|
|
var r0 *model.User
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(*model.User) (*model.User, *model.AppError)); ok {
|
|
|
|
|
return rf(user)
|
|
|
|
|
}
|
2018-05-15 16:33:47 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(*model.User) *model.User); ok {
|
|
|
|
|
r0 = rf(user)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.User)
|
|
|
|
|
}
|
2017-11-27 17:23:35 -05:00
|
|
|
}
|
2018-05-15 16:33:47 -04:00
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(*model.User) *model.AppError); ok {
|
|
|
|
|
r1 = rf(user)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
2017-11-27 17:23:35 -05:00
|
|
|
}
|
2018-07-16 15:49:26 -04:00
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
// UpdateUserActive provides a mock function with given fields: userID, active
|
|
|
|
|
func (_m *API) UpdateUserActive(userID string, active bool) *model.AppError {
|
|
|
|
|
ret := _m.Called(userID, active)
|
2018-12-12 10:18:41 -05:00
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for UpdateUserActive")
|
|
|
|
|
}
|
|
|
|
|
|
2018-12-12 10:18:41 -05:00
|
|
|
var r0 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, bool) *model.AppError); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r0 = rf(userID, active)
|
2018-12-12 10:18:41 -05:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0
|
|
|
|
|
}
|
|
|
|
|
|
2023-11-10 20:55:33 -05:00
|
|
|
// UpdateUserAuth provides a mock function with given fields: userID, userAuth
|
|
|
|
|
func (_m *API) UpdateUserAuth(userID string, userAuth *model.UserAuth) (*model.UserAuth, *model.AppError) {
|
|
|
|
|
ret := _m.Called(userID, userAuth)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for UpdateUserAuth")
|
|
|
|
|
}
|
|
|
|
|
|
2023-11-10 20:55:33 -05:00
|
|
|
var r0 *model.UserAuth
|
|
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, *model.UserAuth) (*model.UserAuth, *model.AppError)); ok {
|
|
|
|
|
return rf(userID, userAuth)
|
|
|
|
|
}
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, *model.UserAuth) *model.UserAuth); ok {
|
|
|
|
|
r0 = rf(userID, userAuth)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.UserAuth)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string, *model.UserAuth) *model.AppError); ok {
|
|
|
|
|
r1 = rf(userID, userAuth)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2021-11-10 11:11:20 -05:00
|
|
|
// UpdateUserCustomStatus provides a mock function with given fields: userID, customStatus
|
|
|
|
|
func (_m *API) UpdateUserCustomStatus(userID string, customStatus *model.CustomStatus) *model.AppError {
|
|
|
|
|
ret := _m.Called(userID, customStatus)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for UpdateUserCustomStatus")
|
|
|
|
|
}
|
|
|
|
|
|
2021-11-10 11:11:20 -05:00
|
|
|
var r0 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, *model.CustomStatus) *model.AppError); ok {
|
|
|
|
|
r0 = rf(userID, customStatus)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0
|
|
|
|
|
}
|
|
|
|
|
|
2024-03-29 18:22:54 -04:00
|
|
|
// UpdateUserRoles provides a mock function with given fields: userID, newRoles
|
|
|
|
|
func (_m *API) UpdateUserRoles(userID string, newRoles string) (*model.User, *model.AppError) {
|
|
|
|
|
ret := _m.Called(userID, newRoles)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for UpdateUserRoles")
|
|
|
|
|
}
|
|
|
|
|
|
2024-03-29 18:22:54 -04:00
|
|
|
var r0 *model.User
|
|
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, string) (*model.User, *model.AppError)); ok {
|
|
|
|
|
return rf(userID, newRoles)
|
|
|
|
|
}
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, string) *model.User); ok {
|
|
|
|
|
r0 = rf(userID, newRoles)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.User)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string, string) *model.AppError); ok {
|
|
|
|
|
r1 = rf(userID, newRoles)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-22 00:33:45 -04:00
|
|
|
// UpdateUserStatus provides a mock function with given fields: userID, status
|
|
|
|
|
func (_m *API) UpdateUserStatus(userID string, status string) (*model.Status, *model.AppError) {
|
|
|
|
|
ret := _m.Called(userID, status)
|
2018-07-16 15:49:26 -04:00
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for UpdateUserStatus")
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-16 15:49:26 -04:00
|
|
|
var r0 *model.Status
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, string) (*model.Status, *model.AppError)); ok {
|
|
|
|
|
return rf(userID, status)
|
|
|
|
|
}
|
2018-07-16 15:49:26 -04:00
|
|
|
if rf, ok := ret.Get(0).(func(string, string) *model.Status); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r0 = rf(userID, status)
|
2018-07-16 15:49:26 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.Status)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string, string) *model.AppError); ok {
|
2021-04-22 00:33:45 -04:00
|
|
|
r1 = rf(userID, status)
|
2018-07-16 15:49:26 -04:00
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
2018-11-07 15:24:54 -05:00
|
|
|
|
2022-11-22 16:26:22 -05:00
|
|
|
// UploadData provides a mock function with given fields: us, rd
|
|
|
|
|
func (_m *API) UploadData(us *model.UploadSession, rd io.Reader) (*model.FileInfo, error) {
|
|
|
|
|
ret := _m.Called(us, rd)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for UploadData")
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-22 16:26:22 -05:00
|
|
|
var r0 *model.FileInfo
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 error
|
|
|
|
|
if rf, ok := ret.Get(0).(func(*model.UploadSession, io.Reader) (*model.FileInfo, error)); ok {
|
|
|
|
|
return rf(us, rd)
|
|
|
|
|
}
|
2022-11-22 16:26:22 -05:00
|
|
|
if rf, ok := ret.Get(0).(func(*model.UploadSession, io.Reader) *model.FileInfo); ok {
|
|
|
|
|
r0 = rf(us, rd)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.FileInfo)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(*model.UploadSession, io.Reader) error); ok {
|
|
|
|
|
r1 = rf(us, rd)
|
|
|
|
|
} else {
|
|
|
|
|
r1 = ret.Error(1)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2018-11-07 15:24:54 -05:00
|
|
|
// UploadFile provides a mock function with given fields: data, channelId, filename
|
|
|
|
|
func (_m *API) UploadFile(data []byte, channelId string, filename string) (*model.FileInfo, *model.AppError) {
|
|
|
|
|
ret := _m.Called(data, channelId, filename)
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for UploadFile")
|
|
|
|
|
}
|
|
|
|
|
|
2018-11-07 15:24:54 -05:00
|
|
|
var r0 *model.FileInfo
|
2023-04-10 04:50:57 -04:00
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func([]byte, string, string) (*model.FileInfo, *model.AppError)); ok {
|
|
|
|
|
return rf(data, channelId, filename)
|
|
|
|
|
}
|
2018-11-07 15:24:54 -05:00
|
|
|
if rf, ok := ret.Get(0).(func([]byte, string, string) *model.FileInfo); ok {
|
|
|
|
|
r0 = rf(data, channelId, filename)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.FileInfo)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func([]byte, string, string) *model.AppError); ok {
|
|
|
|
|
r1 = rf(data, channelId, filename)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
2023-04-10 04:50:57 -04:00
|
|
|
|
2025-03-13 12:00:15 -04:00
|
|
|
// UpsertGroupMember provides a mock function with given fields: groupID, userID
|
|
|
|
|
func (_m *API) UpsertGroupMember(groupID string, userID string) (*model.GroupMember, *model.AppError) {
|
|
|
|
|
ret := _m.Called(groupID, userID)
|
|
|
|
|
|
|
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for UpsertGroupMember")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var r0 *model.GroupMember
|
|
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, string) (*model.GroupMember, *model.AppError)); ok {
|
|
|
|
|
return rf(groupID, userID)
|
|
|
|
|
}
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, string) *model.GroupMember); ok {
|
|
|
|
|
r0 = rf(groupID, userID)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.GroupMember)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string, string) *model.AppError); ok {
|
|
|
|
|
r1 = rf(groupID, userID)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// UpsertGroupMembers provides a mock function with given fields: groupID, userIDs
|
|
|
|
|
func (_m *API) UpsertGroupMembers(groupID string, userIDs []string) ([]*model.GroupMember, *model.AppError) {
|
|
|
|
|
ret := _m.Called(groupID, userIDs)
|
|
|
|
|
|
|
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for UpsertGroupMembers")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var r0 []*model.GroupMember
|
|
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, []string) ([]*model.GroupMember, *model.AppError)); ok {
|
|
|
|
|
return rf(groupID, userIDs)
|
|
|
|
|
}
|
|
|
|
|
if rf, ok := ret.Get(0).(func(string, []string) []*model.GroupMember); ok {
|
|
|
|
|
r0 = rf(groupID, userIDs)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).([]*model.GroupMember)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(string, []string) *model.AppError); ok {
|
|
|
|
|
r1 = rf(groupID, userIDs)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// UpsertGroupSyncable provides a mock function with given fields: groupSyncable
|
|
|
|
|
func (_m *API) UpsertGroupSyncable(groupSyncable *model.GroupSyncable) (*model.GroupSyncable, *model.AppError) {
|
|
|
|
|
ret := _m.Called(groupSyncable)
|
|
|
|
|
|
|
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for UpsertGroupSyncable")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var r0 *model.GroupSyncable
|
|
|
|
|
var r1 *model.AppError
|
|
|
|
|
if rf, ok := ret.Get(0).(func(*model.GroupSyncable) (*model.GroupSyncable, *model.AppError)); ok {
|
|
|
|
|
return rf(groupSyncable)
|
|
|
|
|
}
|
|
|
|
|
if rf, ok := ret.Get(0).(func(*model.GroupSyncable) *model.GroupSyncable); ok {
|
|
|
|
|
r0 = rf(groupSyncable)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.GroupSyncable)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(*model.GroupSyncable) *model.AppError); ok {
|
|
|
|
|
r1 = rf(groupSyncable)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(1) != nil {
|
|
|
|
|
r1 = ret.Get(1).(*model.AppError)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-10 19:10:28 -04:00
|
|
|
// UpsertPropertyValue provides a mock function with given fields: value
|
|
|
|
|
func (_m *API) UpsertPropertyValue(value *model.PropertyValue) (*model.PropertyValue, error) {
|
|
|
|
|
ret := _m.Called(value)
|
|
|
|
|
|
|
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for UpsertPropertyValue")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var r0 *model.PropertyValue
|
|
|
|
|
var r1 error
|
|
|
|
|
if rf, ok := ret.Get(0).(func(*model.PropertyValue) (*model.PropertyValue, error)); ok {
|
|
|
|
|
return rf(value)
|
|
|
|
|
}
|
|
|
|
|
if rf, ok := ret.Get(0).(func(*model.PropertyValue) *model.PropertyValue); ok {
|
|
|
|
|
r0 = rf(value)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).(*model.PropertyValue)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func(*model.PropertyValue) error); ok {
|
|
|
|
|
r1 = rf(value)
|
|
|
|
|
} else {
|
|
|
|
|
r1 = ret.Error(1)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// UpsertPropertyValues provides a mock function with given fields: values
|
|
|
|
|
func (_m *API) UpsertPropertyValues(values []*model.PropertyValue) ([]*model.PropertyValue, error) {
|
|
|
|
|
ret := _m.Called(values)
|
|
|
|
|
|
|
|
|
|
if len(ret) == 0 {
|
|
|
|
|
panic("no return value specified for UpsertPropertyValues")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var r0 []*model.PropertyValue
|
|
|
|
|
var r1 error
|
|
|
|
|
if rf, ok := ret.Get(0).(func([]*model.PropertyValue) ([]*model.PropertyValue, error)); ok {
|
|
|
|
|
return rf(values)
|
|
|
|
|
}
|
|
|
|
|
if rf, ok := ret.Get(0).(func([]*model.PropertyValue) []*model.PropertyValue); ok {
|
|
|
|
|
r0 = rf(values)
|
|
|
|
|
} else {
|
|
|
|
|
if ret.Get(0) != nil {
|
|
|
|
|
r0 = ret.Get(0).([]*model.PropertyValue)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if rf, ok := ret.Get(1).(func([]*model.PropertyValue) error); ok {
|
|
|
|
|
r1 = rf(values)
|
|
|
|
|
} else {
|
|
|
|
|
r1 = ret.Error(1)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return r0, r1
|
|
|
|
|
}
|
|
|
|
|
|
2024-04-12 22:45:59 -04:00
|
|
|
// NewAPI creates a new instance of API. 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 NewAPI(t interface {
|
2023-04-10 04:50:57 -04:00
|
|
|
mock.TestingT
|
|
|
|
|
Cleanup(func())
|
2024-04-12 22:45:59 -04:00
|
|
|
}) *API {
|
2023-04-10 04:50:57 -04:00
|
|
|
mock := &API{}
|
|
|
|
|
mock.Mock.Test(t)
|
|
|
|
|
|
|
|
|
|
t.Cleanup(func() { mock.AssertExpectations(t) })
|
|
|
|
|
|
|
|
|
|
return mock
|
|
|
|
|
}
|