mattermost-api-40800.0.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

type Port = Int Source #

newtype Id Source #

Constructors

Id 

Fields

newtype UserId Source #

Constructors

UI 

Fields

Instances

Eq UserId Source # 

Methods

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

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

Ord UserId Source # 
Read UserId Source # 
Show UserId Source # 
Hashable UserId Source # 

Methods

hashWithSalt :: Int -> UserId -> Int #

hash :: UserId -> Int #

ToJSON UserId Source # 
ToJSONKey UserId Source # 
FromJSON UserId Source # 
FromJSONKey UserId Source # 
PrintfArg UserId Source # 
IsId UserId Source # 

Methods

toId :: UserId -> Id Source #

fromId :: Id -> UserId Source #

HasId User UserId Source # 

Methods

getId :: User -> UserId Source #

newtype TeamId Source #

Constructors

TI 

Fields

Instances

Eq TeamId Source # 

Methods

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

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

Ord TeamId Source # 
Read TeamId Source # 
Show TeamId Source # 
Hashable TeamId Source # 

Methods

hashWithSalt :: Int -> TeamId -> Int #

hash :: TeamId -> Int #

ToJSON TeamId Source # 
ToJSONKey TeamId Source # 
FromJSON TeamId Source # 
FromJSONKey TeamId Source # 
PrintfArg TeamId Source # 
IsId TeamId Source # 

Methods

toId :: TeamId -> Id Source #

fromId :: Id -> TeamId Source #

HasId Team TeamId Source # 

Methods

getId :: Team -> TeamId Source #

newtype ChannelId Source #

Constructors

CI 

Fields

Instances

Eq ChannelId Source # 
Ord ChannelId Source # 
Read ChannelId Source # 
Show ChannelId Source # 
Hashable ChannelId Source # 
ToJSON ChannelId Source # 
ToJSONKey ChannelId Source # 
FromJSON ChannelId Source # 
FromJSONKey ChannelId Source # 
PrintfArg ChannelId Source # 
IsId ChannelId Source # 
HasId ChannelData ChannelId Source # 
HasId Channel ChannelId Source # 

newtype PostId Source #

Constructors

PI 

Fields

Instances

Eq PostId Source # 

Methods

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

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

Ord PostId Source # 
Read PostId Source # 
Show PostId Source # 
Hashable PostId Source # 

Methods

hashWithSalt :: Int -> PostId -> Int #

hash :: PostId -> Int #

ToJSON PostId Source # 
ToJSONKey PostId Source # 
FromJSON PostId Source # 
FromJSONKey PostId Source # 
PrintfArg PostId Source # 
IsId PostId Source # 

Methods

toId :: PostId -> Id Source #

fromId :: Id -> PostId Source #

HasId Post PostId Source # 

Methods

getId :: Post -> PostId Source #

newtype FileId Source #

Constructors

FI 

Fields

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.

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

HTTP API Functions

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

Creates a structure representing a TLS 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.