mattermost-api-50200.5.0: Client API for Mattermost chat system

Safe HaskellNone
LanguageHaskell2010

Network.Mattermost

Contents

Synopsis

Types

Mattermost-Related Types (deprecated: use Network.Mattermost.Types instead)

data Login Source #

Constructors

Login 

Fields

Instances
ToJSON Login Source # 
Instance details

Defined in Network.Mattermost.Types

type Port = Int Source #

newtype Id Source #

Constructors

Id 

Fields

Instances
Eq Id Source # 
Instance details

Defined in Network.Mattermost.Types

Methods

(==) :: Id -> Id -> Bool #

(/=) :: Id -> Id -> Bool #

Ord Id Source # 
Instance details

Defined in Network.Mattermost.Types

Methods

compare :: Id -> Id -> Ordering #

(<) :: Id -> Id -> Bool #

(<=) :: Id -> Id -> Bool #

(>) :: Id -> Id -> Bool #

(>=) :: Id -> Id -> Bool #

max :: Id -> Id -> Id #

min :: Id -> Id -> Id #

Read Id Source # 
Instance details

Defined in Network.Mattermost.Types

Show Id Source # 
Instance details

Defined in Network.Mattermost.Types

Methods

showsPrec :: Int -> Id -> ShowS #

show :: Id -> String #

showList :: [Id] -> ShowS #

Hashable Id Source # 
Instance details

Defined in Network.Mattermost.Types

Methods

hashWithSalt :: Int -> Id -> Int #

hash :: Id -> Int #

ToJSON Id Source # 
Instance details

Defined in Network.Mattermost.Types

ToJSONKey Id Source # 
Instance details

Defined in Network.Mattermost.Types

FromJSON Id Source # 
Instance details

Defined in Network.Mattermost.Types

FromJSONKey Id Source # 
Instance details

Defined in Network.Mattermost.Types

IsId Id Source # 
Instance details

Defined in Network.Mattermost.Types

Methods

toId :: Id -> Id Source #

fromId :: Id -> Id Source #

HasId Id Id Source # 
Instance details

Defined in Network.Mattermost.Types

Methods

getId :: Id -> Id Source #

data User Source #

Instances
Eq User Source # 
Instance details

Defined in Network.Mattermost.Types

Methods

(==) :: User -> User -> Bool #

(/=) :: User -> User -> Bool #

Read User Source # 
Instance details

Defined in Network.Mattermost.Types

Show User Source # 
Instance details

Defined in Network.Mattermost.Types

Methods

showsPrec :: Int -> User -> ShowS #

show :: User -> String #

showList :: [User] -> ShowS #

ToJSON User Source # 
Instance details

Defined in Network.Mattermost.Types

FromJSON User Source # 
Instance details

Defined in Network.Mattermost.Types

HasId User UserId Source # 
Instance details

Defined in Network.Mattermost.Types

Methods

getId :: User -> UserId Source #

newtype UserId Source #

Constructors

UI 

Fields

Instances
Eq UserId Source # 
Instance details

Defined in Network.Mattermost.Types

Methods

(==) :: UserId -> UserId -> Bool #

(/=) :: UserId -> UserId -> Bool #

Ord UserId Source # 
Instance details

Defined in Network.Mattermost.Types

Read UserId Source # 
Instance details

Defined in Network.Mattermost.Types

Show UserId Source # 
Instance details

Defined in Network.Mattermost.Types

Hashable UserId Source # 
Instance details

Defined in Network.Mattermost.Types

Methods

hashWithSalt :: Int -> UserId -> Int #

hash :: UserId -> Int #

ToJSON UserId Source # 
Instance details

Defined in Network.Mattermost.Types

ToJSONKey UserId Source # 
Instance details

Defined in Network.Mattermost.Types

FromJSON UserId Source # 
Instance details

Defined in Network.Mattermost.Types

FromJSONKey UserId Source # 
Instance details

Defined in Network.Mattermost.Types

PrintfArg UserId Source # 
Instance details

Defined in Network.Mattermost.Types

IsId UserId Source # 
Instance details

Defined in Network.Mattermost.Types

Methods

toId :: UserId -> Id Source #

fromId :: Id -> UserId Source #

HasId User UserId Source # 
Instance details

Defined in Network.Mattermost.Types

Methods

getId :: User -> UserId Source #

data Team Source #

Instances
Eq Team Source # 
Instance details

Defined in Network.Mattermost.Types

Methods

(==) :: Team -> Team -> Bool #

(/=) :: Team -> Team -> Bool #

Ord Team Source # 
Instance details

Defined in Network.Mattermost.Types

Methods

compare :: Team -> Team -> Ordering #

(<) :: Team -> Team -> Bool #

(<=) :: Team -> Team -> Bool #

(>) :: Team -> Team -> Bool #

(>=) :: Team -> Team -> Bool #

max :: Team -> Team -> Team #

min :: Team -> Team -> Team #

Read Team Source # 
Instance details

Defined in Network.Mattermost.Types

Show Team Source # 
Instance details

Defined in Network.Mattermost.Types

Methods

showsPrec :: Int -> Team -> ShowS #

show :: Team -> String #

showList :: [Team] -> ShowS #

ToJSON Team Source # 
Instance details

Defined in Network.Mattermost.Types

FromJSON Team Source # 
Instance details

Defined in Network.Mattermost.Types

HasId Team TeamId Source # 
Instance details

Defined in Network.Mattermost.Types

Methods

getId :: Team -> TeamId Source #

data TeamMember Source #

data Type Source #

Instances
Eq Type Source # 
Instance details

Defined in Network.Mattermost.Types

Methods

(==) :: Type -> Type -> Bool #

(/=) :: Type -> Type -> Bool #

Ord Type Source # 
Instance details

Defined in Network.Mattermost.Types

Methods

compare :: Type -> Type -> Ordering #

(<) :: Type -> Type -> Bool #

(<=) :: Type -> Type -> Bool #

(>) :: Type -> Type -> Bool #

(>=) :: Type -> Type -> Bool #

max :: Type -> Type -> Type #

min :: Type -> Type -> Type #

Read Type Source # 
Instance details

Defined in Network.Mattermost.Types

Show Type Source # 
Instance details

Defined in Network.Mattermost.Types

Methods

showsPrec :: Int -> Type -> ShowS #

show :: Type -> String #

showList :: [Type] -> ShowS #

ToJSON Type Source # 
Instance details

Defined in Network.Mattermost.Types

FromJSON Type Source # 
Instance details

Defined in Network.Mattermost.Types

newtype TeamId Source #

Constructors

TI 

Fields

Instances
Eq TeamId Source # 
Instance details

Defined in Network.Mattermost.Types

Methods

(==) :: TeamId -> TeamId -> Bool #

(/=) :: TeamId -> TeamId -> Bool #

Ord TeamId Source # 
Instance details

Defined in Network.Mattermost.Types

Read TeamId Source # 
Instance details

Defined in Network.Mattermost.Types

Show TeamId Source # 
Instance details

Defined in Network.Mattermost.Types

Hashable TeamId Source # 
Instance details

Defined in Network.Mattermost.Types

Methods

hashWithSalt :: Int -> TeamId -> Int #

hash :: TeamId -> Int #

ToJSON TeamId Source # 
Instance details

Defined in Network.Mattermost.Types

ToJSONKey TeamId Source # 
Instance details

Defined in Network.Mattermost.Types

FromJSON TeamId Source # 
Instance details

Defined in Network.Mattermost.Types

FromJSONKey TeamId Source # 
Instance details

Defined in Network.Mattermost.Types

PrintfArg TeamId Source # 
Instance details

Defined in Network.Mattermost.Types

IsId TeamId Source # 
Instance details

Defined in Network.Mattermost.Types

Methods

toId :: TeamId -> Id Source #

fromId :: Id -> TeamId Source #

HasId Team TeamId Source # 
Instance details

Defined in Network.Mattermost.Types

Methods

getId :: Team -> TeamId Source #

data Channel Source #

newtype ChannelId Source #

Constructors

CI 

Fields

Instances
Eq ChannelId Source # 
Instance details

Defined in Network.Mattermost.Types

Ord ChannelId Source # 
Instance details

Defined in Network.Mattermost.Types

Read ChannelId Source # 
Instance details

Defined in Network.Mattermost.Types

Show ChannelId Source # 
Instance details

Defined in Network.Mattermost.Types

Hashable ChannelId Source # 
Instance details

Defined in Network.Mattermost.Types

ToJSON ChannelId Source # 
Instance details

Defined in Network.Mattermost.Types

ToJSONKey ChannelId Source # 
Instance details

Defined in Network.Mattermost.Types

FromJSON ChannelId Source # 
Instance details

Defined in Network.Mattermost.Types

FromJSONKey ChannelId Source # 
Instance details

Defined in Network.Mattermost.Types

PrintfArg ChannelId Source # 
Instance details

Defined in Network.Mattermost.Types

IsId ChannelId Source # 
Instance details

Defined in Network.Mattermost.Types

HasId ChannelData ChannelId Source # 
Instance details

Defined in Network.Mattermost.Types

HasId Channel ChannelId Source # 
Instance details

Defined in Network.Mattermost.Types

newtype PostId Source #

Constructors

PI 

Fields

Instances
Eq PostId Source # 
Instance details

Defined in Network.Mattermost.Types

Methods

(==) :: PostId -> PostId -> Bool #

(/=) :: PostId -> PostId -> Bool #

Ord PostId Source # 
Instance details

Defined in Network.Mattermost.Types

Read PostId Source # 
Instance details

Defined in Network.Mattermost.Types

Show PostId Source # 
Instance details

Defined in Network.Mattermost.Types

Hashable PostId Source # 
Instance details

Defined in Network.Mattermost.Types

Methods

hashWithSalt :: Int -> PostId -> Int #

hash :: PostId -> Int #

ToJSON PostId Source # 
Instance details

Defined in Network.Mattermost.Types

ToJSONKey PostId Source # 
Instance details

Defined in Network.Mattermost.Types

FromJSON PostId Source # 
Instance details

Defined in Network.Mattermost.Types

FromJSONKey PostId Source # 
Instance details

Defined in Network.Mattermost.Types

PrintfArg PostId Source # 
Instance details

Defined in Network.Mattermost.Types

IsId PostId Source # 
Instance details

Defined in Network.Mattermost.Types

Methods

toId :: PostId -> Id Source #

fromId :: Id -> PostId Source #

HasId Post PostId Source # 
Instance details

Defined in Network.Mattermost.Types

Methods

getId :: Post -> PostId Source #

newtype FileId Source #

Constructors

FI 

Fields

Instances
Eq FileId Source # 
Instance details

Defined in Network.Mattermost.Types

Methods

(==) :: FileId -> FileId -> Bool #

(/=) :: FileId -> FileId -> Bool #

Ord FileId Source # 
Instance details

Defined in Network.Mattermost.Types

Read FileId Source # 
Instance details

Defined in Network.Mattermost.Types

Show FileId Source # 
Instance details

Defined in Network.Mattermost.Types

Hashable FileId Source # 
Instance details

Defined in Network.Mattermost.Types

Methods

hashWithSalt :: Int -> FileId -> Int #

hash :: FileId -> Int #

ToJSON FileId Source # 
Instance details

Defined in Network.Mattermost.Types

ToJSONKey FileId Source # 
Instance details

Defined in Network.Mattermost.Types

FromJSON FileId Source # 
Instance details

Defined in Network.Mattermost.Types

FromJSONKey FileId Source # 
Instance details

Defined in Network.Mattermost.Types

PrintfArg FileId Source # 
Instance details

Defined in Network.Mattermost.Types

IsId FileId Source # 
Instance details

Defined in Network.Mattermost.Types

Methods

toId :: FileId -> Id Source #

fromId :: Id -> FileId Source #

data Posts Source #

Constructors

Posts 
Instances
Eq Posts Source # 
Instance details

Defined in Network.Mattermost.Types

Methods

(==) :: Posts -> Posts -> Bool #

(/=) :: Posts -> Posts -> Bool #

Read Posts Source # 
Instance details

Defined in Network.Mattermost.Types

Show Posts Source # 
Instance details

Defined in Network.Mattermost.Types

Methods

showsPrec :: Int -> Posts -> ShowS #

show :: Posts -> String #

showList :: [Posts] -> ShowS #

FromJSON Posts Source # 
Instance details

Defined in Network.Mattermost.Types

data PreferenceCategory Source #

Log-related types

type Logger = LogEvent -> IO () Source #

A Logger is any function which responds to log events:

data LogEvent Source #

If there is a Logger in the ConnectionData struct, it will be sporadically called with values of type LogEvent.

Instances
Eq LogEvent Source # 
Instance details

Defined in Network.Mattermost.Types.Base

Show LogEvent Source # 
Instance details

Defined in Network.Mattermost.Types.Base

data LogEventType Source #

A LogEventType describes the particular event that happened

Constructors

HttpRequest RequestMethod String (Maybe Value) 
HttpResponse Int String (Maybe Value) 
WebSocketRequest Value 
WebSocketResponse (Either String Value)

Left means we got an exception trying to parse the response; Right means we succeeded and here it is.

WebSocketPing 
WebSocketPong 

Typeclasses

class HasId x y | x -> y where Source #

Methods

getId :: x -> y Source #

Instances
HasId Command CommandId Source # 
Instance details

Defined in Network.Mattermost.Types

HasId PendingPost PendingPostId Source # 
Instance details

Defined in Network.Mattermost.Types

HasId Post PostId Source # 
Instance details

Defined in Network.Mattermost.Types

Methods

getId :: Post -> PostId Source #

HasId User UserId Source # 
Instance details

Defined in Network.Mattermost.Types

Methods

getId :: User -> UserId Source #

HasId ChannelData ChannelId Source # 
Instance details

Defined in Network.Mattermost.Types

HasId Channel ChannelId Source # 
Instance details

Defined in Network.Mattermost.Types

HasId Team TeamId Source # 
Instance details

Defined in Network.Mattermost.Types

Methods

getId :: Team -> TeamId Source #

HasId Id Id Source # 
Instance details

Defined in Network.Mattermost.Types

Methods

getId :: Id -> Id Source #

HTTP API Functions

mkConnectionData :: Hostname -> Port -> Text -> Pool MMConn -> ConnectionType -> ConnectionContext -> ConnectionData Source #

Creates a structure representing a connection to the server.

mmLogin :: ConnectionData -> Login -> IO (Either LoginFailureException (Session, User)) Source #

Fire off a login attempt. Note: We get back more than just the auth token. We also get all the server-side configuration data for the user.

route: /api/v3/users/login

mmCreateDirect :: Session -> TeamId -> UserId -> IO Channel Source #

route: /api/v3/teams/{team_id}/channels/create_direct

mmCreateChannel :: Session -> TeamId -> MinChannel -> IO Channel Source #

route: /api/v3/teams/{team_id}/channels/create

mmCreateGroupChannel :: Session -> [UserId] -> IO Channel Source #

Create a group channel containing the specified users in addition to the user making the request.

mmCreateTeam :: Session -> TeamsCreate -> IO Team Source #

route: /api/v3/teams/create

mmDeleteChannel :: Session -> TeamId -> ChannelId -> IO () Source #

route: /api/v3/teams/{team_id}/channels/{channel_id}/delete

mmLeaveChannel :: Session -> TeamId -> ChannelId -> IO () Source #

route: /api/v3/teams/{team_id}/channels/{channel_id}/leave

mmJoinChannel :: Session -> TeamId -> ChannelId -> IO () Source #

route: /api/v3/teams/{team_id}/channels/{channel_id}/join

mmGetTeams :: Session -> IO (HashMap TeamId Team) Source #

Requires an authenticated user. Returns the full list of teams.

route: /api/v3/teams/all

mmGetChannels :: Session -> TeamId -> IO Channels Source #

Requires an authenticated user. Returns the full list of channels for a given team of which the user is a member

route: /api/v3/teams/{team_id}/channels/

mmGetAllChannelDataForUser :: Session -> TeamId -> UserId -> IO (Seq ChannelData) Source #

Get channel/user metadata in bulk.

mmGetMoreChannels :: Session -> TeamId -> Int -> Int -> IO Channels Source #

Requires an authenticated user. Returns the channels for a team of which the user is not already a member

route: /api/v3/teams/{team_id}/channels/more/{offset}/{limit}

mmGetChannel :: Session -> TeamId -> ChannelId -> IO ChannelWithData Source #

Requires an authenticated user. Returns the details of a specific channel.

route: /api/v3/teams/{team_id}/channels/{channel_id}

mmViewChannel Source #

Arguments

:: Session 
-> TeamId 
-> ChannelId

channel to view

-> Maybe ChannelId

previous channel

-> IO () 

route: /api/v3/teams/{team_id}/channels/view

mmDeletePost :: Session -> TeamId -> ChannelId -> PostId -> IO () Source #

route: /api/v3/teams/{team_id}/channels/{channel_id}/posts/{post_id}/delete

mmGetPost :: Session -> TeamId -> ChannelId -> PostId -> IO Posts Source #

route: /api/v3/teams/{team_id}/channels/{channel_id}/posts/{post_id}/get

mmGetPosts :: Session -> TeamId -> ChannelId -> Int -> Int -> IO Posts Source #

route: /api/v3/teams/{team_id}/channels/{channel_id}/posts/page/{offset}/{limit}

mmGetPostsSince :: Session -> TeamId -> ChannelId -> ServerTime -> IO Posts Source #

route: /api/v3/teams/{team_id}/channels/{channel_id}/posts/since/{utc_time}

mmGetPostsBefore :: Session -> TeamId -> ChannelId -> PostId -> Int -> Int -> IO Posts Source #

route: /api/v3/teams/{team_id}/channels/{channel_id}/posts/{post_id}/before/{offset}/{limit}

mmGetPostsAfter :: Session -> TeamId -> ChannelId -> PostId -> Int -> Int -> IO Posts Source #

route: /api/v3/teams/{team_id}/channels/{channel_id}/posts/{post_id}/after/{offset}/{limit}

mmSearchPosts :: Session -> TeamId -> Text -> Bool -> IO Posts Source #

route: /api/v4/teams/{team_id}/posts/search

mmGetReactionsForPost :: Session -> TeamId -> ChannelId -> PostId -> IO [Reaction] Source #

route: /api/v3/teams/{team_id}/channels/{channel_id}/posts/{post_id}/reactions

mmGetFileInfo :: Session -> FileId -> IO FileInfo Source #

route: /api/v3/files/{file_id}/get_info

mmGetFile :: Session -> FileId -> IO ByteString Source #

route: /api/v4/files/{file_id}

mmGetUser :: Session -> UserId -> IO User Source #

route: /api/v3/users/{user_id}/get

mmGetUsers :: Session -> Int -> Int -> IO (HashMap UserId User) Source #

route: /api/v3/users/{offset}/{limit}

mmGetTeamMembers :: Session -> TeamId -> IO (Seq TeamMember) Source #

route: /api/v3/teams/members/{team_id}

mmGetChannelMembers :: Session -> TeamId -> ChannelId -> Int -> Int -> IO (HashMap UserId User) Source #

route: /api/v3/teams/{team_id}/channels/{channel_id}/users/{offset}/{limit}

mmGetProfilesForDMList :: Session -> TeamId -> IO (HashMap UserId User) Source #

route: /api/v3/users/profiles_for_dm_list/{team_id}

mmGetMe :: Session -> IO User Source #

route: /api/v3/users/me

mmGetProfiles :: Session -> TeamId -> Int -> Int -> IO (HashMap UserId User) Source #

route: /api/v3/teams/{team_id}/users/{offset}/{limit}

mmGetStatuses :: Session -> IO (HashMap UserId Text) Source #

route: /api/v3/users/status

mmGetInitialLoad :: Session -> IO InitialLoad Source #

Fire off a login attempt. Note: We get back more than just the auth token. We also get all the server-side configuration data for the user.

route: /api/v3/users/initial_load

mmSetChannelHeader :: Session -> TeamId -> ChannelId -> Text -> IO Channel Source #

route: /api/v3/teams/{team_id}/channels/update_header

mmChannelAddUser :: Session -> TeamId -> ChannelId -> UserId -> IO ChannelData Source #

route: /api/v3/teams/{team_id}/channels/{channel_id}/add

mmChannelRemoveUser :: Session -> ChannelId -> UserId -> IO () Source #

Remove the specified user from the specified channel.

mmTeamAddUser :: Session -> TeamId -> UserId -> IO () Source #

route: /api/v3/teams/{team_id}/add_user_to_team

mmUsersCreate :: ConnectionData -> UsersCreate -> IO User Source #

route: /api/v3/users/create

mmUsersCreateWithSession :: Session -> UsersCreate -> IO User Source #

route: /api/v3/users/create

mmPost :: Session -> TeamId -> PendingPost -> IO Post Source #

route: /api/v3/teams/{team_id}/channels/{channel_id}/posts/create

mmUpdatePost :: Session -> TeamId -> Post -> IO Post Source #

route: /api/v3/teams/{team_id}/channels/{channel_id}/posts/update

mmExecute :: Session -> TeamId -> MinCommand -> IO CommandResponse Source #

route: /api/v3/teams/{team_id}/commands/execute

mmGetConfig :: Session -> IO Value Source #

Get the system configuration. Requires administrative permission.

route: /api/v3/admin/config

mmGetClientConfig :: Session -> IO Value Source #

Get a subset of the server configuration needed by the client. Does not require administrative permission. The format query parameter is currently required with the value of "old".

route: /api/v4/config/client

mmSavePreferences :: Session -> Seq Preference -> IO () Source #

route: /api/v3/preferences/save

mmDeletePreferences :: Session -> Seq Preference -> IO () Source #

route: /api/v3/preferences/save

mmFlagPost :: Session -> UserId -> PostId -> IO () Source #

route: /api/v3/preferences/save

This is a convenience function for a particular use of mmSavePreference

mmUnflagPost :: Session -> UserId -> PostId -> IO () Source #

route: /api/v3/preferences/save

This is a convenience function for a particular use of mmSavePreference

idString :: IsId x => x -> Text Source #

hoistE :: Exception e => Either e r -> IO r Source #

This unwraps an Either value, throwing the contained exception if the Either was a Left value.

noteE :: Exception e => Maybe r -> e -> IO r Source #

This unwraps a Maybe value, throwing a provided exception if the value is Nothing.

assertE :: Exception e => Bool -> e -> IO () Source #

This asserts that the provided Bool is True, throwing a provided exception is the argument was False.