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
- data SubredditName
- mkSubredditName :: MonadThrow m => Text -> m SubredditName
- newtype SubredditID = SubredditID Text
- data Subreddit = Subreddit {
- subredditID :: SubredditID
- name :: SubredditName
- title :: Title
- created :: UTCTime
- description :: Body
- descriptionHTML :: Maybe Body
- publicDescription :: Body
- subscribers :: Integer
- over18 :: Bool
- userIsBanned :: Maybe Bool
- userIsModerator :: Maybe Bool
- userIsSubscriber :: Maybe Bool
- canAssignLinkFlair :: Maybe Bool
- canAssignUserFlair :: Maybe Bool
- quarantine :: Bool
- data RecsList
- data NameSearchResults
- data SubredditRule = SubredditRule {}
- data RuleList
- data NewSubredditRule = NewSubredditRule {
- shortName :: Name
- ruleType :: RuleType
- description :: Body
- violationReason :: Maybe Text
- data PostedSubredditRule
- data RuleType
- data PostRequirements = PostRequirements {}
- data BodyRestriction
Documentation
data SubredditName Source #
The name of a subreddit
Instances
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
Instances
Information about a subreddit. Fields prefixed with userIs
below apply to
the currently authenticated user
Subreddit | |
|
Instances
Wrapper for parsing an array of recommended SubredditName
s, which are
given as single-field JSON objects
Instances
Show RecsList Source # | |
Generic RecsList Source # | |
FromJSON RecsList Source # | |
type Rep RecsList Source # | |
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
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 NewSubredditRule
s
Instances
Wrapper to parse JSON from endpoints that list SubredditRule
s
Instances
Show RuleList Source # | |
Generic RuleList Source # | |
FromJSON RuleList Source # | |
type Rep RuleList Source # | |
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
NewSubredditRule | |
|
Instances
data PostedSubredditRule Source #
Wrapper for parsing newly created SubredditRule
s, 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!
Instances
The type of item that a SubredditRule
applies to
Instances
Eq RuleType Source # | |
Ord RuleType Source # | |
Defined in Network.Reddit.Types.Subreddit | |
Show RuleType Source # | |
Generic RuleType Source # | |
FromJSON RuleType Source # | |
ToHttpApiData RuleType Source # | |
Defined in Network.Reddit.Types.Subreddit toUrlPiece :: RuleType -> Text # toEncodedUrlPiece :: RuleType -> Builder # toHeader :: RuleType -> ByteString # toQueryParam :: RuleType -> Text # | |
type Rep RuleType Source # | |
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
PostRequirements | |
|
Instances
data BodyRestriction Source #
Rules concerning the presence of self-text bodies in posts