public class MattermostClient extends Object implements AutoCloseable, AuditsApi, AuthenticationApi, BrandApi, ChannelApi, ClusterApi, CommandsApi, ComplianceApi, EmojiApi, GeneralApi, LdapApi, LogsApi, OAuthApi, PostApi, PreferencesApi, ReactionApi, SamlApi, StatusApi, TeamApi, UserApi, WebhookApi, WebrtcApi
Modifier and Type | Field and Description |
---|---|
protected static String |
API_URL_SUFFIX |
protected static String |
HEADER_AUTH |
protected static String |
HEADER_ETAG_CLIENT |
Constructor and Description |
---|
MattermostClient(String url) |
MattermostClient(String url,
Level logLevel) |
Modifier and Type | Method and 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)
adds user to a team and return a team member.
|
ApiResponse<TeamMember> |
addTeamMember(String teamId,
String userId,
String hash,
String dataToHash,
String inviteId)
Deprecated.
API Change on Mattermost 4.0
|
ApiResponse<TeamMember> |
addTeamMember(TeamMember teamMemberToAdd)
add user to a team and return a team member.
|
ApiResponse<TeamMemberList> |
addTeamMembers(String teamId,
String... userIds)
adds a number of users to a team and returns the team members.
|
ApiResponse<Boolean> |
attachDeviceId(String deviceId)
attaches a mobile device ID to the current session/
|
String |
authorizeOAuthApp(AuthorizeRequest authRequest)
will authorize an OAuth 2.0 client application to access a user's account
and provide a redirect link to follow.
|
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 javax.ws.rs.client.Client |
buildClient() |
boolean |
checkUserMfa(String loginId)
checks whether a user has MFA active on their account or not based on the
provided login id.
|
void |
clearOAuthToken() |
void |
close() |
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<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<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> |
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> |
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.
|
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,
Class<T> responseType) |
protected <T> ApiResponse<T> |
doApiGet(String url,
String etag,
javax.ws.rs.core.GenericType<T> responseType) |
protected <U> ApiResponse<Void> |
doApiPost(String url,
U data) |
protected <T,U> ApiResponse<T> |
doApiPost(String url,
U data,
Class<T> responseType) |
protected <T,U> ApiResponse<T> |
doApiPost(String url,
U data,
javax.ws.rs.core.GenericType<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,
Class<T> responseType) |
protected <T,U> ApiResponse<T> |
doApiRequest(String method,
String url,
U data,
String etag,
javax.ws.rs.core.GenericType<T> responseType) |
ApiResponse<Object> |
downloadComplianceReport(String reportId)
returns a full compliance report as a file/
|
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<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<Object> |
getBrandImage()
retrieves the previously uploaded brand image.
|
String |
getBrandRoute() |
String |
getCacheRoute() |
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.
|
String |
getChannelByNameForTeamNameRoute(String channelName,
String teamName) |
String |
getChannelByNameRoute(String channelName,
String teamId) |
ApiResponse<ChannelMember> |
getChannelMember(String channelId,
String userId,
String etag)
gets a channel memner.
|
String |
getChannelMemberRoute(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.
|
String |
getChannelMembersRoute(String channelId) |
String |
getChannelRoute(String channelId) |
ApiResponse<ChannelList> |
getChannelsForTeamForUser(String teamId,
String userId,
String etag)
returns a list channels of on a team for user.
|
String |
getChannelsForTeamRoute(String teamId) |
String |
getChannelsRoute() |
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.
|
String |
getClusterRoute() |
ApiResponse<List<ClusterInfo>> |
getClusterStatus() |
String |
getCommandRoute(String commandId) |
String |
getCommandsRoute() |
ApiResponse<Compliance> |
getComplianceReport(String reportId)
returns a compliance report.
|
String |
getComplianceReportRoute(String reportId) |
ApiResponse<Compliances> |
getComplianceReports(Pager pager)
returns list of compliance reports.
|
String |
getComplianceReportsRoute() |
ApiResponse<Config> |
getConfig()
will retrieve the server config with some sanitized items.
|
String |
getConfigRoute() |
String |
getDatabaseRoute() |
ApiResponse<Emoji> |
getEmoji(String emojiId)
returns a custom emoji in the system on the provided emoji id string.
|
ApiResponse<Object> |
getEmojiImage(String emojiId)
returns the emoji image.
|
ApiResponse<EmojiList> |
getEmojiList(Pager pager)
returns a list of custom emoji in the syste,/
|
String |
getEmojiRoute(String emojiId) |
String |
getEmojisRoute() |
String |
getFileRoute(String fileId) |
String |
getFilesRoute() |
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.
|
String |
getIncomingWebhookRoute(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.
|
String |
getIncomingWebhooksRoute() |
String |
getLdapRoute() |
String |
getLicenseRoute() |
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.
|
String |
getOAuthAppRoute(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.
|
String |
getOAuthAppsRoute() |
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<OutgoingWebhook> |
getOutgoingWebhook(String hookId)
outgoing webhooks on the system requested by hook id.
|
String |
getOutgoingWebhookRoute(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.
|
String |
getOutgoingWebhooksRoute() |
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.
|
ApiResponse<Post> |
getPost(String postId,
String etag)
gets a single post.
|
String |
getPostRoute(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.
|
String |
getPostsRoute() |
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.
|
String |
getPreferencesRoute(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<List<Reaction>> |
getReactions(String postId)
returns a list of reactions to a post.
|
String |
getReactionsRoute() |
ApiResponse<SamlCertificateStatus> |
getSamlCertificateStatus()
returns metadata for the SAML configuration.
|
ApiResponse<String> |
getSamlMetadata()
returns metadata for the SAML configuration.
|
String |
getSamlRoute() |
ApiResponse<SessionList> |
getSessions(String userId,
String etag)
returns a list of sessions based on the provided user id string.
|
String |
getSystemRoute() |
ApiResponse<Team> |
getTeam(String teamId,
String etag)
returns a team based on the provided team is string/
|
String |
getTeamAutoCompleteCommandsRoute(String teamId) |
ApiResponse<Team> |
getTeamByName(String name,
String etag)
returns a team based on the provided team name string.
|
String |
getTeamByNameRoute(String teamName) |
String |
getTeamImportRoute(String teamId) |
ApiResponse<TeamMember> |
getTeamMember(String teamId,
String userId,
String etag)
returns a team member based on the provided team and user id strings.
|
String |
getTeamMemberRoute(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.
|
String |
getTeamMembersRoute(String teamId) |
String |
getTeamRoute(String teamId) |
ApiResponse<TeamList> |
getTeamsForUser(String userId,
String etag)
returns a list of teams a user is on.
|
String |
getTeamsRoute() |
ApiResponse<TeamStats> |
getTeamStats(String teamId,
String etag)
returns a team stats based on the team id string.
|
String |
getTeamStatsRoute(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.
|
String |
getTestEmailRoute() |
ApiResponse<User> |
getUser(String userId,
String etag)
returns a user based on the provided user id string.
|
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.
|
String |
getUserByEmailRoute(String email) |
ApiResponse<User> |
getUserByUsername(String userName,
String etag)
returns a user based pn the provided user name string.
|
String |
getUserByUsernameRoute(String userName) |
String |
getUserRoute(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.
|
ApiResponse<UserList> |
getUsersInChannel(String channelId,
Pager pager,
String etag)
returns a page of users on a team.
|
ApiResponse<UserList> |
getUsersInTeam(String teamId,
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.
|
String |
getUsersRoute() |
ApiResponse<List<Status>> |
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.
|
String |
getUserStatusesRoute() |
String |
getUserStatusRoute(String userId) |
ApiResponse<UserList> |
getUsersWithoutTeam(Pager pager,
String etag)
returns a page of users on the system that aren't on any teams.
|
ApiResponse<WebrtcInfoResponse> |
getWebrtcToken()
returns a valid token, stun server and turn server with credentials to
use with the Mattermost WebRTC service.
|
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.
|
protected User |
login(LoginRequest param) |
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.
|
User |
loginById(String id,
String password)
authenticates a user by user id and password.
|
User |
loginByLdap(String loginId,
String password)
authenticates a user by LDAP id and password.
|
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<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<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> |
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<Boolean> |
revokeSession(String userId,
String sessionId)
revokes a user session based on the provided user id and session id
strings.
|
protected Object |
samlFileToMultipart(Path dataFile,
String dataFileName) |
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<PostList> |
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<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.
|
void |
setAccessToken(String token) |
void |
setOAuthToken(String token) |
ApiResponse<Boolean> |
setProfileImage(String userId,
Path imageFilePath)
sets profile image of the user.
|
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> |
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(String postId,
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.
|
boolean |
uploadBrandImage(Path dataFile)
sets the brand image for the system.
|
boolean |
uploadSamlIdpCertificate(Path dataFile,
String fileName)
will upload an IDP certificate for SAML and set the config to use it.
|
boolean |
uploadSamlPrivateCertificate(Path dataFile,
String fileName)
will upload a private key for SAML and set the config to use it.
|
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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createGroupChannel, getChannel, getChannelByName, getChannelByNameForTeamName, getChannelMember, getChannelMembers, getChannelMembers, getChannelMembersByIds, getChannelMembersForUser, getChannelsForTeamForUser, getChannelStats, getPinnedPosts, getPublicChannelsByIdsForTeam, getPublicChannelsForTeam, getPublicChannelsForTeam, updateChannelRoles
listCommands
getComplianceReports
getEmojiList
getOldClientConfig, getOldClientLicense
getAuthorizedOAuthAppsForUser, getOAuthApps
getFlaggedPostsForUser, getFlaggedPostsForUserInChannel, getFlaggedPostsForUserInTeam, getPost, getPostsAfter, getPostsAfter, getPostsBefore, getPostsBefore, getPostsForChannel, getPostsForChannel, getPostsSince, getPostsSince, getPostThread, searchPosts, updatePost
getUsersStatusesByIds, getUserStatus
addTeamMembers, getAllTeams, getAllTeams, getTeam, getTeamByName, getTeamMember, getTeamMembers, getTeamMembers, getTeamMembersByIds, getTeamMembersforUser, getTeamsForUser, getteamStats, removeTeamMember, teamExists, updateTeamMemberRoles
autocompleteUsers, autocompleteUsersInChannel, autocompleteUsersInTeam, getMe, getProfileImage, getSessions, getTeamUnreadForUser, getUser, getUserAudits, getUserAudits, getUserByEmail, getUserByUsername, getUsers, getUsers, getUsersByIds, getUsersByUsernames, getUsersInChannel, getUsersInChannel, getUsersInTeam, getUsersInTeam, getUsersNotInChannel, getUsersNotInChannel, getUsersNotInTeam, getUsersNotInTeam, getUsersWithoutTeam, getUsersWithoutTeam, revokeSession, updateUserRoles
getIncomingWebhook, getIncomingWebhooks, getIncomingWebhooks, getIncomingWebhooksForTeam, getIncomingWebhooksForTeam, getOutgoingWebhooks, getOutgoingWebhooks, getOutgoingWebhooksForChannel, getOutgoingWebhooksForChannel, getOutgoingWebhooksForTeam, getOutgoingWebhooksForTeam
protected static final String API_URL_SUFFIX
protected static final String HEADER_ETAG_CLIENT
protected static final String HEADER_AUTH
public MattermostClient(String url)
protected javax.ws.rs.client.Client buildClient()
public void close() throws Exception
close
in interface AutoCloseable
Exception
AutoCloseable.close()
public void setOAuthToken(String token)
public void clearOAuthToken()
public void setAccessToken(String token)
token
- Personal Access Token to access Mattermost APIpublic String getUsersRoute()
public String getTeamsRoute()
public String getChannelsRoute()
public String getChannelByNameForTeamNameRoute(String channelName, String teamName)
public String getPostsRoute()
public String getConfigRoute()
public String getLicenseRoute()
public String getFilesRoute()
public String getSystemRoute()
public String getTestEmailRoute()
public String getDatabaseRoute()
public String getCacheRoute()
public String getClusterRoute()
public String getIncomingWebhooksRoute()
public String getComplianceReportsRoute()
public String getOutgoingWebhooksRoute()
public String getUserStatusesRoute()
public String getSamlRoute()
public String getLdapRoute()
public String getBrandRoute()
public String getCommandsRoute()
public String getEmojisRoute()
public String getReactionsRoute()
public String getOAuthAppsRoute()
protected <T> ApiResponse<T> doApiGet(String url, String etag, Class<T> responseType)
protected <T> ApiResponse<T> doApiGet(String url, String etag, javax.ws.rs.core.GenericType<T> responseType)
protected ApiResponse<Void> doApiGet(String url, String etag)
protected <T,U> ApiResponse<T> doApiPost(String url, U data, Class<T> responseType)
protected <T,U> ApiResponse<T> doApiPost(String url, U data, javax.ws.rs.core.GenericType<T> responseType)
protected <U> ApiResponse<Void> doApiPost(String url, U data)
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 <T,U> ApiResponse<T> doApiPut(String url, U data, Class<T> responseType)
protected <U> ApiResponse<Void> doApiPut(String url, U data)
protected <T> ApiResponse<T> doApiDelete(String url, Class<T> responseType)
protected ApiResponse<Void> doApiDelete(String url)
protected <T,U> ApiResponse<T> doApiRequest(String method, String url, U data, String etag, Class<T> responseType)
protected <T,U> ApiResponse<T> doApiRequest(String method, String url, U data, String etag, javax.ws.rs.core.GenericType<T> responseType)
protected <U> ApiResponse<Void> doApiRequest(String method, String url, U data, String etag)
public User loginById(String id, String password)
loginById
in interface AuthenticationApi
id
- password
- public User login(String loginId, String password)
login
in interface AuthenticationApi
loginId
- password
- public User loginByLdap(String loginId, String password)
loginByLdap
in interface AuthenticationApi
loginId
- password
- public User loginWithDevice(String loginId, String password, String deviceId)
loginWithDevice
in interface AuthenticationApi
loginId
- password
- deviceId
- protected User login(LoginRequest param)
protected ApiResponse<User> onLogin(ApiResponse<Void> loginResponse)
public ApiResponse<Boolean> logout()
logout
in interface AuthenticationApi
protected ApiResponse<Boolean> onLogout(ApiResponse<Void> logoutResponse)
public ApiResponse<SwitchAccountTypeResult> switchAccountType(SwitchRequest switchRequest)
switchAccountType
in interface AuthenticationApi
public ApiResponse<User> createUser(User user)
createUser
in interface UserApi
user
- public ApiResponse<User> getMe(String etag)
public ApiResponse<User> getUser(String userId, String etag)
public ApiResponse<User> getUserByUsername(String userName, String etag)
getUserByUsername
in interface UserApi
userName
- etag
- public ApiResponse<User> getUserByEmail(String email, String etag)
getUserByEmail
in interface UserApi
email
- etag
- public ApiResponse<UserAutocomplete> autocompleteUsersInTeam(String teamId, String username, String etag)
autocompleteUsersInTeam
in interface UserApi
teamId
- username
- etag
- public ApiResponse<UserAutocomplete> autocompleteUsersInChannel(String teamId, String channelId, String username, String etag)
autocompleteUsersInChannel
in interface UserApi
teamId
- channelId
- username
- etag
- public ApiResponse<UserAutocomplete> autocompleteUsers(String username, String etag)
autocompleteUsers
in interface UserApi
username
- etag
- public ApiResponse<byte[]> getProfileImage(String userId, String etag)
getProfileImage
in interface UserApi
userId
- etag
- public ApiResponse<UserList> getUsers(Pager pager, String etag)
public ApiResponse<UserList> getUsersInTeam(String teamId, Pager pager, String etag)
getUsersInTeam
in interface UserApi
teamId
- pager
- etag
- public ApiResponse<UserList> getUsersNotInTeam(String teamId, Pager pager, String etag)
getUsersNotInTeam
in interface UserApi
teamId
- pager
- etag
- public ApiResponse<UserList> getUsersInChannel(String channelId, Pager pager, String etag)
getUsersInChannel
in interface UserApi
channelId
- pager
- etag
- public ApiResponse<UserList> getUsersNotInChannel(String teamId, String channelId, Pager pager, String etag)
getUsersNotInChannel
in interface UserApi
teamId
- channelId
- pager
- etag
- public ApiResponse<UserList> getUsersWithoutTeam(Pager pager, String etag)
getUsersWithoutTeam
in interface UserApi
pager
- etag
- public ApiResponse<UserList> getUsersByIds(String... userIds)
getUsersByIds
in interface UserApi
userIds
- public ApiResponse<UserList> getUsersByUsernames(String... usernames)
getUsersByUsernames
in interface UserApi
usernames
- public ApiResponse<UserList> searchUsers(UserSearch search)
searchUsers
in interface UserApi
search
- public ApiResponse<User> updateUser(User user)
updateUser
in interface UserApi
user
- public ApiResponse<User> patchUser(String userId, UserPatch patch)
public ApiResponse<Boolean> updateUserMfa(String userId, String code, boolean activate)
updateUserMfa
in interface UserApi
userId
- code
- activate
- public boolean checkUserMfa(String loginId)
checkUserMfa
in interface UserApi
loginId
- public ApiResponse<MfaSecret> generateMfaSecret(String userId)
generateMfaSecret
in interface UserApi
userId
- public ApiResponse<Boolean> updateUserPassword(String userId, String currentPassword, String newPassword)
updateUserPassword
in interface UserApi
userId
- currentPassword
- newPassword
- public ApiResponse<Boolean> updateUserRoles(String userId, Role... roles)
updateUserRoles
in interface UserApi
userId
- role
- public ApiResponse<Boolean> updateUserActive(String userId, boolean active)
updateUserActive
in interface UserApi
userId
- active
- public ApiResponse<Boolean> deleteUser(String userId)
deleteUser
in interface UserApi
userId
- public ApiResponse<Boolean> sendPasswordResetEmail(String email)
sendPasswordResetEmail
in interface UserApi
email
- public ApiResponse<Boolean> resetPassword(String token, String newPassword)
resetPassword
in interface UserApi
token
- newPassword
- public ApiResponse<SessionList> getSessions(String userId, String etag)
getSessions
in interface UserApi
userId
- etag
- public ApiResponse<Boolean> revokeSession(String userId, String sessionId)
revokeSession
in interface UserApi
userId
- sessionId
- public ApiResponse<Boolean> attachDeviceId(String deviceId)
attachDeviceId
in interface UserApi
deviceId
- public ApiResponse<TeamUnreadList> getTeamUnreadForUser(String userId, String teamIdToExclude)
getTeamUnreadForUser
in interface UserApi
userId
- teamIdToExclude
- public ApiResponse<Audits> getUserAudits(String userId, Pager pager, String etag)
getUserAudits
in interface UserApi
userId
- pager
- etag
- public ApiResponse<Boolean> verifyUserEmail(String token)
verifyUserEmail
in interface UserApi
token
- public ApiResponse<Boolean> sendVerificationEmail(String email)
sendVerificationEmail
in interface UserApi
email
- public ApiResponse<Boolean> setProfileImage(String userId, Path imageFilePath)
setProfileImage
in interface UserApi
userId
- imageFilePath
- public ApiResponse<Team> createTeam(Team team)
createTeam
in interface TeamApi
team
- public ApiResponse<Team> getTeam(String teamId, String etag)
public ApiResponse<TeamList> getAllTeams(Pager pager, String etag)
getAllTeams
in interface TeamApi
pager
- etag
- public ApiResponse<Team> getTeamByName(String name, String etag)
getTeamByName
in interface TeamApi
name
- etag
- public ApiResponse<TeamList> searchTeams(TeamSearch search)
searchTeams
in interface TeamApi
search
- public ApiResponse<TeamExists> teamExists(String name, String etag)
teamExists
in interface TeamApi
name
- etag
- public ApiResponse<TeamList> getTeamsForUser(String userId, String etag)
getTeamsForUser
in interface TeamApi
userId
- etag
- public ApiResponse<TeamMember> getTeamMember(String teamId, String userId, String etag)
getTeamMember
in interface TeamApi
teamId
- userId
- etag
- public ApiResponse<Boolean> updateTeamMemberRoles(String teamId, String userId, Role... newRoles)
updateTeamMemberRoles
in interface TeamApi
teamId
- userId
- newRoles
- public ApiResponse<Team> updateTeam(Team team)
updateTeam
in interface TeamApi
team
- public ApiResponse<Team> patchTeam(String teamId, TeamPatch patch)
public ApiResponse<Boolean> deleteTeam(String teamId)
deleteTeam
in interface TeamApi
teamId
- #deleteTeam(String, boolean)}
public ApiResponse<Boolean> deleteTeam(String teamId, boolean permanent)
deleteTeam
in interface TeamApi
teamId
- permanent
- true
: Permanently delete the team, to be used for
compliance reasons only.#deleteTeam(String)}
public ApiResponse<TeamMemberList> getTeamMembers(String teamId, Pager pager, String etag)
getTeamMembers
in interface TeamApi
teamId
- pager
- etag
- public ApiResponse<TeamMemberList> getTeamMembersForUser(String userId, String etag)
getTeamMembersForUser
in interface TeamApi
userId
- etag
- public ApiResponse<TeamMemberList> getTeamMembersByIds(String teamId, String... userIds)
getTeamMembersByIds
in interface TeamApi
teamId
- userIds
- public ApiResponse<TeamMember> addTeamMember(TeamMember teamMemberToAdd)
addTeamMember
in interface TeamApi
teamMemberToAdd
- @Deprecated public ApiResponse<TeamMember> addTeamMember(String teamId, String userId, String hash, String dataToHash, String inviteId)
addTeamMember
in interface TeamApi
teamId
- userId
- hash
- dataToHash
- inviteId
- public ApiResponse<TeamMember> addTeamMember(String hash, String dataToHash, String inviteId)
addTeamMember
in interface TeamApi
hash
- dataToHash
- inviteId
- public ApiResponse<TeamMemberList> addTeamMembers(String teamId, String... userIds)
addTeamMembers
in interface TeamApi
teamId
- userIds
- public ApiResponse<Boolean> removeTeamMember(String teamId, String userId)
removeTeamMember
in interface TeamApi
teamId
- userId
- public ApiResponse<TeamStats> getTeamStats(String teamId, String etag)
getTeamStats
in interface TeamApi
teamId
- etag
- public ApiResponse<TeamUnread> getTeamUnread(String teamId, String userId)
getTeamUnread
in interface TeamApi
teamId
- userId
- public ApiResponse<byte[]> importTeam(byte[] data, int filesize, String importFrom, String fileName, String teamId)
importTeam
in interface TeamApi
data
- filesize
- importFrom
- fileName
- teamId
- public ApiResponse<Boolean> inviteUsersToTeam(String teamId, Collection<String> userEmails)
inviteUsersToTeam
in interface TeamApi
teamId
- userEmails
- public ApiResponse<Channel> createChannel(Channel channel)
createChannel
in interface ChannelApi
channel
- public ApiResponse<Channel> updateChannel(Channel channel)
updateChannel
in interface ChannelApi
channel
- public ApiResponse<Channel> patchChannel(String channelId, ChannelPatch patch)
patchChannel
in interface ChannelApi
channelId
- patch
- public ApiResponse<Channel> createDirectChannel(String userId1, String userId2)
createDirectChannel
in interface ChannelApi
userId1
- userId2
- public ApiResponse<Channel> createGroupChannel(String... userIds)
createGroupChannel
in interface ChannelApi
userIds
- public ApiResponse<Channel> getChannel(String channelId, String etag)
getChannel
in interface ChannelApi
channelId
- etag
- public ApiResponse<ChannelStats> getChannelStats(String channelId, String etag)
getChannelStats
in interface ChannelApi
channelId
- etag
- public ApiResponse<PostList> getPinnedPosts(String channelId, String etag)
getPinnedPosts
in interface ChannelApi
channelId
- etag
- public ApiResponse<ChannelList> getPublicChannelsForTeam(String teamId, Pager pager, String etag)
getPublicChannelsForTeam
in interface ChannelApi
teamId
- pager
- etag
- public ApiResponse<ChannelList> getPublicChannelsByIdsForTeam(String teamId, String... channelIds)
getPublicChannelsByIdsForTeam
in interface ChannelApi
teamId
- channelIds
- public ApiResponse<ChannelList> getChannelsForTeamForUser(String teamId, String userId, String etag)
getChannelsForTeamForUser
in interface ChannelApi
teamId
- userId
- etag
- public ApiResponse<ChannelList> searchChannels(String teamId, ChannelSearch search)
searchChannels
in interface ChannelApi
teamId
- search
- public ApiResponse<Boolean> deleteChannel(String channelId)
deleteChannel
in interface ChannelApi
channelId
- public ApiResponse<Channel> getChannelByName(String channelName, String teamId, String etag)
getChannelByName
in interface ChannelApi
channelName
- teamId
- etag
- public ApiResponse<Channel> getChannelByNameForTeamName(String channelName, String teamName, String etag)
getChannelByNameForTeamName
in interface ChannelApi
channelName
- teamName
- etag
- public ApiResponse<ChannelMembers> getChannelMembers(String channelId, Pager pager, String etag)
getChannelMembers
in interface ChannelApi
channelId
- public ApiResponse<ChannelMembers> getChannelMembersByIds(String channelId, String... userIds)
getChannelMembersByIds
in interface ChannelApi
channelId
- userIds
- public ApiResponse<ChannelMember> getChannelMember(String channelId, String userId, String etag)
getChannelMember
in interface ChannelApi
channelId
- userId
- etag
- public ApiResponse<ChannelMembers> getChannelMembersForUser(String userId, String teamId, String etag)
getChannelMembersForUser
in interface ChannelApi
userId
- teamId
- etag
- public ApiResponse<ChannelViewResponse> viewChannel(String userId, ChannelView view)
viewChannel
in interface ChannelApi
userId
- view
- public ApiResponse<ChannelUnread> getChannelUnread(String channelId, String userId)
getChannelUnread
in interface ChannelApi
channelId
- userId
- public ApiResponse<Boolean> updateChannelRoles(String channelId, String userId, Role... roles)
updateChannelRoles
in interface ChannelApi
channelId
- userId
- roles
- public ApiResponse<Boolean> updateChannelNotifyProps(String channelId, String userId, Map<String,String> props)
updateChannelNotifyProps
in interface ChannelApi
channelId
- userId
- props
- public ApiResponse<ChannelMember> addChannelMember(String channelId, String userId)
addChannelMember
in interface ChannelApi
channelId
- userId
- public ApiResponse<Boolean> removeUserFromChannel(String channelId, String userId)
removeUserFromChannel
in interface ChannelApi
channelId
- userId
- public ApiResponse<Post> createPost(Post post)
createPost
in interface PostApi
post
- public ApiResponse<Post> updatePost(String postId, Post post)
updatePost
in interface PostApi
postId
- post
- public ApiResponse<Post> patchPost(String postId, PostPatch patch)
public ApiResponse<Boolean> pinPost(String postId)
public ApiResponse<Boolean> unpinPost(String postId)
public ApiResponse<Post> getPost(String postId, String etag)
public ApiResponse<Boolean> deletePost(String postId)
deletePost
in interface PostApi
postId
- public ApiResponse<PostList> getPostThread(String postId, String etag)
getPostThread
in interface PostApi
postId
- etag
- public ApiResponse<PostList> getPostsForChannel(String channelId, Pager pager, String etag)
getPostsForChannel
in interface PostApi
channelId
- pager
- etag
- public ApiResponse<PostList> getFlaggedPostsForUser(String userId, Pager pager)
getFlaggedPostsForUser
in interface PostApi
userId
- pager
- public ApiResponse<PostList> getFlaggedPostsForUserInTeam(String userId, String teamId, Pager pager)
getFlaggedPostsForUserInTeam
in interface PostApi
userId
- teamId
- pager
- public ApiResponse<PostList> getFlaggedPostsForUserInChannel(String userId, String channelId, Pager pager)
getFlaggedPostsForUserInChannel
in interface PostApi
userId
- channelId
- pager
- public ApiResponse<PostList> getPostsSince(String channelId, long time)
getPostsSince
in interface PostApi
channelId
- time
- public ApiResponse<PostList> getPostsAfter(String channelId, String postId, Pager pager, String etag)
getPostsAfter
in interface PostApi
channelId
- postId
- pager
- etag
- public ApiResponse<PostList> getPostsBefore(String channelId, String postId, Pager pager, String etag)
getPostsBefore
in interface PostApi
channelId
- postId
- pager
- etag
- public ApiResponse<PostList> searchPosts(String teamId, String terms, boolean isOrSearch)
searchPosts
in interface PostApi
teamId
- terms
- isOrSearch
- public ApiResponse<Boolean> getPing()
getPing
in interface GeneralApi
public ApiResponse<Boolean> testEmail()
testEmail
in interface GeneralApi
public ApiResponse<Config> getConfig()
getConfig
in interface GeneralApi
public ApiResponse<Boolean> reloadConfig()
reloadConfig
in interface GeneralApi
public ApiResponse<Map<String,String>> getOldClientConfig(String etag)
getOldClientConfig
in interface GeneralApi
etag
- public ApiResponse<Map<String,String>> getOldClientLicense(String etag)
getOldClientLicense
in interface GeneralApi
etag
- public ApiResponse<Boolean> databaseRecycle()
databaseRecycle
in interface GeneralApi
public ApiResponse<Boolean> invalidateCaches()
invalidateCaches
in interface GeneralApi
public ApiResponse<Config> updateConfig(Config config)
updateConfig
in interface GeneralApi
config
- public ApiResponse<IncomingWebhook> createIncomingWebhook(IncomingWebhook hook)
createIncomingWebhook
in interface WebhookApi
hook
- public ApiResponse<IncomingWebhook> updateIncomingWebhook(IncomingWebhook hook)
updateIncomingWebhook
in interface WebhookApi
hook
- public ApiResponse<IncomingWebhookList> getIncomingWebhooks(Pager pager, String etag)
getIncomingWebhooks
in interface WebhookApi
pager
- etag
- public ApiResponse<IncomingWebhookList> getIncomingWebhooksForTeam(String teamId, Pager pager, String etag)
getIncomingWebhooksForTeam
in interface WebhookApi
teamId
- pager
- etag
- public ApiResponse<IncomingWebhook> getIncomingWebhook(String hookId, String etag)
getIncomingWebhook
in interface WebhookApi
hookId
- etag
- public ApiResponse<Boolean> deleteIncomingWebhook(String hookId)
deleteIncomingWebhook
in interface WebhookApi
hookId
- public ApiResponse<OutgoingWebhook> createOutgoingWebhook(OutgoingWebhook hook)
createOutgoingWebhook
in interface WebhookApi
hook
- public ApiResponse<OutgoingWebhook> updateOutgoingWebhook(OutgoingWebhook hook)
updateOutgoingWebhook
in interface WebhookApi
hook
- public ApiResponse<OutgoingWebhookList> getOutgoingWebhooks(Pager pager, String etag)
getOutgoingWebhooks
in interface WebhookApi
pager
- etag
- public ApiResponse<OutgoingWebhook> getOutgoingWebhook(String hookId)
getOutgoingWebhook
in interface WebhookApi
hookId
- public ApiResponse<OutgoingWebhookList> getOutgoingWebhooksForChannel(String channelId, Pager pager, String etag)
getOutgoingWebhooksForChannel
in interface WebhookApi
channelId
- pager
- etag
- public ApiResponse<OutgoingWebhookList> getOutgoingWebhooksForTeam(String teamId, Pager pager, String etag)
getOutgoingWebhooksForTeam
in interface WebhookApi
teamId
- pager
- etag
- public ApiResponse<OutgoingWebhook> regenOutgoingHookToken(String hookId)
regenOutgoingHookToken
in interface WebhookApi
hookId
- public ApiResponse<Boolean> deleteOutgoingWebhook(String hookId)
deleteOutgoingWebhook
in interface WebhookApi
hookId
- public ApiResponse<Preferences> getPreferences(String userId)
getPreferences
in interface PreferencesApi
userId
- public ApiResponse<Boolean> updatePreferences(String userId, Preferences preferences)
updatePreferences
in interface PreferencesApi
userId
- preferences
- public ApiResponse<Boolean> deletePreferences(String userId, Preferences preferences)
deletePreferences
in interface PreferencesApi
userId
- preferences
- public ApiResponse<Preferences> getPreferencesByCategory(String userId, PreferenceCategory category)
getPreferencesByCategory
in interface PreferencesApi
userId
- category
- public ApiResponse<Preference> getPreferenceByCategoryAndName(String userId, PreferenceCategory category, String preferenceName)
getPreferenceByCategoryAndName
in interface PreferencesApi
userId
- category
- preferenceName
- public ApiResponse<String> getSamlMetadata()
getSamlMetadata
in interface SamlApi
public boolean uploadSamlIdpCertificate(Path dataFile, String fileName)
uploadSamlIdpCertificate
in interface SamlApi
dataFile
- fileName
- public boolean uploadSamlPublicCertificate(Path dataFile, String fileName)
uploadSamlPublicCertificate
in interface SamlApi
dataFile
- fileName
- public boolean uploadSamlPrivateCertificate(Path dataFile, String fileName)
uploadSamlPrivateCertificate
in interface SamlApi
dataFile
- fileName
- public ApiResponse<Boolean> deleteSamlIdpCertificate()
deleteSamlIdpCertificate
in interface SamlApi
public ApiResponse<Boolean> deleteSamlPublicCertificate()
deleteSamlPublicCertificate
in interface SamlApi
public ApiResponse<Boolean> deleteSamlPrivateCertificate()
deleteSamlPrivateCertificate
in interface SamlApi
public ApiResponse<SamlCertificateStatus> getSamlCertificateStatus()
getSamlCertificateStatus
in interface SamlApi
public ApiResponse<Compliance> createComplianceReport(Compliance report)
createComplianceReport
in interface ComplianceApi
report
- public ApiResponse<Compliances> getComplianceReports(Pager pager)
getComplianceReports
in interface ComplianceApi
pager
- public ApiResponse<Compliance> getComplianceReport(String reportId)
getComplianceReport
in interface ComplianceApi
reportId
- public ApiResponse<Object> downloadComplianceReport(String reportId)
downloadComplianceReport
in interface ComplianceApi
reportId
- public ApiResponse<List<ClusterInfo>> getClusterStatus()
getClusterStatus
in interface ClusterApi
public ApiResponse<Boolean> syncLdap()
public ApiResponse<Boolean> testLdap()
public ApiResponse<Audits> getAudits(Pager pager, String etag)
public ApiResponse<Object> getBrandImage()
getBrandImage
in interface BrandApi
public boolean uploadBrandImage(Path dataFile)
uploadBrandImage
in interface BrandApi
dataFile
- public ApiResponse<List<String>> getLogs(Pager pager)
public ApiResponse<Map<String,String>> postLog(Map<String,String> message)
public ApiResponse<OAuthApp> createOAuthApp(OAuthApp app)
createOAuthApp
in interface OAuthApi
app
- public ApiResponse<List<OAuthApp>> getOAuthApps(Pager pager)
getOAuthApps
in interface OAuthApi
pager
- public ApiResponse<OAuthApp> getOAuthApp(String appId)
getOAuthApp
in interface OAuthApi
appId
- public ApiResponse<OAuthApp> getOAuthAppInfo(String appId)
getOAuthAppInfo
in interface OAuthApi
appId
- public ApiResponse<Boolean> deleteOAuthApp(String appId)
deleteOAuthApp
in interface OAuthApi
appId
- public ApiResponse<OAuthApp> regenerateOAuthAppSecret(String appId)
regenerateOAuthAppSecret
in interface OAuthApi
appId
- public ApiResponse<List<OAuthApp>> getAuthorizedOAuthAppsForUser(String userId, Pager pager)
getAuthorizedOAuthAppsForUser
in interface OAuthApi
userId
- pager
- public String authorizeOAuthApp(AuthorizeRequest authRequest)
authorizeOAuthApp
in interface OAuthApi
authRequest
- public ApiResponse<Boolean> deauthorizeOAuthApp(String appId)
deauthorizeOAuthApp
in interface OAuthApi
appId
- public ApiResponse<Command> createCommand(Command cmd)
createCommand
in interface CommandsApi
cmd
- public ApiResponse<Command> updateCommand(Command cmd)
updateCommand
in interface CommandsApi
cmd
- public ApiResponse<Boolean> deleteCommand(String commandId)
deleteCommand
in interface CommandsApi
commandId
- public ApiResponse<CommandList> listCommands(String teamId, boolean customOnly)
listCommands
in interface CommandsApi
teamId
- customOnly
- public ApiResponse<CommandResponse> executeCommand(String channelId, String command)
executeCommand
in interface CommandsApi
channelId
- command
- public ApiResponse<CommandList> listAutocompleteCommands(String teamId)
listAutocompleteCommands
in interface CommandsApi
teamId
- public ApiResponse<String> regenCommandToken(String commandId)
regenCommandToken
in interface CommandsApi
commandId
- public ApiResponse<Status> getUserStatus(String userId, String etag)
getUserStatus
in interface StatusApi
userId
- etag
- public ApiResponse<List<Status>> getUsersStatusesByIds(String... userIds)
getUsersStatusesByIds
in interface StatusApi
userIds
- public ApiResponse<Status> updateUserStatus(String userId, Status userStatus)
updateUserStatus
in interface StatusApi
userId
- userStatus
- public ApiResponse<WebrtcInfoResponse> getWebrtcToken()
getWebrtcToken
in interface WebrtcApi
public ApiResponse<Emoji> createEmoji(Emoji emoji, Path imageFile)
createEmoji
in interface EmojiApi
emoji
- imageFile
- public ApiResponse<EmojiList> getEmojiList(Pager pager)
getEmojiList
in interface EmojiApi
pager
- add in Mattermost Server 4.1, in older version, ignore.public ApiResponse<Boolean> deleteEmoji(String emojiId)
deleteEmoji
in interface EmojiApi
emojiId
- public ApiResponse<Emoji> getEmoji(String emojiId)
public ApiResponse<Object> getEmojiImage(String emojiId)
getEmojiImage
in interface EmojiApi
emojiId
- public ApiResponse<Reaction> saveReaction(Reaction reaction)
saveReaction
in interface ReactionApi
reaction
- public ApiResponse<List<Reaction>> getReactions(String postId)
getReactions
in interface ReactionApi
postId
- public ApiResponse<Boolean> deleteReaction(Reaction reaction)
deleteReaction
in interface ReactionApi
reaction
- Copyright © 2018. All rights reserved.