-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Matrix multipurpose bot
--   
--   Matrix multipurpose bot
@package matrix-bot
@version 0.2.0

module MatrixBot.AesonUtils
myGenericToJSON :: (Generic a, Typeable a, GToJSON' Value Zero (Rep a)) => a -> Value
myGenericParseJSON :: (Generic a, Typeable a, GFromJSON Zero (Rep a)) => Value -> Parser a

-- | Cut type name prefix from each field
--   
--   For instance if type is called “Foo” and its fields are “fooBar” and
--   “fooBaz” then its fields will be named “bar” and “baz”. If prefix
--   doesn’t equal to “foo” (to the type name) then the field name stays
--   unchanged.
cutTypeNamePrefix :: Typeable a => Proxy a -> Options -> Options

-- | Convert “camelCase” to “snake_case” for each field
camelCaseToSnakeCase :: Options -> Options


-- | Helpers for the log messages
module MatrixBot.Log
withLogger :: MonadUnliftIO m => LogStateHandle -> (Logger -> m a) -> m a
logDebug :: (MonadLogger m, HasCallStack) => Text -> m ()
logInfo :: (MonadLogger m, HasCallStack) => Text -> m ()
logWarn :: (MonadLogger m, HasCallStack) => Text -> m ()
logError :: (MonadLogger m, HasCallStack) => Text -> m ()
newtype Logger
Logger :: (forall (m :: Type -> Type). MonadIO m => Loc -> LogLevel -> Text -> m ()) -> Logger
[runLogger] :: Logger -> forall (m :: Type -> Type). MonadIO m => Loc -> LogLevel -> Text -> m ()
class HasLogger r
logger :: HasLogger r => Lens' r Logger

-- | Default implementation for <a>ML.MonadLogger</a>
defaultMonadLoggerLog :: (MonadIO m, HasLogger r, MonadReader r m, ToLogStr msg) => Loc -> LogSource -> LogLevel -> msg -> m ()
data LogStateHandle
createLogState :: MonadIO m => m LogStateHandle

-- | Set the desired log-level for the logger
--   
--   Will initialize the logger if it was not yet initialized. Otherwise
--   will just override the wanted log level.
setLogLevel :: (MonadUnliftIO m, MonadLogger m) => LogStateHandle -> Maybe LogLevel -> m ()

-- | Initialize log to debug-level in case it is not yet initialized
--   
--   Useful for handling application failures before the log-level is set.
--   So that errors are reported instead of stay silent in the queue.
forceLogInitialization :: (MonadUnliftIO m, MonadLogger m) => LogStateHandle -> m ()
instance GHC.Classes.Eq MatrixBot.Log.LogState
instance GHC.Classes.Eq MatrixBot.Log.LogTime
instance GHC.Classes.Eq MatrixBot.Log.ThreadId
instance MatrixBot.Log.HasLogger MatrixBot.Log.Logger
instance Control.Monad.IO.Class.MonadIO m => Control.Monad.Logger.MonadLogger (Control.Monad.Trans.Reader.ReaderT MatrixBot.Log.Logger m)
instance GHC.Show.Show MatrixBot.Log.LogState
instance GHC.Show.Show MatrixBot.Log.LogTime
instance GHC.Show.Show MatrixBot.Log.ThreadId

module MatrixBot.MatrixApi.Types.MEventTypes

-- | Matrix event types enum
data MEventType
MAnnotationType :: MEventType
MReactionType :: MEventType
MRoomMessageType :: MEventType
MLoginPasswordType :: MEventType

-- | Limited/restricted subset of <a>MEventType</a>
data MEventTypeOneOf (types :: [MEventType])
[MAnnotationTypeOneOf] :: forall (types :: [MEventType]). OneOf 'MAnnotationType types ~ 'True => MEventTypeOneOf types
[MReactionTypeOneOf] :: forall (types :: [MEventType]). OneOf 'MReactionType types ~ 'True => MEventTypeOneOf types
[MRoomMessageTypeOneOf] :: forall (types :: [MEventType]). OneOf 'MRoomMessageType types ~ 'True => MEventTypeOneOf types
[MLoginPasswordTypeOneOf] :: forall (types :: [MEventType]). OneOf 'MLoginPasswordType types ~ 'True => MEventTypeOneOf types
mEventTypeToString :: IsString s => MEventType -> s
mEventTypeOneOfToMEventType :: forall (t :: MEventType) (ts :: [MEventType]). MEventTypeOneOf (t ': ts) -> MEventType
instance GHC.Enum.Bounded MatrixBot.MatrixApi.Types.MEventTypes.MEventType
instance GHC.Enum.Enum MatrixBot.MatrixApi.Types.MEventTypes.MEventType
instance GHC.Classes.Eq MatrixBot.MatrixApi.Types.MEventTypes.MEventType
instance GHC.Classes.Eq (MatrixBot.MatrixApi.Types.MEventTypes.MEventTypeOneOf (t : ts))
instance Data.Aeson.Types.FromJSON.FromJSON MatrixBot.MatrixApi.Types.MEventTypes.MEventType
instance MatrixBot.MatrixApi.Types.MEventTypes.ToParser '(t : ts, t : ts) => Data.Aeson.Types.FromJSON.FromJSON (MatrixBot.MatrixApi.Types.MEventTypes.MEventTypeOneOf (t : ts))
instance GHC.Show.Show MatrixBot.MatrixApi.Types.MEventTypes.MEventType
instance GHC.Show.Show (MatrixBot.MatrixApi.Types.MEventTypes.MEventTypeOneOf (t : ts))
instance Web.Internal.HttpApiData.ToHttpApiData (MatrixBot.MatrixApi.Types.MEventTypes.MEventTypeOneOf (t : ts))
instance Data.Aeson.Types.ToJSON.ToJSON MatrixBot.MatrixApi.Types.MEventTypes.MEventType
instance Data.Aeson.Types.ToJSON.ToJSON (MatrixBot.MatrixApi.Types.MEventTypes.MEventTypeOneOf (t : ts))
instance (MatrixBot.MatrixApi.Types.MEventTypes.ItemParser t ts to x xs, t GHC.Types.~ 'MatrixBot.MatrixApi.Types.MEventTypes.MAnnotationType) => MatrixBot.MatrixApi.Types.MEventTypes.ToParser '(to, 'MatrixBot.MatrixApi.Types.MEventTypes.MAnnotationType : ts)
instance (MatrixBot.MatrixApi.Types.MEventTypes.ItemParser t ts to x xs, t GHC.Types.~ 'MatrixBot.MatrixApi.Types.MEventTypes.MReactionType) => MatrixBot.MatrixApi.Types.MEventTypes.ToParser '(to, 'MatrixBot.MatrixApi.Types.MEventTypes.MReactionType : ts)
instance (MatrixBot.MatrixApi.Types.MEventTypes.ItemParser t ts to x xs, t GHC.Types.~ 'MatrixBot.MatrixApi.Types.MEventTypes.MRoomMessageType) => MatrixBot.MatrixApi.Types.MEventTypes.ToParser '(to, 'MatrixBot.MatrixApi.Types.MEventTypes.MRoomMessageType : ts)
instance (MatrixBot.MatrixApi.Types.MEventTypes.ItemParser t ts to x xs, t GHC.Types.~ 'MatrixBot.MatrixApi.Types.MEventTypes.MLoginPasswordType) => MatrixBot.MatrixApi.Types.MEventTypes.ToParser '(to, 'MatrixBot.MatrixApi.Types.MEventTypes.MLoginPasswordType : ts)
instance MatrixBot.MatrixApi.Types.MEventTypes.ToParser '(x : xs, '[])


-- | A set of generic types that can be used in different places/modules
module MatrixBot.SharedTypes
newtype Username
Username :: Text -> Username
[unUsername] :: Username -> Text
newtype Password
Password :: Text -> Password
[unPassword] :: Password -> Text
newtype AccessToken
AccessToken :: Text -> AccessToken
[unAccessToken] :: AccessToken -> Text
newtype HomeServer
HomeServer :: Text -> HomeServer
[unHomeServer] :: HomeServer -> Text

-- | Matrix user identifier aka MXID
--   
--   Looks like this:
--   
--   <pre>
--   @username:homeserver.tld
--   </pre>
data Mxid
Mxid :: Username -> HomeServer -> Mxid
[mxidUsername] :: Mxid -> Username
[mxidHomeServer] :: Mxid -> HomeServer
mxidParser :: Parser Mxid
printMxid :: Mxid -> Text

-- | Matrix room identifier
--   
--   Looks like this: <tt>!ffffffffffffffffff:homeserver.tld</tt> Parsed to
--   <tt>LocatedRoomId "ffffffffffffffffff" "homeserver.tld"</tt>
--   
--   Or in newer room versions (&gt;=12) looks like this (randomized
--   example): <tt>!xDtl8llK_oKog5ekJYYwJ58CpeVcUPQNOsK0Sp-L2rQ</tt> Parsed
--   to <tt>ServerlessRoomId
--   "xDtl8llK_oKog5ekJYYwJ58CpeVcUPQNOsK0Sp-L2rQ"</tt>
data RoomId

-- | Older room versions (&lt;12)
LocatedRoomId :: Text -> HomeServer -> RoomId

-- | Newer room versions (&gt;=12)
ServerlessRoomId :: Text -> RoomId
roomIdParser :: Parser RoomId
printRoomId :: RoomId -> Text
newtype EventId
EventId :: Text -> EventId
[unEventId] :: EventId -> Text
newtype EventToken
EventToken :: Text -> EventToken
[unEventToken] :: EventToken -> Text
newtype TransactionId
TransactionId :: UUID -> TransactionId
[unTransactionId] :: TransactionId -> UUID
genTransactionId :: MonadIO m => m TransactionId
newtype FilterId
FilterId :: Text -> FilterId
[unFilterId] :: FilterId -> Text
newtype Milliseconds
Milliseconds :: Integer -> Milliseconds
[unMilliseconds] :: Milliseconds -> Integer
newtype Seconds
Seconds :: Integer -> Seconds
[unSeconds] :: Seconds -> Integer
newtype Microseconds
Microseconds :: Integer -> Microseconds
[unMicroseconds] :: Microseconds -> Integer
secondsToMilliseconds :: Seconds -> Milliseconds
millisecondsToMicroseconds :: Milliseconds -> Microseconds
secondsToMicroseconds :: Seconds -> Microseconds
newtype RetryLimit
RetryLimit :: Natural -> RetryLimit
[unRetryLimit] :: RetryLimit -> Natural
newtype RetryDelay
RetryDelay :: Microseconds -> RetryDelay
[unRetryDelay] :: RetryDelay -> Microseconds
class HasRetryParams r
retryLimit :: HasRetryParams r => Lens' r RetryLimit
retryDelay :: HasRetryParams r => Lens' r RetryDelay
printRetryDelaySeconds :: IsString s => RetryDelay -> s
newtype EventsTimeout
EventsTimeout :: Seconds -> EventsTimeout
[unEventsTimeout] :: EventsTimeout -> Seconds
instance GHC.Classes.Eq MatrixBot.SharedTypes.AccessToken
instance GHC.Classes.Eq MatrixBot.SharedTypes.EventId
instance GHC.Classes.Eq MatrixBot.SharedTypes.EventToken
instance GHC.Classes.Eq MatrixBot.SharedTypes.EventsTimeout
instance GHC.Classes.Eq MatrixBot.SharedTypes.FilterId
instance GHC.Classes.Eq MatrixBot.SharedTypes.HomeServer
instance GHC.Classes.Eq MatrixBot.SharedTypes.Microseconds
instance GHC.Classes.Eq MatrixBot.SharedTypes.Milliseconds
instance GHC.Classes.Eq MatrixBot.SharedTypes.Mxid
instance GHC.Classes.Eq MatrixBot.SharedTypes.Password
instance GHC.Classes.Eq MatrixBot.SharedTypes.RetryDelay
instance GHC.Classes.Eq MatrixBot.SharedTypes.RetryLimit
instance GHC.Classes.Eq MatrixBot.SharedTypes.RoomId
instance GHC.Classes.Eq MatrixBot.SharedTypes.Seconds
instance GHC.Classes.Eq MatrixBot.SharedTypes.TransactionId
instance GHC.Classes.Eq MatrixBot.SharedTypes.Username
instance Data.Aeson.Types.FromJSON.FromJSON MatrixBot.SharedTypes.AccessToken
instance Data.Aeson.Types.FromJSON.FromJSON MatrixBot.SharedTypes.EventId
instance Data.Aeson.Types.FromJSON.FromJSON MatrixBot.SharedTypes.EventToken
instance Data.Aeson.Types.FromJSON.FromJSON MatrixBot.SharedTypes.EventsTimeout
instance Data.Aeson.Types.FromJSON.FromJSON MatrixBot.SharedTypes.FilterId
instance Data.Aeson.Types.FromJSON.FromJSON MatrixBot.SharedTypes.HomeServer
instance Data.Aeson.Types.FromJSON.FromJSON MatrixBot.SharedTypes.Microseconds
instance Data.Aeson.Types.FromJSON.FromJSON MatrixBot.SharedTypes.Milliseconds
instance Data.Aeson.Types.FromJSON.FromJSON MatrixBot.SharedTypes.Mxid
instance Data.Aeson.Types.FromJSON.FromJSON MatrixBot.SharedTypes.Password
instance Data.Aeson.Types.FromJSON.FromJSON MatrixBot.SharedTypes.RetryDelay
instance Data.Aeson.Types.FromJSON.FromJSON MatrixBot.SharedTypes.RetryLimit
instance Data.Aeson.Types.FromJSON.FromJSON MatrixBot.SharedTypes.RoomId
instance Data.Aeson.Types.FromJSON.FromJSON MatrixBot.SharedTypes.Seconds
instance Data.Aeson.Types.FromJSON.FromJSON MatrixBot.SharedTypes.TransactionId
instance Data.Aeson.Types.FromJSON.FromJSON MatrixBot.SharedTypes.Username
instance GHC.Show.Show MatrixBot.SharedTypes.AccessToken
instance GHC.Show.Show MatrixBot.SharedTypes.EventId
instance GHC.Show.Show MatrixBot.SharedTypes.EventToken
instance GHC.Show.Show MatrixBot.SharedTypes.EventsTimeout
instance GHC.Show.Show MatrixBot.SharedTypes.FilterId
instance GHC.Show.Show MatrixBot.SharedTypes.HomeServer
instance GHC.Show.Show MatrixBot.SharedTypes.Microseconds
instance GHC.Show.Show MatrixBot.SharedTypes.Milliseconds
instance GHC.Show.Show MatrixBot.SharedTypes.Mxid
instance GHC.Show.Show MatrixBot.SharedTypes.Password
instance GHC.Show.Show MatrixBot.SharedTypes.RetryDelay
instance GHC.Show.Show MatrixBot.SharedTypes.RetryLimit
instance GHC.Show.Show MatrixBot.SharedTypes.RoomId
instance GHC.Show.Show MatrixBot.SharedTypes.Seconds
instance GHC.Show.Show MatrixBot.SharedTypes.TransactionId
instance GHC.Show.Show MatrixBot.SharedTypes.Username
instance Web.Internal.HttpApiData.ToHttpApiData MatrixBot.SharedTypes.EventToken
instance Web.Internal.HttpApiData.ToHttpApiData MatrixBot.SharedTypes.FilterId
instance Web.Internal.HttpApiData.ToHttpApiData MatrixBot.SharedTypes.Milliseconds
instance Web.Internal.HttpApiData.ToHttpApiData MatrixBot.SharedTypes.Mxid
instance Web.Internal.HttpApiData.ToHttpApiData MatrixBot.SharedTypes.RoomId
instance Web.Internal.HttpApiData.ToHttpApiData MatrixBot.SharedTypes.TransactionId
instance Data.Aeson.Types.ToJSON.ToJSON MatrixBot.SharedTypes.AccessToken
instance Data.Aeson.Types.ToJSON.ToJSON MatrixBot.SharedTypes.EventId
instance Data.Aeson.Types.ToJSON.ToJSON MatrixBot.SharedTypes.EventToken
instance Data.Aeson.Types.ToJSON.ToJSON MatrixBot.SharedTypes.EventsTimeout
instance Data.Aeson.Types.ToJSON.ToJSON MatrixBot.SharedTypes.FilterId
instance Data.Aeson.Types.ToJSON.ToJSON MatrixBot.SharedTypes.HomeServer
instance Data.Aeson.Types.ToJSON.ToJSON MatrixBot.SharedTypes.Microseconds
instance Data.Aeson.Types.ToJSON.ToJSON MatrixBot.SharedTypes.Milliseconds
instance Data.Aeson.Types.ToJSON.ToJSON MatrixBot.SharedTypes.Mxid
instance Data.Aeson.Types.ToJSON.ToJSON MatrixBot.SharedTypes.Password
instance Data.Aeson.Types.ToJSON.ToJSON MatrixBot.SharedTypes.RetryDelay
instance Data.Aeson.Types.ToJSON.ToJSON MatrixBot.SharedTypes.RetryLimit
instance Data.Aeson.Types.ToJSON.ToJSON MatrixBot.SharedTypes.RoomId
instance Data.Aeson.Types.ToJSON.ToJSON MatrixBot.SharedTypes.Seconds
instance Data.Aeson.Types.ToJSON.ToJSON MatrixBot.SharedTypes.TransactionId
instance Data.Aeson.Types.ToJSON.ToJSON MatrixBot.SharedTypes.Username


-- | Application’s command-line interface
module MatrixBot.Options
data AppCommand
AppCommandAuth :: AuthOptions -> AppCommand
AppCommandStart :: StartOptions -> AppCommand
AppCommandSendMessage :: SendMessageOptions -> AppCommand
AppCommandEditMessage :: EditMessageOptions -> AppCommand
appCommandParserInfo :: ParserInfo AppCommand
appCommandParser :: Parser AppCommand
data AuthOptions
AuthOptions :: Mxid -> Either Password FilePath -> FilePath -> Maybe LogLevel -> AuthOptions

-- | Where to save credentials JSON output to (can be
--   <tt><i>dev</i>stdout</tt>)
[authOptionsMxid] :: AuthOptions -> Mxid

-- | Either file to read the password from (can be
--   <tt><i>dev</i>stdin</tt>) or the password as-is
[authOptionsPassword] :: AuthOptions -> Either Password FilePath
[authOptionsOutputFile] :: AuthOptions -> FilePath
[authOptionsLogLevel] :: AuthOptions -> Maybe LogLevel
authOptionsParser :: Parser AuthOptions
data StartOptions
StartOptions :: FilePath -> FilePath -> RetryLimit -> RetryDelay -> Maybe FilePath -> EventsTimeout -> Maybe LogLevel -> StartOptions

-- | Path to the file with credentials obtained via calling “auth” command
[startOptionsCredentialsFile] :: StartOptions -> FilePath

-- | Bot configuration JSON file
[startOptionsBotConfigFile] :: StartOptions -> FilePath

-- | In case of Matrix API request exception how many times to retry before
--   bot dies
[startOptionsRetryLimit] :: StartOptions -> RetryLimit

-- | In case of Matrix API request exception how long to wait before each
--   retry
[startOptionsRetryDelay] :: StartOptions -> RetryDelay

-- | Path to a JSON file that contains last event token to start listening
--   events from (when application starts it reads from this file, when it
--   receives new events it writes to it)
[startOptionsEventTokenFile] :: StartOptions -> Maybe FilePath
[startOptionsEventsTimeout] :: StartOptions -> EventsTimeout
[startOptionsLogLevel] :: StartOptions -> Maybe LogLevel
startOptionsParser :: Parser StartOptions
data SendMessageOptions
SendMessageOptions :: FilePath -> RoomId -> Maybe EventId -> Either Text FilePath -> Maybe (Either Text FilePath) -> Maybe TransactionId -> Maybe LogLevel -> SendMessageOptions
[sendMessageOptionsCredentialsFile] :: SendMessageOptions -> FilePath
[sendMessageOptionsRoomId] :: SendMessageOptions -> RoomId

-- | Optionaly make the message a reply to a specified event
[sendMessageOptionsReplyTo] :: SendMessageOptions -> Maybe EventId

-- | Message body either as plain value or a file to read it from (e.g.
--   <i>dev</i>stdin)
[sendMessageOptionsMessage] :: SendMessageOptions -> Either Text FilePath

-- | Optional HTML-formatted message body in addition to the plain text one
[sendMessageOptionsHtmlMessage] :: SendMessageOptions -> Maybe (Either Text FilePath)
[sendMessageOptionsTransactionId] :: SendMessageOptions -> Maybe TransactionId
[sendMessageOptionsLogLevel] :: SendMessageOptions -> Maybe LogLevel
sendMessageOptionsParser :: Parser SendMessageOptions
data EditMessageOptions
EditMessageOptions :: FilePath -> RoomId -> EventId -> Maybe EventId -> Either Text FilePath -> Maybe (Either Text FilePath) -> Maybe (Either Text FilePath) -> Maybe (Either Text FilePath) -> Maybe TransactionId -> Maybe LogLevel -> EditMessageOptions
[editMessageOptionsCredentialsFile] :: EditMessageOptions -> FilePath
[editMessageOptionsRoomId] :: EditMessageOptions -> RoomId

-- | Original message event that we are editing
[editMessageOptionsMessageId] :: EditMessageOptions -> EventId

-- | Optionaly make the message a reply to a specified event
[editMessageOptionsReplyTo] :: EditMessageOptions -> Maybe EventId

-- | New message body either as a plain value or a file to read it from
--   (e.g. <i>dev</i>stdin)
[editMessageOptionsMessage] :: EditMessageOptions -> Either Text FilePath

-- | Optional new HTML-formatted message body in addition to the plain text
--   one
[editMessageOptionsHtmlMessage] :: EditMessageOptions -> Maybe (Either Text FilePath)

-- | Old API compatibility new message body (default template is used if
--   not specified)
[editMessageOptionsMessageCompat] :: EditMessageOptions -> Maybe (Either Text FilePath)

-- | Old API compatibility new HTML-formatted message body (default
--   template is used if not specified)
[editMessageOptionsHtmlMessageCompat] :: EditMessageOptions -> Maybe (Either Text FilePath)
[editMessageOptionsTransactionId] :: EditMessageOptions -> Maybe TransactionId
[editMessageOptionsLogLevel] :: EditMessageOptions -> Maybe LogLevel
editMessageOptionsParser :: Parser EditMessageOptions
credentialsFile :: Parser FilePath
roomId :: Parser RoomId
transactionId :: Parser (Maybe TransactionId)
logLevel :: Parser (Maybe LogLevel)
parseAppCommand :: MonadIO m => m AppCommand
instance GHC.Classes.Eq MatrixBot.Options.AuthOptions
instance GHC.Classes.Eq MatrixBot.Options.EditMessageOptions
instance GHC.Classes.Eq MatrixBot.Options.SendMessageOptions
instance GHC.Classes.Eq MatrixBot.Options.StartOptions
instance GHC.Show.Show MatrixBot.Options.AuthOptions
instance GHC.Show.Show MatrixBot.Options.EditMessageOptions
instance GHC.Show.Show MatrixBot.Options.SendMessageOptions
instance GHC.Show.Show MatrixBot.Options.StartOptions

module MatrixBot.MatrixApi.Client
data MatrixApiClient
MatrixApiClient :: (forall api (m :: Type -> Type) a. (MonadIO m, MonadFail m, Show a, MonadLogger m, HasClient (Free ClientF) api, HasClient ClientM api) => Proxy api -> (forall (clientM :: Type -> Type). HasClient clientM api => Client clientM api -> clientM a) -> m (Either ClientError a)) -> (forall api (m :: Type -> Type) a. (MonadIO m, MonadFail m, Show a, MonadLogger m, HasClient (Free ClientF) api, HasClient ClientM api) => Proxy api -> (forall (clientM :: Type -> Type). HasClient clientM api => Client clientM api -> clientM a) -> m (Either ClientError a)) -> (forall api (m :: Type -> Type) a. (MonadIO m, MonadFail m, Show a, MonadThrow m, MonadLogger m, HasClient (Free ClientF) api, HasClient ClientM api) => Proxy api -> (forall (clientM :: Type -> Type). HasClient clientM api => Client clientM api -> clientM a) -> m a) -> (forall api (m :: Type -> Type) a. (MonadIO m, MonadFail m, Show a, MonadThrow m, MonadLogger m, HasClient (Free ClientF) api, HasClient ClientM api) => Proxy api -> (forall (clientM :: Type -> Type). HasClient clientM api => Client clientM api -> clientM a) -> m a) -> MatrixApiClient
[runMatrixApiClient] :: MatrixApiClient -> forall api (m :: Type -> Type) a. (MonadIO m, MonadFail m, Show a, MonadLogger m, HasClient (Free ClientF) api, HasClient ClientM api) => Proxy api -> (forall (clientM :: Type -> Type). HasClient clientM api => Client clientM api -> clientM a) -> m (Either ClientError a)

-- | Variant that doesn’t log request body that may contain passwords or
--   streamed byte strings
[runMatrixApiClientDoNotShowReqBody] :: MatrixApiClient -> forall api (m :: Type -> Type) a. (MonadIO m, MonadFail m, Show a, MonadLogger m, HasClient (Free ClientF) api, HasClient ClientM api) => Proxy api -> (forall (clientM :: Type -> Type). HasClient clientM api => Client clientM api -> clientM a) -> m (Either ClientError a)
[runMatrixApiClient'] :: MatrixApiClient -> forall api (m :: Type -> Type) a. (MonadIO m, MonadFail m, Show a, MonadThrow m, MonadLogger m, HasClient (Free ClientF) api, HasClient ClientM api) => Proxy api -> (forall (clientM :: Type -> Type). HasClient clientM api => Client clientM api -> clientM a) -> m a

-- | Variant that doesn’t log request body that may contain passwords or
--   streamed byte strings
[runMatrixApiClientDoNotShowReqBody'] :: MatrixApiClient -> forall api (m :: Type -> Type) a. (MonadIO m, MonadFail m, Show a, MonadThrow m, MonadLogger m, HasClient (Free ClientF) api, HasClient ClientM api) => Proxy api -> (forall (clientM :: Type -> Type). HasClient clientM api => Client clientM api -> clientM a) -> m a
newtype RequestOptions
RequestOptions :: Maybe Seconds -> RequestOptions

-- | <a>Nothing</a> means default timeout value (30 seconds)
[requestOptionsTimeout] :: RequestOptions -> Maybe Seconds
defaultRequestOptions :: RequestOptions
mkMatrixApiClient :: (MonadIO m, MonadThrow m, MonadLogger m) => RequestOptions -> HomeServer -> m MatrixApiClient

module MatrixBot.MatrixApi
type ClientV3 a = "_matrix" :> "client" :> "v3" :> a
type Authenticated a = AuthProtect "access-token" :> a
type LoginApi = ClientV3 "login" :> ReqBody '[JSON] LoginRequest :> Post '[JSON] LoginResponse
data LoginRequest
LoginRequest :: MEventTypeOneOf '[ 'MLoginPasswordType] -> Username -> Password -> LoginRequest
[loginRequestType] :: LoginRequest -> MEventTypeOneOf '[ 'MLoginPasswordType]
[loginRequestUser] :: LoginRequest -> Username
[loginRequestPassword] :: LoginRequest -> Password
data LoginResponse
LoginResponse :: AccessToken -> HomeServer -> Mxid -> LoginResponse
[loginResponseAccessToken] :: LoginResponse -> AccessToken
[loginResponseHomeServer] :: LoginResponse -> HomeServer
[loginResponseUserId] :: LoginResponse -> Mxid

-- | See the visibility of the room
type ListRoomApi = ClientV3 Authenticated "directory" :> "list" :> "room" :> Capture "roomId" RoomId :> Get '[JSON] ListRoomResponse
newtype ListRoomResponse
ListRoomResponse :: RoomVisibility -> ListRoomResponse
[listRoomResponseVisibility] :: ListRoomResponse -> RoomVisibility
data RoomVisibility
RoomVisibilityPrivate :: RoomVisibility
RoomVisibilityPublic :: RoomVisibility
type EventsApi = ClientV3 Authenticated "events" :> QueryParam "from" EventToken :> QueryParam "room_id" RoomId :> QueryParam "timeout" Milliseconds :> Get '[JSON] EventsResponse
data EventsResponse
EventsResponse :: [ClientEvent] -> EventToken -> EventToken -> EventsResponse
[eventsResponseChunk] :: EventsResponse -> [ClientEvent]
[eventsResponseEnd] :: EventsResponse -> EventToken
[eventsResponseStart] :: EventsResponse -> EventToken

-- | Room event of any type
data ClientEvent
ClientEventMRoomMessage :: ClientEventGeneric Identity -> MRoomMessageClientEvent -> ClientEvent
ClientEventOther :: ClientEventGeneric Maybe -> Object -> ClientEvent
data ClientEventGeneric (f :: Type -> Type)
ClientEventGeneric :: Text -> Object -> f EventId -> f Integer -> f RoomId -> f Mxid -> Maybe Text -> Maybe Value -> ClientEventGeneric (f :: Type -> Type)
[clientEventGenericType] :: ClientEventGeneric (f :: Type -> Type) -> Text
[clientEventGenericContent] :: ClientEventGeneric (f :: Type -> Type) -> Object
[clientEventGenericEventId] :: ClientEventGeneric (f :: Type -> Type) -> f EventId
[clientEventGenericOriginServerTs] :: ClientEventGeneric (f :: Type -> Type) -> f Integer
[clientEventGenericRoomId] :: ClientEventGeneric (f :: Type -> Type) -> f RoomId
[clientEventGenericSender] :: ClientEventGeneric (f :: Type -> Type) -> f Mxid
[clientEventGenericStateKey] :: ClientEventGeneric (f :: Type -> Type) -> Maybe Text
[clientEventGenericUnsigned] :: ClientEventGeneric (f :: Type -> Type) -> Maybe Value

-- | r.room.message event
data MRoomMessageClientEvent
MRoomMessageClientEvent :: MEventTypeOneOf '[ 'MRoomMessageType] -> MRoomMessageClientEventContent -> MRoomMessageClientEvent
[mRoomMessageClientEventType] :: MRoomMessageClientEvent -> MEventTypeOneOf '[ 'MRoomMessageType]
[mRoomMessageClientEventContent] :: MRoomMessageClientEvent -> MRoomMessageClientEventContent

-- | r.room.message “content” field of any msgtype
data MRoomMessageClientEventContent
MRoomMessageClientEventContentMText :: MRoomMessageMTextMsgtypeClientEventContent -> MRoomMessageClientEventContent
MRoomMessageClientEventContentMImage :: MRoomMessageMImageMsgtypeClientEventContent -> MRoomMessageClientEventContent
MRoomMessageClientEventContentMVideo :: MRoomMessageMVideoMsgtypeClientEventContent -> MRoomMessageClientEventContent
MRoomMessageClientEventContentMAudio :: MRoomMessageMAudioMsgtypeClientEventContent -> MRoomMessageClientEventContent
MRoomMessageClientEventContentMFile :: MRoomMessageMFileMsgtypeClientEventContent -> MRoomMessageClientEventContent
MRoomMessageClientEventContentOther :: Object -> MRoomMessageClientEventContent

-- | m.room.message m.text msgtype content
data MRoomMessageMTextMsgtypeClientEventContent
MRoomMessageMTextMsgtypeClientEventContent :: MTextType -> Text -> MRoomMessageMTextMsgtypeClientEventContent
[mRoomMessageMTextMsgtypeClientEventContentMsgtype] :: MRoomMessageMTextMsgtypeClientEventContent -> MTextType
[mRoomMessageMTextMsgtypeClientEventContentBody] :: MRoomMessageMTextMsgtypeClientEventContent -> Text

-- | m.room.message m.image msgtype content
data MRoomMessageMImageMsgtypeClientEventContent
MRoomMessageMImageMsgtypeClientEventContent :: MImageType -> Text -> Text -> MRoomMessageMImageMsgtypeClientEventContent
[mRoomMessageMImageMsgtypeClientEventContentMsgtype] :: MRoomMessageMImageMsgtypeClientEventContent -> MImageType

-- | File name
[mRoomMessageMImageMsgtypeClientEventContentBody] :: MRoomMessageMImageMsgtypeClientEventContent -> Text

-- | Matrix internal URL to an media file
[mRoomMessageMImageMsgtypeClientEventContentUrl] :: MRoomMessageMImageMsgtypeClientEventContent -> Text

-- | m.room.message m.video msgtype content
data MRoomMessageMVideoMsgtypeClientEventContent
MRoomMessageMVideoMsgtypeClientEventContent :: MVideoType -> Text -> Text -> MRoomMessageMVideoMsgtypeClientEventContent
[mRoomMessageMVideoMsgtypeClientEventContentMsgtype] :: MRoomMessageMVideoMsgtypeClientEventContent -> MVideoType

-- | File name
[mRoomMessageMVideoMsgtypeClientEventContentBody] :: MRoomMessageMVideoMsgtypeClientEventContent -> Text

-- | Matrix internal URL to an media file
[mRoomMessageMVideoMsgtypeClientEventContentUrl] :: MRoomMessageMVideoMsgtypeClientEventContent -> Text

-- | m.room.message m.audio msgtype content
data MRoomMessageMAudioMsgtypeClientEventContent
MRoomMessageMAudioMsgtypeClientEventContent :: MAudioType -> Text -> Text -> MRoomMessageMAudioMsgtypeClientEventContent
[mRoomMessageMAudioMsgtypeClientEventContentMsgtype] :: MRoomMessageMAudioMsgtypeClientEventContent -> MAudioType

-- | File name
[mRoomMessageMAudioMsgtypeClientEventContentBody] :: MRoomMessageMAudioMsgtypeClientEventContent -> Text

-- | Matrix internal URL to an media file
[mRoomMessageMAudioMsgtypeClientEventContentUrl] :: MRoomMessageMAudioMsgtypeClientEventContent -> Text

-- | m.room.message m.file msgtype content
data MRoomMessageMFileMsgtypeClientEventContent
MRoomMessageMFileMsgtypeClientEventContent :: MFileType -> Text -> Text -> MRoomMessageMFileMsgtypeClientEventContent
[mRoomMessageMFileMsgtypeClientEventContentMsgtype] :: MRoomMessageMFileMsgtypeClientEventContent -> MFileType

-- | File name
[mRoomMessageMFileMsgtypeClientEventContentBody] :: MRoomMessageMFileMsgtypeClientEventContent -> Text

-- | Matrix internal URL to an media file
[mRoomMessageMFileMsgtypeClientEventContentUrl] :: MRoomMessageMFileMsgtypeClientEventContent -> Text
type SendEventApi t = ClientV3 Authenticated "rooms" :> Capture "roomId" RoomId :> "send" :> Capture "eventType" t :> Capture "txnId" TransactionId :> ReqBody '[JSON] EventContent t :> Put '[JSON] EventResponse
type family EventContent eventType
newtype EventResponse
EventResponse :: EventId -> EventResponse
[eventResponseEventId] :: EventResponse -> EventId
type CreateUserFilter = ClientV3 Authenticated "user" :> Capture "userId" Mxid :> "filter" :> ReqBody '[JSON] UserFilter :> Post '[JSON] UserFilterIdResponse
newtype UserFilterIdResponse
UserFilterIdResponse :: FilterId -> UserFilterIdResponse
[userFilterIdResponse] :: UserFilterIdResponse -> FilterId
type GetUserFilter = ClientV3 Authenticated "user" :> Capture "userId" Mxid :> "filter" :> Capture "filterId" FilterId :> Post '[JSON] UserFilter
data UserFilter
UserFilter :: Maybe () -> Maybe () -> Maybe () -> Maybe () -> Maybe () -> UserFilter
[userFilterAccountData] :: UserFilter -> Maybe ()
[userFilterEventFields] :: UserFilter -> Maybe ()
[userFilterEventFormat] :: UserFilter -> Maybe ()
[userFilterPresence] :: UserFilter -> Maybe ()
[userFilterRoom] :: UserFilter -> Maybe ()

-- | Generic interface for <tt>msgtype</tt> Matrix API string
--   representation.
class MsgtypeString a
msgtypeString :: MsgtypeString a => a -> Text
data MTextType
MTextType :: MTextType
data MImageType
MImageType :: MImageType
data MVideoType
MVideoType :: MVideoType
data MAudioType
MAudioType :: MAudioType
data MFileType
MFileType :: MFileType
data MRoomMessageContent
MRoomMessageContent :: MTextType -> Text -> Maybe Text -> Maybe InReplyTo -> Maybe MessageEdit -> MRoomMessageContent
[mRoomMessageContentMsgtype] :: MRoomMessageContent -> MTextType
[mRoomMessageContentBody] :: MRoomMessageContent -> Text
[mRoomMessageContentHtmlBody] :: MRoomMessageContent -> Maybe Text
[mRoomMessageContentMRelatesTo] :: MRoomMessageContent -> Maybe InReplyTo
[mRoomMessageContentMessageEdit] :: MRoomMessageContent -> Maybe MessageEdit
newtype InReplyTo
InReplyTo :: EventId -> InReplyTo
[inReplyToEventId] :: InReplyTo -> EventId
mInReplyToKey :: IsString s => s
htmlBodyFormatValue :: IsString s => s
data MessageEdit
MessageEdit :: MTextType -> Text -> Maybe Text -> EventId -> MessageEdit
[messageEditMsgtype] :: MessageEdit -> MTextType
[messageEditNewContentBody] :: MessageEdit -> Text
[messageEditNewContentHtmlBody] :: MessageEdit -> Maybe Text
[messageEditRelatedTo] :: MessageEdit -> EventId
mNewContentKey :: IsString s => s
mReplaceType :: IsString s => s
newtype MReactionContent
MReactionContent :: RelatesTo -> MReactionContent
[mReactionContentMRelatesTo] :: MReactionContent -> RelatesTo
mRelatedToKey :: IsString s => s
data RelatesTo
RelatesTo :: EventId -> Text -> MEventTypeOneOf '[ 'MAnnotationType] -> RelatesTo
[relatesToEventId] :: RelatesTo -> EventId
[relatesToKey] :: RelatesTo -> Text
[relatesToRelType] :: RelatesTo -> MEventTypeOneOf '[ 'MAnnotationType]
mTypeGenericParseJSON :: (Bounded a, Enum a, Typeable a, ToJSON a) => Value -> Parser a
instance GHC.Enum.Bounded MatrixBot.MatrixApi.MAudioType
instance GHC.Enum.Bounded MatrixBot.MatrixApi.MFileType
instance GHC.Enum.Bounded MatrixBot.MatrixApi.MImageType
instance GHC.Enum.Bounded MatrixBot.MatrixApi.MTextType
instance GHC.Enum.Bounded MatrixBot.MatrixApi.MVideoType
instance GHC.Enum.Bounded MatrixBot.MatrixApi.RoomVisibility
instance GHC.Enum.Enum MatrixBot.MatrixApi.MAudioType
instance GHC.Enum.Enum MatrixBot.MatrixApi.MFileType
instance GHC.Enum.Enum MatrixBot.MatrixApi.MImageType
instance GHC.Enum.Enum MatrixBot.MatrixApi.MTextType
instance GHC.Enum.Enum MatrixBot.MatrixApi.MVideoType
instance GHC.Enum.Enum MatrixBot.MatrixApi.RoomVisibility
instance GHC.Classes.Eq MatrixBot.MatrixApi.ClientEvent
instance GHC.Classes.Eq (MatrixBot.MatrixApi.ClientEventGeneric Data.Functor.Identity.Identity)
instance GHC.Classes.Eq (MatrixBot.MatrixApi.ClientEventGeneric GHC.Maybe.Maybe)
instance GHC.Classes.Eq MatrixBot.MatrixApi.EventResponse
instance GHC.Classes.Eq MatrixBot.MatrixApi.EventsResponse
instance GHC.Classes.Eq MatrixBot.MatrixApi.InReplyTo
instance GHC.Classes.Eq MatrixBot.MatrixApi.ListRoomResponse
instance GHC.Classes.Eq MatrixBot.MatrixApi.LoginRequest
instance GHC.Classes.Eq MatrixBot.MatrixApi.LoginResponse
instance GHC.Classes.Eq MatrixBot.MatrixApi.MAudioType
instance GHC.Classes.Eq MatrixBot.MatrixApi.MFileType
instance GHC.Classes.Eq MatrixBot.MatrixApi.MImageType
instance GHC.Classes.Eq MatrixBot.MatrixApi.MReactionContent
instance GHC.Classes.Eq MatrixBot.MatrixApi.MRoomMessageClientEvent
instance GHC.Classes.Eq MatrixBot.MatrixApi.MRoomMessageClientEventContent
instance GHC.Classes.Eq MatrixBot.MatrixApi.MRoomMessageContent
instance GHC.Classes.Eq MatrixBot.MatrixApi.MRoomMessageMAudioMsgtypeClientEventContent
instance GHC.Classes.Eq MatrixBot.MatrixApi.MRoomMessageMFileMsgtypeClientEventContent
instance GHC.Classes.Eq MatrixBot.MatrixApi.MRoomMessageMImageMsgtypeClientEventContent
instance GHC.Classes.Eq MatrixBot.MatrixApi.MRoomMessageMTextMsgtypeClientEventContent
instance GHC.Classes.Eq MatrixBot.MatrixApi.MRoomMessageMVideoMsgtypeClientEventContent
instance GHC.Classes.Eq MatrixBot.MatrixApi.MTextType
instance GHC.Classes.Eq MatrixBot.MatrixApi.MVideoType
instance GHC.Classes.Eq MatrixBot.MatrixApi.MessageEdit
instance GHC.Classes.Eq MatrixBot.MatrixApi.RelatesTo
instance GHC.Classes.Eq MatrixBot.MatrixApi.RoomVisibility
instance GHC.Classes.Eq MatrixBot.MatrixApi.UserFilter
instance GHC.Classes.Eq MatrixBot.MatrixApi.UserFilterIdResponse
instance Data.Aeson.Types.FromJSON.FromJSON MatrixBot.MatrixApi.ClientEvent
instance Data.Aeson.Types.FromJSON.FromJSON (MatrixBot.MatrixApi.ClientEventGeneric Data.Functor.Identity.Identity)
instance Data.Aeson.Types.FromJSON.FromJSON (MatrixBot.MatrixApi.ClientEventGeneric GHC.Maybe.Maybe)
instance Data.Aeson.Types.FromJSON.FromJSON MatrixBot.MatrixApi.EventResponse
instance Data.Aeson.Types.FromJSON.FromJSON MatrixBot.MatrixApi.EventsResponse
instance Data.Aeson.Types.FromJSON.FromJSON MatrixBot.MatrixApi.InReplyTo
instance Data.Aeson.Types.FromJSON.FromJSON MatrixBot.MatrixApi.ListRoomResponse
instance Data.Aeson.Types.FromJSON.FromJSON MatrixBot.MatrixApi.LoginRequest
instance Data.Aeson.Types.FromJSON.FromJSON MatrixBot.MatrixApi.LoginResponse
instance Data.Aeson.Types.FromJSON.FromJSON MatrixBot.MatrixApi.MAudioType
instance Data.Aeson.Types.FromJSON.FromJSON MatrixBot.MatrixApi.MFileType
instance Data.Aeson.Types.FromJSON.FromJSON MatrixBot.MatrixApi.MImageType
instance Data.Aeson.Types.FromJSON.FromJSON MatrixBot.MatrixApi.MReactionContent
instance Data.Aeson.Types.FromJSON.FromJSON MatrixBot.MatrixApi.MRoomMessageClientEvent
instance Data.Aeson.Types.FromJSON.FromJSON MatrixBot.MatrixApi.MRoomMessageClientEventContent
instance Data.Aeson.Types.FromJSON.FromJSON MatrixBot.MatrixApi.MRoomMessageContent
instance Data.Aeson.Types.FromJSON.FromJSON MatrixBot.MatrixApi.MRoomMessageMAudioMsgtypeClientEventContent
instance Data.Aeson.Types.FromJSON.FromJSON MatrixBot.MatrixApi.MRoomMessageMFileMsgtypeClientEventContent
instance Data.Aeson.Types.FromJSON.FromJSON MatrixBot.MatrixApi.MRoomMessageMImageMsgtypeClientEventContent
instance Data.Aeson.Types.FromJSON.FromJSON MatrixBot.MatrixApi.MRoomMessageMTextMsgtypeClientEventContent
instance Data.Aeson.Types.FromJSON.FromJSON MatrixBot.MatrixApi.MRoomMessageMVideoMsgtypeClientEventContent
instance Data.Aeson.Types.FromJSON.FromJSON MatrixBot.MatrixApi.MTextType
instance Data.Aeson.Types.FromJSON.FromJSON MatrixBot.MatrixApi.MVideoType
instance Data.Aeson.Types.FromJSON.FromJSON MatrixBot.MatrixApi.RelatesTo
instance Data.Aeson.Types.FromJSON.FromJSON MatrixBot.MatrixApi.RoomVisibility
instance Data.Aeson.Types.FromJSON.FromJSON MatrixBot.MatrixApi.UserFilter
instance Data.Aeson.Types.FromJSON.FromJSON MatrixBot.MatrixApi.UserFilterIdResponse
instance GHC.Generics.Generic MatrixBot.MatrixApi.ClientEvent
instance GHC.Generics.Generic (MatrixBot.MatrixApi.ClientEventGeneric f)
instance GHC.Generics.Generic MatrixBot.MatrixApi.EventResponse
instance GHC.Generics.Generic MatrixBot.MatrixApi.EventsResponse
instance GHC.Generics.Generic MatrixBot.MatrixApi.InReplyTo
instance GHC.Generics.Generic MatrixBot.MatrixApi.ListRoomResponse
instance GHC.Generics.Generic MatrixBot.MatrixApi.LoginRequest
instance GHC.Generics.Generic MatrixBot.MatrixApi.LoginResponse
instance GHC.Generics.Generic MatrixBot.MatrixApi.MReactionContent
instance GHC.Generics.Generic MatrixBot.MatrixApi.MRoomMessageClientEvent
instance GHC.Generics.Generic MatrixBot.MatrixApi.MRoomMessageClientEventContent
instance GHC.Generics.Generic MatrixBot.MatrixApi.MRoomMessageContent
instance GHC.Generics.Generic MatrixBot.MatrixApi.MRoomMessageMAudioMsgtypeClientEventContent
instance GHC.Generics.Generic MatrixBot.MatrixApi.MRoomMessageMFileMsgtypeClientEventContent
instance GHC.Generics.Generic MatrixBot.MatrixApi.MRoomMessageMImageMsgtypeClientEventContent
instance GHC.Generics.Generic MatrixBot.MatrixApi.MRoomMessageMTextMsgtypeClientEventContent
instance GHC.Generics.Generic MatrixBot.MatrixApi.MRoomMessageMVideoMsgtypeClientEventContent
instance GHC.Generics.Generic MatrixBot.MatrixApi.MessageEdit
instance GHC.Generics.Generic MatrixBot.MatrixApi.RelatesTo
instance GHC.Generics.Generic MatrixBot.MatrixApi.UserFilter
instance GHC.Generics.Generic MatrixBot.MatrixApi.UserFilterIdResponse
instance MatrixBot.MatrixApi.MsgtypeString MatrixBot.MatrixApi.MAudioType
instance MatrixBot.MatrixApi.MsgtypeString MatrixBot.MatrixApi.MFileType
instance MatrixBot.MatrixApi.MsgtypeString MatrixBot.MatrixApi.MImageType
instance MatrixBot.MatrixApi.MsgtypeString MatrixBot.MatrixApi.MTextType
instance MatrixBot.MatrixApi.MsgtypeString MatrixBot.MatrixApi.MVideoType
instance GHC.Show.Show MatrixBot.MatrixApi.ClientEvent
instance GHC.Show.Show (MatrixBot.MatrixApi.ClientEventGeneric Data.Functor.Identity.Identity)
instance GHC.Show.Show (MatrixBot.MatrixApi.ClientEventGeneric GHC.Maybe.Maybe)
instance GHC.Show.Show MatrixBot.MatrixApi.EventResponse
instance GHC.Show.Show MatrixBot.MatrixApi.EventsResponse
instance GHC.Show.Show MatrixBot.MatrixApi.InReplyTo
instance GHC.Show.Show MatrixBot.MatrixApi.ListRoomResponse
instance GHC.Show.Show MatrixBot.MatrixApi.LoginRequest
instance GHC.Show.Show MatrixBot.MatrixApi.LoginResponse
instance GHC.Show.Show MatrixBot.MatrixApi.MAudioType
instance GHC.Show.Show MatrixBot.MatrixApi.MFileType
instance GHC.Show.Show MatrixBot.MatrixApi.MImageType
instance GHC.Show.Show MatrixBot.MatrixApi.MReactionContent
instance GHC.Show.Show MatrixBot.MatrixApi.MRoomMessageClientEvent
instance GHC.Show.Show MatrixBot.MatrixApi.MRoomMessageClientEventContent
instance GHC.Show.Show MatrixBot.MatrixApi.MRoomMessageContent
instance GHC.Show.Show MatrixBot.MatrixApi.MRoomMessageMAudioMsgtypeClientEventContent
instance GHC.Show.Show MatrixBot.MatrixApi.MRoomMessageMFileMsgtypeClientEventContent
instance GHC.Show.Show MatrixBot.MatrixApi.MRoomMessageMImageMsgtypeClientEventContent
instance GHC.Show.Show MatrixBot.MatrixApi.MRoomMessageMTextMsgtypeClientEventContent
instance GHC.Show.Show MatrixBot.MatrixApi.MRoomMessageMVideoMsgtypeClientEventContent
instance GHC.Show.Show MatrixBot.MatrixApi.MTextType
instance GHC.Show.Show MatrixBot.MatrixApi.MVideoType
instance GHC.Show.Show MatrixBot.MatrixApi.MessageEdit
instance GHC.Show.Show MatrixBot.MatrixApi.RelatesTo
instance GHC.Show.Show MatrixBot.MatrixApi.RoomVisibility
instance GHC.Show.Show MatrixBot.MatrixApi.UserFilter
instance GHC.Show.Show MatrixBot.MatrixApi.UserFilterIdResponse
instance Web.Internal.HttpApiData.ToHttpApiData MatrixBot.MatrixApi.MAudioType
instance Web.Internal.HttpApiData.ToHttpApiData MatrixBot.MatrixApi.MFileType
instance Web.Internal.HttpApiData.ToHttpApiData MatrixBot.MatrixApi.MImageType
instance Web.Internal.HttpApiData.ToHttpApiData MatrixBot.MatrixApi.MTextType
instance Web.Internal.HttpApiData.ToHttpApiData MatrixBot.MatrixApi.MVideoType
instance Data.Aeson.Types.ToJSON.ToJSON MatrixBot.MatrixApi.ClientEvent
instance Data.Aeson.Types.ToJSON.ToJSON (MatrixBot.MatrixApi.ClientEventGeneric Data.Functor.Identity.Identity)
instance Data.Aeson.Types.ToJSON.ToJSON (MatrixBot.MatrixApi.ClientEventGeneric GHC.Maybe.Maybe)
instance Data.Aeson.Types.ToJSON.ToJSON MatrixBot.MatrixApi.EventResponse
instance Data.Aeson.Types.ToJSON.ToJSON MatrixBot.MatrixApi.EventsResponse
instance Data.Aeson.Types.ToJSON.ToJSON MatrixBot.MatrixApi.InReplyTo
instance Data.Aeson.Types.ToJSON.ToJSON MatrixBot.MatrixApi.ListRoomResponse
instance Data.Aeson.Types.ToJSON.ToJSON MatrixBot.MatrixApi.LoginRequest
instance Data.Aeson.Types.ToJSON.ToJSON MatrixBot.MatrixApi.LoginResponse
instance Data.Aeson.Types.ToJSON.ToJSON MatrixBot.MatrixApi.MAudioType
instance Data.Aeson.Types.ToJSON.ToJSON MatrixBot.MatrixApi.MFileType
instance Data.Aeson.Types.ToJSON.ToJSON MatrixBot.MatrixApi.MImageType
instance Data.Aeson.Types.ToJSON.ToJSON MatrixBot.MatrixApi.MReactionContent
instance Data.Aeson.Types.ToJSON.ToJSON MatrixBot.MatrixApi.MRoomMessageClientEvent
instance Data.Aeson.Types.ToJSON.ToJSON MatrixBot.MatrixApi.MRoomMessageClientEventContent
instance Data.Aeson.Types.ToJSON.ToJSON MatrixBot.MatrixApi.MRoomMessageContent
instance Data.Aeson.Types.ToJSON.ToJSON MatrixBot.MatrixApi.MRoomMessageMAudioMsgtypeClientEventContent
instance Data.Aeson.Types.ToJSON.ToJSON MatrixBot.MatrixApi.MRoomMessageMFileMsgtypeClientEventContent
instance Data.Aeson.Types.ToJSON.ToJSON MatrixBot.MatrixApi.MRoomMessageMImageMsgtypeClientEventContent
instance Data.Aeson.Types.ToJSON.ToJSON MatrixBot.MatrixApi.MRoomMessageMTextMsgtypeClientEventContent
instance Data.Aeson.Types.ToJSON.ToJSON MatrixBot.MatrixApi.MRoomMessageMVideoMsgtypeClientEventContent
instance Data.Aeson.Types.ToJSON.ToJSON MatrixBot.MatrixApi.MTextType
instance Data.Aeson.Types.ToJSON.ToJSON MatrixBot.MatrixApi.MVideoType
instance Data.Aeson.Types.ToJSON.ToJSON MatrixBot.MatrixApi.MessageEdit
instance Data.Aeson.Types.ToJSON.ToJSON MatrixBot.MatrixApi.RelatesTo
instance Data.Aeson.Types.ToJSON.ToJSON MatrixBot.MatrixApi.RoomVisibility
instance Data.Aeson.Types.ToJSON.ToJSON MatrixBot.MatrixApi.UserFilter
instance Data.Aeson.Types.ToJSON.ToJSON MatrixBot.MatrixApi.UserFilterIdResponse


-- | Logging-related helpers for the Bot Jobs implementation
module MatrixBot.Bot.Jobs.Log

-- | Log Bot Job being handled event (job event response ID)
logEventResponse :: MonadLogger m => EventResponse -> m ()


-- | Bot operation retrying mechanics
module MatrixBot.Bot.Retry

-- | Catch <a>Servant.ClientError</a> exception (which is probably some
--   connectivity issue) and retry
--   
--   It fails immediately if <a>Servant.ClientError</a> is an authorization
--   failure. Also fails immediately if it’s any other exception but
--   <a>Servant.ClientError</a>.
retryOnClientError :: (MonadMask m, MonadLogger m, MonadIO m, MonadReader r m, HasRetryParams r) => m a -> m a

module MatrixBot.Bot.Jobs.Handlers.SendReaction

-- | Leave a reaction for a Matrix room event
sendReaction :: (MonadIO m, MonadFail m, MonadCatch m, MonadLogger m) => MatrixApiClient -> AuthenticatedRequest (AuthProtect "access-token") -> TransactionId -> RoomId -> EventId -> Text -> m (Maybe EventResponse)
instance GHC.Classes.Eq MatrixBot.Bot.Jobs.Handlers.SendReaction.ErrorResponse
instance Data.Aeson.Types.FromJSON.FromJSON MatrixBot.Bot.Jobs.Handlers.SendReaction.ErrorResponse
instance GHC.Generics.Generic MatrixBot.Bot.Jobs.Handlers.SendReaction.ErrorResponse
instance GHC.Show.Show MatrixBot.Bot.Jobs.Handlers.SendReaction.ErrorResponse
instance Data.Aeson.Types.ToJSON.ToJSON MatrixBot.Bot.Jobs.Handlers.SendReaction.ErrorResponse

module MatrixBot.Bot.Jobs.Handlers.SendMessage

-- | Send a text message to a Matrix room
sendMessage :: (MonadIO m, MonadFail m, MonadThrow m, MonadLogger m) => MatrixApiClient -> AuthenticatedRequest (AuthProtect "access-token") -> TransactionId -> RoomId -> Maybe EventId -> Maybe Text -> Text -> Maybe MessageEdit -> m EventResponse
data MessageEdit
MessageEdit :: EventId -> Text -> Maybe Text -> MessageEdit
[messageEditMessageId] :: MessageEdit -> EventId
[messageEditNewText] :: MessageEdit -> Text
[messageEditNewHtml] :: MessageEdit -> Maybe Text
instance GHC.Classes.Eq MatrixBot.Bot.Jobs.Handlers.SendMessage.MessageEdit
instance GHC.Show.Show MatrixBot.Bot.Jobs.Handlers.SendMessage.MessageEdit

module MatrixBot.Bot.Jobs.BotJob

-- | A single Bot Job
data BotJob
BotJobSendReaction :: TransactionId -> RoomId -> EventId -> Text -> BotJob

-- | Send a message (<tt>Maybe T.EventId</tt> means in reply to this event
--   ID, <tt>Maybe Text</tt> is optional HTML-formatted body to be paired
--   with plain text body)
BotJobSendMessage :: TransactionId -> RoomId -> Maybe EventId -> Maybe Text -> Text -> BotJob
instance GHC.Classes.Eq MatrixBot.Bot.Jobs.BotJob.BotJob
instance GHC.Show.Show MatrixBot.Bot.Jobs.BotJob.BotJob

module MatrixBot.Bot.Jobs.Queue

-- | A queue of Bot Jobs interface
data BotJobsQueue
BotJobsQueue :: (BotJob -> STM ()) -> STM BotJob -> BotJobsQueue
[sendJob] :: BotJobsQueue -> BotJob -> STM ()

-- | Blocking operation (will wait for another job to appear)
[getNextJob] :: BotJobsQueue -> STM BotJob
mkBotJobsQueue :: MonadIO m => m BotJobsQueue
class HasBotJobsReader r
botJobsReader :: HasBotJobsReader r => Getter r (STM BotJob)
class HasBotJobsWriter r
botJobsWriter :: HasBotJobsWriter r => Getter r (BotJob -> STM ())
instance MatrixBot.Bot.Jobs.Queue.HasBotJobsReader MatrixBot.Bot.Jobs.Queue.BotJobsQueue
instance MatrixBot.Bot.Jobs.Queue.HasBotJobsWriter MatrixBot.Bot.Jobs.Queue.BotJobsQueue


-- | Events filtering implementation
module MatrixBot.Bot.EventsListener.Filters
type UsersFilter = NonEmpty Mxid
filterByUser :: forall (m :: Type -> Type). MonadLogger m => Maybe UsersFilter -> Mxid -> ExceptT Text m ()
type RoomsFilter = NonEmpty RoomId
filterByRoom :: forall (m :: Type -> Type). MonadLogger m => Maybe RoomsFilter -> RoomId -> ExceptT Text m ()
type MediaMsgtypeFilter = NonEmpty MediaMsgtype
data MediaMsgtype
MediaMsgtype_File :: MediaMsgtype
MediaMsgtype_Image :: MediaMsgtype
MediaMsgtype_Video :: MediaMsgtype
MediaMsgtype_Audio :: MediaMsgtype
filterByMediaMsgtype :: forall (m :: Type -> Type). MonadLogger m => Maybe MediaMsgtypeFilter -> MRoomMessageClientEventContent -> ExceptT Text m ()
instance GHC.Enum.Bounded MatrixBot.Bot.EventsListener.Filters.MediaMsgtype
instance GHC.Enum.Enum MatrixBot.Bot.EventsListener.Filters.MediaMsgtype
instance GHC.Classes.Eq MatrixBot.Bot.EventsListener.Filters.MediaMsgtype
instance Data.Aeson.Types.FromJSON.FromJSON MatrixBot.Bot.EventsListener.Filters.MediaMsgtype
instance GHC.Generics.Generic MatrixBot.Bot.EventsListener.Filters.MediaMsgtype
instance GHC.Show.Show MatrixBot.Bot.EventsListener.Filters.MediaMsgtype
instance Data.Aeson.Types.ToJSON.ToJSON MatrixBot.Bot.EventsListener.Filters.MediaMsgtype

module MatrixBot.Bot.BotConfig

-- | Bot configuration
--   
--   Note that feature configuration is a list of entries. It means a list
--   of filters and applied action in case a filter is matching. An event
--   will go through all such entries and apply each that would have its
--   filter matching the event.
data BotConfig
BotConfig :: Maybe [BotConfigReactToUsers] -> Maybe [BotConfigReplyToMedia] -> BotConfig
[botConfigReactToUsers] :: BotConfig -> Maybe [BotConfigReactToUsers]
[botConfigReplyToMedia] :: BotConfig -> Maybe [BotConfigReplyToMedia]

-- | Bot configuration entry for “react-to-users" feature
data BotConfigReactToUsers
BotConfigReactToUsers :: Maybe UsersFilter -> Maybe RoomsFilter -> NonEmpty Text -> BotConfigReactToUsers
[botConfigReactToUsersUsersFilter] :: BotConfigReactToUsers -> Maybe UsersFilter
[botConfigReactToUsersRoomsFilter] :: BotConfigReactToUsers -> Maybe RoomsFilter

-- | A list of reactions to leave for an event (a list of reactions must be
--   non-empty, otherwise the whole section does not make sense)
[botConfigReactToUsersLeaveReactions] :: BotConfigReactToUsers -> NonEmpty Text

-- | Bot configuration entry for “reply-to-media" feature
data BotConfigReplyToMedia
BotConfigReplyToMedia :: Maybe UsersFilter -> Maybe RoomsFilter -> Maybe MediaMsgtypeFilter -> [BotConfigReplyToMedia_MessageTemplateEntry] -> Maybe [BotConfigReplyToMedia_MessageTemplateEntry] -> BotConfigReplyToMedia
[botConfigReplyToMediaUsersFilter] :: BotConfigReplyToMedia -> Maybe UsersFilter
[botConfigReplyToMediaRoomsFilter] :: BotConfigReplyToMedia -> Maybe RoomsFilter
[botConfigReplyToMediaMsgtypeFilter] :: BotConfigReplyToMedia -> Maybe MediaMsgtypeFilter

-- | Message template, a list of entries that will be just concatenated
[botConfigReplyToMediaMessageTemplate] :: BotConfigReplyToMedia -> [BotConfigReplyToMedia_MessageTemplateEntry]

-- | Optional HTML-formatted message template, to be paired with the plain
--   text template
[botConfigReplyToMediaHtmlMessageTemplate] :: BotConfigReplyToMedia -> Maybe [BotConfigReplyToMedia_MessageTemplateEntry]

-- | Either a plain string or a special entry for a dynamic value
--   substitution
data BotConfigReplyToMedia_MessageTemplateEntry
BotConfigReplyToMedia_MessageTemplateEntry_PlainString :: Text -> BotConfigReplyToMedia_MessageTemplateEntry
BotConfigReplyToMedia_MessageTemplateEntry_DynamicSubstitution_Field :: BotConfigReplyToMedia_DynamicFieldName -> BotConfigReplyToMedia_MessageTemplateEntry
BotConfigReplyToMedia_MessageTemplateEntry_DynamicSubstitution_ExtractedValue :: BotConfigReplyToMedia_DynamicExtractedValueName -> BotConfigReplyToMedia_MessageTemplateEntry
data BotConfigReplyToMedia_DynamicFieldName

-- | <tt>msgtype</tt> — For example <tt>m.image</tt>
BotConfigReplyToMedia_DynamicFieldName_MsgType :: BotConfigReplyToMedia_DynamicFieldName

-- | <tt>body</tt> — Contains file name
BotConfigReplyToMedia_DynamicFieldName_Body :: BotConfigReplyToMedia_DynamicFieldName

-- | <tt>body</tt> — Contains file name
BotConfigReplyToMedia_DynamicFieldName_Url :: BotConfigReplyToMedia_DynamicFieldName
data BotConfigReplyToMedia_DynamicExtractedValueName

-- | <tt>media_id</tt> — Contains media file identifier, can be used to
--   form a direct HTTP link
BotConfigReplyToMedia_DynamicExtractedValueName_MediaId :: BotConfigReplyToMedia_DynamicExtractedValueName
instance GHC.Enum.Bounded MatrixBot.Bot.BotConfig.BotConfigReplyToMedia_DynamicExtractedValueName
instance GHC.Enum.Bounded MatrixBot.Bot.BotConfig.BotConfigReplyToMedia_DynamicFieldName
instance GHC.Enum.Enum MatrixBot.Bot.BotConfig.BotConfigReplyToMedia_DynamicExtractedValueName
instance GHC.Enum.Enum MatrixBot.Bot.BotConfig.BotConfigReplyToMedia_DynamicFieldName
instance GHC.Classes.Eq MatrixBot.Bot.BotConfig.BotConfig
instance GHC.Classes.Eq MatrixBot.Bot.BotConfig.BotConfigReactToUsers
instance GHC.Classes.Eq MatrixBot.Bot.BotConfig.BotConfigReplyToMedia
instance GHC.Classes.Eq MatrixBot.Bot.BotConfig.BotConfigReplyToMedia_DynamicExtractedValueName
instance GHC.Classes.Eq MatrixBot.Bot.BotConfig.BotConfigReplyToMedia_DynamicFieldName
instance GHC.Classes.Eq MatrixBot.Bot.BotConfig.BotConfigReplyToMedia_MessageTemplateEntry
instance Data.Aeson.Types.FromJSON.FromJSON MatrixBot.Bot.BotConfig.BotConfig
instance Data.Aeson.Types.FromJSON.FromJSON MatrixBot.Bot.BotConfig.BotConfigReactToUsers
instance Data.Aeson.Types.FromJSON.FromJSON MatrixBot.Bot.BotConfig.BotConfigReplyToMedia
instance Data.Aeson.Types.FromJSON.FromJSON MatrixBot.Bot.BotConfig.BotConfigReplyToMedia_DynamicExtractedValueName
instance Data.Aeson.Types.FromJSON.FromJSON MatrixBot.Bot.BotConfig.BotConfigReplyToMedia_DynamicFieldName
instance Data.Aeson.Types.FromJSON.FromJSON MatrixBot.Bot.BotConfig.BotConfigReplyToMedia_MessageTemplateEntry
instance GHC.Generics.Generic MatrixBot.Bot.BotConfig.BotConfig
instance GHC.Generics.Generic MatrixBot.Bot.BotConfig.BotConfigReactToUsers
instance GHC.Generics.Generic MatrixBot.Bot.BotConfig.BotConfigReplyToMedia
instance GHC.Generics.Generic MatrixBot.Bot.BotConfig.BotConfigReplyToMedia_DynamicExtractedValueName
instance GHC.Generics.Generic MatrixBot.Bot.BotConfig.BotConfigReplyToMedia_DynamicFieldName
instance GHC.Generics.Generic MatrixBot.Bot.BotConfig.BotConfigReplyToMedia_MessageTemplateEntry
instance GHC.Show.Show MatrixBot.Bot.BotConfig.BotConfig
instance GHC.Show.Show MatrixBot.Bot.BotConfig.BotConfigReactToUsers
instance GHC.Show.Show MatrixBot.Bot.BotConfig.BotConfigReplyToMedia
instance GHC.Show.Show MatrixBot.Bot.BotConfig.BotConfigReplyToMedia_DynamicExtractedValueName
instance GHC.Show.Show MatrixBot.Bot.BotConfig.BotConfigReplyToMedia_DynamicFieldName
instance GHC.Show.Show MatrixBot.Bot.BotConfig.BotConfigReplyToMedia_MessageTemplateEntry
instance Data.Aeson.Types.ToJSON.ToJSON MatrixBot.Bot.BotConfig.BotConfig
instance Data.Aeson.Types.ToJSON.ToJSON MatrixBot.Bot.BotConfig.BotConfigReactToUsers
instance Data.Aeson.Types.ToJSON.ToJSON MatrixBot.Bot.BotConfig.BotConfigReplyToMedia
instance Data.Aeson.Types.ToJSON.ToJSON MatrixBot.Bot.BotConfig.BotConfigReplyToMedia_DynamicExtractedValueName
instance Data.Aeson.Types.ToJSON.ToJSON MatrixBot.Bot.BotConfig.BotConfigReplyToMedia_DynamicFieldName
instance Data.Aeson.Types.ToJSON.ToJSON MatrixBot.Bot.BotConfig.BotConfigReplyToMedia_MessageTemplateEntry


-- | Authentication-related stuff
module MatrixBot.Auth
authenticate :: (MonadIO m, MonadFail m, MonadUnliftIO m, MonadThrow m, MonadLogger m) => Mxid -> Password -> m Credentials
getAuthenticatedMatrixRequest :: (MonadReader r m, HasCredentials r) => m (AuthenticatedRequest (AuthProtect "access-token"))

-- | Set of credentials used for authentication
data Credentials
Credentials :: Username -> HomeServer -> AccessToken -> Credentials
[credentialsUsername] :: Credentials -> Username
[credentialsHomeServer] :: Credentials -> HomeServer
[credentialsAccessToken] :: Credentials -> AccessToken
class HasCredentials r
credentials :: HasCredentials r => Lens' r Credentials
instance GHC.Classes.Eq MatrixBot.Auth.Credentials
instance Data.Aeson.Types.FromJSON.FromJSON MatrixBot.Auth.Credentials
instance GHC.Generics.Generic MatrixBot.Auth.Credentials
instance MatrixBot.Auth.HasCredentials MatrixBot.Auth.Credentials
instance GHC.Show.Show MatrixBot.Auth.Credentials
instance Data.Aeson.Types.ToJSON.ToJSON MatrixBot.Auth.Credentials

module MatrixBot.Bot.BotM

-- | Main Bot Monad Constraint type
type BotM r (m :: Type -> Type) = (MonadIO m, MonadUnliftIO m, MonadFail m, MonadMask m, MonadReader r m, MonadLogger m, HasCredentials r, HasRetryParams r)

module MatrixBot.Bot.SmokeTest

-- | A smoke test to run to check Matrix API can be called using current
--   authentication.
--   
--   Intended to be run at startup, before doing anything else.
startupSmokeTest :: BotM r m => MatrixApiClient -> AuthenticatedRequest (AuthProtect "access-token") -> m ()


-- | Main handling entrypoint, other handlers are brached from here.
module MatrixBot.Bot.Jobs.Handlers.MainHandler

-- | Bot Jobs handler (infinite loop of reading new jobs and performing
--   them)
jobsHandler :: (BotM r m, HasBotJobsReader r) => MatrixApiClient -> AuthenticatedRequest (AuthProtect "access-token") -> m ()

module MatrixBot.Bot.EventsListener.Handlers.ReplyToMedia

-- | Process <tt>m.room.message</tt> event and see if there is a need to
--   reply to an event with a message template.
replyToMedia :: (BotM r m, HasBotJobsWriter r) => [BotConfigReplyToMedia] -> RoomId -> Mxid -> EventId -> MRoomMessageClientEventContent -> m ()
instance GHC.Classes.Eq MatrixBot.Bot.EventsListener.Handlers.ReplyToMedia.ExtractedMediaValues
instance GHC.Classes.Eq MatrixBot.Bot.EventsListener.Handlers.ReplyToMedia.MediaEventData
instance GHC.Show.Show MatrixBot.Bot.EventsListener.Handlers.ReplyToMedia.ExtractedMediaValues
instance GHC.Show.Show MatrixBot.Bot.EventsListener.Handlers.ReplyToMedia.MediaEventData

module MatrixBot.Bot.EventsListener.Handlers.ReactToUsers

-- | Process <tt>m.room.message</tt> event and see if there is a need to
--   leave a reaction for it.
reactToUsers :: (BotM r m, HasBotJobsWriter r) => [BotConfigReactToUsers] -> RoomId -> Mxid -> EventId -> m ()

module MatrixBot.Bot.EventsListener

-- | Matrix rooms events listener handler
--   
--   Read new chunks of events and process them in an infinite loop.
eventsListener :: (BotM r m, HasBotJobsWriter r) => Maybe FilePath -> EventsTimeout -> BotConfig -> MatrixApiClient -> AuthenticatedRequest (AuthProtect "access-token") -> m ()

module MatrixBot.Bot
startTheBot :: (BotM r m, HasBotJobsReader r, HasBotJobsWriter r) => Maybe FilePath -> EventsTimeout -> BotConfig -> m ()

-- | Run a monad supplied via arguments with Matrix API HTTP request maker
--   and authentication
withReqAndAuth :: (MonadIO m, MonadUnliftIO m, MonadThrow m, MonadLogger m, MonadReader r m, HasCredentials r) => EventsTimeout -> (MatrixApiClient -> AuthenticatedRequest (AuthProtect "access-token") -> m a) -> m a


-- | Application startup module
module MatrixBot.App
runApp :: AppM m => m ()
instance GHC.Classes.Eq MatrixBot.App.SendMessageResponse
instance Data.Aeson.Types.FromJSON.FromJSON MatrixBot.App.SendMessageResponse
instance GHC.Generics.Generic MatrixBot.App.SendMessageResponse
instance MatrixBot.Bot.Jobs.Queue.HasBotJobsReader MatrixBot.App.BotEnv
instance MatrixBot.Bot.Jobs.Queue.HasBotJobsWriter MatrixBot.App.BotEnv
instance MatrixBot.Auth.HasCredentials MatrixBot.App.BotEnv
instance MatrixBot.SharedTypes.HasRetryParams MatrixBot.App.BotEnv
instance GHC.Show.Show MatrixBot.App.SendMessageResponse
instance Data.Aeson.Types.ToJSON.ToJSON MatrixBot.App.SendMessageResponse
