{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE BlockArguments #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE MultiParamTypeClasses #-}
module Telegram.Bot.API.Types where

import Data.Aeson (ToJSON(..), FromJSON(..), Value(..), object, KeyValue ((.=)), withObject, (.:))
import Data.Aeson.Types (Parser, Pair, Object)
import Data.Aeson.Text (encodeToLazyText)
import Data.Coerce (coerce)
import Data.Bool (bool)
import Data.Maybe (catMaybes)
import Data.Functor ((<&>))
import Data.Hashable (Hashable)
import Data.String
import Data.Text (Text, pack)
import qualified Data.Text as Text
import qualified Data.Text.Lazy as TL
import Data.Time.Clock.POSIX (POSIXTime)
import GHC.Generics (Generic)
import Servant.API
import Servant.Multipart.API
import System.FilePath

import Telegram.Bot.API.Internal.Utils

type RequiredQueryParam = QueryParam' '[Required , Strict]

newtype Seconds = Seconds Int
  deriving (Seconds -> Seconds -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Seconds -> Seconds -> Bool
$c/= :: Seconds -> Seconds -> Bool
== :: Seconds -> Seconds -> Bool
$c== :: Seconds -> Seconds -> Bool
Eq, Int -> Seconds -> ShowS
[Seconds] -> ShowS
Seconds -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Seconds] -> ShowS
$cshowList :: [Seconds] -> ShowS
show :: Seconds -> String
$cshow :: Seconds -> String
showsPrec :: Int -> Seconds -> ShowS
$cshowsPrec :: Int -> Seconds -> ShowS
Show, Integer -> Seconds
Seconds -> Seconds
Seconds -> Seconds -> Seconds
forall a.
(a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a)
-> (a -> a)
-> (a -> a)
-> (Integer -> a)
-> Num a
fromInteger :: Integer -> Seconds
$cfromInteger :: Integer -> Seconds
signum :: Seconds -> Seconds
$csignum :: Seconds -> Seconds
abs :: Seconds -> Seconds
$cabs :: Seconds -> Seconds
negate :: Seconds -> Seconds
$cnegate :: Seconds -> Seconds
* :: Seconds -> Seconds -> Seconds
$c* :: Seconds -> Seconds -> Seconds
- :: Seconds -> Seconds -> Seconds
$c- :: Seconds -> Seconds -> Seconds
+ :: Seconds -> Seconds -> Seconds
$c+ :: Seconds -> Seconds -> Seconds
Num, [Seconds] -> Encoding
[Seconds] -> Value
Seconds -> Encoding
Seconds -> Value
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [Seconds] -> Encoding
$ctoEncodingList :: [Seconds] -> Encoding
toJSONList :: [Seconds] -> Value
$ctoJSONList :: [Seconds] -> Value
toEncoding :: Seconds -> Encoding
$ctoEncoding :: Seconds -> Encoding
toJSON :: Seconds -> Value
$ctoJSON :: Seconds -> Value
ToJSON, Value -> Parser [Seconds]
Value -> Parser Seconds
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [Seconds]
$cparseJSONList :: Value -> Parser [Seconds]
parseJSON :: Value -> Parser Seconds
$cparseJSON :: Value -> Parser Seconds
FromJSON)

-- * Available types

-- ** User

-- | This object represents a Telegram user or bot.
--
-- <https://core.telegram.org/bots/api#user>
data User = User
  { User -> UserId
userId           :: UserId     -- ^ Unique identifier for this user or bot.
  , User -> Bool
userIsBot        :: Bool       -- ^ 'True', if this user is a bot.
  , User -> Text
userFirstName    :: Text       -- ^ User's or bot's first name.
  , User -> Maybe Text
userLastName     :: Maybe Text -- ^ User‘s or bot’s last name.
  , User -> Maybe Text
userUsername     :: Maybe Text -- ^ User‘s or bot’s username.
  , User -> Maybe Text
userLanguageCode :: Maybe Text -- ^ IETF language tag of the user's language.
  , User -> Maybe Bool
userIsPremium    :: Maybe Bool -- ^ 'True', if this user is a Telegram Premium user.
  , User -> Maybe Bool
userAddedToAttachmentMenu :: Maybe Bool -- ^ 'True', if this user added the bot to the attachment menu.
  , User -> Maybe Bool
userCanJoinGroups :: Maybe Bool -- ^ 'True', if the bot can be invited to groups. Returned only in `getMe`.
  , User -> Maybe Bool
userCanReadAllGroupMessages :: Maybe Bool -- ^ 'True', if privacy mode is disabled for the bot. Returned only in `getMe`.
  , User -> Maybe Bool
userSupportsInlineQueries :: Maybe Bool -- ^ 'True', if the bot supports inline queries. Returned only in `getMe`.
  }
  deriving (Int -> User -> ShowS
[User] -> ShowS
User -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [User] -> ShowS
$cshowList :: [User] -> ShowS
show :: User -> String
$cshow :: User -> String
showsPrec :: Int -> User -> ShowS
$cshowsPrec :: Int -> User -> ShowS
Show, forall x. Rep User x -> User
forall x. User -> Rep User x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep User x -> User
$cfrom :: forall x. User -> Rep User x
Generic)

-- | Unique identifier for this user or bot.
newtype UserId = UserId Integer
  deriving (UserId -> UserId -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UserId -> UserId -> Bool
$c/= :: UserId -> UserId -> Bool
== :: UserId -> UserId -> Bool
$c== :: UserId -> UserId -> Bool
Eq, Int -> UserId -> ShowS
[UserId] -> ShowS
UserId -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UserId] -> ShowS
$cshowList :: [UserId] -> ShowS
show :: UserId -> String
$cshow :: UserId -> String
showsPrec :: Int -> UserId -> ShowS
$cshowsPrec :: Int -> UserId -> ShowS
Show, [UserId] -> Encoding
[UserId] -> Value
UserId -> Encoding
UserId -> Value
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [UserId] -> Encoding
$ctoEncodingList :: [UserId] -> Encoding
toJSONList :: [UserId] -> Value
$ctoJSONList :: [UserId] -> Value
toEncoding :: UserId -> Encoding
$ctoEncoding :: UserId -> Encoding
toJSON :: UserId -> Value
$ctoJSON :: UserId -> Value
ToJSON, Value -> Parser [UserId]
Value -> Parser UserId
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [UserId]
$cparseJSONList :: Value -> Parser [UserId]
parseJSON :: Value -> Parser UserId
$cparseJSON :: Value -> Parser UserId
FromJSON)

instance ToHttpApiData UserId where
  toUrlPiece :: UserId -> Text
toUrlPiece = String -> Text
pack forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Show a => a -> String
show @Integer forall b c a. (b -> c) -> (a -> b) -> a -> c
. coerce :: forall a b. Coercible a b => a -> b
coerce

-- ** Chat

-- | This object represents a chat.
--
-- <https://core.telegram.org/bots/api#chat>
data Chat = Chat
  { Chat -> ChatId
chatId               :: ChatId          -- ^ Unique identifier for this chat. This number may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier.
  , Chat -> ChatType
chatType             :: ChatType        -- ^ Type of chat.
  , Chat -> Maybe Text
chatTitle            :: Maybe Text      -- ^ Title, for supergroups, channels and group chats
  , Chat -> Maybe Text
chatUsername         :: Maybe Text      -- ^ Username, for private chats, supergroups and channels if available
  , Chat -> Maybe Text
chatFirstName        :: Maybe Text      -- ^ First name of the other party in a private chat
  , Chat -> Maybe Text
chatLastName         :: Maybe Text      -- ^ Last name of the other party in a private chat
  , Chat -> Maybe ChatPhoto
chatPhoto            :: Maybe ChatPhoto -- ^ Chat photo. Returned only in getChat.
  , Chat -> Maybe Text
chatBio              :: Maybe Text      -- ^ Bio of the other party in a private chat. Returned only in `getChat`.
  , Chat -> Maybe Bool
chatHasPrivateForwards :: Maybe Bool    -- ^ 'True', if privacy settings of the other party in the private chat allows to use `tg://user?id=<user_id>` links only in chats with the user. Returned only in getChat.
  , Chat -> Maybe Bool
chatHasRestrictedVoiceAndVideoMessages :: Maybe Bool -- ^ 'True', if the privacy settings of the other party restrict sending voice and video note messages in the private chat. Returned only in 'getChat'.
  , Chat -> Maybe Bool
chatJoinToSendMessages :: Maybe Bool    -- ^ 'True', if users need to join the supergroup before they can send messages. Returned only in 'getChat'.
  , Chat -> Maybe Bool
chatJoinByRequest    :: Maybe Bool      -- ^ 'True', if all users directly joining the supergroup need to be approved by supergroup administrators. Returned only in 'getChat'.
  , Chat -> Maybe Text
chatDescription      :: Maybe Text      -- ^ Description, for supergroups and channel chats. Returned only in getChat.
  , Chat -> Maybe Text
chatInviteLink       :: Maybe Text      -- ^ Chat invite link, for supergroups and channel chats. Returned only in getChat.
  , Chat -> Maybe Message
chatPinnedMessage    :: Maybe Message   -- ^ Pinned message, for supergroups. Returned only in getChat.
  , Chat -> Maybe ChatPermissions
chatPermissions      :: Maybe ChatPermissions -- ^ Default chat member permissions, for groups and supergroups.
  , Chat -> Maybe Int
chatSlowModeDelay    :: Maybe Int       -- ^ For supergroups, the minimum allowed delay between consecutive messages sent by each unpriviledged user; in seconds.
  , Chat -> Maybe POSIXTime
chatMessageAutoDeleteTime :: Maybe POSIXTime -- ^ The time after which all messages sent to the chat will be automatically deleted; in seconds.
  , Chat -> Maybe Bool
chatHasProtectedContent :: Maybe Bool   -- ^ 'True', if messages from the chat can't be forwarded to other chats.
  , Chat -> Maybe Text
chatStickerSetName   :: Maybe Text      -- ^ For supergroups, name of group sticker set. Returned only in getChat.
  , Chat -> Maybe Bool
chatCanSetStickerSet :: Maybe Bool      -- ^ True, if the bot can change the group sticker set. Returned only in `getChat`.
  , Chat -> Maybe ChatId
chatLinkedChatId     :: Maybe ChatId    -- ^ Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. This identifier may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier.
  , Chat -> Maybe ChatLocation
chatLocation         :: Maybe ChatLocation -- ^ For supergroups, the location to which the supergroup is connected. Returned only in getChat.
  }
  deriving (forall x. Rep Chat x -> Chat
forall x. Chat -> Rep Chat x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Chat x -> Chat
$cfrom :: forall x. Chat -> Rep Chat x
Generic, Int -> Chat -> ShowS
[Chat] -> ShowS
Chat -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Chat] -> ShowS
$cshowList :: [Chat] -> ShowS
show :: Chat -> String
$cshow :: Chat -> String
showsPrec :: Int -> Chat -> ShowS
$cshowsPrec :: Int -> Chat -> ShowS
Show)

-- | Unique identifier for this chat.
newtype ChatId = ChatId Integer
  deriving (ChatId -> ChatId -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ChatId -> ChatId -> Bool
$c/= :: ChatId -> ChatId -> Bool
== :: ChatId -> ChatId -> Bool
$c== :: ChatId -> ChatId -> Bool
Eq, Int -> ChatId -> ShowS
[ChatId] -> ShowS
ChatId -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ChatId] -> ShowS
$cshowList :: [ChatId] -> ShowS
show :: ChatId -> String
$cshow :: ChatId -> String
showsPrec :: Int -> ChatId -> ShowS
$cshowsPrec :: Int -> ChatId -> ShowS
Show, [ChatId] -> Encoding
[ChatId] -> Value
ChatId -> Encoding
ChatId -> Value
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [ChatId] -> Encoding
$ctoEncodingList :: [ChatId] -> Encoding
toJSONList :: [ChatId] -> Value
$ctoJSONList :: [ChatId] -> Value
toEncoding :: ChatId -> Encoding
$ctoEncoding :: ChatId -> Encoding
toJSON :: ChatId -> Value
$ctoJSON :: ChatId -> Value
ToJSON, Value -> Parser [ChatId]
Value -> Parser ChatId
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [ChatId]
$cparseJSONList :: Value -> Parser [ChatId]
parseJSON :: Value -> Parser ChatId
$cparseJSON :: Value -> Parser ChatId
FromJSON, Eq ChatId
Int -> ChatId -> Int
ChatId -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: ChatId -> Int
$chash :: ChatId -> Int
hashWithSalt :: Int -> ChatId -> Int
$chashWithSalt :: Int -> ChatId -> Int
Hashable)

instance ToHttpApiData ChatId where
  toUrlPiece :: ChatId -> Text
toUrlPiece ChatId
a = String -> Text
pack forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Show a => a -> String
show @Integer forall a b. (a -> b) -> a -> b
$ coerce :: forall a b. Coercible a b => a -> b
coerce ChatId
a

-- | Type of chat.
data ChatType
  = ChatTypePrivate
  | ChatTypeGroup
  | ChatTypeSupergroup
  | ChatTypeChannel
  deriving (forall x. Rep ChatType x -> ChatType
forall x. ChatType -> Rep ChatType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ChatType x -> ChatType
$cfrom :: forall x. ChatType -> Rep ChatType x
Generic, Int -> ChatType -> ShowS
[ChatType] -> ShowS
ChatType -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ChatType] -> ShowS
$cshowList :: [ChatType] -> ShowS
show :: ChatType -> String
$cshow :: ChatType -> String
showsPrec :: Int -> ChatType -> ShowS
$cshowsPrec :: Int -> ChatType -> ShowS
Show)

instance ToJSON   ChatType where
  toJSON :: ChatType -> Value
toJSON = forall a (d :: Meta) (f :: * -> *).
(Generic a, GToJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
a -> Value
gtoJSON
instance FromJSON ChatType where
  parseJSON :: Value -> Parser ChatType
parseJSON = forall a (d :: Meta) (f :: * -> *).
(Generic a, GFromJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
Value -> Parser a
gparseJSON

-- ** Message

-- | This object represents a message.
data Message = Message
  { Message -> MessageId
messageMessageId             :: MessageId -- ^ Unique message identifier inside this chat.
  , Message -> Maybe User
messageFrom                  :: Maybe User -- ^ Sender, empty for messages sent to channels.
  , Message -> Maybe Chat
messageSenderChat            :: Maybe Chat -- ^ Sender of the message, sent on behalf of a chat. For example, the channel itself for channel posts, the supergroup itself for messages from anonymous group administrators, the linked channel for messages automatically forwarded to the discussion group. For backward compatibility, the field from contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat.
  , Message -> POSIXTime
messageDate                  :: POSIXTime -- ^ Date the message was sent in Unix time.
  , Message -> Chat
messageChat                  :: Chat -- ^ Conversation the message belongs to.
  , Message -> Maybe User
messageForwardFrom           :: Maybe User -- ^ For forwarded messages, sender of the original message.
  , Message -> Maybe Chat
messageForwardFromChat       :: Maybe Chat -- ^ For messages forwarded from channels, information about the original channel.
  , Message -> Maybe MessageId
messageForwardFromMessageId  :: Maybe MessageId -- ^ For messages forwarded from channels, identifier of the original message in the channel.
  , Message -> Maybe Text
messageForwardSignature      :: Maybe Text -- ^ For messages forwarded from channels, signature of the post author if present.
  , Message -> Maybe Text
messageForwardSenderName     :: Maybe Text -- ^ Sender's name for messages forwarded from users who disallow adding a link to their account in forwarded messages.
  , Message -> Maybe POSIXTime
messageForwardDate           :: Maybe POSIXTime -- ^ For forwarded messages, date the original message was sent in Unix time
  , Message -> Maybe Bool
messageIsAutomaticForward    :: Maybe Bool -- ^ 'True', if the message is a channel post that was automatically forwarded to the connected discussion group.
  , Message -> Maybe Message
messageReplyToMessage        :: Maybe Message -- ^ For replies, the original message. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply.
  , Message -> Maybe User
messageViaBot                :: Maybe User -- ^ Bot through which the message was sent.
  , Message -> Maybe POSIXTime
messageEditDate              :: Maybe POSIXTime -- ^ Date the message was last edited in Unix time
  , Message -> Maybe Bool
messageHasProtectedContent   :: Maybe Bool -- ^ 'True', if the message can't be forwarded.
  , Message -> Maybe MediaGroupId
messageMediaGroupId          :: Maybe MediaGroupId -- ^ The unique identifier of a media message group this message belongs to
  , Message -> Maybe Text
messageAuthorSignature       :: Maybe Text -- ^ Signature of the post author for messages in channels
  , Message -> Maybe Text
messageText                  :: Maybe Text -- ^ For text messages, the actual UTF-8 text of the message, 0-4096 characters.
  , Message -> Maybe [MessageEntity]
messageEntities              :: Maybe [MessageEntity] -- ^ For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text
  , Message -> Maybe Animation
messageAnimation             :: Maybe Animation -- ^ Message is an animation, information about the animation. For backward compatibility, when this field is set, the document field will also be set.
  , Message -> Maybe Audio
messageAudio                 :: Maybe Audio -- ^ Message is an audio file, information about the file
  , Message -> Maybe Document
messageDocument              :: Maybe Document -- ^ Message is a general file, information about the file.
  , Message -> Maybe [PhotoSize]
messagePhoto                 :: Maybe [PhotoSize] -- ^ Message is a photo, available sizes of the photo
  , Message -> Maybe Sticker
messageSticker               :: Maybe Sticker -- ^ Message is a sticker, information about the sticker
  , Message -> Maybe Video
messageVideo                 :: Maybe Video -- ^ Message is a video, information about the video
  , Message -> Maybe VideoNote
messageVideoNote             :: Maybe VideoNote -- ^ Message is a video note, information about the video message
  , Message -> Maybe Voice
messageVoice                 :: Maybe Voice -- ^ Message is a voice message, information about the file
  , Message -> Maybe Text
messageCaption               :: Maybe Text -- ^ Caption for the audio, document, photo, video or voice, 0-200 characters
  , Message -> Maybe [MessageEntity]
messageCaptionEntities       :: Maybe [MessageEntity] -- ^ For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption
  , Message -> Maybe Contact
messageContact               :: Maybe Contact -- ^ Message is a shared contact, information about the contact
  , Message -> Maybe Dice
messageDice                  :: Maybe Dice -- ^ Message is a dice with random value.
  , Message -> Maybe Game
messageGame                  :: Maybe Game -- ^ Message is a game, information about the game. More about games »  , messageLocation              :: Maybe Location -- ^ Message is a shared location, information about the location
  , Message -> Maybe Poll
messagePoll                  :: Maybe Poll -- ^ Message is a native poll, information about the poll.
  , Message -> Maybe Venue
messageVenue                 :: Maybe Venue -- ^ Message is a venue, information about the venue
  , Message -> Maybe Location
messageLocation              :: Maybe Location -- ^ Message is a shared location, information about the location.
  , Message -> Maybe [User]
messageNewChatMembers        :: Maybe [User] -- ^ New members that were added to the group or supergroup and information about them (the bot itself may be one of these members)
  , Message -> Maybe User
messageLeftChatMember        :: Maybe User -- ^ A member was removed from the group, information about them (this member may be the bot itself)
  , Message -> Maybe Text
messageNewChatTitle          :: Maybe Text -- ^ A chat title was changed to this value
  , Message -> Maybe [PhotoSize]
messageNewChatPhoto          :: Maybe [PhotoSize] -- ^ A chat photo was change to this value
  , Message -> Maybe Bool
messageDeleteChatPhoto       :: Maybe Bool -- ^ Service message: the chat photo was deleted
  , Message -> Maybe Bool
messageGroupChatCreated      :: Maybe Bool -- ^ Service message: the group has been created
  , Message -> Maybe Bool
messageSupergroupChatCreated :: Maybe Bool -- ^ Service message: the supergroup has been created. This field can‘t be received in a message coming through updates, because bot can’t be a member of a supergroup when it is created. It can only be found in reply_to_message if someone replies to a very first message in a directly created supergroup.
  , Message -> Maybe Bool
messageChannelChatCreated    :: Maybe Bool -- ^ Service message: the channel has been created. This field can‘t be received in a message coming through updates, because bot can’t be a member of a channel when it is created. It can only be found in reply_to_message if someone replies to a very first message in a channel.
  , Message -> Maybe MessageAutoDeleteTimerChanged
messageAutoDeleteTimerChanged :: Maybe MessageAutoDeleteTimerChanged -- ^ Service message: auto-delete timer settings changed in the chat.
  , Message -> Maybe ChatId
messageMigrateToChatId       :: Maybe ChatId -- ^ The group has been migrated to a supergroup with the specified identifier. This number may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier.
  , Message -> Maybe ChatId
messageMigrateFromChatId     :: Maybe ChatId -- ^ The supergroup has been migrated from a group with the specified identifier. This number may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier.
  , Message -> Maybe Message
messagePinnedMessage         :: Maybe Message -- ^ Specified message was pinned. Note that the Message object in this field will not contain further reply_to_message fields even if it is itself a reply.
  , Message -> Maybe Invoice
messageInvoice               :: Maybe Invoice -- ^ Message is an invoice for a payment, information about the invoice.
  , Message -> Maybe SuccessfulPayment
messageSuccessfulPayment     :: Maybe SuccessfulPayment -- ^ Message is a service message about a successful payment, information about the payment.
  , Message -> Maybe Text
messageConnectedWebsite      :: Maybe Text -- ^ The domain name of the website on which the user has logged in.
  , Message -> Maybe PassportData
messagePassportData          :: Maybe PassportData -- ^ Telegram Passport data.
  , Message -> Maybe ProximityAlertTriggered
messageProximityAlertTriggered :: Maybe ProximityAlertTriggered -- ^ Service message. A user in the chat triggered another user's proximity alert while sharing Live Location.
  , Message -> Maybe VideoChatScheduled
messageVideoChatScheduled    :: Maybe VideoChatScheduled -- ^ Service message: video chat scheduled.
  , Message -> Maybe VideoChatStarted
messageVideoChatStarted      :: Maybe VideoChatStarted -- ^ Service message: video chat started
  , Message -> Maybe VideoChatEnded
messageVideoChatEnded        :: Maybe VideoChatEnded -- ^ Service message: video chat ended.
  , Message -> Maybe VideoChatParticipantsInvited
messageVideoChatParticipantsInvited :: Maybe VideoChatParticipantsInvited -- ^ Service message: new participants invited to a video chat.
  , Message -> Maybe WebAppData
messageWebAppData            :: Maybe WebAppData -- ^ Service message: data sent by a Web App.
  , Message -> Maybe InlineKeyboardMarkup
messageReplyMarkup           :: Maybe InlineKeyboardMarkup -- ^ Inline keyboard attached to the message. `login_url` buttons are represented as ordinary `url` buttons.
  }
  deriving (forall x. Rep Message x -> Message
forall x. Message -> Rep Message x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Message x -> Message
$cfrom :: forall x. Message -> Rep Message x
Generic, Int -> Message -> ShowS
[Message] -> ShowS
Message -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Message] -> ShowS
$cshowList :: [Message] -> ShowS
show :: Message -> String
$cshow :: Message -> String
showsPrec :: Int -> Message -> ShowS
$cshowsPrec :: Int -> Message -> ShowS
Show)

-- | Unique message identifier inside this chat.
newtype MessageId = MessageId Integer
  deriving (MessageId -> MessageId -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MessageId -> MessageId -> Bool
$c/= :: MessageId -> MessageId -> Bool
== :: MessageId -> MessageId -> Bool
$c== :: MessageId -> MessageId -> Bool
Eq, Int -> MessageId -> ShowS
[MessageId] -> ShowS
MessageId -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MessageId] -> ShowS
$cshowList :: [MessageId] -> ShowS
show :: MessageId -> String
$cshow :: MessageId -> String
showsPrec :: Int -> MessageId -> ShowS
$cshowsPrec :: Int -> MessageId -> ShowS
Show, [MessageId] -> Encoding
[MessageId] -> Value
MessageId -> Encoding
MessageId -> Value
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [MessageId] -> Encoding
$ctoEncodingList :: [MessageId] -> Encoding
toJSONList :: [MessageId] -> Value
$ctoJSONList :: [MessageId] -> Value
toEncoding :: MessageId -> Encoding
$ctoEncoding :: MessageId -> Encoding
toJSON :: MessageId -> Value
$ctoJSON :: MessageId -> Value
ToJSON, Value -> Parser [MessageId]
Value -> Parser MessageId
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [MessageId]
$cparseJSONList :: Value -> Parser [MessageId]
parseJSON :: Value -> Parser MessageId
$cparseJSON :: Value -> Parser MessageId
FromJSON, Eq MessageId
Int -> MessageId -> Int
MessageId -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: MessageId -> Int
$chash :: MessageId -> Int
hashWithSalt :: Int -> MessageId -> Int
$chashWithSalt :: Int -> MessageId -> Int
Hashable)

instance ToHttpApiData MessageId where
  toUrlPiece :: MessageId -> Text
toUrlPiece MessageId
a = String -> Text
pack forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Show a => a -> String
show @Integer forall a b. (a -> b) -> a -> b
$ coerce :: forall a b. Coercible a b => a -> b
coerce MessageId
a

-- | The unique identifier of a media message group a message belongs to.
newtype MediaGroupId = MediaGroupId Text
  deriving (MediaGroupId -> MediaGroupId -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MediaGroupId -> MediaGroupId -> Bool
$c/= :: MediaGroupId -> MediaGroupId -> Bool
== :: MediaGroupId -> MediaGroupId -> Bool
$c== :: MediaGroupId -> MediaGroupId -> Bool
Eq, Int -> MediaGroupId -> ShowS
[MediaGroupId] -> ShowS
MediaGroupId -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MediaGroupId] -> ShowS
$cshowList :: [MediaGroupId] -> ShowS
show :: MediaGroupId -> String
$cshow :: MediaGroupId -> String
showsPrec :: Int -> MediaGroupId -> ShowS
$cshowsPrec :: Int -> MediaGroupId -> ShowS
Show, [MediaGroupId] -> Encoding
[MediaGroupId] -> Value
MediaGroupId -> Encoding
MediaGroupId -> Value
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [MediaGroupId] -> Encoding
$ctoEncodingList :: [MediaGroupId] -> Encoding
toJSONList :: [MediaGroupId] -> Value
$ctoJSONList :: [MediaGroupId] -> Value
toEncoding :: MediaGroupId -> Encoding
$ctoEncoding :: MediaGroupId -> Encoding
toJSON :: MediaGroupId -> Value
$ctoJSON :: MediaGroupId -> Value
ToJSON, Value -> Parser [MediaGroupId]
Value -> Parser MediaGroupId
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [MediaGroupId]
$cparseJSONList :: Value -> Parser [MediaGroupId]
parseJSON :: Value -> Parser MediaGroupId
$cparseJSON :: Value -> Parser MediaGroupId
FromJSON)

-- ** MessageEntity

-- | This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc.
data MessageEntity = MessageEntity
  { MessageEntity -> MessageEntityType
messageEntityType   :: MessageEntityType -- ^ Type of the entity. Can be mention (@username), hashtag, bot_command, url, email, bold (bold text), italic (italic text), underline (underlined text), strikethrough, code (monowidth string), pre (monowidth block), text_link (for clickable text URLs), text_mention (for users without usernames)
  , MessageEntity -> Int
messageEntityOffset :: Int -- ^ Offset in UTF-16 code units to the start of the entity
  , MessageEntity -> Int
messageEntityLength :: Int -- ^ Length of the entity in UTF-16 code units
  , MessageEntity -> Maybe Text
messageEntityUrl    :: Maybe Text -- ^ For “text_link” only, url that will be opened after user taps on the text
  , MessageEntity -> Maybe User
messageEntityUser   :: Maybe User -- ^ For “text_mention” only, the mentioned user
  , MessageEntity -> Maybe Text
messageEntityLanguage :: Maybe Text -- ^ For “pre” only, the programming language of the entity text.
  , MessageEntity -> Maybe Text
messageEntityCustomEmojiId :: Maybe Text -- ^ For “custom_emoji” only, unique identifier of the custom emoji. Use @getCustomEmojiStickers@ to get full information about the sticker.
  }
  deriving (forall x. Rep MessageEntity x -> MessageEntity
forall x. MessageEntity -> Rep MessageEntity x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MessageEntity x -> MessageEntity
$cfrom :: forall x. MessageEntity -> Rep MessageEntity x
Generic, Int -> MessageEntity -> ShowS
[MessageEntity] -> ShowS
MessageEntity -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MessageEntity] -> ShowS
$cshowList :: [MessageEntity] -> ShowS
show :: MessageEntity -> String
$cshow :: MessageEntity -> String
showsPrec :: Int -> MessageEntity -> ShowS
$cshowsPrec :: Int -> MessageEntity -> ShowS
Show)

-- | Type of the entity. Can be mention (@username), hashtag, bot_command, url, email, bold (bold text), italic (italic text), underline (underlined text), strikethrough, code (monowidth string), pre (monowidth block), text_link (for clickable text URLs), text_mention (for users without usernames), cashtag, phone_number
data MessageEntityType
  = MessageEntityMention
  | MessageEntityHashtag
  | MessageEntityBotCommand
  | MessageEntityUrl
  | MessageEntityEmail
  | MessageEntityBold
  | MessageEntityItalic
  | MessageEntityUnderline -- ^ See <https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1text_entity_type_underline.html>
  | MessageEntityStrikethrough -- ^ See <https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1text_entity_type_strikethrough.html>
  | MessageEntityCode
  | MessageEntityPre
  | MessageEntityTextLink
  | MessageEntityTextMention
  | MessageEntityCashtag -- ^ See <https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1text_entity_type_cashtag.html>.
  | MessageEntityPhoneNumber -- ^ See <https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1text_entity_type_phone_number.html>.
  | MessageEntitySpoiler
  | MessageEntityCustomEmoji
  deriving (MessageEntityType -> MessageEntityType -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MessageEntityType -> MessageEntityType -> Bool
$c/= :: MessageEntityType -> MessageEntityType -> Bool
== :: MessageEntityType -> MessageEntityType -> Bool
$c== :: MessageEntityType -> MessageEntityType -> Bool
Eq, Int -> MessageEntityType -> ShowS
[MessageEntityType] -> ShowS
MessageEntityType -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MessageEntityType] -> ShowS
$cshowList :: [MessageEntityType] -> ShowS
show :: MessageEntityType -> String
$cshow :: MessageEntityType -> String
showsPrec :: Int -> MessageEntityType -> ShowS
$cshowsPrec :: Int -> MessageEntityType -> ShowS
Show, forall x. Rep MessageEntityType x -> MessageEntityType
forall x. MessageEntityType -> Rep MessageEntityType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MessageEntityType x -> MessageEntityType
$cfrom :: forall x. MessageEntityType -> Rep MessageEntityType x
Generic)

-- ** 'PhotoSize'

-- | This object represents one size of a photo or a file / sticker thumbnail.
data PhotoSize = PhotoSize
  { PhotoSize -> FileId
photoSizeFileId       :: FileId      -- ^ Unique identifier for this file.
  , PhotoSize -> FileId
photoSizeFileUniqueId :: FileId      -- ^ Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
  , PhotoSize -> Int
photoSizeWidth        :: Int       -- ^ Photo width
  , PhotoSize -> Int
photoSizeHeight       :: Int       -- ^ Photo height
  , PhotoSize -> Maybe Int
photoSizeFileSize     :: Maybe Int -- ^ File size
  }
  deriving (forall x. Rep PhotoSize x -> PhotoSize
forall x. PhotoSize -> Rep PhotoSize x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PhotoSize x -> PhotoSize
$cfrom :: forall x. PhotoSize -> Rep PhotoSize x
Generic, Int -> PhotoSize -> ShowS
[PhotoSize] -> ShowS
PhotoSize -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PhotoSize] -> ShowS
$cshowList :: [PhotoSize] -> ShowS
show :: PhotoSize -> String
$cshow :: PhotoSize -> String
showsPrec :: Int -> PhotoSize -> ShowS
$cshowsPrec :: Int -> PhotoSize -> ShowS
Show)

-- | Unique identifier for this file.
newtype FileId = FileId Text
  deriving (FileId -> FileId -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FileId -> FileId -> Bool
$c/= :: FileId -> FileId -> Bool
== :: FileId -> FileId -> Bool
$c== :: FileId -> FileId -> Bool
Eq, Int -> FileId -> ShowS
[FileId] -> ShowS
FileId -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FileId] -> ShowS
$cshowList :: [FileId] -> ShowS
show :: FileId -> String
$cshow :: FileId -> String
showsPrec :: Int -> FileId -> ShowS
$cshowsPrec :: Int -> FileId -> ShowS
Show, [FileId] -> Encoding
[FileId] -> Value
FileId -> Encoding
FileId -> Value
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [FileId] -> Encoding
$ctoEncodingList :: [FileId] -> Encoding
toJSONList :: [FileId] -> Value
$ctoJSONList :: [FileId] -> Value
toEncoding :: FileId -> Encoding
$ctoEncoding :: FileId -> Encoding
toJSON :: FileId -> Value
$ctoJSON :: FileId -> Value
ToJSON, Value -> Parser [FileId]
Value -> Parser FileId
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [FileId]
$cparseJSONList :: Value -> Parser [FileId]
parseJSON :: Value -> Parser FileId
$cparseJSON :: Value -> Parser FileId
FromJSON)

instance ToHttpApiData FileId where
  toUrlPiece :: FileId -> Text
toUrlPiece = coerce :: forall a b. Coercible a b => a -> b
coerce

-- ** 'Animation'

-- | This object represents an animation file (GIF or H.264/MPEG-4 AVC video without sound).
data Animation = Animation
  { Animation -> FileId
animationFileId       :: FileId          -- ^ Identifier for this file, which can be used to download or reuse the file.
  , Animation -> FileId
animationFileUniqueId :: FileId          -- ^ Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
  , Animation -> Int
animationWidth        :: Int           -- ^ Video width as defined by sender.
  , Animation -> Int
animationHeight       :: Int           -- ^ Video height as defined by sender.
  , Animation -> Seconds
animationDuration     :: Seconds         -- ^ Duration of the video in seconds as defined by sender.
  , Animation -> Maybe PhotoSize
animationThumb        :: Maybe PhotoSize -- ^ Animation thumbnail as defined by sender.
  , Animation -> Maybe Text
animationFileName     :: Maybe Text      -- ^ Original animation filename as defined by sender.
  , Animation -> Maybe Text
animationMimeType     :: Maybe Text      -- ^ MIME type of the file as defined by sender.
  , Animation -> Maybe Integer
animationFileSize     :: Maybe Integer   -- ^ File size in bytes.
  }
  deriving (forall x. Rep Animation x -> Animation
forall x. Animation -> Rep Animation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Animation x -> Animation
$cfrom :: forall x. Animation -> Rep Animation x
Generic, Int -> Animation -> ShowS
[Animation] -> ShowS
Animation -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Animation] -> ShowS
$cshowList :: [Animation] -> ShowS
show :: Animation -> String
$cshow :: Animation -> String
showsPrec :: Int -> Animation -> ShowS
$cshowsPrec :: Int -> Animation -> ShowS
Show)

-- ** 'Audio'

-- | This object represents an audio file to be treated as music by the Telegram clients.
data Audio = Audio
  { Audio -> FileId
audioFileId    :: FileId -- ^ Unique identifier for this file.
  , Audio -> FileId
audioFileUniqueId :: FileId -- ^ Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
  , Audio -> Seconds
audioDuration  :: Seconds -- ^ Duration of the audio in seconds as defined by sender.
  , Audio -> Maybe Text
audioPerformer :: Maybe Text -- ^ Performer of the audio as defined by sender or by audio tags.
  , Audio -> Maybe Text
audioTitle     :: Maybe Text -- ^ Title of the audio as defined by sender or by audio tags.
  , Audio -> Maybe Text
audioFileName  :: Maybe Text -- ^ Original filename as defined by sender.
  , Audio -> Maybe Text
audioMimeType  :: Maybe Text -- ^ MIME type of the file as defined by sender.
  , Audio -> Maybe Integer
audioFileSize  :: Maybe Integer -- ^ File size in bytes.
  , Audio -> Maybe PhotoSize
audioThumb     :: Maybe PhotoSize -- ^ Thumbnail of the album cover to which the music file belongs.
  }
  deriving (forall x. Rep Audio x -> Audio
forall x. Audio -> Rep Audio x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Audio x -> Audio
$cfrom :: forall x. Audio -> Rep Audio x
Generic, Int -> Audio -> ShowS
[Audio] -> ShowS
Audio -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Audio] -> ShowS
$cshowList :: [Audio] -> ShowS
show :: Audio -> String
$cshow :: Audio -> String
showsPrec :: Int -> Audio -> ShowS
$cshowsPrec :: Int -> Audio -> ShowS
Show)

-- ** 'Document'

-- | This object represents a general file (as opposed to photos, voice messages and audio files).
data Document = Document
  { Document -> FileId
documentFileId   :: FileId -- ^ Unique file identifier.
  , Document -> FileId
documentFileUniqueId :: FileId -- ^ Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
  , Document -> Maybe PhotoSize
documentThumb    :: Maybe PhotoSize -- ^ Document thumbnail as defined by sender.
  , Document -> Maybe Text
documentFileName :: Maybe Text -- ^ Original filename as defined by sender.
  , Document -> Maybe Text
documentMimeType :: Maybe Text -- ^ MIME type of the file as defined by sender.
  , Document -> Maybe Integer
documentFileSize :: Maybe Integer -- ^ File size in bytes. 
  }
  deriving (forall x. Rep Document x -> Document
forall x. Document -> Rep Document x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Document x -> Document
$cfrom :: forall x. Document -> Rep Document x
Generic, Int -> Document -> ShowS
[Document] -> ShowS
Document -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Document] -> ShowS
$cshowList :: [Document] -> ShowS
show :: Document -> String
$cshow :: Document -> String
showsPrec :: Int -> Document -> ShowS
$cshowsPrec :: Int -> Document -> ShowS
Show)

-- ** 'Video'

-- | This object represents a video file.
data Video = Video
  { Video -> FileId
videoFileId       :: FileId -- ^ Unique identifier for this file.
  , Video -> FileId
videoFileUniqueId :: FileId -- ^ Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
  , Video -> Int
videoWidth        :: Int -- ^ Video width as defined by sender.
  , Video -> Int
videoHeight       :: Int -- ^ Video height as defined by sender.
  , Video -> Seconds
videoDuration     :: Seconds -- ^ Duration of the video in seconds as defined by sender.
  , Video -> Maybe PhotoSize
videoThumb        :: Maybe PhotoSize -- ^ Video thumbnail.
  , Video -> Maybe Text
videoFileName     :: Maybe Text -- ^ Original filename as defined by sender.
  , Video -> Maybe Text
videoMimeType     :: Maybe Text -- ^ Mime type of a file as defined by sender.
  , Video -> Maybe Integer
videoFileSize     :: Maybe Integer -- ^ File size in bytes.
  }
  deriving (forall x. Rep Video x -> Video
forall x. Video -> Rep Video x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Video x -> Video
$cfrom :: forall x. Video -> Rep Video x
Generic, Int -> Video -> ShowS
[Video] -> ShowS
Video -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Video] -> ShowS
$cshowList :: [Video] -> ShowS
show :: Video -> String
$cshow :: Video -> String
showsPrec :: Int -> Video -> ShowS
$cshowsPrec :: Int -> Video -> ShowS
Show)

-- ** 'VideoNote'

-- | This object represents a video message (available in Telegram apps as of v.4.0).
data VideoNote = VideoNote
  { VideoNote -> FileId
videoNoteFileId   :: FileId -- ^ Unique identifier for this file.
  , VideoNote -> FileId
videoNoteFileUniqueId :: FileId -- ^ Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
  , VideoNote -> Int
videoNoteLength   :: Int -- ^ Video width and height as defined by sender.
  , VideoNote -> Seconds
videoNoteDuration :: Seconds -- ^ Duration of the video in seconds as defined by sender.
  , VideoNote -> Maybe PhotoSize
videoNoteThumb    :: Maybe PhotoSize -- ^ Video thumbnail.
  , VideoNote -> Maybe Integer
videoNoteFileSize :: Maybe Integer -- ^ File size in bytes.
  }
  deriving (forall x. Rep VideoNote x -> VideoNote
forall x. VideoNote -> Rep VideoNote x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep VideoNote x -> VideoNote
$cfrom :: forall x. VideoNote -> Rep VideoNote x
Generic, Int -> VideoNote -> ShowS
[VideoNote] -> ShowS
VideoNote -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VideoNote] -> ShowS
$cshowList :: [VideoNote] -> ShowS
show :: VideoNote -> String
$cshow :: VideoNote -> String
showsPrec :: Int -> VideoNote -> ShowS
$cshowsPrec :: Int -> VideoNote -> ShowS
Show)

-- ** 'Voice'

-- | This object represents a voice note.
data Voice = Voice
  { Voice -> FileId
voiceFileId   :: FileId -- ^ Unique identifier for this file.
  , Voice -> FileId
voiceFileUniqueId :: FileId -- ^ Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
  , Voice -> Seconds
voiceDuration :: Seconds -- ^ Duration of the audio in seconds as defined by sender.
  , Voice -> Maybe Text
voiceMimeType :: Maybe Text -- ^ MIME type of the file as defined by sender.
  , Voice -> Maybe Integer
voiceFileSize :: Maybe Integer -- ^ File size in bytes.
  }
  deriving (forall x. Rep Voice x -> Voice
forall x. Voice -> Rep Voice x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Voice x -> Voice
$cfrom :: forall x. Voice -> Rep Voice x
Generic, Int -> Voice -> ShowS
[Voice] -> ShowS
Voice -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Voice] -> ShowS
$cshowList :: [Voice] -> ShowS
show :: Voice -> String
$cshow :: Voice -> String
showsPrec :: Int -> Voice -> ShowS
$cshowsPrec :: Int -> Voice -> ShowS
Show)

-- ** 'Contact'

-- | This object represents a phone contact.
data Contact = Contact
  { Contact -> Text
contactPhoneNumber :: Text -- ^ Contact's phone number.
  , Contact -> Text
contactFirstName   :: Text -- ^ Contact's first name.
  , Contact -> Maybe Text
contactLastName    :: Maybe Text -- ^ Contact's last name.
  , Contact -> Maybe UserId
contactUserId      :: Maybe UserId -- ^ Contact's user identifier in Telegram.
  , Contact -> Maybe Text
contactVcard       :: Maybe Text -- ^ Additional data about the contact in the form of a vCard.
  }
  deriving (forall x. Rep Contact x -> Contact
forall x. Contact -> Rep Contact x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Contact x -> Contact
$cfrom :: forall x. Contact -> Rep Contact x
Generic, Int -> Contact -> ShowS
[Contact] -> ShowS
Contact -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Contact] -> ShowS
$cshowList :: [Contact] -> ShowS
show :: Contact -> String
$cshow :: Contact -> String
showsPrec :: Int -> Contact -> ShowS
$cshowsPrec :: Int -> Contact -> ShowS
Show)

-- ** 'Dice'

-- | This object represents an animated emoji that displays a random value.
data Dice = Dice
  { Dice -> Text
diceEmoji :: Text -- ^ Emoji on which the dice throw animation is based.
  , Dice -> Int
diceValue :: Int  -- ^ Value of the dice, 1-6 for “🎲”, “🎯” and “🎳” base emoji, 1-5 for “🏀” and “⚽” base emoji, 1-64 for “🎰” base emoji
  }
  deriving (forall x. Rep Dice x -> Dice
forall x. Dice -> Rep Dice x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Dice x -> Dice
$cfrom :: forall x. Dice -> Rep Dice x
Generic, Int -> Dice -> ShowS
[Dice] -> ShowS
Dice -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Dice] -> ShowS
$cshowList :: [Dice] -> ShowS
show :: Dice -> String
$cshow :: Dice -> String
showsPrec :: Int -> Dice -> ShowS
$cshowsPrec :: Int -> Dice -> ShowS
Show)

-- ** 'PollOption'

-- | This object contains information about one answer option in a poll.
data PollOption = PollOption
  { PollOption -> Text
pollOptionText       :: Text -- ^ Option text, 1-100 characters.
  , PollOption -> Int
pollOptionVoterCount :: Int  -- ^ Number of users that voted for this option.
  }
  deriving (forall x. Rep PollOption x -> PollOption
forall x. PollOption -> Rep PollOption x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PollOption x -> PollOption
$cfrom :: forall x. PollOption -> Rep PollOption x
Generic, Int -> PollOption -> ShowS
[PollOption] -> ShowS
PollOption -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PollOption] -> ShowS
$cshowList :: [PollOption] -> ShowS
show :: PollOption -> String
$cshow :: PollOption -> String
showsPrec :: Int -> PollOption -> ShowS
$cshowsPrec :: Int -> PollOption -> ShowS
Show)

-- ** 'PollAnswer'

-- | This object represents an answer of a user in a non-anonymous poll.
data PollAnswer = PollAnswer
  { PollAnswer -> PollId
pollAnswerPollId    :: PollId -- ^ Unique poll identifier.
  , PollAnswer -> User
pollAnswerUser      :: User   -- ^ The user, who changed the answer to the poll.
  , PollAnswer -> [Int]
pollAnswerOptionIds :: [Int]  -- ^ 0-based identifiers of answer options, chosen by the user. May be empty if the user retracted their vote.
  }
  deriving (forall x. Rep PollAnswer x -> PollAnswer
forall x. PollAnswer -> Rep PollAnswer x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PollAnswer x -> PollAnswer
$cfrom :: forall x. PollAnswer -> Rep PollAnswer x
Generic, Int -> PollAnswer -> ShowS
[PollAnswer] -> ShowS
PollAnswer -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PollAnswer] -> ShowS
$cshowList :: [PollAnswer] -> ShowS
show :: PollAnswer -> String
$cshow :: PollAnswer -> String
showsPrec :: Int -> PollAnswer -> ShowS
$cshowsPrec :: Int -> PollAnswer -> ShowS
Show)

-- | Unique poll identifier.
newtype PollId = PollId Text
  deriving (PollId -> PollId -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PollId -> PollId -> Bool
$c/= :: PollId -> PollId -> Bool
== :: PollId -> PollId -> Bool
$c== :: PollId -> PollId -> Bool
Eq, Int -> PollId -> ShowS
[PollId] -> ShowS
PollId -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PollId] -> ShowS
$cshowList :: [PollId] -> ShowS
show :: PollId -> String
$cshow :: PollId -> String
showsPrec :: Int -> PollId -> ShowS
$cshowsPrec :: Int -> PollId -> ShowS
Show, [PollId] -> Encoding
[PollId] -> Value
PollId -> Encoding
PollId -> Value
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [PollId] -> Encoding
$ctoEncodingList :: [PollId] -> Encoding
toJSONList :: [PollId] -> Value
$ctoJSONList :: [PollId] -> Value
toEncoding :: PollId -> Encoding
$ctoEncoding :: PollId -> Encoding
toJSON :: PollId -> Value
$ctoJSON :: PollId -> Value
ToJSON, Value -> Parser [PollId]
Value -> Parser PollId
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [PollId]
$cparseJSONList :: Value -> Parser [PollId]
parseJSON :: Value -> Parser PollId
$cparseJSON :: Value -> Parser PollId
FromJSON)

-- ** 'Poll'

data Poll = Poll
  { Poll -> PollId
pollId                    :: PollId                -- ^ Unique poll identifier.
  , Poll -> Text
pollQuestion              :: Text                  -- ^ Poll question, 1-300 characters.
  , Poll -> [PollOption]
pollOptions               :: [PollOption]          -- ^ List of poll options.
  , Poll -> Int
pollTotalVoterCount       :: Int                 -- ^ Total number of users that voted in the poll.
  , Poll -> Bool
pollIsClosed              :: Bool                  -- ^ 'True', if the poll is closed.
  , Poll -> Bool
pollIsAnonymous           :: Bool                  -- ^ 'True', if the poll is anonymous.
  , Poll -> PollType
pollType                  :: PollType              -- ^ Poll type, currently can be “regular” or “quiz”.
  , Poll -> Bool
pollAllowsMultipleAnswers :: Bool                  -- ^ 'True', if the poll allows multiple answers.
  , Poll -> Maybe Int
pollCorrectOptionId       :: Maybe Int             -- ^ 0-based identifier of the correct answer option. Available only for polls in the quiz mode, which are closed, or was sent (not forwarded) by the bot or to the private chat with the bot.
  , Poll -> Maybe Text
pollExplanation           :: Maybe Text            -- ^ Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters.
  , Poll -> Maybe [MessageEntity]
pollExplanationEntities   :: Maybe [MessageEntity] -- ^ Special entities like usernames, URLs, bot commands, etc. that appear in the explanation.
  , Poll -> Maybe Seconds
pollOpenPeriod            :: Maybe Seconds         -- ^ Amount of time in seconds the poll will be active after creation.
  , Poll -> Maybe POSIXTime
pollCloseData             :: Maybe POSIXTime       -- ^ Point in time (Unix timestamp) when the poll will be automatically closed.
  }
  deriving (forall x. Rep Poll x -> Poll
forall x. Poll -> Rep Poll x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Poll x -> Poll
$cfrom :: forall x. Poll -> Rep Poll x
Generic, Int -> Poll -> ShowS
[Poll] -> ShowS
Poll -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Poll] -> ShowS
$cshowList :: [Poll] -> ShowS
show :: Poll -> String
$cshow :: Poll -> String
showsPrec :: Int -> Poll -> ShowS
$cshowsPrec :: Int -> Poll -> ShowS
Show)

-- ** Location

-- | This object represents a point on the map.
data Location = Location
  { Location -> Float
locationLongitude            :: Float         -- ^ Longitude as defined by sender.
  , Location -> Float
locationLatitude             :: Float         -- ^ Latitude as defined by sender.
  , Location -> Maybe Float
locationHorizontalAccuracy   :: Maybe Float   -- ^ The radius of uncertainty for the location, measured in meters; 0-1500.
  , Location -> Maybe Seconds
locationLivePeriod           :: Maybe Seconds -- ^ Time relative to the message sending date, during which the location can be updated; in seconds. For active live locations only.
  , Location -> Maybe Int
locationHeading              :: Maybe Int     -- ^ The direction in which user is moving, in degrees; 1-360. For active live locations only.
  , Location -> Maybe Int
locationProximityAlertRadius :: Maybe Int     -- ^ Maximum distance for proximity alerts about approaching another chat member, in meters. For sent live locations only.
  }
  deriving (forall x. Rep Location x -> Location
forall x. Location -> Rep Location x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Location x -> Location
$cfrom :: forall x. Location -> Rep Location x
Generic, Int -> Location -> ShowS
[Location] -> ShowS
Location -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Location] -> ShowS
$cshowList :: [Location] -> ShowS
show :: Location -> String
$cshow :: Location -> String
showsPrec :: Int -> Location -> ShowS
$cshowsPrec :: Int -> Location -> ShowS
Show)

-- ** 'Venue'

-- | This object represents a venue.
data Venue = Venue
  { Venue -> Location
venueLocation        :: Location   -- ^ Venue location.
  , Venue -> Text
venueTitle           :: Text       -- ^ Name of the venue.
  , Venue -> Text
venueAddress         :: Text       -- ^ Address of the venue.
  , Venue -> Maybe Text
venueFoursquareId    :: Maybe Text -- ^ Foursquare identifier of the venue.
  , Venue -> Maybe Text
venueFoursquareType  :: Maybe Text -- ^ Foursquare type of the venue. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.)
  , Venue -> Maybe Text
venueGooglePlaceId   :: Maybe Text -- ^ Google Places identifier of the venue.
  , Venue -> Maybe Text
venueGooglePlaceType :: Maybe Text -- ^ Google Places type of the venue. (See supported types.)
  }
  deriving (forall x. Rep Venue x -> Venue
forall x. Venue -> Rep Venue x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Venue x -> Venue
$cfrom :: forall x. Venue -> Rep Venue x
Generic, Int -> Venue -> ShowS
[Venue] -> ShowS
Venue -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Venue] -> ShowS
$cshowList :: [Venue] -> ShowS
show :: Venue -> String
$cshow :: Venue -> String
showsPrec :: Int -> Venue -> ShowS
$cshowsPrec :: Int -> Venue -> ShowS
Show)

-- ** 'ProximityAlertTriggered'

-- | This object represents the content of a service message, sent whenever a user in the chat triggers a proximity alert set by another user.
data ProximityAlertTriggered = ProximityAlertTriggered
  { ProximityAlertTriggered -> User
proximityAlertTriggeredTraveler :: User  -- ^ User that triggered the alert.
  , ProximityAlertTriggered -> User
proximityAlertTriggeredWatcher  :: User  -- ^ User that set the alert.
  , ProximityAlertTriggered -> Int
proximityAlertTriggeredDistance :: Int -- ^ The distance between the users.
  }
  deriving (forall x. Rep ProximityAlertTriggered x -> ProximityAlertTriggered
forall x. ProximityAlertTriggered -> Rep ProximityAlertTriggered x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ProximityAlertTriggered x -> ProximityAlertTriggered
$cfrom :: forall x. ProximityAlertTriggered -> Rep ProximityAlertTriggered x
Generic, Int -> ProximityAlertTriggered -> ShowS
[ProximityAlertTriggered] -> ShowS
ProximityAlertTriggered -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ProximityAlertTriggered] -> ShowS
$cshowList :: [ProximityAlertTriggered] -> ShowS
show :: ProximityAlertTriggered -> String
$cshow :: ProximityAlertTriggered -> String
showsPrec :: Int -> ProximityAlertTriggered -> ShowS
$cshowsPrec :: Int -> ProximityAlertTriggered -> ShowS
Show)

-- ** 'MessageAutoDeleteTimerChanged'

-- | This object represents a service message about a change in auto-delete timer settings.
data MessageAutoDeleteTimerChanged = MessageAutoDeleteTimerChanged
  { MessageAutoDeleteTimerChanged -> Seconds
messageAutoDeleteTimerChangedMessageAutoDeleteTime :: Seconds -- ^ New auto-delete time for messages in the chat; in seconds
  }
  deriving (forall x.
Rep MessageAutoDeleteTimerChanged x
-> MessageAutoDeleteTimerChanged
forall x.
MessageAutoDeleteTimerChanged
-> Rep MessageAutoDeleteTimerChanged x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep MessageAutoDeleteTimerChanged x
-> MessageAutoDeleteTimerChanged
$cfrom :: forall x.
MessageAutoDeleteTimerChanged
-> Rep MessageAutoDeleteTimerChanged x
Generic, Int -> MessageAutoDeleteTimerChanged -> ShowS
[MessageAutoDeleteTimerChanged] -> ShowS
MessageAutoDeleteTimerChanged -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MessageAutoDeleteTimerChanged] -> ShowS
$cshowList :: [MessageAutoDeleteTimerChanged] -> ShowS
show :: MessageAutoDeleteTimerChanged -> String
$cshow :: MessageAutoDeleteTimerChanged -> String
showsPrec :: Int -> MessageAutoDeleteTimerChanged -> ShowS
$cshowsPrec :: Int -> MessageAutoDeleteTimerChanged -> ShowS
Show)

-- ** 'VideoChatScheduled'

-- | This object represents a service message about a video chat scheduled in the chat.
data VideoChatScheduled = VideoChatScheduled
  { VideoChatScheduled -> POSIXTime
videoChatScheduledStartDate :: POSIXTime -- ^ Point in time (Unix timestamp) when the video chat is supposed to be started by a chat administrator.
  }
  deriving (forall x. Rep VideoChatScheduled x -> VideoChatScheduled
forall x. VideoChatScheduled -> Rep VideoChatScheduled x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep VideoChatScheduled x -> VideoChatScheduled
$cfrom :: forall x. VideoChatScheduled -> Rep VideoChatScheduled x
Generic, Int -> VideoChatScheduled -> ShowS
[VideoChatScheduled] -> ShowS
VideoChatScheduled -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VideoChatScheduled] -> ShowS
$cshowList :: [VideoChatScheduled] -> ShowS
show :: VideoChatScheduled -> String
$cshow :: VideoChatScheduled -> String
showsPrec :: Int -> VideoChatScheduled -> ShowS
$cshowsPrec :: Int -> VideoChatScheduled -> ShowS
Show)

-- ** 'VideoChatStarted'

-- | This object represents a service message about a video chat started in the chat. Currently holds no information.
data VideoChatStarted = VideoChatStarted
  deriving (forall x. Rep VideoChatStarted x -> VideoChatStarted
forall x. VideoChatStarted -> Rep VideoChatStarted x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep VideoChatStarted x -> VideoChatStarted
$cfrom :: forall x. VideoChatStarted -> Rep VideoChatStarted x
Generic, Int -> VideoChatStarted -> ShowS
[VideoChatStarted] -> ShowS
VideoChatStarted -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VideoChatStarted] -> ShowS
$cshowList :: [VideoChatStarted] -> ShowS
show :: VideoChatStarted -> String
$cshow :: VideoChatStarted -> String
showsPrec :: Int -> VideoChatStarted -> ShowS
$cshowsPrec :: Int -> VideoChatStarted -> ShowS
Show)

-- ** 'VideoChatEnded'

-- | This object represents a service message about a video chat ended in the chat.
data VideoChatEnded = VideoChatEnded
  { VideoChatEnded -> Seconds
videoChatEndedDuration :: Seconds -- ^ Video chat duration in seconds.
  }
  deriving (forall x. Rep VideoChatEnded x -> VideoChatEnded
forall x. VideoChatEnded -> Rep VideoChatEnded x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep VideoChatEnded x -> VideoChatEnded
$cfrom :: forall x. VideoChatEnded -> Rep VideoChatEnded x
Generic, Int -> VideoChatEnded -> ShowS
[VideoChatEnded] -> ShowS
VideoChatEnded -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VideoChatEnded] -> ShowS
$cshowList :: [VideoChatEnded] -> ShowS
show :: VideoChatEnded -> String
$cshow :: VideoChatEnded -> String
showsPrec :: Int -> VideoChatEnded -> ShowS
$cshowsPrec :: Int -> VideoChatEnded -> ShowS
Show)

-- ** 'VideoChatParticipantsInvited'
data VideoChatParticipantsInvited = VideoChatParticipantsInvited
  { VideoChatParticipantsInvited -> Maybe [User]
videoChatParticipantsInvitedUsers :: Maybe [User] -- ^ New members that were invited to the video chat.
  }
  deriving (forall x.
Rep VideoChatParticipantsInvited x -> VideoChatParticipantsInvited
forall x.
VideoChatParticipantsInvited -> Rep VideoChatParticipantsInvited x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep VideoChatParticipantsInvited x -> VideoChatParticipantsInvited
$cfrom :: forall x.
VideoChatParticipantsInvited -> Rep VideoChatParticipantsInvited x
Generic, Int -> VideoChatParticipantsInvited -> ShowS
[VideoChatParticipantsInvited] -> ShowS
VideoChatParticipantsInvited -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VideoChatParticipantsInvited] -> ShowS
$cshowList :: [VideoChatParticipantsInvited] -> ShowS
show :: VideoChatParticipantsInvited -> String
$cshow :: VideoChatParticipantsInvited -> String
showsPrec :: Int -> VideoChatParticipantsInvited -> ShowS
$cshowsPrec :: Int -> VideoChatParticipantsInvited -> ShowS
Show)

-- ** 'UserProfilePhotos'

-- | This object represent a user's profile pictures.
data UserProfilePhotos = UserProfilePhotos
  { UserProfilePhotos -> Int
userProfilePhotosTotalCount :: Int -- ^ Total number of profile pictures the target user has
  , UserProfilePhotos -> [[PhotoSize]]
userProfilePhotosPhotos     :: [[PhotoSize]] -- ^ Requested profile pictures (in up to 4 sizes each)
  }
  deriving (forall x. Rep UserProfilePhotos x -> UserProfilePhotos
forall x. UserProfilePhotos -> Rep UserProfilePhotos x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UserProfilePhotos x -> UserProfilePhotos
$cfrom :: forall x. UserProfilePhotos -> Rep UserProfilePhotos x
Generic, Int -> UserProfilePhotos -> ShowS
[UserProfilePhotos] -> ShowS
UserProfilePhotos -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UserProfilePhotos] -> ShowS
$cshowList :: [UserProfilePhotos] -> ShowS
show :: UserProfilePhotos -> String
$cshow :: UserProfilePhotos -> String
showsPrec :: Int -> UserProfilePhotos -> ShowS
$cshowsPrec :: Int -> UserProfilePhotos -> ShowS
Show)

-- ** 'WebAppData'

data WebAppData = WebAppData
  { WebAppData -> Text
webAppDataData       :: Text -- ^ The data. Be aware that a bad client can send arbitrary data in this field.
  , WebAppData -> Text
webAppDataButtonText :: Text -- ^ Text of the @web_app@ keyboard button, from which the Web App was opened. Be aware that a bad client can send arbitrary data in this field.
  }
  deriving (forall x. Rep WebAppData x -> WebAppData
forall x. WebAppData -> Rep WebAppData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep WebAppData x -> WebAppData
$cfrom :: forall x. WebAppData -> Rep WebAppData x
Generic, Int -> WebAppData -> ShowS
[WebAppData] -> ShowS
WebAppData -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [WebAppData] -> ShowS
$cshowList :: [WebAppData] -> ShowS
show :: WebAppData -> String
$cshow :: WebAppData -> String
showsPrec :: Int -> WebAppData -> ShowS
$cshowsPrec :: Int -> WebAppData -> ShowS
Show)

-- ** 'File'

-- | This object represents a file ready to be downloaded.
-- The file can be downloaded via the link @https://api.telegram.org/file/bot<token>/<file_path>@.
-- It is guaranteed that the link will be valid for at least 1 hour.
-- When the link expires, a new one can be requested by calling getFile.
data File = File
  { File -> FileId
fileFileId       :: FileId      -- ^ Unique identifier for this file.
  , File -> FileId
fileFileUniqueId :: FileId      -- ^ Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
  , File -> Maybe Integer
fileFileSize     :: Maybe Integer -- ^ File size in bytes, if known.
  , File -> Maybe Text
fileFilePath     :: Maybe Text  -- ^ File path. Use https://api.telegram.org/file/bot<token>/<file_path> to get the file.
  }
  deriving (forall x. Rep File x -> File
forall x. File -> Rep File x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep File x -> File
$cfrom :: forall x. File -> Rep File x
Generic, Int -> File -> ShowS
[File] -> ShowS
File -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [File] -> ShowS
$cshowList :: [File] -> ShowS
show :: File -> String
$cshow :: File -> String
showsPrec :: Int -> File -> ShowS
$cshowsPrec :: Int -> File -> ShowS
Show)

type ContentType = Text

data InputFile
  = InputFileId FileId
  | FileUrl Text
  | InputFile FilePath ContentType

instance ToJSON InputFile where
  toJSON :: InputFile -> Value
toJSON (InputFileId FileId
i) = forall a. ToJSON a => a -> Value
toJSON FileId
i
  toJSON (FileUrl Text
t) = forall a. ToJSON a => a -> Value
toJSON Text
t
  toJSON (InputFile String
f Text
_) = forall a. ToJSON a => a -> Value
toJSON (Text
"attach://" forall a. Semigroup a => a -> a -> a
<> String -> Text
pack (ShowS
takeFileName String
f))

-- ** 'ReplyKeyboardMarkup'

-- | This object represents a custom keyboard with reply options (see Introduction to bots for details and examples).
data ReplyKeyboardMarkup = ReplyKeyboardMarkup
  { ReplyKeyboardMarkup -> [[KeyboardButton]]
replyKeyboardMarkupKeyboard           :: [[KeyboardButton]] -- ^ Array of button rows, each represented by an Array of KeyboardButton objects
  , ReplyKeyboardMarkup -> Maybe Bool
replyKeyboardMarkupResizeKeyboard     :: Maybe Bool         -- ^ Requests clients to resize the keyboard vertically for optimal fit (e.g., make the keyboard smaller if there are just two rows of buttons). Defaults to false, in which case the custom keyboard is always of the same height as the app's standard keyboard.
  , ReplyKeyboardMarkup -> Maybe Bool
replyKeyboardMarkupOneTimeKeyboard    :: Maybe Bool         -- ^ Requests clients to hide the keyboard as soon as it's been used. The keyboard will still be available, but clients will automatically display the usual letter-keyboard in the chat – the user can press a special button in the input field to see the custom keyboard again. Defaults to false.
  , ReplyKeyboardMarkup -> Maybe Text
replyKeyboardMarkupInputFieldSelector :: Maybe Text         -- ^ The placeholder to be shown in the input field when the keyboard is active; 1-64 characters.
  , ReplyKeyboardMarkup -> Maybe Bool
replyKeyboardMarkupSelective          :: Maybe Bool         -- ^ Use this parameter if you want to show the keyboard to specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message.
    --
    -- Example: A user requests to change the bot's language, bot replies to the request with a keyboard to select the new language. Other users in the group don't see the keyboard.
  }
  deriving (forall x. Rep ReplyKeyboardMarkup x -> ReplyKeyboardMarkup
forall x. ReplyKeyboardMarkup -> Rep ReplyKeyboardMarkup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ReplyKeyboardMarkup x -> ReplyKeyboardMarkup
$cfrom :: forall x. ReplyKeyboardMarkup -> Rep ReplyKeyboardMarkup x
Generic, Int -> ReplyKeyboardMarkup -> ShowS
[ReplyKeyboardMarkup] -> ShowS
ReplyKeyboardMarkup -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ReplyKeyboardMarkup] -> ShowS
$cshowList :: [ReplyKeyboardMarkup] -> ShowS
show :: ReplyKeyboardMarkup -> String
$cshow :: ReplyKeyboardMarkup -> String
showsPrec :: Int -> ReplyKeyboardMarkup -> ShowS
$cshowsPrec :: Int -> ReplyKeyboardMarkup -> ShowS
Show)

-- ** 'KeyboardButton'

newtype WebAppInfo = WebAppInfo { WebAppInfo -> Text
webAppInfoUrl :: Text }
  deriving (forall x. Rep WebAppInfo x -> WebAppInfo
forall x. WebAppInfo -> Rep WebAppInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep WebAppInfo x -> WebAppInfo
$cfrom :: forall x. WebAppInfo -> Rep WebAppInfo x
Generic, Int -> WebAppInfo -> ShowS
[WebAppInfo] -> ShowS
WebAppInfo -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [WebAppInfo] -> ShowS
$cshowList :: [WebAppInfo] -> ShowS
show :: WebAppInfo -> String
$cshow :: WebAppInfo -> String
showsPrec :: Int -> WebAppInfo -> ShowS
$cshowsPrec :: Int -> WebAppInfo -> ShowS
Show)

-- | This object represents one button of the reply keyboard.
-- For simple text buttons String can be used instead of this object
-- to specify text of the button. Optional fields are mutually exclusive.
data KeyboardButton = KeyboardButton
  { KeyboardButton -> Text
keyboardButtonText            :: Text       -- ^ Text of the button. If none of the optional fields are used, it will be sent as a message when the button is pressed.
  , KeyboardButton -> Maybe Bool
keyboardButtonRequestContact  :: Maybe Bool -- ^ If 'True', the user's phone number will be sent as a contact when the button is pressed. Available in private chats only.
  , KeyboardButton -> Maybe Bool
keyboardButtonRequestLocation :: Maybe Bool -- ^ If 'True', the user's current location will be sent when the button is pressed. Available in private chats only.
  , KeyboardButton -> Maybe PollType
keyboardButtonRequestPoll     :: Maybe PollType -- ^ If specified, the user will be asked to create a poll and send it to the bot when the button is pressed. Available in private chats only.
  , KeyboardButton -> Maybe WebAppInfo
keyboardButtonWebApp          :: Maybe WebAppInfo -- ^ If specified, the described Web App will be launched when the button is pressed. The Web App will be able to send a “web_app_data” service message. Available in private chats only.
  }
  deriving (forall x. Rep KeyboardButton x -> KeyboardButton
forall x. KeyboardButton -> Rep KeyboardButton x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep KeyboardButton x -> KeyboardButton
$cfrom :: forall x. KeyboardButton -> Rep KeyboardButton x
Generic, Int -> KeyboardButton -> ShowS
[KeyboardButton] -> ShowS
KeyboardButton -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [KeyboardButton] -> ShowS
$cshowList :: [KeyboardButton] -> ShowS
show :: KeyboardButton -> String
$cshow :: KeyboardButton -> String
showsPrec :: Int -> KeyboardButton -> ShowS
$cshowsPrec :: Int -> KeyboardButton -> ShowS
Show)

instance IsString KeyboardButton where
  fromString :: String -> KeyboardButton
fromString String
s = Text
-> Maybe Bool
-> Maybe Bool
-> Maybe PollType
-> Maybe WebAppInfo
-> KeyboardButton
KeyboardButton (forall a. IsString a => String -> a
fromString String
s) forall a. Maybe a
Nothing forall a. Maybe a
Nothing forall a. Maybe a
Nothing forall a. Maybe a
Nothing

-- ** 'MenuButton'

-- | This object describes the bot's menu button in a private chat.
-- If a menu button other than @MenuButtonDefault@ is set for a private chat, then it is applied in the chat. Otherwise the default menu button is applied. By default, the menu button opens the list of bot commands.
data MenuButton
  = MenuButtonCommands -- ^ Represents a menu button, which opens the bot's list of commands.
  | MenuButtonWebApp -- ^ Represents a menu button, which launches a Web App.
      { MenuButton -> Text
menuButtonWebAppText :: Text
      , MenuButton -> WebAppInfo
menuButtonWebAppWebApp :: WebAppInfo
      } 
  | MenuButtonDefault -- ^ Describes that no specific value for the menu button was set.
  deriving forall x. Rep MenuButton x -> MenuButton
forall x. MenuButton -> Rep MenuButton x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MenuButton x -> MenuButton
$cfrom :: forall x. MenuButton -> Rep MenuButton x
Generic

-- ** 'PollType'

data PollType =
  PollTypeQuiz | PollTypeRegular
  deriving (forall x. Rep PollType x -> PollType
forall x. PollType -> Rep PollType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PollType x -> PollType
$cfrom :: forall x. PollType -> Rep PollType x
Generic, Int -> PollType -> ShowS
[PollType] -> ShowS
PollType -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PollType] -> ShowS
$cshowList :: [PollType] -> ShowS
show :: PollType -> String
$cshow :: PollType -> String
showsPrec :: Int -> PollType -> ShowS
$cshowsPrec :: Int -> PollType -> ShowS
Show)

getPollType :: PollType -> Text
getPollType :: PollType -> Text
getPollType PollType
PollTypeQuiz = Text
"quiz"
getPollType PollType
PollTypeRegular = Text
"regular"

instance ToJSON PollType where
  toJSON :: PollType -> Value
toJSON = Text -> Value
String forall b c a. (b -> c) -> (a -> b) -> a -> c
. PollType -> Text
getPollType

instance FromJSON PollType where parseJSON :: Value -> Parser PollType
parseJSON = forall a (d :: Meta) (f :: * -> *).
(Generic a, GFromJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
Value -> Parser a
gparseJSON

-- ** 'ReplyKeyboardRemove'

-- | Upon receiving a message with this object,
-- Telegram clients will remove the current custom keyboard
-- and display the default letter-keyboard.
--
-- By default, custom keyboards are displayed until a new keyboard is sent by a bot.
-- An exception is made for one-time keyboards that are hidden immediately after
-- the user presses a button (see 'ReplyKeyboardMarkup').
data ReplyKeyboardRemove = ReplyKeyboardRemove
  { ReplyKeyboardRemove -> Bool
replyKeyboardRemoveRemoveKeyboard :: Bool -- ^ Requests clients to remove the custom keyboard (user will not be able to summon this keyboard; if you want to hide the keyboard from sight but keep it accessible, use one_time_keyboard in ReplyKeyboardMarkup)
  , ReplyKeyboardRemove -> Maybe Bool
replyKeyboardRemoveSelective      :: Maybe Bool -- ^ Use this parameter if you want to remove the keyboard for specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message.
  --
  -- Example: A user votes in a poll, bot returns confirmation message in reply to the vote and removes the keyboard for that user, while still showing the keyboard with poll options to users who haven't voted yet.
  }
  deriving (forall x. Rep ReplyKeyboardRemove x -> ReplyKeyboardRemove
forall x. ReplyKeyboardRemove -> Rep ReplyKeyboardRemove x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ReplyKeyboardRemove x -> ReplyKeyboardRemove
$cfrom :: forall x. ReplyKeyboardRemove -> Rep ReplyKeyboardRemove x
Generic, Int -> ReplyKeyboardRemove -> ShowS
[ReplyKeyboardRemove] -> ShowS
ReplyKeyboardRemove -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ReplyKeyboardRemove] -> ShowS
$cshowList :: [ReplyKeyboardRemove] -> ShowS
show :: ReplyKeyboardRemove -> String
$cshow :: ReplyKeyboardRemove -> String
showsPrec :: Int -> ReplyKeyboardRemove -> ShowS
$cshowsPrec :: Int -> ReplyKeyboardRemove -> ShowS
Show)

-- ** 'InlineKeyboardMarkup'

-- | This object represents an inline keyboard that appears
-- right next to the message it belongs to.
data InlineKeyboardMarkup = InlineKeyboardMarkup
  { InlineKeyboardMarkup -> [[InlineKeyboardButton]]
inlineKeyboardMarkupInlineKeyboard :: [[InlineKeyboardButton]] -- ^ Array of button rows, each represented by an Array of InlineKeyboardButton objects
  }
  deriving (forall x. Rep InlineKeyboardMarkup x -> InlineKeyboardMarkup
forall x. InlineKeyboardMarkup -> Rep InlineKeyboardMarkup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InlineKeyboardMarkup x -> InlineKeyboardMarkup
$cfrom :: forall x. InlineKeyboardMarkup -> Rep InlineKeyboardMarkup x
Generic, Int -> InlineKeyboardMarkup -> ShowS
[InlineKeyboardMarkup] -> ShowS
InlineKeyboardMarkup -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InlineKeyboardMarkup] -> ShowS
$cshowList :: [InlineKeyboardMarkup] -> ShowS
show :: InlineKeyboardMarkup -> String
$cshow :: InlineKeyboardMarkup -> String
showsPrec :: Int -> InlineKeyboardMarkup -> ShowS
$cshowsPrec :: Int -> InlineKeyboardMarkup -> ShowS
Show)
-- ^ 
-- **Note**: This will only work in Telegram versions released after 9 April, 2016. Older clients will display unsupported message.

-- ** 'InlineKeyboardButton'

-- | This object represents one button of an inline keyboard. You must use exactly one of the optional fields.
data InlineKeyboardButton = InlineKeyboardButton
  { InlineKeyboardButton -> Text
inlineKeyboardButtonText              :: Text -- ^ Label text on the button
  , InlineKeyboardButton -> Maybe Text
inlineKeyboardButtonUrl               :: Maybe Text -- ^ HTTP url to be opened when button is pressed
  , InlineKeyboardButton -> Maybe Text
inlineKeyboardButtonCallbackData      :: Maybe Text -- ^ Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes
  , InlineKeyboardButton -> Maybe WebAppInfo
inlineKeyboardButtonWebApp            :: Maybe WebAppInfo -- ^ Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method @answerWebAppQuery@. Available only in private chats between a user and the bot.
  , InlineKeyboardButton -> Maybe Text
inlineKeyboardButtonSwitchInlineQuery :: Maybe Text -- ^ If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot‘s username and the specified inline query in the input field. Can be empty, in which case just the bot’s username will be inserted.
  , InlineKeyboardButton -> Maybe Text
inlineKeyboardButtonSwitchInlineQueryCurrentChat :: Maybe Text -- ^ If set, pressing the button will insert the bot‘s username and the specified inline query in the current chat's input field. Can be empty, in which case only the bot’s username will be inserted.

  , InlineKeyboardButton -> Maybe CallbackGame
inlineKeyboardButtonCallbackGame      :: Maybe CallbackGame -- ^ Description of the game that will be launched when the user presses the button.
  , InlineKeyboardButton -> Maybe Bool
inlineKeyboardButtonPay               :: Maybe Bool -- ^ Specify True, to send a Pay button.
  }
  deriving (forall x. Rep InlineKeyboardButton x -> InlineKeyboardButton
forall x. InlineKeyboardButton -> Rep InlineKeyboardButton x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InlineKeyboardButton x -> InlineKeyboardButton
$cfrom :: forall x. InlineKeyboardButton -> Rep InlineKeyboardButton x
Generic, Int -> InlineKeyboardButton -> ShowS
[InlineKeyboardButton] -> ShowS
InlineKeyboardButton -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InlineKeyboardButton] -> ShowS
$cshowList :: [InlineKeyboardButton] -> ShowS
show :: InlineKeyboardButton -> String
$cshow :: InlineKeyboardButton -> String
showsPrec :: Int -> InlineKeyboardButton -> ShowS
$cshowsPrec :: Int -> InlineKeyboardButton -> ShowS
Show)

labeledInlineKeyboardButton :: Text -> InlineKeyboardButton
labeledInlineKeyboardButton :: Text -> InlineKeyboardButton
labeledInlineKeyboardButton Text
label = Text
-> Maybe Text
-> Maybe Text
-> Maybe WebAppInfo
-> Maybe Text
-> Maybe Text
-> Maybe CallbackGame
-> Maybe Bool
-> InlineKeyboardButton
InlineKeyboardButton Text
label forall a. Maybe a
Nothing forall a. Maybe a
Nothing forall a. Maybe a
Nothing forall a. Maybe a
Nothing forall a. Maybe a
Nothing forall a. Maybe a
Nothing forall a. Maybe a
Nothing

-- ** 'LoginUrl'

-- | This object represents a parameter of the inline keyboard button used to automatically authorize a user. Serves as a great replacement for the Telegram Login Widget when the user is coming from Telegram. All the user needs to do is tap/click a button and confirm that they want to log in:
--
-- https://core.telegram.org/file/811140015/1734/8VZFkwWXalM.97872/6127fa62d8a0bf2b3c
--
-- Telegram apps support these buttons as of version 5.7.
data LoginUrl = LoginUrl
  { LoginUrl -> Text
loginUrlUrl                :: Text       -- ^ An HTTP URL to be opened with user authorization data added to the query string when the button is pressed. If the user refuses to provide authorization data, the original URL without information about the user will be opened. The data added is the same as described in Receiving authorization data.
  --
  -- **NOTE**: You **must** always check the hash of the received data to verify the authentication and the integrity of the data as described in Checking authorization.
  , LoginUrl -> Maybe Text
loginUrlForwardText        :: Maybe Text -- ^ New text of the button in forwarded messages.
  , LoginUrl -> Maybe Text
loginUrlBotUsername        :: Maybe Text -- ^ Username of a bot, which will be used for user authorization. See Setting up a bot for more details. If not specified, the current bot's username will be assumed. The url's domain must be the same as the domain linked with the bot. See Linking your domain to the bot for more details.
  , LoginUrl -> Maybe Bool
loginUrlRequestWriteAccess :: Maybe Bool -- ^ Pass 'True' to request the permission for your bot to send messages to the user.
  }
  deriving (forall x. Rep LoginUrl x -> LoginUrl
forall x. LoginUrl -> Rep LoginUrl x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LoginUrl x -> LoginUrl
$cfrom :: forall x. LoginUrl -> Rep LoginUrl x
Generic, Int -> LoginUrl -> ShowS
[LoginUrl] -> ShowS
LoginUrl -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LoginUrl] -> ShowS
$cshowList :: [LoginUrl] -> ShowS
show :: LoginUrl -> String
$cshow :: LoginUrl -> String
showsPrec :: Int -> LoginUrl -> ShowS
$cshowsPrec :: Int -> LoginUrl -> ShowS
Show)

-- ** 'CallbackQuery'

-- | This object represents an incoming callback query from a callback button
-- in an inline keyboard. If the button that originated the query was attached
-- to a message sent by the bot, the field message will be present.
-- If the button was attached to a message sent via the bot (in inline mode),
-- the field @inline_message_id@ will be present.
-- Exactly one of the fields data or game_short_name will be present.
data CallbackQuery = CallbackQuery
  { CallbackQuery -> CallbackQueryId
callbackQueryId              :: CallbackQueryId -- ^ Unique identifier for this query
  , CallbackQuery -> User
callbackQueryFrom            :: User -- ^ Sender
  , CallbackQuery -> Maybe Message
callbackQueryMessage         :: Maybe Message -- ^ Message with the callback button that originated the query. Note that message content and message date will not be available if the message is too old
  , CallbackQuery -> Maybe MessageId
callbackQueryInlineMessageId :: Maybe MessageId -- ^ Identifier of the message sent via the bot in inline mode, that originated the query.
  , CallbackQuery -> Text
callbackQueryChatInstance    :: Text -- ^ Global identifier, uniquely corresponding to the chat to which the message with the callback button was sent. Useful for high scores in games.
  , CallbackQuery -> Maybe Text
callbackQueryData            :: Maybe Text -- ^ Data associated with the callback button. Be aware that a bad client can send arbitrary data in this field.
  , CallbackQuery -> Maybe Text
callbackQueryGameShortName   :: Maybe Text -- ^ Short name of a Game to be returned, serves as the unique identifier for the game
  }
  deriving (forall x. Rep CallbackQuery x -> CallbackQuery
forall x. CallbackQuery -> Rep CallbackQuery x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CallbackQuery x -> CallbackQuery
$cfrom :: forall x. CallbackQuery -> Rep CallbackQuery x
Generic, Int -> CallbackQuery -> ShowS
[CallbackQuery] -> ShowS
CallbackQuery -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CallbackQuery] -> ShowS
$cshowList :: [CallbackQuery] -> ShowS
show :: CallbackQuery -> String
$cshow :: CallbackQuery -> String
showsPrec :: Int -> CallbackQuery -> ShowS
$cshowsPrec :: Int -> CallbackQuery -> ShowS
Show)

newtype CallbackQueryId = CallbackQueryId Text
  deriving (CallbackQueryId -> CallbackQueryId -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CallbackQueryId -> CallbackQueryId -> Bool
$c/= :: CallbackQueryId -> CallbackQueryId -> Bool
== :: CallbackQueryId -> CallbackQueryId -> Bool
$c== :: CallbackQueryId -> CallbackQueryId -> Bool
Eq, Int -> CallbackQueryId -> ShowS
[CallbackQueryId] -> ShowS
CallbackQueryId -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CallbackQueryId] -> ShowS
$cshowList :: [CallbackQueryId] -> ShowS
show :: CallbackQueryId -> String
$cshow :: CallbackQueryId -> String
showsPrec :: Int -> CallbackQueryId -> ShowS
$cshowsPrec :: Int -> CallbackQueryId -> ShowS
Show, forall x. Rep CallbackQueryId x -> CallbackQueryId
forall x. CallbackQueryId -> Rep CallbackQueryId x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CallbackQueryId x -> CallbackQueryId
$cfrom :: forall x. CallbackQueryId -> Rep CallbackQueryId x
Generic, [CallbackQueryId] -> Encoding
[CallbackQueryId] -> Value
CallbackQueryId -> Encoding
CallbackQueryId -> Value
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [CallbackQueryId] -> Encoding
$ctoEncodingList :: [CallbackQueryId] -> Encoding
toJSONList :: [CallbackQueryId] -> Value
$ctoJSONList :: [CallbackQueryId] -> Value
toEncoding :: CallbackQueryId -> Encoding
$ctoEncoding :: CallbackQueryId -> Encoding
toJSON :: CallbackQueryId -> Value
$ctoJSON :: CallbackQueryId -> Value
ToJSON, Value -> Parser [CallbackQueryId]
Value -> Parser CallbackQueryId
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [CallbackQueryId]
$cparseJSONList :: Value -> Parser [CallbackQueryId]
parseJSON :: Value -> Parser CallbackQueryId
$cparseJSON :: Value -> Parser CallbackQueryId
FromJSON)

-- ** 'ForceReply'

-- | Upon receiving a message with this object,
-- Telegram clients will display a reply interface to the user
-- (act as if the user has selected the bot‘s message and tapped ’Reply').
-- This can be extremely useful if you want to create user-friendly
-- step-by-step interfaces without having to sacrifice privacy mode.
data ForceReply = ForceReply
  { ForceReply -> Bool
forceReplyForceReply            :: Bool       -- ^ Shows reply interface to the user, as if they manually selected the bot‘s message and tapped ’Reply'
  , ForceReply -> Maybe Text
forceReplyInputFieldPlaceholder :: Maybe Text -- ^ The placeholder to be shown in the input field when the reply is active; 1-64 characters.
  , ForceReply -> Maybe Bool
forceReplySelective             :: Maybe Bool -- ^ Use this parameter if you want to force reply from specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message.
  }
  deriving (forall x. Rep ForceReply x -> ForceReply
forall x. ForceReply -> Rep ForceReply x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ForceReply x -> ForceReply
$cfrom :: forall x. ForceReply -> Rep ForceReply x
Generic, Int -> ForceReply -> ShowS
[ForceReply] -> ShowS
ForceReply -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ForceReply] -> ShowS
$cshowList :: [ForceReply] -> ShowS
show :: ForceReply -> String
$cshow :: ForceReply -> String
showsPrec :: Int -> ForceReply -> ShowS
$cshowsPrec :: Int -> ForceReply -> ShowS
Show)

-- ** Chat photo

-- | Chat photo. Returned only in getChat.
data ChatPhoto = ChatPhoto
  { ChatPhoto -> FileId
chatPhotoSmallFileId       :: FileId -- ^ Unique file identifier of small (160x160) chat photo. This file_id can be used only for photo download.
  , ChatPhoto -> FileId
chatPhotoSmallFileUniqueId :: FileId -- ^ Unique file identifier of small (160x160) chat photo, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
  , ChatPhoto -> FileId
chatPhotoBigFileId         :: FileId -- ^ Unique file identifier of big (640x640) chat photo. This file_id can be used only for photo download.
  , ChatPhoto -> FileId
chatPhotoBigFileUniqueId   :: FileId -- ^ Unique file identifier of big (640x640) chat photo, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
  }
  deriving (forall x. Rep ChatPhoto x -> ChatPhoto
forall x. ChatPhoto -> Rep ChatPhoto x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ChatPhoto x -> ChatPhoto
$cfrom :: forall x. ChatPhoto -> Rep ChatPhoto x
Generic, Int -> ChatPhoto -> ShowS
[ChatPhoto] -> ShowS
ChatPhoto -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ChatPhoto] -> ShowS
$cshowList :: [ChatPhoto] -> ShowS
show :: ChatPhoto -> String
$cshow :: ChatPhoto -> String
showsPrec :: Int -> ChatPhoto -> ShowS
$cshowsPrec :: Int -> ChatPhoto -> ShowS
Show)

-- ** 'ChatInviteLink'

-- | Represents an invite link for a chat.
data ChatInviteLink = ChatInviteLink
  { ChatInviteLink -> Text
chatInviteLinkInviteLink              :: Text            -- ^ The invite link. If the link was created by another chat administrator, then the second part of the link will be replaced with “…”.
  , ChatInviteLink -> User
chatInviteLinkCreator                 :: User            -- ^ Creator of the link.
  , ChatInviteLink -> Bool
chatInviteLinkCreatesJoinRequest      :: Bool            -- ^ 'True', if users joining the chat via the link need to be approved by chat administrators.
  , ChatInviteLink -> Bool
chatInviteLinkIsPrimary               :: Bool            -- ^ 'True', if the link is primary.
  , ChatInviteLink -> Bool
chatInviteLinkIsRevoked               :: Bool            -- ^ 'True', if the link is revoked.
  , ChatInviteLink -> Maybe Text
chatInviteLinkName                    :: Maybe Text      -- ^ Invite link name.
  , ChatInviteLink -> Maybe POSIXTime
chatInviteLinkExpireDate              :: Maybe POSIXTime -- ^ Point in time (Unix timestamp) when the link will expire or has been expired.
  , ChatInviteLink -> Maybe Int
chatInviteLinkMemberLimit             :: Maybe Int     -- ^ Maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999.
  , ChatInviteLink -> Maybe Int
chatInviteLinkPendingJoinRequestCount :: Maybe Int     -- ^ Number of pending join requests created using this link.
  }
  deriving (forall x. Rep ChatInviteLink x -> ChatInviteLink
forall x. ChatInviteLink -> Rep ChatInviteLink x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ChatInviteLink x -> ChatInviteLink
$cfrom :: forall x. ChatInviteLink -> Rep ChatInviteLink x
Generic, Int -> ChatInviteLink -> ShowS
[ChatInviteLink] -> ShowS
ChatInviteLink -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ChatInviteLink] -> ShowS
$cshowList :: [ChatInviteLink] -> ShowS
show :: ChatInviteLink -> String
$cshow :: ChatInviteLink -> String
showsPrec :: Int -> ChatInviteLink -> ShowS
$cshowsPrec :: Int -> ChatInviteLink -> ShowS
Show)

-- ** 'ChatAdministratorRights'

-- | Represents the rights of an administrator in a chat.
data ChatAdministratorRights = ChatAdministratorRights
  { ChatAdministratorRights -> Bool
chatAdministratorRightsIsAnonymous         :: Bool -- ^ 'True', if the user's presence in the chat is hidden.
  , ChatAdministratorRights -> Bool
chatAdministratorRightsCanManageChat       :: Bool -- ^ 'True', if the administrator can access the chat event log, chat statistics, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege.
  , ChatAdministratorRights -> Bool
chatAdministratorRightsCanDeleteMessages   :: Bool -- ^ 'True', if the administrator can delete messages of other users.
  , ChatAdministratorRights -> Bool
chatAdministratorRightsCanManageVideoChats :: Bool -- ^ 'True', if the administrator can manage video chats.
  , ChatAdministratorRights -> Bool
chatAdministratorRightsCanRestrictMembers  :: Bool -- ^ 'True', if the administrator can restrict, ban or unban chat members.
  , ChatAdministratorRights -> Bool
chatAdministratorRightsCanPromoteMembers   :: Bool -- ^ 'True', if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by the user).
  , ChatAdministratorRights -> Bool
chatAdministratorRightsCanChangeInfo       :: Bool -- ^ 'True', if the user is allowed to change the chat title, photo and other settings.
  , ChatAdministratorRights -> Bool
chatAdministratorRightsCanInviteUsers      :: Bool -- ^ 'True', if the user is allowed to invite new users to the chat.
  , ChatAdministratorRights -> Maybe Bool
chatAdministratorRightsCanPostMessages     :: Maybe Bool -- ^ 'True', if the administrator can post in the channel; channels only.
  , ChatAdministratorRights -> Maybe Bool
chatAdministratorRightsCanEditMessages     :: Maybe Bool -- ^ 'True', if the administrator can edit messages of other users and can pin messages; channels only.
  , ChatAdministratorRights -> Maybe Bool
chatAdministratorRightsCanPinMessages      :: Maybe Bool -- ^ 'True', if the user is allowed to pin messages; groups and supergroups only
  }
  deriving (forall x. Rep ChatAdministratorRights x -> ChatAdministratorRights
forall x. ChatAdministratorRights -> Rep ChatAdministratorRights x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ChatAdministratorRights x -> ChatAdministratorRights
$cfrom :: forall x. ChatAdministratorRights -> Rep ChatAdministratorRights x
Generic, Int -> ChatAdministratorRights -> ShowS
[ChatAdministratorRights] -> ShowS
ChatAdministratorRights -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ChatAdministratorRights] -> ShowS
$cshowList :: [ChatAdministratorRights] -> ShowS
show :: ChatAdministratorRights -> String
$cshow :: ChatAdministratorRights -> String
showsPrec :: Int -> ChatAdministratorRights -> ShowS
$cshowsPrec :: Int -> ChatAdministratorRights -> ShowS
Show)

-- ** 'ChatMember'

-- | This object contains information about one member of a chat.
data ChatMember = ChatMember
  { ChatMember -> User
chatMemberUser                  :: User -- ^ Information about the user
  , ChatMember -> Text
chatMemberStatus                :: Text -- ^ The member's status in the chat. Can be “owner”, “administrator”, “member”, “restricted”, “left” or “banned”.

  -- banned, restricted
  , ChatMember -> Maybe POSIXTime
chatMemberUntilDate             :: Maybe POSIXTime -- ^ Restictred and banned only. Date when restrictions will be lifted for this user, unix time.

  -- owner, administrator
  , ChatMember -> Maybe Bool
chatMemberIsAnonymous           :: Maybe Bool -- ^ Owners and administrators only. 'True', if the user's presence in the chat is hidden.
  , ChatMember -> Maybe Text
chatMemberCustomTitle           :: Maybe Text -- ^ Owners and administrators only. Custom title for this user.

  -- administrator
  , ChatMember -> Maybe Bool
chatMemberCanBeEdited           :: Maybe Bool -- ^ Administrators only. True, if the bot is allowed to edit administrator privileges of that user
  , ChatMember -> Maybe Bool
chatMemberCanManageChat         :: Maybe Bool -- ^ Administrators only. 'True', if the administrator can access the chat event log, chat statistics, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege.
  , ChatMember -> Maybe Bool
chatMemberCanDeleteMessages     :: Maybe Bool -- ^ Administrators only. True, if the administrator can delete messages of other users.
  , ChatMember -> Maybe Bool
chatMemberCanManageVideoChats   :: Maybe Bool -- ^ Administrators only. True, if the administrator can manage video (previously, voice) chats.
  , ChatMember -> Maybe Bool
chatMemberCanRestrictMembers    :: Maybe Bool -- ^ Administrators only. True, if the administrator can restrict, ban or unban chat members.
  , ChatMember -> Maybe Bool
chatMemberCanPromoteMembers     :: Maybe Bool -- ^ Administrators only. True, if the administrator can add new administrators with a subset of his own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by the user).
  , ChatMember -> Maybe Bool
chatMemberCanChangeInfo         :: Maybe Bool -- ^ Administrators only. True, if the administrator can change the chat title, photo and other settings.
  , ChatMember -> Maybe Bool
chatMemberCanPostMessages       :: Maybe Bool -- ^ Administrators only. True, if the administrator can post in the channel, channels only.
  , ChatMember -> Maybe Bool
chatMemberCanEditMessages       :: Maybe Bool -- ^ Administrators only. True, if the administrator can edit messages of other users and can pin messages, channels only.

  -- administrator, restricted
  , ChatMember -> Maybe Bool
chatMemberCanInviteUsers        :: Maybe Bool -- ^ Administrators and restricted only. True, if the administrator can invite new users to the chat.
  , ChatMember -> Maybe Bool
chatMemberCanPinMessages        :: Maybe Bool -- ^ Administrators and restricted only. True, if the administrator can pin messages, supergroups only.

  -- restricted
  , ChatMember -> Maybe Bool
chatMemberIsMember              :: Maybe Bool -- ^ Restricted only. True, if the user is a member of the chat at the moment of the request.
  , ChatMember -> Maybe Bool
chatMemberCanSendMessages       :: Maybe Bool -- ^ Restricted only. True, if the user can send text messages, contacts, locations and venues.
  , ChatMember -> Maybe Bool
chatMemberCanSendMediaMessages  :: Maybe Bool -- ^ Restricted only. True, if the user can send audios, documents, photos, videos, video notes and voice notes, implies can_send_messages.
  , ChatMember -> Maybe Bool
chatMemberCanSendPolls          :: Maybe Bool -- ^ Restricted only. True, if the user is allowed to send polls.
  , ChatMember -> Maybe Bool
chatMemberCanSendOtherMessages  :: Maybe Bool -- ^ Restricted only. True, if the user can send animations, games, stickers and use inline bots, implies can_send_media_messages.
  , ChatMember -> Maybe Bool
chatMemberCanAddWebPagePreviews :: Maybe Bool -- ^ Restricted only. True, if user may add web page previews to his messages, implies can_send_media_messages.
  }
  deriving (forall x. Rep ChatMember x -> ChatMember
forall x. ChatMember -> Rep ChatMember x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ChatMember x -> ChatMember
$cfrom :: forall x. ChatMember -> Rep ChatMember x
Generic, Int -> ChatMember -> ShowS
[ChatMember] -> ShowS
ChatMember -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ChatMember] -> ShowS
$cshowList :: [ChatMember] -> ShowS
show :: ChatMember -> String
$cshow :: ChatMember -> String
showsPrec :: Int -> ChatMember -> ShowS
$cshowsPrec :: Int -> ChatMember -> ShowS
Show)

-- ** 'ChatMemberUpdated'

-- | This object represents changes in the status of a chat member.
data ChatMemberUpdated = ChatMemberUpdated
  { ChatMemberUpdated -> Chat
chatMemberUpdatedChat          :: Chat                 -- ^ Chat the user belongs to.
  , ChatMemberUpdated -> User
chatMemberUpdatedFrom          :: User                 -- ^ Performer of the action, which resulted in the change.
  , ChatMemberUpdated -> POSIXTime
chatMemberUpdatedDate          :: POSIXTime            -- ^ Date the change was done in Unix time.
  , ChatMemberUpdated -> ChatMember
chatMemberUpdatedOldChatMember :: ChatMember           -- ^ Previous information about the chat member.
  , ChatMemberUpdated -> ChatMember
chatMemberUpdatedNewChatMember :: ChatMember           -- ^ New information about the chat member.
  , ChatMemberUpdated -> Maybe ChatInviteLink
chatMemberUpdatedInviteLink    :: Maybe ChatInviteLink -- ^ Chat invite link, which was used by the user to join the chat; for joining by invite link events only.
  }
  deriving (forall x. Rep ChatMemberUpdated x -> ChatMemberUpdated
forall x. ChatMemberUpdated -> Rep ChatMemberUpdated x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ChatMemberUpdated x -> ChatMemberUpdated
$cfrom :: forall x. ChatMemberUpdated -> Rep ChatMemberUpdated x
Generic, Int -> ChatMemberUpdated -> ShowS
[ChatMemberUpdated] -> ShowS
ChatMemberUpdated -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ChatMemberUpdated] -> ShowS
$cshowList :: [ChatMemberUpdated] -> ShowS
show :: ChatMemberUpdated -> String
$cshow :: ChatMemberUpdated -> String
showsPrec :: Int -> ChatMemberUpdated -> ShowS
$cshowsPrec :: Int -> ChatMemberUpdated -> ShowS
Show)

-- ** 'ChatJoinRequest'

-- | Represents a join request sent to a chat.
data ChatJoinRequest = ChatJoinRequest
  { ChatJoinRequest -> Chat
chatJoinRequestChat       :: Chat                 -- ^ Chat to which the request was sent.
  , ChatJoinRequest -> User
chatJoinRequestFrom       :: User                 -- ^ User that sent the join request.
  , ChatJoinRequest -> POSIXTime
chatJoinRequestDate       :: POSIXTime            -- ^ Date the request was sent in Unix time.
  , ChatJoinRequest -> Maybe Text
chatJoinRequestBio        :: Maybe Text           -- ^ Bio of the user.
  , ChatJoinRequest -> Maybe ChatInviteLink
chatJoinRequestInviteLink :: Maybe ChatInviteLink -- ^ Chat invite link that was used by the user to send the join request.
  }
  deriving (forall x. Rep ChatJoinRequest x -> ChatJoinRequest
forall x. ChatJoinRequest -> Rep ChatJoinRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ChatJoinRequest x -> ChatJoinRequest
$cfrom :: forall x. ChatJoinRequest -> Rep ChatJoinRequest x
Generic, Int -> ChatJoinRequest -> ShowS
[ChatJoinRequest] -> ShowS
ChatJoinRequest -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ChatJoinRequest] -> ShowS
$cshowList :: [ChatJoinRequest] -> ShowS
show :: ChatJoinRequest -> String
$cshow :: ChatJoinRequest -> String
showsPrec :: Int -> ChatJoinRequest -> ShowS
$cshowsPrec :: Int -> ChatJoinRequest -> ShowS
Show)

-- ** 'ChatPermissions'

-- | Describes actions that a non-administrator user is allowed to take in a chat.
data ChatPermissions = ChatPermissions
  { ChatPermissions -> Maybe Bool
chatPermissionsCanSendMessages :: Maybe Bool       -- ^ True, if the user is allowed to send text messages, contacts, locations and venues.
  , ChatPermissions -> Maybe Bool
chatPermissionsCanSendMediaMessages :: Maybe Bool  -- ^ True, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes, implies can_send_messages.
  , ChatPermissions -> Maybe Bool
chatPermissionsCanSendPolls :: Maybe Bool          -- ^ True, if the user is allowed to send polls, implies can_send_messages.
  , ChatPermissions -> Maybe Bool
chatPermissionsCanSendOtherMessages :: Maybe Bool  -- ^ True, if the user is allowed to send animations, games, stickers and use inline bots, implies can_send_media_messages.
  , ChatPermissions -> Maybe Bool
chatPermissionsCanAddWebPagePreviews :: Maybe Bool -- ^ True, if the user is allowed to add web page previews to their messages, implies can_send_media_messages.
  , ChatPermissions -> Maybe Bool
chatPermissionsCanChangeInfo :: Maybe Bool         -- ^ True, if the user is allowed to change the chat title, photo and other settings. Ignored in public supergroups
  , ChatPermissions -> Maybe Bool
chatPermissionsCanInviteUsers :: Maybe Bool        -- ^ True, if the user is allowed to invite new users to the chat.
  , ChatPermissions -> Maybe Bool
chatPermissionsCanPinMessages :: Maybe Bool        -- ^ True, if the user is allowed to pin messages. Ignored in public supergroups.
  }
  deriving (forall x. Rep ChatPermissions x -> ChatPermissions
forall x. ChatPermissions -> Rep ChatPermissions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ChatPermissions x -> ChatPermissions
$cfrom :: forall x. ChatPermissions -> Rep ChatPermissions x
Generic, Int -> ChatPermissions -> ShowS
[ChatPermissions] -> ShowS
ChatPermissions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ChatPermissions] -> ShowS
$cshowList :: [ChatPermissions] -> ShowS
show :: ChatPermissions -> String
$cshow :: ChatPermissions -> String
showsPrec :: Int -> ChatPermissions -> ShowS
$cshowsPrec :: Int -> ChatPermissions -> ShowS
Show)

-- ** 'ChatLocation'

-- | Represents a location to which a chat is connected.
data ChatLocation = ChatLocation
  { ChatLocation -> Location
chatLocationLocation :: Location -- ^ The location to which the supergroup is connected. Can't be a live location..
  , ChatLocation -> Text
chatLocationAddress :: Text      -- ^ Location address; 1-64 characters, as defined by the chat owner.
  }
  deriving (forall x. Rep ChatLocation x -> ChatLocation
forall x. ChatLocation -> Rep ChatLocation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ChatLocation x -> ChatLocation
$cfrom :: forall x. ChatLocation -> Rep ChatLocation x
Generic, Int -> ChatLocation -> ShowS
[ChatLocation] -> ShowS
ChatLocation -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ChatLocation] -> ShowS
$cshowList :: [ChatLocation] -> ShowS
show :: ChatLocation -> String
$cshow :: ChatLocation -> String
showsPrec :: Int -> ChatLocation -> ShowS
$cshowsPrec :: Int -> ChatLocation -> ShowS
Show)

-- ** 'ResponseParameters'

-- | Contains information about why a request was unsuccessful.
data ResponseParameters = ResponseParameters
  { ResponseParameters -> Maybe ChatId
responseParametersMigrateToChatId :: Maybe ChatId -- ^ The group has been migrated to a supergroup with the specified identifier. This number may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier.
  , ResponseParameters -> Maybe Seconds
responseParametersRetryAfter      :: Maybe Seconds -- ^ In case of exceeding flood control, the number of seconds left to wait before the request can be repeated
  }
  deriving (Int -> ResponseParameters -> ShowS
[ResponseParameters] -> ShowS
ResponseParameters -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ResponseParameters] -> ShowS
$cshowList :: [ResponseParameters] -> ShowS
show :: ResponseParameters -> String
$cshow :: ResponseParameters -> String
showsPrec :: Int -> ResponseParameters -> ShowS
$cshowsPrec :: Int -> ResponseParameters -> ShowS
Show, forall x. Rep ResponseParameters x -> ResponseParameters
forall x. ResponseParameters -> Rep ResponseParameters x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ResponseParameters x -> ResponseParameters
$cfrom :: forall x. ResponseParameters -> Rep ResponseParameters x
Generic)

-- * Stickers

-- | The following methods and objects allow your bot to handle stickers and sticker sets.

-- ** 'Sticker'

-- | This object represents a sticker.
data Sticker = Sticker
  { Sticker -> FileId
stickerFileId       :: FileId             -- ^ Identifier for this file, which can be used to download or reuse the file.
  , Sticker -> FileId
stickerFileUniqueId :: FileId             -- ^ Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
  , Sticker -> Int
stickerWidth        :: Int              -- ^ Sticker width.
  , Sticker -> Int
stickerHeight       :: Int              -- ^ Sticker height.
  , Sticker -> Bool
stickerIsAnimated   :: Bool               -- ^ 'True', if the sticker is animated.
  , Sticker -> Bool
stickerIsVideo      :: Bool               -- ^ 'True', if the sticker is a video sticker.
  , Sticker -> Maybe PhotoSize
stickerThumb        :: Maybe PhotoSize    -- ^ Sticker thumbnail in the .WEBP or .JPG format.
  , Sticker -> Maybe Text
stickerEmoji        :: Maybe Text         -- ^ Emoji associated with the sticker.
  , Sticker -> Maybe Text
stickerSetName      :: Maybe Text         -- ^ Name of the sticker set to which the sticker belongs.
  , Sticker -> Maybe File
stickerPremiumAnimation :: Maybe File    -- ^ For premium regular stickers, premium animation for the sticker.
  , Sticker -> Maybe MaskPosition
stickerMaskPosition :: Maybe MaskPosition -- ^ For mask stickers, the position where the mask should be placed.
  , Sticker -> Maybe Text
stickerCustomEmojiId :: Maybe Text        -- ^ For custom emoji stickers, unique identifier of the custom emoji.
  , Sticker -> Maybe Integer
stickerFileSize     :: Maybe Integer      -- ^ File size in bytes.
  }
  deriving (forall x. Rep Sticker x -> Sticker
forall x. Sticker -> Rep Sticker x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Sticker x -> Sticker
$cfrom :: forall x. Sticker -> Rep Sticker x
Generic, Int -> Sticker -> ShowS
[Sticker] -> ShowS
Sticker -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Sticker] -> ShowS
$cshowList :: [Sticker] -> ShowS
show :: Sticker -> String
$cshow :: Sticker -> String
showsPrec :: Int -> Sticker -> ShowS
$cshowsPrec :: Int -> Sticker -> ShowS
Show)

-- ** 'StickerSet'

-- | This object represents a sticker set.
data StickerSet = StickerSet
  { StickerSet -> Text
stickerSetName          :: Text            -- ^ Sticker set name.
  , StickerSet -> Text
stickerSetTitle         :: Text            -- ^ Sticker set title.
  , StickerSet -> StickerSetType
stickerSetType          :: StickerSetType  -- ^ Type of stickers in the set, currently one of “regular”, “mask”, “custom_emoji”.
  , StickerSet -> Bool
stickerSetIsAnimated    :: Bool            -- ^ 'True', if the sticker set contains animated stickers.
  , StickerSet -> Bool
stickerSetIsVideo       :: Bool            -- ^ 'True', if the sticker is a video sticker.
  , StickerSet -> Maybe Bool
stickerSetContainsMasks :: Maybe Bool      -- ^ True, if the sticker set contains masks.
  , StickerSet -> [Sticker]
stickerSetStickers      :: [Sticker]       -- ^ List of all set stickers.
  , StickerSet -> Maybe PhotoSize
stickerSetThumb         :: Maybe PhotoSize -- ^ Sticker set thumbnail in the .WEBP or .TGS format.
  }
  deriving (forall x. Rep StickerSet x -> StickerSet
forall x. StickerSet -> Rep StickerSet x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StickerSet x -> StickerSet
$cfrom :: forall x. StickerSet -> Rep StickerSet x
Generic, Int -> StickerSet -> ShowS
[StickerSet] -> ShowS
StickerSet -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StickerSet] -> ShowS
$cshowList :: [StickerSet] -> ShowS
show :: StickerSet -> String
$cshow :: StickerSet -> String
showsPrec :: Int -> StickerSet -> ShowS
$cshowsPrec :: Int -> StickerSet -> ShowS
Show)

-- | Type of stickers in the set, currently one of “regular”, “mask”, “custom_emoji”.
data StickerSetType
  = StickerSetTypeRegular
  | StickerSetTypeMask
  | StickerSetTypeCustomEmoji
  deriving (StickerSetType -> StickerSetType -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StickerSetType -> StickerSetType -> Bool
$c/= :: StickerSetType -> StickerSetType -> Bool
== :: StickerSetType -> StickerSetType -> Bool
$c== :: StickerSetType -> StickerSetType -> Bool
Eq, Int -> StickerSetType -> ShowS
[StickerSetType] -> ShowS
StickerSetType -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StickerSetType] -> ShowS
$cshowList :: [StickerSetType] -> ShowS
show :: StickerSetType -> String
$cshow :: StickerSetType -> String
showsPrec :: Int -> StickerSetType -> ShowS
$cshowsPrec :: Int -> StickerSetType -> ShowS
Show, forall x. Rep StickerSetType x -> StickerSetType
forall x. StickerSetType -> Rep StickerSetType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StickerSetType x -> StickerSetType
$cfrom :: forall x. StickerSetType -> Rep StickerSetType x
Generic)

-- ** 'MaskPosition'

-- | This object describes the position on faces where a mask should be placed by default.
data MaskPosition = MaskPosition
  { MaskPosition -> Text
maskPositionPoint  :: Text  -- ^ The part of the face relative to which the mask should be placed. One of “forehead”, “eyes”, “mouth”, or “chin”.
  , MaskPosition -> Float
maskPositionXShift :: Float -- ^ Shift by X-axis measured in widths of the mask scaled to the face size, from left to right. For example, choosing -1.0 will place mask just to the left of the default mask position.
  , MaskPosition -> Float
maskPositionYShift :: Float -- ^ Shift by Y-axis measured in heights of the mask scaled to the face size, from top to bottom. For example, 1.0 will place the mask just below the default mask position.
  , MaskPosition -> Float
maskPositionScale  :: Float -- ^ Mask scaling coefficient. For example, 2.0 means double size.
  }
  deriving (forall x. Rep MaskPosition x -> MaskPosition
forall x. MaskPosition -> Rep MaskPosition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MaskPosition x -> MaskPosition
$cfrom :: forall x. MaskPosition -> Rep MaskPosition x
Generic, Int -> MaskPosition -> ShowS
[MaskPosition] -> ShowS
MaskPosition -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MaskPosition] -> ShowS
$cshowList :: [MaskPosition] -> ShowS
show :: MaskPosition -> String
$cshow :: MaskPosition -> String
showsPrec :: Int -> MaskPosition -> ShowS
$cshowsPrec :: Int -> MaskPosition -> ShowS
Show)

-- * Payments

-- ** 'LabeledPrice'

-- | This object represents a portion of the price for goods or services.
data LabeledPrice = LabelPrice
  { LabeledPrice -> Text
labeledPriceLabel  :: Text  -- ^ Portion label.
  , LabeledPrice -> Int
labeledPriceAmount :: Int -- ^ Price of the product in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).
  }
  deriving (forall x. Rep LabeledPrice x -> LabeledPrice
forall x. LabeledPrice -> Rep LabeledPrice x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LabeledPrice x -> LabeledPrice
$cfrom :: forall x. LabeledPrice -> Rep LabeledPrice x
Generic, Int -> LabeledPrice -> ShowS
[LabeledPrice] -> ShowS
LabeledPrice -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LabeledPrice] -> ShowS
$cshowList :: [LabeledPrice] -> ShowS
show :: LabeledPrice -> String
$cshow :: LabeledPrice -> String
showsPrec :: Int -> LabeledPrice -> ShowS
$cshowsPrec :: Int -> LabeledPrice -> ShowS
Show)

-- ** 'Invoice'

-- | This object contains basic information about an invoice.
data Invoice = Invoice
  { Invoice -> Text
invoiceTitle          :: Text  -- ^ Product name.
  , Invoice -> Text
invoiceDescription    :: Text  -- ^ Product description.
  , Invoice -> Text
invoiceStartParameter :: Text  -- ^ Unique bot deep-linking parameter that can be used to generate this invoice.
  , Invoice -> Text
invoiceCurrency       :: Text  -- ^ Three-letter ISO 4217 currency code.
  , Invoice -> Int
invoiceTotalAmount    :: Int -- ^ Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).
  }
  deriving (forall x. Rep Invoice x -> Invoice
forall x. Invoice -> Rep Invoice x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Invoice x -> Invoice
$cfrom :: forall x. Invoice -> Rep Invoice x
Generic, Int -> Invoice -> ShowS
[Invoice] -> ShowS
Invoice -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Invoice] -> ShowS
$cshowList :: [Invoice] -> ShowS
show :: Invoice -> String
$cshow :: Invoice -> String
showsPrec :: Int -> Invoice -> ShowS
$cshowsPrec :: Int -> Invoice -> ShowS
Show)

-- ** 'ShippingAddress'

-- | This object represents a shipping address.
data ShippingAddress = ShippingAddress
  { ShippingAddress -> Text
shippingAddressCountryCode :: Text -- ^ ISO 3166-1 alpha-2 country code.
  , ShippingAddress -> Text
shippingAddressState       :: Text -- ^ State, if applicable.
  , ShippingAddress -> Text
shippingAddressCity        :: Text -- ^ City.
  , ShippingAddress -> Text
shippingAddressStreetLine1 :: Text -- ^ First line for the address.
  , ShippingAddress -> Text
shippingAddressStreetLine2 :: Text -- ^ Second line for the address.
  , ShippingAddress -> Text
shippingAddressPostCode    :: Text -- ^ Address post code.
  }
  deriving (forall x. Rep ShippingAddress x -> ShippingAddress
forall x. ShippingAddress -> Rep ShippingAddress x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ShippingAddress x -> ShippingAddress
$cfrom :: forall x. ShippingAddress -> Rep ShippingAddress x
Generic, Int -> ShippingAddress -> ShowS
[ShippingAddress] -> ShowS
ShippingAddress -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ShippingAddress] -> ShowS
$cshowList :: [ShippingAddress] -> ShowS
show :: ShippingAddress -> String
$cshow :: ShippingAddress -> String
showsPrec :: Int -> ShippingAddress -> ShowS
$cshowsPrec :: Int -> ShippingAddress -> ShowS
Show)

-- ** 'OrderInfo'

-- | This object represents information about an order.
data OrderInfo = OrderInfo
  { OrderInfo -> Maybe Text
orderInfoName            :: Maybe Text            -- ^ User name.
  , OrderInfo -> Maybe Text
orderInfoPhoneNumber     :: Maybe Text            -- ^ User's phone number.
  , OrderInfo -> Maybe Text
orderInfoEmail           :: Maybe Text            -- ^ User email.
  , OrderInfo -> Maybe ShippingAddress
orderInfoShippingAddress :: Maybe ShippingAddress -- ^ User shipping address.
  }
  deriving (forall x. Rep OrderInfo x -> OrderInfo
forall x. OrderInfo -> Rep OrderInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep OrderInfo x -> OrderInfo
$cfrom :: forall x. OrderInfo -> Rep OrderInfo x
Generic, Int -> OrderInfo -> ShowS
[OrderInfo] -> ShowS
OrderInfo -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OrderInfo] -> ShowS
$cshowList :: [OrderInfo] -> ShowS
show :: OrderInfo -> String
$cshow :: OrderInfo -> String
showsPrec :: Int -> OrderInfo -> ShowS
$cshowsPrec :: Int -> OrderInfo -> ShowS
Show)

-- ** 'ShippingOption'

-- | This object represents one shipping option.
data ShippingOption = ShippingOption
  { ShippingOption -> ShippingOptionId
shippingOptionId    :: ShippingOptionId -- ^ Shipping option identifier.
  , ShippingOption -> Text
shippingOptionTitle :: Text             -- ^ Option title.
  , ShippingOption -> [LabeledPrice]
shippingOptionPrice :: [LabeledPrice]   -- ^ List of price portions.
  }
  deriving (forall x. Rep ShippingOption x -> ShippingOption
forall x. ShippingOption -> Rep ShippingOption x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ShippingOption x -> ShippingOption
$cfrom :: forall x. ShippingOption -> Rep ShippingOption x
Generic, Int -> ShippingOption -> ShowS
[ShippingOption] -> ShowS
ShippingOption -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ShippingOption] -> ShowS
$cshowList :: [ShippingOption] -> ShowS
show :: ShippingOption -> String
$cshow :: ShippingOption -> String
showsPrec :: Int -> ShippingOption -> ShowS
$cshowsPrec :: Int -> ShippingOption -> ShowS
Show)

newtype ShippingOptionId = ShippingOptionId Text
  deriving (ShippingOptionId -> ShippingOptionId -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ShippingOptionId -> ShippingOptionId -> Bool
$c/= :: ShippingOptionId -> ShippingOptionId -> Bool
== :: ShippingOptionId -> ShippingOptionId -> Bool
$c== :: ShippingOptionId -> ShippingOptionId -> Bool
Eq, Int -> ShippingOptionId -> ShowS
[ShippingOptionId] -> ShowS
ShippingOptionId -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ShippingOptionId] -> ShowS
$cshowList :: [ShippingOptionId] -> ShowS
show :: ShippingOptionId -> String
$cshow :: ShippingOptionId -> String
showsPrec :: Int -> ShippingOptionId -> ShowS
$cshowsPrec :: Int -> ShippingOptionId -> ShowS
Show, forall x. Rep ShippingOptionId x -> ShippingOptionId
forall x. ShippingOptionId -> Rep ShippingOptionId x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ShippingOptionId x -> ShippingOptionId
$cfrom :: forall x. ShippingOptionId -> Rep ShippingOptionId x
Generic, [ShippingOptionId] -> Encoding
[ShippingOptionId] -> Value
ShippingOptionId -> Encoding
ShippingOptionId -> Value
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [ShippingOptionId] -> Encoding
$ctoEncodingList :: [ShippingOptionId] -> Encoding
toJSONList :: [ShippingOptionId] -> Value
$ctoJSONList :: [ShippingOptionId] -> Value
toEncoding :: ShippingOptionId -> Encoding
$ctoEncoding :: ShippingOptionId -> Encoding
toJSON :: ShippingOptionId -> Value
$ctoJSON :: ShippingOptionId -> Value
ToJSON, Value -> Parser [ShippingOptionId]
Value -> Parser ShippingOptionId
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [ShippingOptionId]
$cparseJSONList :: Value -> Parser [ShippingOptionId]
parseJSON :: Value -> Parser ShippingOptionId
$cparseJSON :: Value -> Parser ShippingOptionId
FromJSON)

-- ** 'SuccessfulPayment'

-- | This object contains basic information about a successful payment.
data SuccessfulPayment = SuccessfulPayment
  { SuccessfulPayment -> Text
successfulPaymentCurrency                :: Text                   -- ^ Three-letter ISO 4217 currency code.
  , SuccessfulPayment -> Int
successfulPaymentTotalAmount             :: Int                  -- ^ Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).
  , SuccessfulPayment -> Text
successfulPaymentInvoicePayload          :: Text                   -- ^ Bot specified invoice payload.
  , SuccessfulPayment -> Maybe ShippingOptionId
successfulPaymentShippingOptionId        :: Maybe ShippingOptionId -- ^ Identifier of the shipping option chosen by the user.
  , SuccessfulPayment -> Maybe OrderInfo
successfulPaymentOrderInfo               :: Maybe OrderInfo        -- ^ Order info provided by the user.
  , SuccessfulPayment -> Text
successfulPaymentTelegramPaymentChargeId :: Text                   -- ^ Telegram payment identifier.
  , SuccessfulPayment -> Text
successfulPaymentProviderPaymentChargeId :: Text                   -- ^ Provider payment identifier.
  }
  deriving (forall x. Rep SuccessfulPayment x -> SuccessfulPayment
forall x. SuccessfulPayment -> Rep SuccessfulPayment x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SuccessfulPayment x -> SuccessfulPayment
$cfrom :: forall x. SuccessfulPayment -> Rep SuccessfulPayment x
Generic, Int -> SuccessfulPayment -> ShowS
[SuccessfulPayment] -> ShowS
SuccessfulPayment -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SuccessfulPayment] -> ShowS
$cshowList :: [SuccessfulPayment] -> ShowS
show :: SuccessfulPayment -> String
$cshow :: SuccessfulPayment -> String
showsPrec :: Int -> SuccessfulPayment -> ShowS
$cshowsPrec :: Int -> SuccessfulPayment -> ShowS
Show)

-- ** 'ShippingQuery'

-- | This object contains information about an incoming shipping query.
data ShippingQuery = ShippingQuery
  { ShippingQuery -> Text
shippingQueryId              :: Text            -- ^ Unique query identifier.
  , ShippingQuery -> User
shippingQueryFrom            :: User            -- ^ User who sent the query.
  , ShippingQuery -> Text
shippingQueryInvoicePayload  :: Text            -- ^ Bot specified invoice payload.
  , ShippingQuery -> ShippingAddress
shippingQueryShippingAddress :: ShippingAddress -- ^ User specified shipping address.
  }
  deriving (forall x. Rep ShippingQuery x -> ShippingQuery
forall x. ShippingQuery -> Rep ShippingQuery x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ShippingQuery x -> ShippingQuery
$cfrom :: forall x. ShippingQuery -> Rep ShippingQuery x
Generic, Int -> ShippingQuery -> ShowS
[ShippingQuery] -> ShowS
ShippingQuery -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ShippingQuery] -> ShowS
$cshowList :: [ShippingQuery] -> ShowS
show :: ShippingQuery -> String
$cshow :: ShippingQuery -> String
showsPrec :: Int -> ShippingQuery -> ShowS
$cshowsPrec :: Int -> ShippingQuery -> ShowS
Show)

-- ** 'PreCheckoutQuery'

-- | This object contains information about an incoming pre-checkout query.
data PreCheckoutQuery = PreCheckoutQuery
  { PreCheckoutQuery -> Text
preCheckoutQueryId               :: Text                   -- ^ Unique query identifier.
  , PreCheckoutQuery -> User
preCheckoutQueryFrom             :: User                   -- ^ User who sent the query.
  , PreCheckoutQuery -> Text
preCheckoutQueryCurrency         :: Text                   -- ^ Three-letter ISO 4217 currency code
  , PreCheckoutQuery -> Int
preCheckoutQueryTotalAmount      :: Int                  -- ^ Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).
  , PreCheckoutQuery -> Text
preCheckoutQueryInvoicePayload   :: Text                   -- ^ Bot specified invoice payload
  , PreCheckoutQuery -> Maybe ShippingOptionId
preCheckoutQueryShippingOptionId :: Maybe ShippingOptionId -- ^ Identifier of the shipping option chosen by the user.
  , PreCheckoutQuery -> Maybe OrderInfo
preCheckoutQueryOrderInfo        :: Maybe OrderInfo        -- ^ Order info provided by the user.
  }
  deriving (forall x. Rep PreCheckoutQuery x -> PreCheckoutQuery
forall x. PreCheckoutQuery -> Rep PreCheckoutQuery x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PreCheckoutQuery x -> PreCheckoutQuery
$cfrom :: forall x. PreCheckoutQuery -> Rep PreCheckoutQuery x
Generic, Int -> PreCheckoutQuery -> ShowS
[PreCheckoutQuery] -> ShowS
PreCheckoutQuery -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PreCheckoutQuery] -> ShowS
$cshowList :: [PreCheckoutQuery] -> ShowS
show :: PreCheckoutQuery -> String
$cshow :: PreCheckoutQuery -> String
showsPrec :: Int -> PreCheckoutQuery -> ShowS
$cshowsPrec :: Int -> PreCheckoutQuery -> ShowS
Show)

-- * Telegram Passport

-- | Telegram Passport is a unified authorization method for services that require personal identification. Users can upload their documents once, then instantly share their data with services that require real-world ID (finance, ICOs, etc.). Please see the manual for details.

-- ** 'PassportData'

-- | Contains information about Telegram Passport data shared with the bot by the user.
data PassportData = PassportData
  { PassportData -> [EncryptedPassportElement]
passportDataData        :: [EncryptedPassportElement] -- ^ Array with information about documents and other Telegram Passport elements that was shared with the bot.
  , PassportData -> EncryptedCredentials
passportDataCredentials :: EncryptedCredentials       -- ^ Encrypted credentials required to decrypt the data.
  }
  deriving (forall x. Rep PassportData x -> PassportData
forall x. PassportData -> Rep PassportData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PassportData x -> PassportData
$cfrom :: forall x. PassportData -> Rep PassportData x
Generic, Int -> PassportData -> ShowS
[PassportData] -> ShowS
PassportData -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PassportData] -> ShowS
$cshowList :: [PassportData] -> ShowS
show :: PassportData -> String
$cshow :: PassportData -> String
showsPrec :: Int -> PassportData -> ShowS
$cshowsPrec :: Int -> PassportData -> ShowS
Show)

-- ** 'PassportFile'

-- | This object represents a file uploaded to Telegram Passport. Currently all Telegram Passport files are in JPEG format when decrypted and don't exceed 10MB.
data PassportFile = PassportFile
  { PassportFile -> FileId
passportFileFileId       :: FileId    -- ^ Identifier for this file, which can be used to download or reuse the file.
  , PassportFile -> FileId
passportFileFileUniqueId :: FileId    -- ^ Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
  , PassportFile -> Int
passportFileFileSize     :: Int     -- ^ File size in bytes.
  , PassportFile -> POSIXTime
passportFileFileDate     :: POSIXTime -- ^ Unix time when the file was uploaded.
  }
  deriving (forall x. Rep PassportFile x -> PassportFile
forall x. PassportFile -> Rep PassportFile x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PassportFile x -> PassportFile
$cfrom :: forall x. PassportFile -> Rep PassportFile x
Generic, Int -> PassportFile -> ShowS
[PassportFile] -> ShowS
PassportFile -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PassportFile] -> ShowS
$cshowList :: [PassportFile] -> ShowS
show :: PassportFile -> String
$cshow :: PassportFile -> String
showsPrec :: Int -> PassportFile -> ShowS
$cshowsPrec :: Int -> PassportFile -> ShowS
Show)

-- ** 'EncryptedPassportElement'

-- | Contains information about documents or other Telegram Passport elements shared with the bot by the user.
data EncryptedPassportElement = EncryptedPassportElement
  { EncryptedPassportElement -> PassportElementType
encryptedPassportElementType        :: PassportElementType  -- ^ One of “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport”, “address”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”, “phone_number”, “email”.
  , EncryptedPassportElement -> Maybe Text
encryptedPassportElementData        :: Maybe Text           -- ^ Base64-encoded encrypted Telegram Passport element data provided by the user, available for “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport” and “address” types. Can be decrypted and verified using the accompanying 'EncryptedCredentials'.
  , EncryptedPassportElement -> Maybe Text
encryptedPassportElementPhoneNumber :: Maybe Text           -- ^ User's verified phone number, available only for “phone_number” type.
  , EncryptedPassportElement -> Maybe Text
encryptedPassportElementEmail       :: Maybe Text           -- ^ User's verified email address, available only for “email” type.
  , EncryptedPassportElement -> Maybe [PassportFile]
encryptedPassportElementFiles       :: Maybe [PassportFile] -- ^ Array of encrypted files with documents provided by the user, available for “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration” and “temporary_registration” types. Files can be decrypted and verified using the accompanying EncryptedCredentials.
  , EncryptedPassportElement -> Maybe PassportFile
encryptedPassportElementFrontSide   :: Maybe PassportFile   -- ^ Encrypted file with the front side of the document, provided by the user. Available for “passport”, “driver_license”, “identity_card” and “internal_passport”. The file can be decrypted and verified using the accompanying EncryptedCredentials.
  , EncryptedPassportElement -> Maybe PassportFile
encryptedPassportElementReverseSide :: Maybe PassportFile   -- ^ Encrypted file with the reverse side of the document, provided by the user. Available for “driver_license” and “identity_card”. The file can be decrypted and verified using the accompanying EncryptedCredentials.
  , EncryptedPassportElement -> Maybe PassportFile
encryptedPassportElementSelfie      :: Maybe PassportFile   -- ^ Encrypted file with the selfie of the user holding a document, provided by the user; available for “passport”, “driver_license”, “identity_card” and “internal_passport”. The file can be decrypted and verified using the accompanying EncryptedCredentials.
  , EncryptedPassportElement -> Maybe [PassportFile]
encryptedPassportElementTranslation :: Maybe [PassportFile] -- ^ Array of encrypted files with translated versions of documents provided by the user. Available if requested for “passport”, “driver_license”, “identity_card”, “internal_passport”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration” and “temporary_registration” types. Files can be decrypted and verified using the accompanying EncryptedCredentials.
  , EncryptedPassportElement -> Text
encryptedPassportElementHash        :: Text                 -- ^ Base64-encoded element hash for using in 'PassportElementErrorUnspecified'.
  } deriving (forall x.
Rep EncryptedPassportElement x -> EncryptedPassportElement
forall x.
EncryptedPassportElement -> Rep EncryptedPassportElement x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep EncryptedPassportElement x -> EncryptedPassportElement
$cfrom :: forall x.
EncryptedPassportElement -> Rep EncryptedPassportElement x
Generic, Int -> EncryptedPassportElement -> ShowS
[EncryptedPassportElement] -> ShowS
EncryptedPassportElement -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EncryptedPassportElement] -> ShowS
$cshowList :: [EncryptedPassportElement] -> ShowS
show :: EncryptedPassportElement -> String
$cshow :: EncryptedPassportElement -> String
showsPrec :: Int -> EncryptedPassportElement -> ShowS
$cshowsPrec :: Int -> EncryptedPassportElement -> ShowS
Show)


-- | One of “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport”, “address”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”, “phone_number”, “email”.
data PassportElementType
  = PassportElementTypePersonalDetails
  | PassportElementTypePassport
  | PassportElementTypeDriverLicense
  | PassportElementTypeIdentityCard
  | PassportElementTypeInternalPassport
  | PassportElementTypeAddress
  | PassportElementTypeUtilityBill
  | PassportElementTypeBankStatement
  | PassportElementTypeRentalAgreement
  | PassportElementTypePassportRegistration
  | PassportElementTypeTemporaryRegistration
  | PassportElementTypePhoneNumber
  | PassportElementTypeEmail
  deriving (forall x. Rep PassportElementType x -> PassportElementType
forall x. PassportElementType -> Rep PassportElementType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PassportElementType x -> PassportElementType
$cfrom :: forall x. PassportElementType -> Rep PassportElementType x
Generic, Int -> PassportElementType -> ShowS
[PassportElementType] -> ShowS
PassportElementType -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PassportElementType] -> ShowS
$cshowList :: [PassportElementType] -> ShowS
show :: PassportElementType -> String
$cshow :: PassportElementType -> String
showsPrec :: Int -> PassportElementType -> ShowS
$cshowsPrec :: Int -> PassportElementType -> ShowS
Show)

-- ** 'EncryptedCredentials'

-- | Contains data required for decrypting and authenticating EncryptedPassportElement. See the Telegram Passport Documentation for a complete description of the data decryption and authentication processes.
data EncryptedCredentials = EncryptedCredentials
  { EncryptedCredentials -> Text
encryptedCredentialsData   :: Text -- ^ Base64-encoded encrypted JSON-serialized data with unique user's payload, data hashes and secrets required for EncryptedPassportElement decryption and authentication.
  , EncryptedCredentials -> Text
encryptedCredentialsHash   :: Text -- ^ Base64-encoded data hash for data authentication.
  , EncryptedCredentials -> Text
encryptedCredentialsSecret :: Text -- ^ Base64-encoded secret, encrypted with the bot's public RSA key, required for data decryption
  }
  deriving (forall x. Rep EncryptedCredentials x -> EncryptedCredentials
forall x. EncryptedCredentials -> Rep EncryptedCredentials x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EncryptedCredentials x -> EncryptedCredentials
$cfrom :: forall x. EncryptedCredentials -> Rep EncryptedCredentials x
Generic, Int -> EncryptedCredentials -> ShowS
[EncryptedCredentials] -> ShowS
EncryptedCredentials -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EncryptedCredentials] -> ShowS
$cshowList :: [EncryptedCredentials] -> ShowS
show :: EncryptedCredentials -> String
$cshow :: EncryptedCredentials -> String
showsPrec :: Int -> EncryptedCredentials -> ShowS
$cshowsPrec :: Int -> EncryptedCredentials -> ShowS
Show)

-- ** 'PassportElementError'

data PassportErrorSource
  = PassportErrorSourceData
  | PassportErrorSourceFrontSide
  | PassportErrorSourceReverseSide
  | PassportErrorSourceSelfie
  | PassportErrorSourceFile
  | PassportErrorSourceFiles
  | PassportErrorSourceTranslationFile
  | PassportErrorSourceTranslationFiles
  | PassportErrorSourceUnspecified
  deriving (forall x. Rep PassportErrorSource x -> PassportErrorSource
forall x. PassportErrorSource -> Rep PassportErrorSource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PassportErrorSource x -> PassportErrorSource
$cfrom :: forall x. PassportErrorSource -> Rep PassportErrorSource x
Generic, Int -> PassportErrorSource -> ShowS
[PassportErrorSource] -> ShowS
PassportErrorSource -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PassportErrorSource] -> ShowS
$cshowList :: [PassportErrorSource] -> ShowS
show :: PassportErrorSource -> String
$cshow :: PassportErrorSource -> String
showsPrec :: Int -> PassportErrorSource -> ShowS
$cshowsPrec :: Int -> PassportErrorSource -> ShowS
Show)

data PassportElementError
  = PassportElementError
    { PassportElementError -> PassportErrorSource
passportElementErroSource       :: PassportErrorSource -- ^ Error source, must be one of 'PassportErrorSource'.
    , PassportElementError -> PassportElementType
passportElementErrorType        :: PassportElementType -- ^ The section of the user's Telegram Passport which has the error, one of 'PassportElementType'.
    , PassportElementError -> Text
passportElementErrorName        :: Text                -- ^ Name of the data field which has the error.
    , PassportElementError -> Maybe Text
passportElementErrorHash        :: Maybe Text          -- ^ Base64-encoded data hash.
    , PassportElementError -> Text
passportElementErrorMessage     :: Text                -- ^ Error message.
    , PassportElementError -> Maybe Text
passportElementErrorFileHash    :: Maybe Text          -- ^ Base64-encoded hash of the file with the reverse side of the document.
    , PassportElementError -> Maybe [Text]
passportElementErrorFileHashes  :: Maybe [Text]        -- ^ List of base64-encoded file hashes.
    , PassportElementError -> Maybe Text
passportElementErrorElementHash :: Maybe Text          -- ^ Base64-encoded element hash.
    }
    deriving (forall x. Rep PassportElementError x -> PassportElementError
forall x. PassportElementError -> Rep PassportElementError x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PassportElementError x -> PassportElementError
$cfrom :: forall x. PassportElementError -> Rep PassportElementError x
Generic, Int -> PassportElementError -> ShowS
[PassportElementError] -> ShowS
PassportElementError -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PassportElementError] -> ShowS
$cshowList :: [PassportElementError] -> ShowS
show :: PassportElementError -> String
$cshow :: PassportElementError -> String
showsPrec :: Int -> PassportElementError -> ShowS
$cshowsPrec :: Int -> PassportElementError -> ShowS
Show)

-- * Games

-- | Your bot can offer users HTML5 games to play solo or to compete against each other in groups and one-on-one chats. Create games via @BotFather using the /newgame command. Please note that this kind of power requires responsibility: you will need to accept the terms for each game that your bots will be offering.
-- 
-- Games are a new type of content on Telegram, represented by the Game and InlineQueryResultGame objects.
-- Once you've created a game via BotFather, you can send games to chats as regular messages using the sendGame method, or use inline mode with InlineQueryResultGame.
-- If you send the game message without any buttons, it will automatically have a 'Play GameName' button. When this button is pressed, your bot gets a CallbackQuery with the game_short_name of the requested game. You provide the correct URL for this particular user and the app opens the game in the in-app browser.
-- You can manually add multiple buttons to your game message. Please note that the first button in the first row must always launch the game, using the field callback_game in InlineKeyboardButton. You can add extra buttons according to taste: e.g., for a description of the rules, or to open the game's official community.
-- To make your game more attractive, you can upload a GIF animation that demostrates the game to the users via BotFather (see Lumberjack for example).
-- A game message will also display high scores for the current chat. Use setGameScore to post high scores to the chat with the game, add the edit_message parameter to automatically update the message with the current scoreboard.
-- Use getGameHighScores to get data for in-game high score tables.
-- You can also add an extra sharing button for users to share their best score to different chats.
-- For examples of what can be done using this new stuff, check the @gamebot and @gamee bots.

-- ** 'Game'

-- | This object represents a game. Use BotFather to create and edit games, their short names will act as unique identifiers.
data Game = Game
  { Game -> Text
gameTitle        :: Text                  -- ^ Title of the game.
  , Game -> Text
gameDescription  :: Text                  -- ^ Description of the game.
  , Game -> [PhotoSize]
gamePhoto        :: [PhotoSize]           -- ^ Photo that will be displayed in the game message in chats.
  , Game -> Maybe Text
gameText         :: Maybe Text            -- ^ Brief description of the game or high scores included in the game message. Can be automatically edited to include current high scores for the game when the bot calls setGameScore, or manually edited using editMessageText. 0-4096 characters.
  , Game -> Maybe [MessageEntity]
gameTextEntities :: Maybe [MessageEntity] -- ^ Special entities that appear in text, such as usernames, URLs, bot commands, etc.
  , Game -> Maybe Animation
gameAnimation    :: Maybe Animation       -- ^ Animation that will be displayed in the game message in chats. Upload via @BotFather@.
  }
  deriving (forall x. Rep Game x -> Game
forall x. Game -> Rep Game x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Game x -> Game
$cfrom :: forall x. Game -> Rep Game x
Generic, Int -> Game -> ShowS
[Game] -> ShowS
Game -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Game] -> ShowS
$cshowList :: [Game] -> ShowS
show :: Game -> String
$cshow :: Game -> String
showsPrec :: Int -> Game -> ShowS
$cshowsPrec :: Int -> Game -> ShowS
Show)

-- ** 'CallbackGame'

-- | A placeholder, currently holds no information. Use BotFather to set up your game.
newtype CallbackGame = CallbackGame Object
  deriving (forall x. Rep CallbackGame x -> CallbackGame
forall x. CallbackGame -> Rep CallbackGame x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CallbackGame x -> CallbackGame
$cfrom :: forall x. CallbackGame -> Rep CallbackGame x
Generic, Int -> CallbackGame -> ShowS
[CallbackGame] -> ShowS
CallbackGame -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CallbackGame] -> ShowS
$cshowList :: [CallbackGame] -> ShowS
show :: CallbackGame -> String
$cshow :: CallbackGame -> String
showsPrec :: Int -> CallbackGame -> ShowS
$cshowsPrec :: Int -> CallbackGame -> ShowS
Show)

-- ** 'GameHighScore'

-- | This object represents one row of the high scores table for a game.
data GameHighScore = GameHighScore
  { GameHighScore -> Int
gameHighScorePosition :: Int -- ^ Position in high score table for the game.
  , GameHighScore -> User
gameHighScoreUser     :: User  -- ^ User.
  , GameHighScore -> Int
gameHighScoreScore    :: Int -- ^ Score.
  }
  deriving (forall x. Rep GameHighScore x -> GameHighScore
forall x. GameHighScore -> Rep GameHighScore x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GameHighScore x -> GameHighScore
$cfrom :: forall x. GameHighScore -> Rep GameHighScore x
Generic, Int -> GameHighScore -> ShowS
[GameHighScore] -> ShowS
GameHighScore -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GameHighScore] -> ShowS
$cshowList :: [GameHighScore] -> ShowS
show :: GameHighScore -> String
$cshow :: GameHighScore -> String
showsPrec :: Int -> GameHighScore -> ShowS
$cshowsPrec :: Int -> GameHighScore -> ShowS
Show)

-- ** 'CopyMessageId'

-- | This object represents result of copyMessage request.
data CopyMessageId = CopyMessageId
  { CopyMessageId -> MessageId
copyMessageIdMessageId :: MessageId -- ^ the MessageId of the sent message.
  }
  deriving (forall x. Rep CopyMessageId x -> CopyMessageId
forall x. CopyMessageId -> Rep CopyMessageId x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CopyMessageId x -> CopyMessageId
$cfrom :: forall x. CopyMessageId -> Rep CopyMessageId x
Generic, Int -> CopyMessageId -> ShowS
[CopyMessageId] -> ShowS
CopyMessageId -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CopyMessageId] -> ShowS
$cshowList :: [CopyMessageId] -> ShowS
show :: CopyMessageId -> String
$cshow :: CopyMessageId -> String
showsPrec :: Int -> CopyMessageId -> ShowS
$cshowsPrec :: Int -> CopyMessageId -> ShowS
Show)


-- | Unique identifier for the target chat
-- or username of the target channel (in the format @\@channelusername@).
data SomeChatId
  = SomeChatId ChatId       -- ^ Unique chat ID.
  | SomeChatUsername Text   -- ^ Username of the target channel.
  deriving (forall x. Rep SomeChatId x -> SomeChatId
forall x. SomeChatId -> Rep SomeChatId x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SomeChatId x -> SomeChatId
$cfrom :: forall x. SomeChatId -> Rep SomeChatId x
Generic)

instance ToJSON   SomeChatId where toJSON :: SomeChatId -> Value
toJSON = forall a. (Generic a, GSomeJSON (Rep a)) => a -> Value
genericSomeToJSON
instance FromJSON SomeChatId where parseJSON :: Value -> Parser SomeChatId
parseJSON = forall a. (Generic a, GSomeJSON (Rep a)) => Value -> Parser a
genericSomeParseJSON

instance ToHttpApiData SomeChatId where
  toUrlPiece :: SomeChatId -> Text
toUrlPiece (SomeChatId ChatId
chatid) = forall a. ToHttpApiData a => a -> Text
toUrlPiece ChatId
chatid
  toUrlPiece (SomeChatUsername Text
name) = Text
name
  
-- | This object represents a bot command.
data BotCommand = BotCommand
  { BotCommand -> Text
botCommandCommand :: Text -- ^ Text of the command; 1-32 characters. Can contain only lowercase English letters, digits and underscores.
  , BotCommand -> Text
botCommandDescription :: Text -- ^ Description of the command; 1-256 characters.
  }
  deriving (forall x. Rep BotCommand x -> BotCommand
forall x. BotCommand -> Rep BotCommand x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BotCommand x -> BotCommand
$cfrom :: forall x. BotCommand -> Rep BotCommand x
Generic, Int -> BotCommand -> ShowS
[BotCommand] -> ShowS
BotCommand -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BotCommand] -> ShowS
$cshowList :: [BotCommand] -> ShowS
show :: BotCommand -> String
$cshow :: BotCommand -> String
showsPrec :: Int -> BotCommand -> ShowS
$cshowsPrec :: Int -> BotCommand -> ShowS
Show)

data BotCommandScope
  = BotCommandScopeDefault -- ^ Represents the default scope of bot commands. Default commands are used if no commands with a narrower scope are specified for the user.
  | BotCommandScopeAllPrivateChats -- ^ Represents the scope of bot commands, covering all private chats.
  | BotCommandScopeAllGroupChats -- ^ Represents the scope of bot commands, covering all group and supergroup chats.
  | BotCommandScopeAllChatAdministrators -- ^ Represents the scope of bot commands, covering all group and supergroup chat administrators.
  | BotCommandScopeChat SomeChatId -- ^ Represents the scope of bot commands, covering a specific chat.
  | BotCommandScopeChatAdministrators SomeChatId -- ^ Represents the scope of bot commands, covering all administrators of a specific group or supergroup chat.
  | BotCommandScopeChatMember SomeChatId UserId -- ^ Represents the scope of bot commands, covering a specific member of a group or supergroup chat.

addType :: Text -> [Pair] -> [Pair]
addType :: Text -> [Pair] -> [Pair]
addType Text
name [Pair]
xs = (Key
"type" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text
name) forall a. a -> [a] -> [a]
: [Pair]
xs

instance ToJSON BotCommandScope where
  toJSON :: BotCommandScope -> Value
toJSON = \case
    BotCommandScope
BotCommandScopeDefault ->
      [Pair] -> Value
object forall a b. (a -> b) -> a -> b
$ Text -> [Pair] -> [Pair]
addType Text
"default" []
    BotCommandScope
BotCommandScopeAllPrivateChats ->
      [Pair] -> Value
object forall a b. (a -> b) -> a -> b
$ Text -> [Pair] -> [Pair]
addType Text
"all_private_chats" []
    BotCommandScope
BotCommandScopeAllGroupChats ->
      [Pair] -> Value
object forall a b. (a -> b) -> a -> b
$ Text -> [Pair] -> [Pair]
addType Text
"all_group_chats" []
    BotCommandScope
BotCommandScopeAllChatAdministrators ->
      [Pair] -> Value
object forall a b. (a -> b) -> a -> b
$ Text -> [Pair] -> [Pair]
addType Text
"all_chat_administrators" []
    BotCommandScopeChat SomeChatId
sci ->
      [Pair] -> Value
object forall a b. (a -> b) -> a -> b
$ Text -> [Pair] -> [Pair]
addType Text
"chat" [Key
"chat_id" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= SomeChatId
sci]
    BotCommandScopeChatAdministrators SomeChatId
sci ->
      [Pair] -> Value
object forall a b. (a -> b) -> a -> b
$ Text -> [Pair] -> [Pair]
addType Text
"chat_administrators" [Key
"chat_id" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= SomeChatId
sci]
    BotCommandScopeChatMember SomeChatId
sci UserId
ui ->
      [Pair] -> Value
object forall a b. (a -> b) -> a -> b
$ Text -> [Pair] -> [Pair]
addType Text
"chat_member" [Key
"chat_id" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= SomeChatId
sci, Key
"user_id" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= UserId
ui]

instance FromJSON BotCommandScope where
  parseJSON :: Value -> Parser BotCommandScope
parseJSON = forall a. String -> (Object -> Parser a) -> Value -> Parser a
withObject String
"BotCommandScope" \Object
o ->
    (Object
o forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"type" :: Parser Text) forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \case
    Text
"default" ->                forall (f :: * -> *) a. Applicative f => a -> f a
pure BotCommandScope
BotCommandScopeDefault
    Text
"all_private_chats" ->      forall (f :: * -> *) a. Applicative f => a -> f a
pure BotCommandScope
BotCommandScopeAllPrivateChats
    Text
"all_group_chats" ->        forall (f :: * -> *) a. Applicative f => a -> f a
pure BotCommandScope
BotCommandScopeAllGroupChats
    Text
"all_chat_administrators"-> forall (f :: * -> *) a. Applicative f => a -> f a
pure BotCommandScope
BotCommandScopeAllChatAdministrators
    Text
"chat" ->                        SomeChatId -> BotCommandScope
BotCommandScopeChat forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
o forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"chat_id"
    Text
"chat_administrators"->          SomeChatId -> BotCommandScope
BotCommandScopeChatAdministrators forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
o forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"chat_id"
    Text
"chat_member"->                  SomeChatId -> UserId -> BotCommandScope
BotCommandScopeChatMember forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
o forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"chat_id" forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
o forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"user_id"
    Text
t -> forall (m :: * -> *) a. MonadFail m => String -> m a
fail forall a b. (a -> b) -> a -> b
$ Text -> String
Text.unpack (Text
"Unknown type: " forall a. Semigroup a => a -> a -> a
<> Text
t)


-- | Generic fields for all InputMedia structures
data InputMediaGeneric = InputMediaGeneric
  { InputMediaGeneric -> InputFile
inputMediaGenericMedia :: InputFile -- ^ File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name.
  , InputMediaGeneric -> Maybe Text
inputMediaGenericCaption :: Maybe Text -- ^ Caption of the photo to be sent, 0-1024 characters after entities parsing.
  , InputMediaGeneric -> Maybe Text
inputMediaGenericParseMode :: Maybe Text -- ^ Mode for parsing entities in the photo caption. See formatting options <https:\/\/core.telegram.org\/bots\/api#formatting-options> for more details.
  , InputMediaGeneric -> Maybe [MessageEntity]
inputMediaGenericCaptionEntities :: Maybe [MessageEntity] -- ^ List of special entities that appear in the caption, which can be specified instead of parse_mode.
  }
  deriving forall x. Rep InputMediaGeneric x -> InputMediaGeneric
forall x. InputMediaGeneric -> Rep InputMediaGeneric x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InputMediaGeneric x -> InputMediaGeneric
$cfrom :: forall x. InputMediaGeneric -> Rep InputMediaGeneric x
Generic

data InputMediaGenericThumb = InputMediaGenericThumb
  { InputMediaGenericThumb -> InputMediaGeneric
inputMediaGenericGeneric :: InputMediaGeneric
  , InputMediaGenericThumb -> Maybe InputFile
inputMediaGenericThumb :: Maybe InputFile -- ^ Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. 
  }

data InputMedia
  = InputMediaPhoto InputMediaGeneric -- ^ Represents a photo to be sent.
  | InputMediaVideo -- ^ Represents a video to be sent.
    { InputMedia -> InputMediaGenericThumb
inputMediaVideoGeneric :: InputMediaGenericThumb
    , InputMedia -> Maybe Integer
inputMediaVideoWidth :: Maybe Integer -- ^ Video width
    , InputMedia -> Maybe Integer
inputMediaVideoHeight :: Maybe Integer -- ^ Video height
    , InputMedia -> Maybe Integer
inputMediaVideoDuration :: Maybe Integer -- ^ Video duration in seconds
    , InputMedia -> Maybe Bool
inputMediaVideoSupportsStreaming :: Maybe Bool -- ^ Pass True, if the uploaded video is suitable for streaming
    }
  | InputMediaAnimation -- ^ Represents an animation file (GIF or H.264/MPEG-4 AVC video without sound) to be sent.
    { InputMedia -> InputMediaGenericThumb
inputMediaAnimationGeneric :: InputMediaGenericThumb
    , InputMedia -> Maybe Integer
inputMediaAnimationWidth :: Maybe Integer -- ^ Animation width
    , InputMedia -> Maybe Integer
inputMediaAnimationHeight :: Maybe Integer -- ^ Animation height
    , InputMedia -> Maybe Integer
inputMediaAnimationDuration :: Maybe Integer -- ^ Animation duration in seconds
    }
  | InputMediaAudio -- ^ Represents an audio file to be treated as music to be sent.
    { InputMedia -> InputMediaGenericThumb
inputMediaAudioGeneric :: InputMediaGenericThumb
    , InputMedia -> Maybe Integer
inputMediaAudioDuration :: Maybe Integer -- ^ Duration of the audio in seconds
    , InputMedia -> Maybe Text
inputMediaAudioPerformer :: Maybe Text -- ^ Performer of the audio
    , InputMedia -> Maybe Text
inputMediaAudioTitle :: Maybe Text -- ^ Title of the audio
    }
  | InputMediaDocument -- ^ Represents a general file to be sent.
    { InputMedia -> InputMediaGenericThumb
inputMediaDocumentGeneric :: InputMediaGenericThumb
    , InputMedia -> Maybe Bool
inputMediaDocumentDisableContentTypeDetection :: Maybe Bool -- ^ Disables automatic server-side content type detection for files uploaded using multipart/form-data. Always True, if the document is sent as part of an album.
    }

foldMap deriveJSON'
  [ ''User
  , ''Chat
  , ''Message
  , ''MessageEntityType
  , ''MessageEntity
  , ''PhotoSize
  , ''Audio
  , ''Document
  , ''StickerSetType
  , ''Sticker
  , ''Video
  , ''Voice
  , ''VideoNote
  , ''Contact
  , ''Location
  , ''Venue
  , ''UserProfilePhotos
  , ''File
  , ''ReplyKeyboardMarkup
  , ''KeyboardButton
  , ''ReplyKeyboardRemove
  , ''InlineKeyboardMarkup
  , ''InlineKeyboardButton
  , ''CallbackQuery
  , ''ForceReply
  , ''ChatPhoto
  , ''ChatMember
  , ''ResponseParameters
  , ''MaskPosition
  , ''CallbackGame
  , ''Animation
  , ''Dice
  , ''Game
  , ''Poll
  , ''PollOption
  , ''MessageAutoDeleteTimerChanged
  , ''Invoice
  , ''SuccessfulPayment
  , ''OrderInfo
  , ''ShippingAddress
  , ''PassportData
  , ''EncryptedPassportElement
  , ''PassportElementType
  , ''PassportFile
  , ''PassportElementError
  , ''PassportErrorSource
  , ''EncryptedCredentials
  , ''ProximityAlertTriggered
  , ''VideoChatScheduled
  , ''VideoChatStarted
  , ''VideoChatEnded
  , ''VideoChatParticipantsInvited
  , ''ChatPermissions
  , ''ChatLocation
  , ''StickerSet
  , ''BotCommand
  , ''ChatInviteLink
  , ''LabeledPrice
  , ''ShippingOption
  , ''ShippingQuery
  , ''PreCheckoutQuery
  , ''WebAppData
  , ''WebAppInfo
  , ''ChatAdministratorRights
  , ''CopyMessageId
  ]

instance ToJSON InputMediaGeneric where toJSON :: InputMediaGeneric -> Value
toJSON = forall a (d :: Meta) (f :: * -> *).
(Generic a, GToJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
a -> Value
gtoJSON

instance ToHttpApiData PassportElementError where
  toUrlPiece :: PassportElementError -> Text
toUrlPiece = Text -> Text
TL.toStrict forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. ToJSON a => a -> Text
encodeToLazyText

instance ToHttpApiData [PassportElementError] where
  toUrlPiece :: [PassportElementError] -> Text
toUrlPiece = Text -> Text
TL.toStrict forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. ToJSON a => a -> Text
encodeToLazyText

instance ToMultipart Tmp InputMediaGeneric where
  toMultipart :: InputMediaGeneric -> MultipartData Tmp
toMultipart InputMediaGeneric{Maybe [MessageEntity]
Maybe Text
InputFile
inputMediaGenericCaptionEntities :: Maybe [MessageEntity]
inputMediaGenericParseMode :: Maybe Text
inputMediaGenericCaption :: Maybe Text
inputMediaGenericMedia :: InputFile
$sel:inputMediaGenericCaptionEntities:InputMediaGeneric :: InputMediaGeneric -> Maybe [MessageEntity]
$sel:inputMediaGenericParseMode:InputMediaGeneric :: InputMediaGeneric -> Maybe Text
$sel:inputMediaGenericCaption:InputMediaGeneric :: InputMediaGeneric -> Maybe Text
$sel:inputMediaGenericMedia:InputMediaGeneric :: InputMediaGeneric -> InputFile
..} = Text -> InputFile -> MultipartData Tmp -> MultipartData Tmp
makeFile Text
"media" InputFile
inputMediaGenericMedia (forall tag. [Input] -> [FileData tag] -> MultipartData tag
MultipartData [Input]
fields []) where
    fields :: [Input]
fields = forall a. [Maybe a] -> [a]
catMaybes
      [ Maybe Text
inputMediaGenericCaption forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&>
        \Text
t -> Text -> Text -> Input
Input Text
"caption" Text
t
      , Maybe Text
inputMediaGenericParseMode forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&>
        \Text
t -> Text -> Text -> Input
Input Text
"parse_mode" Text
t
      , Maybe [MessageEntity]
inputMediaGenericCaptionEntities forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&>
        \[MessageEntity]
t -> Text -> Text -> Input
Input Text
"caption_entities" (Text -> Text
TL.toStrict forall a b. (a -> b) -> a -> b
$ forall a. ToJSON a => a -> Text
encodeToLazyText [MessageEntity]
t)
      ]

instance ToJSON InputMediaGenericThumb where
  toJSON :: InputMediaGenericThumb -> Value
toJSON InputMediaGenericThumb{Maybe InputFile
InputMediaGeneric
inputMediaGenericThumb :: Maybe InputFile
inputMediaGenericGeneric :: InputMediaGeneric
$sel:inputMediaGenericThumb:InputMediaGenericThumb :: InputMediaGenericThumb -> Maybe InputFile
$sel:inputMediaGenericGeneric:InputMediaGenericThumb :: InputMediaGenericThumb -> InputMediaGeneric
..}
    = Value -> [Pair] -> Value
addJsonFields (forall a. ToJSON a => a -> Value
toJSON InputMediaGeneric
inputMediaGenericGeneric)
      [Key
"thumb" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Maybe InputFile
inputMediaGenericThumb]

instance ToMultipart Tmp InputMediaGenericThumb where
  toMultipart :: InputMediaGenericThumb -> MultipartData Tmp
toMultipart = \case
    InputMediaGenericThumb InputMediaGeneric
generic Maybe InputFile
Nothing -> forall tag a. ToMultipart tag a => a -> MultipartData tag
toMultipart InputMediaGeneric
generic
    InputMediaGenericThumb InputMediaGeneric
generic (Just InputFile
thumb) -> Text -> InputFile -> MultipartData Tmp -> MultipartData Tmp
makeFile Text
"thumb" InputFile
thumb (forall tag a. ToMultipart tag a => a -> MultipartData tag
toMultipart InputMediaGeneric
generic)

instance ToJSON InputMedia where
  toJSON :: InputMedia -> Value
toJSON = \case
    InputMediaPhoto InputMediaGeneric
img ->
      Value -> [Pair] -> Value
addJsonFields (forall a. ToJSON a => a -> Value
toJSON InputMediaGeneric
img) (Text -> [Pair] -> [Pair]
addType Text
"photo" [])
    InputMediaVideo InputMediaGenericThumb
imgt Maybe Integer
width Maybe Integer
height Maybe Integer
duration Maybe Bool
streaming ->
      Value -> [Pair] -> Value
addJsonFields (forall a. ToJSON a => a -> Value
toJSON InputMediaGenericThumb
imgt)
                (Text -> [Pair] -> [Pair]
addType Text
"video"
                [ Key
"width" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Maybe Integer
width
                , Key
"height" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Maybe Integer
height
                , Key
"duration" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Maybe Integer
duration
                , Key
"support_streaming" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Maybe Bool
streaming
                ])
    InputMediaAnimation InputMediaGenericThumb
imgt Maybe Integer
width Maybe Integer
height Maybe Integer
duration ->
      Value -> [Pair] -> Value
addJsonFields (forall a. ToJSON a => a -> Value
toJSON InputMediaGenericThumb
imgt)
                (Text -> [Pair] -> [Pair]
addType Text
"animation"
                [ Key
"width" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Maybe Integer
width
                , Key
"height" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Maybe Integer
height
                , Key
"duration" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Maybe Integer
duration
                ])
    InputMediaAudio InputMediaGenericThumb
imgt Maybe Integer
duration Maybe Text
performer Maybe Text
title ->
      Value -> [Pair] -> Value
addJsonFields (forall a. ToJSON a => a -> Value
toJSON InputMediaGenericThumb
imgt)
                (Text -> [Pair] -> [Pair]
addType Text
"audio"
                [ Key
"duration" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Maybe Integer
duration
                , Key
"performer" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
performer
                , Key
"title" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
title
                ])
    InputMediaDocument InputMediaGenericThumb
imgt Maybe Bool
dctd ->
      Value -> [Pair] -> Value
addJsonFields (forall a. ToJSON a => a -> Value
toJSON InputMediaGenericThumb
imgt)
                (Text -> [Pair] -> [Pair]
addType Text
"document" [Key
"disable_content_type_detection" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Maybe Bool
dctd])



instance ToMultipart Tmp InputMedia where
  toMultipart :: InputMedia -> MultipartData Tmp
toMultipart = let
    in \case
    InputMediaPhoto InputMediaGeneric
img ->
      forall tag. [Input] -> MultipartData tag -> MultipartData tag
addMultipartFields
      [ Text -> Text -> Input
Input Text
"type" Text
"photo"
      ] (forall tag a. ToMultipart tag a => a -> MultipartData tag
toMultipart InputMediaGeneric
img)
    InputMediaVideo InputMediaGenericThumb
imgt Maybe Integer
width Maybe Integer
height Maybe Integer
duration Maybe Bool
streaming ->
      forall tag. [Input] -> MultipartData tag -> MultipartData tag
addMultipartFields
      (Text -> Text -> Input
Input Text
"type" Text
"video"
      forall a. a -> [a] -> [a]
: forall a. [Maybe a] -> [a]
catMaybes 
      [ Maybe Integer
width forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&>
        \Integer
t -> Text -> Text -> Input
Input Text
"width" (Text -> Text
TL.toStrict forall a b. (a -> b) -> a -> b
$ forall a. ToJSON a => a -> Text
encodeToLazyText Integer
t)
      , Maybe Integer
height forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&>
        \Integer
t -> Text -> Text -> Input
Input Text
"height" (Text -> Text
TL.toStrict forall a b. (a -> b) -> a -> b
$ forall a. ToJSON a => a -> Text
encodeToLazyText Integer
t)
      , Maybe Integer
duration forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&>
        \Integer
t -> Text -> Text -> Input
Input Text
"duration" (Text -> Text
TL.toStrict forall a b. (a -> b) -> a -> b
$ forall a. ToJSON a => a -> Text
encodeToLazyText Integer
t)
      , Maybe Bool
streaming forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&>
        \Bool
t -> Text -> Text -> Input
Input Text
"support_streaming" (forall a. a -> a -> Bool -> a
bool Text
"false" Text
"true" Bool
t)
      ]) (forall tag a. ToMultipart tag a => a -> MultipartData tag
toMultipart InputMediaGenericThumb
imgt)
    InputMediaAnimation InputMediaGenericThumb
imgt Maybe Integer
width Maybe Integer
height Maybe Integer
duration ->
      forall tag. [Input] -> MultipartData tag -> MultipartData tag
addMultipartFields
      (Text -> Text -> Input
Input Text
"type" Text
"animation"
      forall a. a -> [a] -> [a]
: forall a. [Maybe a] -> [a]
catMaybes 
      [ Maybe Integer
width forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&>
        \Integer
t -> Text -> Text -> Input
Input Text
"width" (Text -> Text
TL.toStrict forall a b. (a -> b) -> a -> b
$ forall a. ToJSON a => a -> Text
encodeToLazyText Integer
t)
      , Maybe Integer
height forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&>
        \Integer
t -> Text -> Text -> Input
Input Text
"height" (Text -> Text
TL.toStrict forall a b. (a -> b) -> a -> b
$ forall a. ToJSON a => a -> Text
encodeToLazyText Integer
t)
      , Maybe Integer
duration forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&>
        \Integer
t -> Text -> Text -> Input
Input Text
"duration" (Text -> Text
TL.toStrict forall a b. (a -> b) -> a -> b
$ forall a. ToJSON a => a -> Text
encodeToLazyText Integer
t)
      ]) (forall tag a. ToMultipart tag a => a -> MultipartData tag
toMultipart InputMediaGenericThumb
imgt)
    InputMediaAudio InputMediaGenericThumb
imgt Maybe Integer
duration Maybe Text
performer Maybe Text
title ->
      forall tag. [Input] -> MultipartData tag -> MultipartData tag
addMultipartFields
      (Text -> Text -> Input
Input Text
"type" Text
"audio"
      forall a. a -> [a] -> [a]
: forall a. [Maybe a] -> [a]
catMaybes 
      [ Maybe Integer
duration forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&>
        \Integer
t -> Text -> Text -> Input
Input Text
"duration" (Text -> Text
TL.toStrict forall a b. (a -> b) -> a -> b
$ forall a. ToJSON a => a -> Text
encodeToLazyText Integer
t)
      , Maybe Text
performer forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&>
        \Text
t -> Text -> Text -> Input
Input Text
"performer" Text
t
      , Maybe Text
title forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&>
        \Text
t -> Text -> Text -> Input
Input Text
"title" Text
t
      ]) (forall tag a. ToMultipart tag a => a -> MultipartData tag
toMultipart InputMediaGenericThumb
imgt)
    InputMediaDocument InputMediaGenericThumb
imgt Maybe Bool
dctd ->
      forall tag. [Input] -> MultipartData tag -> MultipartData tag
addMultipartFields
      (Text -> Text -> Input
Input Text
"type" Text
"document"
      forall a. a -> [a] -> [a]
: forall a. [Maybe a] -> [a]
catMaybes 
      [ Maybe Bool
dctd forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> 
         \Bool
t -> Text -> Text -> Input
Input Text
"disable_content_type_detection" (forall a. a -> a -> Bool -> a
bool Text
"false" Text
"true" Bool
t)
      ]) (forall tag a. ToMultipart tag a => a -> MultipartData tag
toMultipart InputMediaGenericThumb
imgt)

-- | Multipart file helper
makeFile :: Text -> InputFile ->  MultipartData Tmp ->  MultipartData Tmp
makeFile :: Text -> InputFile -> MultipartData Tmp -> MultipartData Tmp
makeFile Text
name (InputFile String
path Text
ct) (MultipartData [Input]
fields [FileData Tmp]
files) = 
  forall tag. [Input] -> [FileData tag] -> MultipartData tag
MultipartData 
    (Text -> Text -> Input
Input Text
name (Text
"attach://" forall a. Semigroup a => a -> a -> a
<> Text
name) forall a. a -> [a] -> [a]
: [Input]
fields) 
    (forall tag.
Text -> Text -> Text -> MultipartResult tag -> FileData tag
FileData Text
name (String -> Text
pack forall a b. (a -> b) -> a -> b
$ ShowS
takeFileName String
path) Text
ct String
path forall a. a -> [a] -> [a]
: [FileData Tmp]
files)

makeFile Text
name InputFile
file (MultipartData [Input]
fields [FileData Tmp]
files) = 
  forall tag. [Input] -> [FileData tag] -> MultipartData tag
MultipartData 
    (Text -> Text -> Input
Input Text
name (Text -> Text
TL.toStrict forall a b. (a -> b) -> a -> b
$ forall a. ToJSON a => a -> Text
encodeToLazyText InputFile
file) forall a. a -> [a] -> [a]
: [Input]
fields) 
    [FileData Tmp]
files

instance ToJSON MenuButton where
  toJSON :: MenuButton -> Value
toJSON = \case
    MenuButton
MenuButtonCommands ->
      [Pair] -> Value
object forall a b. (a -> b) -> a -> b
$ Text -> [Pair] -> [Pair]
addType Text
"commands" []
    MenuButtonWebApp Text
txt WebAppInfo
wai ->
      [Pair] -> Value
object forall a b. (a -> b) -> a -> b
$ Text -> [Pair] -> [Pair]
addType Text
"web_app" [Key
"text" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text
txt, Key
"web_app_info" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= WebAppInfo
wai]
    MenuButton
MenuButtonDefault ->
      [Pair] -> Value
object forall a b. (a -> b) -> a -> b
$ Text -> [Pair] -> [Pair]
addType Text
"default" []

instance FromJSON MenuButton where
  parseJSON :: Value -> Parser MenuButton
parseJSON = forall a (d :: Meta) (f :: * -> *).
(Generic a, GFromJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
Value -> Parser a
gparseJSON