heddit-0.0.1: Reddit API bindings
Copyright(c) 2021 Rory Tyler Hayford
LicenseBSD-3-Clause
Maintainerrory.hayford@protonmail.com
Stabilityexperimental
PortabilityGHC
Safe HaskellNone
LanguageHaskell2010

Network.Reddit.Live

Description

 
Synopsis

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 LiveThreadIDs in the given container. Invalid IDs are silently discarded by this endpoint

Note: This endpoint will only accept a maximum of 100 LiveThreadIDs. If you would like to get all of the information for a larger number of LiveThreads at once, see getAllLiveInfo

getAllLiveInfo :: (MonadReddit m, Traversable t) => t LiveThreadID -> m (Seq LiveThread) Source #

Get all of the LiveThreads corresponding to a container of LiveThreadIDs, without a limit

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 Submissions 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 #

Arguments

:: (MonadReddit m, Foldable t) 
=> Maybe (t LivePermission)

If Nothing, grants all contributor permissions. If Just but empty, removes all permissions

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

Arguments

:: (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

Instances details
Eq LiveReportType Source # 
Instance details

Defined in Network.Reddit.Types.Live

Show LiveReportType Source # 
Instance details

Defined in Network.Reddit.Types.Live

Generic LiveReportType Source # 
Instance details

Defined in Network.Reddit.Types.Live

Associated Types

type Rep LiveReportType :: Type -> Type #

ToHttpApiData LiveReportType Source # 
Instance details

Defined in Network.Reddit.Types.Live

type Rep LiveReportType Source # 
Instance details

Defined in Network.Reddit.Types.Live

type Rep LiveReportType = D1 ('MetaData "LiveReportType" "Network.Reddit.Types.Live" "heddit-0.0.1-76ROQ5tOAm3CpLSaFw8ccb" 'False) ((C1 ('MetaCons "Spam" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "VoteManipulation" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "PersonalInfo" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Sexualizing" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "SiteBreaking" 'PrefixI 'False) (U1 :: Type -> Type))))

data LivePermission Source #

Permission granted to a LiveContributor

Constructors

Edit 
Update 
Manage 
Settings 

Instances

Instances details
Bounded LivePermission Source # 
Instance details

Defined in Network.Reddit.Types.Live

Enum LivePermission Source # 
Instance details

Defined in Network.Reddit.Types.Live

Eq LivePermission Source # 
Instance details

Defined in Network.Reddit.Types.Live

Ord LivePermission Source # 
Instance details

Defined in Network.Reddit.Types.Live

Show LivePermission Source # 
Instance details

Defined in Network.Reddit.Types.Live

Generic LivePermission Source # 
Instance details

Defined in Network.Reddit.Types.Live

Associated Types

type Rep LivePermission :: Type -> Type #

FromJSON LivePermission Source # 
Instance details

Defined in Network.Reddit.Types.Live

ToHttpApiData LivePermission Source # 
Instance details

Defined in Network.Reddit.Types.Live

type Rep LivePermission Source # 
Instance details

Defined in Network.Reddit.Types.Live

type Rep LivePermission = D1 ('MetaData "LivePermission" "Network.Reddit.Types.Live" "heddit-0.0.1-76ROQ5tOAm3CpLSaFw8ccb" 'False) ((C1 ('MetaCons "Edit" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Update" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Manage" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Settings" 'PrefixI 'False) (U1 :: Type -> Type)))

data LiveContributor Source #

A user contributor in a LiveThread

data LiveUpdateEmbed Source #

External resources embedded in a LiveUpdate

newtype LiveUpdateID Source #

ID for a LiveUpdate

Constructors

LiveUpdateID Text 

Instances

Instances details
Eq LiveUpdateID Source # 
Instance details

Defined in Network.Reddit.Types.Live

Show LiveUpdateID Source # 
Instance details

Defined in Network.Reddit.Types.Live

Generic LiveUpdateID Source # 
Instance details

Defined in Network.Reddit.Types.Live

Associated Types

type Rep LiveUpdateID :: Type -> Type #

FromJSON LiveUpdateID Source # 
Instance details

Defined in Network.Reddit.Types.Live

ToHttpApiData LiveUpdateID Source # 
Instance details

Defined in Network.Reddit.Types.Live

Thing LiveUpdateID Source # 
Instance details

Defined in Network.Reddit.Types.Live

type Rep LiveUpdateID Source # 
Instance details

Defined in Network.Reddit.Types.Live

type Rep LiveUpdateID = D1 ('MetaData "LiveUpdateID" "Network.Reddit.Types.Live" "heddit-0.0.1-76ROQ5tOAm3CpLSaFw8ccb" 'True) (C1 ('MetaCons "LiveUpdateID" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))

data LiveUpdate Source #

An individual update in a LiveThread

Instances

Instances details
Eq LiveUpdate Source # 
Instance details

Defined in Network.Reddit.Types.Live

Show LiveUpdate Source # 
Instance details

Defined in Network.Reddit.Types.Live

Generic LiveUpdate Source # 
Instance details

Defined in Network.Reddit.Types.Live

Associated Types

type Rep LiveUpdate :: Type -> Type #

FromJSON LiveUpdate Source # 
Instance details

Defined in Network.Reddit.Types.Live

Paginable LiveUpdate Source # 
Instance details

Defined in Network.Reddit.Types.Live

type Rep LiveUpdate Source # 
Instance details

Defined in Network.Reddit.Types.Live

type PaginateOptions LiveUpdate Source # 
Instance details

Defined in Network.Reddit.Types.Live

type PaginateThing LiveUpdate Source # 
Instance details

Defined in Network.Reddit.Types.Live

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

Instances details
Eq PostableLiveThread Source # 
Instance details

Defined in Network.Reddit.Types.Live

Show PostableLiveThread Source # 
Instance details

Defined in Network.Reddit.Types.Live

Generic PostableLiveThread Source # 
Instance details

Defined in Network.Reddit.Types.Live

Associated Types

type Rep PostableLiveThread :: Type -> Type #

ToForm PostableLiveThread Source # 
Instance details

Defined in Network.Reddit.Types.Live

type Rep PostableLiveThread Source # 
Instance details

Defined in Network.Reddit.Types.Live

type Rep PostableLiveThread = D1 ('MetaData "PostableLiveThread" "Network.Reddit.Types.Live" "heddit-0.0.1-76ROQ5tOAm3CpLSaFw8ccb" 'False) (C1 ('MetaCons "PostableLiveThread" 'PrefixI 'True) ((S1 ('MetaSel ('Just "title") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Title) :*: S1 ('MetaSel ('Just "description") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Body))) :*: (S1 ('MetaSel ('Just "resources") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Body)) :*: S1 ('MetaSel ('Just "nsfw") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Bool))))

data LiveState Source #

The state of the LiveThread

Constructors

Current 
Complete 

Instances

Instances details
Eq LiveState Source # 
Instance details

Defined in Network.Reddit.Types.Live

Show LiveState Source # 
Instance details

Defined in Network.Reddit.Types.Live

Generic LiveState Source # 
Instance details

Defined in Network.Reddit.Types.Live

Associated Types

type Rep LiveState :: Type -> Type #

FromJSON LiveState Source # 
Instance details

Defined in Network.Reddit.Types.Live

type Rep LiveState Source # 
Instance details

Defined in Network.Reddit.Types.Live

type Rep LiveState = D1 ('MetaData "LiveState" "Network.Reddit.Types.Live" "heddit-0.0.1-76ROQ5tOAm3CpLSaFw8ccb" 'False) (C1 ('MetaCons "Current" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Complete" 'PrefixI 'False) (U1 :: Type -> Type))

newtype LiveThreadID Source #

ID for a single LiveThread

Constructors

LiveThreadID Text 

Instances

Instances details
Eq LiveThreadID Source # 
Instance details

Defined in Network.Reddit.Types.Live

Show LiveThreadID Source # 
Instance details

Defined in Network.Reddit.Types.Live

Generic LiveThreadID Source # 
Instance details

Defined in Network.Reddit.Types.Live

Associated Types

type Rep LiveThreadID :: Type -> Type #

FromJSON LiveThreadID Source # 
Instance details

Defined in Network.Reddit.Types.Live

ToHttpApiData LiveThreadID Source # 
Instance details

Defined in Network.Reddit.Types.Live

Thing LiveThreadID Source # 
Instance details

Defined in Network.Reddit.Types.Live

type Rep LiveThreadID Source # 
Instance details

Defined in Network.Reddit.Types.Live

type Rep LiveThreadID = D1 ('MetaData "LiveThreadID" "Network.Reddit.Types.Live" "heddit-0.0.1-76ROQ5tOAm3CpLSaFw8ccb" 'True) (C1 ('MetaCons "LiveThreadID" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))

data LiveThread Source #

An existing Reddit live thread. It may be currently live or already complete

Instances

Instances details
Eq LiveThread Source # 
Instance details

Defined in Network.Reddit.Types.Live

Show LiveThread Source # 
Instance details

Defined in Network.Reddit.Types.Live

Generic LiveThread Source # 
Instance details

Defined in Network.Reddit.Types.Live

Associated Types

type Rep LiveThread :: Type -> Type #

FromJSON LiveThread Source # 
Instance details

Defined in Network.Reddit.Types.Live

Paginable LiveThread Source # 
Instance details

Defined in Network.Reddit.Types.Live

type Rep LiveThread Source # 
Instance details

Defined in Network.Reddit.Types.Live

type PaginateOptions LiveThread Source # 
Instance details

Defined in Network.Reddit.Types.Live

type PaginateThing LiveThread Source # 
Instance details

Defined in Network.Reddit.Types.Live

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