module TD.Data.InputMessageContent
(InputMessageContent(..)) 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.FormattedText as FormattedText
import qualified TD.Data.LinkPreviewOptions as LinkPreviewOptions
import qualified TD.Data.InputFile as InputFile
import qualified TD.Data.InputThumbnail as InputThumbnail
import qualified Data.Text as T
import qualified TD.Data.InputPaidMedia as InputPaidMedia
import qualified TD.Data.MessageSelfDestructType as MessageSelfDestructType
import qualified Data.ByteString as BS
import qualified TD.Data.Location as Location
import qualified TD.Data.Venue as Venue
import qualified TD.Data.Contact as Contact
import qualified TD.Data.Invoice as Invoice
import qualified TD.Data.PollType as PollType
import qualified TD.Data.MessageCopyOptions as MessageCopyOptions
data InputMessageContent
= InputMessageText
{ InputMessageContent -> Maybe FormattedText
text :: Maybe FormattedText.FormattedText
, InputMessageContent -> Maybe LinkPreviewOptions
link_preview_options :: Maybe LinkPreviewOptions.LinkPreviewOptions
, InputMessageContent -> Maybe Bool
clear_draft :: Maybe Bool
}
| InputMessageAnimation
{ InputMessageContent -> Maybe InputFile
animation :: Maybe InputFile.InputFile
, InputMessageContent -> Maybe InputThumbnail
thumbnail :: Maybe InputThumbnail.InputThumbnail
, InputMessageContent -> Maybe [Int]
added_sticker_file_ids :: Maybe [Int]
, InputMessageContent -> Maybe Int
duration :: Maybe Int
, InputMessageContent -> Maybe Int
width :: Maybe Int
, InputMessageContent -> Maybe Int
height :: Maybe Int
, InputMessageContent -> Maybe FormattedText
caption :: Maybe FormattedText.FormattedText
, InputMessageContent -> Maybe Bool
show_caption_above_media :: Maybe Bool
, InputMessageContent -> Maybe Bool
has_spoiler :: Maybe Bool
}
| InputMessageAudio
{ InputMessageContent -> Maybe InputFile
audio :: Maybe InputFile.InputFile
, InputMessageContent -> Maybe InputThumbnail
album_cover_thumbnail :: Maybe InputThumbnail.InputThumbnail
, duration :: Maybe Int
, InputMessageContent -> Maybe Text
title :: Maybe T.Text
, InputMessageContent -> Maybe Text
performer :: Maybe T.Text
, caption :: Maybe FormattedText.FormattedText
}
| InputMessageDocument
{ InputMessageContent -> Maybe InputFile
document :: Maybe InputFile.InputFile
, thumbnail :: Maybe InputThumbnail.InputThumbnail
, InputMessageContent -> Maybe Bool
disable_content_type_detection :: Maybe Bool
, caption :: Maybe FormattedText.FormattedText
}
| InputMessagePaidMedia
{ InputMessageContent -> Maybe Int
star_count :: Maybe Int
, InputMessageContent -> Maybe [InputPaidMedia]
paid_media :: Maybe [InputPaidMedia.InputPaidMedia]
, caption :: Maybe FormattedText.FormattedText
, show_caption_above_media :: Maybe Bool
, InputMessageContent -> Maybe Text
payload :: Maybe T.Text
}
| InputMessagePhoto
{ InputMessageContent -> Maybe InputFile
photo :: Maybe InputFile.InputFile
, thumbnail :: Maybe InputThumbnail.InputThumbnail
, added_sticker_file_ids :: Maybe [Int]
, width :: Maybe Int
, height :: Maybe Int
, caption :: Maybe FormattedText.FormattedText
, show_caption_above_media :: Maybe Bool
, InputMessageContent -> Maybe MessageSelfDestructType
self_destruct_type :: Maybe MessageSelfDestructType.MessageSelfDestructType
, has_spoiler :: Maybe Bool
}
| InputMessageSticker
{ InputMessageContent -> Maybe InputFile
sticker :: Maybe InputFile.InputFile
, thumbnail :: Maybe InputThumbnail.InputThumbnail
, width :: Maybe Int
, height :: Maybe Int
, InputMessageContent -> Maybe Text
emoji :: Maybe T.Text
}
| InputMessageVideo
{ InputMessageContent -> Maybe InputFile
video :: Maybe InputFile.InputFile
, thumbnail :: Maybe InputThumbnail.InputThumbnail
, added_sticker_file_ids :: Maybe [Int]
, duration :: Maybe Int
, width :: Maybe Int
, height :: Maybe Int
, InputMessageContent -> Maybe Bool
supports_streaming :: Maybe Bool
, caption :: Maybe FormattedText.FormattedText
, show_caption_above_media :: Maybe Bool
, self_destruct_type :: Maybe MessageSelfDestructType.MessageSelfDestructType
, has_spoiler :: Maybe Bool
}
| InputMessageVideoNote
{ InputMessageContent -> Maybe InputFile
video_note :: Maybe InputFile.InputFile
, thumbnail :: Maybe InputThumbnail.InputThumbnail
, duration :: Maybe Int
, InputMessageContent -> Maybe Int
_length :: Maybe Int
, self_destruct_type :: Maybe MessageSelfDestructType.MessageSelfDestructType
}
| InputMessageVoiceNote
{ InputMessageContent -> Maybe InputFile
voice_note :: Maybe InputFile.InputFile
, duration :: Maybe Int
, InputMessageContent -> Maybe ByteString
waveform :: Maybe BS.ByteString
, caption :: Maybe FormattedText.FormattedText
, self_destruct_type :: Maybe MessageSelfDestructType.MessageSelfDestructType
}
| InputMessageLocation
{ InputMessageContent -> Maybe Location
location :: Maybe Location.Location
, InputMessageContent -> Maybe Int
live_period :: Maybe Int
, InputMessageContent -> Maybe Int
heading :: Maybe Int
, InputMessageContent -> Maybe Int
proximity_alert_radius :: Maybe Int
}
| InputMessageVenue
{ InputMessageContent -> Maybe Venue
venue :: Maybe Venue.Venue
}
| InputMessageContact
{ InputMessageContent -> Maybe Contact
contact :: Maybe Contact.Contact
}
| InputMessageDice
{ emoji :: Maybe T.Text
, clear_draft :: Maybe Bool
}
| InputMessageGame
{ InputMessageContent -> Maybe Int
bot_user_id :: Maybe Int
, InputMessageContent -> Maybe Text
game_short_name :: Maybe T.Text
}
| InputMessageInvoice
{ InputMessageContent -> Maybe Invoice
invoice :: Maybe Invoice.Invoice
, title :: Maybe T.Text
, InputMessageContent -> Maybe Text
description :: Maybe T.Text
, InputMessageContent -> Maybe Text
photo_url :: Maybe T.Text
, InputMessageContent -> Maybe Int
photo_size :: Maybe Int
, InputMessageContent -> Maybe Int
photo_width :: Maybe Int
, InputMessageContent -> Maybe Int
photo_height :: Maybe Int
, InputMessageContent -> Maybe ByteString
_payload :: Maybe BS.ByteString
, InputMessageContent -> Maybe Text
provider_token :: Maybe T.Text
, InputMessageContent -> Maybe Text
provider_data :: Maybe T.Text
, InputMessageContent -> Maybe Text
start_parameter :: Maybe T.Text
, InputMessageContent -> Maybe InputPaidMedia
_paid_media :: Maybe InputPaidMedia.InputPaidMedia
, InputMessageContent -> Maybe FormattedText
paid_media_caption :: Maybe FormattedText.FormattedText
}
| InputMessagePoll
{ InputMessageContent -> Maybe FormattedText
question :: Maybe FormattedText.FormattedText
, InputMessageContent -> Maybe [FormattedText]
options :: Maybe [FormattedText.FormattedText]
, InputMessageContent -> Maybe Bool
is_anonymous :: Maybe Bool
, InputMessageContent -> Maybe PollType
_type :: Maybe PollType.PollType
, InputMessageContent -> Maybe Int
open_period :: Maybe Int
, InputMessageContent -> Maybe Int
close_date :: Maybe Int
, InputMessageContent -> Maybe Bool
is_closed :: Maybe Bool
}
| InputMessageStory
{ InputMessageContent -> Maybe Int
story_sender_chat_id :: Maybe Int
, InputMessageContent -> Maybe Int
story_id :: Maybe Int
}
| InputMessageForwarded
{ InputMessageContent -> Maybe Int
from_chat_id :: Maybe Int
, InputMessageContent -> Maybe Int
message_id :: Maybe Int
, InputMessageContent -> Maybe Bool
in_game_share :: Maybe Bool
, InputMessageContent -> Maybe MessageCopyOptions
copy_options :: Maybe MessageCopyOptions.MessageCopyOptions
}
deriving (InputMessageContent -> InputMessageContent -> Bool
(InputMessageContent -> InputMessageContent -> Bool)
-> (InputMessageContent -> InputMessageContent -> Bool)
-> Eq InputMessageContent
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: InputMessageContent -> InputMessageContent -> Bool
== :: InputMessageContent -> InputMessageContent -> Bool
$c/= :: InputMessageContent -> InputMessageContent -> Bool
/= :: InputMessageContent -> InputMessageContent -> Bool
Eq, Int -> InputMessageContent -> ShowS
[InputMessageContent] -> ShowS
InputMessageContent -> String
(Int -> InputMessageContent -> ShowS)
-> (InputMessageContent -> String)
-> ([InputMessageContent] -> ShowS)
-> Show InputMessageContent
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> InputMessageContent -> ShowS
showsPrec :: Int -> InputMessageContent -> ShowS
$cshow :: InputMessageContent -> String
show :: InputMessageContent -> String
$cshowList :: [InputMessageContent] -> ShowS
showList :: [InputMessageContent] -> ShowS
Show)
instance I.ShortShow InputMessageContent where
shortShow :: InputMessageContent -> String
shortShow InputMessageText
{ text :: InputMessageContent -> Maybe FormattedText
text = Maybe FormattedText
text_
, link_preview_options :: InputMessageContent -> Maybe LinkPreviewOptions
link_preview_options = Maybe LinkPreviewOptions
link_preview_options_
, clear_draft :: InputMessageContent -> Maybe Bool
clear_draft = Maybe Bool
clear_draft_
}
= String
"InputMessageText"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"text" String -> Maybe FormattedText -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe FormattedText
text_
, String
"link_preview_options" String -> Maybe LinkPreviewOptions -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe LinkPreviewOptions
link_preview_options_
, String
"clear_draft" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
clear_draft_
]
shortShow InputMessageAnimation
{ animation :: InputMessageContent -> Maybe InputFile
animation = Maybe InputFile
animation_
, thumbnail :: InputMessageContent -> Maybe InputThumbnail
thumbnail = Maybe InputThumbnail
thumbnail_
, added_sticker_file_ids :: InputMessageContent -> Maybe [Int]
added_sticker_file_ids = Maybe [Int]
added_sticker_file_ids_
, duration :: InputMessageContent -> Maybe Int
duration = Maybe Int
duration_
, width :: InputMessageContent -> Maybe Int
width = Maybe Int
width_
, height :: InputMessageContent -> Maybe Int
height = Maybe Int
height_
, caption :: InputMessageContent -> Maybe FormattedText
caption = Maybe FormattedText
caption_
, show_caption_above_media :: InputMessageContent -> Maybe Bool
show_caption_above_media = Maybe Bool
show_caption_above_media_
, has_spoiler :: InputMessageContent -> Maybe Bool
has_spoiler = Maybe Bool
has_spoiler_
}
= String
"InputMessageAnimation"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"animation" String -> Maybe InputFile -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe InputFile
animation_
, String
"thumbnail" String -> Maybe InputThumbnail -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe InputThumbnail
thumbnail_
, String
"added_sticker_file_ids" String -> Maybe [Int] -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe [Int]
added_sticker_file_ids_
, String
"duration" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
duration_
, 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 FormattedText -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe FormattedText
caption_
, String
"show_caption_above_media" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
show_caption_above_media_
, String
"has_spoiler" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
has_spoiler_
]
shortShow InputMessageAudio
{ audio :: InputMessageContent -> Maybe InputFile
audio = Maybe InputFile
audio_
, album_cover_thumbnail :: InputMessageContent -> Maybe InputThumbnail
album_cover_thumbnail = Maybe InputThumbnail
album_cover_thumbnail_
, duration :: InputMessageContent -> Maybe Int
duration = Maybe Int
duration_
, title :: InputMessageContent -> Maybe Text
title = Maybe Text
title_
, performer :: InputMessageContent -> Maybe Text
performer = Maybe Text
performer_
, caption :: InputMessageContent -> Maybe FormattedText
caption = Maybe FormattedText
caption_
}
= String
"InputMessageAudio"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"audio" String -> Maybe InputFile -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe InputFile
audio_
, String
"album_cover_thumbnail" String -> Maybe InputThumbnail -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe InputThumbnail
album_cover_thumbnail_
, String
"duration" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
duration_
, String
"title" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
title_
, String
"performer" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
performer_
, String
"caption" String -> Maybe FormattedText -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe FormattedText
caption_
]
shortShow InputMessageDocument
{ document :: InputMessageContent -> Maybe InputFile
document = Maybe InputFile
document_
, thumbnail :: InputMessageContent -> Maybe InputThumbnail
thumbnail = Maybe InputThumbnail
thumbnail_
, disable_content_type_detection :: InputMessageContent -> Maybe Bool
disable_content_type_detection = Maybe Bool
disable_content_type_detection_
, caption :: InputMessageContent -> Maybe FormattedText
caption = Maybe FormattedText
caption_
}
= String
"InputMessageDocument"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"document" String -> Maybe InputFile -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe InputFile
document_
, String
"thumbnail" String -> Maybe InputThumbnail -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe InputThumbnail
thumbnail_
, String
"disable_content_type_detection" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
disable_content_type_detection_
, String
"caption" String -> Maybe FormattedText -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe FormattedText
caption_
]
shortShow InputMessagePaidMedia
{ star_count :: InputMessageContent -> Maybe Int
star_count = Maybe Int
star_count_
, paid_media :: InputMessageContent -> Maybe [InputPaidMedia]
paid_media = Maybe [InputPaidMedia]
paid_media_
, caption :: InputMessageContent -> Maybe FormattedText
caption = Maybe FormattedText
caption_
, show_caption_above_media :: InputMessageContent -> Maybe Bool
show_caption_above_media = Maybe Bool
show_caption_above_media_
, payload :: InputMessageContent -> Maybe Text
payload = Maybe Text
payload_
}
= String
"InputMessagePaidMedia"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"star_count" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
star_count_
, String
"paid_media" String -> Maybe [InputPaidMedia] -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe [InputPaidMedia]
paid_media_
, String
"caption" String -> Maybe FormattedText -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe FormattedText
caption_
, String
"show_caption_above_media" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
show_caption_above_media_
, String
"payload" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
payload_
]
shortShow InputMessagePhoto
{ photo :: InputMessageContent -> Maybe InputFile
photo = Maybe InputFile
photo_
, thumbnail :: InputMessageContent -> Maybe InputThumbnail
thumbnail = Maybe InputThumbnail
thumbnail_
, added_sticker_file_ids :: InputMessageContent -> Maybe [Int]
added_sticker_file_ids = Maybe [Int]
added_sticker_file_ids_
, width :: InputMessageContent -> Maybe Int
width = Maybe Int
width_
, height :: InputMessageContent -> Maybe Int
height = Maybe Int
height_
, caption :: InputMessageContent -> Maybe FormattedText
caption = Maybe FormattedText
caption_
, show_caption_above_media :: InputMessageContent -> Maybe Bool
show_caption_above_media = Maybe Bool
show_caption_above_media_
, self_destruct_type :: InputMessageContent -> Maybe MessageSelfDestructType
self_destruct_type = Maybe MessageSelfDestructType
self_destruct_type_
, has_spoiler :: InputMessageContent -> Maybe Bool
has_spoiler = Maybe Bool
has_spoiler_
}
= String
"InputMessagePhoto"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"photo" String -> Maybe InputFile -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe InputFile
photo_
, String
"thumbnail" String -> Maybe InputThumbnail -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe InputThumbnail
thumbnail_
, String
"added_sticker_file_ids" String -> Maybe [Int] -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe [Int]
added_sticker_file_ids_
, 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 FormattedText -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe FormattedText
caption_
, String
"show_caption_above_media" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
show_caption_above_media_
, String
"self_destruct_type" String -> Maybe MessageSelfDestructType -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe MessageSelfDestructType
self_destruct_type_
, String
"has_spoiler" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
has_spoiler_
]
shortShow InputMessageSticker
{ sticker :: InputMessageContent -> Maybe InputFile
sticker = Maybe InputFile
sticker_
, thumbnail :: InputMessageContent -> Maybe InputThumbnail
thumbnail = Maybe InputThumbnail
thumbnail_
, width :: InputMessageContent -> Maybe Int
width = Maybe Int
width_
, height :: InputMessageContent -> Maybe Int
height = Maybe Int
height_
, emoji :: InputMessageContent -> Maybe Text
emoji = Maybe Text
emoji_
}
= String
"InputMessageSticker"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"sticker" String -> Maybe InputFile -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe InputFile
sticker_
, String
"thumbnail" String -> Maybe InputThumbnail -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe InputThumbnail
thumbnail_
, 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
"emoji" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
emoji_
]
shortShow InputMessageVideo
{ video :: InputMessageContent -> Maybe InputFile
video = Maybe InputFile
video_
, thumbnail :: InputMessageContent -> Maybe InputThumbnail
thumbnail = Maybe InputThumbnail
thumbnail_
, added_sticker_file_ids :: InputMessageContent -> Maybe [Int]
added_sticker_file_ids = Maybe [Int]
added_sticker_file_ids_
, duration :: InputMessageContent -> Maybe Int
duration = Maybe Int
duration_
, width :: InputMessageContent -> Maybe Int
width = Maybe Int
width_
, height :: InputMessageContent -> Maybe Int
height = Maybe Int
height_
, supports_streaming :: InputMessageContent -> Maybe Bool
supports_streaming = Maybe Bool
supports_streaming_
, caption :: InputMessageContent -> Maybe FormattedText
caption = Maybe FormattedText
caption_
, show_caption_above_media :: InputMessageContent -> Maybe Bool
show_caption_above_media = Maybe Bool
show_caption_above_media_
, self_destruct_type :: InputMessageContent -> Maybe MessageSelfDestructType
self_destruct_type = Maybe MessageSelfDestructType
self_destruct_type_
, has_spoiler :: InputMessageContent -> Maybe Bool
has_spoiler = Maybe Bool
has_spoiler_
}
= String
"InputMessageVideo"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"video" String -> Maybe InputFile -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe InputFile
video_
, String
"thumbnail" String -> Maybe InputThumbnail -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe InputThumbnail
thumbnail_
, String
"added_sticker_file_ids" String -> Maybe [Int] -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe [Int]
added_sticker_file_ids_
, String
"duration" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
duration_
, 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
"supports_streaming" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
supports_streaming_
, String
"caption" String -> Maybe FormattedText -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe FormattedText
caption_
, String
"show_caption_above_media" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
show_caption_above_media_
, String
"self_destruct_type" String -> Maybe MessageSelfDestructType -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe MessageSelfDestructType
self_destruct_type_
, String
"has_spoiler" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
has_spoiler_
]
shortShow InputMessageVideoNote
{ video_note :: InputMessageContent -> Maybe InputFile
video_note = Maybe InputFile
video_note_
, thumbnail :: InputMessageContent -> Maybe InputThumbnail
thumbnail = Maybe InputThumbnail
thumbnail_
, duration :: InputMessageContent -> Maybe Int
duration = Maybe Int
duration_
, _length :: InputMessageContent -> Maybe Int
_length = Maybe Int
_length_
, self_destruct_type :: InputMessageContent -> Maybe MessageSelfDestructType
self_destruct_type = Maybe MessageSelfDestructType
self_destruct_type_
}
= String
"InputMessageVideoNote"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"video_note" String -> Maybe InputFile -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe InputFile
video_note_
, String
"thumbnail" String -> Maybe InputThumbnail -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe InputThumbnail
thumbnail_
, String
"duration" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
duration_
, String
"_length" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
_length_
, String
"self_destruct_type" String -> Maybe MessageSelfDestructType -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe MessageSelfDestructType
self_destruct_type_
]
shortShow InputMessageVoiceNote
{ voice_note :: InputMessageContent -> Maybe InputFile
voice_note = Maybe InputFile
voice_note_
, duration :: InputMessageContent -> Maybe Int
duration = Maybe Int
duration_
, waveform :: InputMessageContent -> Maybe ByteString
waveform = Maybe ByteString
waveform_
, caption :: InputMessageContent -> Maybe FormattedText
caption = Maybe FormattedText
caption_
, self_destruct_type :: InputMessageContent -> Maybe MessageSelfDestructType
self_destruct_type = Maybe MessageSelfDestructType
self_destruct_type_
}
= String
"InputMessageVoiceNote"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"voice_note" String -> Maybe InputFile -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe InputFile
voice_note_
, String
"duration" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
duration_
, String
"waveform" String -> Maybe ByteString -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe ByteString
waveform_
, String
"caption" String -> Maybe FormattedText -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe FormattedText
caption_
, String
"self_destruct_type" String -> Maybe MessageSelfDestructType -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe MessageSelfDestructType
self_destruct_type_
]
shortShow InputMessageLocation
{ location :: InputMessageContent -> Maybe Location
location = Maybe Location
location_
, live_period :: InputMessageContent -> Maybe Int
live_period = Maybe Int
live_period_
, heading :: InputMessageContent -> Maybe Int
heading = Maybe Int
heading_
, proximity_alert_radius :: InputMessageContent -> Maybe Int
proximity_alert_radius = Maybe Int
proximity_alert_radius_
}
= String
"InputMessageLocation"
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
"live_period" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
live_period_
, String
"heading" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
heading_
, String
"proximity_alert_radius" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
proximity_alert_radius_
]
shortShow InputMessageVenue
{ venue :: InputMessageContent -> Maybe Venue
venue = Maybe Venue
venue_
}
= String
"InputMessageVenue"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"venue" String -> Maybe Venue -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Venue
venue_
]
shortShow InputMessageContact
{ contact :: InputMessageContent -> Maybe Contact
contact = Maybe Contact
contact_
}
= String
"InputMessageContact"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"contact" String -> Maybe Contact -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Contact
contact_
]
shortShow InputMessageDice
{ emoji :: InputMessageContent -> Maybe Text
emoji = Maybe Text
emoji_
, clear_draft :: InputMessageContent -> Maybe Bool
clear_draft = Maybe Bool
clear_draft_
}
= String
"InputMessageDice"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"emoji" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
emoji_
, String
"clear_draft" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
clear_draft_
]
shortShow InputMessageGame
{ bot_user_id :: InputMessageContent -> Maybe Int
bot_user_id = Maybe Int
bot_user_id_
, game_short_name :: InputMessageContent -> Maybe Text
game_short_name = Maybe Text
game_short_name_
}
= String
"InputMessageGame"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"bot_user_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
bot_user_id_
, String
"game_short_name" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
game_short_name_
]
shortShow InputMessageInvoice
{ invoice :: InputMessageContent -> Maybe Invoice
invoice = Maybe Invoice
invoice_
, title :: InputMessageContent -> Maybe Text
title = Maybe Text
title_
, description :: InputMessageContent -> Maybe Text
description = Maybe Text
description_
, photo_url :: InputMessageContent -> Maybe Text
photo_url = Maybe Text
photo_url_
, photo_size :: InputMessageContent -> Maybe Int
photo_size = Maybe Int
photo_size_
, photo_width :: InputMessageContent -> Maybe Int
photo_width = Maybe Int
photo_width_
, photo_height :: InputMessageContent -> Maybe Int
photo_height = Maybe Int
photo_height_
, _payload :: InputMessageContent -> Maybe ByteString
_payload = Maybe ByteString
_payload_
, provider_token :: InputMessageContent -> Maybe Text
provider_token = Maybe Text
provider_token_
, provider_data :: InputMessageContent -> Maybe Text
provider_data = Maybe Text
provider_data_
, start_parameter :: InputMessageContent -> Maybe Text
start_parameter = Maybe Text
start_parameter_
, _paid_media :: InputMessageContent -> Maybe InputPaidMedia
_paid_media = Maybe InputPaidMedia
_paid_media_
, paid_media_caption :: InputMessageContent -> Maybe FormattedText
paid_media_caption = Maybe FormattedText
paid_media_caption_
}
= String
"InputMessageInvoice"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"invoice" String -> Maybe Invoice -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Invoice
invoice_
, String
"title" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
title_
, String
"description" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
description_
, String
"photo_url" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
photo_url_
, String
"photo_size" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
photo_size_
, String
"photo_width" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
photo_width_
, String
"photo_height" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
photo_height_
, String
"_payload" String -> Maybe ByteString -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe ByteString
_payload_
, String
"provider_token" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
provider_token_
, String
"provider_data" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
provider_data_
, String
"start_parameter" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
start_parameter_
, String
"_paid_media" String -> Maybe InputPaidMedia -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe InputPaidMedia
_paid_media_
, String
"paid_media_caption" String -> Maybe FormattedText -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe FormattedText
paid_media_caption_
]
shortShow InputMessagePoll
{ question :: InputMessageContent -> Maybe FormattedText
question = Maybe FormattedText
question_
, options :: InputMessageContent -> Maybe [FormattedText]
options = Maybe [FormattedText]
options_
, is_anonymous :: InputMessageContent -> Maybe Bool
is_anonymous = Maybe Bool
is_anonymous_
, _type :: InputMessageContent -> Maybe PollType
_type = Maybe PollType
_type_
, open_period :: InputMessageContent -> Maybe Int
open_period = Maybe Int
open_period_
, close_date :: InputMessageContent -> Maybe Int
close_date = Maybe Int
close_date_
, is_closed :: InputMessageContent -> Maybe Bool
is_closed = Maybe Bool
is_closed_
}
= String
"InputMessagePoll"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"question" String -> Maybe FormattedText -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe FormattedText
question_
, String
"options" String -> Maybe [FormattedText] -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe [FormattedText]
options_
, String
"is_anonymous" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
is_anonymous_
, String
"_type" String -> Maybe PollType -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe PollType
_type_
, String
"open_period" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
open_period_
, String
"close_date" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
close_date_
, String
"is_closed" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
is_closed_
]
shortShow InputMessageStory
{ story_sender_chat_id :: InputMessageContent -> Maybe Int
story_sender_chat_id = Maybe Int
story_sender_chat_id_
, story_id :: InputMessageContent -> Maybe Int
story_id = Maybe Int
story_id_
}
= String
"InputMessageStory"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"story_sender_chat_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
story_sender_chat_id_
, String
"story_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
story_id_
]
shortShow InputMessageForwarded
{ from_chat_id :: InputMessageContent -> Maybe Int
from_chat_id = Maybe Int
from_chat_id_
, message_id :: InputMessageContent -> Maybe Int
message_id = Maybe Int
message_id_
, in_game_share :: InputMessageContent -> Maybe Bool
in_game_share = Maybe Bool
in_game_share_
, copy_options :: InputMessageContent -> Maybe MessageCopyOptions
copy_options = Maybe MessageCopyOptions
copy_options_
}
= String
"InputMessageForwarded"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"from_chat_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
from_chat_id_
, String
"message_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
message_id_
, String
"in_game_share" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
in_game_share_
, String
"copy_options" String -> Maybe MessageCopyOptions -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe MessageCopyOptions
copy_options_
]
instance AT.FromJSON InputMessageContent where
parseJSON :: Value -> Parser InputMessageContent
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
"inputMessageText" -> Value -> Parser InputMessageContent
parseInputMessageText Value
v
String
"inputMessageAnimation" -> Value -> Parser InputMessageContent
parseInputMessageAnimation Value
v
String
"inputMessageAudio" -> Value -> Parser InputMessageContent
parseInputMessageAudio Value
v
String
"inputMessageDocument" -> Value -> Parser InputMessageContent
parseInputMessageDocument Value
v
String
"inputMessagePaidMedia" -> Value -> Parser InputMessageContent
parseInputMessagePaidMedia Value
v
String
"inputMessagePhoto" -> Value -> Parser InputMessageContent
parseInputMessagePhoto Value
v
String
"inputMessageSticker" -> Value -> Parser InputMessageContent
parseInputMessageSticker Value
v
String
"inputMessageVideo" -> Value -> Parser InputMessageContent
parseInputMessageVideo Value
v
String
"inputMessageVideoNote" -> Value -> Parser InputMessageContent
parseInputMessageVideoNote Value
v
String
"inputMessageVoiceNote" -> Value -> Parser InputMessageContent
parseInputMessageVoiceNote Value
v
String
"inputMessageLocation" -> Value -> Parser InputMessageContent
parseInputMessageLocation Value
v
String
"inputMessageVenue" -> Value -> Parser InputMessageContent
parseInputMessageVenue Value
v
String
"inputMessageContact" -> Value -> Parser InputMessageContent
parseInputMessageContact Value
v
String
"inputMessageDice" -> Value -> Parser InputMessageContent
parseInputMessageDice Value
v
String
"inputMessageGame" -> Value -> Parser InputMessageContent
parseInputMessageGame Value
v
String
"inputMessageInvoice" -> Value -> Parser InputMessageContent
parseInputMessageInvoice Value
v
String
"inputMessagePoll" -> Value -> Parser InputMessageContent
parseInputMessagePoll Value
v
String
"inputMessageStory" -> Value -> Parser InputMessageContent
parseInputMessageStory Value
v
String
"inputMessageForwarded" -> Value -> Parser InputMessageContent
parseInputMessageForwarded Value
v
String
_ -> Parser InputMessageContent
forall a. Monoid a => a
mempty
where
parseInputMessageText :: A.Value -> AT.Parser InputMessageContent
parseInputMessageText :: Value -> Parser InputMessageContent
parseInputMessageText = String
-> (Object -> Parser InputMessageContent)
-> Value
-> Parser InputMessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InputMessageText" ((Object -> Parser InputMessageContent)
-> Value -> Parser InputMessageContent)
-> (Object -> Parser InputMessageContent)
-> Value
-> Parser InputMessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe FormattedText
text_ <- Object
o Object -> Key -> Parser (Maybe FormattedText)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"text"
Maybe LinkPreviewOptions
link_preview_options_ <- Object
o Object -> Key -> Parser (Maybe LinkPreviewOptions)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"link_preview_options"
Maybe Bool
clear_draft_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"clear_draft"
InputMessageContent -> Parser InputMessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InputMessageContent -> Parser InputMessageContent)
-> InputMessageContent -> Parser InputMessageContent
forall a b. (a -> b) -> a -> b
$ InputMessageText
{ text :: Maybe FormattedText
text = Maybe FormattedText
text_
, link_preview_options :: Maybe LinkPreviewOptions
link_preview_options = Maybe LinkPreviewOptions
link_preview_options_
, clear_draft :: Maybe Bool
clear_draft = Maybe Bool
clear_draft_
}
parseInputMessageAnimation :: A.Value -> AT.Parser InputMessageContent
parseInputMessageAnimation :: Value -> Parser InputMessageContent
parseInputMessageAnimation = String
-> (Object -> Parser InputMessageContent)
-> Value
-> Parser InputMessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InputMessageAnimation" ((Object -> Parser InputMessageContent)
-> Value -> Parser InputMessageContent)
-> (Object -> Parser InputMessageContent)
-> Value
-> Parser InputMessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe InputFile
animation_ <- Object
o Object -> Key -> Parser (Maybe InputFile)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"animation"
Maybe InputThumbnail
thumbnail_ <- Object
o Object -> Key -> Parser (Maybe InputThumbnail)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"thumbnail"
Maybe [Int]
added_sticker_file_ids_ <- Object
o Object -> Key -> Parser (Maybe [Int])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"added_sticker_file_ids"
Maybe Int
duration_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"duration"
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 FormattedText
caption_ <- Object
o Object -> Key -> Parser (Maybe FormattedText)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"caption"
Maybe Bool
show_caption_above_media_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"show_caption_above_media"
Maybe Bool
has_spoiler_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"has_spoiler"
InputMessageContent -> Parser InputMessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InputMessageContent -> Parser InputMessageContent)
-> InputMessageContent -> Parser InputMessageContent
forall a b. (a -> b) -> a -> b
$ InputMessageAnimation
{ animation :: Maybe InputFile
animation = Maybe InputFile
animation_
, thumbnail :: Maybe InputThumbnail
thumbnail = Maybe InputThumbnail
thumbnail_
, added_sticker_file_ids :: Maybe [Int]
added_sticker_file_ids = Maybe [Int]
added_sticker_file_ids_
, duration :: Maybe Int
duration = Maybe Int
duration_
, width :: Maybe Int
width = Maybe Int
width_
, height :: Maybe Int
height = Maybe Int
height_
, caption :: Maybe FormattedText
caption = Maybe FormattedText
caption_
, show_caption_above_media :: Maybe Bool
show_caption_above_media = Maybe Bool
show_caption_above_media_
, has_spoiler :: Maybe Bool
has_spoiler = Maybe Bool
has_spoiler_
}
parseInputMessageAudio :: A.Value -> AT.Parser InputMessageContent
parseInputMessageAudio :: Value -> Parser InputMessageContent
parseInputMessageAudio = String
-> (Object -> Parser InputMessageContent)
-> Value
-> Parser InputMessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InputMessageAudio" ((Object -> Parser InputMessageContent)
-> Value -> Parser InputMessageContent)
-> (Object -> Parser InputMessageContent)
-> Value
-> Parser InputMessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe InputFile
audio_ <- Object
o Object -> Key -> Parser (Maybe InputFile)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"audio"
Maybe InputThumbnail
album_cover_thumbnail_ <- Object
o Object -> Key -> Parser (Maybe InputThumbnail)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"album_cover_thumbnail"
Maybe Int
duration_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"duration"
Maybe Text
title_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"title"
Maybe Text
performer_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"performer"
Maybe FormattedText
caption_ <- Object
o Object -> Key -> Parser (Maybe FormattedText)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"caption"
InputMessageContent -> Parser InputMessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InputMessageContent -> Parser InputMessageContent)
-> InputMessageContent -> Parser InputMessageContent
forall a b. (a -> b) -> a -> b
$ InputMessageAudio
{ audio :: Maybe InputFile
audio = Maybe InputFile
audio_
, album_cover_thumbnail :: Maybe InputThumbnail
album_cover_thumbnail = Maybe InputThumbnail
album_cover_thumbnail_
, duration :: Maybe Int
duration = Maybe Int
duration_
, title :: Maybe Text
title = Maybe Text
title_
, performer :: Maybe Text
performer = Maybe Text
performer_
, caption :: Maybe FormattedText
caption = Maybe FormattedText
caption_
}
parseInputMessageDocument :: A.Value -> AT.Parser InputMessageContent
parseInputMessageDocument :: Value -> Parser InputMessageContent
parseInputMessageDocument = String
-> (Object -> Parser InputMessageContent)
-> Value
-> Parser InputMessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InputMessageDocument" ((Object -> Parser InputMessageContent)
-> Value -> Parser InputMessageContent)
-> (Object -> Parser InputMessageContent)
-> Value
-> Parser InputMessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe InputFile
document_ <- Object
o Object -> Key -> Parser (Maybe InputFile)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"document"
Maybe InputThumbnail
thumbnail_ <- Object
o Object -> Key -> Parser (Maybe InputThumbnail)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"thumbnail"
Maybe Bool
disable_content_type_detection_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"disable_content_type_detection"
Maybe FormattedText
caption_ <- Object
o Object -> Key -> Parser (Maybe FormattedText)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"caption"
InputMessageContent -> Parser InputMessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InputMessageContent -> Parser InputMessageContent)
-> InputMessageContent -> Parser InputMessageContent
forall a b. (a -> b) -> a -> b
$ InputMessageDocument
{ document :: Maybe InputFile
document = Maybe InputFile
document_
, thumbnail :: Maybe InputThumbnail
thumbnail = Maybe InputThumbnail
thumbnail_
, disable_content_type_detection :: Maybe Bool
disable_content_type_detection = Maybe Bool
disable_content_type_detection_
, caption :: Maybe FormattedText
caption = Maybe FormattedText
caption_
}
parseInputMessagePaidMedia :: A.Value -> AT.Parser InputMessageContent
parseInputMessagePaidMedia :: Value -> Parser InputMessageContent
parseInputMessagePaidMedia = String
-> (Object -> Parser InputMessageContent)
-> Value
-> Parser InputMessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InputMessagePaidMedia" ((Object -> Parser InputMessageContent)
-> Value -> Parser InputMessageContent)
-> (Object -> Parser InputMessageContent)
-> Value
-> Parser InputMessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Int
star_count_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"star_count"
Maybe [InputPaidMedia]
paid_media_ <- Object
o Object -> Key -> Parser (Maybe [InputPaidMedia])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"paid_media"
Maybe FormattedText
caption_ <- Object
o Object -> Key -> Parser (Maybe FormattedText)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"caption"
Maybe Bool
show_caption_above_media_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"show_caption_above_media"
Maybe Text
payload_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"payload"
InputMessageContent -> Parser InputMessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InputMessageContent -> Parser InputMessageContent)
-> InputMessageContent -> Parser InputMessageContent
forall a b. (a -> b) -> a -> b
$ InputMessagePaidMedia
{ star_count :: Maybe Int
star_count = Maybe Int
star_count_
, paid_media :: Maybe [InputPaidMedia]
paid_media = Maybe [InputPaidMedia]
paid_media_
, caption :: Maybe FormattedText
caption = Maybe FormattedText
caption_
, show_caption_above_media :: Maybe Bool
show_caption_above_media = Maybe Bool
show_caption_above_media_
, payload :: Maybe Text
payload = Maybe Text
payload_
}
parseInputMessagePhoto :: A.Value -> AT.Parser InputMessageContent
parseInputMessagePhoto :: Value -> Parser InputMessageContent
parseInputMessagePhoto = String
-> (Object -> Parser InputMessageContent)
-> Value
-> Parser InputMessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InputMessagePhoto" ((Object -> Parser InputMessageContent)
-> Value -> Parser InputMessageContent)
-> (Object -> Parser InputMessageContent)
-> Value
-> Parser InputMessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe InputFile
photo_ <- Object
o Object -> Key -> Parser (Maybe InputFile)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"photo"
Maybe InputThumbnail
thumbnail_ <- Object
o Object -> Key -> Parser (Maybe InputThumbnail)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"thumbnail"
Maybe [Int]
added_sticker_file_ids_ <- Object
o Object -> Key -> Parser (Maybe [Int])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"added_sticker_file_ids"
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 FormattedText
caption_ <- Object
o Object -> Key -> Parser (Maybe FormattedText)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"caption"
Maybe Bool
show_caption_above_media_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"show_caption_above_media"
Maybe MessageSelfDestructType
self_destruct_type_ <- Object
o Object -> Key -> Parser (Maybe MessageSelfDestructType)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"self_destruct_type"
Maybe Bool
has_spoiler_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"has_spoiler"
InputMessageContent -> Parser InputMessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InputMessageContent -> Parser InputMessageContent)
-> InputMessageContent -> Parser InputMessageContent
forall a b. (a -> b) -> a -> b
$ InputMessagePhoto
{ photo :: Maybe InputFile
photo = Maybe InputFile
photo_
, thumbnail :: Maybe InputThumbnail
thumbnail = Maybe InputThumbnail
thumbnail_
, added_sticker_file_ids :: Maybe [Int]
added_sticker_file_ids = Maybe [Int]
added_sticker_file_ids_
, width :: Maybe Int
width = Maybe Int
width_
, height :: Maybe Int
height = Maybe Int
height_
, caption :: Maybe FormattedText
caption = Maybe FormattedText
caption_
, show_caption_above_media :: Maybe Bool
show_caption_above_media = Maybe Bool
show_caption_above_media_
, self_destruct_type :: Maybe MessageSelfDestructType
self_destruct_type = Maybe MessageSelfDestructType
self_destruct_type_
, has_spoiler :: Maybe Bool
has_spoiler = Maybe Bool
has_spoiler_
}
parseInputMessageSticker :: A.Value -> AT.Parser InputMessageContent
parseInputMessageSticker :: Value -> Parser InputMessageContent
parseInputMessageSticker = String
-> (Object -> Parser InputMessageContent)
-> Value
-> Parser InputMessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InputMessageSticker" ((Object -> Parser InputMessageContent)
-> Value -> Parser InputMessageContent)
-> (Object -> Parser InputMessageContent)
-> Value
-> Parser InputMessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe InputFile
sticker_ <- Object
o Object -> Key -> Parser (Maybe InputFile)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"sticker"
Maybe InputThumbnail
thumbnail_ <- Object
o Object -> Key -> Parser (Maybe InputThumbnail)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"thumbnail"
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 Text
emoji_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"emoji"
InputMessageContent -> Parser InputMessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InputMessageContent -> Parser InputMessageContent)
-> InputMessageContent -> Parser InputMessageContent
forall a b. (a -> b) -> a -> b
$ InputMessageSticker
{ sticker :: Maybe InputFile
sticker = Maybe InputFile
sticker_
, thumbnail :: Maybe InputThumbnail
thumbnail = Maybe InputThumbnail
thumbnail_
, width :: Maybe Int
width = Maybe Int
width_
, height :: Maybe Int
height = Maybe Int
height_
, emoji :: Maybe Text
emoji = Maybe Text
emoji_
}
parseInputMessageVideo :: A.Value -> AT.Parser InputMessageContent
parseInputMessageVideo :: Value -> Parser InputMessageContent
parseInputMessageVideo = String
-> (Object -> Parser InputMessageContent)
-> Value
-> Parser InputMessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InputMessageVideo" ((Object -> Parser InputMessageContent)
-> Value -> Parser InputMessageContent)
-> (Object -> Parser InputMessageContent)
-> Value
-> Parser InputMessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe InputFile
video_ <- Object
o Object -> Key -> Parser (Maybe InputFile)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"video"
Maybe InputThumbnail
thumbnail_ <- Object
o Object -> Key -> Parser (Maybe InputThumbnail)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"thumbnail"
Maybe [Int]
added_sticker_file_ids_ <- Object
o Object -> Key -> Parser (Maybe [Int])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"added_sticker_file_ids"
Maybe Int
duration_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"duration"
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 Bool
supports_streaming_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"supports_streaming"
Maybe FormattedText
caption_ <- Object
o Object -> Key -> Parser (Maybe FormattedText)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"caption"
Maybe Bool
show_caption_above_media_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"show_caption_above_media"
Maybe MessageSelfDestructType
self_destruct_type_ <- Object
o Object -> Key -> Parser (Maybe MessageSelfDestructType)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"self_destruct_type"
Maybe Bool
has_spoiler_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"has_spoiler"
InputMessageContent -> Parser InputMessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InputMessageContent -> Parser InputMessageContent)
-> InputMessageContent -> Parser InputMessageContent
forall a b. (a -> b) -> a -> b
$ InputMessageVideo
{ video :: Maybe InputFile
video = Maybe InputFile
video_
, thumbnail :: Maybe InputThumbnail
thumbnail = Maybe InputThumbnail
thumbnail_
, added_sticker_file_ids :: Maybe [Int]
added_sticker_file_ids = Maybe [Int]
added_sticker_file_ids_
, duration :: Maybe Int
duration = Maybe Int
duration_
, width :: Maybe Int
width = Maybe Int
width_
, height :: Maybe Int
height = Maybe Int
height_
, supports_streaming :: Maybe Bool
supports_streaming = Maybe Bool
supports_streaming_
, caption :: Maybe FormattedText
caption = Maybe FormattedText
caption_
, show_caption_above_media :: Maybe Bool
show_caption_above_media = Maybe Bool
show_caption_above_media_
, self_destruct_type :: Maybe MessageSelfDestructType
self_destruct_type = Maybe MessageSelfDestructType
self_destruct_type_
, has_spoiler :: Maybe Bool
has_spoiler = Maybe Bool
has_spoiler_
}
parseInputMessageVideoNote :: A.Value -> AT.Parser InputMessageContent
parseInputMessageVideoNote :: Value -> Parser InputMessageContent
parseInputMessageVideoNote = String
-> (Object -> Parser InputMessageContent)
-> Value
-> Parser InputMessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InputMessageVideoNote" ((Object -> Parser InputMessageContent)
-> Value -> Parser InputMessageContent)
-> (Object -> Parser InputMessageContent)
-> Value
-> Parser InputMessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe InputFile
video_note_ <- Object
o Object -> Key -> Parser (Maybe InputFile)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"video_note"
Maybe InputThumbnail
thumbnail_ <- Object
o Object -> Key -> Parser (Maybe InputThumbnail)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"thumbnail"
Maybe Int
duration_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"duration"
Maybe Int
_length_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"length"
Maybe MessageSelfDestructType
self_destruct_type_ <- Object
o Object -> Key -> Parser (Maybe MessageSelfDestructType)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"self_destruct_type"
InputMessageContent -> Parser InputMessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InputMessageContent -> Parser InputMessageContent)
-> InputMessageContent -> Parser InputMessageContent
forall a b. (a -> b) -> a -> b
$ InputMessageVideoNote
{ video_note :: Maybe InputFile
video_note = Maybe InputFile
video_note_
, thumbnail :: Maybe InputThumbnail
thumbnail = Maybe InputThumbnail
thumbnail_
, duration :: Maybe Int
duration = Maybe Int
duration_
, _length :: Maybe Int
_length = Maybe Int
_length_
, self_destruct_type :: Maybe MessageSelfDestructType
self_destruct_type = Maybe MessageSelfDestructType
self_destruct_type_
}
parseInputMessageVoiceNote :: A.Value -> AT.Parser InputMessageContent
parseInputMessageVoiceNote :: Value -> Parser InputMessageContent
parseInputMessageVoiceNote = String
-> (Object -> Parser InputMessageContent)
-> Value
-> Parser InputMessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InputMessageVoiceNote" ((Object -> Parser InputMessageContent)
-> Value -> Parser InputMessageContent)
-> (Object -> Parser InputMessageContent)
-> Value
-> Parser InputMessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe InputFile
voice_note_ <- Object
o Object -> Key -> Parser (Maybe InputFile)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"voice_note"
Maybe Int
duration_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"duration"
Maybe ByteString
waveform_ <- (String -> ByteString) -> Maybe String -> Maybe ByteString
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap String -> ByteString
I.readBytes (Maybe String -> Maybe ByteString)
-> Parser (Maybe String) -> Parser (Maybe ByteString)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
o Object -> Key -> Parser (Maybe String)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"waveform"
Maybe FormattedText
caption_ <- Object
o Object -> Key -> Parser (Maybe FormattedText)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"caption"
Maybe MessageSelfDestructType
self_destruct_type_ <- Object
o Object -> Key -> Parser (Maybe MessageSelfDestructType)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"self_destruct_type"
InputMessageContent -> Parser InputMessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InputMessageContent -> Parser InputMessageContent)
-> InputMessageContent -> Parser InputMessageContent
forall a b. (a -> b) -> a -> b
$ InputMessageVoiceNote
{ voice_note :: Maybe InputFile
voice_note = Maybe InputFile
voice_note_
, duration :: Maybe Int
duration = Maybe Int
duration_
, waveform :: Maybe ByteString
waveform = Maybe ByteString
waveform_
, caption :: Maybe FormattedText
caption = Maybe FormattedText
caption_
, self_destruct_type :: Maybe MessageSelfDestructType
self_destruct_type = Maybe MessageSelfDestructType
self_destruct_type_
}
parseInputMessageLocation :: A.Value -> AT.Parser InputMessageContent
parseInputMessageLocation :: Value -> Parser InputMessageContent
parseInputMessageLocation = String
-> (Object -> Parser InputMessageContent)
-> Value
-> Parser InputMessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InputMessageLocation" ((Object -> Parser InputMessageContent)
-> Value -> Parser InputMessageContent)
-> (Object -> Parser InputMessageContent)
-> Value
-> Parser InputMessageContent
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
live_period_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"live_period"
Maybe Int
heading_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"heading"
Maybe Int
proximity_alert_radius_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"proximity_alert_radius"
InputMessageContent -> Parser InputMessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InputMessageContent -> Parser InputMessageContent)
-> InputMessageContent -> Parser InputMessageContent
forall a b. (a -> b) -> a -> b
$ InputMessageLocation
{ location :: Maybe Location
location = Maybe Location
location_
, live_period :: Maybe Int
live_period = Maybe Int
live_period_
, heading :: Maybe Int
heading = Maybe Int
heading_
, proximity_alert_radius :: Maybe Int
proximity_alert_radius = Maybe Int
proximity_alert_radius_
}
parseInputMessageVenue :: A.Value -> AT.Parser InputMessageContent
parseInputMessageVenue :: Value -> Parser InputMessageContent
parseInputMessageVenue = String
-> (Object -> Parser InputMessageContent)
-> Value
-> Parser InputMessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InputMessageVenue" ((Object -> Parser InputMessageContent)
-> Value -> Parser InputMessageContent)
-> (Object -> Parser InputMessageContent)
-> Value
-> Parser InputMessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Venue
venue_ <- Object
o Object -> Key -> Parser (Maybe Venue)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"venue"
InputMessageContent -> Parser InputMessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InputMessageContent -> Parser InputMessageContent)
-> InputMessageContent -> Parser InputMessageContent
forall a b. (a -> b) -> a -> b
$ InputMessageVenue
{ venue :: Maybe Venue
venue = Maybe Venue
venue_
}
parseInputMessageContact :: A.Value -> AT.Parser InputMessageContent
parseInputMessageContact :: Value -> Parser InputMessageContent
parseInputMessageContact = String
-> (Object -> Parser InputMessageContent)
-> Value
-> Parser InputMessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InputMessageContact" ((Object -> Parser InputMessageContent)
-> Value -> Parser InputMessageContent)
-> (Object -> Parser InputMessageContent)
-> Value
-> Parser InputMessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Contact
contact_ <- Object
o Object -> Key -> Parser (Maybe Contact)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"contact"
InputMessageContent -> Parser InputMessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InputMessageContent -> Parser InputMessageContent)
-> InputMessageContent -> Parser InputMessageContent
forall a b. (a -> b) -> a -> b
$ InputMessageContact
{ contact :: Maybe Contact
contact = Maybe Contact
contact_
}
parseInputMessageDice :: A.Value -> AT.Parser InputMessageContent
parseInputMessageDice :: Value -> Parser InputMessageContent
parseInputMessageDice = String
-> (Object -> Parser InputMessageContent)
-> Value
-> Parser InputMessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InputMessageDice" ((Object -> Parser InputMessageContent)
-> Value -> Parser InputMessageContent)
-> (Object -> Parser InputMessageContent)
-> Value
-> Parser InputMessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Text
emoji_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"emoji"
Maybe Bool
clear_draft_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"clear_draft"
InputMessageContent -> Parser InputMessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InputMessageContent -> Parser InputMessageContent)
-> InputMessageContent -> Parser InputMessageContent
forall a b. (a -> b) -> a -> b
$ InputMessageDice
{ emoji :: Maybe Text
emoji = Maybe Text
emoji_
, clear_draft :: Maybe Bool
clear_draft = Maybe Bool
clear_draft_
}
parseInputMessageGame :: A.Value -> AT.Parser InputMessageContent
parseInputMessageGame :: Value -> Parser InputMessageContent
parseInputMessageGame = String
-> (Object -> Parser InputMessageContent)
-> Value
-> Parser InputMessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InputMessageGame" ((Object -> Parser InputMessageContent)
-> Value -> Parser InputMessageContent)
-> (Object -> Parser InputMessageContent)
-> Value
-> Parser InputMessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Int
bot_user_id_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"bot_user_id"
Maybe Text
game_short_name_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"game_short_name"
InputMessageContent -> Parser InputMessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InputMessageContent -> Parser InputMessageContent)
-> InputMessageContent -> Parser InputMessageContent
forall a b. (a -> b) -> a -> b
$ InputMessageGame
{ bot_user_id :: Maybe Int
bot_user_id = Maybe Int
bot_user_id_
, game_short_name :: Maybe Text
game_short_name = Maybe Text
game_short_name_
}
parseInputMessageInvoice :: A.Value -> AT.Parser InputMessageContent
parseInputMessageInvoice :: Value -> Parser InputMessageContent
parseInputMessageInvoice = String
-> (Object -> Parser InputMessageContent)
-> Value
-> Parser InputMessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InputMessageInvoice" ((Object -> Parser InputMessageContent)
-> Value -> Parser InputMessageContent)
-> (Object -> Parser InputMessageContent)
-> Value
-> Parser InputMessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Invoice
invoice_ <- Object
o Object -> Key -> Parser (Maybe Invoice)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"invoice"
Maybe Text
title_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"title"
Maybe Text
description_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"description"
Maybe Text
photo_url_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"photo_url"
Maybe Int
photo_size_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"photo_size"
Maybe Int
photo_width_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"photo_width"
Maybe Int
photo_height_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"photo_height"
Maybe ByteString
_payload_ <- (String -> ByteString) -> Maybe String -> Maybe ByteString
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap String -> ByteString
I.readBytes (Maybe String -> Maybe ByteString)
-> Parser (Maybe String) -> Parser (Maybe ByteString)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
o Object -> Key -> Parser (Maybe String)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"payload"
Maybe Text
provider_token_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"provider_token"
Maybe Text
provider_data_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"provider_data"
Maybe Text
start_parameter_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"start_parameter"
Maybe InputPaidMedia
_paid_media_ <- Object
o Object -> Key -> Parser (Maybe InputPaidMedia)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"paid_media"
Maybe FormattedText
paid_media_caption_ <- Object
o Object -> Key -> Parser (Maybe FormattedText)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"paid_media_caption"
InputMessageContent -> Parser InputMessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InputMessageContent -> Parser InputMessageContent)
-> InputMessageContent -> Parser InputMessageContent
forall a b. (a -> b) -> a -> b
$ InputMessageInvoice
{ invoice :: Maybe Invoice
invoice = Maybe Invoice
invoice_
, title :: Maybe Text
title = Maybe Text
title_
, description :: Maybe Text
description = Maybe Text
description_
, photo_url :: Maybe Text
photo_url = Maybe Text
photo_url_
, photo_size :: Maybe Int
photo_size = Maybe Int
photo_size_
, photo_width :: Maybe Int
photo_width = Maybe Int
photo_width_
, photo_height :: Maybe Int
photo_height = Maybe Int
photo_height_
, _payload :: Maybe ByteString
_payload = Maybe ByteString
_payload_
, provider_token :: Maybe Text
provider_token = Maybe Text
provider_token_
, provider_data :: Maybe Text
provider_data = Maybe Text
provider_data_
, start_parameter :: Maybe Text
start_parameter = Maybe Text
start_parameter_
, _paid_media :: Maybe InputPaidMedia
_paid_media = Maybe InputPaidMedia
_paid_media_
, paid_media_caption :: Maybe FormattedText
paid_media_caption = Maybe FormattedText
paid_media_caption_
}
parseInputMessagePoll :: A.Value -> AT.Parser InputMessageContent
parseInputMessagePoll :: Value -> Parser InputMessageContent
parseInputMessagePoll = String
-> (Object -> Parser InputMessageContent)
-> Value
-> Parser InputMessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InputMessagePoll" ((Object -> Parser InputMessageContent)
-> Value -> Parser InputMessageContent)
-> (Object -> Parser InputMessageContent)
-> Value
-> Parser InputMessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe FormattedText
question_ <- Object
o Object -> Key -> Parser (Maybe FormattedText)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"question"
Maybe [FormattedText]
options_ <- Object
o Object -> Key -> Parser (Maybe [FormattedText])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"options"
Maybe Bool
is_anonymous_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"is_anonymous"
Maybe PollType
_type_ <- Object
o Object -> Key -> Parser (Maybe PollType)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"type"
Maybe Int
open_period_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"open_period"
Maybe Int
close_date_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"close_date"
Maybe Bool
is_closed_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"is_closed"
InputMessageContent -> Parser InputMessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InputMessageContent -> Parser InputMessageContent)
-> InputMessageContent -> Parser InputMessageContent
forall a b. (a -> b) -> a -> b
$ InputMessagePoll
{ question :: Maybe FormattedText
question = Maybe FormattedText
question_
, options :: Maybe [FormattedText]
options = Maybe [FormattedText]
options_
, is_anonymous :: Maybe Bool
is_anonymous = Maybe Bool
is_anonymous_
, _type :: Maybe PollType
_type = Maybe PollType
_type_
, open_period :: Maybe Int
open_period = Maybe Int
open_period_
, close_date :: Maybe Int
close_date = Maybe Int
close_date_
, is_closed :: Maybe Bool
is_closed = Maybe Bool
is_closed_
}
parseInputMessageStory :: A.Value -> AT.Parser InputMessageContent
parseInputMessageStory :: Value -> Parser InputMessageContent
parseInputMessageStory = String
-> (Object -> Parser InputMessageContent)
-> Value
-> Parser InputMessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InputMessageStory" ((Object -> Parser InputMessageContent)
-> Value -> Parser InputMessageContent)
-> (Object -> Parser InputMessageContent)
-> Value
-> Parser InputMessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Int
story_sender_chat_id_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"story_sender_chat_id"
Maybe Int
story_id_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"story_id"
InputMessageContent -> Parser InputMessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InputMessageContent -> Parser InputMessageContent)
-> InputMessageContent -> Parser InputMessageContent
forall a b. (a -> b) -> a -> b
$ InputMessageStory
{ story_sender_chat_id :: Maybe Int
story_sender_chat_id = Maybe Int
story_sender_chat_id_
, story_id :: Maybe Int
story_id = Maybe Int
story_id_
}
parseInputMessageForwarded :: A.Value -> AT.Parser InputMessageContent
parseInputMessageForwarded :: Value -> Parser InputMessageContent
parseInputMessageForwarded = String
-> (Object -> Parser InputMessageContent)
-> Value
-> Parser InputMessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InputMessageForwarded" ((Object -> Parser InputMessageContent)
-> Value -> Parser InputMessageContent)
-> (Object -> Parser InputMessageContent)
-> Value
-> Parser InputMessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Int
from_chat_id_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"from_chat_id"
Maybe Int
message_id_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"message_id"
Maybe Bool
in_game_share_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"in_game_share"
Maybe MessageCopyOptions
copy_options_ <- Object
o Object -> Key -> Parser (Maybe MessageCopyOptions)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"copy_options"
InputMessageContent -> Parser InputMessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InputMessageContent -> Parser InputMessageContent)
-> InputMessageContent -> Parser InputMessageContent
forall a b. (a -> b) -> a -> b
$ InputMessageForwarded
{ from_chat_id :: Maybe Int
from_chat_id = Maybe Int
from_chat_id_
, message_id :: Maybe Int
message_id = Maybe Int
message_id_
, in_game_share :: Maybe Bool
in_game_share = Maybe Bool
in_game_share_
, copy_options :: Maybe MessageCopyOptions
copy_options = Maybe MessageCopyOptions
copy_options_
}
parseJSON Value
_ = Parser InputMessageContent
forall a. Monoid a => a
mempty
instance AT.ToJSON InputMessageContent where
toJSON :: InputMessageContent -> Value
toJSON InputMessageText
{ text :: InputMessageContent -> Maybe FormattedText
text = Maybe FormattedText
text_
, link_preview_options :: InputMessageContent -> Maybe LinkPreviewOptions
link_preview_options = Maybe LinkPreviewOptions
link_preview_options_
, clear_draft :: InputMessageContent -> Maybe Bool
clear_draft = Maybe Bool
clear_draft_
}
= [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
"inputMessageText"
, Key
"text" Key -> Maybe FormattedText -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe FormattedText
text_
, Key
"link_preview_options" Key -> Maybe LinkPreviewOptions -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe LinkPreviewOptions
link_preview_options_
, Key
"clear_draft" Key -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Bool
clear_draft_
]
toJSON InputMessageAnimation
{ animation :: InputMessageContent -> Maybe InputFile
animation = Maybe InputFile
animation_
, thumbnail :: InputMessageContent -> Maybe InputThumbnail
thumbnail = Maybe InputThumbnail
thumbnail_
, added_sticker_file_ids :: InputMessageContent -> Maybe [Int]
added_sticker_file_ids = Maybe [Int]
added_sticker_file_ids_
, duration :: InputMessageContent -> Maybe Int
duration = Maybe Int
duration_
, width :: InputMessageContent -> Maybe Int
width = Maybe Int
width_
, height :: InputMessageContent -> Maybe Int
height = Maybe Int
height_
, caption :: InputMessageContent -> Maybe FormattedText
caption = Maybe FormattedText
caption_
, show_caption_above_media :: InputMessageContent -> Maybe Bool
show_caption_above_media = Maybe Bool
show_caption_above_media_
, has_spoiler :: InputMessageContent -> 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
"inputMessageAnimation"
, Key
"animation" Key -> Maybe InputFile -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe InputFile
animation_
, Key
"thumbnail" Key -> Maybe InputThumbnail -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe InputThumbnail
thumbnail_
, Key
"added_sticker_file_ids" Key -> Maybe [Int] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe [Int]
added_sticker_file_ids_
, Key
"duration" Key -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Int
duration_
, 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 FormattedText -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe FormattedText
caption_
, Key
"show_caption_above_media" Key -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Bool
show_caption_above_media_
, 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 InputMessageAudio
{ audio :: InputMessageContent -> Maybe InputFile
audio = Maybe InputFile
audio_
, album_cover_thumbnail :: InputMessageContent -> Maybe InputThumbnail
album_cover_thumbnail = Maybe InputThumbnail
album_cover_thumbnail_
, duration :: InputMessageContent -> Maybe Int
duration = Maybe Int
duration_
, title :: InputMessageContent -> Maybe Text
title = Maybe Text
title_
, performer :: InputMessageContent -> Maybe Text
performer = Maybe Text
performer_
, caption :: InputMessageContent -> Maybe FormattedText
caption = Maybe FormattedText
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
"inputMessageAudio"
, Key
"audio" Key -> Maybe InputFile -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe InputFile
audio_
, Key
"album_cover_thumbnail" Key -> Maybe InputThumbnail -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe InputThumbnail
album_cover_thumbnail_
, Key
"duration" Key -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Int
duration_
, 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
"performer" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
performer_
, Key
"caption" Key -> Maybe FormattedText -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe FormattedText
caption_
]
toJSON InputMessageDocument
{ document :: InputMessageContent -> Maybe InputFile
document = Maybe InputFile
document_
, thumbnail :: InputMessageContent -> Maybe InputThumbnail
thumbnail = Maybe InputThumbnail
thumbnail_
, disable_content_type_detection :: InputMessageContent -> Maybe Bool
disable_content_type_detection = Maybe Bool
disable_content_type_detection_
, caption :: InputMessageContent -> Maybe FormattedText
caption = Maybe FormattedText
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
"inputMessageDocument"
, Key
"document" Key -> Maybe InputFile -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe InputFile
document_
, Key
"thumbnail" Key -> Maybe InputThumbnail -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe InputThumbnail
thumbnail_
, Key
"disable_content_type_detection" Key -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Bool
disable_content_type_detection_
, Key
"caption" Key -> Maybe FormattedText -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe FormattedText
caption_
]
toJSON InputMessagePaidMedia
{ star_count :: InputMessageContent -> Maybe Int
star_count = Maybe Int
star_count_
, paid_media :: InputMessageContent -> Maybe [InputPaidMedia]
paid_media = Maybe [InputPaidMedia]
paid_media_
, caption :: InputMessageContent -> Maybe FormattedText
caption = Maybe FormattedText
caption_
, show_caption_above_media :: InputMessageContent -> Maybe Bool
show_caption_above_media = Maybe Bool
show_caption_above_media_
, payload :: InputMessageContent -> Maybe Text
payload = Maybe Text
payload_
}
= [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
"inputMessagePaidMedia"
, Key
"star_count" Key -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Int
star_count_
, Key
"paid_media" Key -> Maybe [InputPaidMedia] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe [InputPaidMedia]
paid_media_
, Key
"caption" Key -> Maybe FormattedText -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe FormattedText
caption_
, Key
"show_caption_above_media" Key -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Bool
show_caption_above_media_
, Key
"payload" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
payload_
]
toJSON InputMessagePhoto
{ photo :: InputMessageContent -> Maybe InputFile
photo = Maybe InputFile
photo_
, thumbnail :: InputMessageContent -> Maybe InputThumbnail
thumbnail = Maybe InputThumbnail
thumbnail_
, added_sticker_file_ids :: InputMessageContent -> Maybe [Int]
added_sticker_file_ids = Maybe [Int]
added_sticker_file_ids_
, width :: InputMessageContent -> Maybe Int
width = Maybe Int
width_
, height :: InputMessageContent -> Maybe Int
height = Maybe Int
height_
, caption :: InputMessageContent -> Maybe FormattedText
caption = Maybe FormattedText
caption_
, show_caption_above_media :: InputMessageContent -> Maybe Bool
show_caption_above_media = Maybe Bool
show_caption_above_media_
, self_destruct_type :: InputMessageContent -> Maybe MessageSelfDestructType
self_destruct_type = Maybe MessageSelfDestructType
self_destruct_type_
, has_spoiler :: InputMessageContent -> 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
"inputMessagePhoto"
, Key
"photo" Key -> Maybe InputFile -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe InputFile
photo_
, Key
"thumbnail" Key -> Maybe InputThumbnail -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe InputThumbnail
thumbnail_
, Key
"added_sticker_file_ids" Key -> Maybe [Int] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe [Int]
added_sticker_file_ids_
, 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 FormattedText -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe FormattedText
caption_
, Key
"show_caption_above_media" Key -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Bool
show_caption_above_media_
, Key
"self_destruct_type" Key -> Maybe MessageSelfDestructType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe MessageSelfDestructType
self_destruct_type_
, 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 InputMessageSticker
{ sticker :: InputMessageContent -> Maybe InputFile
sticker = Maybe InputFile
sticker_
, thumbnail :: InputMessageContent -> Maybe InputThumbnail
thumbnail = Maybe InputThumbnail
thumbnail_
, width :: InputMessageContent -> Maybe Int
width = Maybe Int
width_
, height :: InputMessageContent -> Maybe Int
height = Maybe Int
height_
, emoji :: InputMessageContent -> Maybe Text
emoji = Maybe Text
emoji_
}
= [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
"inputMessageSticker"
, Key
"sticker" Key -> Maybe InputFile -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe InputFile
sticker_
, Key
"thumbnail" Key -> Maybe InputThumbnail -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe InputThumbnail
thumbnail_
, 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
"emoji" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
emoji_
]
toJSON InputMessageVideo
{ video :: InputMessageContent -> Maybe InputFile
video = Maybe InputFile
video_
, thumbnail :: InputMessageContent -> Maybe InputThumbnail
thumbnail = Maybe InputThumbnail
thumbnail_
, added_sticker_file_ids :: InputMessageContent -> Maybe [Int]
added_sticker_file_ids = Maybe [Int]
added_sticker_file_ids_
, duration :: InputMessageContent -> Maybe Int
duration = Maybe Int
duration_
, width :: InputMessageContent -> Maybe Int
width = Maybe Int
width_
, height :: InputMessageContent -> Maybe Int
height = Maybe Int
height_
, supports_streaming :: InputMessageContent -> Maybe Bool
supports_streaming = Maybe Bool
supports_streaming_
, caption :: InputMessageContent -> Maybe FormattedText
caption = Maybe FormattedText
caption_
, show_caption_above_media :: InputMessageContent -> Maybe Bool
show_caption_above_media = Maybe Bool
show_caption_above_media_
, self_destruct_type :: InputMessageContent -> Maybe MessageSelfDestructType
self_destruct_type = Maybe MessageSelfDestructType
self_destruct_type_
, has_spoiler :: InputMessageContent -> 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
"inputMessageVideo"
, Key
"video" Key -> Maybe InputFile -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe InputFile
video_
, Key
"thumbnail" Key -> Maybe InputThumbnail -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe InputThumbnail
thumbnail_
, Key
"added_sticker_file_ids" Key -> Maybe [Int] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe [Int]
added_sticker_file_ids_
, Key
"duration" Key -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Int
duration_
, 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
"supports_streaming" Key -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Bool
supports_streaming_
, Key
"caption" Key -> Maybe FormattedText -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe FormattedText
caption_
, Key
"show_caption_above_media" Key -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Bool
show_caption_above_media_
, Key
"self_destruct_type" Key -> Maybe MessageSelfDestructType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe MessageSelfDestructType
self_destruct_type_
, 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 InputMessageVideoNote
{ video_note :: InputMessageContent -> Maybe InputFile
video_note = Maybe InputFile
video_note_
, thumbnail :: InputMessageContent -> Maybe InputThumbnail
thumbnail = Maybe InputThumbnail
thumbnail_
, duration :: InputMessageContent -> Maybe Int
duration = Maybe Int
duration_
, _length :: InputMessageContent -> Maybe Int
_length = Maybe Int
_length_
, self_destruct_type :: InputMessageContent -> Maybe MessageSelfDestructType
self_destruct_type = Maybe MessageSelfDestructType
self_destruct_type_
}
= [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
"inputMessageVideoNote"
, Key
"video_note" Key -> Maybe InputFile -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe InputFile
video_note_
, Key
"thumbnail" Key -> Maybe InputThumbnail -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe InputThumbnail
thumbnail_
, Key
"duration" Key -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Int
duration_
, Key
"length" Key -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Int
_length_
, Key
"self_destruct_type" Key -> Maybe MessageSelfDestructType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe MessageSelfDestructType
self_destruct_type_
]
toJSON InputMessageVoiceNote
{ voice_note :: InputMessageContent -> Maybe InputFile
voice_note = Maybe InputFile
voice_note_
, duration :: InputMessageContent -> Maybe Int
duration = Maybe Int
duration_
, waveform :: InputMessageContent -> Maybe ByteString
waveform = Maybe ByteString
waveform_
, caption :: InputMessageContent -> Maybe FormattedText
caption = Maybe FormattedText
caption_
, self_destruct_type :: InputMessageContent -> Maybe MessageSelfDestructType
self_destruct_type = Maybe MessageSelfDestructType
self_destruct_type_
}
= [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
"inputMessageVoiceNote"
, Key
"voice_note" Key -> Maybe InputFile -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe InputFile
voice_note_
, Key
"duration" Key -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Int
duration_
, Key
"waveform" Key -> Maybe Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= (ByteString -> Value) -> Maybe ByteString -> Maybe Value
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ByteString -> Value
I.writeBytes Maybe ByteString
waveform_
, Key
"caption" Key -> Maybe FormattedText -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe FormattedText
caption_
, Key
"self_destruct_type" Key -> Maybe MessageSelfDestructType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe MessageSelfDestructType
self_destruct_type_
]
toJSON InputMessageLocation
{ location :: InputMessageContent -> Maybe Location
location = Maybe Location
location_
, live_period :: InputMessageContent -> Maybe Int
live_period = Maybe Int
live_period_
, heading :: InputMessageContent -> Maybe Int
heading = Maybe Int
heading_
, proximity_alert_radius :: InputMessageContent -> Maybe Int
proximity_alert_radius = Maybe Int
proximity_alert_radius_
}
= [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
"inputMessageLocation"
, 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
"live_period" Key -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Int
live_period_
, Key
"heading" Key -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Int
heading_
, Key
"proximity_alert_radius" Key -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Int
proximity_alert_radius_
]
toJSON InputMessageVenue
{ venue :: InputMessageContent -> Maybe Venue
venue = Maybe Venue
venue_
}
= [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
"inputMessageVenue"
, Key
"venue" Key -> Maybe Venue -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Venue
venue_
]
toJSON InputMessageContact
{ contact :: InputMessageContent -> Maybe Contact
contact = Maybe Contact
contact_
}
= [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
"inputMessageContact"
, Key
"contact" Key -> Maybe Contact -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Contact
contact_
]
toJSON InputMessageDice
{ emoji :: InputMessageContent -> Maybe Text
emoji = Maybe Text
emoji_
, clear_draft :: InputMessageContent -> Maybe Bool
clear_draft = Maybe Bool
clear_draft_
}
= [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
"inputMessageDice"
, Key
"emoji" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
emoji_
, Key
"clear_draft" Key -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Bool
clear_draft_
]
toJSON InputMessageGame
{ bot_user_id :: InputMessageContent -> Maybe Int
bot_user_id = Maybe Int
bot_user_id_
, game_short_name :: InputMessageContent -> Maybe Text
game_short_name = Maybe Text
game_short_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
"inputMessageGame"
, Key
"bot_user_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
bot_user_id_
, Key
"game_short_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
game_short_name_
]
toJSON InputMessageInvoice
{ invoice :: InputMessageContent -> Maybe Invoice
invoice = Maybe Invoice
invoice_
, title :: InputMessageContent -> Maybe Text
title = Maybe Text
title_
, description :: InputMessageContent -> Maybe Text
description = Maybe Text
description_
, photo_url :: InputMessageContent -> Maybe Text
photo_url = Maybe Text
photo_url_
, photo_size :: InputMessageContent -> Maybe Int
photo_size = Maybe Int
photo_size_
, photo_width :: InputMessageContent -> Maybe Int
photo_width = Maybe Int
photo_width_
, photo_height :: InputMessageContent -> Maybe Int
photo_height = Maybe Int
photo_height_
, _payload :: InputMessageContent -> Maybe ByteString
_payload = Maybe ByteString
_payload_
, provider_token :: InputMessageContent -> Maybe Text
provider_token = Maybe Text
provider_token_
, provider_data :: InputMessageContent -> Maybe Text
provider_data = Maybe Text
provider_data_
, start_parameter :: InputMessageContent -> Maybe Text
start_parameter = Maybe Text
start_parameter_
, _paid_media :: InputMessageContent -> Maybe InputPaidMedia
_paid_media = Maybe InputPaidMedia
_paid_media_
, paid_media_caption :: InputMessageContent -> Maybe FormattedText
paid_media_caption = Maybe FormattedText
paid_media_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
"inputMessageInvoice"
, Key
"invoice" Key -> Maybe Invoice -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Invoice
invoice_
, 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
"description" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
description_
, Key
"photo_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
photo_url_
, Key
"photo_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
photo_size_
, Key
"photo_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
photo_width_
, Key
"photo_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
photo_height_
, Key
"payload" Key -> Maybe Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= (ByteString -> Value) -> Maybe ByteString -> Maybe Value
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ByteString -> Value
I.writeBytes Maybe ByteString
_payload_
, Key
"provider_token" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
provider_token_
, Key
"provider_data" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
provider_data_
, Key
"start_parameter" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
start_parameter_
, Key
"paid_media" Key -> Maybe InputPaidMedia -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe InputPaidMedia
_paid_media_
, Key
"paid_media_caption" Key -> Maybe FormattedText -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe FormattedText
paid_media_caption_
]
toJSON InputMessagePoll
{ question :: InputMessageContent -> Maybe FormattedText
question = Maybe FormattedText
question_
, options :: InputMessageContent -> Maybe [FormattedText]
options = Maybe [FormattedText]
options_
, is_anonymous :: InputMessageContent -> Maybe Bool
is_anonymous = Maybe Bool
is_anonymous_
, _type :: InputMessageContent -> Maybe PollType
_type = Maybe PollType
_type_
, open_period :: InputMessageContent -> Maybe Int
open_period = Maybe Int
open_period_
, close_date :: InputMessageContent -> Maybe Int
close_date = Maybe Int
close_date_
, is_closed :: InputMessageContent -> Maybe Bool
is_closed = Maybe Bool
is_closed_
}
= [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
"inputMessagePoll"
, Key
"question" Key -> Maybe FormattedText -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe FormattedText
question_
, Key
"options" Key -> Maybe [FormattedText] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe [FormattedText]
options_
, Key
"is_anonymous" 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_anonymous_
, Key
"type" Key -> Maybe PollType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe PollType
_type_
, Key
"open_period" Key -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Int
open_period_
, Key
"close_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
close_date_
, Key
"is_closed" 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_closed_
]
toJSON InputMessageStory
{ story_sender_chat_id :: InputMessageContent -> Maybe Int
story_sender_chat_id = Maybe Int
story_sender_chat_id_
, story_id :: InputMessageContent -> Maybe Int
story_id = Maybe Int
story_id_
}
= [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
"inputMessageStory"
, Key
"story_sender_chat_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
story_sender_chat_id_
, Key
"story_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
story_id_
]
toJSON InputMessageForwarded
{ from_chat_id :: InputMessageContent -> Maybe Int
from_chat_id = Maybe Int
from_chat_id_
, message_id :: InputMessageContent -> Maybe Int
message_id = Maybe Int
message_id_
, in_game_share :: InputMessageContent -> Maybe Bool
in_game_share = Maybe Bool
in_game_share_
, copy_options :: InputMessageContent -> Maybe MessageCopyOptions
copy_options = Maybe MessageCopyOptions
copy_options_
}
= [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
"inputMessageForwarded"
, Key
"from_chat_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
from_chat_id_
, Key
"message_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
message_id_
, Key
"in_game_share" Key -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Bool
in_game_share_
, Key
"copy_options" Key -> Maybe MessageCopyOptions -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe MessageCopyOptions
copy_options_
]