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 SubredditWidgets = SubredditWidgets {}
- data Widget
- newtype WidgetID = WidgetID Text
- data WidgetSection
- data ShortName
- mkShortName :: MonadThrow m => Text -> m ShortName
- data WidgetList
- data WidgetStyles = WidgetStyles {}
- data ButtonWidget = ButtonWidget {}
- data Button
- data ButtonImage = ButtonImage {}
- data ButtonText = ButtonText {}
- data ButtonHover
- data ImageHover = ImageHover {}
- data TextHover = TextHover {}
- data CalendarWidget = CalendarWidget {}
- data CalendarConfig = CalendarConfig {}
- defaultCalendarConfig :: CalendarConfig
- data CommunityListWidget = CommunityListWidget {}
- data CommunityInfo = CommunityInfo {
- name :: SubredditName
- subscribers :: Maybe Integer
- primaryColor :: Maybe RGBText
- iconURL :: Maybe URL
- communityIcon :: Maybe URL
- isSubscribed :: Maybe Bool
- isNSFW :: Maybe Bool
- mkCommunityInfo :: SubredditName -> CommunityInfo
- data CustomWidget = CustomWidget {}
- data ImageData = ImageData {}
- data IDCardWidget = IDCardWidget {}
- data ImageWidget = ImageWidget {}
- data Image = Image {}
- data MenuWidget = MenuWidget {}
- data MenuChild
- data MenuLink = MenuLink {}
- data Submenu = Submenu {}
- data ModeratorsWidget = ModeratorsWidget {}
- data ModInfo = ModInfo {}
- data PostFlairWidget = PostFlairWidget {}
- mkPostFlairWidget :: ShortName -> Seq FlairID -> PostFlairWidget
- data PostFlairInfo = PostFlairInfo {}
- data PostFlairWidgetDisplay
- data RulesWidget = RulesWidget {}
- data RulesDisplay
- data TextAreaWidget = TextAreaWidget {}
- mkTextAreaWidget :: ShortName -> Body -> TextAreaWidget
Documentation
data SubredditWidgets Source #
An organized collection of a subreddit's widgets
SubredditWidgets | |
|
Instances
Represents one of various kinds of widgets
Instances
A widget ID. These are usually prefixed with the type of widget it corresponds
to, e.g. rules-2qh1i
for a RulesWidget
Instances
Eq WidgetID Source # | |
Show WidgetID Source # | |
Generic WidgetID Source # | |
ToJSON WidgetID Source # | |
Defined in Network.Reddit.Types.Widget | |
FromJSON WidgetID Source # | |
ToHttpApiData WidgetID Source # | |
Defined in Network.Reddit.Types.Widget toUrlPiece :: WidgetID -> Text # toEncodedUrlPiece :: WidgetID -> Builder # toHeader :: WidgetID -> ByteString # toQueryParam :: WidgetID -> Text # | |
type Rep WidgetID Source # | |
Defined in Network.Reddit.Types.Widget |
data WidgetSection Source #
The section in which certain Widget
s appear
Instances
Eq WidgetSection Source # | |
Defined in Network.Reddit.Types.Widget (==) :: WidgetSection -> WidgetSection -> Bool # (/=) :: WidgetSection -> WidgetSection -> Bool # | |
Show WidgetSection Source # | |
Defined in Network.Reddit.Types.Widget showsPrec :: Int -> WidgetSection -> ShowS # show :: WidgetSection -> String # showList :: [WidgetSection] -> ShowS # | |
Generic WidgetSection Source # | |
Defined in Network.Reddit.Types.Widget type Rep WidgetSection :: Type -> Type # from :: WidgetSection -> Rep WidgetSection x # to :: Rep WidgetSection x -> WidgetSection # | |
ToHttpApiData WidgetSection Source # | |
Defined in Network.Reddit.Types.Widget toUrlPiece :: WidgetSection -> Text # toEncodedUrlPiece :: WidgetSection -> Builder # toHeader :: WidgetSection -> ByteString # toQueryParam :: WidgetSection -> Text # | |
type Rep WidgetSection Source # | |
A "short name" for any widget. This name must be less than 30 characters long
mkShortName :: MonadThrow m => Text -> m ShortName Source #
Smart constructor for ShortName
s, which must be <= 30 characters long
data WidgetList Source #
Wrapper to parse a HashMap WidgetID Widget
, discarding the ID keys
Instances
Show WidgetList Source # | |
Defined in Network.Reddit.Types.Widget showsPrec :: Int -> WidgetList -> ShowS # show :: WidgetList -> String # showList :: [WidgetList] -> ShowS # | |
Generic WidgetList Source # | |
Defined in Network.Reddit.Types.Widget type Rep WidgetList :: Type -> Type # from :: WidgetList -> Rep WidgetList x # to :: Rep WidgetList x -> WidgetList # | |
FromJSON WidgetList Source # | |
Defined in Network.Reddit.Types.Widget parseJSON :: Value -> Parser WidgetList # parseJSONList :: Value -> Parser [WidgetList] # | |
type Rep WidgetList Source # | |
Defined in Network.Reddit.Types.Widget type Rep WidgetList = D1 ('MetaData "WidgetList" "Network.Reddit.Types.Widget" "heddit-0.0.1-76ROQ5tOAm3CpLSaFw8ccb" 'True) (C1 ('MetaCons "WidgetList" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Seq Widget)))) |
data WidgetStyles Source #
Style options for an individual widget
Instances
Individual widget types
All of the widget types in this module have a widgetID
field
with the type Maybe WidgetID
. This field should be present
when fetching existing widgets, but should be left as Nothing
if creating a new widget
data ButtonWidget Source #
A widget containing buttons
Instances
An individual button in a ButtonWidget
Instances
Eq Button Source # | |
Show Button Source # | |
Generic Button Source # | |
ToJSON Button Source # | |
Defined in Network.Reddit.Types.Widget | |
FromJSON Button Source # | |
type Rep Button Source # | |
Defined in Network.Reddit.Types.Widget type Rep Button = D1 ('MetaData "Button" "Network.Reddit.Types.Widget" "heddit-0.0.1-76ROQ5tOAm3CpLSaFw8ccb" 'False) (C1 ('MetaCons "ImageButton" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ButtonImage)) :+: C1 ('MetaCons "TextButton" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ButtonText))) |
data ButtonImage Source #
Data for an ImageButton
Instances
data ButtonText Source #
Data for a TextButton
Instances
data ButtonHover Source #
The state of the Button
when hovering over it
Instances
data ImageHover Source #
The state of an ImageButton
when hovering over it
Instances
The state of a TextButton
when hovering over it
Instances
Eq TextHover Source # | |
Show TextHover Source # | |
Generic TextHover Source # | |
ToJSON TextHover Source # | |
Defined in Network.Reddit.Types.Widget | |
FromJSON TextHover Source # | |
type Rep TextHover Source # | |
Defined in Network.Reddit.Types.Widget type Rep TextHover = D1 ('MetaData "TextHover" "Network.Reddit.Types.Widget" "heddit-0.0.1-76ROQ5tOAm3CpLSaFw8ccb" 'False) (C1 ('MetaCons "TextHover" 'PrefixI 'True) ((S1 ('MetaSel ('Just "text") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ShortName) :*: S1 ('MetaSel ('Just "color") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe RGBText))) :*: (S1 ('MetaSel ('Just "fillColor") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe RGBText)) :*: S1 ('MetaSel ('Just "textColor") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe RGBText))))) |
data CalendarWidget Source #
A widget representing a calendar
Instances
data CalendarConfig Source #
Configuration options for a CalendarWidget
Instances
defaultCalendarConfig :: CalendarConfig Source #
A calendar config with default values
data CommunityListWidget Source #
A widget listing related subreddits
Instances
data CommunityInfo Source #
Information about a single subreddit in a CommunityListWidget
. When
creating a new widget, only the name
field will be serialized
CommunityInfo | |
|
Instances
mkCommunityInfo :: SubredditName -> CommunityInfo Source #
Convenience function for creating a new CommunityInfo
, where
all but one of the fields should be Nothing
data CustomWidget Source #
A custom widget
Instances
Image data that belongs to a CustomWidget
Instances
Eq ImageData Source # | |
Show ImageData Source # | |
Generic ImageData Source # | |
ToJSON ImageData Source # | |
Defined in Network.Reddit.Types.Widget | |
FromJSON ImageData Source # | |
type Rep ImageData Source # | |
Defined in Network.Reddit.Types.Widget type Rep ImageData = D1 ('MetaData "ImageData" "Network.Reddit.Types.Widget" "heddit-0.0.1-76ROQ5tOAm3CpLSaFw8ccb" 'False) (C1 ('MetaCons "ImageData" 'PrefixI 'True) ((S1 ('MetaSel ('Just "name") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Name) :*: S1 ('MetaSel ('Just "height") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int)) :*: (S1 ('MetaSel ('Just "width") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int) :*: S1 ('MetaSel ('Just "url") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 UploadURL)))) |
data IDCardWidget Source #
An ID card displaying information about the subreddit
Instances
data ImageWidget Source #
A widget composed of various Image
s
Instances
An individual image in an ImageWidget
Instances
Eq Image Source # | |
Show Image Source # | |
Generic Image Source # | |
ToJSON Image Source # | |
Defined in Network.Reddit.Types.Widget | |
FromJSON Image Source # | |
type Rep Image Source # | |
Defined in Network.Reddit.Types.Widget type Rep Image = D1 ('MetaData "Image" "Network.Reddit.Types.Widget" "heddit-0.0.1-76ROQ5tOAm3CpLSaFw8ccb" 'False) (C1 ('MetaCons "Image" 'PrefixI 'True) ((S1 ('MetaSel ('Just "width") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Integer) :*: S1 ('MetaSel ('Just "height") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Integer)) :*: (S1 ('MetaSel ('Just "url") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 UploadURL) :*: S1 ('MetaSel ('Just "linkURL") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe URL))))) |
data MenuWidget Source #
A widget representing a menu
Instances
A child widget in a MenuWidget
Instances
Eq MenuChild Source # | |
Show MenuChild Source # | |
Generic MenuChild Source # | |
ToJSON MenuChild Source # | |
Defined in Network.Reddit.Types.Widget | |
FromJSON MenuChild Source # | |
type Rep MenuChild Source # | |
Defined in Network.Reddit.Types.Widget type Rep MenuChild = D1 ('MetaData "MenuChild" "Network.Reddit.Types.Widget" "heddit-0.0.1-76ROQ5tOAm3CpLSaFw8ccb" 'False) (C1 ('MetaCons "SubmenuChild" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Submenu)) :+: C1 ('MetaCons "MenuLinkChild" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 MenuLink))) |
A link in a MenuWidget
or Submenu
Instances
Eq MenuLink Source # | |
Show MenuLink Source # | |
Generic MenuLink Source # | |
ToJSON MenuLink Source # | |
Defined in Network.Reddit.Types.Widget | |
FromJSON MenuLink Source # | |
type Rep MenuLink Source # | |
Defined in Network.Reddit.Types.Widget type Rep MenuLink = D1 ('MetaData "MenuLink" "Network.Reddit.Types.Widget" "heddit-0.0.1-76ROQ5tOAm3CpLSaFw8ccb" 'False) (C1 ('MetaCons "MenuLink" 'PrefixI 'True) (S1 ('MetaSel ('Just "text") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "url") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 URL))) |
A submenu child in a MenuWidget
which contains MenuLink
s
Instances
data ModeratorsWidget Source #
A widget listing the moderators of the subreddit. This widget cannot be
created. It can be updated by modifying the styles
field only
Instances
Information about a moderator as displayed in a ModeratorsWidget
Instances
Eq ModInfo Source # | |
Show ModInfo Source # | |
Generic ModInfo Source # | |
ToJSON ModInfo Source # | |
Defined in Network.Reddit.Types.Widget | |
FromJSON ModInfo Source # | |
type Rep ModInfo Source # | |
Defined in Network.Reddit.Types.Widget type Rep ModInfo = D1 ('MetaData "ModInfo" "Network.Reddit.Types.Widget" "heddit-0.0.1-76ROQ5tOAm3CpLSaFw8ccb" 'False) (C1 ('MetaCons "ModInfo" 'PrefixI 'True) ((S1 ('MetaSel ('Just "name") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Username) :*: S1 ('MetaSel ('Just "flairText") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe FlairText))) :*: (S1 ('MetaSel ('Just "flairTextColor") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe ForegroundColor)) :*: S1 ('MetaSel ('Just "flairBackgroundColor") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe RGBText))))) |
data PostFlairWidget Source #
A widget listing flair choices for submissions. When creating a new widget,
the FlairID
s in the order
field must be valid template IDs for the given
subreddit. Existing flair templates can be obtained with
getSubmissionFlairTemplates
, which can
then be mapped over to obtain the IDs. Once the flair IDs have been obtained,
mkPostFlairWidget
can be used to construct a widget with default values for
most fields
PostFlairWidget | |
|
Instances
mkPostFlairWidget :: ShortName -> Seq FlairID -> PostFlairWidget Source #
Make a new PostFlairWidget
with default values for most fields
data PostFlairInfo Source #
Information about submission flair templates in a PostFlairWidget
PostFlairInfo | |
|
Instances
data PostFlairWidgetDisplay Source #
The display orientation for PostFlairWidget
s
Instances
Eq PostFlairWidgetDisplay Source # | |
Defined in Network.Reddit.Types.Widget | |
Show PostFlairWidgetDisplay Source # | |
Defined in Network.Reddit.Types.Widget showsPrec :: Int -> PostFlairWidgetDisplay -> ShowS # show :: PostFlairWidgetDisplay -> String # showList :: [PostFlairWidgetDisplay] -> ShowS # | |
Generic PostFlairWidgetDisplay Source # | |
Defined in Network.Reddit.Types.Widget type Rep PostFlairWidgetDisplay :: Type -> Type # | |
ToJSON PostFlairWidgetDisplay Source # | |
Defined in Network.Reddit.Types.Widget toJSON :: PostFlairWidgetDisplay -> Value # toEncoding :: PostFlairWidgetDisplay -> Encoding # toJSONList :: [PostFlairWidgetDisplay] -> Value # | |
FromJSON PostFlairWidgetDisplay Source # | |
Defined in Network.Reddit.Types.Widget | |
type Rep PostFlairWidgetDisplay Source # | |
Defined in Network.Reddit.Types.Widget |
data RulesWidget Source #
A widget listing subreddit SubredditRule
s. The rules
field cannot be
updated through widget endpoints, and are excluded during serialization
RulesWidget | |
|
Instances
data RulesDisplay Source #
Display style for a RulesWidget
Instances
Eq RulesDisplay Source # | |
Defined in Network.Reddit.Types.Widget (==) :: RulesDisplay -> RulesDisplay -> Bool # (/=) :: RulesDisplay -> RulesDisplay -> Bool # | |
Show RulesDisplay Source # | |
Defined in Network.Reddit.Types.Widget showsPrec :: Int -> RulesDisplay -> ShowS # show :: RulesDisplay -> String # showList :: [RulesDisplay] -> ShowS # | |
Generic RulesDisplay Source # | |
Defined in Network.Reddit.Types.Widget type Rep RulesDisplay :: Type -> Type # from :: RulesDisplay -> Rep RulesDisplay x # to :: Rep RulesDisplay x -> RulesDisplay # | |
ToJSON RulesDisplay Source # | |
Defined in Network.Reddit.Types.Widget toJSON :: RulesDisplay -> Value # toEncoding :: RulesDisplay -> Encoding # toJSONList :: [RulesDisplay] -> Value # toEncodingList :: [RulesDisplay] -> Encoding # | |
FromJSON RulesDisplay Source # | |
Defined in Network.Reddit.Types.Widget parseJSON :: Value -> Parser RulesDisplay # parseJSONList :: Value -> Parser [RulesDisplay] # | |
type Rep RulesDisplay Source # | |
Defined in Network.Reddit.Types.Widget |
data TextAreaWidget Source #
A widget composed of text. See mkTextAreaWidget
for constructing a new
widget
Instances
mkTextAreaWidget :: ShortName -> Body -> TextAreaWidget Source #
Create a new TextAreaWidget
, with default values for most fields