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