module TD.Data.PageBlock
  (PageBlock(..)) where

import qualified Data.Aeson as A
import qualified Data.Aeson.Types as AT
import qualified TD.Lib.Internal as I
import qualified TD.Data.RichText as RichText
import qualified Data.Text as T
import {-# SOURCE #-} qualified TD.Data.PageBlockListItem as PageBlockListItem
import qualified TD.Data.Animation as Animation
import qualified TD.Data.PageBlockCaption as PageBlockCaption
import qualified TD.Data.Audio as Audio
import qualified TD.Data.Photo as Photo
import qualified TD.Data.Video as Video
import qualified TD.Data.VoiceNote as VoiceNote
import qualified TD.Data.ChatPhotoInfo as ChatPhotoInfo
import qualified TD.Data.PageBlockTableCell as PageBlockTableCell
import qualified TD.Data.PageBlockRelatedArticle as PageBlockRelatedArticle
import qualified TD.Data.Location as Location

-- | Describes a block of an instant view for a web page
data PageBlock
  = PageBlockTitle -- ^ The title of a page; instant view only
    { PageBlock -> Maybe RichText
title :: Maybe RichText.RichText -- ^ Title
    }
  | PageBlockSubtitle -- ^ The subtitle of a page; instant view only
    { PageBlock -> Maybe RichText
subtitle :: Maybe RichText.RichText -- ^ Subtitle
    }
  | PageBlockAuthorDate -- ^ The author and publishing date of a page; instant view only
    { PageBlock -> Maybe RichText
author       :: Maybe RichText.RichText -- ^ Author
    , PageBlock -> Maybe Int
publish_date :: Maybe Int               -- ^ Point in time (Unix timestamp) when the article was published; 0 if unknown
    }
  | PageBlockHeader -- ^ A header; instant view only
    { PageBlock -> Maybe RichText
header :: Maybe RichText.RichText -- ^ Header
    }
  | PageBlockSubheader -- ^ A subheader; instant view only
    { PageBlock -> Maybe RichText
subheader :: Maybe RichText.RichText -- ^ Subheader
    }
  | PageBlockSectionHeading -- ^ A section heading
    { PageBlock -> Maybe RichText
text :: Maybe RichText.RichText -- ^ Text of the section heading
    , PageBlock -> Maybe Int
size :: Maybe Int               -- ^ Relative size of the text font; 1-6, 1 is the largest, 6 is the smallest
    }
  | PageBlockKicker -- ^ A kicker; instant view only
    { PageBlock -> Maybe RichText
kicker :: Maybe RichText.RichText -- ^ Kicker
    }
  | PageBlockParagraph -- ^ A text paragraph
    { text :: Maybe RichText.RichText -- ^ Paragraph text
    }
  | PageBlockPreformatted -- ^ A preformatted text paragraph
    { text     :: Maybe RichText.RichText -- ^ Paragraph text
    , PageBlock -> Maybe Text
language :: Maybe T.Text            -- ^ Programming language for which the text needs to be formatted
    }
  | PageBlockFooter -- ^ The footer of a page
    { PageBlock -> Maybe RichText
footer :: Maybe RichText.RichText -- ^ Footer
    }
  | PageBlockThinking -- ^ A "Thinking..." placeholder; for pending rich messages only
    { text :: Maybe RichText.RichText -- ^ Text of the placeholder
    }
  | PageBlockDivider -- ^ An empty block separating a page
  | PageBlockMathematicalExpression -- ^ A mathematical expression
    { PageBlock -> Maybe Text
expression :: Maybe T.Text -- ^ The expression in LaTeX format
    }
  | PageBlockAnchor -- ^ An invisible anchor on a page, which can be used in a URL to open the page from the specified anchor
    { PageBlock -> Maybe Text
name :: Maybe T.Text -- ^ Name of the anchor
    }
  | PageBlockList -- ^ A list of data blocks
    { PageBlock -> Maybe [PageBlockListItem]
items :: Maybe [PageBlockListItem.PageBlockListItem] -- ^ The items of the list
    }
  | PageBlockBlockQuote -- ^ A block quote
    { PageBlock -> Maybe [PageBlock]
blocks :: Maybe [PageBlock]       -- ^ Quote blocks
    , PageBlock -> Maybe RichText
credit :: Maybe RichText.RichText -- ^ Quote credit; may be null if none
    }
  | PageBlockPullQuote -- ^ A pull quote
    { text   :: Maybe RichText.RichText -- ^ Quote text
    , credit :: Maybe RichText.RichText -- ^ Quote credit; may be null if none
    }
  | PageBlockAnimation -- ^ An animation
    { PageBlock -> Maybe Animation
animation     :: Maybe Animation.Animation               -- ^ Animation file; may be null
    , PageBlock -> Maybe PageBlockCaption
caption       :: Maybe PageBlockCaption.PageBlockCaption -- ^ Animation caption; may be null if none
    , PageBlock -> Maybe Bool
need_autoplay :: Maybe Bool                              -- ^ True, if the animation must be played automatically
    , PageBlock -> Maybe Bool
has_spoiler   :: Maybe Bool                              -- ^ True, if the animation preview must be covered by a spoiler animation
    }
  | PageBlockAudio -- ^ An audio file
    { PageBlock -> Maybe Audio
audio   :: Maybe Audio.Audio                       -- ^ Audio file; may be null
    , caption :: Maybe PageBlockCaption.PageBlockCaption -- ^ Audio file caption; may be null if none
    }
  | PageBlockPhoto -- ^ A photo
    { PageBlock -> Maybe Photo
photo       :: Maybe Photo.Photo                       -- ^ Photo file; may be null
    , caption     :: Maybe PageBlockCaption.PageBlockCaption -- ^ Photo caption; may be null if none
    , PageBlock -> Maybe Text
url         :: Maybe T.Text                            -- ^ URL that needs to be opened when the photo is clicked; instant view only
    , has_spoiler :: Maybe Bool                              -- ^ True, if the photo preview must be covered by a spoiler animation
    }
  | PageBlockVideo -- ^ A video
    { PageBlock -> Maybe Video
video         :: Maybe Video.Video                       -- ^ Video file; may be null
    , caption       :: Maybe PageBlockCaption.PageBlockCaption -- ^ Video caption; may be null if none
    , need_autoplay :: Maybe Bool                              -- ^ True, if the video must be played automatically
    , PageBlock -> Maybe Bool
is_looped     :: Maybe Bool                              -- ^ True, if the video must be looped
    , has_spoiler   :: Maybe Bool                              -- ^ True, if the video preview must be covered by a spoiler animation
    }
  | PageBlockVoiceNote -- ^ A voice note
    { PageBlock -> Maybe VoiceNote
voice_note :: Maybe VoiceNote.VoiceNote               -- ^ Voice note; may be null
    , caption    :: Maybe PageBlockCaption.PageBlockCaption -- ^ Voice note caption; may be null if none
    }
  | PageBlockCover -- ^ A page cover; instant view only
    { PageBlock -> Maybe PageBlock
cover :: Maybe PageBlock -- ^ Cover
    }
  | PageBlockEmbedded -- ^ An embedded web page; instant view only
    { url             :: Maybe T.Text                            -- ^ URL of the embedded page, if available
    , PageBlock -> Maybe Text
html            :: Maybe T.Text                            -- ^ HTML-markup of the embedded page
    , PageBlock -> Maybe Photo
poster_photo    :: Maybe Photo.Photo                       -- ^ Poster photo, if available; may be null
    , PageBlock -> Maybe Int
width           :: Maybe Int                               -- ^ Block width; 0 if unknown
    , PageBlock -> Maybe Int
height          :: Maybe Int                               -- ^ Block height; 0 if unknown
    , caption         :: Maybe PageBlockCaption.PageBlockCaption -- ^ Block caption; may be null if none
    , PageBlock -> Maybe Bool
is_full_width   :: Maybe Bool                              -- ^ True, if the block must be full width
    , PageBlock -> Maybe Bool
allow_scrolling :: Maybe Bool                              -- ^ True, if scrolling needs to be allowed
    }
  | PageBlockEmbeddedPost -- ^ An embedded post; instant view only
    { url          :: Maybe T.Text                            -- ^ URL of the embedded post
    , PageBlock -> Maybe Text
_author      :: Maybe T.Text                            -- ^ Post author
    , PageBlock -> Maybe Photo
author_photo :: Maybe Photo.Photo                       -- ^ Post author photo; may be null
    , PageBlock -> Maybe Int
date         :: Maybe Int                               -- ^ Point in time (Unix timestamp) when the post was created; 0 if unknown
    , blocks       :: Maybe [PageBlock]                       -- ^ Post content
    , caption      :: Maybe PageBlockCaption.PageBlockCaption -- ^ Post caption; may be null if none
    }
  | PageBlockCollage -- ^ A collage
    { blocks  :: Maybe [PageBlock]                       -- ^ Collage item contents
    , caption :: Maybe PageBlockCaption.PageBlockCaption -- ^ Block caption; may be null if none
    }
  | PageBlockSlideshow -- ^ A slideshow
    { blocks  :: Maybe [PageBlock]                       -- ^ Slideshow item contents
    , caption :: Maybe PageBlockCaption.PageBlockCaption -- ^ Block caption; may be null if none
    }
  | PageBlockChatLink -- ^ A link to a chat; instant view only
    { PageBlock -> Maybe Text
_title          :: Maybe T.Text                      -- ^ Chat title
    , PageBlock -> Maybe ChatPhotoInfo
_photo          :: Maybe ChatPhotoInfo.ChatPhotoInfo -- ^ Chat photo; may be null
    , PageBlock -> Maybe Int
accent_color_id :: Maybe Int                         -- ^ Identifier of the accent color for chat title and background of chat photo
    , PageBlock -> Maybe Text
username        :: Maybe T.Text                      -- ^ Chat username by which all other information about the chat can be resolved
    }
  | PageBlockTable -- ^ A table
    { PageBlock -> Maybe RichText
_caption    :: Maybe RichText.RichText                         -- ^ Table caption; may be null if none
    , PageBlock -> Maybe [[PageBlockTableCell]]
cells       :: Maybe [[PageBlockTableCell.PageBlockTableCell]] -- ^ Table cells
    , PageBlock -> Maybe Bool
is_bordered :: Maybe Bool                                      -- ^ True, if the table is bordered
    , PageBlock -> Maybe Bool
is_striped  :: Maybe Bool                                      -- ^ True, if the table is striped
    }
  | PageBlockDetails -- ^ A collapsible block
    { header  :: Maybe RichText.RichText -- ^ Always visible heading for the block
    , blocks  :: Maybe [PageBlock]       -- ^ Block contents
    , PageBlock -> Maybe Bool
is_open :: Maybe Bool              -- ^ True, if the block is open by default
    }
  | PageBlockRelatedArticles -- ^ Related articles; instant view only
    { header   :: Maybe RichText.RichText                                 -- ^ Block header
    , PageBlock -> Maybe [PageBlockRelatedArticle]
articles :: Maybe [PageBlockRelatedArticle.PageBlockRelatedArticle] -- ^ List of related articles
    }
  | PageBlockMap -- ^ A map
    { PageBlock -> Maybe Location
location :: Maybe Location.Location                 -- ^ Location of the map center
    , PageBlock -> Maybe Int
zoom     :: Maybe Int                               -- ^ Map zoom level
    , width    :: Maybe Int                               -- ^ Map width
    , height   :: Maybe Int                               -- ^ Map height
    , caption  :: Maybe PageBlockCaption.PageBlockCaption -- ^ Block caption; may be null if none
    }
  deriving (PageBlock -> PageBlock -> Bool
(PageBlock -> PageBlock -> Bool)
-> (PageBlock -> PageBlock -> Bool) -> Eq PageBlock
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PageBlock -> PageBlock -> Bool
== :: PageBlock -> PageBlock -> Bool
$c/= :: PageBlock -> PageBlock -> Bool
/= :: PageBlock -> PageBlock -> Bool
Eq, Int -> PageBlock -> ShowS
[PageBlock] -> ShowS
PageBlock -> String
(Int -> PageBlock -> ShowS)
-> (PageBlock -> String)
-> ([PageBlock] -> ShowS)
-> Show PageBlock
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PageBlock -> ShowS
showsPrec :: Int -> PageBlock -> ShowS
$cshow :: PageBlock -> String
show :: PageBlock -> String
$cshowList :: [PageBlock] -> ShowS
showList :: [PageBlock] -> ShowS
Show)

instance I.ShortShow PageBlock where
  shortShow :: PageBlock -> String
shortShow PageBlockTitle
    { title :: PageBlock -> Maybe RichText
title = Maybe RichText
title_
    }
      = String
"PageBlockTitle"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"title" String -> Maybe RichText -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe RichText
title_
        ]
  shortShow PageBlockSubtitle
    { subtitle :: PageBlock -> Maybe RichText
subtitle = Maybe RichText
subtitle_
    }
      = String
"PageBlockSubtitle"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"subtitle" String -> Maybe RichText -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe RichText
subtitle_
        ]
  shortShow PageBlockAuthorDate
    { author :: PageBlock -> Maybe RichText
author       = Maybe RichText
author_
    , publish_date :: PageBlock -> Maybe Int
publish_date = Maybe Int
publish_date_
    }
      = String
"PageBlockAuthorDate"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"author"       String -> Maybe RichText -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe RichText
author_
        , String
"publish_date" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
publish_date_
        ]
  shortShow PageBlockHeader
    { header :: PageBlock -> Maybe RichText
header = Maybe RichText
header_
    }
      = String
"PageBlockHeader"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"header" String -> Maybe RichText -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe RichText
header_
        ]
  shortShow PageBlockSubheader
    { subheader :: PageBlock -> Maybe RichText
subheader = Maybe RichText
subheader_
    }
      = String
"PageBlockSubheader"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"subheader" String -> Maybe RichText -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe RichText
subheader_
        ]
  shortShow PageBlockSectionHeading
    { text :: PageBlock -> Maybe RichText
text = Maybe RichText
text_
    , size :: PageBlock -> Maybe Int
size = Maybe Int
size_
    }
      = String
"PageBlockSectionHeading"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"text" String -> Maybe RichText -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe RichText
text_
        , String
"size" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
size_
        ]
  shortShow PageBlockKicker
    { kicker :: PageBlock -> Maybe RichText
kicker = Maybe RichText
kicker_
    }
      = String
"PageBlockKicker"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"kicker" String -> Maybe RichText -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe RichText
kicker_
        ]
  shortShow PageBlockParagraph
    { text :: PageBlock -> Maybe RichText
text = Maybe RichText
text_
    }
      = String
"PageBlockParagraph"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"text" String -> Maybe RichText -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe RichText
text_
        ]
  shortShow PageBlockPreformatted
    { text :: PageBlock -> Maybe RichText
text     = Maybe RichText
text_
    , language :: PageBlock -> Maybe Text
language = Maybe Text
language_
    }
      = String
"PageBlockPreformatted"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"text"     String -> Maybe RichText -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe RichText
text_
        , String
"language" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
language_
        ]
  shortShow PageBlockFooter
    { footer :: PageBlock -> Maybe RichText
footer = Maybe RichText
footer_
    }
      = String
"PageBlockFooter"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"footer" String -> Maybe RichText -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe RichText
footer_
        ]
  shortShow PageBlockThinking
    { text :: PageBlock -> Maybe RichText
text = Maybe RichText
text_
    }
      = String
"PageBlockThinking"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"text" String -> Maybe RichText -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe RichText
text_
        ]
  shortShow PageBlock
PageBlockDivider
      = String
"PageBlockDivider"
  shortShow PageBlockMathematicalExpression
    { expression :: PageBlock -> Maybe Text
expression = Maybe Text
expression_
    }
      = String
"PageBlockMathematicalExpression"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"expression" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
expression_
        ]
  shortShow PageBlockAnchor
    { name :: PageBlock -> Maybe Text
name = Maybe Text
name_
    }
      = String
"PageBlockAnchor"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"name" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
name_
        ]
  shortShow PageBlockList
    { items :: PageBlock -> Maybe [PageBlockListItem]
items = Maybe [PageBlockListItem]
items_
    }
      = String
"PageBlockList"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"items" String -> Maybe [PageBlockListItem] -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe [PageBlockListItem]
items_
        ]
  shortShow PageBlockBlockQuote
    { blocks :: PageBlock -> Maybe [PageBlock]
blocks = Maybe [PageBlock]
blocks_
    , credit :: PageBlock -> Maybe RichText
credit = Maybe RichText
credit_
    }
      = String
"PageBlockBlockQuote"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"blocks" String -> Maybe [PageBlock] -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe [PageBlock]
blocks_
        , String
"credit" String -> Maybe RichText -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe RichText
credit_
        ]
  shortShow PageBlockPullQuote
    { text :: PageBlock -> Maybe RichText
text   = Maybe RichText
text_
    , credit :: PageBlock -> Maybe RichText
credit = Maybe RichText
credit_
    }
      = String
"PageBlockPullQuote"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"text"   String -> Maybe RichText -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe RichText
text_
        , String
"credit" String -> Maybe RichText -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe RichText
credit_
        ]
  shortShow PageBlockAnimation
    { animation :: PageBlock -> Maybe Animation
animation     = Maybe Animation
animation_
    , caption :: PageBlock -> Maybe PageBlockCaption
caption       = Maybe PageBlockCaption
caption_
    , need_autoplay :: PageBlock -> Maybe Bool
need_autoplay = Maybe Bool
need_autoplay_
    , has_spoiler :: PageBlock -> Maybe Bool
has_spoiler   = Maybe Bool
has_spoiler_
    }
      = String
"PageBlockAnimation"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"animation"     String -> Maybe Animation -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Animation
animation_
        , String
"caption"       String -> Maybe PageBlockCaption -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe PageBlockCaption
caption_
        , String
"need_autoplay" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
need_autoplay_
        , String
"has_spoiler"   String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
has_spoiler_
        ]
  shortShow PageBlockAudio
    { audio :: PageBlock -> Maybe Audio
audio   = Maybe Audio
audio_
    , caption :: PageBlock -> Maybe PageBlockCaption
caption = Maybe PageBlockCaption
caption_
    }
      = String
"PageBlockAudio"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"audio"   String -> Maybe Audio -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Audio
audio_
        , String
"caption" String -> Maybe PageBlockCaption -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe PageBlockCaption
caption_
        ]
  shortShow PageBlockPhoto
    { photo :: PageBlock -> Maybe Photo
photo       = Maybe Photo
photo_
    , caption :: PageBlock -> Maybe PageBlockCaption
caption     = Maybe PageBlockCaption
caption_
    , url :: PageBlock -> Maybe Text
url         = Maybe Text
url_
    , has_spoiler :: PageBlock -> Maybe Bool
has_spoiler = Maybe Bool
has_spoiler_
    }
      = String
"PageBlockPhoto"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"photo"       String -> Maybe Photo -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Photo
photo_
        , String
"caption"     String -> Maybe PageBlockCaption -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe PageBlockCaption
caption_
        , String
"url"         String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
url_
        , String
"has_spoiler" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
has_spoiler_
        ]
  shortShow PageBlockVideo
    { video :: PageBlock -> Maybe Video
video         = Maybe Video
video_
    , caption :: PageBlock -> Maybe PageBlockCaption
caption       = Maybe PageBlockCaption
caption_
    , need_autoplay :: PageBlock -> Maybe Bool
need_autoplay = Maybe Bool
need_autoplay_
    , is_looped :: PageBlock -> Maybe Bool
is_looped     = Maybe Bool
is_looped_
    , has_spoiler :: PageBlock -> Maybe Bool
has_spoiler   = Maybe Bool
has_spoiler_
    }
      = String
"PageBlockVideo"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"video"         String -> Maybe Video -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Video
video_
        , String
"caption"       String -> Maybe PageBlockCaption -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe PageBlockCaption
caption_
        , String
"need_autoplay" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
need_autoplay_
        , String
"is_looped"     String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
is_looped_
        , String
"has_spoiler"   String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
has_spoiler_
        ]
  shortShow PageBlockVoiceNote
    { voice_note :: PageBlock -> Maybe VoiceNote
voice_note = Maybe VoiceNote
voice_note_
    , caption :: PageBlock -> Maybe PageBlockCaption
caption    = Maybe PageBlockCaption
caption_
    }
      = String
"PageBlockVoiceNote"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"voice_note" String -> Maybe VoiceNote -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe VoiceNote
voice_note_
        , String
"caption"    String -> Maybe PageBlockCaption -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe PageBlockCaption
caption_
        ]
  shortShow PageBlockCover
    { cover :: PageBlock -> Maybe PageBlock
cover = Maybe PageBlock
cover_
    }
      = String
"PageBlockCover"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"cover" String -> Maybe PageBlock -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe PageBlock
cover_
        ]
  shortShow PageBlockEmbedded
    { url :: PageBlock -> Maybe Text
url             = Maybe Text
url_
    , html :: PageBlock -> Maybe Text
html            = Maybe Text
html_
    , poster_photo :: PageBlock -> Maybe Photo
poster_photo    = Maybe Photo
poster_photo_
    , width :: PageBlock -> Maybe Int
width           = Maybe Int
width_
    , height :: PageBlock -> Maybe Int
height          = Maybe Int
height_
    , caption :: PageBlock -> Maybe PageBlockCaption
caption         = Maybe PageBlockCaption
caption_
    , is_full_width :: PageBlock -> Maybe Bool
is_full_width   = Maybe Bool
is_full_width_
    , allow_scrolling :: PageBlock -> Maybe Bool
allow_scrolling = Maybe Bool
allow_scrolling_
    }
      = String
"PageBlockEmbedded"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"url"             String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
url_
        , String
"html"            String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
html_
        , String
"poster_photo"    String -> Maybe Photo -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Photo
poster_photo_
        , String
"width"           String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
width_
        , String
"height"          String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
height_
        , String
"caption"         String -> Maybe PageBlockCaption -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe PageBlockCaption
caption_
        , String
"is_full_width"   String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
is_full_width_
        , String
"allow_scrolling" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
allow_scrolling_
        ]
  shortShow PageBlockEmbeddedPost
    { url :: PageBlock -> Maybe Text
url          = Maybe Text
url_
    , _author :: PageBlock -> Maybe Text
_author      = Maybe Text
_author_
    , author_photo :: PageBlock -> Maybe Photo
author_photo = Maybe Photo
author_photo_
    , date :: PageBlock -> Maybe Int
date         = Maybe Int
date_
    , blocks :: PageBlock -> Maybe [PageBlock]
blocks       = Maybe [PageBlock]
blocks_
    , caption :: PageBlock -> Maybe PageBlockCaption
caption      = Maybe PageBlockCaption
caption_
    }
      = String
"PageBlockEmbeddedPost"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"url"          String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
url_
        , String
"_author"      String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
_author_
        , String
"author_photo" String -> Maybe Photo -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Photo
author_photo_
        , String
"date"         String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
date_
        , String
"blocks"       String -> Maybe [PageBlock] -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe [PageBlock]
blocks_
        , String
"caption"      String -> Maybe PageBlockCaption -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe PageBlockCaption
caption_
        ]
  shortShow PageBlockCollage
    { blocks :: PageBlock -> Maybe [PageBlock]
blocks  = Maybe [PageBlock]
blocks_
    , caption :: PageBlock -> Maybe PageBlockCaption
caption = Maybe PageBlockCaption
caption_
    }
      = String
"PageBlockCollage"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"blocks"  String -> Maybe [PageBlock] -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe [PageBlock]
blocks_
        , String
"caption" String -> Maybe PageBlockCaption -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe PageBlockCaption
caption_
        ]
  shortShow PageBlockSlideshow
    { blocks :: PageBlock -> Maybe [PageBlock]
blocks  = Maybe [PageBlock]
blocks_
    , caption :: PageBlock -> Maybe PageBlockCaption
caption = Maybe PageBlockCaption
caption_
    }
      = String
"PageBlockSlideshow"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"blocks"  String -> Maybe [PageBlock] -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe [PageBlock]
blocks_
        , String
"caption" String -> Maybe PageBlockCaption -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe PageBlockCaption
caption_
        ]
  shortShow PageBlockChatLink
    { _title :: PageBlock -> Maybe Text
_title          = Maybe Text
_title_
    , _photo :: PageBlock -> Maybe ChatPhotoInfo
_photo          = Maybe ChatPhotoInfo
_photo_
    , accent_color_id :: PageBlock -> Maybe Int
accent_color_id = Maybe Int
accent_color_id_
    , username :: PageBlock -> Maybe Text
username        = Maybe Text
username_
    }
      = String
"PageBlockChatLink"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"_title"          String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
_title_
        , String
"_photo"          String -> Maybe ChatPhotoInfo -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe ChatPhotoInfo
_photo_
        , String
"accent_color_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
accent_color_id_
        , String
"username"        String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
username_
        ]
  shortShow PageBlockTable
    { _caption :: PageBlock -> Maybe RichText
_caption    = Maybe RichText
_caption_
    , cells :: PageBlock -> Maybe [[PageBlockTableCell]]
cells       = Maybe [[PageBlockTableCell]]
cells_
    , is_bordered :: PageBlock -> Maybe Bool
is_bordered = Maybe Bool
is_bordered_
    , is_striped :: PageBlock -> Maybe Bool
is_striped  = Maybe Bool
is_striped_
    }
      = String
"PageBlockTable"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"_caption"    String -> Maybe RichText -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe RichText
_caption_
        , String
"cells"       String -> Maybe [[PageBlockTableCell]] -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe [[PageBlockTableCell]]
cells_
        , String
"is_bordered" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
is_bordered_
        , String
"is_striped"  String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
is_striped_
        ]
  shortShow PageBlockDetails
    { header :: PageBlock -> Maybe RichText
header  = Maybe RichText
header_
    , blocks :: PageBlock -> Maybe [PageBlock]
blocks  = Maybe [PageBlock]
blocks_
    , is_open :: PageBlock -> Maybe Bool
is_open = Maybe Bool
is_open_
    }
      = String
"PageBlockDetails"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"header"  String -> Maybe RichText -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe RichText
header_
        , String
"blocks"  String -> Maybe [PageBlock] -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe [PageBlock]
blocks_
        , String
"is_open" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
is_open_
        ]
  shortShow PageBlockRelatedArticles
    { header :: PageBlock -> Maybe RichText
header   = Maybe RichText
header_
    , articles :: PageBlock -> Maybe [PageBlockRelatedArticle]
articles = Maybe [PageBlockRelatedArticle]
articles_
    }
      = String
"PageBlockRelatedArticles"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"header"   String -> Maybe RichText -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe RichText
header_
        , String
"articles" String -> Maybe [PageBlockRelatedArticle] -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe [PageBlockRelatedArticle]
articles_
        ]
  shortShow PageBlockMap
    { location :: PageBlock -> Maybe Location
location = Maybe Location
location_
    , zoom :: PageBlock -> Maybe Int
zoom     = Maybe Int
zoom_
    , width :: PageBlock -> Maybe Int
width    = Maybe Int
width_
    , height :: PageBlock -> Maybe Int
height   = Maybe Int
height_
    , caption :: PageBlock -> Maybe PageBlockCaption
caption  = Maybe PageBlockCaption
caption_
    }
      = String
"PageBlockMap"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"location" String -> Maybe Location -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Location
location_
        , String
"zoom"     String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
zoom_
        , String
"width"    String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
width_
        , String
"height"   String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
height_
        , String
"caption"  String -> Maybe PageBlockCaption -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe PageBlockCaption
caption_
        ]

instance AT.FromJSON PageBlock where
  parseJSON :: Value -> Parser PageBlock
parseJSON v :: Value
v@(AT.Object Object
obj) = do
    String
t <- Object
obj Object -> Key -> Parser String
forall a. FromJSON a => Object -> Key -> Parser a
A..: Key
"@type" :: AT.Parser String

    case String
t of
      String
"pageBlockTitle"                  -> Value -> Parser PageBlock
parsePageBlockTitle Value
v
      String
"pageBlockSubtitle"               -> Value -> Parser PageBlock
parsePageBlockSubtitle Value
v
      String
"pageBlockAuthorDate"             -> Value -> Parser PageBlock
parsePageBlockAuthorDate Value
v
      String
"pageBlockHeader"                 -> Value -> Parser PageBlock
parsePageBlockHeader Value
v
      String
"pageBlockSubheader"              -> Value -> Parser PageBlock
parsePageBlockSubheader Value
v
      String
"pageBlockSectionHeading"         -> Value -> Parser PageBlock
parsePageBlockSectionHeading Value
v
      String
"pageBlockKicker"                 -> Value -> Parser PageBlock
parsePageBlockKicker Value
v
      String
"pageBlockParagraph"              -> Value -> Parser PageBlock
parsePageBlockParagraph Value
v
      String
"pageBlockPreformatted"           -> Value -> Parser PageBlock
parsePageBlockPreformatted Value
v
      String
"pageBlockFooter"                 -> Value -> Parser PageBlock
parsePageBlockFooter Value
v
      String
"pageBlockThinking"               -> Value -> Parser PageBlock
parsePageBlockThinking Value
v
      String
"pageBlockDivider"                -> PageBlock -> Parser PageBlock
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure PageBlock
PageBlockDivider
      String
"pageBlockMathematicalExpression" -> Value -> Parser PageBlock
parsePageBlockMathematicalExpression Value
v
      String
"pageBlockAnchor"                 -> Value -> Parser PageBlock
parsePageBlockAnchor Value
v
      String
"pageBlockList"                   -> Value -> Parser PageBlock
parsePageBlockList Value
v
      String
"pageBlockBlockQuote"             -> Value -> Parser PageBlock
parsePageBlockBlockQuote Value
v
      String
"pageBlockPullQuote"              -> Value -> Parser PageBlock
parsePageBlockPullQuote Value
v
      String
"pageBlockAnimation"              -> Value -> Parser PageBlock
parsePageBlockAnimation Value
v
      String
"pageBlockAudio"                  -> Value -> Parser PageBlock
parsePageBlockAudio Value
v
      String
"pageBlockPhoto"                  -> Value -> Parser PageBlock
parsePageBlockPhoto Value
v
      String
"pageBlockVideo"                  -> Value -> Parser PageBlock
parsePageBlockVideo Value
v
      String
"pageBlockVoiceNote"              -> Value -> Parser PageBlock
parsePageBlockVoiceNote Value
v
      String
"pageBlockCover"                  -> Value -> Parser PageBlock
parsePageBlockCover Value
v
      String
"pageBlockEmbedded"               -> Value -> Parser PageBlock
parsePageBlockEmbedded Value
v
      String
"pageBlockEmbeddedPost"           -> Value -> Parser PageBlock
parsePageBlockEmbeddedPost Value
v
      String
"pageBlockCollage"                -> Value -> Parser PageBlock
parsePageBlockCollage Value
v
      String
"pageBlockSlideshow"              -> Value -> Parser PageBlock
parsePageBlockSlideshow Value
v
      String
"pageBlockChatLink"               -> Value -> Parser PageBlock
parsePageBlockChatLink Value
v
      String
"pageBlockTable"                  -> Value -> Parser PageBlock
parsePageBlockTable Value
v
      String
"pageBlockDetails"                -> Value -> Parser PageBlock
parsePageBlockDetails Value
v
      String
"pageBlockRelatedArticles"        -> Value -> Parser PageBlock
parsePageBlockRelatedArticles Value
v
      String
"pageBlockMap"                    -> Value -> Parser PageBlock
parsePageBlockMap Value
v
      String
_                                 -> Parser PageBlock
forall a. Monoid a => a
mempty
    
    where
      parsePageBlockTitle :: A.Value -> AT.Parser PageBlock
      parsePageBlockTitle :: Value -> Parser PageBlock
parsePageBlockTitle = String -> (Object -> Parser PageBlock) -> Value -> Parser PageBlock
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"PageBlockTitle" ((Object -> Parser PageBlock) -> Value -> Parser PageBlock)
-> (Object -> Parser PageBlock) -> Value -> Parser PageBlock
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe RichText
title_ <- Object
o Object -> Key -> Parser (Maybe RichText)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"title"
        PageBlock -> Parser PageBlock
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PageBlock -> Parser PageBlock) -> PageBlock -> Parser PageBlock
forall a b. (a -> b) -> a -> b
$ PageBlockTitle
          { title :: Maybe RichText
title = Maybe RichText
title_
          }
      parsePageBlockSubtitle :: A.Value -> AT.Parser PageBlock
      parsePageBlockSubtitle :: Value -> Parser PageBlock
parsePageBlockSubtitle = String -> (Object -> Parser PageBlock) -> Value -> Parser PageBlock
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"PageBlockSubtitle" ((Object -> Parser PageBlock) -> Value -> Parser PageBlock)
-> (Object -> Parser PageBlock) -> Value -> Parser PageBlock
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe RichText
subtitle_ <- Object
o Object -> Key -> Parser (Maybe RichText)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"subtitle"
        PageBlock -> Parser PageBlock
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PageBlock -> Parser PageBlock) -> PageBlock -> Parser PageBlock
forall a b. (a -> b) -> a -> b
$ PageBlockSubtitle
          { subtitle :: Maybe RichText
subtitle = Maybe RichText
subtitle_
          }
      parsePageBlockAuthorDate :: A.Value -> AT.Parser PageBlock
      parsePageBlockAuthorDate :: Value -> Parser PageBlock
parsePageBlockAuthorDate = String -> (Object -> Parser PageBlock) -> Value -> Parser PageBlock
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"PageBlockAuthorDate" ((Object -> Parser PageBlock) -> Value -> Parser PageBlock)
-> (Object -> Parser PageBlock) -> Value -> Parser PageBlock
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe RichText
author_       <- Object
o Object -> Key -> Parser (Maybe RichText)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"author"
        Maybe Int
publish_date_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"publish_date"
        PageBlock -> Parser PageBlock
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PageBlock -> Parser PageBlock) -> PageBlock -> Parser PageBlock
forall a b. (a -> b) -> a -> b
$ PageBlockAuthorDate
          { author :: Maybe RichText
author       = Maybe RichText
author_
          , publish_date :: Maybe Int
publish_date = Maybe Int
publish_date_
          }
      parsePageBlockHeader :: A.Value -> AT.Parser PageBlock
      parsePageBlockHeader :: Value -> Parser PageBlock
parsePageBlockHeader = String -> (Object -> Parser PageBlock) -> Value -> Parser PageBlock
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"PageBlockHeader" ((Object -> Parser PageBlock) -> Value -> Parser PageBlock)
-> (Object -> Parser PageBlock) -> Value -> Parser PageBlock
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe RichText
header_ <- Object
o Object -> Key -> Parser (Maybe RichText)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"header"
        PageBlock -> Parser PageBlock
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PageBlock -> Parser PageBlock) -> PageBlock -> Parser PageBlock
forall a b. (a -> b) -> a -> b
$ PageBlockHeader
          { header :: Maybe RichText
header = Maybe RichText
header_
          }
      parsePageBlockSubheader :: A.Value -> AT.Parser PageBlock
      parsePageBlockSubheader :: Value -> Parser PageBlock
parsePageBlockSubheader = String -> (Object -> Parser PageBlock) -> Value -> Parser PageBlock
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"PageBlockSubheader" ((Object -> Parser PageBlock) -> Value -> Parser PageBlock)
-> (Object -> Parser PageBlock) -> Value -> Parser PageBlock
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe RichText
subheader_ <- Object
o Object -> Key -> Parser (Maybe RichText)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"subheader"
        PageBlock -> Parser PageBlock
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PageBlock -> Parser PageBlock) -> PageBlock -> Parser PageBlock
forall a b. (a -> b) -> a -> b
$ PageBlockSubheader
          { subheader :: Maybe RichText
subheader = Maybe RichText
subheader_
          }
      parsePageBlockSectionHeading :: A.Value -> AT.Parser PageBlock
      parsePageBlockSectionHeading :: Value -> Parser PageBlock
parsePageBlockSectionHeading = String -> (Object -> Parser PageBlock) -> Value -> Parser PageBlock
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"PageBlockSectionHeading" ((Object -> Parser PageBlock) -> Value -> Parser PageBlock)
-> (Object -> Parser PageBlock) -> Value -> Parser PageBlock
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe RichText
text_ <- Object
o Object -> Key -> Parser (Maybe RichText)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"text"
        Maybe Int
size_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"size"
        PageBlock -> Parser PageBlock
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PageBlock -> Parser PageBlock) -> PageBlock -> Parser PageBlock
forall a b. (a -> b) -> a -> b
$ PageBlockSectionHeading
          { text :: Maybe RichText
text = Maybe RichText
text_
          , size :: Maybe Int
size = Maybe Int
size_
          }
      parsePageBlockKicker :: A.Value -> AT.Parser PageBlock
      parsePageBlockKicker :: Value -> Parser PageBlock
parsePageBlockKicker = String -> (Object -> Parser PageBlock) -> Value -> Parser PageBlock
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"PageBlockKicker" ((Object -> Parser PageBlock) -> Value -> Parser PageBlock)
-> (Object -> Parser PageBlock) -> Value -> Parser PageBlock
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe RichText
kicker_ <- Object
o Object -> Key -> Parser (Maybe RichText)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"kicker"
        PageBlock -> Parser PageBlock
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PageBlock -> Parser PageBlock) -> PageBlock -> Parser PageBlock
forall a b. (a -> b) -> a -> b
$ PageBlockKicker
          { kicker :: Maybe RichText
kicker = Maybe RichText
kicker_
          }
      parsePageBlockParagraph :: A.Value -> AT.Parser PageBlock
      parsePageBlockParagraph :: Value -> Parser PageBlock
parsePageBlockParagraph = String -> (Object -> Parser PageBlock) -> Value -> Parser PageBlock
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"PageBlockParagraph" ((Object -> Parser PageBlock) -> Value -> Parser PageBlock)
-> (Object -> Parser PageBlock) -> Value -> Parser PageBlock
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe RichText
text_ <- Object
o Object -> Key -> Parser (Maybe RichText)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"text"
        PageBlock -> Parser PageBlock
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PageBlock -> Parser PageBlock) -> PageBlock -> Parser PageBlock
forall a b. (a -> b) -> a -> b
$ PageBlockParagraph
          { text :: Maybe RichText
text = Maybe RichText
text_
          }
      parsePageBlockPreformatted :: A.Value -> AT.Parser PageBlock
      parsePageBlockPreformatted :: Value -> Parser PageBlock
parsePageBlockPreformatted = String -> (Object -> Parser PageBlock) -> Value -> Parser PageBlock
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"PageBlockPreformatted" ((Object -> Parser PageBlock) -> Value -> Parser PageBlock)
-> (Object -> Parser PageBlock) -> Value -> Parser PageBlock
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe RichText
text_     <- Object
o Object -> Key -> Parser (Maybe RichText)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"text"
        Maybe Text
language_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"language"
        PageBlock -> Parser PageBlock
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PageBlock -> Parser PageBlock) -> PageBlock -> Parser PageBlock
forall a b. (a -> b) -> a -> b
$ PageBlockPreformatted
          { text :: Maybe RichText
text     = Maybe RichText
text_
          , language :: Maybe Text
language = Maybe Text
language_
          }
      parsePageBlockFooter :: A.Value -> AT.Parser PageBlock
      parsePageBlockFooter :: Value -> Parser PageBlock
parsePageBlockFooter = String -> (Object -> Parser PageBlock) -> Value -> Parser PageBlock
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"PageBlockFooter" ((Object -> Parser PageBlock) -> Value -> Parser PageBlock)
-> (Object -> Parser PageBlock) -> Value -> Parser PageBlock
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe RichText
footer_ <- Object
o Object -> Key -> Parser (Maybe RichText)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"footer"
        PageBlock -> Parser PageBlock
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PageBlock -> Parser PageBlock) -> PageBlock -> Parser PageBlock
forall a b. (a -> b) -> a -> b
$ PageBlockFooter
          { footer :: Maybe RichText
footer = Maybe RichText
footer_
          }
      parsePageBlockThinking :: A.Value -> AT.Parser PageBlock
      parsePageBlockThinking :: Value -> Parser PageBlock
parsePageBlockThinking = String -> (Object -> Parser PageBlock) -> Value -> Parser PageBlock
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"PageBlockThinking" ((Object -> Parser PageBlock) -> Value -> Parser PageBlock)
-> (Object -> Parser PageBlock) -> Value -> Parser PageBlock
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe RichText
text_ <- Object
o Object -> Key -> Parser (Maybe RichText)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"text"
        PageBlock -> Parser PageBlock
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PageBlock -> Parser PageBlock) -> PageBlock -> Parser PageBlock
forall a b. (a -> b) -> a -> b
$ PageBlockThinking
          { text :: Maybe RichText
text = Maybe RichText
text_
          }
      parsePageBlockMathematicalExpression :: A.Value -> AT.Parser PageBlock
      parsePageBlockMathematicalExpression :: Value -> Parser PageBlock
parsePageBlockMathematicalExpression = String -> (Object -> Parser PageBlock) -> Value -> Parser PageBlock
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"PageBlockMathematicalExpression" ((Object -> Parser PageBlock) -> Value -> Parser PageBlock)
-> (Object -> Parser PageBlock) -> Value -> Parser PageBlock
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Text
expression_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"expression"
        PageBlock -> Parser PageBlock
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PageBlock -> Parser PageBlock) -> PageBlock -> Parser PageBlock
forall a b. (a -> b) -> a -> b
$ PageBlockMathematicalExpression
          { expression :: Maybe Text
expression = Maybe Text
expression_
          }
      parsePageBlockAnchor :: A.Value -> AT.Parser PageBlock
      parsePageBlockAnchor :: Value -> Parser PageBlock
parsePageBlockAnchor = String -> (Object -> Parser PageBlock) -> Value -> Parser PageBlock
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"PageBlockAnchor" ((Object -> Parser PageBlock) -> Value -> Parser PageBlock)
-> (Object -> Parser PageBlock) -> Value -> Parser PageBlock
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Text
name_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"name"
        PageBlock -> Parser PageBlock
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PageBlock -> Parser PageBlock) -> PageBlock -> Parser PageBlock
forall a b. (a -> b) -> a -> b
$ PageBlockAnchor
          { name :: Maybe Text
name = Maybe Text
name_
          }
      parsePageBlockList :: A.Value -> AT.Parser PageBlock
      parsePageBlockList :: Value -> Parser PageBlock
parsePageBlockList = String -> (Object -> Parser PageBlock) -> Value -> Parser PageBlock
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"PageBlockList" ((Object -> Parser PageBlock) -> Value -> Parser PageBlock)
-> (Object -> Parser PageBlock) -> Value -> Parser PageBlock
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe [PageBlockListItem]
items_ <- Object
o Object -> Key -> Parser (Maybe [PageBlockListItem])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"items"
        PageBlock -> Parser PageBlock
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PageBlock -> Parser PageBlock) -> PageBlock -> Parser PageBlock
forall a b. (a -> b) -> a -> b
$ PageBlockList
          { items :: Maybe [PageBlockListItem]
items = Maybe [PageBlockListItem]
items_
          }
      parsePageBlockBlockQuote :: A.Value -> AT.Parser PageBlock
      parsePageBlockBlockQuote :: Value -> Parser PageBlock
parsePageBlockBlockQuote = String -> (Object -> Parser PageBlock) -> Value -> Parser PageBlock
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"PageBlockBlockQuote" ((Object -> Parser PageBlock) -> Value -> Parser PageBlock)
-> (Object -> Parser PageBlock) -> Value -> Parser PageBlock
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe [PageBlock]
blocks_ <- Object
o Object -> Key -> Parser (Maybe [PageBlock])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"blocks"
        Maybe RichText
credit_ <- Object
o Object -> Key -> Parser (Maybe RichText)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"credit"
        PageBlock -> Parser PageBlock
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PageBlock -> Parser PageBlock) -> PageBlock -> Parser PageBlock
forall a b. (a -> b) -> a -> b
$ PageBlockBlockQuote
          { blocks :: Maybe [PageBlock]
blocks = Maybe [PageBlock]
blocks_
          , credit :: Maybe RichText
credit = Maybe RichText
credit_
          }
      parsePageBlockPullQuote :: A.Value -> AT.Parser PageBlock
      parsePageBlockPullQuote :: Value -> Parser PageBlock
parsePageBlockPullQuote = String -> (Object -> Parser PageBlock) -> Value -> Parser PageBlock
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"PageBlockPullQuote" ((Object -> Parser PageBlock) -> Value -> Parser PageBlock)
-> (Object -> Parser PageBlock) -> Value -> Parser PageBlock
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe RichText
text_   <- Object
o Object -> Key -> Parser (Maybe RichText)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"text"
        Maybe RichText
credit_ <- Object
o Object -> Key -> Parser (Maybe RichText)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"credit"
        PageBlock -> Parser PageBlock
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PageBlock -> Parser PageBlock) -> PageBlock -> Parser PageBlock
forall a b. (a -> b) -> a -> b
$ PageBlockPullQuote
          { text :: Maybe RichText
text   = Maybe RichText
text_
          , credit :: Maybe RichText
credit = Maybe RichText
credit_
          }
      parsePageBlockAnimation :: A.Value -> AT.Parser PageBlock
      parsePageBlockAnimation :: Value -> Parser PageBlock
parsePageBlockAnimation = String -> (Object -> Parser PageBlock) -> Value -> Parser PageBlock
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"PageBlockAnimation" ((Object -> Parser PageBlock) -> Value -> Parser PageBlock)
-> (Object -> Parser PageBlock) -> Value -> Parser PageBlock
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Animation
animation_     <- Object
o Object -> Key -> Parser (Maybe Animation)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"animation"
        Maybe PageBlockCaption
caption_       <- Object
o Object -> Key -> Parser (Maybe PageBlockCaption)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"caption"
        Maybe Bool
need_autoplay_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"need_autoplay"
        Maybe Bool
has_spoiler_   <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"has_spoiler"
        PageBlock -> Parser PageBlock
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PageBlock -> Parser PageBlock) -> PageBlock -> Parser PageBlock
forall a b. (a -> b) -> a -> b
$ PageBlockAnimation
          { animation :: Maybe Animation
animation     = Maybe Animation
animation_
          , caption :: Maybe PageBlockCaption
caption       = Maybe PageBlockCaption
caption_
          , need_autoplay :: Maybe Bool
need_autoplay = Maybe Bool
need_autoplay_
          , has_spoiler :: Maybe Bool
has_spoiler   = Maybe Bool
has_spoiler_
          }
      parsePageBlockAudio :: A.Value -> AT.Parser PageBlock
      parsePageBlockAudio :: Value -> Parser PageBlock
parsePageBlockAudio = String -> (Object -> Parser PageBlock) -> Value -> Parser PageBlock
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"PageBlockAudio" ((Object -> Parser PageBlock) -> Value -> Parser PageBlock)
-> (Object -> Parser PageBlock) -> Value -> Parser PageBlock
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Audio
audio_   <- Object
o Object -> Key -> Parser (Maybe Audio)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"audio"
        Maybe PageBlockCaption
caption_ <- Object
o Object -> Key -> Parser (Maybe PageBlockCaption)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"caption"
        PageBlock -> Parser PageBlock
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PageBlock -> Parser PageBlock) -> PageBlock -> Parser PageBlock
forall a b. (a -> b) -> a -> b
$ PageBlockAudio
          { audio :: Maybe Audio
audio   = Maybe Audio
audio_
          , caption :: Maybe PageBlockCaption
caption = Maybe PageBlockCaption
caption_
          }
      parsePageBlockPhoto :: A.Value -> AT.Parser PageBlock
      parsePageBlockPhoto :: Value -> Parser PageBlock
parsePageBlockPhoto = String -> (Object -> Parser PageBlock) -> Value -> Parser PageBlock
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"PageBlockPhoto" ((Object -> Parser PageBlock) -> Value -> Parser PageBlock)
-> (Object -> Parser PageBlock) -> Value -> Parser PageBlock
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Photo
photo_       <- Object
o Object -> Key -> Parser (Maybe Photo)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"photo"
        Maybe PageBlockCaption
caption_     <- Object
o Object -> Key -> Parser (Maybe PageBlockCaption)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"caption"
        Maybe Text
url_         <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"url"
        Maybe Bool
has_spoiler_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"has_spoiler"
        PageBlock -> Parser PageBlock
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PageBlock -> Parser PageBlock) -> PageBlock -> Parser PageBlock
forall a b. (a -> b) -> a -> b
$ PageBlockPhoto
          { photo :: Maybe Photo
photo       = Maybe Photo
photo_
          , caption :: Maybe PageBlockCaption
caption     = Maybe PageBlockCaption
caption_
          , url :: Maybe Text
url         = Maybe Text
url_
          , has_spoiler :: Maybe Bool
has_spoiler = Maybe Bool
has_spoiler_
          }
      parsePageBlockVideo :: A.Value -> AT.Parser PageBlock
      parsePageBlockVideo :: Value -> Parser PageBlock
parsePageBlockVideo = String -> (Object -> Parser PageBlock) -> Value -> Parser PageBlock
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"PageBlockVideo" ((Object -> Parser PageBlock) -> Value -> Parser PageBlock)
-> (Object -> Parser PageBlock) -> Value -> Parser PageBlock
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Video
video_         <- Object
o Object -> Key -> Parser (Maybe Video)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"video"
        Maybe PageBlockCaption
caption_       <- Object
o Object -> Key -> Parser (Maybe PageBlockCaption)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"caption"
        Maybe Bool
need_autoplay_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"need_autoplay"
        Maybe Bool
is_looped_     <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"is_looped"
        Maybe Bool
has_spoiler_   <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"has_spoiler"
        PageBlock -> Parser PageBlock
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PageBlock -> Parser PageBlock) -> PageBlock -> Parser PageBlock
forall a b. (a -> b) -> a -> b
$ PageBlockVideo
          { video :: Maybe Video
video         = Maybe Video
video_
          , caption :: Maybe PageBlockCaption
caption       = Maybe PageBlockCaption
caption_
          , need_autoplay :: Maybe Bool
need_autoplay = Maybe Bool
need_autoplay_
          , is_looped :: Maybe Bool
is_looped     = Maybe Bool
is_looped_
          , has_spoiler :: Maybe Bool
has_spoiler   = Maybe Bool
has_spoiler_
          }
      parsePageBlockVoiceNote :: A.Value -> AT.Parser PageBlock
      parsePageBlockVoiceNote :: Value -> Parser PageBlock
parsePageBlockVoiceNote = String -> (Object -> Parser PageBlock) -> Value -> Parser PageBlock
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"PageBlockVoiceNote" ((Object -> Parser PageBlock) -> Value -> Parser PageBlock)
-> (Object -> Parser PageBlock) -> Value -> Parser PageBlock
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe VoiceNote
voice_note_ <- Object
o Object -> Key -> Parser (Maybe VoiceNote)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"voice_note"
        Maybe PageBlockCaption
caption_    <- Object
o Object -> Key -> Parser (Maybe PageBlockCaption)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"caption"
        PageBlock -> Parser PageBlock
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PageBlock -> Parser PageBlock) -> PageBlock -> Parser PageBlock
forall a b. (a -> b) -> a -> b
$ PageBlockVoiceNote
          { voice_note :: Maybe VoiceNote
voice_note = Maybe VoiceNote
voice_note_
          , caption :: Maybe PageBlockCaption
caption    = Maybe PageBlockCaption
caption_
          }
      parsePageBlockCover :: A.Value -> AT.Parser PageBlock
      parsePageBlockCover :: Value -> Parser PageBlock
parsePageBlockCover = String -> (Object -> Parser PageBlock) -> Value -> Parser PageBlock
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"PageBlockCover" ((Object -> Parser PageBlock) -> Value -> Parser PageBlock)
-> (Object -> Parser PageBlock) -> Value -> Parser PageBlock
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe PageBlock
cover_ <- Object
o Object -> Key -> Parser (Maybe PageBlock)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"cover"
        PageBlock -> Parser PageBlock
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PageBlock -> Parser PageBlock) -> PageBlock -> Parser PageBlock
forall a b. (a -> b) -> a -> b
$ PageBlockCover
          { cover :: Maybe PageBlock
cover = Maybe PageBlock
cover_
          }
      parsePageBlockEmbedded :: A.Value -> AT.Parser PageBlock
      parsePageBlockEmbedded :: Value -> Parser PageBlock
parsePageBlockEmbedded = String -> (Object -> Parser PageBlock) -> Value -> Parser PageBlock
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"PageBlockEmbedded" ((Object -> Parser PageBlock) -> Value -> Parser PageBlock)
-> (Object -> Parser PageBlock) -> Value -> Parser PageBlock
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Text
url_             <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"url"
        Maybe Text
html_            <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"html"
        Maybe Photo
poster_photo_    <- Object
o Object -> Key -> Parser (Maybe Photo)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"poster_photo"
        Maybe Int
width_           <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"width"
        Maybe Int
height_          <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"height"
        Maybe PageBlockCaption
caption_         <- Object
o Object -> Key -> Parser (Maybe PageBlockCaption)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"caption"
        Maybe Bool
is_full_width_   <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"is_full_width"
        Maybe Bool
allow_scrolling_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"allow_scrolling"
        PageBlock -> Parser PageBlock
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PageBlock -> Parser PageBlock) -> PageBlock -> Parser PageBlock
forall a b. (a -> b) -> a -> b
$ PageBlockEmbedded
          { url :: Maybe Text
url             = Maybe Text
url_
          , html :: Maybe Text
html            = Maybe Text
html_
          , poster_photo :: Maybe Photo
poster_photo    = Maybe Photo
poster_photo_
          , width :: Maybe Int
width           = Maybe Int
width_
          , height :: Maybe Int
height          = Maybe Int
height_
          , caption :: Maybe PageBlockCaption
caption         = Maybe PageBlockCaption
caption_
          , is_full_width :: Maybe Bool
is_full_width   = Maybe Bool
is_full_width_
          , allow_scrolling :: Maybe Bool
allow_scrolling = Maybe Bool
allow_scrolling_
          }
      parsePageBlockEmbeddedPost :: A.Value -> AT.Parser PageBlock
      parsePageBlockEmbeddedPost :: Value -> Parser PageBlock
parsePageBlockEmbeddedPost = String -> (Object -> Parser PageBlock) -> Value -> Parser PageBlock
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"PageBlockEmbeddedPost" ((Object -> Parser PageBlock) -> Value -> Parser PageBlock)
-> (Object -> Parser PageBlock) -> Value -> Parser PageBlock
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Text
url_          <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"url"
        Maybe Text
_author_      <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"author"
        Maybe Photo
author_photo_ <- Object
o Object -> Key -> Parser (Maybe Photo)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"author_photo"
        Maybe Int
date_         <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"date"
        Maybe [PageBlock]
blocks_       <- Object
o Object -> Key -> Parser (Maybe [PageBlock])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"blocks"
        Maybe PageBlockCaption
caption_      <- Object
o Object -> Key -> Parser (Maybe PageBlockCaption)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"caption"
        PageBlock -> Parser PageBlock
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PageBlock -> Parser PageBlock) -> PageBlock -> Parser PageBlock
forall a b. (a -> b) -> a -> b
$ PageBlockEmbeddedPost
          { url :: Maybe Text
url          = Maybe Text
url_
          , _author :: Maybe Text
_author      = Maybe Text
_author_
          , author_photo :: Maybe Photo
author_photo = Maybe Photo
author_photo_
          , date :: Maybe Int
date         = Maybe Int
date_
          , blocks :: Maybe [PageBlock]
blocks       = Maybe [PageBlock]
blocks_
          , caption :: Maybe PageBlockCaption
caption      = Maybe PageBlockCaption
caption_
          }
      parsePageBlockCollage :: A.Value -> AT.Parser PageBlock
      parsePageBlockCollage :: Value -> Parser PageBlock
parsePageBlockCollage = String -> (Object -> Parser PageBlock) -> Value -> Parser PageBlock
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"PageBlockCollage" ((Object -> Parser PageBlock) -> Value -> Parser PageBlock)
-> (Object -> Parser PageBlock) -> Value -> Parser PageBlock
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe [PageBlock]
blocks_  <- Object
o Object -> Key -> Parser (Maybe [PageBlock])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"blocks"
        Maybe PageBlockCaption
caption_ <- Object
o Object -> Key -> Parser (Maybe PageBlockCaption)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"caption"
        PageBlock -> Parser PageBlock
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PageBlock -> Parser PageBlock) -> PageBlock -> Parser PageBlock
forall a b. (a -> b) -> a -> b
$ PageBlockCollage
          { blocks :: Maybe [PageBlock]
blocks  = Maybe [PageBlock]
blocks_
          , caption :: Maybe PageBlockCaption
caption = Maybe PageBlockCaption
caption_
          }
      parsePageBlockSlideshow :: A.Value -> AT.Parser PageBlock
      parsePageBlockSlideshow :: Value -> Parser PageBlock
parsePageBlockSlideshow = String -> (Object -> Parser PageBlock) -> Value -> Parser PageBlock
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"PageBlockSlideshow" ((Object -> Parser PageBlock) -> Value -> Parser PageBlock)
-> (Object -> Parser PageBlock) -> Value -> Parser PageBlock
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe [PageBlock]
blocks_  <- Object
o Object -> Key -> Parser (Maybe [PageBlock])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"blocks"
        Maybe PageBlockCaption
caption_ <- Object
o Object -> Key -> Parser (Maybe PageBlockCaption)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"caption"
        PageBlock -> Parser PageBlock
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PageBlock -> Parser PageBlock) -> PageBlock -> Parser PageBlock
forall a b. (a -> b) -> a -> b
$ PageBlockSlideshow
          { blocks :: Maybe [PageBlock]
blocks  = Maybe [PageBlock]
blocks_
          , caption :: Maybe PageBlockCaption
caption = Maybe PageBlockCaption
caption_
          }
      parsePageBlockChatLink :: A.Value -> AT.Parser PageBlock
      parsePageBlockChatLink :: Value -> Parser PageBlock
parsePageBlockChatLink = String -> (Object -> Parser PageBlock) -> Value -> Parser PageBlock
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"PageBlockChatLink" ((Object -> Parser PageBlock) -> Value -> Parser PageBlock)
-> (Object -> Parser PageBlock) -> Value -> Parser PageBlock
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Text
_title_          <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"title"
        Maybe ChatPhotoInfo
_photo_          <- Object
o Object -> Key -> Parser (Maybe ChatPhotoInfo)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"photo"
        Maybe Int
accent_color_id_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"accent_color_id"
        Maybe Text
username_        <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"username"
        PageBlock -> Parser PageBlock
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PageBlock -> Parser PageBlock) -> PageBlock -> Parser PageBlock
forall a b. (a -> b) -> a -> b
$ PageBlockChatLink
          { _title :: Maybe Text
_title          = Maybe Text
_title_
          , _photo :: Maybe ChatPhotoInfo
_photo          = Maybe ChatPhotoInfo
_photo_
          , accent_color_id :: Maybe Int
accent_color_id = Maybe Int
accent_color_id_
          , username :: Maybe Text
username        = Maybe Text
username_
          }
      parsePageBlockTable :: A.Value -> AT.Parser PageBlock
      parsePageBlockTable :: Value -> Parser PageBlock
parsePageBlockTable = String -> (Object -> Parser PageBlock) -> Value -> Parser PageBlock
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"PageBlockTable" ((Object -> Parser PageBlock) -> Value -> Parser PageBlock)
-> (Object -> Parser PageBlock) -> Value -> Parser PageBlock
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe RichText
_caption_    <- Object
o Object -> Key -> Parser (Maybe RichText)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"caption"
        Maybe [[PageBlockTableCell]]
cells_       <- Object
o Object -> Key -> Parser (Maybe [[PageBlockTableCell]])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"cells"
        Maybe Bool
is_bordered_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"is_bordered"
        Maybe Bool
is_striped_  <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"is_striped"
        PageBlock -> Parser PageBlock
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PageBlock -> Parser PageBlock) -> PageBlock -> Parser PageBlock
forall a b. (a -> b) -> a -> b
$ PageBlockTable
          { _caption :: Maybe RichText
_caption    = Maybe RichText
_caption_
          , cells :: Maybe [[PageBlockTableCell]]
cells       = Maybe [[PageBlockTableCell]]
cells_
          , is_bordered :: Maybe Bool
is_bordered = Maybe Bool
is_bordered_
          , is_striped :: Maybe Bool
is_striped  = Maybe Bool
is_striped_
          }
      parsePageBlockDetails :: A.Value -> AT.Parser PageBlock
      parsePageBlockDetails :: Value -> Parser PageBlock
parsePageBlockDetails = String -> (Object -> Parser PageBlock) -> Value -> Parser PageBlock
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"PageBlockDetails" ((Object -> Parser PageBlock) -> Value -> Parser PageBlock)
-> (Object -> Parser PageBlock) -> Value -> Parser PageBlock
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe RichText
header_  <- Object
o Object -> Key -> Parser (Maybe RichText)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"header"
        Maybe [PageBlock]
blocks_  <- Object
o Object -> Key -> Parser (Maybe [PageBlock])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"blocks"
        Maybe Bool
is_open_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"is_open"
        PageBlock -> Parser PageBlock
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PageBlock -> Parser PageBlock) -> PageBlock -> Parser PageBlock
forall a b. (a -> b) -> a -> b
$ PageBlockDetails
          { header :: Maybe RichText
header  = Maybe RichText
header_
          , blocks :: Maybe [PageBlock]
blocks  = Maybe [PageBlock]
blocks_
          , is_open :: Maybe Bool
is_open = Maybe Bool
is_open_
          }
      parsePageBlockRelatedArticles :: A.Value -> AT.Parser PageBlock
      parsePageBlockRelatedArticles :: Value -> Parser PageBlock
parsePageBlockRelatedArticles = String -> (Object -> Parser PageBlock) -> Value -> Parser PageBlock
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"PageBlockRelatedArticles" ((Object -> Parser PageBlock) -> Value -> Parser PageBlock)
-> (Object -> Parser PageBlock) -> Value -> Parser PageBlock
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe RichText
header_   <- Object
o Object -> Key -> Parser (Maybe RichText)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"header"
        Maybe [PageBlockRelatedArticle]
articles_ <- Object
o Object -> Key -> Parser (Maybe [PageBlockRelatedArticle])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"articles"
        PageBlock -> Parser PageBlock
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PageBlock -> Parser PageBlock) -> PageBlock -> Parser PageBlock
forall a b. (a -> b) -> a -> b
$ PageBlockRelatedArticles
          { header :: Maybe RichText
header   = Maybe RichText
header_
          , articles :: Maybe [PageBlockRelatedArticle]
articles = Maybe [PageBlockRelatedArticle]
articles_
          }
      parsePageBlockMap :: A.Value -> AT.Parser PageBlock
      parsePageBlockMap :: Value -> Parser PageBlock
parsePageBlockMap = String -> (Object -> Parser PageBlock) -> Value -> Parser PageBlock
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"PageBlockMap" ((Object -> Parser PageBlock) -> Value -> Parser PageBlock)
-> (Object -> Parser PageBlock) -> Value -> Parser PageBlock
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Location
location_ <- Object
o Object -> Key -> Parser (Maybe Location)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"location"
        Maybe Int
zoom_     <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"zoom"
        Maybe Int
width_    <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"width"
        Maybe Int
height_   <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"height"
        Maybe PageBlockCaption
caption_  <- Object
o Object -> Key -> Parser (Maybe PageBlockCaption)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"caption"
        PageBlock -> Parser PageBlock
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PageBlock -> Parser PageBlock) -> PageBlock -> Parser PageBlock
forall a b. (a -> b) -> a -> b
$ PageBlockMap
          { location :: Maybe Location
location = Maybe Location
location_
          , zoom :: Maybe Int
zoom     = Maybe Int
zoom_
          , width :: Maybe Int
width    = Maybe Int
width_
          , height :: Maybe Int
height   = Maybe Int
height_
          , caption :: Maybe PageBlockCaption
caption  = Maybe PageBlockCaption
caption_
          }
  parseJSON Value
_ = Parser PageBlock
forall a. Monoid a => a
mempty

instance AT.ToJSON PageBlock where
  toJSON :: PageBlock -> Value
toJSON PageBlockTitle
    { title :: PageBlock -> Maybe RichText
title = Maybe RichText
title_
    }
      = [Pair] -> Value
A.object
        [ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"pageBlockTitle"
        , Key
"title" Key -> Maybe RichText -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe RichText
title_
        ]
  toJSON PageBlockSubtitle
    { subtitle :: PageBlock -> Maybe RichText
subtitle = Maybe RichText
subtitle_
    }
      = [Pair] -> Value
A.object
        [ Key
"@type"    Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"pageBlockSubtitle"
        , Key
"subtitle" Key -> Maybe RichText -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe RichText
subtitle_
        ]
  toJSON PageBlockAuthorDate
    { author :: PageBlock -> Maybe RichText
author       = Maybe RichText
author_
    , publish_date :: PageBlock -> Maybe Int
publish_date = Maybe Int
publish_date_
    }
      = [Pair] -> Value
A.object
        [ Key
"@type"        Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"pageBlockAuthorDate"
        , Key
"author"       Key -> Maybe RichText -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe RichText
author_
        , Key
"publish_date" Key -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Int
publish_date_
        ]
  toJSON PageBlockHeader
    { header :: PageBlock -> Maybe RichText
header = Maybe RichText
header_
    }
      = [Pair] -> Value
A.object
        [ Key
"@type"  Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"pageBlockHeader"
        , Key
"header" Key -> Maybe RichText -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe RichText
header_
        ]
  toJSON PageBlockSubheader
    { subheader :: PageBlock -> Maybe RichText
subheader = Maybe RichText
subheader_
    }
      = [Pair] -> Value
A.object
        [ Key
"@type"     Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"pageBlockSubheader"
        , Key
"subheader" Key -> Maybe RichText -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe RichText
subheader_
        ]
  toJSON PageBlockSectionHeading
    { text :: PageBlock -> Maybe RichText
text = Maybe RichText
text_
    , size :: PageBlock -> Maybe Int
size = Maybe Int
size_
    }
      = [Pair] -> Value
A.object
        [ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"pageBlockSectionHeading"
        , Key
"text"  Key -> Maybe RichText -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe RichText
text_
        , Key
"size"  Key -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Int
size_
        ]
  toJSON PageBlockKicker
    { kicker :: PageBlock -> Maybe RichText
kicker = Maybe RichText
kicker_
    }
      = [Pair] -> Value
A.object
        [ Key
"@type"  Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"pageBlockKicker"
        , Key
"kicker" Key -> Maybe RichText -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe RichText
kicker_
        ]
  toJSON PageBlockParagraph
    { text :: PageBlock -> Maybe RichText
text = Maybe RichText
text_
    }
      = [Pair] -> Value
A.object
        [ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"pageBlockParagraph"
        , Key
"text"  Key -> Maybe RichText -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe RichText
text_
        ]
  toJSON PageBlockPreformatted
    { text :: PageBlock -> Maybe RichText
text     = Maybe RichText
text_
    , language :: PageBlock -> Maybe Text
language = Maybe Text
language_
    }
      = [Pair] -> Value
A.object
        [ Key
"@type"    Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"pageBlockPreformatted"
        , Key
"text"     Key -> Maybe RichText -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe RichText
text_
        , Key
"language" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
language_
        ]
  toJSON PageBlockFooter
    { footer :: PageBlock -> Maybe RichText
footer = Maybe RichText
footer_
    }
      = [Pair] -> Value
A.object
        [ Key
"@type"  Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"pageBlockFooter"
        , Key
"footer" Key -> Maybe RichText -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe RichText
footer_
        ]
  toJSON PageBlockThinking
    { text :: PageBlock -> Maybe RichText
text = Maybe RichText
text_
    }
      = [Pair] -> Value
A.object
        [ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"pageBlockThinking"
        , Key
"text"  Key -> Maybe RichText -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe RichText
text_
        ]
  toJSON PageBlock
PageBlockDivider
      = [Pair] -> Value
A.object
        [ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"pageBlockDivider"
        ]
  toJSON PageBlockMathematicalExpression
    { expression :: PageBlock -> Maybe Text
expression = Maybe Text
expression_
    }
      = [Pair] -> Value
A.object
        [ Key
"@type"      Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"pageBlockMathematicalExpression"
        , Key
"expression" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
expression_
        ]
  toJSON PageBlockAnchor
    { name :: PageBlock -> Maybe Text
name = Maybe Text
name_
    }
      = [Pair] -> Value
A.object
        [ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"pageBlockAnchor"
        , Key
"name"  Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
name_
        ]
  toJSON PageBlockList
    { items :: PageBlock -> Maybe [PageBlockListItem]
items = Maybe [PageBlockListItem]
items_
    }
      = [Pair] -> Value
A.object
        [ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"pageBlockList"
        , Key
"items" Key -> Maybe [PageBlockListItem] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe [PageBlockListItem]
items_
        ]
  toJSON PageBlockBlockQuote
    { blocks :: PageBlock -> Maybe [PageBlock]
blocks = Maybe [PageBlock]
blocks_
    , credit :: PageBlock -> Maybe RichText
credit = Maybe RichText
credit_
    }
      = [Pair] -> Value
A.object
        [ Key
"@type"  Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"pageBlockBlockQuote"
        , Key
"blocks" Key -> Maybe [PageBlock] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe [PageBlock]
blocks_
        , Key
"credit" Key -> Maybe RichText -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe RichText
credit_
        ]
  toJSON PageBlockPullQuote
    { text :: PageBlock -> Maybe RichText
text   = Maybe RichText
text_
    , credit :: PageBlock -> Maybe RichText
credit = Maybe RichText
credit_
    }
      = [Pair] -> Value
A.object
        [ Key
"@type"  Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"pageBlockPullQuote"
        , Key
"text"   Key -> Maybe RichText -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe RichText
text_
        , Key
"credit" Key -> Maybe RichText -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe RichText
credit_
        ]
  toJSON PageBlockAnimation
    { animation :: PageBlock -> Maybe Animation
animation     = Maybe Animation
animation_
    , caption :: PageBlock -> Maybe PageBlockCaption
caption       = Maybe PageBlockCaption
caption_
    , need_autoplay :: PageBlock -> Maybe Bool
need_autoplay = Maybe Bool
need_autoplay_
    , has_spoiler :: PageBlock -> Maybe Bool
has_spoiler   = Maybe Bool
has_spoiler_
    }
      = [Pair] -> Value
A.object
        [ Key
"@type"         Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"pageBlockAnimation"
        , Key
"animation"     Key -> Maybe Animation -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Animation
animation_
        , Key
"caption"       Key -> Maybe PageBlockCaption -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe PageBlockCaption
caption_
        , Key
"need_autoplay" Key -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Bool
need_autoplay_
        , Key
"has_spoiler"   Key -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Bool
has_spoiler_
        ]
  toJSON PageBlockAudio
    { audio :: PageBlock -> Maybe Audio
audio   = Maybe Audio
audio_
    , caption :: PageBlock -> Maybe PageBlockCaption
caption = Maybe PageBlockCaption
caption_
    }
      = [Pair] -> Value
A.object
        [ Key
"@type"   Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"pageBlockAudio"
        , Key
"audio"   Key -> Maybe Audio -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Audio
audio_
        , Key
"caption" Key -> Maybe PageBlockCaption -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe PageBlockCaption
caption_
        ]
  toJSON PageBlockPhoto
    { photo :: PageBlock -> Maybe Photo
photo       = Maybe Photo
photo_
    , caption :: PageBlock -> Maybe PageBlockCaption
caption     = Maybe PageBlockCaption
caption_
    , url :: PageBlock -> Maybe Text
url         = Maybe Text
url_
    , has_spoiler :: PageBlock -> Maybe Bool
has_spoiler = Maybe Bool
has_spoiler_
    }
      = [Pair] -> Value
A.object
        [ Key
"@type"       Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"pageBlockPhoto"
        , Key
"photo"       Key -> Maybe Photo -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Photo
photo_
        , Key
"caption"     Key -> Maybe PageBlockCaption -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe PageBlockCaption
caption_
        , Key
"url"         Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
url_
        , Key
"has_spoiler" Key -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Bool
has_spoiler_
        ]
  toJSON PageBlockVideo
    { video :: PageBlock -> Maybe Video
video         = Maybe Video
video_
    , caption :: PageBlock -> Maybe PageBlockCaption
caption       = Maybe PageBlockCaption
caption_
    , need_autoplay :: PageBlock -> Maybe Bool
need_autoplay = Maybe Bool
need_autoplay_
    , is_looped :: PageBlock -> Maybe Bool
is_looped     = Maybe Bool
is_looped_
    , has_spoiler :: PageBlock -> Maybe Bool
has_spoiler   = Maybe Bool
has_spoiler_
    }
      = [Pair] -> Value
A.object
        [ Key
"@type"         Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"pageBlockVideo"
        , Key
"video"         Key -> Maybe Video -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Video
video_
        , Key
"caption"       Key -> Maybe PageBlockCaption -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe PageBlockCaption
caption_
        , Key
"need_autoplay" Key -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Bool
need_autoplay_
        , Key
"is_looped"     Key -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Bool
is_looped_
        , Key
"has_spoiler"   Key -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Bool
has_spoiler_
        ]
  toJSON PageBlockVoiceNote
    { voice_note :: PageBlock -> Maybe VoiceNote
voice_note = Maybe VoiceNote
voice_note_
    , caption :: PageBlock -> Maybe PageBlockCaption
caption    = Maybe PageBlockCaption
caption_
    }
      = [Pair] -> Value
A.object
        [ Key
"@type"      Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"pageBlockVoiceNote"
        , Key
"voice_note" Key -> Maybe VoiceNote -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe VoiceNote
voice_note_
        , Key
"caption"    Key -> Maybe PageBlockCaption -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe PageBlockCaption
caption_
        ]
  toJSON PageBlockCover
    { cover :: PageBlock -> Maybe PageBlock
cover = Maybe PageBlock
cover_
    }
      = [Pair] -> Value
A.object
        [ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"pageBlockCover"
        , Key
"cover" Key -> Maybe PageBlock -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe PageBlock
cover_
        ]
  toJSON PageBlockEmbedded
    { url :: PageBlock -> Maybe Text
url             = Maybe Text
url_
    , html :: PageBlock -> Maybe Text
html            = Maybe Text
html_
    , poster_photo :: PageBlock -> Maybe Photo
poster_photo    = Maybe Photo
poster_photo_
    , width :: PageBlock -> Maybe Int
width           = Maybe Int
width_
    , height :: PageBlock -> Maybe Int
height          = Maybe Int
height_
    , caption :: PageBlock -> Maybe PageBlockCaption
caption         = Maybe PageBlockCaption
caption_
    , is_full_width :: PageBlock -> Maybe Bool
is_full_width   = Maybe Bool
is_full_width_
    , allow_scrolling :: PageBlock -> Maybe Bool
allow_scrolling = Maybe Bool
allow_scrolling_
    }
      = [Pair] -> Value
A.object
        [ Key
"@type"           Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"pageBlockEmbedded"
        , Key
"url"             Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
url_
        , Key
"html"            Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
html_
        , Key
"poster_photo"    Key -> Maybe Photo -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Photo
poster_photo_
        , Key
"width"           Key -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Int
width_
        , Key
"height"          Key -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Int
height_
        , Key
"caption"         Key -> Maybe PageBlockCaption -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe PageBlockCaption
caption_
        , Key
"is_full_width"   Key -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Bool
is_full_width_
        , Key
"allow_scrolling" Key -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Bool
allow_scrolling_
        ]
  toJSON PageBlockEmbeddedPost
    { url :: PageBlock -> Maybe Text
url          = Maybe Text
url_
    , _author :: PageBlock -> Maybe Text
_author      = Maybe Text
_author_
    , author_photo :: PageBlock -> Maybe Photo
author_photo = Maybe Photo
author_photo_
    , date :: PageBlock -> Maybe Int
date         = Maybe Int
date_
    , blocks :: PageBlock -> Maybe [PageBlock]
blocks       = Maybe [PageBlock]
blocks_
    , caption :: PageBlock -> Maybe PageBlockCaption
caption      = Maybe PageBlockCaption
caption_
    }
      = [Pair] -> Value
A.object
        [ Key
"@type"        Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"pageBlockEmbeddedPost"
        , Key
"url"          Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
url_
        , Key
"author"       Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
_author_
        , Key
"author_photo" Key -> Maybe Photo -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Photo
author_photo_
        , Key
"date"         Key -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Int
date_
        , Key
"blocks"       Key -> Maybe [PageBlock] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe [PageBlock]
blocks_
        , Key
"caption"      Key -> Maybe PageBlockCaption -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe PageBlockCaption
caption_
        ]
  toJSON PageBlockCollage
    { blocks :: PageBlock -> Maybe [PageBlock]
blocks  = Maybe [PageBlock]
blocks_
    , caption :: PageBlock -> Maybe PageBlockCaption
caption = Maybe PageBlockCaption
caption_
    }
      = [Pair] -> Value
A.object
        [ Key
"@type"   Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"pageBlockCollage"
        , Key
"blocks"  Key -> Maybe [PageBlock] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe [PageBlock]
blocks_
        , Key
"caption" Key -> Maybe PageBlockCaption -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe PageBlockCaption
caption_
        ]
  toJSON PageBlockSlideshow
    { blocks :: PageBlock -> Maybe [PageBlock]
blocks  = Maybe [PageBlock]
blocks_
    , caption :: PageBlock -> Maybe PageBlockCaption
caption = Maybe PageBlockCaption
caption_
    }
      = [Pair] -> Value
A.object
        [ Key
"@type"   Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"pageBlockSlideshow"
        , Key
"blocks"  Key -> Maybe [PageBlock] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe [PageBlock]
blocks_
        , Key
"caption" Key -> Maybe PageBlockCaption -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe PageBlockCaption
caption_
        ]
  toJSON PageBlockChatLink
    { _title :: PageBlock -> Maybe Text
_title          = Maybe Text
_title_
    , _photo :: PageBlock -> Maybe ChatPhotoInfo
_photo          = Maybe ChatPhotoInfo
_photo_
    , accent_color_id :: PageBlock -> Maybe Int
accent_color_id = Maybe Int
accent_color_id_
    , username :: PageBlock -> Maybe Text
username        = Maybe Text
username_
    }
      = [Pair] -> Value
A.object
        [ Key
"@type"           Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"pageBlockChatLink"
        , Key
"title"           Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
_title_
        , Key
"photo"           Key -> Maybe ChatPhotoInfo -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe ChatPhotoInfo
_photo_
        , Key
"accent_color_id" Key -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Int
accent_color_id_
        , Key
"username"        Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
username_
        ]
  toJSON PageBlockTable
    { _caption :: PageBlock -> Maybe RichText
_caption    = Maybe RichText
_caption_
    , cells :: PageBlock -> Maybe [[PageBlockTableCell]]
cells       = Maybe [[PageBlockTableCell]]
cells_
    , is_bordered :: PageBlock -> Maybe Bool
is_bordered = Maybe Bool
is_bordered_
    , is_striped :: PageBlock -> Maybe Bool
is_striped  = Maybe Bool
is_striped_
    }
      = [Pair] -> Value
A.object
        [ Key
"@type"       Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"pageBlockTable"
        , Key
"caption"     Key -> Maybe RichText -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe RichText
_caption_
        , Key
"cells"       Key -> Maybe [[PageBlockTableCell]] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe [[PageBlockTableCell]]
cells_
        , Key
"is_bordered" Key -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Bool
is_bordered_
        , Key
"is_striped"  Key -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Bool
is_striped_
        ]
  toJSON PageBlockDetails
    { header :: PageBlock -> Maybe RichText
header  = Maybe RichText
header_
    , blocks :: PageBlock -> Maybe [PageBlock]
blocks  = Maybe [PageBlock]
blocks_
    , is_open :: PageBlock -> Maybe Bool
is_open = Maybe Bool
is_open_
    }
      = [Pair] -> Value
A.object
        [ Key
"@type"   Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"pageBlockDetails"
        , Key
"header"  Key -> Maybe RichText -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe RichText
header_
        , Key
"blocks"  Key -> Maybe [PageBlock] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe [PageBlock]
blocks_
        , Key
"is_open" Key -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Bool
is_open_
        ]
  toJSON PageBlockRelatedArticles
    { header :: PageBlock -> Maybe RichText
header   = Maybe RichText
header_
    , articles :: PageBlock -> Maybe [PageBlockRelatedArticle]
articles = Maybe [PageBlockRelatedArticle]
articles_
    }
      = [Pair] -> Value
A.object
        [ Key
"@type"    Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"pageBlockRelatedArticles"
        , Key
"header"   Key -> Maybe RichText -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe RichText
header_
        , Key
"articles" Key -> Maybe [PageBlockRelatedArticle] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe [PageBlockRelatedArticle]
articles_
        ]
  toJSON PageBlockMap
    { location :: PageBlock -> Maybe Location
location = Maybe Location
location_
    , zoom :: PageBlock -> Maybe Int
zoom     = Maybe Int
zoom_
    , width :: PageBlock -> Maybe Int
width    = Maybe Int
width_
    , height :: PageBlock -> Maybe Int
height   = Maybe Int
height_
    , caption :: PageBlock -> Maybe PageBlockCaption
caption  = Maybe PageBlockCaption
caption_
    }
      = [Pair] -> Value
A.object
        [ Key
"@type"    Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"pageBlockMap"
        , Key
"location" Key -> Maybe Location -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Location
location_
        , Key
"zoom"     Key -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Int
zoom_
        , Key
"width"    Key -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Int
width_
        , Key
"height"   Key -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Int
height_
        , Key
"caption"  Key -> Maybe PageBlockCaption -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe PageBlockCaption
caption_
        ]