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.Types.Subreddit

Description

 
Synopsis

Documentation

data SubredditName Source #

The name of a subreddit

Instances

Instances details
Eq SubredditName Source # 
Instance details

Defined in Network.Reddit.Types.Subreddit

Show SubredditName Source # 
Instance details

Defined in Network.Reddit.Types.Subreddit

Generic SubredditName Source # 
Instance details

Defined in Network.Reddit.Types.Subreddit

Associated Types

type Rep SubredditName :: Type -> Type #

ToJSON SubredditName Source # 
Instance details

Defined in Network.Reddit.Types.Subreddit

FromJSON SubredditName Source # 
Instance details

Defined in Network.Reddit.Types.Subreddit

ToHttpApiData SubredditName Source # 
Instance details

Defined in Network.Reddit.Types.Subreddit

type Rep SubredditName Source # 
Instance details

Defined in Network.Reddit.Types.Subreddit

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

mkSubredditName :: MonadThrow m => Text -> m SubredditName Source #

Smart constructor for SubredditName, which must be between 3 and 20 chars, and may only include upper/lowercase alphanumeric chars, underscores, and hyphens

newtype SubredditID Source #

Unique site-wide identifier for a subreddit

Constructors

SubredditID Text 

Instances

Instances details
Eq SubredditID Source # 
Instance details

Defined in Network.Reddit.Types.Subreddit

Show SubredditID Source # 
Instance details

Defined in Network.Reddit.Types.Subreddit

Generic SubredditID Source # 
Instance details

Defined in Network.Reddit.Types.Subreddit

Associated Types

type Rep SubredditID :: Type -> Type #

FromJSON SubredditID Source # 
Instance details

Defined in Network.Reddit.Types.Subreddit

Thing SubredditID Source # 
Instance details

Defined in Network.Reddit.Types.Subreddit

type Rep SubredditID Source # 
Instance details

Defined in Network.Reddit.Types.Subreddit

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

data Subreddit Source #

Information about a subreddit. Fields prefixed with userIs below apply to the currently authenticated user

Constructors

Subreddit 

Fields

Instances

Instances details
Eq Subreddit Source # 
Instance details

Defined in Network.Reddit.Types.Subreddit

Show Subreddit Source # 
Instance details

Defined in Network.Reddit.Types.Subreddit

Generic Subreddit Source # 
Instance details

Defined in Network.Reddit.Types.Subreddit

Associated Types

type Rep Subreddit :: Type -> Type #

FromJSON Subreddit Source # 
Instance details

Defined in Network.Reddit.Types.Subreddit

Paginable Subreddit Source # 
Instance details

Defined in Network.Reddit.Types.Subreddit

type Rep Subreddit Source # 
Instance details

Defined in Network.Reddit.Types.Subreddit

type Rep Subreddit = D1 ('MetaData "Subreddit" "Network.Reddit.Types.Subreddit" "heddit-0.0.1-76ROQ5tOAm3CpLSaFw8ccb" 'False) (C1 ('MetaCons "Subreddit" 'PrefixI 'True) (((S1 ('MetaSel ('Just "subredditID") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 SubredditID) :*: (S1 ('MetaSel ('Just "name") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 SubredditName) :*: S1 ('MetaSel ('Just "title") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Title))) :*: ((S1 ('MetaSel ('Just "created") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 UTCTime) :*: S1 ('MetaSel ('Just "description") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Body)) :*: (S1 ('MetaSel ('Just "descriptionHTML") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Body)) :*: S1 ('MetaSel ('Just "publicDescription") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Body)))) :*: (((S1 ('MetaSel ('Just "subscribers") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Integer) :*: S1 ('MetaSel ('Just "over18") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Bool)) :*: (S1 ('MetaSel ('Just "userIsBanned") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Bool)) :*: S1 ('MetaSel ('Just "userIsModerator") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Bool)))) :*: ((S1 ('MetaSel ('Just "userIsSubscriber") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Bool)) :*: S1 ('MetaSel ('Just "canAssignLinkFlair") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Bool))) :*: (S1 ('MetaSel ('Just "canAssignUserFlair") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Bool)) :*: S1 ('MetaSel ('Just "quarantine") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Bool))))))
type PaginateOptions Subreddit Source # 
Instance details

Defined in Network.Reddit.Types.Subreddit

type PaginateThing Subreddit Source # 
Instance details

Defined in Network.Reddit.Types.Subreddit

data RecsList Source #

Wrapper for parsing an array of recommended SubredditNames, which are given as single-field JSON objects

Instances

Instances details
Show RecsList Source # 
Instance details

Defined in Network.Reddit.Types.Subreddit

Generic RecsList Source # 
Instance details

Defined in Network.Reddit.Types.Subreddit

Associated Types

type Rep RecsList :: Type -> Type #

Methods

from :: RecsList -> Rep RecsList x #

to :: Rep RecsList x -> RecsList #

FromJSON RecsList Source # 
Instance details

Defined in Network.Reddit.Types.Subreddit

type Rep RecsList Source # 
Instance details

Defined in Network.Reddit.Types.Subreddit

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

data NameSearchResults Source #

Wrapper for parsing an object of SubredditName results when searching subreddits by name

Instances

Instances details
Show NameSearchResults Source # 
Instance details

Defined in Network.Reddit.Types.Subreddit

Generic NameSearchResults Source # 
Instance details

Defined in Network.Reddit.Types.Subreddit

Associated Types

type Rep NameSearchResults :: Type -> Type #

FromJSON NameSearchResults Source # 
Instance details

Defined in Network.Reddit.Types.Subreddit

type Rep NameSearchResults Source # 
Instance details

Defined in Network.Reddit.Types.Subreddit

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

Rules/requirements

data SubredditRule Source #

A Subreddit rule. If you are a moderator, you can update the shortName, description, violationReason, and ruleType fields. See reorderSubredditRules. New rules may also be created with NewSubredditRules

Instances

Instances details
Eq SubredditRule Source # 
Instance details

Defined in Network.Reddit.Types.Subreddit

Show SubredditRule Source # 
Instance details

Defined in Network.Reddit.Types.Subreddit

Generic SubredditRule Source # 
Instance details

Defined in Network.Reddit.Types.Subreddit

Associated Types

type Rep SubredditRule :: Type -> Type #

FromJSON SubredditRule Source #

Depending on the endpoint, the JSON fields are either camel- or snake-cased

Instance details

Defined in Network.Reddit.Types.Subreddit

ToForm SubredditRule Source # 
Instance details

Defined in Network.Reddit.Types.Subreddit

Methods

toForm :: SubredditRule -> Form #

type Rep SubredditRule Source # 
Instance details

Defined in Network.Reddit.Types.Subreddit

data RuleList Source #

Wrapper to parse JSON from endpoints that list SubredditRules

Instances

Instances details
Show RuleList Source # 
Instance details

Defined in Network.Reddit.Types.Subreddit

Generic RuleList Source # 
Instance details

Defined in Network.Reddit.Types.Subreddit

Associated Types

type Rep RuleList :: Type -> Type #

Methods

from :: RuleList -> Rep RuleList x #

to :: Rep RuleList x -> RuleList #

FromJSON RuleList Source # 
Instance details

Defined in Network.Reddit.Types.Subreddit

type Rep RuleList Source # 
Instance details

Defined in Network.Reddit.Types.Subreddit

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

data NewSubredditRule Source #

Represents a new SubredditRule that can be created by moderators

Constructors

NewSubredditRule 

Fields

Instances

Instances details
Eq NewSubredditRule Source # 
Instance details

Defined in Network.Reddit.Types.Subreddit

Show NewSubredditRule Source # 
Instance details

Defined in Network.Reddit.Types.Subreddit

Generic NewSubredditRule Source # 
Instance details

Defined in Network.Reddit.Types.Subreddit

Associated Types

type Rep NewSubredditRule :: Type -> Type #

ToForm NewSubredditRule Source # 
Instance details

Defined in Network.Reddit.Types.Subreddit

type Rep NewSubredditRule Source # 
Instance details

Defined in Network.Reddit.Types.Subreddit

type Rep NewSubredditRule = D1 ('MetaData "NewSubredditRule" "Network.Reddit.Types.Subreddit" "heddit-0.0.1-76ROQ5tOAm3CpLSaFw8ccb" 'False) (C1 ('MetaCons "NewSubredditRule" 'PrefixI 'True) ((S1 ('MetaSel ('Just "shortName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Name) :*: S1 ('MetaSel ('Just "ruleType") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 RuleType)) :*: (S1 ('MetaSel ('Just "description") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Body) :*: S1 ('MetaSel ('Just "violationReason") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)))))

data PostedSubredditRule Source #

Wrapper for parsing newly created SubredditRules, after POSTing a NewSubredditRule. Rather unbelievably, Reddit transmits these new rules as a JSON object ... in a single element array ... encoded as a string ... inside another object!

data RuleType Source #

The type of item that a SubredditRule applies to

Constructors

CommentRule 
LinkRule 
AllRule 

Instances

Instances details
Eq RuleType Source # 
Instance details

Defined in Network.Reddit.Types.Subreddit

Ord RuleType Source # 
Instance details

Defined in Network.Reddit.Types.Subreddit

Show RuleType Source # 
Instance details

Defined in Network.Reddit.Types.Subreddit

Generic RuleType Source # 
Instance details

Defined in Network.Reddit.Types.Subreddit

Associated Types

type Rep RuleType :: Type -> Type #

Methods

from :: RuleType -> Rep RuleType x #

to :: Rep RuleType x -> RuleType #

FromJSON RuleType Source # 
Instance details

Defined in Network.Reddit.Types.Subreddit

ToHttpApiData RuleType Source # 
Instance details

Defined in Network.Reddit.Types.Subreddit

type Rep RuleType Source # 
Instance details

Defined in Network.Reddit.Types.Subreddit

type Rep RuleType = D1 ('MetaData "RuleType" "Network.Reddit.Types.Subreddit" "heddit-0.0.1-76ROQ5tOAm3CpLSaFw8ccb" 'False) (C1 ('MetaCons "CommentRule" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "LinkRule" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "AllRule" 'PrefixI 'False) (U1 :: Type -> Type)))

data PostRequirements Source #

Mod-created requirements for posting in a subreddit

Constructors

PostRequirements 

Fields

Instances

Instances details
Eq PostRequirements Source # 
Instance details

Defined in Network.Reddit.Types.Subreddit

Show PostRequirements Source # 
Instance details

Defined in Network.Reddit.Types.Subreddit

Generic PostRequirements Source # 
Instance details

Defined in Network.Reddit.Types.Subreddit

Associated Types

type Rep PostRequirements :: Type -> Type #

FromJSON PostRequirements Source # 
Instance details

Defined in Network.Reddit.Types.Subreddit

type Rep PostRequirements Source # 
Instance details

Defined in Network.Reddit.Types.Subreddit

type Rep PostRequirements = D1 ('MetaData "PostRequirements" "Network.Reddit.Types.Subreddit" "heddit-0.0.1-76ROQ5tOAm3CpLSaFw8ccb" 'False) (C1 ('MetaCons "PostRequirements" 'PrefixI 'True) (((S1 ('MetaSel ('Just "bodyBlacklistedStrings") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [Text]) :*: S1 ('MetaSel ('Just "bodyRestrictionPolicy") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 BodyRestriction)) :*: (S1 ('MetaSel ('Just "domainBlacklist") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [Text]) :*: S1 ('MetaSel ('Just "domainWhitelist") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [Text]))) :*: ((S1 ('MetaSel ('Just "isFlairRequired") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Bool) :*: S1 ('MetaSel ('Just "titleBlacklistedStrings") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [Text])) :*: (S1 ('MetaSel ('Just "titleRequiredStrings") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [Text]) :*: (S1 ('MetaSel ('Just "titleTextMaxLength") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Word)) :*: S1 ('MetaSel ('Just "titleTextMinLength") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Word)))))))

data BodyRestriction Source #

Rules concerning the presence of self-text bodies in posts

Instances

Instances details
Eq BodyRestriction Source # 
Instance details

Defined in Network.Reddit.Types.Subreddit

Show BodyRestriction Source # 
Instance details

Defined in Network.Reddit.Types.Subreddit

Generic BodyRestriction Source # 
Instance details

Defined in Network.Reddit.Types.Subreddit

Associated Types

type Rep BodyRestriction :: Type -> Type #

FromJSON BodyRestriction Source # 
Instance details

Defined in Network.Reddit.Types.Subreddit

type Rep BodyRestriction Source # 
Instance details

Defined in Network.Reddit.Types.Subreddit

type Rep BodyRestriction = D1 ('MetaData "BodyRestriction" "Network.Reddit.Types.Subreddit" "heddit-0.0.1-76ROQ5tOAm3CpLSaFw8ccb" 'False) (C1 ('MetaCons "BodyRequired" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "BodyNotAllowed" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "NoRestriction" 'PrefixI 'False) (U1 :: Type -> Type)))