module TD.Data.InputPageBlock
  (InputPageBlock(..)) 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.InputPageBlockListItem as InputPageBlockListItem
import qualified TD.Data.InputAnimation as InputAnimation
import qualified TD.Data.PageBlockCaption as PageBlockCaption
import qualified TD.Data.InputAudio as InputAudio
import qualified TD.Data.InputPhoto as InputPhoto
import qualified TD.Data.InputVideo as InputVideo
import qualified TD.Data.InputVoiceNote as InputVoiceNote
import qualified TD.Data.PageBlockTableCell as PageBlockTableCell
import qualified TD.Data.Location as Location

-- | Describes a block of a rich message to send
data InputPageBlock
  = InputPageBlockSectionHeading -- ^ A section heading
    { InputPageBlock -> Maybe RichText
text :: Maybe RichText.RichText -- ^ Text of the section heading
    , InputPageBlock -> Maybe Int
size :: Maybe Int               -- ^ Relative size of the text font; 1-6, 1 is the largest, 6 is the smallest
    }
  | InputPageBlockParagraph -- ^ A text paragraph
    { text :: Maybe RichText.RichText -- ^ Paragraph text
    }
  | InputPageBlockPreformatted -- ^ A preformatted text paragraph
    { text     :: Maybe RichText.RichText -- ^ Paragraph text
    , InputPageBlock -> Maybe Text
language :: Maybe T.Text            -- ^ Programming language for which the text needs to be formatted
    }
  | InputPageBlockFooter -- ^ The footer of the page
    { InputPageBlock -> Maybe RichText
footer :: Maybe RichText.RichText -- ^ Footer
    }
  | InputPageBlockThinking -- ^ A "Thinking..." placeholder; for pending rich messages only; for bots only
    { text :: Maybe RichText.RichText -- ^ Text of the placeholder
    }
  | InputPageBlockDivider -- ^ An empty block separating the page
  | InputPageBlockMathematicalExpression -- ^ A mathematical expression
    { InputPageBlock -> Maybe Text
expression :: Maybe T.Text -- ^ The expression in LaTeX format
    }
  | InputPageBlockAnchor -- ^ An invisible anchor
    { InputPageBlock -> Maybe Text
name :: Maybe T.Text -- ^ Name of the anchor
    }
  | InputPageBlockList -- ^ A list of data blocks
    { InputPageBlock -> Maybe [InputPageBlockListItem]
items :: Maybe [InputPageBlockListItem.InputPageBlockListItem] -- ^ The items of the list
    }
  | InputPageBlockBlockQuote -- ^ A block quote
    { InputPageBlock -> Maybe [InputPageBlock]
blocks :: Maybe [InputPageBlock]  -- ^ Quote blocks
    , InputPageBlock -> Maybe RichText
credit :: Maybe RichText.RichText -- ^ Quote credit; pass null if none
    }
  | InputPageBlockPullQuote -- ^ A pull quote
    { text   :: Maybe RichText.RichText -- ^ Quote text
    , credit :: Maybe RichText.RichText -- ^ Quote credit; pass null if none
    }
  | InputPageBlockAnimation -- ^ An animation
    { InputPageBlock -> Maybe InputAnimation
animation   :: Maybe InputAnimation.InputAnimation     -- ^ The animation to be sent
    , InputPageBlock -> Maybe PageBlockCaption
caption     :: Maybe PageBlockCaption.PageBlockCaption -- ^ Animation caption; pass null if none
    , InputPageBlock -> Maybe Bool
has_spoiler :: Maybe Bool                              -- ^ True, if the animation preview must be covered by a spoiler animation
    }
  | InputPageBlockAudio -- ^ An audio file
    { InputPageBlock -> Maybe InputAudio
audio   :: Maybe InputAudio.InputAudio             -- ^ The audio to be sent
    , caption :: Maybe PageBlockCaption.PageBlockCaption -- ^ Audio file caption; pass null if none
    }
  | InputPageBlockPhoto -- ^ A photo
    { InputPageBlock -> Maybe InputPhoto
photo       :: Maybe InputPhoto.InputPhoto             -- ^ The photo to be sent
    , caption     :: Maybe PageBlockCaption.PageBlockCaption -- ^ Photo caption; pass null if none
    , has_spoiler :: Maybe Bool                              -- ^ True, if the photo preview must be covered by a spoiler animation
    }
  | InputPageBlockVideo -- ^ A video
    { InputPageBlock -> Maybe InputVideo
video       :: Maybe InputVideo.InputVideo             -- ^ The video to be sent
    , caption     :: Maybe PageBlockCaption.PageBlockCaption -- ^ Video caption; pass null if none
    , has_spoiler :: Maybe Bool                              -- ^ True, if the video preview must be covered by a spoiler animation
    }
  | InputPageBlockVoiceNote -- ^ A voice note
    { InputPageBlock -> Maybe InputVoiceNote
voice_note :: Maybe InputVoiceNote.InputVoiceNote     -- ^ The voice note to be sent
    , caption    :: Maybe PageBlockCaption.PageBlockCaption -- ^ Voice note caption; pass null if none
    }
  | InputPageBlockCollage -- ^ A collage
    { blocks  :: Maybe [InputPageBlock]                  -- ^ Collage item contents
    , caption :: Maybe PageBlockCaption.PageBlockCaption -- ^ Block caption; pass null if none
    }
  | InputPageBlockSlideshow -- ^ A slideshow
    { blocks  :: Maybe [InputPageBlock]                  -- ^ Slideshow item contents
    , caption :: Maybe PageBlockCaption.PageBlockCaption -- ^ Block caption; pass null if none
    }
  | InputPageBlockTable -- ^ A table
    { InputPageBlock -> Maybe RichText
_caption    :: Maybe RichText.RichText                         -- ^ Table caption
    , InputPageBlock -> Maybe [[PageBlockTableCell]]
cells       :: Maybe [[PageBlockTableCell.PageBlockTableCell]] -- ^ Table cells
    , InputPageBlock -> Maybe Bool
is_bordered :: Maybe Bool                                      -- ^ True, if the table is bordered
    , InputPageBlock -> Maybe Bool
is_striped  :: Maybe Bool                                      -- ^ True, if the table is striped
    }
  | InputPageBlockDetails -- ^ A collapsible block
    { InputPageBlock -> Maybe RichText
header  :: Maybe RichText.RichText -- ^ Always visible heading for the block
    , blocks  :: Maybe [InputPageBlock]  -- ^ Block contents
    , InputPageBlock -> Maybe Bool
is_open :: Maybe Bool              -- ^ True, if the block is open by default
    }
  | InputPageBlockMap -- ^ A map. The map's width and height must not exceed 10000 in total. Width and height ratio must be at most 20
    { InputPageBlock -> Maybe Location
location :: Maybe Location.Location                 -- ^ Location of the map center
    , InputPageBlock -> Maybe Int
zoom     :: Maybe Int                               -- ^ Map zoom level; 0-24
    , InputPageBlock -> Maybe Int
width    :: Maybe Int                               -- ^ Map width; 0-10000
    , InputPageBlock -> Maybe Int
height   :: Maybe Int                               -- ^ Map height; 0-10000
    , caption  :: Maybe PageBlockCaption.PageBlockCaption -- ^ Block caption; pass null if none
    }
  deriving (InputPageBlock -> InputPageBlock -> Bool
(InputPageBlock -> InputPageBlock -> Bool)
-> (InputPageBlock -> InputPageBlock -> Bool) -> Eq InputPageBlock
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: InputPageBlock -> InputPageBlock -> Bool
== :: InputPageBlock -> InputPageBlock -> Bool
$c/= :: InputPageBlock -> InputPageBlock -> Bool
/= :: InputPageBlock -> InputPageBlock -> Bool
Eq, Int -> InputPageBlock -> ShowS
[InputPageBlock] -> ShowS
InputPageBlock -> String
(Int -> InputPageBlock -> ShowS)
-> (InputPageBlock -> String)
-> ([InputPageBlock] -> ShowS)
-> Show InputPageBlock
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> InputPageBlock -> ShowS
showsPrec :: Int -> InputPageBlock -> ShowS
$cshow :: InputPageBlock -> String
show :: InputPageBlock -> String
$cshowList :: [InputPageBlock] -> ShowS
showList :: [InputPageBlock] -> ShowS
Show)

instance I.ShortShow InputPageBlock where
  shortShow :: InputPageBlock -> String
shortShow InputPageBlockSectionHeading
    { text :: InputPageBlock -> Maybe RichText
text = Maybe RichText
text_
    , size :: InputPageBlock -> Maybe Int
size = Maybe Int
size_
    }
      = String
"InputPageBlockSectionHeading"
        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 InputPageBlockParagraph
    { text :: InputPageBlock -> Maybe RichText
text = Maybe RichText
text_
    }
      = String
"InputPageBlockParagraph"
        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 InputPageBlockPreformatted
    { text :: InputPageBlock -> Maybe RichText
text     = Maybe RichText
text_
    , language :: InputPageBlock -> Maybe Text
language = Maybe Text
language_
    }
      = String
"InputPageBlockPreformatted"
        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 InputPageBlockFooter
    { footer :: InputPageBlock -> Maybe RichText
footer = Maybe RichText
footer_
    }
      = String
"InputPageBlockFooter"
        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 InputPageBlockThinking
    { text :: InputPageBlock -> Maybe RichText
text = Maybe RichText
text_
    }
      = String
"InputPageBlockThinking"
        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 InputPageBlock
InputPageBlockDivider
      = String
"InputPageBlockDivider"
  shortShow InputPageBlockMathematicalExpression
    { expression :: InputPageBlock -> Maybe Text
expression = Maybe Text
expression_
    }
      = String
"InputPageBlockMathematicalExpression"
        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 InputPageBlockAnchor
    { name :: InputPageBlock -> Maybe Text
name = Maybe Text
name_
    }
      = String
"InputPageBlockAnchor"
        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 InputPageBlockList
    { items :: InputPageBlock -> Maybe [InputPageBlockListItem]
items = Maybe [InputPageBlockListItem]
items_
    }
      = String
"InputPageBlockList"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"items" String -> Maybe [InputPageBlockListItem] -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe [InputPageBlockListItem]
items_
        ]
  shortShow InputPageBlockBlockQuote
    { blocks :: InputPageBlock -> Maybe [InputPageBlock]
blocks = Maybe [InputPageBlock]
blocks_
    , credit :: InputPageBlock -> Maybe RichText
credit = Maybe RichText
credit_
    }
      = String
"InputPageBlockBlockQuote"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"blocks" String -> Maybe [InputPageBlock] -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe [InputPageBlock]
blocks_
        , String
"credit" String -> Maybe RichText -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe RichText
credit_
        ]
  shortShow InputPageBlockPullQuote
    { text :: InputPageBlock -> Maybe RichText
text   = Maybe RichText
text_
    , credit :: InputPageBlock -> Maybe RichText
credit = Maybe RichText
credit_
    }
      = String
"InputPageBlockPullQuote"
        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 InputPageBlockAnimation
    { animation :: InputPageBlock -> Maybe InputAnimation
animation   = Maybe InputAnimation
animation_
    , caption :: InputPageBlock -> Maybe PageBlockCaption
caption     = Maybe PageBlockCaption
caption_
    , has_spoiler :: InputPageBlock -> Maybe Bool
has_spoiler = Maybe Bool
has_spoiler_
    }
      = String
"InputPageBlockAnimation"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"animation"   String -> Maybe InputAnimation -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe InputAnimation
animation_
        , String
"caption"     String -> Maybe PageBlockCaption -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe PageBlockCaption
caption_
        , String
"has_spoiler" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
has_spoiler_
        ]
  shortShow InputPageBlockAudio
    { audio :: InputPageBlock -> Maybe InputAudio
audio   = Maybe InputAudio
audio_
    , caption :: InputPageBlock -> Maybe PageBlockCaption
caption = Maybe PageBlockCaption
caption_
    }
      = String
"InputPageBlockAudio"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"audio"   String -> Maybe InputAudio -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe InputAudio
audio_
        , String
"caption" String -> Maybe PageBlockCaption -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe PageBlockCaption
caption_
        ]
  shortShow InputPageBlockPhoto
    { photo :: InputPageBlock -> Maybe InputPhoto
photo       = Maybe InputPhoto
photo_
    , caption :: InputPageBlock -> Maybe PageBlockCaption
caption     = Maybe PageBlockCaption
caption_
    , has_spoiler :: InputPageBlock -> Maybe Bool
has_spoiler = Maybe Bool
has_spoiler_
    }
      = String
"InputPageBlockPhoto"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"photo"       String -> Maybe InputPhoto -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe InputPhoto
photo_
        , String
"caption"     String -> Maybe PageBlockCaption -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe PageBlockCaption
caption_
        , String
"has_spoiler" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
has_spoiler_
        ]
  shortShow InputPageBlockVideo
    { video :: InputPageBlock -> Maybe InputVideo
video       = Maybe InputVideo
video_
    , caption :: InputPageBlock -> Maybe PageBlockCaption
caption     = Maybe PageBlockCaption
caption_
    , has_spoiler :: InputPageBlock -> Maybe Bool
has_spoiler = Maybe Bool
has_spoiler_
    }
      = String
"InputPageBlockVideo"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"video"       String -> Maybe InputVideo -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe InputVideo
video_
        , String
"caption"     String -> Maybe PageBlockCaption -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe PageBlockCaption
caption_
        , String
"has_spoiler" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
has_spoiler_
        ]
  shortShow InputPageBlockVoiceNote
    { voice_note :: InputPageBlock -> Maybe InputVoiceNote
voice_note = Maybe InputVoiceNote
voice_note_
    , caption :: InputPageBlock -> Maybe PageBlockCaption
caption    = Maybe PageBlockCaption
caption_
    }
      = String
"InputPageBlockVoiceNote"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"voice_note" String -> Maybe InputVoiceNote -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe InputVoiceNote
voice_note_
        , String
"caption"    String -> Maybe PageBlockCaption -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe PageBlockCaption
caption_
        ]
  shortShow InputPageBlockCollage
    { blocks :: InputPageBlock -> Maybe [InputPageBlock]
blocks  = Maybe [InputPageBlock]
blocks_
    , caption :: InputPageBlock -> Maybe PageBlockCaption
caption = Maybe PageBlockCaption
caption_
    }
      = String
"InputPageBlockCollage"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"blocks"  String -> Maybe [InputPageBlock] -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe [InputPageBlock]
blocks_
        , String
"caption" String -> Maybe PageBlockCaption -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe PageBlockCaption
caption_
        ]
  shortShow InputPageBlockSlideshow
    { blocks :: InputPageBlock -> Maybe [InputPageBlock]
blocks  = Maybe [InputPageBlock]
blocks_
    , caption :: InputPageBlock -> Maybe PageBlockCaption
caption = Maybe PageBlockCaption
caption_
    }
      = String
"InputPageBlockSlideshow"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"blocks"  String -> Maybe [InputPageBlock] -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe [InputPageBlock]
blocks_
        , String
"caption" String -> Maybe PageBlockCaption -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe PageBlockCaption
caption_
        ]
  shortShow InputPageBlockTable
    { _caption :: InputPageBlock -> Maybe RichText
_caption    = Maybe RichText
_caption_
    , cells :: InputPageBlock -> Maybe [[PageBlockTableCell]]
cells       = Maybe [[PageBlockTableCell]]
cells_
    , is_bordered :: InputPageBlock -> Maybe Bool
is_bordered = Maybe Bool
is_bordered_
    , is_striped :: InputPageBlock -> Maybe Bool
is_striped  = Maybe Bool
is_striped_
    }
      = String
"InputPageBlockTable"
        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 InputPageBlockDetails
    { header :: InputPageBlock -> Maybe RichText
header  = Maybe RichText
header_
    , blocks :: InputPageBlock -> Maybe [InputPageBlock]
blocks  = Maybe [InputPageBlock]
blocks_
    , is_open :: InputPageBlock -> Maybe Bool
is_open = Maybe Bool
is_open_
    }
      = String
"InputPageBlockDetails"
        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 [InputPageBlock] -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe [InputPageBlock]
blocks_
        , String
"is_open" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
is_open_
        ]
  shortShow InputPageBlockMap
    { location :: InputPageBlock -> Maybe Location
location = Maybe Location
location_
    , zoom :: InputPageBlock -> Maybe Int
zoom     = Maybe Int
zoom_
    , width :: InputPageBlock -> Maybe Int
width    = Maybe Int
width_
    , height :: InputPageBlock -> Maybe Int
height   = Maybe Int
height_
    , caption :: InputPageBlock -> Maybe PageBlockCaption
caption  = Maybe PageBlockCaption
caption_
    }
      = String
"InputPageBlockMap"
        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 InputPageBlock where
  parseJSON :: Value -> Parser InputPageBlock
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
"inputPageBlockSectionHeading"         -> Value -> Parser InputPageBlock
parseInputPageBlockSectionHeading Value
v
      String
"inputPageBlockParagraph"              -> Value -> Parser InputPageBlock
parseInputPageBlockParagraph Value
v
      String
"inputPageBlockPreformatted"           -> Value -> Parser InputPageBlock
parseInputPageBlockPreformatted Value
v
      String
"inputPageBlockFooter"                 -> Value -> Parser InputPageBlock
parseInputPageBlockFooter Value
v
      String
"inputPageBlockThinking"               -> Value -> Parser InputPageBlock
parseInputPageBlockThinking Value
v
      String
"inputPageBlockDivider"                -> InputPageBlock -> Parser InputPageBlock
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure InputPageBlock
InputPageBlockDivider
      String
"inputPageBlockMathematicalExpression" -> Value -> Parser InputPageBlock
parseInputPageBlockMathematicalExpression Value
v
      String
"inputPageBlockAnchor"                 -> Value -> Parser InputPageBlock
parseInputPageBlockAnchor Value
v
      String
"inputPageBlockList"                   -> Value -> Parser InputPageBlock
parseInputPageBlockList Value
v
      String
"inputPageBlockBlockQuote"             -> Value -> Parser InputPageBlock
parseInputPageBlockBlockQuote Value
v
      String
"inputPageBlockPullQuote"              -> Value -> Parser InputPageBlock
parseInputPageBlockPullQuote Value
v
      String
"inputPageBlockAnimation"              -> Value -> Parser InputPageBlock
parseInputPageBlockAnimation Value
v
      String
"inputPageBlockAudio"                  -> Value -> Parser InputPageBlock
parseInputPageBlockAudio Value
v
      String
"inputPageBlockPhoto"                  -> Value -> Parser InputPageBlock
parseInputPageBlockPhoto Value
v
      String
"inputPageBlockVideo"                  -> Value -> Parser InputPageBlock
parseInputPageBlockVideo Value
v
      String
"inputPageBlockVoiceNote"              -> Value -> Parser InputPageBlock
parseInputPageBlockVoiceNote Value
v
      String
"inputPageBlockCollage"                -> Value -> Parser InputPageBlock
parseInputPageBlockCollage Value
v
      String
"inputPageBlockSlideshow"              -> Value -> Parser InputPageBlock
parseInputPageBlockSlideshow Value
v
      String
"inputPageBlockTable"                  -> Value -> Parser InputPageBlock
parseInputPageBlockTable Value
v
      String
"inputPageBlockDetails"                -> Value -> Parser InputPageBlock
parseInputPageBlockDetails Value
v
      String
"inputPageBlockMap"                    -> Value -> Parser InputPageBlock
parseInputPageBlockMap Value
v
      String
_                                      -> Parser InputPageBlock
forall a. Monoid a => a
mempty
    
    where
      parseInputPageBlockSectionHeading :: A.Value -> AT.Parser InputPageBlock
      parseInputPageBlockSectionHeading :: Value -> Parser InputPageBlock
parseInputPageBlockSectionHeading = String
-> (Object -> Parser InputPageBlock)
-> Value
-> Parser InputPageBlock
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InputPageBlockSectionHeading" ((Object -> Parser InputPageBlock)
 -> Value -> Parser InputPageBlock)
-> (Object -> Parser InputPageBlock)
-> Value
-> Parser InputPageBlock
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"
        InputPageBlock -> Parser InputPageBlock
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InputPageBlock -> Parser InputPageBlock)
-> InputPageBlock -> Parser InputPageBlock
forall a b. (a -> b) -> a -> b
$ InputPageBlockSectionHeading
          { text :: Maybe RichText
text = Maybe RichText
text_
          , size :: Maybe Int
size = Maybe Int
size_
          }
      parseInputPageBlockParagraph :: A.Value -> AT.Parser InputPageBlock
      parseInputPageBlockParagraph :: Value -> Parser InputPageBlock
parseInputPageBlockParagraph = String
-> (Object -> Parser InputPageBlock)
-> Value
-> Parser InputPageBlock
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InputPageBlockParagraph" ((Object -> Parser InputPageBlock)
 -> Value -> Parser InputPageBlock)
-> (Object -> Parser InputPageBlock)
-> Value
-> Parser InputPageBlock
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"
        InputPageBlock -> Parser InputPageBlock
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InputPageBlock -> Parser InputPageBlock)
-> InputPageBlock -> Parser InputPageBlock
forall a b. (a -> b) -> a -> b
$ InputPageBlockParagraph
          { text :: Maybe RichText
text = Maybe RichText
text_
          }
      parseInputPageBlockPreformatted :: A.Value -> AT.Parser InputPageBlock
      parseInputPageBlockPreformatted :: Value -> Parser InputPageBlock
parseInputPageBlockPreformatted = String
-> (Object -> Parser InputPageBlock)
-> Value
-> Parser InputPageBlock
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InputPageBlockPreformatted" ((Object -> Parser InputPageBlock)
 -> Value -> Parser InputPageBlock)
-> (Object -> Parser InputPageBlock)
-> Value
-> Parser InputPageBlock
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"
        InputPageBlock -> Parser InputPageBlock
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InputPageBlock -> Parser InputPageBlock)
-> InputPageBlock -> Parser InputPageBlock
forall a b. (a -> b) -> a -> b
$ InputPageBlockPreformatted
          { text :: Maybe RichText
text     = Maybe RichText
text_
          , language :: Maybe Text
language = Maybe Text
language_
          }
      parseInputPageBlockFooter :: A.Value -> AT.Parser InputPageBlock
      parseInputPageBlockFooter :: Value -> Parser InputPageBlock
parseInputPageBlockFooter = String
-> (Object -> Parser InputPageBlock)
-> Value
-> Parser InputPageBlock
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InputPageBlockFooter" ((Object -> Parser InputPageBlock)
 -> Value -> Parser InputPageBlock)
-> (Object -> Parser InputPageBlock)
-> Value
-> Parser InputPageBlock
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"
        InputPageBlock -> Parser InputPageBlock
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InputPageBlock -> Parser InputPageBlock)
-> InputPageBlock -> Parser InputPageBlock
forall a b. (a -> b) -> a -> b
$ InputPageBlockFooter
          { footer :: Maybe RichText
footer = Maybe RichText
footer_
          }
      parseInputPageBlockThinking :: A.Value -> AT.Parser InputPageBlock
      parseInputPageBlockThinking :: Value -> Parser InputPageBlock
parseInputPageBlockThinking = String
-> (Object -> Parser InputPageBlock)
-> Value
-> Parser InputPageBlock
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InputPageBlockThinking" ((Object -> Parser InputPageBlock)
 -> Value -> Parser InputPageBlock)
-> (Object -> Parser InputPageBlock)
-> Value
-> Parser InputPageBlock
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"
        InputPageBlock -> Parser InputPageBlock
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InputPageBlock -> Parser InputPageBlock)
-> InputPageBlock -> Parser InputPageBlock
forall a b. (a -> b) -> a -> b
$ InputPageBlockThinking
          { text :: Maybe RichText
text = Maybe RichText
text_
          }
      parseInputPageBlockMathematicalExpression :: A.Value -> AT.Parser InputPageBlock
      parseInputPageBlockMathematicalExpression :: Value -> Parser InputPageBlock
parseInputPageBlockMathematicalExpression = String
-> (Object -> Parser InputPageBlock)
-> Value
-> Parser InputPageBlock
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InputPageBlockMathematicalExpression" ((Object -> Parser InputPageBlock)
 -> Value -> Parser InputPageBlock)
-> (Object -> Parser InputPageBlock)
-> Value
-> Parser InputPageBlock
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"
        InputPageBlock -> Parser InputPageBlock
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InputPageBlock -> Parser InputPageBlock)
-> InputPageBlock -> Parser InputPageBlock
forall a b. (a -> b) -> a -> b
$ InputPageBlockMathematicalExpression
          { expression :: Maybe Text
expression = Maybe Text
expression_
          }
      parseInputPageBlockAnchor :: A.Value -> AT.Parser InputPageBlock
      parseInputPageBlockAnchor :: Value -> Parser InputPageBlock
parseInputPageBlockAnchor = String
-> (Object -> Parser InputPageBlock)
-> Value
-> Parser InputPageBlock
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InputPageBlockAnchor" ((Object -> Parser InputPageBlock)
 -> Value -> Parser InputPageBlock)
-> (Object -> Parser InputPageBlock)
-> Value
-> Parser InputPageBlock
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"
        InputPageBlock -> Parser InputPageBlock
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InputPageBlock -> Parser InputPageBlock)
-> InputPageBlock -> Parser InputPageBlock
forall a b. (a -> b) -> a -> b
$ InputPageBlockAnchor
          { name :: Maybe Text
name = Maybe Text
name_
          }
      parseInputPageBlockList :: A.Value -> AT.Parser InputPageBlock
      parseInputPageBlockList :: Value -> Parser InputPageBlock
parseInputPageBlockList = String
-> (Object -> Parser InputPageBlock)
-> Value
-> Parser InputPageBlock
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InputPageBlockList" ((Object -> Parser InputPageBlock)
 -> Value -> Parser InputPageBlock)
-> (Object -> Parser InputPageBlock)
-> Value
-> Parser InputPageBlock
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe [InputPageBlockListItem]
items_ <- Object
o Object -> Key -> Parser (Maybe [InputPageBlockListItem])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"items"
        InputPageBlock -> Parser InputPageBlock
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InputPageBlock -> Parser InputPageBlock)
-> InputPageBlock -> Parser InputPageBlock
forall a b. (a -> b) -> a -> b
$ InputPageBlockList
          { items :: Maybe [InputPageBlockListItem]
items = Maybe [InputPageBlockListItem]
items_
          }
      parseInputPageBlockBlockQuote :: A.Value -> AT.Parser InputPageBlock
      parseInputPageBlockBlockQuote :: Value -> Parser InputPageBlock
parseInputPageBlockBlockQuote = String
-> (Object -> Parser InputPageBlock)
-> Value
-> Parser InputPageBlock
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InputPageBlockBlockQuote" ((Object -> Parser InputPageBlock)
 -> Value -> Parser InputPageBlock)
-> (Object -> Parser InputPageBlock)
-> Value
-> Parser InputPageBlock
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe [InputPageBlock]
blocks_ <- Object
o Object -> Key -> Parser (Maybe [InputPageBlock])
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"
        InputPageBlock -> Parser InputPageBlock
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InputPageBlock -> Parser InputPageBlock)
-> InputPageBlock -> Parser InputPageBlock
forall a b. (a -> b) -> a -> b
$ InputPageBlockBlockQuote
          { blocks :: Maybe [InputPageBlock]
blocks = Maybe [InputPageBlock]
blocks_
          , credit :: Maybe RichText
credit = Maybe RichText
credit_
          }
      parseInputPageBlockPullQuote :: A.Value -> AT.Parser InputPageBlock
      parseInputPageBlockPullQuote :: Value -> Parser InputPageBlock
parseInputPageBlockPullQuote = String
-> (Object -> Parser InputPageBlock)
-> Value
-> Parser InputPageBlock
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InputPageBlockPullQuote" ((Object -> Parser InputPageBlock)
 -> Value -> Parser InputPageBlock)
-> (Object -> Parser InputPageBlock)
-> Value
-> Parser InputPageBlock
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"
        InputPageBlock -> Parser InputPageBlock
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InputPageBlock -> Parser InputPageBlock)
-> InputPageBlock -> Parser InputPageBlock
forall a b. (a -> b) -> a -> b
$ InputPageBlockPullQuote
          { text :: Maybe RichText
text   = Maybe RichText
text_
          , credit :: Maybe RichText
credit = Maybe RichText
credit_
          }
      parseInputPageBlockAnimation :: A.Value -> AT.Parser InputPageBlock
      parseInputPageBlockAnimation :: Value -> Parser InputPageBlock
parseInputPageBlockAnimation = String
-> (Object -> Parser InputPageBlock)
-> Value
-> Parser InputPageBlock
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InputPageBlockAnimation" ((Object -> Parser InputPageBlock)
 -> Value -> Parser InputPageBlock)
-> (Object -> Parser InputPageBlock)
-> Value
-> Parser InputPageBlock
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe InputAnimation
animation_   <- Object
o Object -> Key -> Parser (Maybe InputAnimation)
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
has_spoiler_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"has_spoiler"
        InputPageBlock -> Parser InputPageBlock
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InputPageBlock -> Parser InputPageBlock)
-> InputPageBlock -> Parser InputPageBlock
forall a b. (a -> b) -> a -> b
$ InputPageBlockAnimation
          { animation :: Maybe InputAnimation
animation   = Maybe InputAnimation
animation_
          , caption :: Maybe PageBlockCaption
caption     = Maybe PageBlockCaption
caption_
          , has_spoiler :: Maybe Bool
has_spoiler = Maybe Bool
has_spoiler_
          }
      parseInputPageBlockAudio :: A.Value -> AT.Parser InputPageBlock
      parseInputPageBlockAudio :: Value -> Parser InputPageBlock
parseInputPageBlockAudio = String
-> (Object -> Parser InputPageBlock)
-> Value
-> Parser InputPageBlock
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InputPageBlockAudio" ((Object -> Parser InputPageBlock)
 -> Value -> Parser InputPageBlock)
-> (Object -> Parser InputPageBlock)
-> Value
-> Parser InputPageBlock
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe InputAudio
audio_   <- Object
o Object -> Key -> Parser (Maybe InputAudio)
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"
        InputPageBlock -> Parser InputPageBlock
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InputPageBlock -> Parser InputPageBlock)
-> InputPageBlock -> Parser InputPageBlock
forall a b. (a -> b) -> a -> b
$ InputPageBlockAudio
          { audio :: Maybe InputAudio
audio   = Maybe InputAudio
audio_
          , caption :: Maybe PageBlockCaption
caption = Maybe PageBlockCaption
caption_
          }
      parseInputPageBlockPhoto :: A.Value -> AT.Parser InputPageBlock
      parseInputPageBlockPhoto :: Value -> Parser InputPageBlock
parseInputPageBlockPhoto = String
-> (Object -> Parser InputPageBlock)
-> Value
-> Parser InputPageBlock
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InputPageBlockPhoto" ((Object -> Parser InputPageBlock)
 -> Value -> Parser InputPageBlock)
-> (Object -> Parser InputPageBlock)
-> Value
-> Parser InputPageBlock
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe InputPhoto
photo_       <- Object
o Object -> Key -> Parser (Maybe InputPhoto)
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 Bool
has_spoiler_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"has_spoiler"
        InputPageBlock -> Parser InputPageBlock
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InputPageBlock -> Parser InputPageBlock)
-> InputPageBlock -> Parser InputPageBlock
forall a b. (a -> b) -> a -> b
$ InputPageBlockPhoto
          { photo :: Maybe InputPhoto
photo       = Maybe InputPhoto
photo_
          , caption :: Maybe PageBlockCaption
caption     = Maybe PageBlockCaption
caption_
          , has_spoiler :: Maybe Bool
has_spoiler = Maybe Bool
has_spoiler_
          }
      parseInputPageBlockVideo :: A.Value -> AT.Parser InputPageBlock
      parseInputPageBlockVideo :: Value -> Parser InputPageBlock
parseInputPageBlockVideo = String
-> (Object -> Parser InputPageBlock)
-> Value
-> Parser InputPageBlock
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InputPageBlockVideo" ((Object -> Parser InputPageBlock)
 -> Value -> Parser InputPageBlock)
-> (Object -> Parser InputPageBlock)
-> Value
-> Parser InputPageBlock
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe InputVideo
video_       <- Object
o Object -> Key -> Parser (Maybe InputVideo)
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
has_spoiler_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"has_spoiler"
        InputPageBlock -> Parser InputPageBlock
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InputPageBlock -> Parser InputPageBlock)
-> InputPageBlock -> Parser InputPageBlock
forall a b. (a -> b) -> a -> b
$ InputPageBlockVideo
          { video :: Maybe InputVideo
video       = Maybe InputVideo
video_
          , caption :: Maybe PageBlockCaption
caption     = Maybe PageBlockCaption
caption_
          , has_spoiler :: Maybe Bool
has_spoiler = Maybe Bool
has_spoiler_
          }
      parseInputPageBlockVoiceNote :: A.Value -> AT.Parser InputPageBlock
      parseInputPageBlockVoiceNote :: Value -> Parser InputPageBlock
parseInputPageBlockVoiceNote = String
-> (Object -> Parser InputPageBlock)
-> Value
-> Parser InputPageBlock
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InputPageBlockVoiceNote" ((Object -> Parser InputPageBlock)
 -> Value -> Parser InputPageBlock)
-> (Object -> Parser InputPageBlock)
-> Value
-> Parser InputPageBlock
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe InputVoiceNote
voice_note_ <- Object
o Object -> Key -> Parser (Maybe InputVoiceNote)
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"
        InputPageBlock -> Parser InputPageBlock
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InputPageBlock -> Parser InputPageBlock)
-> InputPageBlock -> Parser InputPageBlock
forall a b. (a -> b) -> a -> b
$ InputPageBlockVoiceNote
          { voice_note :: Maybe InputVoiceNote
voice_note = Maybe InputVoiceNote
voice_note_
          , caption :: Maybe PageBlockCaption
caption    = Maybe PageBlockCaption
caption_
          }
      parseInputPageBlockCollage :: A.Value -> AT.Parser InputPageBlock
      parseInputPageBlockCollage :: Value -> Parser InputPageBlock
parseInputPageBlockCollage = String
-> (Object -> Parser InputPageBlock)
-> Value
-> Parser InputPageBlock
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InputPageBlockCollage" ((Object -> Parser InputPageBlock)
 -> Value -> Parser InputPageBlock)
-> (Object -> Parser InputPageBlock)
-> Value
-> Parser InputPageBlock
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe [InputPageBlock]
blocks_  <- Object
o Object -> Key -> Parser (Maybe [InputPageBlock])
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"
        InputPageBlock -> Parser InputPageBlock
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InputPageBlock -> Parser InputPageBlock)
-> InputPageBlock -> Parser InputPageBlock
forall a b. (a -> b) -> a -> b
$ InputPageBlockCollage
          { blocks :: Maybe [InputPageBlock]
blocks  = Maybe [InputPageBlock]
blocks_
          , caption :: Maybe PageBlockCaption
caption = Maybe PageBlockCaption
caption_
          }
      parseInputPageBlockSlideshow :: A.Value -> AT.Parser InputPageBlock
      parseInputPageBlockSlideshow :: Value -> Parser InputPageBlock
parseInputPageBlockSlideshow = String
-> (Object -> Parser InputPageBlock)
-> Value
-> Parser InputPageBlock
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InputPageBlockSlideshow" ((Object -> Parser InputPageBlock)
 -> Value -> Parser InputPageBlock)
-> (Object -> Parser InputPageBlock)
-> Value
-> Parser InputPageBlock
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe [InputPageBlock]
blocks_  <- Object
o Object -> Key -> Parser (Maybe [InputPageBlock])
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"
        InputPageBlock -> Parser InputPageBlock
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InputPageBlock -> Parser InputPageBlock)
-> InputPageBlock -> Parser InputPageBlock
forall a b. (a -> b) -> a -> b
$ InputPageBlockSlideshow
          { blocks :: Maybe [InputPageBlock]
blocks  = Maybe [InputPageBlock]
blocks_
          , caption :: Maybe PageBlockCaption
caption = Maybe PageBlockCaption
caption_
          }
      parseInputPageBlockTable :: A.Value -> AT.Parser InputPageBlock
      parseInputPageBlockTable :: Value -> Parser InputPageBlock
parseInputPageBlockTable = String
-> (Object -> Parser InputPageBlock)
-> Value
-> Parser InputPageBlock
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InputPageBlockTable" ((Object -> Parser InputPageBlock)
 -> Value -> Parser InputPageBlock)
-> (Object -> Parser InputPageBlock)
-> Value
-> Parser InputPageBlock
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"
        InputPageBlock -> Parser InputPageBlock
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InputPageBlock -> Parser InputPageBlock)
-> InputPageBlock -> Parser InputPageBlock
forall a b. (a -> b) -> a -> b
$ InputPageBlockTable
          { _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_
          }
      parseInputPageBlockDetails :: A.Value -> AT.Parser InputPageBlock
      parseInputPageBlockDetails :: Value -> Parser InputPageBlock
parseInputPageBlockDetails = String
-> (Object -> Parser InputPageBlock)
-> Value
-> Parser InputPageBlock
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InputPageBlockDetails" ((Object -> Parser InputPageBlock)
 -> Value -> Parser InputPageBlock)
-> (Object -> Parser InputPageBlock)
-> Value
-> Parser InputPageBlock
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 [InputPageBlock]
blocks_  <- Object
o Object -> Key -> Parser (Maybe [InputPageBlock])
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"
        InputPageBlock -> Parser InputPageBlock
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InputPageBlock -> Parser InputPageBlock)
-> InputPageBlock -> Parser InputPageBlock
forall a b. (a -> b) -> a -> b
$ InputPageBlockDetails
          { header :: Maybe RichText
header  = Maybe RichText
header_
          , blocks :: Maybe [InputPageBlock]
blocks  = Maybe [InputPageBlock]
blocks_
          , is_open :: Maybe Bool
is_open = Maybe Bool
is_open_
          }
      parseInputPageBlockMap :: A.Value -> AT.Parser InputPageBlock
      parseInputPageBlockMap :: Value -> Parser InputPageBlock
parseInputPageBlockMap = String
-> (Object -> Parser InputPageBlock)
-> Value
-> Parser InputPageBlock
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InputPageBlockMap" ((Object -> Parser InputPageBlock)
 -> Value -> Parser InputPageBlock)
-> (Object -> Parser InputPageBlock)
-> Value
-> Parser InputPageBlock
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"
        InputPageBlock -> Parser InputPageBlock
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InputPageBlock -> Parser InputPageBlock)
-> InputPageBlock -> Parser InputPageBlock
forall a b. (a -> b) -> a -> b
$ InputPageBlockMap
          { 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 InputPageBlock
forall a. Monoid a => a
mempty

instance AT.ToJSON InputPageBlock where
  toJSON :: InputPageBlock -> Value
toJSON InputPageBlockSectionHeading
    { text :: InputPageBlock -> Maybe RichText
text = Maybe RichText
text_
    , size :: InputPageBlock -> 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
"inputPageBlockSectionHeading"
        , 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 InputPageBlockParagraph
    { text :: InputPageBlock -> 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
"inputPageBlockParagraph"
        , 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 InputPageBlockPreformatted
    { text :: InputPageBlock -> Maybe RichText
text     = Maybe RichText
text_
    , language :: InputPageBlock -> 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
"inputPageBlockPreformatted"
        , 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 InputPageBlockFooter
    { footer :: InputPageBlock -> 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
"inputPageBlockFooter"
        , 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 InputPageBlockThinking
    { text :: InputPageBlock -> 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
"inputPageBlockThinking"
        , 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 InputPageBlock
InputPageBlockDivider
      = [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
"inputPageBlockDivider"
        ]
  toJSON InputPageBlockMathematicalExpression
    { expression :: InputPageBlock -> 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
"inputPageBlockMathematicalExpression"
        , 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 InputPageBlockAnchor
    { name :: InputPageBlock -> 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
"inputPageBlockAnchor"
        , 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 InputPageBlockList
    { items :: InputPageBlock -> Maybe [InputPageBlockListItem]
items = Maybe [InputPageBlockListItem]
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
"inputPageBlockList"
        , Key
"items" Key -> Maybe [InputPageBlockListItem] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe [InputPageBlockListItem]
items_
        ]
  toJSON InputPageBlockBlockQuote
    { blocks :: InputPageBlock -> Maybe [InputPageBlock]
blocks = Maybe [InputPageBlock]
blocks_
    , credit :: InputPageBlock -> 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
"inputPageBlockBlockQuote"
        , Key
"blocks" Key -> Maybe [InputPageBlock] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe [InputPageBlock]
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 InputPageBlockPullQuote
    { text :: InputPageBlock -> Maybe RichText
text   = Maybe RichText
text_
    , credit :: InputPageBlock -> 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
"inputPageBlockPullQuote"
        , 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 InputPageBlockAnimation
    { animation :: InputPageBlock -> Maybe InputAnimation
animation   = Maybe InputAnimation
animation_
    , caption :: InputPageBlock -> Maybe PageBlockCaption
caption     = Maybe PageBlockCaption
caption_
    , has_spoiler :: InputPageBlock -> 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
"inputPageBlockAnimation"
        , Key
"animation"   Key -> Maybe InputAnimation -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe InputAnimation
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
"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 InputPageBlockAudio
    { audio :: InputPageBlock -> Maybe InputAudio
audio   = Maybe InputAudio
audio_
    , caption :: InputPageBlock -> 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
"inputPageBlockAudio"
        , Key
"audio"   Key -> Maybe InputAudio -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe InputAudio
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 InputPageBlockPhoto
    { photo :: InputPageBlock -> Maybe InputPhoto
photo       = Maybe InputPhoto
photo_
    , caption :: InputPageBlock -> Maybe PageBlockCaption
caption     = Maybe PageBlockCaption
caption_
    , has_spoiler :: InputPageBlock -> 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
"inputPageBlockPhoto"
        , Key
"photo"       Key -> Maybe InputPhoto -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe InputPhoto
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
"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 InputPageBlockVideo
    { video :: InputPageBlock -> Maybe InputVideo
video       = Maybe InputVideo
video_
    , caption :: InputPageBlock -> Maybe PageBlockCaption
caption     = Maybe PageBlockCaption
caption_
    , has_spoiler :: InputPageBlock -> 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
"inputPageBlockVideo"
        , Key
"video"       Key -> Maybe InputVideo -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe InputVideo
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
"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 InputPageBlockVoiceNote
    { voice_note :: InputPageBlock -> Maybe InputVoiceNote
voice_note = Maybe InputVoiceNote
voice_note_
    , caption :: InputPageBlock -> 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
"inputPageBlockVoiceNote"
        , Key
"voice_note" Key -> Maybe InputVoiceNote -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe InputVoiceNote
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 InputPageBlockCollage
    { blocks :: InputPageBlock -> Maybe [InputPageBlock]
blocks  = Maybe [InputPageBlock]
blocks_
    , caption :: InputPageBlock -> 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
"inputPageBlockCollage"
        , Key
"blocks"  Key -> Maybe [InputPageBlock] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe [InputPageBlock]
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 InputPageBlockSlideshow
    { blocks :: InputPageBlock -> Maybe [InputPageBlock]
blocks  = Maybe [InputPageBlock]
blocks_
    , caption :: InputPageBlock -> 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
"inputPageBlockSlideshow"
        , Key
"blocks"  Key -> Maybe [InputPageBlock] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe [InputPageBlock]
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 InputPageBlockTable
    { _caption :: InputPageBlock -> Maybe RichText
_caption    = Maybe RichText
_caption_
    , cells :: InputPageBlock -> Maybe [[PageBlockTableCell]]
cells       = Maybe [[PageBlockTableCell]]
cells_
    , is_bordered :: InputPageBlock -> Maybe Bool
is_bordered = Maybe Bool
is_bordered_
    , is_striped :: InputPageBlock -> 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
"inputPageBlockTable"
        , 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 InputPageBlockDetails
    { header :: InputPageBlock -> Maybe RichText
header  = Maybe RichText
header_
    , blocks :: InputPageBlock -> Maybe [InputPageBlock]
blocks  = Maybe [InputPageBlock]
blocks_
    , is_open :: InputPageBlock -> 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
"inputPageBlockDetails"
        , 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 [InputPageBlock] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe [InputPageBlock]
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 InputPageBlockMap
    { location :: InputPageBlock -> Maybe Location
location = Maybe Location
location_
    , zoom :: InputPageBlock -> Maybe Int
zoom     = Maybe Int
zoom_
    , width :: InputPageBlock -> Maybe Int
width    = Maybe Int
width_
    , height :: InputPageBlock -> Maybe Int
height   = Maybe Int
height_
    , caption :: InputPageBlock -> 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
"inputPageBlockMap"
        , 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_
        ]