Copyright | (c) 2021 Rory Tyler Hayford |
---|---|
License | BSD-3-Clause |
Maintainer | rory.hayford@protonmail.com |
Stability | experimental |
Portability | GHC |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- getLiveThread :: MonadReddit m => LiveThreadID -> m LiveThread
- getLiveInfo :: (MonadReddit m, Foldable t) => t LiveThreadID -> Paginator LiveThreadID LiveThread -> m (Listing LiveThreadID LiveThread)
- getAllLiveInfo :: (MonadReddit m, Traversable t) => t LiveThreadID -> m (Seq LiveThread)
- getLiveUpdates :: MonadReddit m => LiveThreadID -> Paginator LiveUpdateID LiveUpdate -> m (Listing LiveUpdateID LiveUpdate)
- getLiveUpdate :: MonadReddit m => LiveThreadID -> LiveUpdateID -> m LiveUpdate
- getLiveDiscussions :: MonadReddit m => LiveThreadID -> Paginator SubmissionID Submission -> m (Listing SubmissionID Submission)
- getLiveContributors :: MonadReddit m => LiveThreadID -> m (Seq LiveContributor)
- reportLiveThread :: MonadReddit m => LiveReportType -> LiveThreadID -> m ()
- createLiveThread :: MonadReddit m => NewLiveThread -> m LiveThread
- closeLiveThread :: MonadReddit m => LiveThreadID -> m ()
- updateLiveThread :: MonadReddit m => LiveThreadID -> UpdatedLiveThread -> m ()
- addLiveUpdate :: MonadReddit m => LiveThreadID -> Body -> m ()
- strikeLiveUpdate :: MonadReddit m => LiveThreadID -> LiveUpdateID -> m ()
- deleteLiveUpdate :: MonadReddit m => LiveThreadID -> LiveUpdateID -> m ()
- removeLiveContributor :: MonadReddit m => LiveThreadID -> UserID -> m ()
- removeLiveContributorByName :: MonadReddit m => LiveThreadID -> Username -> m ()
- updateLiveContributor :: (MonadReddit m, Foldable t) => Maybe (t LivePermission) -> LiveThreadID -> Username -> m ()
- abdicateLiveContributor :: MonadReddit m => LiveThreadID -> m ()
- inviteLiveContributor :: MonadReddit m => LiveThreadID -> Username -> m ()
- inviteLiveContributorWithPerms :: (MonadReddit m, Foldable t) => t LivePermission -> LiveThreadID -> Username -> m ()
- revokeLiveInvitation :: MonadReddit m => LiveThreadID -> UserID -> m ()
- revokeLiveInvitationByName :: MonadReddit m => LiveThreadID -> Username -> m ()
- data LiveReportType
- data LivePermission
- data LiveContributor = LiveContributor UserID Username (Seq LivePermission)
- data LiveUpdateEmbed = LiveUpdateEmbed URL (Maybe Integer) (Maybe Integer)
- newtype LiveUpdateID = LiveUpdateID Text
- data LiveUpdate = LiveUpdate LiveUpdateID (Maybe Username) Body Body Bool (Seq LiveUpdateEmbed)
- type UpdatedLiveThread = PostableLiveThread
- type NewLiveThread = PostableLiveThread
- data PostableLiveThread = PostableLiveThread Title (Maybe Body) (Maybe Body) Bool
- data LiveState
- newtype LiveThreadID = LiveThreadID Text
- data LiveThread = LiveThread LiveThreadID Title (Maybe Body) (Maybe Body) (Maybe Body) (Maybe Body) UTCTime (Maybe Integer) LiveState Bool (Maybe URL)
- mkNewLiveThread :: Title -> NewLiveThread
- liveThreadToPostable :: LiveThread -> UpdatedLiveThread
Actions
getLiveThread :: MonadReddit m => LiveThreadID -> m LiveThread Source #
Get the details on a single LiveThread
given its ID
getLiveInfo :: (MonadReddit m, Foldable t) => t LiveThreadID -> Paginator LiveThreadID LiveThread -> m (Listing LiveThreadID LiveThread) Source #
Get information about live threads corresponding to each of the
LiveThreadID
s in the given container. Invalid IDs are silently discarded
by this endpoint
Note: This endpoint will only accept a maximum of 100 LiveThreadID
s. If
you would like to get all of the information for a larger number of LiveThread
s
at once, see getAllLiveInfo
getAllLiveInfo :: (MonadReddit m, Traversable t) => t LiveThreadID -> m (Seq LiveThread) Source #
Get all of the LiveThread
s corresponding to a container of LiveThreadID
s,
without a limit
getLiveUpdates :: MonadReddit m => LiveThreadID -> Paginator LiveUpdateID LiveUpdate -> m (Listing LiveUpdateID LiveUpdate) Source #
Get a Listing
of LiveUpdate
s for the given live thread
getLiveUpdate :: MonadReddit m => LiveThreadID -> LiveUpdateID -> m LiveUpdate Source #
Get a single LiveUpdate
for the given live thread
getLiveDiscussions :: MonadReddit m => LiveThreadID -> Paginator SubmissionID Submission -> m (Listing SubmissionID Submission) Source #
Get a Listing
of Submission
s representing the discussions on the given
live thread
getLiveContributors :: MonadReddit m => LiveThreadID -> m (Seq LiveContributor) Source #
Get a list of contributors to the live thread
reportLiveThread :: MonadReddit m => LiveReportType -> LiveThreadID -> m () Source #
Report the given live thread to Reddit admins with the provided reason
createLiveThread :: MonadReddit m => NewLiveThread -> m LiveThread Source #
Create a NewLiveThread
, returning the LiveThread
upon success. Also see
mkNewLiveThread
closeLiveThread :: MonadReddit m => LiveThreadID -> m () Source #
Close an existing live thread. After closing, it is no longer possible to update or modify the live thread
Warning: This action is irreversible
updateLiveThread :: MonadReddit m => LiveThreadID -> UpdatedLiveThread -> m () Source #
Update the existing live thread with new settings
addLiveUpdate :: MonadReddit m => LiveThreadID -> Body -> m () Source #
Add an update to the live thread
strikeLiveUpdate :: MonadReddit m => LiveThreadID -> LiveUpdateID -> m () Source #
Strike the existing LiveUpdate
, causing its stricken
field to be True
and the content to be crossed-out and marked incorrect on the web UI
deleteLiveUpdate :: MonadReddit m => LiveThreadID -> LiveUpdateID -> m () Source #
Strike the existing LiveUpdate
, causing its stricken
field to be True
and the content to be crossed-out and marked incorrect on the web UI
Live thread contribution
removeLiveContributor :: MonadReddit m => LiveThreadID -> UserID -> m () Source #
Remove the user as a contributor to the live thread. If you don't know the
contributor's user ID, you can use removeLiveContributorByName
removeLiveContributorByName :: MonadReddit m => LiveThreadID -> Username -> m () Source #
Remove the live contributor by username. Note that this action must perform an additional network request to fetch the user ID from the given username
updateLiveContributor Source #
:: (MonadReddit m, Foldable t) | |
=> Maybe (t LivePermission) | If |
-> LiveThreadID | |
-> Username | |
-> m () |
Update the permissions for the live contributor
abdicateLiveContributor :: MonadReddit m => LiveThreadID -> m () Source #
Abdicate your role as a live contributor, removing all access and permissions
Warning: This cannot be undone, even if you are the creator of the live thread
inviteLiveContributor :: MonadReddit m => LiveThreadID -> Username -> m () Source #
Invite a user to contribute to the live thread. Note that this implicitly
grants all permissions to the invitee. If you would like more fine-grained
control over permissions, see inviteLiveContributorWithPerms
inviteLiveContributorWithPerms Source #
:: (MonadReddit m, Foldable t) | |
=> t LivePermission | If empty, grants no permissions |
-> LiveThreadID | |
-> Username | |
-> m () |
As inviteLiveContributor
, but allows customization of the permissions
granted to the invitee
revokeLiveInvitation :: MonadReddit m => LiveThreadID -> UserID -> m () Source #
Revoke the invitation to contribute to the live thread. If you don't know
the contributor's user ID, you can use revokeLiveInvitationByName
revokeLiveInvitationByName :: MonadReddit m => LiveThreadID -> Username -> m () Source #
Revoke the live invitation by username. Note that this action must perform an additional network request to fetch the user ID from the given username
Types
data LiveReportType Source #
The reason for reporting the LiveThread
to the Reddit admins
Instances
data LivePermission Source #
Permission granted to a LiveContributor
Instances
data LiveContributor Source #
A user contributor in a LiveThread
Instances
data LiveUpdateEmbed Source #
External resources embedded in a LiveUpdate
Instances
newtype LiveUpdateID Source #
ID for a LiveUpdate
Instances
data LiveUpdate Source #
An individual update in a LiveThread
Instances
type UpdatedLiveThread = PostableLiveThread Source #
Type synonym for updating existing live threads
type NewLiveThread = PostableLiveThread Source #
Type synonym for creating new live threads
data PostableLiveThread Source #
Data to create a new LiveThread
or update an existing one. In the latter
case, see liveThreadToPostable
for conversion
Instances
The state of the LiveThread
newtype LiveThreadID Source #
ID for a single LiveThread
Instances
data LiveThread Source #
An existing Reddit live thread. It may be currently live or already complete
LiveThread LiveThreadID Title (Maybe Body) (Maybe Body) (Maybe Body) (Maybe Body) UTCTime (Maybe Integer) LiveState Bool (Maybe URL) |
Instances
mkNewLiveThread :: Title -> NewLiveThread Source #
Create a NewLiveThread
with default values for most fields
liveThreadToPostable :: LiveThread -> UpdatedLiveThread Source #
Convenience function to transform an existing LiveThread
into
a PostableLiveThread
, which may be used in updates