github.com/haalcala/mattermost-server-change-repo@v0.0.0-20210713015153-16753fbeee5f/app/app_iface.go (about)

     1  // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
     2  // See LICENSE.txt for license information.
     3  
     4  // Code generated by "make app-layers"
     5  // DO NOT EDIT
     6  
     7  package app
     8  
     9  import (
    10  	"bytes"
    11  	"context"
    12  	"crypto/ecdsa"
    13  	"io"
    14  	"mime/multipart"
    15  	"net/http"
    16  	"net/url"
    17  	"time"
    18  
    19  	"github.com/dyatlov/go-opengraph/opengraph"
    20  	"github.com/gorilla/websocket"
    21  	"github.com/mattermost/go-i18n/i18n"
    22  	goi18n "github.com/mattermost/go-i18n/i18n"
    23  	"github.com/mattermost/mattermost-server/v5/audit"
    24  	"github.com/mattermost/mattermost-server/v5/einterfaces"
    25  	"github.com/mattermost/mattermost-server/v5/mlog"
    26  	"github.com/mattermost/mattermost-server/v5/model"
    27  	"github.com/mattermost/mattermost-server/v5/plugin"
    28  	"github.com/mattermost/mattermost-server/v5/services/filesstore"
    29  	"github.com/mattermost/mattermost-server/v5/services/httpservice"
    30  	"github.com/mattermost/mattermost-server/v5/services/imageproxy"
    31  	"github.com/mattermost/mattermost-server/v5/services/searchengine"
    32  	"github.com/mattermost/mattermost-server/v5/services/timezones"
    33  	"github.com/mattermost/mattermost-server/v5/store"
    34  )
    35  
    36  // AppIface is extracted from App struct and contains all it's exported methods. It's provided to allow partial interface passing and app layers creation.
    37  type AppIface interface {
    38  	// @openTracingParams args
    39  	ExecuteCommand(args *model.CommandArgs) (*model.CommandResponse, *model.AppError)
    40  	// @openTracingParams teamID
    41  	// previous ListCommands now ListAutocompleteCommands
    42  	ListAutocompleteCommands(teamID string, T goi18n.TranslateFunc) ([]*model.Command, *model.AppError)
    43  	// @openTracingParams teamID, skipSlackParsing
    44  	CreateCommandPost(post *model.Post, teamID string, response *model.CommandResponse, skipSlackParsing bool) (*model.Post, *model.AppError)
    45  	// AddCursorIdsForPostList adds NextPostId and PrevPostId as cursor to the PostList.
    46  	// The conditional blocks ensure that it sets those cursor IDs immediately as afterPost, beforePost or empty,
    47  	// and only query to database whenever necessary.
    48  	AddCursorIdsForPostList(originalList *model.PostList, afterPost, beforePost string, since int64, page, perPage int)
    49  	// AddPublicKey will add plugin public key to the config. Overwrites the previous file
    50  	AddPublicKey(name string, key io.Reader) *model.AppError
    51  	// Caller must close the first return value
    52  	FileReader(path string) (filesstore.ReadCloseSeeker, *model.AppError)
    53  	// ChannelMembersMinusGroupMembers returns the set of users in the given channel minus the set of users in the given
    54  	// groups.
    55  	//
    56  	// The result can be used, for example, to determine the set of users who would be removed from a channel if the
    57  	// channel were group-constrained with the given groups.
    58  	ChannelMembersMinusGroupMembers(channelID string, groupIDs []string, page, perPage int) ([]*model.UserWithGroups, int64, *model.AppError)
    59  	// ClientConfigWithComputed gets the configuration in a format suitable for sending to the client.
    60  	ClientConfigWithComputed() map[string]string
    61  	// ConvertBotToUser converts a bot to user.
    62  	ConvertBotToUser(bot *model.Bot, userPatch *model.UserPatch, sysadmin bool) (*model.User, *model.AppError)
    63  	// ConvertUserToBot converts a user to bot.
    64  	ConvertUserToBot(user *model.User) (*model.Bot, *model.AppError)
    65  	// CreateBot creates the given bot and corresponding user.
    66  	CreateBot(bot *model.Bot) (*model.Bot, *model.AppError)
    67  	// CreateChannelScheme creates a new Scheme of scope channel and assigns it to the channel.
    68  	CreateChannelScheme(channel *model.Channel) (*model.Scheme, *model.AppError)
    69  	// CreateDefaultChannels creates channels in the given team for each channel returned by (*App).DefaultChannelNames.
    70  	//
    71  	CreateDefaultChannels(teamID string) ([]*model.Channel, *model.AppError)
    72  	// CreateDefaultMemberships adds users to teams and channels based on their group memberships and how those groups
    73  	// are configured to sync with teams and channels for group members on or after the given timestamp.
    74  	CreateDefaultMemberships(since int64) error
    75  	// CreateGuest creates a guest and sets several fields of the returned User struct to
    76  	// their zero values.
    77  	CreateGuest(user *model.User) (*model.User, *model.AppError)
    78  	// CreateUser creates a user and sets several fields of the returned User struct to
    79  	// their zero values.
    80  	CreateUser(user *model.User) (*model.User, *model.AppError)
    81  	// Creates and stores FileInfos for a post created before the FileInfos table existed.
    82  	MigrateFilenamesToFileInfos(post *model.Post) []*model.FileInfo
    83  	// DefaultChannelNames returns the list of system-wide default channel names.
    84  	//
    85  	// By default the list will be (not necessarily in this order):
    86  	//	['town-square', 'off-topic']
    87  	// However, if TeamSettings.ExperimentalDefaultChannels contains a list of channels then that list will replace
    88  	// 'off-topic' and be included in the return results in addition to 'town-square'. For example:
    89  	//	['town-square', 'game-of-thrones', 'wow']
    90  	//
    91  	DefaultChannelNames() []string
    92  	// DeleteBotIconImage deletes LHS icon for a bot.
    93  	DeleteBotIconImage(botUserId string) *model.AppError
    94  	// DeleteChannelScheme deletes a channels scheme and sets its SchemeId to nil.
    95  	DeleteChannelScheme(channel *model.Channel) (*model.Channel, *model.AppError)
    96  	// DeleteGroupConstrainedMemberships deletes team and channel memberships of users who aren't members of the allowed
    97  	// groups of all group-constrained teams and channels.
    98  	DeleteGroupConstrainedMemberships() error
    99  	// DeletePublicKey will delete plugin public key from the config.
   100  	DeletePublicKey(name string) *model.AppError
   101  	// DemoteUserToGuest Convert user's roles and all his mermbership's roles from
   102  	// regular user roles to guest roles.
   103  	DemoteUserToGuest(user *model.User) *model.AppError
   104  	// DisablePlugin will set the config for an installed plugin to disabled, triggering deactivation if active.
   105  	// Notifies cluster peers through config change.
   106  	DisablePlugin(id string) *model.AppError
   107  	// DoPermissionsMigrations execute all the permissions migrations need by the current version.
   108  	DoPermissionsMigrations() error
   109  	// EnablePlugin will set the config for an installed plugin to enabled, triggering asynchronous
   110  	// activation if inactive anywhere in the cluster.
   111  	// Notifies cluster peers through config change.
   112  	EnablePlugin(id string) *model.AppError
   113  	// Expand announcements in incoming webhooks from Slack. Those announcements
   114  	// can be found in the text attribute, or in the pretext, text, title and value
   115  	// attributes of the attachment structure. The Slack attachment structure is
   116  	// documented here: https://api.slack.com/docs/attachments
   117  	ProcessSlackAttachments(attachments []*model.SlackAttachment) []*model.SlackAttachment
   118  	// ExtendSessionExpiryIfNeeded extends Session.ExpiresAt based on session lengths in config.
   119  	// A new ExpiresAt is only written if enough time has elapsed since last update.
   120  	// Returns true only if the session was extended.
   121  	ExtendSessionExpiryIfNeeded(session *model.Session) bool
   122  	// FillInPostProps should be invoked before saving posts to fill in properties such as
   123  	// channel_mentions.
   124  	//
   125  	// If channel is nil, FillInPostProps will look up the channel corresponding to the post.
   126  	FillInPostProps(post *model.Post, channel *model.Channel) *model.AppError
   127  	// FilterNonGroupChannelMembers returns the subset of the given user IDs of the users who are not members of groups
   128  	// associated to the channel excluding bots
   129  	FilterNonGroupChannelMembers(userIDs []string, channel *model.Channel) ([]string, error)
   130  	// FilterNonGroupTeamMembers returns the subset of the given user IDs of the users who are not members of groups
   131  	// associated to the team excluding bots.
   132  	FilterNonGroupTeamMembers(userIDs []string, team *model.Team) ([]string, error)
   133  	// GetAllLdapGroupsPage retrieves all LDAP groups under the configured base DN using the default or configured group
   134  	// filter.
   135  	GetAllLdapGroupsPage(page int, perPage int, opts model.LdapGroupSearchOpts) ([]*model.Group, int, *model.AppError)
   136  	// GetBot returns the given bot.
   137  	GetBot(botUserId string, includeDeleted bool) (*model.Bot, *model.AppError)
   138  	// GetBotIconImage retrieves LHS icon for a bot.
   139  	GetBotIconImage(botUserId string) ([]byte, *model.AppError)
   140  	// GetBots returns the requested page of bots.
   141  	GetBots(options *model.BotGetOptions) (model.BotList, *model.AppError)
   142  	// GetChannelGroupUsers returns the users who are associated to the channel via GroupChannels and GroupMembers.
   143  	GetChannelGroupUsers(channelID string) ([]*model.User, *model.AppError)
   144  	// GetChannelModerationsForChannel Gets a channels ChannelModerations from either the higherScoped roles or from the channel scheme roles.
   145  	GetChannelModerationsForChannel(channel *model.Channel) ([]*model.ChannelModeration, *model.AppError)
   146  	// GetClusterPluginStatuses returns the status for plugins installed anywhere in the cluster.
   147  	GetClusterPluginStatuses() (model.PluginStatuses, *model.AppError)
   148  	// GetConfigFile proxies access to the given configuration file to the underlying config store.
   149  	GetConfigFile(name string) ([]byte, error)
   150  	// GetEmojiStaticUrl returns a relative static URL for system default emojis,
   151  	// and the API route for custom ones. Errors if not found or if custom and deleted.
   152  	GetEmojiStaticUrl(emojiName string) (string, *model.AppError)
   153  	// GetEnvironmentConfig returns a map of configuration keys whose values have been overridden by an environment variable.
   154  	GetEnvironmentConfig() map[string]interface{}
   155  	// GetFilteredUsersStats is used to get a count of users based on the set of filters supported by UserCountOptions.
   156  	GetFilteredUsersStats(options *model.UserCountOptions) (*model.UsersStats, *model.AppError)
   157  	// GetGroupsByTeam returns the paged list and the total count of group associated to the given team.
   158  	GetGroupsByTeam(teamID string, opts model.GroupSearchOpts) ([]*model.GroupWithSchemeAdmin, int, *model.AppError)
   159  	// GetKnownUsers returns the list of user ids of users with any direct
   160  	// relationship with a user. That means any user sharing any channel, including
   161  	// direct and group channels.
   162  	GetKnownUsers(userID string) ([]string, *model.AppError)
   163  	// GetLdapGroup retrieves a single LDAP group by the given LDAP group id.
   164  	GetLdapGroup(ldapGroupID string) (*model.Group, *model.AppError)
   165  	// GetMarketplacePlugins returns a list of plugins from the marketplace-server,
   166  	// and plugins that are installed locally.
   167  	GetMarketplacePlugins(filter *model.MarketplacePluginFilter) ([]*model.MarketplacePlugin, *model.AppError)
   168  	// GetPluginPublicKeyFiles returns all public keys listed in the config.
   169  	GetPluginPublicKeyFiles() ([]string, *model.AppError)
   170  	// GetPluginStatus returns the status for a plugin installed on this server.
   171  	GetPluginStatus(id string) (*model.PluginStatus, *model.AppError)
   172  	// GetPluginStatuses returns the status for plugins installed on this server.
   173  	GetPluginStatuses() (model.PluginStatuses, *model.AppError)
   174  	// GetPluginsEnvironment returns the plugin environment for use if plugins are enabled and
   175  	// initialized.
   176  	//
   177  	// To get the plugins environment when the plugins are disabled, manually acquire the plugins
   178  	// lock instead.
   179  	GetPluginsEnvironment() *plugin.Environment
   180  	// GetProductNotices is called from the frontend to fetch the product notices that are relevant to the caller
   181  	GetProductNotices(userID, teamID string, client model.NoticeClientType, clientVersion string, locale string) (model.NoticeMessages, *model.AppError)
   182  	// GetPublicKey will return the actual public key saved in the `name` file.
   183  	GetPublicKey(name string) ([]byte, *model.AppError)
   184  	// GetSanitizedConfig gets the configuration for a system admin without any secrets.
   185  	GetSanitizedConfig() *model.Config
   186  	// GetSchemeRolesForChannel Checks if a channel or its team has an override scheme for channel roles and returns the scheme roles or default channel roles.
   187  	GetSchemeRolesForChannel(channelId string) (guestRoleName string, userRoleName string, adminRoleName string, err *model.AppError)
   188  	// GetSessionLengthInMillis returns the session length, in milliseconds,
   189  	// based on the type of session (Mobile, SSO, Web/LDAP).
   190  	GetSessionLengthInMillis(session *model.Session) int64
   191  	// GetSuggestions returns suggestions for user input.
   192  	GetSuggestions(commandArgs *model.CommandArgs, commands []*model.Command, roleID string) []model.AutocompleteSuggestion
   193  	// GetTeamGroupUsers returns the users who are associated to the team via GroupTeams and GroupMembers.
   194  	GetTeamGroupUsers(teamID string) ([]*model.User, *model.AppError)
   195  	// GetTeamSchemeChannelRoles Checks if a team has an override scheme and returns the scheme channel role names or default channel role names.
   196  	GetTeamSchemeChannelRoles(teamID string) (guestRoleName string, userRoleName string, adminRoleName string, err *model.AppError)
   197  	// GetTotalUsersStats is used for the DM list total
   198  	GetTotalUsersStats(viewRestrictions *model.ViewUsersRestrictions) (*model.UsersStats, *model.AppError)
   199  	// HubRegister registers a connection to a hub.
   200  	HubRegister(webConn *WebConn)
   201  	// HubStart starts all the hubs.
   202  	HubStart()
   203  	// HubUnregister unregisters a connection from a hub.
   204  	HubUnregister(webConn *WebConn)
   205  	// InstallMarketplacePlugin installs a plugin listed in the marketplace server. It will get the plugin bundle
   206  	// from the prepackaged folder, if available, or remotely if EnableRemoteMarketplace is true.
   207  	InstallMarketplacePlugin(request *model.InstallMarketplacePluginRequest) (*model.Manifest, *model.AppError)
   208  	// InstallPlugin unpacks and installs a plugin but does not enable or activate it.
   209  	InstallPlugin(pluginFile io.ReadSeeker, replace bool) (*model.Manifest, *model.AppError)
   210  	// InstallPluginWithSignature verifies and installs plugin.
   211  	InstallPluginWithSignature(pluginFile, signature io.ReadSeeker) (*model.Manifest, *model.AppError)
   212  	// IsUsernameTaken checks if the username is already used by another user. Return false if the username is invalid.
   213  	IsUsernameTaken(name string) bool
   214  	// LimitedClientConfigWithComputed gets the configuration in a format suitable for sending to the client.
   215  	LimitedClientConfigWithComputed() map[string]string
   216  	// LogAuditRec logs an audit record using default LvlAuditCLI.
   217  	LogAuditRec(rec *audit.Record, err error)
   218  	// LogAuditRecWithLevel logs an audit record using specified Level.
   219  	LogAuditRecWithLevel(rec *audit.Record, level mlog.LogLevel, err error)
   220  	// MakeAuditRecord creates a audit record pre-populated with defaults.
   221  	MakeAuditRecord(event string, initialStatus string) *audit.Record
   222  	// MarkChanelAsUnreadFromPost will take a post and set the channel as unread from that one.
   223  	MarkChannelAsUnreadFromPost(postID string, userID string) (*model.ChannelUnreadAt, *model.AppError)
   224  	// MentionsToPublicChannels returns all the mentions to public channels,
   225  	// linking them to their channels
   226  	MentionsToPublicChannels(message, teamID string) model.ChannelMentionMap
   227  	// MentionsToTeamMembers returns all the @ mentions found in message that
   228  	// belong to users in the specified team, linking them to their users
   229  	MentionsToTeamMembers(message, teamID string) model.UserMentionMap
   230  	// MoveChannel method is prone to data races if someone joins to channel during the move process. However this
   231  	// function is only exposed to sysadmins and the possibility of this edge case is relatively small.
   232  	MoveChannel(team *model.Team, channel *model.Channel, user *model.User) *model.AppError
   233  	// NewWebConn returns a new WebConn instance.
   234  	NewWebConn(ws *websocket.Conn, session model.Session, t goi18n.TranslateFunc, locale string) *WebConn
   235  	// NewWebHub creates a new Hub.
   236  	NewWebHub() *Hub
   237  	// NotifySessionsExpired is called periodically from the job server to notify any mobile sessions that have expired.
   238  	NotifySessionsExpired() *model.AppError
   239  	// OverrideIconURLIfEmoji changes the post icon override URL prop, if it has an emoji icon,
   240  	// so that it points to the URL (relative) of the emoji - static if emoji is default, /api if custom.
   241  	OverrideIconURLIfEmoji(post *model.Post)
   242  	// PatchBot applies the given patch to the bot and corresponding user.
   243  	PatchBot(botUserId string, botPatch *model.BotPatch) (*model.Bot, *model.AppError)
   244  	// PatchChannelModerationsForChannel Updates a channels scheme roles based on a given ChannelModerationPatch, if the permissions match the higher scoped role the scheme is deleted.
   245  	PatchChannelModerationsForChannel(channel *model.Channel, channelModerationsPatch []*model.ChannelModerationPatch) ([]*model.ChannelModeration, *model.AppError)
   246  	// Perform an HTTP POST request to an integration's action endpoint.
   247  	// Caller must consume and close returned http.Response as necessary.
   248  	// For internal requests, requests are routed directly to a plugin ServerHTTP hook
   249  	DoActionRequest(rawURL string, body []byte) (*http.Response, *model.AppError)
   250  	// PermanentDeleteBot permanently deletes a bot and its corresponding user.
   251  	PermanentDeleteBot(botUserId string) *model.AppError
   252  	// PromoteGuestToUser Convert user's roles and all his mermbership's roles from
   253  	// guest roles to regular user roles.
   254  	PromoteGuestToUser(user *model.User, requestorId string) *model.AppError
   255  	// RenameChannel is used to rename the channel Name and the DisplayName fields
   256  	RenameChannel(channel *model.Channel, newChannelName string, newDisplayName string) (*model.Channel, *model.AppError)
   257  	// RenameTeam is used to rename the team Name and the DisplayName fields
   258  	RenameTeam(team *model.Team, newTeamName string, newDisplayName string) (*model.Team, *model.AppError)
   259  	// RevokeSessionsFromAllUsers will go through all the sessions active
   260  	// in the server and revoke them
   261  	RevokeSessionsFromAllUsers() *model.AppError
   262  	// SaveConfig replaces the active configuration, optionally notifying cluster peers.
   263  	SaveConfig(newCfg *model.Config, sendConfigChangeClusterMessage bool) *model.AppError
   264  	// SearchAllChannels returns a list of channels, the total count of the results of the search (if the paginate search option is true), and an error.
   265  	SearchAllChannels(term string, opts model.ChannelSearchOpts) (*model.ChannelListWithTeamData, int64, *model.AppError)
   266  	// SearchAllTeams returns a team list and the total count of the results
   267  	SearchAllTeams(searchOpts *model.TeamSearch) ([]*model.Team, int64, *model.AppError)
   268  	// SendAdminUpgradeRequestEmail takes the username of user trying to alert admins and then applies rate limit of n (number of admins) emails per user per day
   269  	// before sending the emails.
   270  	SendAdminUpgradeRequestEmail(username string, subscription *model.Subscription) *model.AppError
   271  	// SendNoCardPaymentFailedEmail
   272  	SendNoCardPaymentFailedEmail() *model.AppError
   273  	// ServePluginPublicRequest serves public plugin files
   274  	// at the URL http(s)://$SITE_URL/plugins/$PLUGIN_ID/public/{anything}
   275  	ServePluginPublicRequest(w http.ResponseWriter, r *http.Request)
   276  	// ServerBusyStateChanged is called when a CLUSTER_EVENT_BUSY_STATE_CHANGED is received.
   277  	ServerBusyStateChanged(sbs *model.ServerBusyState)
   278  	// SessionHasPermissionToManageBot returns nil if the session has access to manage the given bot.
   279  	// This function deviates from other authorization checks in returning an error instead of just
   280  	// a boolean, allowing the permission failure to be exposed with more granularity.
   281  	SessionHasPermissionToManageBot(session model.Session, botUserId string) *model.AppError
   282  	// SessionIsRegistered determines if a specific session has been registered
   283  	SessionIsRegistered(session model.Session) bool
   284  	// SetBotIconImage sets LHS icon for a bot.
   285  	SetBotIconImage(botUserId string, file io.ReadSeeker) *model.AppError
   286  	// SetBotIconImageFromMultiPartFile sets LHS icon for a bot.
   287  	SetBotIconImageFromMultiPartFile(botUserId string, imageData *multipart.FileHeader) *model.AppError
   288  	// SetSessionExpireInDays sets the session's expiry the specified number of days
   289  	// relative to either the session creation date or the current time, depending
   290  	// on the `ExtendSessionOnActivity` config setting.
   291  	SetSessionExpireInDays(session *model.Session, days int)
   292  	// SetStatusLastActivityAt sets the last activity at for a user on the local app server and updates
   293  	// status to away if needed. Used by the WS to set status to away if an 'online' device disconnects
   294  	// while an 'away' device is still connected
   295  	SetStatusLastActivityAt(userID string, activityAt int64)
   296  	// SyncPlugins synchronizes the plugins installed locally
   297  	// with the plugin bundles available in the file store.
   298  	SyncPlugins() *model.AppError
   299  	// SyncRolesAndMembership updates the SchemeAdmin status and membership of all of the members of the given
   300  	// syncable.
   301  	SyncRolesAndMembership(syncableID string, syncableType model.GroupSyncableType)
   302  	// SyncSyncableRoles updates the SchemeAdmin field value of the given syncable's members based on the configuration of
   303  	// the member's group memberships and the configuration of those groups to the syncable. This method should only
   304  	// be invoked on group-synced (aka group-constrained) syncables.
   305  	SyncSyncableRoles(syncableID string, syncableType model.GroupSyncableType) *model.AppError
   306  	// TeamMembersMinusGroupMembers returns the set of users on the given team minus the set of users in the given
   307  	// groups.
   308  	//
   309  	// The result can be used, for example, to determine the set of users who would be removed from a team if the team
   310  	// were group-constrained with the given groups.
   311  	TeamMembersMinusGroupMembers(teamID string, groupIDs []string, page, perPage int) ([]*model.UserWithGroups, int64, *model.AppError)
   312  	// This function migrates the default built in roles from code/config to the database.
   313  	DoAdvancedPermissionsMigration()
   314  	// This function zip's up all the files in fileDatas array and then saves it to the directory specified with the specified zip file name
   315  	// Ensure the zip file name ends with a .zip
   316  	CreateZipFileAndAddFiles(fileBackend filesstore.FileBackend, fileDatas []model.FileData, zipFileName, directory string) error
   317  	// This to be used for places we check the users password when they are already logged in
   318  	DoubleCheckPassword(user *model.User, password string) *model.AppError
   319  	// UpdateBotActive marks a bot as active or inactive, along with its corresponding user.
   320  	UpdateBotActive(botUserId string, active bool) (*model.Bot, *model.AppError)
   321  	// UpdateBotOwner changes a bot's owner to the given value.
   322  	UpdateBotOwner(botUserId, newOwnerId string) (*model.Bot, *model.AppError)
   323  	// UpdateChannel updates a given channel by its Id. It also publishes the CHANNEL_UPDATED event.
   324  	UpdateChannel(channel *model.Channel) (*model.Channel, *model.AppError)
   325  	// UpdateChannelScheme saves the new SchemeId of the channel passed.
   326  	UpdateChannelScheme(channel *model.Channel) (*model.Channel, *model.AppError)
   327  	// UpdateProductNotices is called periodically from a scheduled worker to fetch new notices and update the cache
   328  	UpdateProductNotices() *model.AppError
   329  	// UpdateViewedProductNotices is called from the frontend to mark a set of notices as 'viewed' by user
   330  	UpdateViewedProductNotices(userID string, noticeIds []string) *model.AppError
   331  	// UpdateViewedProductNoticesForNewUser is called when new user is created to mark all current notices for this
   332  	// user as viewed in order to avoid showing them imminently on first login
   333  	UpdateViewedProductNoticesForNewUser(userID string)
   334  	// UpdateWebConnUserActivity sets the LastUserActivityAt of the hub for the given session.
   335  	UpdateWebConnUserActivity(session model.Session, activityAt int64)
   336  	// UploadFile uploads a single file in form of a completely constructed byte array for a channel.
   337  	UploadFile(data []byte, channelId string, filename string) (*model.FileInfo, *model.AppError)
   338  	// UploadFileX uploads a single file as specified in t. It applies the upload
   339  	// constraints, executes plugins and image processing logic as needed. It
   340  	// returns a filled-out FileInfo and an optional error. A plugin may reject the
   341  	// upload, returning a rejection error. In this case FileInfo would have
   342  	// contained the last "good" FileInfo before the execution of that plugin.
   343  	UploadFileX(channelId, name string, input io.Reader, opts ...func(*UploadFileTask)) (*model.FileInfo, *model.AppError)
   344  	// Uploads some files to the given team and channel as the given user. files and filenames should have
   345  	// the same length. clientIds should either not be provided or have the same length as files and filenames.
   346  	// The provided files should be closed by the caller so that they are not leaked.
   347  	UploadFiles(teamID string, channelId string, userID string, files []io.ReadCloser, filenames []string, clientIds []string, now time.Time) (*model.FileUploadResponse, *model.AppError)
   348  	// UserIsInAdminRoleGroup returns true at least one of the user's groups are configured to set the members as
   349  	// admins in the given syncable.
   350  	UserIsInAdminRoleGroup(userID, syncableID string, syncableType model.GroupSyncableType) (bool, *model.AppError)
   351  	// VerifyPlugin checks that the given signature corresponds to the given plugin and matches a trusted certificate.
   352  	VerifyPlugin(plugin, signature io.ReadSeeker) *model.AppError
   353  	//GetUserStatusesByIds used by apiV4
   354  	GetUserStatusesByIds(userIDs []string) ([]*model.Status, *model.AppError)
   355  	AcceptLanguage() string
   356  	AccountMigration() einterfaces.AccountMigrationInterface
   357  	ActivateMfa(userID, token string) *model.AppError
   358  	AddChannelMember(userID string, channel *model.Channel, userRequestorId string, postRootId string) (*model.ChannelMember, *model.AppError)
   359  	AddConfigListener(listener func(*model.Config, *model.Config)) string
   360  	AddDirectChannels(teamID string, user *model.User) *model.AppError
   361  	AddLdapPrivateCertificate(fileData *multipart.FileHeader) *model.AppError
   362  	AddLdapPublicCertificate(fileData *multipart.FileHeader) *model.AppError
   363  	AddSamlIdpCertificate(fileData *multipart.FileHeader) *model.AppError
   364  	AddSamlPrivateCertificate(fileData *multipart.FileHeader) *model.AppError
   365  	AddSamlPublicCertificate(fileData *multipart.FileHeader) *model.AppError
   366  	AddSessionToCache(session *model.Session)
   367  	AddStatusCache(status *model.Status)
   368  	AddStatusCacheSkipClusterSend(status *model.Status)
   369  	AddTeamMember(teamID, userID string) (*model.TeamMember, *model.AppError)
   370  	AddTeamMemberByInviteId(inviteId, userID string) (*model.TeamMember, *model.AppError)
   371  	AddTeamMemberByToken(userID, tokenID string) (*model.TeamMember, *model.AppError)
   372  	AddTeamMembers(teamID string, userIDs []string, userRequestorId string, graceful bool) ([]*model.TeamMemberWithError, *model.AppError)
   373  	AddUserToChannel(user *model.User, channel *model.Channel) (*model.ChannelMember, *model.AppError)
   374  	AddUserToTeam(teamID string, userID string, userRequestorId string) (*model.Team, *model.AppError)
   375  	AddUserToTeamByInviteId(inviteId string, userID string) (*model.Team, *model.AppError)
   376  	AddUserToTeamByTeamId(teamID string, user *model.User) *model.AppError
   377  	AddUserToTeamByToken(userID string, tokenID string) (*model.Team, *model.AppError)
   378  	AdjustImage(file io.Reader) (*bytes.Buffer, *model.AppError)
   379  	AllowOAuthAppAccessToUser(userID string, authRequest *model.AuthorizeRequest) (string, *model.AppError)
   380  	AppendFile(fr io.Reader, path string) (int64, *model.AppError)
   381  	AsymmetricSigningKey() *ecdsa.PrivateKey
   382  	AttachDeviceId(sessionId string, deviceId string, expiresAt int64) *model.AppError
   383  	AttachSessionCookies(w http.ResponseWriter, r *http.Request)
   384  	AuthenticateUserForLogin(id, loginId, password, mfaToken, cwsToken string, ldapOnly bool) (user *model.User, err *model.AppError)
   385  	AuthorizeOAuthUser(w http.ResponseWriter, r *http.Request, service, code, state, redirectUri string) (io.ReadCloser, string, map[string]string, *model.User, *model.AppError)
   386  	AutocompleteChannels(teamID string, term string) (*model.ChannelList, *model.AppError)
   387  	AutocompleteChannelsForSearch(teamID string, userID string, term string) (*model.ChannelList, *model.AppError)
   388  	AutocompleteUsersInChannel(teamID string, channelId string, term string, options *model.UserSearchOptions) (*model.UserAutocompleteInChannel, *model.AppError)
   389  	AutocompleteUsersInTeam(teamID string, term string, options *model.UserSearchOptions) (*model.UserAutocompleteInTeam, *model.AppError)
   390  	BroadcastStatus(status *model.Status)
   391  	BuildPostReactions(postId string) (*[]ReactionImportData, *model.AppError)
   392  	BuildPushNotificationMessage(contentsConfig string, post *model.Post, user *model.User, channel *model.Channel, channelName string, senderName string, explicitMention bool, channelWideMention bool, replyToThreadType string) (*model.PushNotification, *model.AppError)
   393  	BuildSamlMetadataObject(idpMetadata []byte) (*model.SamlMetadataResponse, *model.AppError)
   394  	BulkExport(writer io.Writer, outPath string, opts BulkExportOpts) *model.AppError
   395  	BulkImport(fileReader io.Reader, dryRun bool, workers int) (*model.AppError, int)
   396  	BulkImportWithPath(fileReader io.Reader, dryRun bool, workers int, importPath string) (*model.AppError, int)
   397  	CancelJob(jobId string) *model.AppError
   398  	ChannelMembersToAdd(since int64, channelID *string) ([]*model.UserChannelIDPair, *model.AppError)
   399  	ChannelMembersToRemove(teamID *string) ([]*model.ChannelMember, *model.AppError)
   400  	CheckAndSendUserLimitWarningEmails() *model.AppError
   401  	CheckForClientSideCert(r *http.Request) (string, string, string)
   402  	CheckMandatoryS3Fields(settings *model.FileSettings) *model.AppError
   403  	CheckPasswordAndAllCriteria(user *model.User, password string, mfaToken string) *model.AppError
   404  	CheckRolesExist(roleNames []string) *model.AppError
   405  	CheckUserAllAuthenticationCriteria(user *model.User, mfaToken string) *model.AppError
   406  	CheckUserMfa(user *model.User, token string) *model.AppError
   407  	CheckUserPostflightAuthenticationCriteria(user *model.User) *model.AppError
   408  	CheckUserPreflightAuthenticationCriteria(user *model.User, mfaToken string) *model.AppError
   409  	CheckValidDomains(team *model.Team) *model.AppError
   410  	ClearChannelMembersCache(channelID string)
   411  	ClearSessionCacheForAllUsers()
   412  	ClearSessionCacheForAllUsersSkipClusterSend()
   413  	ClearSessionCacheForUser(userID string)
   414  	ClearSessionCacheForUserSkipClusterSend(userID string)
   415  	ClearTeamMembersCache(teamID string)
   416  	ClientConfig() map[string]string
   417  	ClientConfigHash() string
   418  	Cloud() einterfaces.CloudInterface
   419  	Cluster() einterfaces.ClusterInterface
   420  	CompareAndDeletePluginKey(pluginId string, key string, oldValue []byte) (bool, *model.AppError)
   421  	CompareAndSetPluginKey(pluginId string, key string, oldValue, newValue []byte) (bool, *model.AppError)
   422  	CompleteOAuth(service string, body io.ReadCloser, teamID string, props map[string]string, tokenUser *model.User) (*model.User, *model.AppError)
   423  	CompleteSwitchWithOAuth(service string, userData io.Reader, email string, tokenUser *model.User) (*model.User, *model.AppError)
   424  	Compliance() einterfaces.ComplianceInterface
   425  	Config() *model.Config
   426  	Context() context.Context
   427  	CopyFileInfos(userID string, fileIds []string) ([]string, *model.AppError)
   428  	CreateChannel(channel *model.Channel, addMember bool) (*model.Channel, *model.AppError)
   429  	CreateChannelWithUser(channel *model.Channel, userID string) (*model.Channel, *model.AppError)
   430  	CreateCommand(cmd *model.Command) (*model.Command, *model.AppError)
   431  	CreateCommandWebhook(commandID string, args *model.CommandArgs) (*model.CommandWebhook, *model.AppError)
   432  	CreateEmoji(sessionUserId string, emoji *model.Emoji, multiPartImageData *multipart.Form) (*model.Emoji, *model.AppError)
   433  	CreateGroup(group *model.Group) (*model.Group, *model.AppError)
   434  	CreateGroupChannel(userIDs []string, creatorId string) (*model.Channel, *model.AppError)
   435  	CreateIncomingWebhookForChannel(creatorId string, channel *model.Channel, hook *model.IncomingWebhook) (*model.IncomingWebhook, *model.AppError)
   436  	CreateJob(job *model.Job) (*model.Job, *model.AppError)
   437  	CreateOAuthApp(app *model.OAuthApp) (*model.OAuthApp, *model.AppError)
   438  	CreateOAuthStateToken(extra string) (*model.Token, *model.AppError)
   439  	CreateOAuthUser(service string, userData io.Reader, teamID string, tokenUser *model.User) (*model.User, *model.AppError)
   440  	CreateOutgoingWebhook(hook *model.OutgoingWebhook) (*model.OutgoingWebhook, *model.AppError)
   441  	CreatePasswordRecoveryToken(userID, email string) (*model.Token, *model.AppError)
   442  	CreatePost(post *model.Post, channel *model.Channel, triggerWebhooks, setOnline bool) (savedPost *model.Post, err *model.AppError)
   443  	CreatePostAsUser(post *model.Post, currentSessionId string, setOnline bool) (*model.Post, *model.AppError)
   444  	CreatePostMissingChannel(post *model.Post, triggerWebhooks bool) (*model.Post, *model.AppError)
   445  	CreateRole(role *model.Role) (*model.Role, *model.AppError)
   446  	CreateScheme(scheme *model.Scheme) (*model.Scheme, *model.AppError)
   447  	CreateSession(session *model.Session) (*model.Session, *model.AppError)
   448  	CreateSidebarCategory(userID, teamID string, newCategory *model.SidebarCategoryWithChannels) (*model.SidebarCategoryWithChannels, *model.AppError)
   449  	CreateTeam(team *model.Team) (*model.Team, *model.AppError)
   450  	CreateTeamWithUser(team *model.Team, userID string) (*model.Team, *model.AppError)
   451  	CreateTermsOfService(text, userID string) (*model.TermsOfService, *model.AppError)
   452  	CreateUploadSession(us *model.UploadSession) (*model.UploadSession, *model.AppError)
   453  	CreateUserAccessToken(token *model.UserAccessToken) (*model.UserAccessToken, *model.AppError)
   454  	CreateUserAsAdmin(user *model.User, redirect string) (*model.User, *model.AppError)
   455  	CreateUserFromSignup(user *model.User, redirect string) (*model.User, *model.AppError)
   456  	CreateUserWithInviteId(user *model.User, inviteId, redirect string) (*model.User, *model.AppError)
   457  	CreateUserWithToken(user *model.User, token *model.Token) (*model.User, *model.AppError)
   458  	CreateWebhookPost(userID string, channel *model.Channel, text, overrideUsername, overrideIconURL, overrideIconEmoji string, props model.StringInterface, postType string, postRootId string) (*model.Post, *model.AppError)
   459  	DBHealthCheckDelete() error
   460  	DBHealthCheckWrite() error
   461  	DataRetention() einterfaces.DataRetentionInterface
   462  	DeactivateGuests() *model.AppError
   463  	DeactivateMfa(userID string) *model.AppError
   464  	DeauthorizeOAuthAppForUser(userID, appId string) *model.AppError
   465  	DeleteAllExpiredPluginKeys() *model.AppError
   466  	DeleteAllKeysForPlugin(pluginId string) *model.AppError
   467  	DeleteBrandImage() *model.AppError
   468  	DeleteChannel(channel *model.Channel, userID string) *model.AppError
   469  	DeleteCommand(commandID string) *model.AppError
   470  	DeleteEmoji(emoji *model.Emoji) *model.AppError
   471  	DeleteEphemeralPost(userID, postId string)
   472  	DeleteExport(name string) *model.AppError
   473  	DeleteFlaggedPosts(postId string)
   474  	DeleteGroup(groupID string) (*model.Group, *model.AppError)
   475  	DeleteGroupMember(groupID string, userID string) (*model.GroupMember, *model.AppError)
   476  	DeleteGroupSyncable(groupID string, syncableID string, syncableType model.GroupSyncableType) (*model.GroupSyncable, *model.AppError)
   477  	DeleteIncomingWebhook(hookID string) *model.AppError
   478  	DeleteOAuthApp(appId string) *model.AppError
   479  	DeleteOutgoingWebhook(hookID string) *model.AppError
   480  	DeletePluginKey(pluginId string, key string) *model.AppError
   481  	DeletePost(postId, deleteByID string) (*model.Post, *model.AppError)
   482  	DeletePostFiles(post *model.Post)
   483  	DeletePreferences(userID string, preferences model.Preferences) *model.AppError
   484  	DeleteReactionForPost(reaction *model.Reaction) *model.AppError
   485  	DeleteScheme(schemeId string) (*model.Scheme, *model.AppError)
   486  	DeleteSidebarCategory(userID, teamID, categoryId string) *model.AppError
   487  	DeleteToken(token *model.Token) *model.AppError
   488  	DisableAutoResponder(userID string, asAdmin bool) *model.AppError
   489  	DisableUserAccessToken(token *model.UserAccessToken) *model.AppError
   490  	DoAppMigrations()
   491  	DoCommandRequest(cmd *model.Command, p url.Values) (*model.Command, *model.CommandResponse, *model.AppError)
   492  	DoEmojisPermissionsMigration()
   493  	DoGuestRolesCreationMigration()
   494  	DoLocalRequest(rawURL string, body []byte) (*http.Response, *model.AppError)
   495  	DoLogin(w http.ResponseWriter, r *http.Request, user *model.User, deviceId string, isMobile, isOAuthUser, isSaml bool) *model.AppError
   496  	DoPostAction(postId, actionId, userID, selectedOption string) (string, *model.AppError)
   497  	DoPostActionWithCookie(postId, actionId, userID, selectedOption string, cookie *model.PostActionCookie) (string, *model.AppError)
   498  	DoSystemConsoleRolesCreationMigration()
   499  	DoUploadFile(now time.Time, rawTeamId string, rawChannelId string, rawUserId string, rawFilename string, data []byte) (*model.FileInfo, *model.AppError)
   500  	DoUploadFileExpectModification(now time.Time, rawTeamId string, rawChannelId string, rawUserId string, rawFilename string, data []byte) (*model.FileInfo, []byte, *model.AppError)
   501  	DownloadFromURL(downloadURL string) ([]byte, error)
   502  	EnableUserAccessToken(token *model.UserAccessToken) *model.AppError
   503  	EnvironmentConfig() map[string]interface{}
   504  	ExportPermissions(w io.Writer) error
   505  	FetchSamlMetadataFromIdp(url string) ([]byte, *model.AppError)
   506  	FileBackend() (filesstore.FileBackend, *model.AppError)
   507  	FileExists(path string) (bool, *model.AppError)
   508  	FileModTime(path string) (time.Time, *model.AppError)
   509  	FileSize(path string) (int64, *model.AppError)
   510  	FillInChannelProps(channel *model.Channel) *model.AppError
   511  	FillInChannelsProps(channelList *model.ChannelList) *model.AppError
   512  	FilterUsersByVisible(viewer *model.User, otherUsers []*model.User) ([]*model.User, *model.AppError)
   513  	FindTeamByName(name string) bool
   514  	GenerateMfaSecret(userID string) (*model.MfaSecret, *model.AppError)
   515  	GeneratePublicLink(siteURL string, info *model.FileInfo) string
   516  	GenerateSupportPacket() []model.FileData
   517  	GetActivePluginManifests() ([]*model.Manifest, *model.AppError)
   518  	GetAllChannels(page, perPage int, opts model.ChannelSearchOpts) (*model.ChannelListWithTeamData, *model.AppError)
   519  	GetAllChannelsCount(opts model.ChannelSearchOpts) (int64, *model.AppError)
   520  	GetAllPrivateTeams() ([]*model.Team, *model.AppError)
   521  	GetAllPrivateTeamsPage(offset int, limit int) ([]*model.Team, *model.AppError)
   522  	GetAllPrivateTeamsPageWithCount(offset int, limit int) (*model.TeamsWithCount, *model.AppError)
   523  	GetAllPublicTeams() ([]*model.Team, *model.AppError)
   524  	GetAllPublicTeamsPage(offset int, limit int) ([]*model.Team, *model.AppError)
   525  	GetAllPublicTeamsPageWithCount(offset int, limit int) (*model.TeamsWithCount, *model.AppError)
   526  	GetAllRoles() ([]*model.Role, *model.AppError)
   527  	GetAllStatuses() map[string]*model.Status
   528  	GetAllTeams() ([]*model.Team, *model.AppError)
   529  	GetAllTeamsPage(offset int, limit int) ([]*model.Team, *model.AppError)
   530  	GetAllTeamsPageWithCount(offset int, limit int) (*model.TeamsWithCount, *model.AppError)
   531  	GetAnalytics(name string, teamID string) (model.AnalyticsRows, *model.AppError)
   532  	GetAudits(userID string, limit int) (model.Audits, *model.AppError)
   533  	GetAuditsPage(userID string, page int, perPage int) (model.Audits, *model.AppError)
   534  	GetAuthorizationCode(w http.ResponseWriter, r *http.Request, service string, props map[string]string, loginHint string) (string, *model.AppError)
   535  	GetAuthorizedAppsForUser(userID string, page, perPage int) ([]*model.OAuthApp, *model.AppError)
   536  	GetBrandImage() ([]byte, *model.AppError)
   537  	GetBulkReactionsForPosts(postIds []string) (map[string][]*model.Reaction, *model.AppError)
   538  	GetChannel(channelId string) (*model.Channel, *model.AppError)
   539  	GetChannelByName(channelName, teamID string, includeDeleted bool) (*model.Channel, *model.AppError)
   540  	GetChannelByNameForTeamName(channelName, teamName string, includeDeleted bool) (*model.Channel, *model.AppError)
   541  	GetChannelCounts(teamID string, userID string) (*model.ChannelCounts, *model.AppError)
   542  	GetChannelGuestCount(channelId string) (int64, *model.AppError)
   543  	GetChannelMember(channelId string, userID string) (*model.ChannelMember, *model.AppError)
   544  	GetChannelMemberCount(channelId string) (int64, *model.AppError)
   545  	GetChannelMembersByIds(channelId string, userIDs []string) (*model.ChannelMembers, *model.AppError)
   546  	GetChannelMembersForUser(teamID string, userID string) (*model.ChannelMembers, *model.AppError)
   547  	GetChannelMembersForUserWithPagination(teamID, userID string, page, perPage int) ([]*model.ChannelMember, *model.AppError)
   548  	GetChannelMembersPage(channelId string, page, perPage int) (*model.ChannelMembers, *model.AppError)
   549  	GetChannelMembersTimezones(channelId string) ([]string, *model.AppError)
   550  	GetChannelPinnedPostCount(channelId string) (int64, *model.AppError)
   551  	GetChannelUnread(channelId, userID string) (*model.ChannelUnread, *model.AppError)
   552  	GetChannelsByNames(channelNames []string, teamID string) ([]*model.Channel, *model.AppError)
   553  	GetChannelsForScheme(scheme *model.Scheme, offset int, limit int) (model.ChannelList, *model.AppError)
   554  	GetChannelsForSchemePage(scheme *model.Scheme, page int, perPage int) (model.ChannelList, *model.AppError)
   555  	GetChannelsForUser(teamID string, userID string, includeDeleted bool, lastDeleteAt int) (*model.ChannelList, *model.AppError)
   556  	GetChannelsUserNotIn(teamID string, userID string, offset int, limit int) (*model.ChannelList, *model.AppError)
   557  	GetCloudSession(token string) (*model.Session, *model.AppError)
   558  	GetClusterId() string
   559  	GetClusterStatus() []*model.ClusterInfo
   560  	GetCommand(commandID string) (*model.Command, *model.AppError)
   561  	GetComplianceFile(job *model.Compliance) ([]byte, *model.AppError)
   562  	GetComplianceReport(reportId string) (*model.Compliance, *model.AppError)
   563  	GetComplianceReports(page, perPage int) (model.Compliances, *model.AppError)
   564  	GetCookieDomain() string
   565  	GetDataRetentionPolicy() (*model.DataRetentionPolicy, *model.AppError)
   566  	GetDefaultProfileImage(user *model.User) ([]byte, *model.AppError)
   567  	GetDeletedChannels(teamID string, offset int, limit int, userID string) (*model.ChannelList, *model.AppError)
   568  	GetEmoji(emojiId string) (*model.Emoji, *model.AppError)
   569  	GetEmojiByName(emojiName string) (*model.Emoji, *model.AppError)
   570  	GetEmojiImage(emojiId string) ([]byte, string, *model.AppError)
   571  	GetEmojiList(page, perPage int, sort string) ([]*model.Emoji, *model.AppError)
   572  	GetErrorListForEmailsOverLimit(emailList []string, cloudUserLimit int64) ([]string, []*model.EmailInviteWithError, *model.AppError)
   573  	GetFile(fileId string) ([]byte, *model.AppError)
   574  	GetFileInfo(fileId string) (*model.FileInfo, *model.AppError)
   575  	GetFileInfos(page, perPage int, opt *model.GetFileInfosOptions) ([]*model.FileInfo, *model.AppError)
   576  	GetFileInfosForPost(postId string, fromMaster bool) ([]*model.FileInfo, *model.AppError)
   577  	GetFileInfosForPostWithMigration(postId string) ([]*model.FileInfo, *model.AppError)
   578  	GetFlaggedPosts(userID string, offset int, limit int) (*model.PostList, *model.AppError)
   579  	GetFlaggedPostsForChannel(userID, channelId string, offset int, limit int) (*model.PostList, *model.AppError)
   580  	GetFlaggedPostsForTeam(userID, teamID string, offset int, limit int) (*model.PostList, *model.AppError)
   581  	GetGroup(id string) (*model.Group, *model.AppError)
   582  	GetGroupByName(name string, opts model.GroupSearchOpts) (*model.Group, *model.AppError)
   583  	GetGroupByRemoteID(remoteID string, groupSource model.GroupSource) (*model.Group, *model.AppError)
   584  	GetGroupChannel(userIDs []string) (*model.Channel, *model.AppError)
   585  	GetGroupMemberCount(groupID string) (int64, *model.AppError)
   586  	GetGroupMemberUsers(groupID string) ([]*model.User, *model.AppError)
   587  	GetGroupMemberUsersPage(groupID string, page int, perPage int) ([]*model.User, int, *model.AppError)
   588  	GetGroupSyncable(groupID string, syncableID string, syncableType model.GroupSyncableType) (*model.GroupSyncable, *model.AppError)
   589  	GetGroupSyncables(groupID string, syncableType model.GroupSyncableType) ([]*model.GroupSyncable, *model.AppError)
   590  	GetGroups(page, perPage int, opts model.GroupSearchOpts) ([]*model.Group, *model.AppError)
   591  	GetGroupsAssociatedToChannelsByTeam(teamID string, opts model.GroupSearchOpts) (map[string][]*model.GroupWithSchemeAdmin, *model.AppError)
   592  	GetGroupsByChannel(channelId string, opts model.GroupSearchOpts) ([]*model.GroupWithSchemeAdmin, int, *model.AppError)
   593  	GetGroupsByIDs(groupIDs []string) ([]*model.Group, *model.AppError)
   594  	GetGroupsBySource(groupSource model.GroupSource) ([]*model.Group, *model.AppError)
   595  	GetGroupsByUserId(userID string) ([]*model.Group, *model.AppError)
   596  	GetHubForUserId(userID string) *Hub
   597  	GetIncomingWebhook(hookID string) (*model.IncomingWebhook, *model.AppError)
   598  	GetIncomingWebhooksForTeamPage(teamID string, page, perPage int) ([]*model.IncomingWebhook, *model.AppError)
   599  	GetIncomingWebhooksForTeamPageByUser(teamID string, userID string, page, perPage int) ([]*model.IncomingWebhook, *model.AppError)
   600  	GetIncomingWebhooksPage(page, perPage int) ([]*model.IncomingWebhook, *model.AppError)
   601  	GetIncomingWebhooksPageByUser(userID string, page, perPage int) ([]*model.IncomingWebhook, *model.AppError)
   602  	GetJob(id string) (*model.Job, *model.AppError)
   603  	GetJobs(offset int, limit int) ([]*model.Job, *model.AppError)
   604  	GetJobsByType(jobType string, offset int, limit int) ([]*model.Job, *model.AppError)
   605  	GetJobsByTypePage(jobType string, page int, perPage int) ([]*model.Job, *model.AppError)
   606  	GetJobsPage(page int, perPage int) ([]*model.Job, *model.AppError)
   607  	GetLatestTermsOfService() (*model.TermsOfService, *model.AppError)
   608  	GetLogs(page, perPage int) ([]string, *model.AppError)
   609  	GetLogsSkipSend(page, perPage int) ([]string, *model.AppError)
   610  	GetMemberCountsByGroup(channelID string, includeTimezones bool) ([]*model.ChannelMemberCountByGroup, *model.AppError)
   611  	GetMessageForNotification(post *model.Post, translateFunc i18n.TranslateFunc) string
   612  	GetMultipleEmojiByName(names []string) ([]*model.Emoji, *model.AppError)
   613  	GetNewUsersForTeamPage(teamID string, page, perPage int, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError)
   614  	GetNextPostIdFromPostList(postList *model.PostList) string
   615  	GetNotificationNameFormat(user *model.User) string
   616  	GetNumberOfChannelsOnTeam(teamID string) (int, *model.AppError)
   617  	GetOAuthAccessTokenForCodeFlow(clientId, grantType, redirectUri, code, secret, refreshToken string) (*model.AccessResponse, *model.AppError)
   618  	GetOAuthAccessTokenForImplicitFlow(userID string, authRequest *model.AuthorizeRequest) (*model.Session, *model.AppError)
   619  	GetOAuthApp(appId string) (*model.OAuthApp, *model.AppError)
   620  	GetOAuthApps(page, perPage int) ([]*model.OAuthApp, *model.AppError)
   621  	GetOAuthAppsByCreator(userID string, page, perPage int) ([]*model.OAuthApp, *model.AppError)
   622  	GetOAuthCodeRedirect(userID string, authRequest *model.AuthorizeRequest) (string, *model.AppError)
   623  	GetOAuthImplicitRedirect(userID string, authRequest *model.AuthorizeRequest) (string, *model.AppError)
   624  	GetOAuthLoginEndpoint(w http.ResponseWriter, r *http.Request, service, teamID, action, redirectTo, loginHint string, isMobile bool) (string, *model.AppError)
   625  	GetOAuthSignupEndpoint(w http.ResponseWriter, r *http.Request, service, teamID string) (string, *model.AppError)
   626  	GetOAuthStateToken(token string) (*model.Token, *model.AppError)
   627  	GetOpenGraphMetadata(requestURL string) *opengraph.OpenGraph
   628  	GetOrCreateDirectChannel(userID, otherUserID string) (*model.Channel, *model.AppError)
   629  	GetOutgoingWebhook(hookID string) (*model.OutgoingWebhook, *model.AppError)
   630  	GetOutgoingWebhooksForChannelPageByUser(channelId string, userID string, page, perPage int) ([]*model.OutgoingWebhook, *model.AppError)
   631  	GetOutgoingWebhooksForTeamPage(teamID string, page, perPage int) ([]*model.OutgoingWebhook, *model.AppError)
   632  	GetOutgoingWebhooksForTeamPageByUser(teamID string, userID string, page, perPage int) ([]*model.OutgoingWebhook, *model.AppError)
   633  	GetOutgoingWebhooksPage(page, perPage int) ([]*model.OutgoingWebhook, *model.AppError)
   634  	GetOutgoingWebhooksPageByUser(userID string, page, perPage int) ([]*model.OutgoingWebhook, *model.AppError)
   635  	GetPasswordRecoveryToken(token string) (*model.Token, *model.AppError)
   636  	GetPermalinkPost(postId string, userID string) (*model.PostList, *model.AppError)
   637  	GetPinnedPosts(channelId string) (*model.PostList, *model.AppError)
   638  	GetPluginKey(pluginId string, key string) ([]byte, *model.AppError)
   639  	GetPlugins() (*model.PluginsResponse, *model.AppError)
   640  	GetPostAfterTime(channelId string, time int64) (*model.Post, *model.AppError)
   641  	GetPostIdAfterTime(channelId string, time int64) (string, *model.AppError)
   642  	GetPostIdBeforeTime(channelId string, time int64) (string, *model.AppError)
   643  	GetPostThread(postId string, skipFetchThreads, collapsedThreads, collapsedThreadsExtended bool) (*model.PostList, *model.AppError)
   644  	GetPosts(channelId string, offset int, limit int) (*model.PostList, *model.AppError)
   645  	GetPostsAfterPost(options model.GetPostsOptions) (*model.PostList, *model.AppError)
   646  	GetPostsAroundPost(before bool, options model.GetPostsOptions) (*model.PostList, *model.AppError)
   647  	GetPostsBeforePost(options model.GetPostsOptions) (*model.PostList, *model.AppError)
   648  	GetPostsEtag(channelId string, collapsedThreads bool) string
   649  	GetPostsForChannelAroundLastUnread(channelId, userID string, limitBefore, limitAfter int, skipFetchThreads bool, collapsedThreads, collapsedThreadsExtended bool) (*model.PostList, *model.AppError)
   650  	GetPostsPage(options model.GetPostsOptions) (*model.PostList, *model.AppError)
   651  	GetPostsSince(options model.GetPostsSinceOptions) (*model.PostList, *model.AppError)
   652  	GetPreferenceByCategoryAndNameForUser(userID string, category string, preferenceName string) (*model.Preference, *model.AppError)
   653  	GetPreferenceByCategoryForUser(userID string, category string) (model.Preferences, *model.AppError)
   654  	GetPreferencesForUser(userID string) (model.Preferences, *model.AppError)
   655  	GetPrevPostIdFromPostList(postList *model.PostList) string
   656  	GetPrivateChannelsForTeam(teamID string, offset int, limit int) (*model.ChannelList, *model.AppError)
   657  	GetProfileImage(user *model.User) ([]byte, bool, *model.AppError)
   658  	GetPublicChannelsByIdsForTeam(teamID string, channelIds []string) (*model.ChannelList, *model.AppError)
   659  	GetPublicChannelsForTeam(teamID string, offset int, limit int) (*model.ChannelList, *model.AppError)
   660  	GetReactionsForPost(postId string) ([]*model.Reaction, *model.AppError)
   661  	GetRecentlyActiveUsersForTeam(teamID string) (map[string]*model.User, *model.AppError)
   662  	GetRecentlyActiveUsersForTeamPage(teamID string, page, perPage int, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError)
   663  	GetRole(id string) (*model.Role, *model.AppError)
   664  	GetRoleByName(name string) (*model.Role, *model.AppError)
   665  	GetRolesByNames(names []string) ([]*model.Role, *model.AppError)
   666  	GetSamlCertificateStatus() *model.SamlCertificateStatus
   667  	GetSamlMetadata() (string, *model.AppError)
   668  	GetSamlMetadataFromIdp(idpMetadataUrl string) (*model.SamlMetadataResponse, *model.AppError)
   669  	GetSanitizeOptions(asAdmin bool) map[string]bool
   670  	GetScheme(id string) (*model.Scheme, *model.AppError)
   671  	GetSchemeByName(name string) (*model.Scheme, *model.AppError)
   672  	GetSchemeRolesForTeam(teamID string) (string, string, string, *model.AppError)
   673  	GetSchemes(scope string, offset int, limit int) ([]*model.Scheme, *model.AppError)
   674  	GetSchemesPage(scope string, page int, perPage int) ([]*model.Scheme, *model.AppError)
   675  	GetSession(token string) (*model.Session, *model.AppError)
   676  	GetSessionById(sessionId string) (*model.Session, *model.AppError)
   677  	GetSessions(userID string) ([]*model.Session, *model.AppError)
   678  	GetSidebarCategories(userID, teamID string) (*model.OrderedSidebarCategories, *model.AppError)
   679  	GetSidebarCategory(categoryId string) (*model.SidebarCategoryWithChannels, *model.AppError)
   680  	GetSidebarCategoryOrder(userID, teamID string) ([]string, *model.AppError)
   681  	GetSinglePost(postId string) (*model.Post, *model.AppError)
   682  	GetSiteURL() string
   683  	GetStatus(userID string) (*model.Status, *model.AppError)
   684  	GetStatusFromCache(userID string) *model.Status
   685  	GetStatusesByIds(userIDs []string) (map[string]interface{}, *model.AppError)
   686  	GetT() goi18n.TranslateFunc
   687  	GetTeam(teamID string) (*model.Team, *model.AppError)
   688  	GetTeamByInviteId(inviteId string) (*model.Team, *model.AppError)
   689  	GetTeamByName(name string) (*model.Team, *model.AppError)
   690  	GetTeamIcon(team *model.Team) ([]byte, *model.AppError)
   691  	GetTeamIdFromQuery(query url.Values) (string, *model.AppError)
   692  	GetTeamMember(teamID, userID string) (*model.TeamMember, *model.AppError)
   693  	GetTeamMembers(teamID string, offset int, limit int, teamMembersGetOptions *model.TeamMembersGetOptions) ([]*model.TeamMember, *model.AppError)
   694  	GetTeamMembersByIds(teamID string, userIDs []string, restrictions *model.ViewUsersRestrictions) ([]*model.TeamMember, *model.AppError)
   695  	GetTeamMembersForUser(userID string) ([]*model.TeamMember, *model.AppError)
   696  	GetTeamMembersForUserWithPagination(userID string, page, perPage int) ([]*model.TeamMember, *model.AppError)
   697  	GetTeamStats(teamID string, restrictions *model.ViewUsersRestrictions) (*model.TeamStats, *model.AppError)
   698  	GetTeamUnread(teamID, userID string) (*model.TeamUnread, *model.AppError)
   699  	GetTeamsForScheme(scheme *model.Scheme, offset int, limit int) ([]*model.Team, *model.AppError)
   700  	GetTeamsForSchemePage(scheme *model.Scheme, page int, perPage int) ([]*model.Team, *model.AppError)
   701  	GetTeamsForUser(userID string) ([]*model.Team, *model.AppError)
   702  	GetTeamsUnreadForUser(excludeTeamId string, userID string) ([]*model.TeamUnread, *model.AppError)
   703  	GetTermsOfService(id string) (*model.TermsOfService, *model.AppError)
   704  	GetThreadForUser(userID, teamID, threadId string, extended bool) (*model.ThreadResponse, *model.AppError)
   705  	GetThreadMembershipsForUser(userID, teamID string) ([]*model.ThreadMembership, error)
   706  	GetThreadMentionsForUserPerChannel(userId, teamId string) (map[string]int64, *model.AppError)
   707  	GetThreadsForUser(userID, teamID string, options model.GetUserThreadsOpts) (*model.Threads, *model.AppError)
   708  	GetUploadSession(uploadId string) (*model.UploadSession, *model.AppError)
   709  	GetUploadSessionsForUser(userID string) ([]*model.UploadSession, *model.AppError)
   710  	GetUser(userID string) (*model.User, *model.AppError)
   711  	GetUserAccessToken(tokenID string, sanitize bool) (*model.UserAccessToken, *model.AppError)
   712  	GetUserAccessTokens(page, perPage int) ([]*model.UserAccessToken, *model.AppError)
   713  	GetUserAccessTokensForUser(userID string, page, perPage int) ([]*model.UserAccessToken, *model.AppError)
   714  	GetUserByAuth(authData *string, authService string) (*model.User, *model.AppError)
   715  	GetUserByEmail(email string) (*model.User, *model.AppError)
   716  	GetUserByUsername(username string) (*model.User, *model.AppError)
   717  	GetUserForLogin(id, loginId string) (*model.User, *model.AppError)
   718  	GetUserTermsOfService(userID string) (*model.UserTermsOfService, *model.AppError)
   719  	GetUsers(options *model.UserGetOptions) ([]*model.User, *model.AppError)
   720  	GetUsersByGroupChannelIds(channelIds []string, asAdmin bool) (map[string][]*model.User, *model.AppError)
   721  	GetUsersByIds(userIDs []string, options *store.UserGetByIdsOpts) ([]*model.User, *model.AppError)
   722  	GetUsersByUsernames(usernames []string, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError)
   723  	GetUsersEtag(restrictionsHash string) string
   724  	GetUsersInChannel(options *model.UserGetOptions) ([]*model.User, *model.AppError)
   725  	GetUsersInChannelByStatus(options *model.UserGetOptions) ([]*model.User, *model.AppError)
   726  	GetUsersInChannelMap(options *model.UserGetOptions, asAdmin bool) (map[string]*model.User, *model.AppError)
   727  	GetUsersInChannelPage(options *model.UserGetOptions, asAdmin bool) ([]*model.User, *model.AppError)
   728  	GetUsersInChannelPageByStatus(options *model.UserGetOptions, asAdmin bool) ([]*model.User, *model.AppError)
   729  	GetUsersInTeam(options *model.UserGetOptions) ([]*model.User, *model.AppError)
   730  	GetUsersInTeamEtag(teamID string, restrictionsHash string) string
   731  	GetUsersInTeamPage(options *model.UserGetOptions, asAdmin bool) ([]*model.User, *model.AppError)
   732  	GetUsersNotInChannel(teamID string, channelId string, groupConstrained bool, offset int, limit int, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError)
   733  	GetUsersNotInChannelMap(teamID string, channelId string, groupConstrained bool, offset int, limit int, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) (map[string]*model.User, *model.AppError)
   734  	GetUsersNotInChannelPage(teamID string, channelId string, groupConstrained bool, page int, perPage int, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError)
   735  	GetUsersNotInTeam(teamID string, groupConstrained bool, offset int, limit int, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError)
   736  	GetUsersNotInTeamEtag(teamID string, restrictionsHash string) string
   737  	GetUsersNotInTeamPage(teamID string, groupConstrained bool, page int, perPage int, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError)
   738  	GetUsersPage(options *model.UserGetOptions, asAdmin bool) ([]*model.User, *model.AppError)
   739  	GetUsersWithoutTeam(options *model.UserGetOptions) ([]*model.User, *model.AppError)
   740  	GetUsersWithoutTeamPage(options *model.UserGetOptions, asAdmin bool) ([]*model.User, *model.AppError)
   741  	GetVerifyEmailToken(token string) (*model.Token, *model.AppError)
   742  	GetViewUsersRestrictions(userID string) (*model.ViewUsersRestrictions, *model.AppError)
   743  	GetWarnMetricsStatus() (map[string]*model.WarnMetricStatus, *model.AppError)
   744  	HTTPService() httpservice.HTTPService
   745  	Handle404(w http.ResponseWriter, r *http.Request)
   746  	HandleCommandResponse(command *model.Command, args *model.CommandArgs, response *model.CommandResponse, builtIn bool) (*model.CommandResponse, *model.AppError)
   747  	HandleCommandResponsePost(command *model.Command, args *model.CommandArgs, response *model.CommandResponse, builtIn bool) (*model.Post, *model.AppError)
   748  	HandleCommandWebhook(hookID string, response *model.CommandResponse) *model.AppError
   749  	HandleImages(previewPathList []string, thumbnailPathList []string, fileData [][]byte)
   750  	HandleIncomingWebhook(hookID string, req *model.IncomingWebhookRequest) *model.AppError
   751  	HandleMessageExportConfig(cfg *model.Config, appCfg *model.Config)
   752  	HasPermissionTo(askingUserId string, permission *model.Permission) bool
   753  	HasPermissionToChannel(askingUserId string, channelId string, permission *model.Permission) bool
   754  	HasPermissionToChannelByPost(askingUserId string, postId string, permission *model.Permission) bool
   755  	HasPermissionToTeam(askingUserId string, teamID string, permission *model.Permission) bool
   756  	HasPermissionToUser(askingUserId string, userID string) bool
   757  	HubStop()
   758  	ImageProxy() *imageproxy.ImageProxy
   759  	ImageProxyAdder() func(string) string
   760  	ImageProxyRemover() (f func(string) string)
   761  	ImportPermissions(jsonl io.Reader) error
   762  	InitPlugins(pluginDir, webappPluginDir string)
   763  	InitPostMetadata()
   764  	InitServer()
   765  	InstallPluginFromData(data model.PluginEventData)
   766  	InvalidateAllEmailInvites() *model.AppError
   767  	InvalidateCacheForUser(userID string)
   768  	InvalidateWebConnSessionCacheForUser(userID string)
   769  	InviteGuestsToChannels(teamID string, guestsInvite *model.GuestsInvite, senderId string) *model.AppError
   770  	InviteGuestsToChannelsGracefully(teamID string, guestsInvite *model.GuestsInvite, senderId string) ([]*model.EmailInviteWithError, *model.AppError)
   771  	InviteNewUsersToTeam(emailList []string, teamID, senderId string) *model.AppError
   772  	InviteNewUsersToTeamGracefully(emailList []string, teamID, senderId string) ([]*model.EmailInviteWithError, *model.AppError)
   773  	IpAddress() string
   774  	IsFirstUserAccount() bool
   775  	IsLeader() bool
   776  	IsPasswordValid(password string) *model.AppError
   777  	IsPhase2MigrationCompleted() *model.AppError
   778  	IsUserAway(lastActivityAt int64) bool
   779  	IsUserSignUpAllowed() *model.AppError
   780  	JoinChannel(channel *model.Channel, userID string) *model.AppError
   781  	JoinDefaultChannels(teamID string, user *model.User, shouldBeAdmin bool, userRequestorId string) *model.AppError
   782  	JoinUserToTeam(team *model.Team, user *model.User, userRequestorId string) *model.AppError
   783  	Ldap() einterfaces.LdapInterface
   784  	LeaveChannel(channelId string, userID string) *model.AppError
   785  	LeaveTeam(team *model.Team, user *model.User, requestorId string) *model.AppError
   786  	LimitedClientConfig() map[string]string
   787  	ListAllCommands(teamID string, T goi18n.TranslateFunc) ([]*model.Command, *model.AppError)
   788  	ListDirectory(path string) ([]string, *model.AppError)
   789  	ListExports() ([]string, *model.AppError)
   790  	ListImports() ([]string, *model.AppError)
   791  	ListPluginKeys(pluginId string, page, perPage int) ([]string, *model.AppError)
   792  	ListTeamCommands(teamID string) ([]*model.Command, *model.AppError)
   793  	Log() *mlog.Logger
   794  	LoginByOAuth(service string, userData io.Reader, teamID string, tokenUser *model.User) (*model.User, *model.AppError)
   795  	MakePermissionError(permissions []*model.Permission) *model.AppError
   796  	MarkChannelsAsViewed(channelIds []string, userID string, currentSessionId string) (map[string]int64, *model.AppError)
   797  	MaxPostSize() int
   798  	MessageExport() einterfaces.MessageExportInterface
   799  	Metrics() einterfaces.MetricsInterface
   800  	MigrateIdLDAP(toAttribute string) *model.AppError
   801  	MoveCommand(team *model.Team, command *model.Command) *model.AppError
   802  	MoveFile(oldPath, newPath string) *model.AppError
   803  	NewClusterDiscoveryService() *ClusterDiscoveryService
   804  	NewPluginAPI(manifest *model.Manifest) plugin.API
   805  	Notification() einterfaces.NotificationInterface
   806  	NotificationsLog() *mlog.Logger
   807  	NotifyAndSetWarnMetricAck(warnMetricId string, sender *model.User, forceAck bool, isBot bool) *model.AppError
   808  	OpenInteractiveDialog(request model.OpenDialogRequest) *model.AppError
   809  	OriginChecker() func(*http.Request) bool
   810  	PatchChannel(channel *model.Channel, patch *model.ChannelPatch, userID string) (*model.Channel, *model.AppError)
   811  	PatchPost(postId string, patch *model.PostPatch) (*model.Post, *model.AppError)
   812  	PatchRole(role *model.Role, patch *model.RolePatch) (*model.Role, *model.AppError)
   813  	PatchScheme(scheme *model.Scheme, patch *model.SchemePatch) (*model.Scheme, *model.AppError)
   814  	PatchTeam(teamID string, patch *model.TeamPatch) (*model.Team, *model.AppError)
   815  	PatchUser(userID string, patch *model.UserPatch, asAdmin bool) (*model.User, *model.AppError)
   816  	Path() string
   817  	PermanentDeleteAllUsers() *model.AppError
   818  	PermanentDeleteChannel(channel *model.Channel) *model.AppError
   819  	PermanentDeleteTeam(team *model.Team) *model.AppError
   820  	PermanentDeleteTeamId(teamID string) *model.AppError
   821  	PermanentDeleteUser(user *model.User) *model.AppError
   822  	PluginCommandsForTeam(teamID string) []*model.Command
   823  	PluginContext() *plugin.Context
   824  	PostActionCookieSecret() []byte
   825  	PostAddToChannelMessage(user *model.User, addedUser *model.User, channel *model.Channel, postRootId string) *model.AppError
   826  	PostPatchWithProxyRemovedFromImageURLs(patch *model.PostPatch) *model.PostPatch
   827  	PostUpdateChannelDisplayNameMessage(userID string, channel *model.Channel, oldChannelDisplayName, newChannelDisplayName string) *model.AppError
   828  	PostUpdateChannelHeaderMessage(userID string, channel *model.Channel, oldChannelHeader, newChannelHeader string) *model.AppError
   829  	PostUpdateChannelPurposeMessage(userID string, channel *model.Channel, oldChannelPurpose string, newChannelPurpose string) *model.AppError
   830  	PostWithProxyAddedToImageURLs(post *model.Post) *model.Post
   831  	PostWithProxyRemovedFromImageURLs(post *model.Post) *model.Post
   832  	PreparePostForClient(originalPost *model.Post, isNewPost bool, isEditPost bool) *model.Post
   833  	PreparePostListForClient(originalList *model.PostList) *model.PostList
   834  	ProcessSlackText(text string) string
   835  	Publish(message *model.WebSocketEvent)
   836  	PublishSkipClusterSend(message *model.WebSocketEvent)
   837  	PublishUserTyping(userID, channelId, parentId string) *model.AppError
   838  	PurgeBleveIndexes() *model.AppError
   839  	PurgeElasticsearchIndexes() *model.AppError
   840  	ReadFile(path string) ([]byte, *model.AppError)
   841  	RecycleDatabaseConnection()
   842  	RegenCommandToken(cmd *model.Command) (*model.Command, *model.AppError)
   843  	RegenOutgoingWebhookToken(hook *model.OutgoingWebhook) (*model.OutgoingWebhook, *model.AppError)
   844  	RegenerateOAuthAppSecret(app *model.OAuthApp) (*model.OAuthApp, *model.AppError)
   845  	RegenerateTeamInviteId(teamID string) (*model.Team, *model.AppError)
   846  	RegisterPluginCommand(pluginId string, command *model.Command) error
   847  	ReloadConfig() error
   848  	RemoveAllDeactivatedMembersFromChannel(channel *model.Channel) *model.AppError
   849  	RemoveConfigListener(id string)
   850  	RemoveCustomStatus(userID string) *model.AppError
   851  	RemoveDirectory(path string) *model.AppError
   852  	RemoveFile(path string) *model.AppError
   853  	RemoveLdapPrivateCertificate() *model.AppError
   854  	RemoveLdapPublicCertificate() *model.AppError
   855  	RemovePlugin(id string) *model.AppError
   856  	RemovePluginFromData(data model.PluginEventData)
   857  	RemoveRecentCustomStatus(userID string, status *model.CustomStatus) *model.AppError
   858  	RemoveSamlIdpCertificate() *model.AppError
   859  	RemoveSamlPrivateCertificate() *model.AppError
   860  	RemoveSamlPublicCertificate() *model.AppError
   861  	RemoveTeamIcon(teamID string) *model.AppError
   862  	RemoveTeamMemberFromTeam(teamMember *model.TeamMember, requestorId string) *model.AppError
   863  	RemoveUserFromChannel(userIDToRemove string, removerUserId string, channel *model.Channel) *model.AppError
   864  	RemoveUserFromTeam(teamID string, userID string, requestorId string) *model.AppError
   865  	RemoveUsersFromChannelNotMemberOfTeam(remover *model.User, channel *model.Channel, team *model.Team) *model.AppError
   866  	RequestId() string
   867  	RequestLicenseAndAckWarnMetric(warnMetricId string, isBot bool) *model.AppError
   868  	ResetPasswordFromToken(userSuppliedTokenString, newPassword string) *model.AppError
   869  	ResetPermissionsSystem() *model.AppError
   870  	RestoreChannel(channel *model.Channel, userID string) (*model.Channel, *model.AppError)
   871  	RestoreTeam(teamID string) *model.AppError
   872  	RestrictUsersGetByPermissions(userID string, options *model.UserGetOptions) (*model.UserGetOptions, *model.AppError)
   873  	RestrictUsersSearchByPermissions(userID string, options *model.UserSearchOptions) (*model.UserSearchOptions, *model.AppError)
   874  	RevokeAccessToken(token string) *model.AppError
   875  	RevokeAllSessions(userID string) *model.AppError
   876  	RevokeSession(session *model.Session) *model.AppError
   877  	RevokeSessionById(sessionId string) *model.AppError
   878  	RevokeSessionsForDeviceId(userID string, deviceId string, currentSessionId string) *model.AppError
   879  	RevokeUserAccessToken(token *model.UserAccessToken) *model.AppError
   880  	RolesGrantPermission(roleNames []string, permissionId string) bool
   881  	Saml() einterfaces.SamlInterface
   882  	SanitizeProfile(user *model.User, asAdmin bool)
   883  	SanitizeTeam(session model.Session, team *model.Team) *model.Team
   884  	SanitizeTeams(session model.Session, teams []*model.Team) []*model.Team
   885  	SaveAndBroadcastStatus(status *model.Status)
   886  	SaveBrandImage(imageData *multipart.FileHeader) *model.AppError
   887  	SaveComplianceReport(job *model.Compliance) (*model.Compliance, *model.AppError)
   888  	SaveReactionForPost(reaction *model.Reaction) (*model.Reaction, *model.AppError)
   889  	SaveUserTermsOfService(userID, termsOfServiceId string, accepted bool) *model.AppError
   890  	SchemesIterator(scope string, batchSize int) func() []*model.Scheme
   891  	SearchArchivedChannels(teamID string, term string, userID string) (*model.ChannelList, *model.AppError)
   892  	SearchChannels(teamID string, term string) (*model.ChannelList, *model.AppError)
   893  	SearchChannelsForUser(userID, teamID, term string) (*model.ChannelList, *model.AppError)
   894  	SearchChannelsUserNotIn(teamID string, userID string, term string) (*model.ChannelList, *model.AppError)
   895  	SearchEmoji(name string, prefixOnly bool, limit int) ([]*model.Emoji, *model.AppError)
   896  	SearchEngine() *searchengine.Broker
   897  	SearchGroupChannels(userID, term string) (*model.ChannelList, *model.AppError)
   898  	SearchPostsInTeam(teamID string, paramsList []*model.SearchParams) (*model.PostList, *model.AppError)
   899  	SearchPostsInTeamForUser(terms string, userID string, teamID string, isOrSearch bool, includeDeletedChannels bool, timeZoneOffset int, page, perPage int) (*model.PostSearchResults, *model.AppError)
   900  	SearchPrivateTeams(term string) ([]*model.Team, *model.AppError)
   901  	SearchPublicTeams(term string) ([]*model.Team, *model.AppError)
   902  	SearchUserAccessTokens(term string) ([]*model.UserAccessToken, *model.AppError)
   903  	SearchUsers(props *model.UserSearch, options *model.UserSearchOptions) ([]*model.User, *model.AppError)
   904  	SearchUsersInChannel(channelId string, term string, options *model.UserSearchOptions) ([]*model.User, *model.AppError)
   905  	SearchUsersInGroup(groupID string, term string, options *model.UserSearchOptions) ([]*model.User, *model.AppError)
   906  	SearchUsersInTeam(teamID, term string, options *model.UserSearchOptions) ([]*model.User, *model.AppError)
   907  	SearchUsersNotInChannel(teamID string, channelId string, term string, options *model.UserSearchOptions) ([]*model.User, *model.AppError)
   908  	SearchUsersNotInTeam(notInTeamId string, term string, options *model.UserSearchOptions) ([]*model.User, *model.AppError)
   909  	SearchUsersWithoutTeam(term string, options *model.UserSearchOptions) ([]*model.User, *model.AppError)
   910  	SendAckToPushProxy(ack *model.PushNotificationAck) error
   911  	SendAutoResponse(channel *model.Channel, receiver *model.User, post *model.Post) (bool, *model.AppError)
   912  	SendAutoResponseIfNecessary(channel *model.Channel, sender *model.User, post *model.Post) (bool, *model.AppError)
   913  	SendEmailVerification(user *model.User, newEmail, redirect string) *model.AppError
   914  	SendEphemeralPost(userID string, post *model.Post) *model.Post
   915  	SendNotifications(post *model.Post, team *model.Team, channel *model.Channel, sender *model.User, parentPostList *model.PostList, setOnline bool) ([]string, error)
   916  	SendPasswordReset(email string, siteURL string) (bool, *model.AppError)
   917  	SendPaymentFailedEmail(failedPayment *model.FailedPayment) *model.AppError
   918  	ServeInterPluginRequest(w http.ResponseWriter, r *http.Request, sourcePluginId, destinationPluginId string)
   919  	ServePluginRequest(w http.ResponseWriter, r *http.Request)
   920  	Session() *model.Session
   921  	SessionCacheLength() int
   922  	SessionHasPermissionTo(session model.Session, permission *model.Permission) bool
   923  	SessionHasPermissionToAny(session model.Session, permissions []*model.Permission) bool
   924  	SessionHasPermissionToCategory(session model.Session, userID, teamID, categoryId string) bool
   925  	SessionHasPermissionToChannel(session model.Session, channelId string, permission *model.Permission) bool
   926  	SessionHasPermissionToChannelByPost(session model.Session, postId string, permission *model.Permission) bool
   927  	SessionHasPermissionToTeam(session model.Session, teamID string, permission *model.Permission) bool
   928  	SessionHasPermissionToUser(session model.Session, userID string) bool
   929  	SessionHasPermissionToUserOrBot(session model.Session, userID string) bool
   930  	SetAcceptLanguage(s string)
   931  	SetActiveChannel(userID string, channelId string) *model.AppError
   932  	SetAutoResponderStatus(user *model.User, oldNotifyProps model.StringMap)
   933  	SetContext(c context.Context)
   934  	SetCustomStatus(userID string, cs *model.CustomStatus) *model.AppError
   935  	SetDefaultProfileImage(user *model.User) *model.AppError
   936  	SetIpAddress(s string)
   937  	SetPath(s string)
   938  	SetPhase2PermissionsMigrationStatus(isComplete bool) error
   939  	SetPluginKey(pluginId string, key string, value []byte) *model.AppError
   940  	SetPluginKeyWithExpiry(pluginId string, key string, value []byte, expireInSeconds int64) *model.AppError
   941  	SetPluginKeyWithOptions(pluginId string, key string, value []byte, options model.PluginKVSetOptions) (bool, *model.AppError)
   942  	SetPluginsEnvironment(pluginsEnvironment *plugin.Environment)
   943  	SetProfileImage(userID string, imageData *multipart.FileHeader) *model.AppError
   944  	SetProfileImageFromFile(userID string, file io.Reader) *model.AppError
   945  	SetProfileImageFromMultiPartFile(userID string, file multipart.File) *model.AppError
   946  	SetRequestId(s string)
   947  	SetSamlIdpCertificateFromMetadata(data []byte) *model.AppError
   948  	SetSearchEngine(se *searchengine.Broker)
   949  	SetServer(srv *Server)
   950  	SetSession(s *model.Session)
   951  	SetStatusAwayIfNeeded(userID string, manual bool)
   952  	SetStatusDoNotDisturb(userID string)
   953  	SetStatusOffline(userID string, manual bool)
   954  	SetStatusOnline(userID string, manual bool)
   955  	SetStatusOutOfOffice(userID string)
   956  	SetT(t goi18n.TranslateFunc)
   957  	SetTeamIcon(teamID string, imageData *multipart.FileHeader) *model.AppError
   958  	SetTeamIconFromFile(team *model.Team, file io.Reader) *model.AppError
   959  	SetTeamIconFromMultiPartFile(teamID string, file multipart.File) *model.AppError
   960  	SetUserAgent(s string)
   961  	SlackImport(fileData multipart.File, fileSize int64, teamID string) (*model.AppError, *bytes.Buffer)
   962  	SoftDeleteTeam(teamID string) *model.AppError
   963  	Srv() *Server
   964  	SubmitInteractiveDialog(request model.SubmitDialogRequest) (*model.SubmitDialogResponse, *model.AppError)
   965  	SwitchEmailToLdap(email, password, code, ldapLoginId, ldapPassword string) (string, *model.AppError)
   966  	SwitchEmailToOAuth(w http.ResponseWriter, r *http.Request, email, password, code, service string) (string, *model.AppError)
   967  	SwitchLdapToEmail(ldapPassword, code, email, newPassword string) (string, *model.AppError)
   968  	SwitchOAuthToEmail(email, password, requesterId string) (string, *model.AppError)
   969  	SyncLdap()
   970  	SyncPluginsActiveState()
   971  	T(translationID string, args ...interface{}) string
   972  	TeamMembersToAdd(since int64, teamID *string) ([]*model.UserTeamIDPair, *model.AppError)
   973  	TeamMembersToRemove(teamID *string) ([]*model.TeamMember, *model.AppError)
   974  	TelemetryId() string
   975  	TestElasticsearch(cfg *model.Config) *model.AppError
   976  	TestEmail(userID string, cfg *model.Config) *model.AppError
   977  	TestFilesStoreConnection() *model.AppError
   978  	TestFilesStoreConnectionWithConfig(cfg *model.FileSettings) *model.AppError
   979  	TestLdap() *model.AppError
   980  	TestSiteURL(siteURL string) *model.AppError
   981  	Timezones() *timezones.Timezones
   982  	ToggleMuteChannel(channelId, userID string) (*model.ChannelMember, *model.AppError)
   983  	TotalWebsocketConnections() int
   984  	TriggerWebhook(payload *model.OutgoingWebhookPayload, hook *model.OutgoingWebhook, post *model.Post, channel *model.Channel)
   985  	UnregisterPluginCommand(pluginId, teamID, trigger string)
   986  	UnregisterPluginCommands(pluginId string)
   987  	UpdateActive(user *model.User, active bool) (*model.User, *model.AppError)
   988  	UpdateChannelLastViewedAt(channelIds []string, userID string) *model.AppError
   989  	UpdateChannelMemberNotifyProps(data map[string]string, channelId string, userID string) (*model.ChannelMember, *model.AppError)
   990  	UpdateChannelMemberRoles(channelId string, userID string, newRoles string) (*model.ChannelMember, *model.AppError)
   991  	UpdateChannelMemberSchemeRoles(channelId string, userID string, isSchemeGuest bool, isSchemeUser bool, isSchemeAdmin bool) (*model.ChannelMember, *model.AppError)
   992  	UpdateChannelPrivacy(oldChannel *model.Channel, user *model.User) (*model.Channel, *model.AppError)
   993  	UpdateCommand(oldCmd, updatedCmd *model.Command) (*model.Command, *model.AppError)
   994  	UpdateConfig(f func(*model.Config))
   995  	UpdateEphemeralPost(userID string, post *model.Post) *model.Post
   996  	UpdateGroup(group *model.Group) (*model.Group, *model.AppError)
   997  	UpdateGroupSyncable(groupSyncable *model.GroupSyncable) (*model.GroupSyncable, *model.AppError)
   998  	UpdateHashedPassword(user *model.User, newHashedPassword string) *model.AppError
   999  	UpdateHashedPasswordByUserId(userID, newHashedPassword string) *model.AppError
  1000  	UpdateIncomingWebhook(oldHook, updatedHook *model.IncomingWebhook) (*model.IncomingWebhook, *model.AppError)
  1001  	UpdateLastActivityAtIfNeeded(session model.Session)
  1002  	UpdateMfa(activate bool, userID, token string) *model.AppError
  1003  	UpdateMobileAppBadge(userID string)
  1004  	UpdateOAuthUserAttrs(userData io.Reader, user *model.User, provider einterfaces.OauthProvider, service string, tokenUser *model.User) *model.AppError
  1005  	UpdateOauthApp(oldApp, updatedApp *model.OAuthApp) (*model.OAuthApp, *model.AppError)
  1006  	UpdateOutgoingWebhook(oldHook, updatedHook *model.OutgoingWebhook) (*model.OutgoingWebhook, *model.AppError)
  1007  	UpdatePassword(user *model.User, newPassword string) *model.AppError
  1008  	UpdatePasswordAsUser(userID, currentPassword, newPassword string) *model.AppError
  1009  	UpdatePasswordByUserIdSendEmail(userID, newPassword, method string) *model.AppError
  1010  	UpdatePasswordSendEmail(user *model.User, newPassword, method string) *model.AppError
  1011  	UpdatePost(post *model.Post, safeUpdate bool) (*model.Post, *model.AppError)
  1012  	UpdatePreferences(userID string, preferences model.Preferences) *model.AppError
  1013  	UpdateRole(role *model.Role) (*model.Role, *model.AppError)
  1014  	UpdateScheme(scheme *model.Scheme) (*model.Scheme, *model.AppError)
  1015  	UpdateSessionsIsGuest(userID string, isGuest bool)
  1016  	UpdateSidebarCategories(userID, teamID string, categories []*model.SidebarCategoryWithChannels) ([]*model.SidebarCategoryWithChannels, *model.AppError)
  1017  	UpdateSidebarCategoryOrder(userID, teamID string, categoryOrder []string) *model.AppError
  1018  	UpdateTeam(team *model.Team) (*model.Team, *model.AppError)
  1019  	UpdateTeamMemberRoles(teamID string, userID string, newRoles string) (*model.TeamMember, *model.AppError)
  1020  	UpdateTeamMemberSchemeRoles(teamID string, userID string, isSchemeGuest bool, isSchemeUser bool, isSchemeAdmin bool) (*model.TeamMember, *model.AppError)
  1021  	UpdateTeamPrivacy(teamID string, teamType string, allowOpenInvite bool) *model.AppError
  1022  	UpdateTeamScheme(team *model.Team) (*model.Team, *model.AppError)
  1023  	UpdateThreadFollowForUser(userID, threadId string, state bool) *model.AppError
  1024  	UpdateThreadReadForUser(userID, teamID, threadId string, timestamp int64) *model.AppError
  1025  	UpdateThreadsReadForUser(userID, teamID string) *model.AppError
  1026  	UpdateUser(user *model.User, sendNotifications bool) (*model.User, *model.AppError)
  1027  	UpdateUserActive(userID string, active bool) *model.AppError
  1028  	UpdateUserAsUser(user *model.User, asAdmin bool) (*model.User, *model.AppError)
  1029  	UpdateUserAuth(userID string, userAuth *model.UserAuth) (*model.UserAuth, *model.AppError)
  1030  	UpdateUserNotifyProps(userID string, props map[string]string, sendNotifications bool) (*model.User, *model.AppError)
  1031  	UpdateUserRoles(userID string, newRoles string, sendWebSocketEvent bool) (*model.User, *model.AppError)
  1032  	UpdateUserRolesWithUser(user *model.User, newRoles string, sendWebSocketEvent bool) (*model.User, *model.AppError)
  1033  	UploadData(us *model.UploadSession, rd io.Reader) (*model.FileInfo, *model.AppError)
  1034  	UploadEmojiImage(id string, imageData *multipart.FileHeader) *model.AppError
  1035  	UploadMultipartFiles(teamID string, channelId string, userID string, fileHeaders []*multipart.FileHeader, clientIds []string, now time.Time) (*model.FileUploadResponse, *model.AppError)
  1036  	UpsertGroupMember(groupID string, userID string) (*model.GroupMember, *model.AppError)
  1037  	UpsertGroupSyncable(groupSyncable *model.GroupSyncable) (*model.GroupSyncable, *model.AppError)
  1038  	UserAgent() string
  1039  	UserCanSeeOtherUser(userID string, otherUserId string) (bool, *model.AppError)
  1040  	VerifyEmailFromToken(userSuppliedTokenString string) *model.AppError
  1041  	VerifyUserEmail(userID, email string) *model.AppError
  1042  	ViewChannel(view *model.ChannelView, userID string, currentSessionId string) (map[string]int64, *model.AppError)
  1043  	WaitForChannelMembership(channelId string, userID string)
  1044  	WriteFile(fr io.Reader, path string) (int64, *model.AppError)
  1045  }