Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- mmLogin :: ConnectionData -> Login -> IO (Either LoginFailureException (Session, User))
- mmInitialUser :: ConnectionData -> UsersCreate -> IO User
- mmGetChannelMembersForUser :: UserParam -> TeamId -> Session -> IO (Seq ChannelMember)
- mmGetChannelsForUser :: UserParam -> TeamId -> Session -> IO (Seq Channel)
- mmViewChannel :: UserParam -> ChannelId -> Maybe ChannelId -> Session -> IO ()
- mmCreateGroupMessageChannel :: Seq UserId -> Session -> IO Channel
- mmGetUnreadMessages :: UserParam -> ChannelId -> Session -> IO ChannelUnread
- mmGetListOfChannelsByIds :: TeamId -> Seq ChannelId -> Session -> IO (Seq Channel)
- mmPatchChannel :: ChannelId -> ChannelPatch -> Session -> IO Channel
- mmCreateDirectMessageChannel :: (UserId, UserId) -> Session -> IO Channel
- mmGetChannelStatistics :: ChannelId -> Session -> IO ChannelStats
- mmAddUser :: ChannelId -> MinChannelMember -> Session -> IO ChannelMember
- mmCreateChannel :: MinChannel -> Session -> IO Channel
- mmGetChannelByName :: TeamId -> Text -> Session -> IO Channel
- mmGetChannel :: ChannelId -> Session -> IO Channel
- mmDeleteChannel :: ChannelId -> Session -> IO ()
- mmGetChannelMember :: ChannelId -> UserParam -> Session -> IO ChannelMember
- mmRemoveUserFromChannel :: ChannelId -> UserParam -> Session -> IO ()
- mmExecuteCommand :: MinCommand -> Session -> IO CommandResponse
- mmGetFile :: FileId -> Session -> IO ByteString
- mmUploadFile :: ChannelId -> String -> ByteString -> Session -> IO UploadResponse
- mmGetMetadataForFile :: FileId -> Session -> IO FileInfo
- mmCreatePost :: RawPost -> Session -> IO Post
- mmSearchForTeamPosts :: TeamId -> SearchPosts -> Session -> IO Posts
- mmGetThread :: PostId -> Session -> IO Posts
- mmUpdatePost :: PostId -> PostUpdate -> Session -> IO Post
- mmGetPost :: PostId -> Session -> IO Post
- mmDeletePost :: PostId -> Session -> IO ()
- data FlaggedPostsQuery = FlaggedPostsQuery {}
- defaultFlaggedPostsQuery :: FlaggedPostsQuery
- mmGetListOfFlaggedPosts :: UserParam -> FlaggedPostsQuery -> Session -> IO Posts
- mmPatchPost :: PostId -> PostUpdate -> Session -> IO Post
- data PostQuery = PostQuery {}
- defaultPostQuery :: PostQuery
- postQueryToQueryString :: PostQuery -> String
- mmGetPostsForChannel :: ChannelId -> PostQuery -> Session -> IO Posts
- mmGetSpecificUserPreference :: UserParam -> Text -> Text -> Session -> IO Preference
- mmSaveUsersPreferences :: UserParam -> Seq Preference -> Session -> IO ()
- mmGetUsersPreferences :: UserParam -> Session -> IO (Seq Preference)
- mmDeleteUsersPreferences :: UserParam -> Seq Preference -> Session -> IO ()
- mmListUsersPreferencesByCategory :: UserParam -> Text -> Session -> IO (Seq Preference)
- mmGetReactionsForPost :: PostId -> Session -> IO (Seq Reaction)
- mmGetUserStatusByIds :: Seq UserId -> Session -> IO (Seq Status)
- mmGetClientConfiguration :: Maybe Text -> Session -> IO ClientConfig
- mmUpdateConfiguration :: ServerConfig -> Session -> IO ServerConfig
- mmGetConfiguration :: Session -> IO ServerConfig
- mmGetTeamMember :: TeamId -> UserParam -> Session -> IO TeamMember
- mmRemoveUserFromTeam :: TeamId -> UserParam -> Session -> IO ()
- mmGetPublicChannels :: TeamId -> Maybe Int -> Maybe Int -> Session -> IO (Seq Channel)
- mmCreateTeam :: TeamsCreate -> Session -> IO Team
- mmGetTeams :: Maybe Integer -> Maybe Integer -> Session -> IO (Seq Team)
- mmSearchTeams :: Text -> Session -> IO (Seq Team)
- mmSearchChannels :: TeamId -> Text -> Session -> IO (Seq Channel)
- mmGetUsersTeams :: UserParam -> Session -> IO (Seq Team)
- mmGetTeamMembersByIds :: TeamId -> Seq UserId -> Session -> IO (Seq TeamMember)
- mmGetTeamMembersForUser :: UserParam -> Session -> IO (Seq TeamMember)
- mmAddUserToTeam :: TeamId -> TeamMember -> Session -> IO TeamMember
- mmGetTeamByName :: Text -> Session -> IO Team
- mmGetTeam :: TeamId -> Session -> IO Team
- mmSearchUsers :: UserSearch -> Session -> IO (Seq User)
- mmGetUsersByUsernames :: Seq Text -> Session -> IO (Seq User)
- mmUpdateUsersRoles :: UserId -> Text -> Session -> IO ()
- mmGetUsersByIds :: Seq UserId -> Session -> IO (Seq User)
- mmGetUser :: UserParam -> Session -> IO User
- mmDeactivateUserAccount :: UserParam -> Session -> IO ()
- mmCreateUser :: UsersCreate -> Session -> IO User
- data UserQuery = UserQuery {}
- defaultUserQuery :: UserQuery
- data UserQuerySort
- userQueryToQueryString :: UserQuery -> String
- mmGetUsers :: UserQuery -> Session -> IO (Seq User)
- mmAutocompleteUsers :: Maybe TeamId -> Maybe ChannelId -> Text -> Session -> IO UserAutocomplete
- mmAutocompleteChannels :: TeamId -> Text -> Session -> IO (Seq Channel)
- mmGetUserStatus :: UserParam -> Session -> IO Text
- getUserStatusesByIds :: Seq UserId -> Session -> IO (HashMap UserId Text)
- data UserAutocomplete = UserAutocomplete {}
- data UploadResponse = UploadResponse {}
- mmFlagPost :: UserId -> PostId -> Session -> IO ()
- mmUnflagPost :: UserId -> PostId -> Session -> IO ()
Documentation
mmLogin :: ConnectionData -> Login -> IO (Either LoginFailureException (Session, User)) Source #
mmInitialUser :: ConnectionData -> UsersCreate -> IO User Source #
Endpoints
Brand
Channels
mmGetChannelMembersForUser :: UserParam -> TeamId -> Session -> IO (Seq ChannelMember) Source #
Get all channel members on a team for a user.
Permissions: Logged in as the user and view_team
permission for
the team. Having manage_system
permission voids the previous
requirements.
mmGetChannelsForUser :: UserParam -> TeamId -> Session -> IO (Seq Channel) Source #
Get all the channels on a team for a user.
Permissions: Logged in as the user, or have edit_other_users
permission, and view_team
permission for the team.
mmViewChannel :: UserParam -> ChannelId -> Maybe ChannelId -> Session -> IO () Source #
Perform all the actions involved in viewing a channel. This includes marking channels as read, clearing push notifications, and updating the active channel.
Permissions: Must be logged in as user or have edit_other_users
permission.
mmCreateGroupMessageChannel :: Seq UserId -> Session -> IO Channel Source #
Create a new group message channel to group of users. If the logged in user's id is not included in the list, it will be appended to the end.
Permissions: Must have create_group_channel
permission.
mmGetUnreadMessages :: UserParam -> ChannelId -> Session -> IO ChannelUnread Source #
Get the total unread messages and mentions for a channel for a user.
Permissions: Must be logged in as user and have the read_channel
permission, or have edit_other_usrs
permission.
mmGetListOfChannelsByIds :: TeamId -> Seq ChannelId -> Session -> IO (Seq Channel) Source #
Get a list of public channels on a team by id.
Permissions: view_team
for the team the channels are on.
mmPatchChannel :: ChannelId -> ChannelPatch -> Session -> IO Channel Source #
Partially update a channel by providing only the fields you want to update. Omitted fields will not be updated. The fields that can be updated are defined in the request body, all other provided fields will be ignored.
Permissions: If updating a public channel,
manage_public_channel_members
permission is required. If updating a
private channel, manage_private_channel_members
permission is
required.
mmCreateDirectMessageChannel :: (UserId, UserId) -> Session -> IO Channel Source #
Create a new direct message channel between two users.
Permissions: Must be one of the two users and have
create_direct_channel
permission. Having the manage_system
permission voids the previous requirements.
mmGetChannelStatistics :: ChannelId -> Session -> IO ChannelStats Source #
Get statistics for a channel.
Permissions: Must have the read_channel
permission.
mmAddUser :: ChannelId -> MinChannelMember -> Session -> IO ChannelMember Source #
Add a user to the channel.
mmCreateChannel :: MinChannel -> Session -> IO Channel Source #
Create a new channel.
Permissions: If creating a public channel, create_public_channel
permission is required. If creating a private channel,
create_private_channel
permission is required.
mmGetChannelByName :: TeamId -> Text -> Session -> IO Channel Source #
Gets channel from the provided team id and channel name strings.
Permissions: read_channel
permission for the channel.
mmGetChannel :: ChannelId -> Session -> IO Channel Source #
Get channel from the provided channel id string.
Permissions: read_channel
permission for the channel.
mmDeleteChannel :: ChannelId -> Session -> IO () Source #
Delete a channel based from provided channel id string.
Permissions: delete_public_channel
permission if the channel is
public,
delete_private_channel
permission if the channel is private,
or have manage_system
permission.
mmGetChannelMember :: ChannelId -> UserParam -> Session -> IO ChannelMember Source #
Get a channel member.
Permissions: read_channel
permission for the channel.
mmRemoveUserFromChannel :: ChannelId -> UserParam -> Session -> IO () Source #
Delete a channel member, effectively removing them from a channel.
Permissions: manage_public_channel_members
permission if the
channel is public.
manage_private_channel_members
permission if the channel is private.
Cluster
Commands
mmExecuteCommand :: MinCommand -> Session -> IO CommandResponse Source #
Execute a command on a team.
Permissions: Must have use_slash_commands
permission for the team
the command is in.
Compliance
Elasticsearch
Emoji
Files
mmGetFile :: FileId -> Session -> IO ByteString Source #
Gets a file that has been uploaded previously.
Permissions: Must have read_channel
permission or be uploader of
the file.
mmUploadFile :: ChannelId -> String -> ByteString -> Session -> IO UploadResponse Source #
Uploads a file that can later be attached to a post.
Permissions: Must have upload_file
permission.
mmGetMetadataForFile :: FileId -> Session -> IO FileInfo Source #
Gets a file's info.
Permissions: Must have read_channel
permission or be uploader of
the file.
Jobs
LDAP
OAuth
Posts
mmCreatePost :: RawPost -> Session -> IO Post Source #
Create a new post in a channel. To create the post as a comment on
another post, provide root_id
.
Permissions: Must have create_post
permission for the channel the
post is being created in.
mmSearchForTeamPosts :: TeamId -> SearchPosts -> Session -> IO Posts Source #
Search posts in the team and from the provided terms string.
Permissions: Must be authenticated and have the view_team
permission.
mmGetThread :: PostId -> Session -> IO Posts Source #
Get a post and the rest of the posts in the same thread.
Permissions: Must have read_channel
permission for the channel the
post is in or if the channel is public, have the
read_public_channels
permission for the team.
mmUpdatePost :: PostId -> PostUpdate -> Session -> IO Post Source #
Update a post. Only the fields listed below are updatable, omitted fields will be treated as blank.
Permissions: Must have edit_post
permission for the channel the
post is in.
mmGetPost :: PostId -> Session -> IO Post Source #
Get a single post.
Permissions: Must have read_channel
permission for the channel the
post is in or if the channel is public, have the
read_public_channels
permission for the team.
mmDeletePost :: PostId -> Session -> IO () Source #
Soft deletes a post, by marking the post as deleted in the database. Soft deleted posts will not be returned in post queries.
Permissions: Must be logged in as the user or have
delete_others_posts
permission.
data FlaggedPostsQuery Source #
mmGetListOfFlaggedPosts :: UserParam -> FlaggedPostsQuery -> Session -> IO Posts Source #
Get a page of flagged posts of a user provided user id string. Selects from a channel, team or all flagged posts by a user.
Permissions: Must be user or have manage_system
permission.
mmPatchPost :: PostId -> PostUpdate -> Session -> IO Post Source #
Partially update a post by providing only the fields you want to update. Omitted fields will not be updated. The fields that can be updated are defined in the request body, all other provided fields will be ignored.
Permissions: Must have the edit_post
permission.
mmGetPostsForChannel :: ChannelId -> PostQuery -> Session -> IO Posts Source #
Get a page of posts in a channel. Use the query parameters to modify
the behaviour of this endpoint. The parameters since
, before
and
after
must not be used together.
Permissions: Must have read_channel
permission for the channel.
Preferences
mmGetSpecificUserPreference :: UserParam -> Text -> Text -> Session -> IO Preference Source #
Gets a single preference for the current user with the given category and name.
Permissions: Must be logged in as the user being updated or have the
edit_other_users
permission.
mmSaveUsersPreferences :: UserParam -> Seq Preference -> Session -> IO () Source #
Save a list of the user's preferences.
Permissions: Must be logged in as the user being updated or have the
edit_other_users
permission.
mmGetUsersPreferences :: UserParam -> Session -> IO (Seq Preference) Source #
Get a list of the user's preferences.
Permissions: Must be logged in as the user being updated or have the
edit_other_users
permission.
mmDeleteUsersPreferences :: UserParam -> Seq Preference -> Session -> IO () Source #
Delete a list of the user's preferences.
Permissions: Must be logged in as the user being updated or have the
edit_other_users
permission.
mmListUsersPreferencesByCategory :: UserParam -> Text -> Session -> IO (Seq Preference) Source #
Lists the current user's stored preferences in the given category.
Permissions: Must be logged in as the user being updated or have the
edit_other_users
permission.
Reactions
SAML
Statuses
System
mmGetClientConfiguration :: Maybe Text -> Session -> IO ClientConfig Source #
Get a subset of the server configuration needed by the client.
Permissions: No permission required.
mmUpdateConfiguration :: ServerConfig -> Session -> IO ServerConfig Source #
Submit a new configuration for the server to use.
Permissions: Must have manage_system
permission.
mmGetConfiguration :: Session -> IO ServerConfig Source #
Retrieve the current server configuration
Permissions: Must have manage_system
permission.
Teams
mmGetTeamMember :: TeamId -> UserParam -> Session -> IO TeamMember Source #
Get a team member on the system.
Permissions: Must be authenticated and have the view_team
permission.
mmRemoveUserFromTeam :: TeamId -> UserParam -> Session -> IO () Source #
Delete the team member object for a user, effectively removing them from a team.
Permissions: Must be logged in as the user or have the
remove_user_from_team
permission.
mmGetPublicChannels :: TeamId -> Maybe Int -> Maybe Int -> Session -> IO (Seq Channel) Source #
Get a page of public channels on a team based on query string parameters - page and per_page.
Permissions: Must be authenticated and have the list_team_channels
permission.
mmCreateTeam :: TeamsCreate -> Session -> IO Team Source #
Create a new team on the system.
Permissions: Must be authenticated and have the create_team
permission.
mmGetTeams :: Maybe Integer -> Maybe Integer -> Session -> IO (Seq Team) Source #
For regular users only returns open teams. Users with the "manage_system" permission will return teams regardless of type. The result is based on query string parameters - page and per_page.
Permissions: Must be authenticated. "manage_system" permission is required to show all teams.
mmSearchTeams :: Text -> Session -> IO (Seq Team) Source #
Search teams based on search term provided in the request body.
Permissions: Logged in user only shows open teams
Logged in user with "manage_system" permission shows all teams
mmSearchChannels :: TeamId -> Text -> Session -> IO (Seq Channel) Source #
Search public channels on a team based on the search term provided in the request body.
Permissions: Must have the list_team_channels
permission.
mmGetUsersTeams :: UserParam -> Session -> IO (Seq Team) Source #
Get a list of teams that a user is on.
Permissions: Must be authenticated as the user or have the
manage_system
permission.
mmGetTeamMembersByIds :: TeamId -> Seq UserId -> Session -> IO (Seq TeamMember) Source #
Get a list of team members based on a provided array of user ids.
Permissions: Must have view_team
permission for the team.
mmGetTeamMembersForUser :: UserParam -> Session -> IO (Seq TeamMember) Source #
Get a list of team members for a user. Useful for getting the ids of teams the user is on and the roles they have in those teams.
Permissions: Must be logged in as the user or have the
edit_other_users
permission.
mmAddUserToTeam :: TeamId -> TeamMember -> Session -> IO TeamMember Source #
Add user to the team by user_id.
Permissions: Must be authenticated and team be open to add self. For
adding another user, authenticated user must have the
add_user_to_team
permission.
mmGetTeamByName :: Text -> Session -> IO Team Source #
Get a team based on provided name string
Permissions: Must be authenticated, team type is open and have the
view_team
permission.
mmGetTeam :: TeamId -> Session -> IO Team Source #
Get a team on the system.
Permissions: Must be authenticated and have the view_team
permission.
Users
mmSearchUsers :: UserSearch -> Session -> IO (Seq User) Source #
Get a list of users based on search criteria provided in the request body. Searches are typically done against username, full name, nickname and email unless otherwise configured by the server.
Permissions: Requires an active session and read_channel
and/or
view_team
permissions for any channels or teams specified in the
request body.
mmGetUsersByUsernames :: Seq Text -> Session -> IO (Seq User) Source #
Get a list of users based on a provided list of usernames.
Permissions: Requires an active session but no other permissions.
mmUpdateUsersRoles :: UserId -> Text -> Session -> IO () Source #
Update a user's system-level roles. Valid user roles are "system_user", "system_admin" or both of them. Overwrites any previously assigned system-level roles.
Permissions: Must have the manage_roles
permission.
mmGetUsersByIds :: Seq UserId -> Session -> IO (Seq User) Source #
Get a list of users based on a provided list of user ids.
Permissions: Requires an active session but no other permissions.
mmGetUser :: UserParam -> Session -> IO User Source #
Get a user a object. Sensitive information will be sanitized out.
Permissions: Requires an active session but no other permissions.
mmDeactivateUserAccount :: UserParam -> Session -> IO () Source #
Deactivates the user by archiving its user object.
Permissions: Must be logged in as the user being deactivated or have
the edit_other_users
permission.
mmCreateUser :: UsersCreate -> Session -> IO User Source #
Create a new user on the system.
Permissions: No permission required but user creation can be controlled by server configuration.
mmGetUsers :: UserQuery -> Session -> IO (Seq User) Source #
Get a page of a list of users. Based on query string parameters, select users from a team, channel, or select users not in a specific channel.
Since server version 4.0, some basic sorting is available using the
sort
query parameter. Sorting is currently only supported when
selecting users on a team.
Permissions: Requires an active session and (if specified) membership to the channel or team being selected from.
mmAutocompleteUsers :: Maybe TeamId -> Maybe ChannelId -> Text -> Session -> IO UserAutocomplete Source #
Get a list of users for the purpose of autocompleting based on the
provided search term. Specify a combination of team_id
and
channel_id
to filter results further.
Permissions: Requires an active session and view_team
and
read_channel
on any teams or channels used to filter the results
further.
mmAutocompleteChannels :: TeamId -> Text -> Session -> IO (Seq Channel) Source #
Get a list of channels for the purpose of autocompleting based on the provided search term.
Webhooks
User Statuses
data UserAutocomplete Source #
UserAutocomplete | |
|
Instances
Eq UserAutocomplete Source # | |
Defined in Network.Mattermost.Endpoints (==) :: UserAutocomplete -> UserAutocomplete -> Bool # (/=) :: UserAutocomplete -> UserAutocomplete -> Bool # | |
Read UserAutocomplete Source # | |
Defined in Network.Mattermost.Endpoints | |
Show UserAutocomplete Source # | |
Defined in Network.Mattermost.Endpoints showsPrec :: Int -> UserAutocomplete -> ShowS # show :: UserAutocomplete -> String # showList :: [UserAutocomplete] -> ShowS # | |
ToJSON UserAutocomplete Source # | |
Defined in Network.Mattermost.Endpoints toJSON :: UserAutocomplete -> Value # toEncoding :: UserAutocomplete -> Encoding # toJSONList :: [UserAutocomplete] -> Value # toEncodingList :: [UserAutocomplete] -> Encoding # | |
FromJSON UserAutocomplete Source # | |
Defined in Network.Mattermost.Endpoints parseJSON :: Value -> Parser UserAutocomplete # parseJSONList :: Value -> Parser [UserAutocomplete] # |
data UploadResponse Source #
UploadResponse | |
|
Instances
Eq UploadResponse Source # | |
Defined in Network.Mattermost.Endpoints (==) :: UploadResponse -> UploadResponse -> Bool # (/=) :: UploadResponse -> UploadResponse -> Bool # | |
Read UploadResponse Source # | |
Defined in Network.Mattermost.Endpoints readsPrec :: Int -> ReadS UploadResponse # readList :: ReadS [UploadResponse] # | |
Show UploadResponse Source # | |
Defined in Network.Mattermost.Endpoints showsPrec :: Int -> UploadResponse -> ShowS # show :: UploadResponse -> String # showList :: [UploadResponse] -> ShowS # | |
ToJSON UploadResponse Source # | |
Defined in Network.Mattermost.Endpoints toJSON :: UploadResponse -> Value # toEncoding :: UploadResponse -> Encoding # toJSONList :: [UploadResponse] -> Value # toEncodingList :: [UploadResponse] -> Encoding # | |
FromJSON UploadResponse Source # | |
Defined in Network.Mattermost.Endpoints parseJSON :: Value -> Parser UploadResponse # parseJSONList :: Value -> Parser [UploadResponse] # |
Helpers
mmFlagPost :: UserId -> PostId -> Session -> IO () Source #
Add a post to a user's flagged post list. This is a convenience
wrapper for the mmSaveUsersPreferences
function.
Permissions: Must be logged in as the user being updated or have the
edit_other_users
permission.
mmUnflagPost :: UserId -> PostId -> Session -> IO () Source #
Remove a post from a user's flagged post list. This is a convenience
wrapper for the mmSaveUsersPreferences
function.
Permissions: Must be logged in as the user being updated or have the
edit_other_users
permission.