mattermost-api-40400.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 ChannelId Source #

Constructors

CI 

Fields

Instances

Eq ChannelId Source # 
Ord ChannelId Source # 
Read ChannelId Source # 
Show ChannelId Source # 
Hashable ChannelId Source # 
FromJSON ChannelId Source # 
FromJSONKey ChannelId Source # 
ToJSON ChannelId Source # 
ToJSONKey ChannelId Source # 
IsId ChannelId Source # 
HasId ChannelData ChannelId Source # 
HasId Channel ChannelId 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.

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 -> 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 -> UTCTime -> 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

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.

Orphan instances

Stream Connection Source #

This instance allows us to use simpleHTTP from Stream with connections from the connection package.