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.Item

Contents

Description

Actions with operate on Items, either Comments or Submissions

Synopsis

Actions

delete :: MonadReddit m => ItemID -> m () Source #

Delete an Item

reply :: MonadReddit m => ItemID -> Body -> m Comment Source #

Leave a comment in reply to an Item, which can be markdown-formatted. This will return the newly created Comment upon success

edit :: MonadReddit m => ItemID -> Body -> m Item Source #

Edit some item, given its ItemID. The return value will be wrapped in an Item constructor, since it can be either a Comment or Submission

vote :: MonadReddit m => Vote -> ItemID -> m () Source #

Submit a vote. Be careful! Reddit views bot-based vote manipulation as a serious violation

report :: MonadReddit m => Report -> ItemID -> m () Source #

Report an item, which brings it to the attention of the subreddit moderators

save :: MonadReddit m => ItemID -> m () Source #

Save an item

unsave :: MonadReddit m => ItemID -> m () Source #

Unsave an item

setInboxReplies :: MonadReddit m => Bool -> ItemID -> m () Source #

Enable or disable inbox replies for an item given its ItemID

getGildedItems :: MonadReddit m => SubredditName -> Paginator ItemID Item -> m (Listing ItemID Item) Source #

Get a Listing of Items that have been gilded

Types

data Report Source #

The reason for issuing a report. The length of the contained text must be <= 100 characters

Instances

Instances details
Eq Report Source # 
Instance details

Defined in Network.Reddit.Types.Item

Methods

(==) :: Report -> Report -> Bool #

(/=) :: Report -> Report -> Bool #

Show Report Source # 
Instance details

Defined in Network.Reddit.Types.Item

Generic Report Source # 
Instance details

Defined in Network.Reddit.Types.Item

Associated Types

type Rep Report :: Type -> Type #

Methods

from :: Report -> Rep Report x #

to :: Rep Report x -> Report #

ToHttpApiData Report Source # 
Instance details

Defined in Network.Reddit.Types.Item

type Rep Report Source # 
Instance details

Defined in Network.Reddit.Types.Item

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

data Vote Source #

The direction in which to vote

Constructors

Downvote 
Unvote 
Upvote 

Instances

Instances details
Eq Vote Source # 
Instance details

Defined in Network.Reddit.Types.Item

Methods

(==) :: Vote -> Vote -> Bool #

(/=) :: Vote -> Vote -> Bool #

Ord Vote Source # 
Instance details

Defined in Network.Reddit.Types.Item

Methods

compare :: Vote -> Vote -> Ordering #

(<) :: Vote -> Vote -> Bool #

(<=) :: Vote -> Vote -> Bool #

(>) :: Vote -> Vote -> Bool #

(>=) :: Vote -> Vote -> Bool #

max :: Vote -> Vote -> Vote #

min :: Vote -> Vote -> Vote #

Show Vote Source # 
Instance details

Defined in Network.Reddit.Types.Item

Methods

showsPrec :: Int -> Vote -> ShowS #

show :: Vote -> String #

showList :: [Vote] -> ShowS #

Generic Vote Source # 
Instance details

Defined in Network.Reddit.Types.Item

Associated Types

type Rep Vote :: Type -> Type #

Methods

from :: Vote -> Rep Vote x #

to :: Rep Vote x -> Vote #

type Rep Vote Source # 
Instance details

Defined in Network.Reddit.Types.Item

type Rep Vote = D1 ('MetaData "Vote" "Network.Reddit.Types.Item" "heddit-0.0.1-76ROQ5tOAm3CpLSaFw8ccb" 'False) (C1 ('MetaCons "Downvote" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Unvote" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Upvote" 'PrefixI 'False) (U1 :: Type -> Type)))

data Item Source #

Certain endpoints will return either Comments or a Submissions, or both

Instances

Instances details
Eq Item Source # 
Instance details

Defined in Network.Reddit.Types.Item

Methods

(==) :: Item -> Item -> Bool #

(/=) :: Item -> Item -> Bool #

Show Item Source # 
Instance details

Defined in Network.Reddit.Types.Item

Methods

showsPrec :: Int -> Item -> ShowS #

show :: Item -> String #

showList :: [Item] -> ShowS #

Generic Item Source # 
Instance details

Defined in Network.Reddit.Types.Item

Associated Types

type Rep Item :: Type -> Type #

Methods

from :: Item -> Rep Item x #

to :: Rep Item x -> Item #

FromJSON Item Source # 
Instance details

Defined in Network.Reddit.Types.Item

Paginable Item Source # 
Instance details

Defined in Network.Reddit.Types.Item

FromJSON (PostedItem Item) Source # 
Instance details

Defined in Network.Reddit.Types.Item

type Rep Item Source # 
Instance details

Defined in Network.Reddit.Types.Item

type Rep Item = D1 ('MetaData "Item" "Network.Reddit.Types.Item" "heddit-0.0.1-76ROQ5tOAm3CpLSaFw8ccb" 'False) (C1 ('MetaCons "CommentItem" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Comment)) :+: C1 ('MetaCons "SubmissionItem" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Submission)))
type PaginateOptions Item Source # 
Instance details

Defined in Network.Reddit.Types.Item

type PaginateThing Item Source # 
Instance details

Defined in Network.Reddit.Types.Item

data ItemID Source #

Wraps either a CommentID or a SubmissionID. This is required to use Items with Paginators

Instances

Instances details
Eq ItemID Source # 
Instance details

Defined in Network.Reddit.Types.Item

Methods

(==) :: ItemID -> ItemID -> Bool #

(/=) :: ItemID -> ItemID -> Bool #

Show ItemID Source # 
Instance details

Defined in Network.Reddit.Types.Item

Generic ItemID Source # 
Instance details

Defined in Network.Reddit.Types.Item

Associated Types

type Rep ItemID :: Type -> Type #

Methods

from :: ItemID -> Rep ItemID x #

to :: Rep ItemID x -> ItemID #

FromJSON ItemID Source # 
Instance details

Defined in Network.Reddit.Types.Item

Thing ItemID Source # 
Instance details

Defined in Network.Reddit.Types.Item

Methods

fullname :: ItemID -> Text Source #

type Rep ItemID Source # 
Instance details

Defined in Network.Reddit.Types.Item

type Rep ItemID = D1 ('MetaData "ItemID" "Network.Reddit.Types.Item" "heddit-0.0.1-76ROQ5tOAm3CpLSaFw8ccb" 'False) (C1 ('MetaCons "CommentItemID" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 CommentID)) :+: C1 ('MetaCons "SubmissionItemID" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 SubmissionID)))

mkReport :: MonadThrow m => Text -> m Report Source #

Smart constructor for Reports, which may be no longer than 100 characters in length