Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data Login = Login {}
- type Hostname = Text
- type Port = Int
- data ConnectionData
- data Session
- newtype Id = Id {}
- data User = User {
- userId :: UserId
- userCreateAt :: UTCTime
- userUpdateAt :: UTCTime
- userDeleteAt :: UTCTime
- userUsername :: Text
- userAuthData :: Text
- userAuthService :: Text
- userEmail :: Text
- userEmailVerified :: Bool
- userNickname :: Text
- userFirstName :: Text
- userLastName :: Text
- userRoles :: Text
- userNotifyProps :: UserNotifyProps
- userLastPasswordUpdate :: Maybe UTCTime
- userLastPictureUpdate :: Maybe UTCTime
- userLocale :: Text
- newtype UserId = UI {}
- data InitialLoad = InitialLoad {}
- data Team = Team {}
- data TeamMember = TeamMember {}
- data Type
- newtype TeamId = TI {}
- data TeamsCreate = TeamsCreate {}
- data Channel = Channel {
- channelId :: ChannelId
- channelCreateAt :: UTCTime
- channelUpdateAt :: UTCTime
- channelDeleteAt :: UTCTime
- channelTeamId :: Maybe TeamId
- channelType :: Type
- channelDisplayName :: Text
- channelName :: Text
- channelHeader :: Text
- channelPurpose :: Text
- channelLastPostAt :: UTCTime
- channelTotalMsgCount :: Int
- channelExtraUpdateAt :: UTCTime
- channelCreatorId :: Maybe UserId
- data ChannelWithData = ChannelWithData Channel ChannelData
- data ChannelData = ChannelData {}
- newtype ChannelId = CI {}
- type Channels = Seq Channel
- data MinChannel = MinChannel {}
- data UsersCreate = UsersCreate {}
- data Post = Post {
- postPendingPostId :: Maybe PostId
- postOriginalId :: Maybe PostId
- postProps :: PostProps
- postRootId :: Maybe PostId
- postFileIds :: Seq FileId
- postId :: PostId
- postType :: PostType
- postMessage :: Text
- postDeleteAt :: Maybe UTCTime
- postHashtags :: Text
- postUpdateAt :: UTCTime
- postUserId :: Maybe UserId
- postCreateAt :: UTCTime
- postParentId :: Maybe PostId
- postChannelId :: ChannelId
- postHasReactions :: Bool
- data PostType
- data PostProps = PostProps {}
- data PendingPost = PendingPost {}
- newtype PostId = PI {}
- newtype FileId = FI {}
- data FileInfo = FileInfo {
- fileInfoId :: FileId
- fileInfoUserId :: UserId
- fileInfoPostId :: Maybe PostId
- fileInfoCreateAt :: UTCTime
- fileInfoUpdateAt :: UTCTime
- fileInfoDeleteAt :: UTCTime
- fileInfoName :: Text
- fileInfoExtension :: Text
- fileInfoSize :: Int
- fileInfoMimeType :: Text
- fileInfoWidth :: Maybe Int
- fileInfoHeight :: Maybe Int
- fileInfoHasPreview :: Bool
- data Reaction = Reaction {}
- urlForFile :: FileId -> Text
- data Posts = Posts {}
- data MinCommand = MinCommand {}
- data CommandResponse = CommandResponse {}
- data CommandResponseType
- data Preference = Preference {}
- data PreferenceCategory
- = PreferenceCategoryDirectChannelShow
- | PreferenceCategoryGroupChannelShow
- | PreferenceCategoryTutorialStep
- | PreferenceCategoryAdvancedSettings
- | PreferenceCategoryFlaggedPost
- | PreferenceCategoryDisplaySettings
- | PreferenceCategoryTheme
- | PreferenceCategoryAuthorizedOAuthApp
- | PreferenceCategoryNotifications
- | PreferenceCategoryLast
- | PreferenceCategoryOther Text
- data PreferenceName = PreferenceName {}
- data PreferenceValue = PreferenceValue {}
- data FlaggedPost = FlaggedPost {}
- preferenceToFlaggedPost :: Preference -> Maybe FlaggedPost
- type Logger = LogEvent -> IO ()
- data LogEvent = LogEvent {}
- data LogEventType
- withLogger :: ConnectionData -> Logger -> ConnectionData
- noLogger :: ConnectionData -> ConnectionData
- class HasId x y | x -> y where
- mkConnectionData :: Hostname -> Port -> ConnectionContext -> ConnectionData
- initConnectionData :: Hostname -> Port -> IO ConnectionData
- initConnectionDataInsecure :: Hostname -> Port -> IO ConnectionData
- mmLogin :: ConnectionData -> Login -> IO (Either LoginFailureException (Session, User))
- mmCreateDirect :: Session -> TeamId -> UserId -> IO Channel
- mmCreateChannel :: Session -> TeamId -> MinChannel -> IO Channel
- mmCreateGroupChannel :: Session -> [UserId] -> IO Channel
- mmCreateTeam :: Session -> TeamsCreate -> IO Team
- mmDeleteChannel :: Session -> TeamId -> ChannelId -> IO ()
- mmLeaveChannel :: Session -> TeamId -> ChannelId -> IO ()
- mmJoinChannel :: Session -> TeamId -> ChannelId -> IO ()
- mmGetTeams :: Session -> IO (HashMap TeamId Team)
- mmGetChannels :: Session -> TeamId -> IO Channels
- mmGetAllChannelsForUser :: Session -> TeamId -> UserId -> IO (Seq Channel)
- mmGetAllChannelDataForUser :: Session -> TeamId -> UserId -> IO (Seq ChannelData)
- mmGetAllChannelsWithDataForUser :: Session -> TeamId -> UserId -> IO (HashMap ChannelId ChannelWithData)
- mmGetMoreChannels :: Session -> TeamId -> Int -> Int -> IO Channels
- mmGetChannel :: Session -> TeamId -> ChannelId -> IO ChannelWithData
- mmViewChannel :: Session -> TeamId -> ChannelId -> Maybe ChannelId -> IO ()
- mmDeletePost :: Session -> TeamId -> ChannelId -> PostId -> IO ()
- mmGetPost :: Session -> TeamId -> ChannelId -> PostId -> IO Posts
- mmGetPosts :: Session -> TeamId -> ChannelId -> Int -> Int -> IO Posts
- mmGetPostsSince :: Session -> TeamId -> ChannelId -> UTCTime -> IO Posts
- mmGetPostsBefore :: Session -> TeamId -> ChannelId -> PostId -> Int -> Int -> IO Posts
- mmGetPostsAfter :: Session -> TeamId -> ChannelId -> PostId -> Int -> Int -> IO Posts
- mmSearchPosts :: Session -> TeamId -> Text -> Bool -> IO Posts
- mmGetReactionsForPost :: Session -> TeamId -> ChannelId -> PostId -> IO [Reaction]
- mmGetFileInfo :: Session -> FileId -> IO FileInfo
- mmGetFile :: Session -> FileId -> IO ByteString
- mmGetUser :: Session -> UserId -> IO User
- mmGetUsers :: Session -> Int -> Int -> IO (HashMap UserId User)
- mmGetTeamMembers :: Session -> TeamId -> IO (Seq TeamMember)
- mmGetChannelMembers :: Session -> TeamId -> ChannelId -> Int -> Int -> IO (HashMap UserId User)
- mmGetProfilesForDMList :: Session -> TeamId -> IO (HashMap UserId User)
- mmGetMe :: Session -> IO User
- mmGetProfiles :: Session -> TeamId -> Int -> Int -> IO (HashMap UserId User)
- mmGetStatuses :: Session -> IO (HashMap UserId Text)
- mmGetInitialLoad :: Session -> IO InitialLoad
- mmSaveConfig :: Session -> Value -> IO ()
- mmSetChannelHeader :: Session -> TeamId -> ChannelId -> Text -> IO Channel
- mmChannelAddUser :: Session -> TeamId -> ChannelId -> UserId -> IO ChannelData
- mmChannelRemoveUser :: Session -> ChannelId -> UserId -> IO ()
- mmTeamAddUser :: Session -> TeamId -> UserId -> IO ()
- mmUsersCreate :: ConnectionData -> UsersCreate -> IO User
- mmUsersCreateWithSession :: Session -> UsersCreate -> IO User
- mmPost :: Session -> TeamId -> PendingPost -> IO Post
- mmUpdatePost :: Session -> TeamId -> Post -> IO Post
- mmExecute :: Session -> TeamId -> MinCommand -> IO CommandResponse
- mmGetConfig :: Session -> IO Value
- mmSetPreferences :: Session -> UserId -> Seq Preference -> IO ()
- mmSavePreferences :: Session -> Seq Preference -> IO ()
- mmDeletePreferences :: Session -> Seq Preference -> IO ()
- mmFlagPost :: Session -> UserId -> PostId -> IO ()
- mmUnflagPost :: Session -> UserId -> PostId -> IO ()
- mmGetFlaggedPosts :: Session -> UserId -> IO Posts
- mmGetMyPreferences :: Session -> IO (Seq Preference)
- mkPendingPost :: Text -> UserId -> ChannelId -> IO PendingPost
- idString :: IsId x => x -> Text
- hoistE :: Exception e => Either e r -> IO r
- noteE :: Exception e => Maybe r -> e -> IO r
- assertE :: Exception e => Bool -> e -> IO ()
Types
Mattermost-Related Types (deprecated: use Network.Mattermost.Types instead)
data ConnectionData Source #
User | |
|
data InitialLoad Source #
Team | |
|
data TeamMember Source #
data TeamsCreate Source #
data ChannelWithData Source #
data MinChannel Source #
Post | |
|
urlForFile :: FileId -> Text Source #
Posts | |
|
data MinCommand Source #
data CommandResponseType Source #
data Preference Source #
data PreferenceCategory Source #
data PreferenceName Source #
data PreferenceValue Source #
data FlaggedPost Source #
preferenceToFlaggedPost :: Preference -> Maybe FlaggedPost Source #
Attempt to expose a Preference
as a FlaggedPost
Log-related types
data LogEventType Source #
A LogEventType
describes the particular event that happened
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 |
withLogger :: ConnectionData -> Logger -> ConnectionData Source #
Typeclasses
HTTP API Functions
mkConnectionData :: Hostname -> Port -> ConnectionContext -> ConnectionData Source #
Creates a structure representing a TLS connection to the server.
initConnectionData :: Hostname -> Port -> IO ConnectionData Source #
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.
mmGetAllChannelsWithDataForUser :: Session -> TeamId -> UserId -> IO (HashMap ChannelId ChannelWithData) Source #
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}
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
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}
mmGetProfiles :: Session -> TeamId -> Int -> Int -> IO (HashMap UserId User) Source #
route: /api/v3/teams/{team_id}/users/{offset}/{limit}
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
mmSetPreferences :: Session -> UserId -> Seq Preference -> IO () Source #
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
mmGetMyPreferences :: Session -> IO (Seq Preference) Source #
mkPendingPost :: Text -> UserId -> ChannelId -> IO PendingPost Source #
Orphan instances
Stream Connection Source # | This instance allows us to use |