- java.lang.Object
-
- net.bis5.mattermost.client4.MattermostClient
-
- All Implemented Interfaces:
AutoCloseable,AuditsApi,AuthenticationApi,BotsApi,BrandApi,ChannelApi,ClusterApi,CommandsApi,ComplianceApi,ElasticsearchApi,EmojiApi,FilesApi,LdapApi,LogsApi,OAuthApi,OpenGraphApi,PluginApi,PostApi,PreferencesApi,ReactionApi,SamlApi,StatusApi,SystemApi,TeamApi,UserApi,WebhookApi
public class MattermostClient extends Object implements AutoCloseable, AuditsApi, AuthenticationApi, BotsApi, BrandApi, ChannelApi, ClusterApi, CommandsApi, ComplianceApi, ElasticsearchApi, EmojiApi, FilesApi, SystemApi, LdapApi, LogsApi, OAuthApi, OpenGraphApi, PluginApi, PostApi, PreferencesApi, ReactionApi, SamlApi, StatusApi, TeamApi, UserApi, WebhookApi
Mattermost API Version4 Client default implementation.- Since:
- 2017/06/10
- Author:
- Maruyama Takayuki
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMattermostClient.MattermostClientBuilder
-
Field Summary
Fields Modifier and Type Field Description protected static StringAPI_URL_SUFFIXprotected static StringHEADER_AUTHprotected static StringHEADER_ETAG_CLIENT
-
Constructor Summary
Constructors Constructor Description MattermostClient(String url)MattermostClient(String url, Level logLevel)Create new MattermosClient instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description ApiResponse<ChannelMember>addChannelMember(String channelId, String userId)adds user to channel and return a channel memner.ApiResponse<TeamMember>addTeamMember(String hash, String dataToHash, String inviteId)Deprecated.ApiResponse<TeamMember>addTeamMember(String teamId, String userId, String hash, String dataToHash, String inviteId)Deprecated.ApiResponse<TeamMember>addTeamMember(TeamMember teamMemberToAdd)add user to a team and return a team member.ApiResponse<TeamMember>addTeamMemberFromInvite(String token, String inviteId)add user to team from invite.ApiResponse<TeamMemberList>addTeamMembers(String teamId, String... userIds)adds a number of users to a team and returns the team members.ApiResponse<Bot>assignBotToUser(String botUserId, String ownerUserId)Assign a bot to a user.ApiResponse<Boolean>attachDeviceId(String deviceId)attaches a mobile device ID to the current session.StringauthorizeOAuthApp(AuthorizeRequest authRequest)will authorize an OAuth 2.0 client application to access a user's account and provide a redirect link to follow.ApiResponse<ChannelList>autocompleteChannels(String teamId, String searchTerm)autocomplete channels in team based on search term.ApiResponse<ChannelList>autocompleteChannelsForSearch(String teamId, String searchTerm)autocomplete your (joined) channels in team based on search term.ApiResponse<EmojiList>autocompleteEmoji(String name)get a list of custom emoji that name starts with or matching provided name.ApiResponse<UserAutocomplete>autocompleteUsers(String username, String etag)returns the users in the system based on search term.ApiResponse<UserAutocomplete>autocompleteUsersInChannel(String teamId, String channelId, String username, String etag)returns the users in a channel based on search term.ApiResponse<UserAutocomplete>autocompleteUsersInTeam(String teamId, String username, String etag)returns the users on a team based on search term.protected jakarta.ws.rs.client.ClientbuildClient(Consumer<jakarta.ws.rs.client.ClientBuilder> httpClientConfig)static MattermostClient.MattermostClientBuilderbuilder()booleancheckUserMfa(String loginId)checks whether a user has MFA active on their account or not based on the provided login id.voidclearOAuthToken()voidclose()ApiResponse<Channel>convertChannelToPrivate(String channelId)convert channel from public to private.ApiResponse<Bot>createBot(BotPatch bot)Create a bot.ApiResponse<Channel>createChannel(Channel channel)creates a channel based on the provided channel object.ApiResponse<Command>createCommand(Command cmd)will create a new command if the user have the right permissions.ApiResponse<Compliance>createComplianceReport(Compliance report)creates a compliance report.ApiResponse<Channel>createDirectChannel(String userId1, String userId2)creates a direct message channel based on the two user ids provided.ApiResponse<Emoji>createEmoji(Emoji emoji, Path imageFile)will save an emoji to the server if the current user has permission to do so.ApiResponse<Post>createEphemeralPost(String sendToUserId, Post post)creates an ephemeral post send totargetUserId.ApiResponse<Channel>createGroupChannel(String... userIds)creates a group message channel based on userIds provided.ApiResponse<IncomingWebhook>createIncomingWebhook(IncomingWebhook hook)creates an incoming webhook for a channel.ApiResponse<OAuthApp>createOAuthApp(OAuthApp app)will register a new OAuth 2.0 client application with Mattermost acting as an OAuth 2.0 service provider.ApiResponse<OutgoingWebhook>createOutgoingWebhook(OutgoingWebhook hook)creates an outgoing webhook for a team or channel.ApiResponse<Post>createPost(Post post)creates a post based on the provided post object.ApiResponse<Team>createTeam(Team team)creates a team in the system based on the provided team object.ApiResponse<User>createUser(User user)creates a user in the system based on the provided user object.ApiResponse<UserAccessToken>createUserAccessToken(String userId, String description)ApiResponse<Boolean>databaseRecycle()will recycle the connections.ApiResponse<Boolean>deauthorizeOAuthApp(String appId)will deauthorize an OAuth 2.0 client application from accessing a user's account.ApiResponse<Boolean>deleteBrandImage()delete the brand image for the system.ApiResponse<Boolean>deleteChannel(String channelId)deletes channel based on the provided channel id string.ApiResponse<Boolean>deleteCommand(String commandId)deletes a command based on the provided command id string.ApiResponse<Boolean>deleteEmoji(String emojiId)delete an custom emoji on the provided emoji id string.ApiResponse<Boolean>deleteIncomingWebhook(String hookId)deletes an Incoming Webhook given the hook id.ApiResponse<Boolean>deleteOAuthApp(String appId)deletes a registered OAuth 2.0 client application.ApiResponse<Boolean>deleteOutgoingWebhook(String hookId)delete the outgoing webhook on the system requested by hook id.ApiResponse<Boolean>deletePost(String postId)deletes a post from the provided post id string.ApiResponse<Boolean>deletePreferences(String userId, Preferences preferences)deletes the user's preferences.ApiResponse<Boolean>deleteProfileImage(String userId)delete user profile image.ApiResponse<Boolean>deleteReaction(Reaction reaction)deletes reaction of a user in a post.ApiResponse<Boolean>deleteSamlIdpCertificate()deletes the SAML IDP certificate from the server and updates the config to not use it and disable SAML.ApiResponse<Boolean>deleteSamlPrivateCertificate()deletes the SAML IDP certificate from the server and updates the config to not use it and disable SAML.ApiResponse<Boolean>deleteSamlPublicCertificate()deletes the saml IDP certificate from the server and updates the config to not use it and disable SAML.ApiResponse<Boolean>deleteTeam(String teamId)deletes the team softly (archive only, not permanent delete).ApiResponse<Boolean>deleteTeam(String teamId, boolean permanent)deletes the team.ApiResponse<Boolean>deleteUser(String userId)deactivates a user in the system based on the provided user id string.ApiResponse<Bot>disableBot(String botUserId)Disable a bot.ApiResponse<Boolean>disablePlugin(String pluginId)ApiResponse<Boolean>disableUserAccessToken(String tokenId)protected ApiResponse<Void>doApiDelete(String url)protected <T> ApiResponse<T>doApiDelete(String url, Class<T> responseType)protected ApiResponse<Void>doApiGet(String url, String etag)protected <T> ApiResponse<T>doApiGet(String url, String etag, jakarta.ws.rs.core.GenericType<T> responseType)protected <T> ApiResponse<T>doApiGet(String url, String etag, Class<T> responseType)protected ApiResponse<Path>doApiGetFile(String url, String etag)protected <U> ApiResponse<Void>doApiPost(String url, U data)protected <T,U>
ApiResponse<T>doApiPost(String url, U data, jakarta.ws.rs.core.GenericType<T> responseType)protected <T,U>
ApiResponse<T>doApiPost(String url, U data, Class<T> responseType)protected ApiResponse<Void>doApiPostMultiPart(String url, org.glassfish.jersey.media.multipart.MultiPart multiPart)protected <T> ApiResponse<T>doApiPostMultiPart(String url, org.glassfish.jersey.media.multipart.MultiPart multiPart, Class<T> responseType)protected <U> ApiResponse<Void>doApiPut(String url, U data)protected <T,U>
ApiResponse<T>doApiPut(String url, U data, Class<T> responseType)protected <U> ApiResponse<Void>doApiRequest(String method, String url, U data, String etag)protected <T,U>
ApiResponse<T>doApiRequest(String method, String url, U data, String etag, jakarta.ws.rs.core.GenericType<T> responseType)protected <T,U>
ApiResponse<T>doApiRequest(String method, String url, U data, String etag, Class<T> responseType)ApiResponse<Object>downloadComplianceReport(String reportId)returns a full compliance report as a file.ApiResponse<Bot>enableBot(String botUserId)Enable a bot.ApiResponse<Boolean>enablePlugin(String pluginId)ApiResponse<Boolean>enableUserAccessToken(String tokenId)ApiResponse<CommandResponse>executeCommand(String channelId, String command)executes a given command.ApiResponse<MfaSecret>generateMfaSecret(String userId)will generate a new MFA secret for a user and return it as a string and as a base64 encoded image QR code.ApiResponse<TeamList>getAllTeams(Pager pager, String etag)returns all teams based on permssions.ApiResponse<AnalyticsRows>getAnalytics(AnalyticsCategory category, String teamId)ApiResponse<Audits>getAudits(Pager pager, String etag)returns a list of audits for the whole system.ApiResponse<List<OAuthApp>>getAuthorizedOAuthAppsForUser(String userId, Pager pager)gets a page of OAuth 2.0 client applications the user authorized to use access their account.ApiResponse<Bot>getBot(String botUserId, boolean includeDeleted)Get a bot.ApiResponse<Bots>getBots(Pager pager, GetBotsOption option)Get bots.StringgetBotsRoute()StringgetBotsRoute(String botUserId)ApiResponse<Path>getBrandImage()retrieves the previously uploaded brand image.StringgetBrandImageRoute()StringgetCacheRoute()ApiResponse<Channel>getChannel(String channelId, String etag)returns a channel based on the provided channel id string.ApiResponse<Channel>getChannelByName(String channelName, String teamId, String etag)returns a channel based on the provided channel name and team id strings.ApiResponse<Channel>getChannelByNameForTeamName(String channelName, String teamName, String etag)returns a channel based on the provided channel name and team name strings.StringgetChannelByNameForTeamNameRoute(String channelName, String teamName)StringgetChannelByNameRoute(String channelName, String teamId)ApiResponse<ChannelMember>getChannelMember(String channelId, String userId, String etag)gets a channel memner.StringgetChannelMemberRoute(String channelId, String userId)ApiResponse<ChannelMembers>getChannelMembers(String channelId, Pager pager, String etag)gets a page of channel members.ApiResponse<ChannelMembers>getChannelMembersByIds(String channelId, String... userIds)gets the channel members in a channel for a list of user ids.ApiResponse<ChannelMembers>getChannelMembersForUser(String userId, String teamId, String etag)gets all the channel members for a user on a team.StringgetChannelMembersRoute(String channelId)StringgetChannelRoute(String channelId)ApiResponse<ChannelList>getChannelsForTeamForUser(String teamId, String userId, String etag)returns a list channels of on a team for user.StringgetChannelsForTeamRoute(String teamId)StringgetChannelsRoute()ApiResponse<ChannelStats>getChannelStats(String channelId, String etag)returns statistics for a channel.ApiResponse<ChannelUnread>getChannelUnread(String channelId, String userId)will return a ChannelUnread object that contains the number ofo unread messages and mentions for a user.StringgetClusterRoute()ApiResponse<ClusterInfo[]>getClusterStatus()StringgetCommandRoute(String commandId)StringgetCommandsRoute()ApiResponse<Compliance>getComplianceReport(String reportId)returns a compliance report.StringgetComplianceReportRoute(String reportId)ApiResponse<Compliances>getComplianceReports(Pager pager)returns list of compliance reports.StringgetComplianceReportsRoute()ApiResponse<Config>getConfig()will retrieve the server config with some sanitized items.StringgetConfigRoute()StringgetDatabaseRoute()ApiResponse<ChannelList>getDeletedChannels(String teamId, Pager pager)StringgetElasticsearchRoute()ApiResponse<Emoji>getEmoji(String emojiId)returns a custom emoji in the system on the provided emoji id string.ApiResponse<Emoji>getEmojiByName(String emojiName)get a custom emoji by name.StringgetEmojiByNameRoute(String emojiName)ApiResponse<Path>getEmojiImage(String emojiId)returns the emoji image.ApiResponse<EmojiList>getEmojiList(Pager pager)returns a list of custom emoji in the system.ApiResponse<EmojiList>getEmojiListSorted(Pager pager)returns a list of custom emoji in the system sorted by name.StringgetEmojiRoute(String emojiId)StringgetEmojisRoute()ApiResponse<Path>getFile(String fileId)Get a file content.ApiResponse<FileInfo[]>getFileInfoForPost(String postId)get a list of file info attached the post.ApiResponse<FileInfo>getFileMetadata(String fileId)Get a file metadata.ApiResponse<Path>getFilePreview(String fileId)Get a file preview.StringgetFileRoute(String fileId)StringgetFilesRoute()ApiResponse<Path>getFileThumbnail(String fileId)Get a file thumbnail.ApiResponse<PostList>getFlaggedPostsForUser(String userId, Pager pager)returns flagges posts of a user based on user id string.ApiResponse<PostList>getFlaggedPostsForUserInChannel(String userId, String channelId, Pager pager)returns flagged posts in channel of a user based on user id string.ApiResponse<PostList>getFlaggedPostsForUserInTeam(String userId, String teamId, Pager pager)returns flagged posts in team of a user based on user id string.ApiResponse<IncomingWebhook>getIncomingWebhook(String hookId, String etag)returns an Incoming webhook given the hook id.StringgetIncomingWebhookRoute(String hookId)ApiResponse<IncomingWebhookList>getIncomingWebhooks(Pager pager, String etag)returns a page of incoming webhooks on the system.ApiResponse<IncomingWebhookList>getIncomingWebhooksForTeam(String teamId, Pager pager, String etag)returns a page of incoming webhooks for a team.StringgetIncomingWebhooksRoute()ApiResponse<TeamInviteInfo>getInviteInfo(String inviteId)get team info by invite id.StringgetLdapRoute()StringgetLicenseRoute()ApiResponse<List<String>>getLogs(Pager pager)page of logs as a string list.ApiResponse<User>getMe(String etag)returns the logged in user.ApiResponse<OAuthApp>getOAuthApp(String appId)gets a registered OAuth 2.0 client application with Mattermost acting as an OAuth 2.0 service provider.ApiResponse<OAuthApp>getOAuthAppInfo(String appId)gets a sanitized version of a registered OAuth 2.0 client application with Mattermost acting as an OAuth 2.0 service provider.StringgetOAuthAppRoute(String appId)ApiResponse<List<OAuthApp>>getOAuthApps(Pager pager)gets a page of registered OAuth 2.0 client applications with Mattermost acting as an OAuth 2.0 service provider.StringgetOAuthAppsRoute()ApiResponse<Map<String,String>>getOldClientConfig(String etag)will retrieve the parts of the server configuration needed by the client, formatted in the old format.ApiResponse<Map<String,String>>getOldClientLicense(String etag)will retrieve the parts of the server license needed by the client, formatted in the old format.ApiResponse<net.bis5.opengraph.models.OpenGraph>getOpenGraphMetadata(String url)Retrieve the OpenGraph metadata for provided url.StringgetOpenGraphRoute()ApiResponse<OutgoingWebhook>getOutgoingWebhook(String hookId)outgoing webhooks on the system requested by hook id.StringgetOutgoingWebhookRoute(String hookId)ApiResponse<OutgoingWebhookList>getOutgoingWebhooks(Pager pager, String etag)returns a page of outgoing webhooks ont eh system.ApiResponse<OutgoingWebhookList>getOutgoingWebhooksForChannel(String channelId, Pager pager, String etag)returns a page of outgoing webhooks for a channel.ApiResponse<OutgoingWebhookList>getOutgoingWebhooksForTeam(String teamId, Pager pager, String etag)returns a page of outgoing webhooks for a team.StringgetOutgoingWebhooksRoute()ApiResponse<Boolean>getPing()will ping the server and to see if it is up and running.ApiResponse<PostList>getPinnedPosts(String channelId, String etag)gets a list of pinned posts.StringgetPluginRoute(String pluginId)ApiResponse<Plugins>getPlugins()StringgetPluginsRoute()ApiResponse<Post>getPost(String postId, String etag)gets a single post.StringgetPostRoute(String postId)ApiResponse<PostList>getPostsAfter(String channelId, String postId, Pager pager, String etag)gets a page of posts that were posted after the post provided.ApiResponse<PostList>getPostsBefore(String channelId, String postId, Pager pager, String etag)gets a page of posts that were posted before the post provided.ApiResponse<PostList>getPostsForChannel(String channelId, Pager pager, String etag)gets a page of posts with an array for ordering for a channel.StringgetPostsRoute()ApiResponse<PostList>getPostsSince(String channelId, long time)gets posts created after a specified time as Unix time in milliseconds.ApiResponse<PostList>getPostThread(String postId, String etag)gets a post with all the other posts in the same thread.ApiResponse<Preference>getPreferenceByCategoryAndName(String userId, PreferenceCategory category, String preferenceName)returns the user's preferences from the provided category and preference name string.ApiResponse<Preferences>getPreferences(String userId)returns the user's preferences.ApiResponse<Preferences>getPreferencesByCategory(String userId, PreferenceCategory category)returns the user's preferences from the provided category string.StringgetPreferencesRoute(String userId)ApiResponse<byte[]>getProfileImage(String userId, String etag)gets user's profile image.ApiResponse<ChannelList>getPublicChannelsByIdsForTeam(String teamId, String... channelIds)returns a list of public channeld based on provided team id string.ApiResponse<ChannelList>getPublicChannelsForTeam(String teamId, Pager pager, String etag)returns a list of public channels based on the provided team id string.ApiResponse<String>getPublicFileLink(String fileId)Get a public link can be access without logging in to Mattermost.ApiResponse<ReactionList>getReactions(String postId)returns a list of reactions to a post.StringgetReactionsRoute()ApiResponse<SamlCertificateStatus>getSamlCertificateStatus()returns metadata for the SAML configuration.ApiResponse<Path>getSamlMetadata()returns metadata for the SAML configuration.StringgetSamlRoute()ApiResponse<SessionList>getSessions(String userId, String etag)returns a list of sessions based on the provided user id string.StringgetSystemRoute()ApiResponse<Team>getTeam(String teamId, String etag)returns a team based on the provided team id string.StringgetTeamAutoCompleteCommandsRoute(String teamId)ApiResponse<Team>getTeamByName(String name, String etag)returns a team based on the provided team name string.StringgetTeamByNameRoute(String teamName)ApiResponse<Path>getTeamIcon(String teamId)Get the team icon image.StringgetTeamIconRoute(String teamId)StringgetTeamImportRoute(String teamId)StringgetTeamInviteRoute(String inviteId)ApiResponse<TeamMember>getTeamMember(String teamId, String userId, String etag)returns a team member based on the provided team and user id strings.StringgetTeamMemberRoute(String teamId, String userId)ApiResponse<TeamMemberList>getTeamMembers(String teamId, Pager pager, String etag)returns team members based on the provided team id string.ApiResponse<TeamMemberList>getTeamMembersByIds(String teamId, String... userIds)will return an array of team members based on the team id and a list of user ids provided.ApiResponse<TeamMemberList>getTeamMembersForUser(String userId, String etag)returns the team member for a user.StringgetTeamMembersRoute(String teamId)StringgetTeamRoute(String teamId)ApiResponse<TeamList>getTeamsForUser(String userId, String etag)returns a list of teams a user is on.StringgetTeamsRoute()ApiResponse<TeamStats>getTeamStats(String teamId, String etag)returns a team stats based on the team id string.StringgetTeamStatsRoute(String teamId)ApiResponse<TeamUnread>getTeamUnread(String teamId, String userId)will return a TeamUnread object that contains the amount of unread messages and mentions the user has for the specified team.ApiResponse<TeamUnreadList>getTeamUnreadForUser(String userId, String teamIdToExclude)will return a list with TeamUnread objects that contain the amount of unread messages and mentions the current user has for the teams it belongs to.StringgetTestEmailRoute()ApiResponse<User>getUser(String userId, String etag)returns a user based on the provided user id string.ApiResponse<UserAccessToken>getUserAccessToken(String tokenId)ApiResponse<UserAccessTokenList>getUserAccessTokens(String userId, Pager pager)ApiResponse<UserAccessTokenList>getUserAccessTokensAllUsers(Pager pager)ApiResponse<Audits>getUserAudits(String userId, Pager pager, String etag)returns a list of audit based on the provided user id string.ApiResponse<User>getUserByEmail(String email, String etag)returns a user based on the provided user email string.StringgetUserByEmailRoute(String email)ApiResponse<User>getUserByUsername(String userName, String etag)returns a user based pn the provided user name string.StringgetUserByUsernameRoute(String userName)StringgetUserProfileImageRoute(String userId)StringgetUserRoute(String userId)ApiResponse<UserList>getUsers(Pager pager, String etag)returns a page of users on the system.ApiResponse<UserList>getUsersByIds(String... userIds)returns a list of users based on the provided user ids.ApiResponse<UserList>getUsersByUsernames(String... usernames)returns a list of users based on the provided usernames.StringgetUserSessionsRoute(String userId)ApiResponse<UserList>getUsersInChannel(String channelId, UsersOrder.InChannel order, Pager pager, String etag)returns a page of users on a team.ApiResponse<UserList>getUsersInTeam(String teamId, UsersOrder.InTeam order, Pager pager, String etag)returns a page of users on a team.ApiResponse<UserList>getUsersNotInChannel(String teamId, String channelId, Pager pager, String etag)returns a page of users on a team.ApiResponse<UserList>getUsersNotInTeam(String teamId, Pager pager, String etag)returns a page of users who are not in a team.StringgetUsersRoute()ApiResponse<StatusList>getUsersStatusesByIds(String... userIds)returns a list of users status based on the provided user ids.ApiResponse<Status>getUserStatus(String userId, String etag)returns a user status based on the provided user id string.StringgetUserStatusesRoute()StringgetUserStatusRoute(String userId)ApiResponse<UserList>getUsersWithoutTeam(Pager pager, String etag)returns a page of users on the system that aren't on any teams.StringgetUserTokenRoute(String tokenId)StringgetUserTokensRoute()StringgetUserTokensRoute(String userId)ApiResponse<PluginManifest[]>getWebappPlugins()ApiResponse<byte[]>importTeam(byte[] data, int filesize, String importFrom, String fileName, String teamId)will import an exported team from other app into a existing team.ApiResponse<Boolean>invalidateCaches()will purge the cache and can affect the performance while is cleaning.ApiResponse<Boolean>inviteUsersToTeam(String teamId, Collection<String> userEmails)invite users by email to the team.ApiResponse<CommandList>listAutocompleteCommands(String teamId)will retrieve a list of commands available in the team.ApiResponse<CommandList>listCommands(String teamId, boolean customOnly)will retrieve a list of commands available in the team.ApiResponse<User>login(String loginId, String password)authenticates a user by login id, which can be username, email, or some sort of SSO identifier based on server configuration, and a password.protected ApiResponse<User>login(LoginRequest param)ApiResponse<User>loginById(String id, String password)authenticates a user by user id and password.ApiResponse<User>loginByLdap(String loginId, String password)authenticates a user by LDAP id and password.ApiResponse<User>loginWithDevice(String loginId, String password, String deviceId)authenticates a user by login id (username, email or some sort of SSO identifier based on configuration), password and attaches a device id to the session.ApiResponse<Boolean>logout()terminates the current user's session.protected ApiResponse<User>onLogin(ApiResponse<Void> loginResponse)protected ApiResponse<Boolean>onLogout(ApiResponse<Void> logoutResponse)ApiResponse<Bot>patchBot(String botUserId, BotPatch patch)Patch a bot.ApiResponse<Channel>patchChannel(String channelId, ChannelPatch patch)partially updates a channel.ApiResponse<Post>patchPost(String postId, PostPatch patch)partially updates a post.ApiResponse<Team>patchTeam(String teamId, TeamPatch patch)partially updates a team.ApiResponse<User>patchUser(String userId, UserPatch patch)partially updates a user in the system.ApiResponse<Boolean>pinPost(String postId)pin a post based on proviced post id string.ApiResponse<Map<String,String>>postLog(Map<String,String> message)This method is a convenience Web Service call so clients can log messages into the server-side logs.ApiResponse<Boolean>purgeElasticsearchIndexes()deletes all Elasticsearch indexes.ApiResponse<String>regenCommandToken(String commandId)will create a new token if the user have the right permissions.ApiResponse<OAuthApp>regenerateOAuthAppSecret(String appId)regenerates the client secret for a registered OAuth 2.0 client application.ApiResponse<OutgoingWebhook>regenOutgoingHookToken(String hookId)regenerate the outgoing webhook token.ApiResponse<Boolean>reloadConfig()will reload the server configuration.ApiResponse<Boolean>removeLicense()ApiResponse<Boolean>removePlugin(String pluginId)ApiResponse<Boolean>removeTeamIcon(String teamId)Remove the team icon.ApiResponse<Boolean>removeTeamMember(String teamId, String userId)will remove a user from a team.ApiResponse<Boolean>removeUserFromChannel(String channelId, String userId)will delete the channel member object for a user, effectively removing the user from a channel.ApiResponse<Boolean>resetPassword(String token, String newPassword)uses a recovery code to update reset a user's password.ApiResponse<Channel>restoreChannel(String channelId)ApiResponse<Boolean>revokeAllActiveSessionForUser(String userId)ApiResponse<Boolean>revokeSession(String userId, String sessionId)revokes a user session based on the provided user id and session id strings.ApiResponse<Boolean>revokeUserAccessToken(String tokenId)ApiResponse<Reaction>saveReaction(Reaction reaction)saves an emoji reaction for a post.ApiResponse<ChannelList>searchChannels(String teamId, ChannelSearch search)returns the channels on a team matching the provided search term.ApiResponse<EmojiList>searchEmoji(SearchEmojiRequest searchRequest)search custom emoji based on request.ApiResponse<PostSearchResults>searchPosts(String teamId, String terms, boolean isOrSearch)returns any posts with matching term string.ApiResponse<TeamList>searchTeams(TeamSearch search)returns teams matching the provided search term.ApiResponse<UserAccessTokenList>searchTokens(String term)ApiResponse<UserList>searchUsers(UserSearch search)returns a list of users based on some search criteria.ApiResponse<Boolean>sendPasswordResetEmail(String email)will send a link for password resetting to a user with the provided email.ApiResponse<Boolean>sendVerificationEmail(String email)will send an email to the user with the provided email addresses, if that user exists.voidsetAccessToken(String token)Set Personal Access Token that use to access Mattermost API to this client.voidsetOAuthToken(String token)ApiResponse<Boolean>setProfileImage(String userId, Path imageFilePath)sets profile image of the user.ApiResponse<Boolean>setTeamIcon(String teamId, Path iconFilePath)Set the team icon.ApiResponse<SwitchAccountTypeResult>switchAccountType(SwitchRequest switchRequest)changes a user's login type from one type to another.ApiResponse<Boolean>syncLdap()will force a sync with the configured LDAP server.ApiResponse<TeamExists>teamExists(String name, String etag)returns true or false if the team exist or not.ApiResponse<Boolean>testElasticsearchConfiguration()test Elasticsearch configuration.ApiResponse<Boolean>testEmail()will attempt to connect to the configured SMTP server.ApiResponse<Boolean>testLdap()will attempt to connect to the configured LDAP server and return OK if configured correctly.ApiResponse<Boolean>unpinPost(String postId)unpin a post based on provided post id string.ApiResponse<Channel>updateChannel(Channel channel)update a channel based on the provided channel object.ApiResponse<Boolean>updateChannelNotifyProps(String channelId, String userId, Map<String,String> props)will update the notification properties on a channel for a user.ApiResponse<Boolean>updateChannelRoles(String channelId, String userId, Role... roles)will update the roles on a channel for a user.ApiResponse<Command>updateCommand(Command cmd)updates a command based on the provided Command object.ApiResponse<Config>updateConfig(Config config)will update the server configuration.ApiResponse<IncomingWebhook>updateIncomingWebhook(IncomingWebhook hook)updates an incoming webhook for a channel.ApiResponse<OutgoingWebhook>updateOutgoingWebhook(OutgoingWebhook hook)updates an outgoing webhook.ApiResponse<Post>updatePost(Post post)updates a post based on the provided post object.ApiResponse<Boolean>updatePreferences(String userId, Preferences preferences)saves the user's preferences.ApiResponse<Team>updateTeam(Team team)will update a team.ApiResponse<Boolean>updateTeamMemberRoles(String teamId, String userId, Role... newRoles)will update the roles on a team for a user.ApiResponse<User>updateUser(User user)updates a user in the system based on the provided user object.ApiResponse<Boolean>updateUserActive(String userId, boolean active)updates status of a user whether active or not.ApiResponse<Boolean>updateUserMfa(String userId, String code, boolean activate)activates multi-factor authentication for a user if activate is true and a valid code is provided.ApiResponse<Boolean>updateUserPassword(String userId, String currentPassword, String newPassword)updates a user's password.ApiResponse<Boolean>updateUserRoles(String userId, Role... roles)updates a user's roles in the system.ApiResponse<Status>updateUserStatus(String userId, Status userStatus)sets a user's status based on the provided user id string.ApiResponse<Boolean>uploadBrandImage(Path dataFile)sets the brand image for the system.ApiResponse<FileUploadResult>uploadFile(String channelId, Path... filePaths)Upload a file to specified channel.ApiResponse<Boolean>uploadLicenseFile(Path licenseFile)ApiResponse<PluginManifest>uploadPlugin(Path plugin, boolean force)ApiResponse<Boolean>uploadSamlIdpCertificate(Path dataFile, String fileName)will upload an IDP certificate for SAML and set the config to use it.ApiResponse<Boolean>uploadSamlPrivateCertificate(Path dataFile, String fileName)will upload a private key for SAML and set the config to use it.ApiResponse<Boolean>uploadSamlPublicCertificate(Path dataFile, String fileName)will upload a public certificate for SAML and set the config to use it.ApiResponse<Boolean>verifyUserEmail(String token)will verify a user's email using the supplied token.ApiResponse<ChannelViewResponse>viewChannel(String userId, ChannelView view)performs a view action for a user.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.bis5.mattermost.client4.api.ChannelApi
createGroupChannel, getChannel, getChannelByName, getChannelByNameForTeamName, getChannelMember, getChannelMembers, getChannelMembers, getChannelMembersByIds, getChannelMembersForUser, getChannelsForTeamForUser, getChannelStats, getDeletedChannels, getPinnedPosts, getPublicChannelsByIdsForTeam, getPublicChannelsForTeam, getPublicChannelsForTeam, updateChannelRoles
-
Methods inherited from interface net.bis5.mattermost.client4.api.CommandsApi
listCommands
-
Methods inherited from interface net.bis5.mattermost.client4.api.ComplianceApi
getComplianceReports
-
Methods inherited from interface net.bis5.mattermost.client4.api.EmojiApi
getEmojiList, getEmojiListSorted
-
Methods inherited from interface net.bis5.mattermost.client4.api.OAuthApi
getAuthorizedOAuthAppsForUser, getOAuthApps
-
Methods inherited from interface net.bis5.mattermost.client4.api.PluginApi
uploadPlugin
-
Methods inherited from interface net.bis5.mattermost.client4.api.PostApi
getFlaggedPostsForUser, getFlaggedPostsForUserInChannel, getFlaggedPostsForUserInTeam, getPost, getPostsAfter, getPostsAfter, getPostsBefore, getPostsBefore, getPostsForChannel, getPostsForChannel, getPostsSince, getPostsSince, getPostThread, searchPosts, updatePost
-
Methods inherited from interface net.bis5.mattermost.client4.api.StatusApi
getUsersStatusesByIds, getUserStatus
-
Methods inherited from interface net.bis5.mattermost.client4.api.SystemApi
getAnalytics, getAnalytics, getAnalytics, getOldClientConfig, getOldClientLicense
-
Methods inherited from interface net.bis5.mattermost.client4.api.TeamApi
addTeamMembers, getAllTeams, getAllTeams, getTeam, getTeamByName, getTeamMember, getTeamMembers, getTeamMembers, getTeamMembersByIds, getTeamMembersForUser, getTeamsForUser, getTeamStats, removeTeamMember, teamExists, updateTeamMemberRoles
-
Methods inherited from interface net.bis5.mattermost.client4.api.UserApi
autocompleteUsers, autocompleteUsersInChannel, autocompleteUsersInTeam, getMe, getProfileImage, getSessions, getTeamUnreadForUser, getUser, getUserAccessTokens, getUserAccessTokensAllUsers, getUserAudits, getUserAudits, getUserByEmail, getUserByUsername, getUsers, getUsers, getUsersByIds, getUsersByUsernames, getUsersInChannel, getUsersInChannel, getUsersInChannel, getUsersInChannel, getUsersInTeam, getUsersInTeam, getUsersInTeam, getUsersInTeam, getUsersNotInChannel, getUsersNotInChannel, getUsersNotInTeam, getUsersNotInTeam, getUsersWithoutTeam, getUsersWithoutTeam, revokeSession, updateUserRoles
-
Methods inherited from interface net.bis5.mattermost.client4.api.WebhookApi
getIncomingWebhook, getIncomingWebhooks, getIncomingWebhooks, getIncomingWebhooksForTeam, getIncomingWebhooksForTeam, getOutgoingWebhooks, getOutgoingWebhooks, getOutgoingWebhooksForChannel, getOutgoingWebhooksForChannel, getOutgoingWebhooksForTeam, getOutgoingWebhooksForTeam
-
-
-
-
Field Detail
-
API_URL_SUFFIX
protected static final String API_URL_SUFFIX
- See Also:
- Constant Field Values
-
HEADER_ETAG_CLIENT
protected static final String HEADER_ETAG_CLIENT
- See Also:
- Constant Field Values
-
HEADER_AUTH
protected static final String HEADER_AUTH
- See Also:
- Constant Field Values
-
-
Method Detail
-
builder
public static MattermostClient.MattermostClientBuilder builder()
-
buildClient
protected jakarta.ws.rs.client.Client buildClient(Consumer<jakarta.ws.rs.client.ClientBuilder> httpClientConfig)
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable
-
setOAuthToken
public void setOAuthToken(String token)
-
clearOAuthToken
public void clearOAuthToken()
-
setAccessToken
public void setAccessToken(String token)
Set Personal Access Token that use to access Mattermost API to this client.- Since:
- Mattermost Server 4.1
-
getUsersRoute
public String getUsersRoute()
-
getUserTokensRoute
public String getUserTokensRoute()
-
getTeamsRoute
public String getTeamsRoute()
-
getChannelsRoute
public String getChannelsRoute()
-
getChannelByNameForTeamNameRoute
public String getChannelByNameForTeamNameRoute(String channelName, String teamName)
-
getPostsRoute
public String getPostsRoute()
-
getConfigRoute
public String getConfigRoute()
-
getLicenseRoute
public String getLicenseRoute()
-
getFilesRoute
public String getFilesRoute()
-
getSystemRoute
public String getSystemRoute()
-
getTestEmailRoute
public String getTestEmailRoute()
-
getDatabaseRoute
public String getDatabaseRoute()
-
getCacheRoute
public String getCacheRoute()
-
getClusterRoute
public String getClusterRoute()
-
getIncomingWebhooksRoute
public String getIncomingWebhooksRoute()
-
getComplianceReportsRoute
public String getComplianceReportsRoute()
-
getOutgoingWebhooksRoute
public String getOutgoingWebhooksRoute()
-
getUserStatusesRoute
public String getUserStatusesRoute()
-
getSamlRoute
public String getSamlRoute()
-
getLdapRoute
public String getLdapRoute()
-
getBrandImageRoute
public String getBrandImageRoute()
-
getCommandsRoute
public String getCommandsRoute()
-
getEmojisRoute
public String getEmojisRoute()
-
getReactionsRoute
public String getReactionsRoute()
-
getOAuthAppsRoute
public String getOAuthAppsRoute()
-
getElasticsearchRoute
public String getElasticsearchRoute()
-
getPluginsRoute
public String getPluginsRoute()
-
getOpenGraphRoute
public String getOpenGraphRoute()
-
getBotsRoute
public String getBotsRoute()
-
doApiGet
protected <T> ApiResponse<T> doApiGet(String url, String etag, Class<T> responseType)
-
doApiGet
protected <T> ApiResponse<T> doApiGet(String url, String etag, jakarta.ws.rs.core.GenericType<T> responseType)
-
doApiGet
protected ApiResponse<Void> doApiGet(String url, String etag)
-
doApiPost
protected <T,U> ApiResponse<T> doApiPost(String url, U data, Class<T> responseType)
-
doApiPost
protected <T,U> ApiResponse<T> doApiPost(String url, U data, jakarta.ws.rs.core.GenericType<T> responseType)
-
doApiPost
protected <U> ApiResponse<Void> doApiPost(String url, U data)
-
doApiPostMultiPart
protected ApiResponse<Void> doApiPostMultiPart(String url, org.glassfish.jersey.media.multipart.MultiPart multiPart)
-
doApiPostMultiPart
protected <T> ApiResponse<T> doApiPostMultiPart(String url, org.glassfish.jersey.media.multipart.MultiPart multiPart, Class<T> responseType)
-
doApiPut
protected <T,U> ApiResponse<T> doApiPut(String url, U data, Class<T> responseType)
-
doApiPut
protected <U> ApiResponse<Void> doApiPut(String url, U data)
-
doApiDelete
protected <T> ApiResponse<T> doApiDelete(String url, Class<T> responseType)
-
doApiDelete
protected ApiResponse<Void> doApiDelete(String url)
-
doApiRequest
protected <T,U> ApiResponse<T> doApiRequest(String method, String url, U data, String etag, Class<T> responseType)
-
doApiRequest
protected <T,U> ApiResponse<T> doApiRequest(String method, String url, U data, String etag, jakarta.ws.rs.core.GenericType<T> responseType)
-
doApiRequest
protected <U> ApiResponse<Void> doApiRequest(String method, String url, U data, String etag)
-
doApiGetFile
protected ApiResponse<Path> doApiGetFile(String url, String etag) throws IOException
- Throws:
IOException
-
loginById
public ApiResponse<User> loginById(String id, String password)
Description copied from interface:AuthenticationApiauthenticates a user by user id and password.- Specified by:
loginByIdin interfaceAuthenticationApi
-
onLogin
protected ApiResponse<User> onLogin(ApiResponse<Void> loginResponse)
-
login
protected ApiResponse<User> login(LoginRequest param)
-
login
public ApiResponse<User> login(String loginId, String password)
Description copied from interface:AuthenticationApiauthenticates a user by login id, which can be username, email, or some sort of SSO identifier based on server configuration, and a password.- Specified by:
loginin interfaceAuthenticationApi
-
loginByLdap
public ApiResponse<User> loginByLdap(String loginId, String password)
Description copied from interface:AuthenticationApiauthenticates a user by LDAP id and password.- Specified by:
loginByLdapin interfaceAuthenticationApi
-
loginWithDevice
public ApiResponse<User> loginWithDevice(String loginId, String password, String deviceId)
Description copied from interface:AuthenticationApiauthenticates a user by login id (username, email or some sort of SSO identifier based on configuration), password and attaches a device id to the session.- Specified by:
loginWithDevicein interfaceAuthenticationApi
-
logout
public ApiResponse<Boolean> logout()
Description copied from interface:AuthenticationApiterminates the current user's session.- Specified by:
logoutin interfaceAuthenticationApi
-
onLogout
protected ApiResponse<Boolean> onLogout(ApiResponse<Void> logoutResponse)
-
switchAccountType
public ApiResponse<SwitchAccountTypeResult> switchAccountType(SwitchRequest switchRequest)
Description copied from interface:AuthenticationApichanges a user's login type from one type to another.- Specified by:
switchAccountTypein interfaceAuthenticationApi
-
createUser
public ApiResponse<User> createUser(User user)
Description copied from interface:UserApicreates a user in the system based on the provided user object.- Specified by:
createUserin interfaceUserApi
-
getMe
public ApiResponse<User> getMe(String etag)
Description copied from interface:UserApireturns the logged in user.
-
getUser
public ApiResponse<User> getUser(String userId, String etag)
Description copied from interface:UserApireturns a user based on the provided user id string.
-
getUserByUsername
public ApiResponse<User> getUserByUsername(String userName, String etag)
Description copied from interface:UserApireturns a user based pn the provided user name string.- Specified by:
getUserByUsernamein interfaceUserApi
-
getUserByEmail
public ApiResponse<User> getUserByEmail(String email, String etag)
Description copied from interface:UserApireturns a user based on the provided user email string.- Specified by:
getUserByEmailin interfaceUserApi
-
autocompleteUsersInTeam
public ApiResponse<UserAutocomplete> autocompleteUsersInTeam(String teamId, String username, String etag)
Description copied from interface:UserApireturns the users on a team based on search term.- Specified by:
autocompleteUsersInTeamin interfaceUserApi
-
autocompleteUsersInChannel
public ApiResponse<UserAutocomplete> autocompleteUsersInChannel(String teamId, String channelId, String username, String etag)
Description copied from interface:UserApireturns the users in a channel based on search term.- Specified by:
autocompleteUsersInChannelin interfaceUserApi
-
autocompleteUsers
public ApiResponse<UserAutocomplete> autocompleteUsers(String username, String etag)
Description copied from interface:UserApireturns the users in the system based on search term.- Specified by:
autocompleteUsersin interfaceUserApi
-
getProfileImage
public ApiResponse<byte[]> getProfileImage(String userId, String etag)
Description copied from interface:UserApigets user's profile image. Must be logged in or be a system administrator.- Specified by:
getProfileImagein interfaceUserApi
-
getUsers
public ApiResponse<UserList> getUsers(Pager pager, String etag)
Description copied from interface:UserApireturns a page of users on the system. Page counting starts at 0.
-
getUsersInTeam
public ApiResponse<UserList> getUsersInTeam(String teamId, UsersOrder.InTeam order, Pager pager, String etag)
Description copied from interface:UserApireturns a page of users on a team. Page counting starts at 0.- Specified by:
getUsersInTeamin interfaceUserApi
-
getUsersNotInTeam
public ApiResponse<UserList> getUsersNotInTeam(String teamId, Pager pager, String etag)
Description copied from interface:UserApireturns a page of users who are not in a team. Page counting starts at 0.- Specified by:
getUsersNotInTeamin interfaceUserApi
-
getUsersInChannel
public ApiResponse<UserList> getUsersInChannel(String channelId, UsersOrder.InChannel order, Pager pager, String etag)
Description copied from interface:UserApireturns a page of users on a team. Page counting starts at 0.- Specified by:
getUsersInChannelin interfaceUserApi
-
getUsersNotInChannel
public ApiResponse<UserList> getUsersNotInChannel(String teamId, String channelId, Pager pager, String etag)
Description copied from interface:UserApireturns a page of users on a team. Page counting starts at 0.- Specified by:
getUsersNotInChannelin interfaceUserApi
-
getUsersWithoutTeam
public ApiResponse<UserList> getUsersWithoutTeam(Pager pager, String etag)
Description copied from interface:UserApireturns a page of users on the system that aren't on any teams. Page counting starts at 0.- Specified by:
getUsersWithoutTeamin interfaceUserApi
-
getUsersByIds
public ApiResponse<UserList> getUsersByIds(String... userIds)
Description copied from interface:UserApireturns a list of users based on the provided user ids.- Specified by:
getUsersByIdsin interfaceUserApi
-
getUsersByUsernames
public ApiResponse<UserList> getUsersByUsernames(String... usernames)
Description copied from interface:UserApireturns a list of users based on the provided usernames.- Specified by:
getUsersByUsernamesin interfaceUserApi
-
searchUsers
public ApiResponse<UserList> searchUsers(UserSearch search)
Description copied from interface:UserApireturns a list of users based on some search criteria.- Specified by:
searchUsersin interfaceUserApi
-
updateUser
public ApiResponse<User> updateUser(User user)
Description copied from interface:UserApiupdates a user in the system based on the provided user object.- Specified by:
updateUserin interfaceUserApi
-
patchUser
public ApiResponse<User> patchUser(String userId, UserPatch patch)
Description copied from interface:UserApipartially updates a user in the system. Any missing fields are not updated.
-
updateUserMfa
public ApiResponse<Boolean> updateUserMfa(String userId, String code, boolean activate)
Description copied from interface:UserApiactivates multi-factor authentication for a user if activate is true and a valid code is provided. If activate is false, then code is not required and multi-factor authentication is disabled for the user.- Specified by:
updateUserMfain interfaceUserApi
-
checkUserMfa
public boolean checkUserMfa(String loginId)
Description copied from interface:UserApichecks whether a user has MFA active on their account or not based on the provided login id.- Specified by:
checkUserMfain interfaceUserApi
-
generateMfaSecret
public ApiResponse<MfaSecret> generateMfaSecret(String userId)
Description copied from interface:UserApiwill generate a new MFA secret for a user and return it as a string and as a base64 encoded image QR code.- Specified by:
generateMfaSecretin interfaceUserApi
-
updateUserPassword
public ApiResponse<Boolean> updateUserPassword(String userId, String currentPassword, String newPassword)
Description copied from interface:UserApiupdates a user's password. Must be logged in as the user or be a system administrator.- Specified by:
updateUserPasswordin interfaceUserApi
-
updateUserRoles
public ApiResponse<Boolean> updateUserRoles(String userId, Role... roles)
Description copied from interface:UserApiupdates a user's roles in the system. A user can have "system_user" and "system_admin" roles.- Specified by:
updateUserRolesin interfaceUserApi
-
updateUserActive
public ApiResponse<Boolean> updateUserActive(String userId, boolean active)
Description copied from interface:UserApiupdates status of a user whether active or not.- Specified by:
updateUserActivein interfaceUserApi
-
deleteUser
public ApiResponse<Boolean> deleteUser(String userId)
Description copied from interface:UserApideactivates a user in the system based on the provided user id string.- Specified by:
deleteUserin interfaceUserApi
-
sendPasswordResetEmail
public ApiResponse<Boolean> sendPasswordResetEmail(String email)
Description copied from interface:UserApiwill send a link for password resetting to a user with the provided email.- Specified by:
sendPasswordResetEmailin interfaceUserApi
-
resetPassword
public ApiResponse<Boolean> resetPassword(String token, String newPassword)
Description copied from interface:UserApiuses a recovery code to update reset a user's password.- Specified by:
resetPasswordin interfaceUserApi
-
getSessions
public ApiResponse<SessionList> getSessions(String userId, String etag)
Description copied from interface:UserApireturns a list of sessions based on the provided user id string.- Specified by:
getSessionsin interfaceUserApi
-
revokeSession
public ApiResponse<Boolean> revokeSession(String userId, String sessionId)
Description copied from interface:UserApirevokes a user session based on the provided user id and session id strings.- Specified by:
revokeSessionin interfaceUserApi
-
attachDeviceId
public ApiResponse<Boolean> attachDeviceId(String deviceId)
Description copied from interface:UserApiattaches a mobile device ID to the current session.- Specified by:
attachDeviceIdin interfaceUserApi
-
getTeamUnreadForUser
public ApiResponse<TeamUnreadList> getTeamUnreadForUser(String userId, String teamIdToExclude)
Description copied from interface:UserApiwill return a list with TeamUnread objects that contain the amount of unread messages and mentions the current user has for the teams it belongs to. An optional team ID can be set to exclude that team from the results. Must be authenticated.- Specified by:
getTeamUnreadForUserin interfaceUserApi
-
getUserAudits
public ApiResponse<Audits> getUserAudits(String userId, Pager pager, String etag)
Description copied from interface:UserApireturns a list of audit based on the provided user id string.- Specified by:
getUserAuditsin interfaceUserApi
-
verifyUserEmail
public ApiResponse<Boolean> verifyUserEmail(String token)
Description copied from interface:UserApiwill verify a user's email using the supplied token.- Specified by:
verifyUserEmailin interfaceUserApi
-
sendVerificationEmail
public ApiResponse<Boolean> sendVerificationEmail(String email)
Description copied from interface:UserApiwill send an email to the user with the provided email addresses, if that user exists. The email will contain a link that can be used to verify the user's email address.- Specified by:
sendVerificationEmailin interfaceUserApi
-
setProfileImage
public ApiResponse<Boolean> setProfileImage(String userId, Path imageFilePath)
Description copied from interface:UserApisets profile image of the user.- Specified by:
setProfileImagein interfaceUserApi
-
createUserAccessToken
public ApiResponse<UserAccessToken> createUserAccessToken(String userId, String description)
- Specified by:
createUserAccessTokenin interfaceUserApi
-
getUserAccessTokens
public ApiResponse<UserAccessTokenList> getUserAccessTokens(String userId, Pager pager)
- Specified by:
getUserAccessTokensin interfaceUserApi
-
getUserAccessTokensAllUsers
public ApiResponse<UserAccessTokenList> getUserAccessTokensAllUsers(Pager pager)
- Specified by:
getUserAccessTokensAllUsersin interfaceUserApi
-
revokeUserAccessToken
public ApiResponse<Boolean> revokeUserAccessToken(String tokenId)
- Specified by:
revokeUserAccessTokenin interfaceUserApi
-
getUserAccessToken
public ApiResponse<UserAccessToken> getUserAccessToken(String tokenId)
- Specified by:
getUserAccessTokenin interfaceUserApi
-
disableUserAccessToken
public ApiResponse<Boolean> disableUserAccessToken(String tokenId)
- Specified by:
disableUserAccessTokenin interfaceUserApi
-
enableUserAccessToken
public ApiResponse<Boolean> enableUserAccessToken(String tokenId)
- Specified by:
enableUserAccessTokenin interfaceUserApi
-
searchTokens
public ApiResponse<UserAccessTokenList> searchTokens(String term)
- Specified by:
searchTokensin interfaceUserApi
-
revokeAllActiveSessionForUser
public ApiResponse<Boolean> revokeAllActiveSessionForUser(String userId)
- Specified by:
revokeAllActiveSessionForUserin interfaceUserApi
-
deleteProfileImage
public ApiResponse<Boolean> deleteProfileImage(String userId)
Description copied from interface:UserApidelete user profile image.- Specified by:
deleteProfileImagein interfaceUserApi
-
createTeam
public ApiResponse<Team> createTeam(Team team)
Description copied from interface:TeamApicreates a team in the system based on the provided team object.- Specified by:
createTeamin interfaceTeamApi
-
getTeam
public ApiResponse<Team> getTeam(String teamId, String etag)
Description copied from interface:TeamApireturns a team based on the provided team id string.
-
getAllTeams
public ApiResponse<TeamList> getAllTeams(Pager pager, String etag)
Description copied from interface:TeamApireturns all teams based on permssions.- Specified by:
getAllTeamsin interfaceTeamApi
-
getTeamByName
public ApiResponse<Team> getTeamByName(String name, String etag)
Description copied from interface:TeamApireturns a team based on the provided team name string.- Specified by:
getTeamByNamein interfaceTeamApi
-
searchTeams
public ApiResponse<TeamList> searchTeams(TeamSearch search)
Description copied from interface:TeamApireturns teams matching the provided search term.- Specified by:
searchTeamsin interfaceTeamApi
-
teamExists
public ApiResponse<TeamExists> teamExists(String name, String etag)
Description copied from interface:TeamApireturns true or false if the team exist or not.- Specified by:
teamExistsin interfaceTeamApi
-
getTeamsForUser
public ApiResponse<TeamList> getTeamsForUser(String userId, String etag)
Description copied from interface:TeamApireturns a list of teams a user is on. Must be logged in as the user or be a system administrator.- Specified by:
getTeamsForUserin interfaceTeamApi
-
getTeamMember
public ApiResponse<TeamMember> getTeamMember(String teamId, String userId, String etag)
Description copied from interface:TeamApireturns a team member based on the provided team and user id strings.- Specified by:
getTeamMemberin interfaceTeamApi
-
updateTeamMemberRoles
public ApiResponse<Boolean> updateTeamMemberRoles(String teamId, String userId, Role... newRoles)
Description copied from interface:TeamApiwill update the roles on a team for a user.- Specified by:
updateTeamMemberRolesin interfaceTeamApi
-
updateTeam
public ApiResponse<Team> updateTeam(Team team)
Description copied from interface:TeamApiwill update a team.- Specified by:
updateTeamin interfaceTeamApi
-
patchTeam
public ApiResponse<Team> patchTeam(String teamId, TeamPatch patch)
Description copied from interface:TeamApipartially updates a team. Any missing fields are not updated.
-
deleteTeam
public ApiResponse<Boolean> deleteTeam(String teamId)
Description copied from interface:TeamApideletes the team softly (archive only, not permanent delete).- Specified by:
deleteTeamin interfaceTeamApi- See Also:
TeamApi.deleteTeam(String, boolean)
-
deleteTeam
public ApiResponse<Boolean> deleteTeam(String teamId, boolean permanent)
Description copied from interface:TeamApideletes the team.- Specified by:
deleteTeamin interfaceTeamApipermanent-true: Permanently delete the team, to be used for compliance reasons only.- See Also:
TeamApi.deleteTeam(String)
-
getTeamMembers
public ApiResponse<TeamMemberList> getTeamMembers(String teamId, Pager pager, String etag)
Description copied from interface:TeamApireturns team members based on the provided team id string.- Specified by:
getTeamMembersin interfaceTeamApi
-
getTeamMembersForUser
public ApiResponse<TeamMemberList> getTeamMembersForUser(String userId, String etag)
Description copied from interface:TeamApireturns the team member for a user.- Specified by:
getTeamMembersForUserin interfaceTeamApi
-
getTeamMembersByIds
public ApiResponse<TeamMemberList> getTeamMembersByIds(String teamId, String... userIds)
Description copied from interface:TeamApiwill return an array of team members based on the team id and a list of user ids provided. Must be authenticated.- Specified by:
getTeamMembersByIdsin interfaceTeamApi
-
addTeamMember
public ApiResponse<TeamMember> addTeamMember(TeamMember teamMemberToAdd)
Description copied from interface:TeamApiadd user to a team and return a team member.- Specified by:
addTeamMemberin interfaceTeamApi
-
addTeamMember
@Deprecated public ApiResponse<TeamMember> addTeamMember(String teamId, String userId, String hash, String dataToHash, String inviteId)
Deprecated.Description copied from interface:TeamApiShould not use this API because server api changed.- Specified by:
addTeamMemberin interfaceTeamApi
-
addTeamMember
@Deprecated public ApiResponse<TeamMember> addTeamMember(String hash, String dataToHash, String inviteId)
Deprecated.Description copied from interface:TeamApiadds user to a team and return a team member.- Specified by:
addTeamMemberin interfaceTeamApi
-
addTeamMemberFromInvite
public ApiResponse<TeamMember> addTeamMemberFromInvite(String token, String inviteId)
Description copied from interface:TeamApiadd user to team from invite.- Specified by:
addTeamMemberFromInvitein interfaceTeamApi
-
addTeamMembers
public ApiResponse<TeamMemberList> addTeamMembers(String teamId, String... userIds)
Description copied from interface:TeamApiadds a number of users to a team and returns the team members.- Specified by:
addTeamMembersin interfaceTeamApi
-
removeTeamMember
public ApiResponse<Boolean> removeTeamMember(String teamId, String userId)
Description copied from interface:TeamApiwill remove a user from a team.- Specified by:
removeTeamMemberin interfaceTeamApi
-
getTeamStats
public ApiResponse<TeamStats> getTeamStats(String teamId, String etag)
Description copied from interface:TeamApireturns a team stats based on the team id string. Must be authenticated.- Specified by:
getTeamStatsin interfaceTeamApi
-
getTeamIcon
public ApiResponse<Path> getTeamIcon(String teamId) throws IOException
Description copied from interface:TeamApiGet the team icon image.- Specified by:
getTeamIconin interfaceTeamApi- Throws:
IOException
-
setTeamIcon
public ApiResponse<Boolean> setTeamIcon(String teamId, Path iconFilePath)
Description copied from interface:TeamApiSet the team icon.- Specified by:
setTeamIconin interfaceTeamApi
-
removeTeamIcon
public ApiResponse<Boolean> removeTeamIcon(String teamId)
Description copied from interface:TeamApiRemove the team icon.- Specified by:
removeTeamIconin interfaceTeamApi
-
getTeamUnread
public ApiResponse<TeamUnread> getTeamUnread(String teamId, String userId)
Description copied from interface:TeamApiwill return a TeamUnread object that contains the amount of unread messages and mentions the user has for the specified team. Must be authenticated.- Specified by:
getTeamUnreadin interfaceTeamApi
-
importTeam
public ApiResponse<byte[]> importTeam(byte[] data, int filesize, String importFrom, String fileName, String teamId)
Description copied from interface:TeamApiwill import an exported team from other app into a existing team.- Specified by:
importTeamin interfaceTeamApi
-
inviteUsersToTeam
public ApiResponse<Boolean> inviteUsersToTeam(String teamId, Collection<String> userEmails)
Description copied from interface:TeamApiinvite users by email to the team.- Specified by:
inviteUsersToTeamin interfaceTeamApi
-
getInviteInfo
public ApiResponse<TeamInviteInfo> getInviteInfo(String inviteId)
Description copied from interface:TeamApiget team info by invite id.- Specified by:
getInviteInfoin interfaceTeamApi
-
createChannel
public ApiResponse<Channel> createChannel(Channel channel)
Description copied from interface:ChannelApicreates a channel based on the provided channel object.- Specified by:
createChannelin interfaceChannelApi
-
updateChannel
public ApiResponse<Channel> updateChannel(Channel channel)
Description copied from interface:ChannelApiupdate a channel based on the provided channel object.- Specified by:
updateChannelin interfaceChannelApi
-
patchChannel
public ApiResponse<Channel> patchChannel(String channelId, ChannelPatch patch)
Description copied from interface:ChannelApipartially updates a channel. Any missing fields are not updated.- Specified by:
patchChannelin interfaceChannelApi
-
createDirectChannel
public ApiResponse<Channel> createDirectChannel(String userId1, String userId2)
Description copied from interface:ChannelApicreates a direct message channel based on the two user ids provided.- Specified by:
createDirectChannelin interfaceChannelApi
-
createGroupChannel
public ApiResponse<Channel> createGroupChannel(String... userIds)
Description copied from interface:ChannelApicreates a group message channel based on userIds provided.- Specified by:
createGroupChannelin interfaceChannelApi
-
getChannel
public ApiResponse<Channel> getChannel(String channelId, String etag)
Description copied from interface:ChannelApireturns a channel based on the provided channel id string.- Specified by:
getChannelin interfaceChannelApi
-
getChannelStats
public ApiResponse<ChannelStats> getChannelStats(String channelId, String etag)
Description copied from interface:ChannelApireturns statistics for a channel.- Specified by:
getChannelStatsin interfaceChannelApi
-
getPinnedPosts
public ApiResponse<PostList> getPinnedPosts(String channelId, String etag)
Description copied from interface:ChannelApigets a list of pinned posts.- Specified by:
getPinnedPostsin interfaceChannelApi
-
getPublicChannelsForTeam
public ApiResponse<ChannelList> getPublicChannelsForTeam(String teamId, Pager pager, String etag)
Description copied from interface:ChannelApireturns a list of public channels based on the provided team id string.- Specified by:
getPublicChannelsForTeamin interfaceChannelApi
-
getPublicChannelsByIdsForTeam
public ApiResponse<ChannelList> getPublicChannelsByIdsForTeam(String teamId, String... channelIds)
Description copied from interface:ChannelApireturns a list of public channeld based on provided team id string.- Specified by:
getPublicChannelsByIdsForTeamin interfaceChannelApi
-
getChannelsForTeamForUser
public ApiResponse<ChannelList> getChannelsForTeamForUser(String teamId, String userId, String etag)
Description copied from interface:ChannelApireturns a list channels of on a team for user.- Specified by:
getChannelsForTeamForUserin interfaceChannelApi
-
searchChannels
public ApiResponse<ChannelList> searchChannels(String teamId, ChannelSearch search)
Description copied from interface:ChannelApireturns the channels on a team matching the provided search term.- Specified by:
searchChannelsin interfaceChannelApi
-
deleteChannel
public ApiResponse<Boolean> deleteChannel(String channelId)
Description copied from interface:ChannelApideletes channel based on the provided channel id string.- Specified by:
deleteChannelin interfaceChannelApi
-
getChannelByName
public ApiResponse<Channel> getChannelByName(String channelName, String teamId, String etag)
Description copied from interface:ChannelApireturns a channel based on the provided channel name and team id strings.- Specified by:
getChannelByNamein interfaceChannelApi
-
getChannelByNameForTeamName
public ApiResponse<Channel> getChannelByNameForTeamName(String channelName, String teamName, String etag)
Description copied from interface:ChannelApireturns a channel based on the provided channel name and team name strings.- Specified by:
getChannelByNameForTeamNamein interfaceChannelApi
-
getChannelMembers
public ApiResponse<ChannelMembers> getChannelMembers(String channelId, Pager pager, String etag)
Description copied from interface:ChannelApigets a page of channel members.- Specified by:
getChannelMembersin interfaceChannelApi
-
getChannelMembersByIds
public ApiResponse<ChannelMembers> getChannelMembersByIds(String channelId, String... userIds)
Description copied from interface:ChannelApigets the channel members in a channel for a list of user ids.- Specified by:
getChannelMembersByIdsin interfaceChannelApi
-
getChannelMember
public ApiResponse<ChannelMember> getChannelMember(String channelId, String userId, String etag)
Description copied from interface:ChannelApigets a channel memner.- Specified by:
getChannelMemberin interfaceChannelApi
-
getChannelMembersForUser
public ApiResponse<ChannelMembers> getChannelMembersForUser(String userId, String teamId, String etag)
Description copied from interface:ChannelApigets all the channel members for a user on a team.- Specified by:
getChannelMembersForUserin interfaceChannelApi
-
viewChannel
public ApiResponse<ChannelViewResponse> viewChannel(String userId, ChannelView view)
Description copied from interface:ChannelApiperforms a view action for a user. synonymous with switching channels or marking channels as read by a user.- Specified by:
viewChannelin interfaceChannelApi
-
getChannelUnread
public ApiResponse<ChannelUnread> getChannelUnread(String channelId, String userId)
Description copied from interface:ChannelApiwill return a ChannelUnread object that contains the number ofo unread messages and mentions for a user.- Specified by:
getChannelUnreadin interfaceChannelApi
-
updateChannelRoles
public ApiResponse<Boolean> updateChannelRoles(String channelId, String userId, Role... roles)
Description copied from interface:ChannelApiwill update the roles on a channel for a user.- Specified by:
updateChannelRolesin interfaceChannelApi
-
updateChannelNotifyProps
public ApiResponse<Boolean> updateChannelNotifyProps(String channelId, String userId, Map<String,String> props)
Description copied from interface:ChannelApiwill update the notification properties on a channel for a user.- Specified by:
updateChannelNotifyPropsin interfaceChannelApi
-
addChannelMember
public ApiResponse<ChannelMember> addChannelMember(String channelId, String userId)
Description copied from interface:ChannelApiadds user to channel and return a channel memner.- Specified by:
addChannelMemberin interfaceChannelApi
-
removeUserFromChannel
public ApiResponse<Boolean> removeUserFromChannel(String channelId, String userId)
Description copied from interface:ChannelApiwill delete the channel member object for a user, effectively removing the user from a channel.- Specified by:
removeUserFromChannelin interfaceChannelApi
-
restoreChannel
public ApiResponse<Channel> restoreChannel(String channelId)
- Specified by:
restoreChannelin interfaceChannelApi
-
getDeletedChannels
public ApiResponse<ChannelList> getDeletedChannels(String teamId, Pager pager)
- Specified by:
getDeletedChannelsin interfaceChannelApi
-
convertChannelToPrivate
public ApiResponse<Channel> convertChannelToPrivate(String channelId)
Description copied from interface:ChannelApiconvert channel from public to private.- Specified by:
convertChannelToPrivatein interfaceChannelApi
-
autocompleteChannels
public ApiResponse<ChannelList> autocompleteChannels(String teamId, String searchTerm)
Description copied from interface:ChannelApiautocomplete channels in team based on search term.- Specified by:
autocompleteChannelsin interfaceChannelApi
-
autocompleteChannelsForSearch
public ApiResponse<ChannelList> autocompleteChannelsForSearch(String teamId, String searchTerm)
Description copied from interface:ChannelApiautocomplete your (joined) channels in team based on search term.- Specified by:
autocompleteChannelsForSearchin interfaceChannelApi
-
createPost
public ApiResponse<Post> createPost(Post post)
Description copied from interface:PostApicreates a post based on the provided post object.- Specified by:
createPostin interfacePostApi
-
createEphemeralPost
public ApiResponse<Post> createEphemeralPost(String sendToUserId, Post post)
Description copied from interface:PostApicreates an ephemeral post send totargetUserId.- Specified by:
createEphemeralPostin interfacePostApi
-
updatePost
public ApiResponse<Post> updatePost(Post post)
Description copied from interface:PostApiupdates a post based on the provided post object.- Specified by:
updatePostin interfacePostApi
-
patchPost
public ApiResponse<Post> patchPost(String postId, PostPatch patch)
Description copied from interface:PostApipartially updates a post. Any missing fields are not updated.
-
pinPost
public ApiResponse<Boolean> pinPost(String postId)
Description copied from interface:PostApipin a post based on proviced post id string.
-
unpinPost
public ApiResponse<Boolean> unpinPost(String postId)
Description copied from interface:PostApiunpin a post based on provided post id string.
-
getPost
public ApiResponse<Post> getPost(String postId, String etag)
Description copied from interface:PostApigets a single post.
-
deletePost
public ApiResponse<Boolean> deletePost(String postId)
Description copied from interface:PostApideletes a post from the provided post id string.- Specified by:
deletePostin interfacePostApi
-
getPostThread
public ApiResponse<PostList> getPostThread(String postId, String etag)
Description copied from interface:PostApigets a post with all the other posts in the same thread.- Specified by:
getPostThreadin interfacePostApi
-
getPostsForChannel
public ApiResponse<PostList> getPostsForChannel(String channelId, Pager pager, String etag)
Description copied from interface:PostApigets a page of posts with an array for ordering for a channel.- Specified by:
getPostsForChannelin interfacePostApi
-
getFlaggedPostsForUser
public ApiResponse<PostList> getFlaggedPostsForUser(String userId, Pager pager)
Description copied from interface:PostApireturns flagges posts of a user based on user id string.- Specified by:
getFlaggedPostsForUserin interfacePostApi
-
getFlaggedPostsForUserInTeam
public ApiResponse<PostList> getFlaggedPostsForUserInTeam(String userId, String teamId, Pager pager)
Description copied from interface:PostApireturns flagged posts in team of a user based on user id string.- Specified by:
getFlaggedPostsForUserInTeamin interfacePostApi
-
getFlaggedPostsForUserInChannel
public ApiResponse<PostList> getFlaggedPostsForUserInChannel(String userId, String channelId, Pager pager)
Description copied from interface:PostApireturns flagged posts in channel of a user based on user id string.- Specified by:
getFlaggedPostsForUserInChannelin interfacePostApi
-
getPostsSince
public ApiResponse<PostList> getPostsSince(String channelId, long time)
Description copied from interface:PostApigets posts created after a specified time as Unix time in milliseconds.- Specified by:
getPostsSincein interfacePostApi
-
getPostsAfter
public ApiResponse<PostList> getPostsAfter(String channelId, String postId, Pager pager, String etag)
Description copied from interface:PostApigets a page of posts that were posted after the post provided.- Specified by:
getPostsAfterin interfacePostApi
-
getPostsBefore
public ApiResponse<PostList> getPostsBefore(String channelId, String postId, Pager pager, String etag)
Description copied from interface:PostApigets a page of posts that were posted before the post provided.- Specified by:
getPostsBeforein interfacePostApi
-
searchPosts
public ApiResponse<PostSearchResults> searchPosts(String teamId, String terms, boolean isOrSearch)
Description copied from interface:PostApireturns any posts with matching term string.- Specified by:
searchPostsin interfacePostApi
-
getFileInfoForPost
public ApiResponse<FileInfo[]> getFileInfoForPost(String postId)
Description copied from interface:PostApiget a list of file info attached the post.- Specified by:
getFileInfoForPostin interfacePostApi
-
uploadFile
public ApiResponse<FileUploadResult> uploadFile(String channelId, Path... filePaths) throws IOException
Description copied from interface:FilesApiUpload a file to specified channel.- Specified by:
uploadFilein interfaceFilesApi- Parameters:
channelId- channel id will be upload file to.filePaths- file path to upload.- Throws:
IOException- If an I/O error occurs
-
getFile
public ApiResponse<Path> getFile(String fileId) throws IOException
Description copied from interface:FilesApiGet a file content.- Specified by:
getFilein interfaceFilesApi- Parameters:
fileId- the file id to get- Throws:
IOException- If an I/O error occurs
-
getFileThumbnail
public ApiResponse<Path> getFileThumbnail(String fileId) throws IOException
Description copied from interface:FilesApiGet a file thumbnail.- Specified by:
getFileThumbnailin interfaceFilesApi- Parameters:
fileId- the file id to get thumbnail- Throws:
IOException- If an I/O error occurs
-
getFilePreview
public ApiResponse<Path> getFilePreview(String fileId) throws IOException
Description copied from interface:FilesApiGet a file preview.- Specified by:
getFilePreviewin interfaceFilesApi- Parameters:
fileId- the file id to get preview- Throws:
IOException- If an I/O error occurs
-
getPublicFileLink
public ApiResponse<String> getPublicFileLink(String fileId)
Description copied from interface:FilesApiGet a public link can be access without logging in to Mattermost.- Specified by:
getPublicFileLinkin interfaceFilesApi- Parameters:
fileId- the file id to get public link
-
getFileMetadata
public ApiResponse<FileInfo> getFileMetadata(String fileId)
Description copied from interface:FilesApiGet a file metadata.- Specified by:
getFileMetadatain interfaceFilesApi- Parameters:
fileId- the file id to get metadata
-
getPing
public ApiResponse<Boolean> getPing()
Description copied from interface:SystemApiwill ping the server and to see if it is up and running.
-
testEmail
public ApiResponse<Boolean> testEmail()
Description copied from interface:SystemApiwill attempt to connect to the configured SMTP server.
-
getConfig
public ApiResponse<Config> getConfig()
Description copied from interface:SystemApiwill retrieve the server config with some sanitized items.
-
reloadConfig
public ApiResponse<Boolean> reloadConfig()
Description copied from interface:SystemApiwill reload the server configuration.- Specified by:
reloadConfigin interfaceSystemApi
-
getOldClientConfig
public ApiResponse<Map<String,String>> getOldClientConfig(String etag)
Description copied from interface:SystemApiwill retrieve the parts of the server configuration needed by the client, formatted in the old format.- Specified by:
getOldClientConfigin interfaceSystemApi
-
getOldClientLicense
public ApiResponse<Map<String,String>> getOldClientLicense(String etag)
Description copied from interface:SystemApiwill retrieve the parts of the server license needed by the client, formatted in the old format.- Specified by:
getOldClientLicensein interfaceSystemApi
-
databaseRecycle
public ApiResponse<Boolean> databaseRecycle()
Description copied from interface:SystemApiwill recycle the connections. Discard current connection and get new one.- Specified by:
databaseRecyclein interfaceSystemApi
-
invalidateCaches
public ApiResponse<Boolean> invalidateCaches()
Description copied from interface:SystemApiwill purge the cache and can affect the performance while is cleaning.- Specified by:
invalidateCachesin interfaceSystemApi
-
updateConfig
public ApiResponse<Config> updateConfig(Config config)
Description copied from interface:SystemApiwill update the server configuration.- Specified by:
updateConfigin interfaceSystemApi
-
getAnalytics
public ApiResponse<AnalyticsRows> getAnalytics(AnalyticsCategory category, String teamId)
- Specified by:
getAnalyticsin interfaceSystemApi
-
uploadLicenseFile
public ApiResponse<Boolean> uploadLicenseFile(Path licenseFile)
- Specified by:
uploadLicenseFilein interfaceSystemApi
-
removeLicense
public ApiResponse<Boolean> removeLicense()
- Specified by:
removeLicensein interfaceSystemApi
-
createIncomingWebhook
public ApiResponse<IncomingWebhook> createIncomingWebhook(IncomingWebhook hook)
Description copied from interface:WebhookApicreates an incoming webhook for a channel.- Specified by:
createIncomingWebhookin interfaceWebhookApi
-
updateIncomingWebhook
public ApiResponse<IncomingWebhook> updateIncomingWebhook(IncomingWebhook hook)
Description copied from interface:WebhookApiupdates an incoming webhook for a channel.- Specified by:
updateIncomingWebhookin interfaceWebhookApi
-
getIncomingWebhooks
public ApiResponse<IncomingWebhookList> getIncomingWebhooks(Pager pager, String etag)
Description copied from interface:WebhookApireturns a page of incoming webhooks on the system. Page counting starts at 0.- Specified by:
getIncomingWebhooksin interfaceWebhookApi
-
getIncomingWebhooksForTeam
public ApiResponse<IncomingWebhookList> getIncomingWebhooksForTeam(String teamId, Pager pager, String etag)
Description copied from interface:WebhookApireturns a page of incoming webhooks for a team. Page counting starts at 0.- Specified by:
getIncomingWebhooksForTeamin interfaceWebhookApi
-
getIncomingWebhook
public ApiResponse<IncomingWebhook> getIncomingWebhook(String hookId, String etag)
Description copied from interface:WebhookApireturns an Incoming webhook given the hook id.- Specified by:
getIncomingWebhookin interfaceWebhookApi
-
deleteIncomingWebhook
public ApiResponse<Boolean> deleteIncomingWebhook(String hookId)
Description copied from interface:WebhookApideletes an Incoming Webhook given the hook id.- Specified by:
deleteIncomingWebhookin interfaceWebhookApi
-
createOutgoingWebhook
public ApiResponse<OutgoingWebhook> createOutgoingWebhook(OutgoingWebhook hook)
Description copied from interface:WebhookApicreates an outgoing webhook for a team or channel.- Specified by:
createOutgoingWebhookin interfaceWebhookApi
-
updateOutgoingWebhook
public ApiResponse<OutgoingWebhook> updateOutgoingWebhook(OutgoingWebhook hook)
Description copied from interface:WebhookApiupdates an outgoing webhook.- Specified by:
updateOutgoingWebhookin interfaceWebhookApi
-
getOutgoingWebhooks
public ApiResponse<OutgoingWebhookList> getOutgoingWebhooks(Pager pager, String etag)
Description copied from interface:WebhookApireturns a page of outgoing webhooks ont eh system. Page counting starts at 0.- Specified by:
getOutgoingWebhooksin interfaceWebhookApi
-
getOutgoingWebhook
public ApiResponse<OutgoingWebhook> getOutgoingWebhook(String hookId)
Description copied from interface:WebhookApioutgoing webhooks on the system requested by hook id.- Specified by:
getOutgoingWebhookin interfaceWebhookApi
-
getOutgoingWebhooksForChannel
public ApiResponse<OutgoingWebhookList> getOutgoingWebhooksForChannel(String channelId, Pager pager, String etag)
Description copied from interface:WebhookApireturns a page of outgoing webhooks for a channel. Page counting starts at 0.- Specified by:
getOutgoingWebhooksForChannelin interfaceWebhookApi
-
getOutgoingWebhooksForTeam
public ApiResponse<OutgoingWebhookList> getOutgoingWebhooksForTeam(String teamId, Pager pager, String etag)
Description copied from interface:WebhookApireturns a page of outgoing webhooks for a team. Page counting starts at 0.- Specified by:
getOutgoingWebhooksForTeamin interfaceWebhookApi
-
regenOutgoingHookToken
public ApiResponse<OutgoingWebhook> regenOutgoingHookToken(String hookId)
Description copied from interface:WebhookApiregenerate the outgoing webhook token.- Specified by:
regenOutgoingHookTokenin interfaceWebhookApi
-
deleteOutgoingWebhook
public ApiResponse<Boolean> deleteOutgoingWebhook(String hookId)
Description copied from interface:WebhookApidelete the outgoing webhook on the system requested by hook id.- Specified by:
deleteOutgoingWebhookin interfaceWebhookApi
-
getPreferences
public ApiResponse<Preferences> getPreferences(String userId)
Description copied from interface:PreferencesApireturns the user's preferences.- Specified by:
getPreferencesin interfacePreferencesApi
-
updatePreferences
public ApiResponse<Boolean> updatePreferences(String userId, Preferences preferences)
Description copied from interface:PreferencesApisaves the user's preferences.- Specified by:
updatePreferencesin interfacePreferencesApi
-
deletePreferences
public ApiResponse<Boolean> deletePreferences(String userId, Preferences preferences)
Description copied from interface:PreferencesApideletes the user's preferences.- Specified by:
deletePreferencesin interfacePreferencesApi
-
getPreferencesByCategory
public ApiResponse<Preferences> getPreferencesByCategory(String userId, PreferenceCategory category)
Description copied from interface:PreferencesApireturns the user's preferences from the provided category string.- Specified by:
getPreferencesByCategoryin interfacePreferencesApi
-
getPreferenceByCategoryAndName
public ApiResponse<Preference> getPreferenceByCategoryAndName(String userId, PreferenceCategory category, String preferenceName)
Description copied from interface:PreferencesApireturns the user's preferences from the provided category and preference name string.- Specified by:
getPreferenceByCategoryAndNamein interfacePreferencesApi
-
getSamlMetadata
public ApiResponse<Path> getSamlMetadata() throws IOException
Description copied from interface:SamlApireturns metadata for the SAML configuration.- Specified by:
getSamlMetadatain interfaceSamlApi- Throws:
IOException
-
uploadSamlIdpCertificate
public ApiResponse<Boolean> uploadSamlIdpCertificate(Path dataFile, String fileName)
Description copied from interface:SamlApiwill upload an IDP certificate for SAML and set the config to use it.- Specified by:
uploadSamlIdpCertificatein interfaceSamlApi
-
uploadSamlPublicCertificate
public ApiResponse<Boolean> uploadSamlPublicCertificate(Path dataFile, String fileName)
Description copied from interface:SamlApiwill upload a public certificate for SAML and set the config to use it.- Specified by:
uploadSamlPublicCertificatein interfaceSamlApi
-
uploadSamlPrivateCertificate
public ApiResponse<Boolean> uploadSamlPrivateCertificate(Path dataFile, String fileName)
Description copied from interface:SamlApiwill upload a private key for SAML and set the config to use it.- Specified by:
uploadSamlPrivateCertificatein interfaceSamlApi
-
deleteSamlIdpCertificate
public ApiResponse<Boolean> deleteSamlIdpCertificate()
Description copied from interface:SamlApideletes the SAML IDP certificate from the server and updates the config to not use it and disable SAML.- Specified by:
deleteSamlIdpCertificatein interfaceSamlApi
-
deleteSamlPublicCertificate
public ApiResponse<Boolean> deleteSamlPublicCertificate()
Description copied from interface:SamlApideletes the saml IDP certificate from the server and updates the config to not use it and disable SAML.- Specified by:
deleteSamlPublicCertificatein interfaceSamlApi
-
deleteSamlPrivateCertificate
public ApiResponse<Boolean> deleteSamlPrivateCertificate()
Description copied from interface:SamlApideletes the SAML IDP certificate from the server and updates the config to not use it and disable SAML.- Specified by:
deleteSamlPrivateCertificatein interfaceSamlApi
-
getSamlCertificateStatus
public ApiResponse<SamlCertificateStatus> getSamlCertificateStatus()
Description copied from interface:SamlApireturns metadata for the SAML configuration.- Specified by:
getSamlCertificateStatusin interfaceSamlApi
-
createComplianceReport
public ApiResponse<Compliance> createComplianceReport(Compliance report)
Description copied from interface:ComplianceApicreates a compliance report.- Specified by:
createComplianceReportin interfaceComplianceApi
-
getComplianceReports
public ApiResponse<Compliances> getComplianceReports(Pager pager)
Description copied from interface:ComplianceApireturns list of compliance reports.- Specified by:
getComplianceReportsin interfaceComplianceApi
-
getComplianceReport
public ApiResponse<Compliance> getComplianceReport(String reportId)
Description copied from interface:ComplianceApireturns a compliance report.- Specified by:
getComplianceReportin interfaceComplianceApi
-
downloadComplianceReport
public ApiResponse<Object> downloadComplianceReport(String reportId)
Description copied from interface:ComplianceApireturns a full compliance report as a file.- Specified by:
downloadComplianceReportin interfaceComplianceApi
-
getClusterStatus
public ApiResponse<ClusterInfo[]> getClusterStatus()
- Specified by:
getClusterStatusin interfaceClusterApi
-
syncLdap
public ApiResponse<Boolean> syncLdap()
Description copied from interface:LdapApiwill force a sync with the configured LDAP server.
-
testLdap
public ApiResponse<Boolean> testLdap()
Description copied from interface:LdapApiwill attempt to connect to the configured LDAP server and return OK if configured correctly.
-
getAudits
public ApiResponse<Audits> getAudits(Pager pager, String etag)
Description copied from interface:AuditsApireturns a list of audits for the whole system.
-
getBrandImage
public ApiResponse<Path> getBrandImage() throws IOException
Description copied from interface:BrandApiretrieves the previously uploaded brand image.- Specified by:
getBrandImagein interfaceBrandApi- Throws:
IOException
-
uploadBrandImage
public ApiResponse<Boolean> uploadBrandImage(Path dataFile)
Description copied from interface:BrandApisets the brand image for the system.- Specified by:
uploadBrandImagein interfaceBrandApi
-
deleteBrandImage
public ApiResponse<Boolean> deleteBrandImage()
Description copied from interface:BrandApidelete the brand image for the system.- Specified by:
deleteBrandImagein interfaceBrandApi
-
getLogs
public ApiResponse<List<String>> getLogs(Pager pager)
Description copied from interface:LogsApipage of logs as a string list.
-
postLog
public ApiResponse<Map<String,String>> postLog(Map<String,String> message)
Description copied from interface:LogsApiThis method is a convenience Web Service call so clients can log messages into the server-side logs. For example we typically log javascript error messages into the server-side. It returns the log message if the logging was successful.
-
createOAuthApp
public ApiResponse<OAuthApp> createOAuthApp(OAuthApp app)
Description copied from interface:OAuthApiwill register a new OAuth 2.0 client application with Mattermost acting as an OAuth 2.0 service provider.- Specified by:
createOAuthAppin interfaceOAuthApi
-
getOAuthApps
public ApiResponse<List<OAuthApp>> getOAuthApps(Pager pager)
Description copied from interface:OAuthApigets a page of registered OAuth 2.0 client applications with Mattermost acting as an OAuth 2.0 service provider.- Specified by:
getOAuthAppsin interfaceOAuthApi
-
getOAuthApp
public ApiResponse<OAuthApp> getOAuthApp(String appId)
Description copied from interface:OAuthApigets a registered OAuth 2.0 client application with Mattermost acting as an OAuth 2.0 service provider.- Specified by:
getOAuthAppin interfaceOAuthApi
-
getOAuthAppInfo
public ApiResponse<OAuthApp> getOAuthAppInfo(String appId)
Description copied from interface:OAuthApigets a sanitized version of a registered OAuth 2.0 client application with Mattermost acting as an OAuth 2.0 service provider.- Specified by:
getOAuthAppInfoin interfaceOAuthApi
-
deleteOAuthApp
public ApiResponse<Boolean> deleteOAuthApp(String appId)
Description copied from interface:OAuthApideletes a registered OAuth 2.0 client application.- Specified by:
deleteOAuthAppin interfaceOAuthApi
-
regenerateOAuthAppSecret
public ApiResponse<OAuthApp> regenerateOAuthAppSecret(String appId)
Description copied from interface:OAuthApiregenerates the client secret for a registered OAuth 2.0 client application.- Specified by:
regenerateOAuthAppSecretin interfaceOAuthApi
-
getAuthorizedOAuthAppsForUser
public ApiResponse<List<OAuthApp>> getAuthorizedOAuthAppsForUser(String userId, Pager pager)
Description copied from interface:OAuthApigets a page of OAuth 2.0 client applications the user authorized to use access their account.- Specified by:
getAuthorizedOAuthAppsForUserin interfaceOAuthApi
-
authorizeOAuthApp
public String authorizeOAuthApp(AuthorizeRequest authRequest)
Description copied from interface:OAuthApiwill authorize an OAuth 2.0 client application to access a user's account and provide a redirect link to follow.- Specified by:
authorizeOAuthAppin interfaceOAuthApi
-
deauthorizeOAuthApp
public ApiResponse<Boolean> deauthorizeOAuthApp(String appId)
Description copied from interface:OAuthApiwill deauthorize an OAuth 2.0 client application from accessing a user's account.- Specified by:
deauthorizeOAuthAppin interfaceOAuthApi
-
createCommand
public ApiResponse<Command> createCommand(Command cmd)
Description copied from interface:CommandsApiwill create a new command if the user have the right permissions.- Specified by:
createCommandin interfaceCommandsApi
-
updateCommand
public ApiResponse<Command> updateCommand(Command cmd)
Description copied from interface:CommandsApiupdates a command based on the provided Command object.- Specified by:
updateCommandin interfaceCommandsApi
-
deleteCommand
public ApiResponse<Boolean> deleteCommand(String commandId)
Description copied from interface:CommandsApideletes a command based on the provided command id string.- Specified by:
deleteCommandin interfaceCommandsApi
-
listCommands
public ApiResponse<CommandList> listCommands(String teamId, boolean customOnly)
Description copied from interface:CommandsApiwill retrieve a list of commands available in the team.- Specified by:
listCommandsin interfaceCommandsApi
-
executeCommand
public ApiResponse<CommandResponse> executeCommand(String channelId, String command)
Description copied from interface:CommandsApiexecutes a given command.- Specified by:
executeCommandin interfaceCommandsApi
-
listAutocompleteCommands
public ApiResponse<CommandList> listAutocompleteCommands(String teamId)
Description copied from interface:CommandsApiwill retrieve a list of commands available in the team.- Specified by:
listAutocompleteCommandsin interfaceCommandsApi
-
regenCommandToken
public ApiResponse<String> regenCommandToken(String commandId)
Description copied from interface:CommandsApiwill create a new token if the user have the right permissions.- Specified by:
regenCommandTokenin interfaceCommandsApi
-
getUserStatus
public ApiResponse<Status> getUserStatus(String userId, String etag)
Description copied from interface:StatusApireturns a user status based on the provided user id string.- Specified by:
getUserStatusin interfaceStatusApi
-
getUsersStatusesByIds
public ApiResponse<StatusList> getUsersStatusesByIds(String... userIds)
Description copied from interface:StatusApireturns a list of users status based on the provided user ids.- Specified by:
getUsersStatusesByIdsin interfaceStatusApi
-
updateUserStatus
public ApiResponse<Status> updateUserStatus(String userId, Status userStatus)
Description copied from interface:StatusApisets a user's status based on the provided user id string.- Specified by:
updateUserStatusin interfaceStatusApi
-
createEmoji
public ApiResponse<Emoji> createEmoji(Emoji emoji, Path imageFile)
Description copied from interface:EmojiApiwill save an emoji to the server if the current user has permission to do so. If successful, the provided emoji will be returned with its Id field filled in. Otherwise, an error will be returned.- Specified by:
createEmojiin interfaceEmojiApi
-
getEmojiList
public ApiResponse<EmojiList> getEmojiList(Pager pager)
Description copied from interface:EmojiApireturns a list of custom emoji in the system.- Specified by:
getEmojiListin interfaceEmojiApi- Parameters:
pager- add in Mattermost Server 4.1, in older version, ignore.
-
getEmojiListSorted
public ApiResponse<EmojiList> getEmojiListSorted(Pager pager)
Description copied from interface:EmojiApireturns a list of custom emoji in the system sorted by name.- Specified by:
getEmojiListSortedin interfaceEmojiApi
-
deleteEmoji
public ApiResponse<Boolean> deleteEmoji(String emojiId)
Description copied from interface:EmojiApidelete an custom emoji on the provided emoji id string.- Specified by:
deleteEmojiin interfaceEmojiApi
-
getEmoji
public ApiResponse<Emoji> getEmoji(String emojiId)
Description copied from interface:EmojiApireturns a custom emoji in the system on the provided emoji id string.
-
getEmojiImage
public ApiResponse<Path> getEmojiImage(String emojiId) throws IOException
Description copied from interface:EmojiApireturns the emoji image.- Specified by:
getEmojiImagein interfaceEmojiApi- Throws:
IOException
-
getEmojiByName
public ApiResponse<Emoji> getEmojiByName(String emojiName)
Description copied from interface:EmojiApiget a custom emoji by name.- Specified by:
getEmojiByNamein interfaceEmojiApi
-
searchEmoji
public ApiResponse<EmojiList> searchEmoji(SearchEmojiRequest searchRequest)
Description copied from interface:EmojiApisearch custom emoji based on request.- Specified by:
searchEmojiin interfaceEmojiApi
-
autocompleteEmoji
public ApiResponse<EmojiList> autocompleteEmoji(String name)
Description copied from interface:EmojiApiget a list of custom emoji that name starts with or matching provided name.- Specified by:
autocompleteEmojiin interfaceEmojiApi
-
saveReaction
public ApiResponse<Reaction> saveReaction(Reaction reaction)
Description copied from interface:ReactionApisaves an emoji reaction for a post. Returns the saved reaction if successful, otherwise an error will be returned.- Specified by:
saveReactionin interfaceReactionApi
-
getReactions
public ApiResponse<ReactionList> getReactions(String postId)
Description copied from interface:ReactionApireturns a list of reactions to a post.- Specified by:
getReactionsin interfaceReactionApi
-
deleteReaction
public ApiResponse<Boolean> deleteReaction(Reaction reaction)
Description copied from interface:ReactionApideletes reaction of a user in a post.- Specified by:
deleteReactionin interfaceReactionApi
-
testElasticsearchConfiguration
public ApiResponse<Boolean> testElasticsearchConfiguration()
Description copied from interface:ElasticsearchApitest Elasticsearch configuration.- Specified by:
testElasticsearchConfigurationin interfaceElasticsearchApi
-
purgeElasticsearchIndexes
public ApiResponse<Boolean> purgeElasticsearchIndexes()
Description copied from interface:ElasticsearchApideletes all Elasticsearch indexes.- Specified by:
purgeElasticsearchIndexesin interfaceElasticsearchApi
-
uploadPlugin
public ApiResponse<PluginManifest> uploadPlugin(Path plugin, boolean force)
- Specified by:
uploadPluginin interfacePluginApi
-
getPlugins
public ApiResponse<Plugins> getPlugins()
- Specified by:
getPluginsin interfacePluginApi
-
removePlugin
public ApiResponse<Boolean> removePlugin(String pluginId)
- Specified by:
removePluginin interfacePluginApi
-
enablePlugin
public ApiResponse<Boolean> enablePlugin(String pluginId)
- Specified by:
enablePluginin interfacePluginApi
-
disablePlugin
public ApiResponse<Boolean> disablePlugin(String pluginId)
- Specified by:
disablePluginin interfacePluginApi
-
getWebappPlugins
public ApiResponse<PluginManifest[]> getWebappPlugins()
- Specified by:
getWebappPluginsin interfacePluginApi
-
getOpenGraphMetadata
public ApiResponse<net.bis5.opengraph.models.OpenGraph> getOpenGraphMetadata(String url)
Description copied from interface:OpenGraphApiRetrieve the OpenGraph metadata for provided url.- Specified by:
getOpenGraphMetadatain interfaceOpenGraphApi
-
createBot
public ApiResponse<Bot> createBot(BotPatch bot)
Description copied from interface:BotsApiCreate a bot.
-
patchBot
public ApiResponse<Bot> patchBot(String botUserId, BotPatch patch)
Description copied from interface:BotsApiPatch a bot.
-
getBot
public ApiResponse<Bot> getBot(String botUserId, boolean includeDeleted)
Description copied from interface:BotsApiGet a bot.
-
getBots
public ApiResponse<Bots> getBots(Pager pager, GetBotsOption option)
Description copied from interface:BotsApiGet bots.
-
disableBot
public ApiResponse<Bot> disableBot(String botUserId)
Description copied from interface:BotsApiDisable a bot.- Specified by:
disableBotin interfaceBotsApi
-
enableBot
public ApiResponse<Bot> enableBot(String botUserId)
Description copied from interface:BotsApiEnable a bot.
-
assignBotToUser
public ApiResponse<Bot> assignBotToUser(String botUserId, String ownerUserId)
Description copied from interface:BotsApiAssign a bot to a user.- Specified by:
assignBotToUserin interfaceBotsApi
-
-