{-# 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
(Seconds -> Seconds -> Bool)
-> (Seconds -> Seconds -> Bool) -> Eq Seconds
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
(Int -> Seconds -> ShowS)
-> (Seconds -> String) -> ([Seconds] -> ShowS) -> Show Seconds
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
(Seconds -> Seconds -> Seconds)
-> (Seconds -> Seconds -> Seconds)
-> (Seconds -> Seconds -> Seconds)
-> (Seconds -> Seconds)
-> (Seconds -> Seconds)
-> (Seconds -> Seconds)
-> (Integer -> Seconds)
-> Num 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
(Seconds -> Value)
-> (Seconds -> Encoding)
-> ([Seconds] -> Value)
-> ([Seconds] -> Encoding)
-> ToJSON Seconds
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
(Value -> Parser Seconds)
-> (Value -> Parser [Seconds]) -> FromJSON 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
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
(Int -> User -> ShowS)
-> (User -> String) -> ([User] -> ShowS) -> Show User
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. User -> Rep User x)
-> (forall x. Rep User x -> User) -> Generic User
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
(UserId -> UserId -> Bool)
-> (UserId -> UserId -> Bool) -> Eq UserId
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
(Int -> UserId -> ShowS)
-> (UserId -> String) -> ([UserId] -> ShowS) -> Show UserId
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
(UserId -> Value)
-> (UserId -> Encoding)
-> ([UserId] -> Value)
-> ([UserId] -> Encoding)
-> ToJSON UserId
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
(Value -> Parser UserId)
-> (Value -> Parser [UserId]) -> FromJSON 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 (String -> Text) -> (UserId -> String) -> UserId -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Show Integer => Integer -> String
forall a. Show a => a -> String
show @Integer (Integer -> String) -> (UserId -> Integer) -> UserId -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. UserId -> Integer
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 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. Chat -> Rep Chat x)
-> (forall x. Rep Chat x -> Chat) -> Generic Chat
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
(Int -> Chat -> ShowS)
-> (Chat -> String) -> ([Chat] -> ShowS) -> Show Chat
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
(ChatId -> ChatId -> Bool)
-> (ChatId -> ChatId -> Bool) -> Eq ChatId
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
(Int -> ChatId -> ShowS)
-> (ChatId -> String) -> ([ChatId] -> ShowS) -> Show ChatId
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
(ChatId -> Value)
-> (ChatId -> Encoding)
-> ([ChatId] -> Value)
-> ([ChatId] -> Encoding)
-> ToJSON ChatId
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
(Value -> Parser ChatId)
-> (Value -> Parser [ChatId]) -> FromJSON 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
Eq ChatId
-> (Int -> ChatId -> Int) -> (ChatId -> Int) -> Hashable 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
$cp1Hashable :: Eq ChatId
Hashable)

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

-- | Type of chat.
data ChatType
  = ChatTypePrivate
  | ChatTypeGroup
  | ChatTypeSupergroup
  | ChatTypeChannel
  deriving ((forall x. ChatType -> Rep ChatType x)
-> (forall x. Rep ChatType x -> ChatType) -> Generic ChatType
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
(Int -> ChatType -> ShowS)
-> (ChatType -> String) -> ([ChatType] -> ShowS) -> Show ChatType
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 = ChatType -> Value
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 = Value -> Parser ChatType
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. Message -> Rep Message x)
-> (forall x. Rep Message x -> Message) -> Generic Message
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
(Int -> Message -> ShowS)
-> (Message -> String) -> ([Message] -> ShowS) -> Show Message
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
(MessageId -> MessageId -> Bool)
-> (MessageId -> MessageId -> Bool) -> Eq MessageId
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
(Int -> MessageId -> ShowS)
-> (MessageId -> String)
-> ([MessageId] -> ShowS)
-> Show MessageId
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
(MessageId -> Value)
-> (MessageId -> Encoding)
-> ([MessageId] -> Value)
-> ([MessageId] -> Encoding)
-> ToJSON MessageId
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
(Value -> Parser MessageId)
-> (Value -> Parser [MessageId]) -> FromJSON 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
Eq MessageId
-> (Int -> MessageId -> Int)
-> (MessageId -> Int)
-> Hashable 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
$cp1Hashable :: Eq MessageId
Hashable)

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

-- | The unique identifier of a media message group a message belongs to.
newtype MediaGroupId = MediaGroupId Text
  deriving (MediaGroupId -> MediaGroupId -> Bool
(MediaGroupId -> MediaGroupId -> Bool)
-> (MediaGroupId -> MediaGroupId -> Bool) -> Eq MediaGroupId
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
(Int -> MediaGroupId -> ShowS)
-> (MediaGroupId -> String)
-> ([MediaGroupId] -> ShowS)
-> Show MediaGroupId
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
(MediaGroupId -> Value)
-> (MediaGroupId -> Encoding)
-> ([MediaGroupId] -> Value)
-> ([MediaGroupId] -> Encoding)
-> ToJSON MediaGroupId
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
(Value -> Parser MediaGroupId)
-> (Value -> Parser [MediaGroupId]) -> FromJSON 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.
  }
  deriving ((forall x. MessageEntity -> Rep MessageEntity x)
-> (forall x. Rep MessageEntity x -> MessageEntity)
-> Generic MessageEntity
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
(Int -> MessageEntity -> ShowS)
-> (MessageEntity -> String)
-> ([MessageEntity] -> ShowS)
-> Show MessageEntity
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
  deriving (MessageEntityType -> MessageEntityType -> Bool
(MessageEntityType -> MessageEntityType -> Bool)
-> (MessageEntityType -> MessageEntityType -> Bool)
-> Eq MessageEntityType
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
(Int -> MessageEntityType -> ShowS)
-> (MessageEntityType -> String)
-> ([MessageEntityType] -> ShowS)
-> Show MessageEntityType
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. MessageEntityType -> Rep MessageEntityType x)
-> (forall x. Rep MessageEntityType x -> MessageEntityType)
-> Generic MessageEntityType
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. PhotoSize -> Rep PhotoSize x)
-> (forall x. Rep PhotoSize x -> PhotoSize) -> Generic PhotoSize
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
(Int -> PhotoSize -> ShowS)
-> (PhotoSize -> String)
-> ([PhotoSize] -> ShowS)
-> Show PhotoSize
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
(FileId -> FileId -> Bool)
-> (FileId -> FileId -> Bool) -> Eq FileId
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
(Int -> FileId -> ShowS)
-> (FileId -> String) -> ([FileId] -> ShowS) -> Show FileId
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
(FileId -> Value)
-> (FileId -> Encoding)
-> ([FileId] -> Value)
-> ([FileId] -> Encoding)
-> ToJSON FileId
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
(Value -> Parser FileId)
-> (Value -> Parser [FileId]) -> FromJSON 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 = FileId -> Text
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 Int
animationFileSize     :: Maybe Int     -- ^ File size in bytes.
  }
  deriving ((forall x. Animation -> Rep Animation x)
-> (forall x. Rep Animation x -> Animation) -> Generic Animation
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
(Int -> Animation -> ShowS)
-> (Animation -> String)
-> ([Animation] -> ShowS)
-> Show Animation
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 Int
audioFileSize  :: Maybe Int -- ^ File size in bytes.
  , Audio -> Maybe PhotoSize
audioThumb     :: Maybe PhotoSize -- ^ Thumbnail of the album cover to which the music file belongs.
  }
  deriving ((forall x. Audio -> Rep Audio x)
-> (forall x. Rep Audio x -> Audio) -> Generic Audio
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
(Int -> Audio -> ShowS)
-> (Audio -> String) -> ([Audio] -> ShowS) -> Show Audio
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 Int
documentFileSize :: Maybe Int -- ^ File size in bytes. 
  }
  deriving ((forall x. Document -> Rep Document x)
-> (forall x. Rep Document x -> Document) -> Generic Document
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
(Int -> Document -> ShowS)
-> (Document -> String) -> ([Document] -> ShowS) -> Show Document
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 Int
videoFileSize     :: Maybe Int -- ^ File size in bytes.
  }
  deriving ((forall x. Video -> Rep Video x)
-> (forall x. Rep Video x -> Video) -> Generic Video
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
(Int -> Video -> ShowS)
-> (Video -> String) -> ([Video] -> ShowS) -> Show Video
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 Int
videoNoteFileSize :: Maybe Int -- ^ File size in bytes.
  }
  deriving ((forall x. VideoNote -> Rep VideoNote x)
-> (forall x. Rep VideoNote x -> VideoNote) -> Generic VideoNote
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
(Int -> VideoNote -> ShowS)
-> (VideoNote -> String)
-> ([VideoNote] -> ShowS)
-> Show VideoNote
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 Int
voiceFileSize :: Maybe Int -- ^ File size in bytes.
  }
  deriving ((forall x. Voice -> Rep Voice x)
-> (forall x. Rep Voice x -> Voice) -> Generic Voice
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
(Int -> Voice -> ShowS)
-> (Voice -> String) -> ([Voice] -> ShowS) -> Show Voice
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. Contact -> Rep Contact x)
-> (forall x. Rep Contact x -> Contact) -> Generic Contact
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
(Int -> Contact -> ShowS)
-> (Contact -> String) -> ([Contact] -> ShowS) -> Show Contact
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. Dice -> Rep Dice x)
-> (forall x. Rep Dice x -> Dice) -> Generic Dice
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
(Int -> Dice -> ShowS)
-> (Dice -> String) -> ([Dice] -> ShowS) -> Show Dice
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. PollOption -> Rep PollOption x)
-> (forall x. Rep PollOption x -> PollOption) -> Generic PollOption
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
(Int -> PollOption -> ShowS)
-> (PollOption -> String)
-> ([PollOption] -> ShowS)
-> Show PollOption
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. PollAnswer -> Rep PollAnswer x)
-> (forall x. Rep PollAnswer x -> PollAnswer) -> Generic PollAnswer
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
(Int -> PollAnswer -> ShowS)
-> (PollAnswer -> String)
-> ([PollAnswer] -> ShowS)
-> Show PollAnswer
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
(PollId -> PollId -> Bool)
-> (PollId -> PollId -> Bool) -> Eq PollId
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
(Int -> PollId -> ShowS)
-> (PollId -> String) -> ([PollId] -> ShowS) -> Show PollId
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
(PollId -> Value)
-> (PollId -> Encoding)
-> ([PollId] -> Value)
-> ([PollId] -> Encoding)
-> ToJSON PollId
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
(Value -> Parser PollId)
-> (Value -> Parser [PollId]) -> FromJSON 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. Poll -> Rep Poll x)
-> (forall x. Rep Poll x -> Poll) -> Generic Poll
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
(Int -> Poll -> ShowS)
-> (Poll -> String) -> ([Poll] -> ShowS) -> Show Poll
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. Location -> Rep Location x)
-> (forall x. Rep Location x -> Location) -> Generic Location
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
(Int -> Location -> ShowS)
-> (Location -> String) -> ([Location] -> ShowS) -> Show Location
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. Venue -> Rep Venue x)
-> (forall x. Rep Venue x -> Venue) -> Generic Venue
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
(Int -> Venue -> ShowS)
-> (Venue -> String) -> ([Venue] -> ShowS) -> Show Venue
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.
 ProximityAlertTriggered -> Rep ProximityAlertTriggered x)
-> (forall x.
    Rep ProximityAlertTriggered x -> ProximityAlertTriggered)
-> Generic ProximityAlertTriggered
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
(Int -> ProximityAlertTriggered -> ShowS)
-> (ProximityAlertTriggered -> String)
-> ([ProximityAlertTriggered] -> ShowS)
-> Show ProximityAlertTriggered
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.
 MessageAutoDeleteTimerChanged
 -> Rep MessageAutoDeleteTimerChanged x)
-> (forall x.
    Rep MessageAutoDeleteTimerChanged x
    -> MessageAutoDeleteTimerChanged)
-> Generic MessageAutoDeleteTimerChanged
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
(Int -> MessageAutoDeleteTimerChanged -> ShowS)
-> (MessageAutoDeleteTimerChanged -> String)
-> ([MessageAutoDeleteTimerChanged] -> ShowS)
-> Show MessageAutoDeleteTimerChanged
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. VideoChatScheduled -> Rep VideoChatScheduled x)
-> (forall x. Rep VideoChatScheduled x -> VideoChatScheduled)
-> Generic VideoChatScheduled
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
(Int -> VideoChatScheduled -> ShowS)
-> (VideoChatScheduled -> String)
-> ([VideoChatScheduled] -> ShowS)
-> Show VideoChatScheduled
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. VideoChatStarted -> Rep VideoChatStarted x)
-> (forall x. Rep VideoChatStarted x -> VideoChatStarted)
-> Generic VideoChatStarted
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
(Int -> VideoChatStarted -> ShowS)
-> (VideoChatStarted -> String)
-> ([VideoChatStarted] -> ShowS)
-> Show VideoChatStarted
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. VideoChatEnded -> Rep VideoChatEnded x)
-> (forall x. Rep VideoChatEnded x -> VideoChatEnded)
-> Generic VideoChatEnded
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
(Int -> VideoChatEnded -> ShowS)
-> (VideoChatEnded -> String)
-> ([VideoChatEnded] -> ShowS)
-> Show VideoChatEnded
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.
 VideoChatParticipantsInvited -> Rep VideoChatParticipantsInvited x)
-> (forall x.
    Rep VideoChatParticipantsInvited x -> VideoChatParticipantsInvited)
-> Generic VideoChatParticipantsInvited
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
(Int -> VideoChatParticipantsInvited -> ShowS)
-> (VideoChatParticipantsInvited -> String)
-> ([VideoChatParticipantsInvited] -> ShowS)
-> Show VideoChatParticipantsInvited
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. UserProfilePhotos -> Rep UserProfilePhotos x)
-> (forall x. Rep UserProfilePhotos x -> UserProfilePhotos)
-> Generic UserProfilePhotos
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
(Int -> UserProfilePhotos -> ShowS)
-> (UserProfilePhotos -> String)
-> ([UserProfilePhotos] -> ShowS)
-> Show UserProfilePhotos
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. WebAppData -> Rep WebAppData x)
-> (forall x. Rep WebAppData x -> WebAppData) -> Generic WebAppData
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
(Int -> WebAppData -> ShowS)
-> (WebAppData -> String)
-> ([WebAppData] -> ShowS)
-> Show WebAppData
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 Int
fileFileSize     :: Maybe Int -- ^ 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. File -> Rep File x)
-> (forall x. Rep File x -> File) -> Generic File
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
(Int -> File -> ShowS)
-> (File -> String) -> ([File] -> ShowS) -> Show File
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) = FileId -> Value
forall a. ToJSON a => a -> Value
toJSON FileId
i
  toJSON (FileUrl Text
t) = Text -> Value
forall a. ToJSON a => a -> Value
toJSON Text
t
  toJSON (InputFile String
f Text
_) = Text -> Value
forall a. ToJSON a => a -> Value
toJSON (Text
"attach://" Text -> Text -> Text
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. ReplyKeyboardMarkup -> Rep ReplyKeyboardMarkup x)
-> (forall x. Rep ReplyKeyboardMarkup x -> ReplyKeyboardMarkup)
-> Generic ReplyKeyboardMarkup
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
(Int -> ReplyKeyboardMarkup -> ShowS)
-> (ReplyKeyboardMarkup -> String)
-> ([ReplyKeyboardMarkup] -> ShowS)
-> Show ReplyKeyboardMarkup
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. WebAppInfo -> Rep WebAppInfo x)
-> (forall x. Rep WebAppInfo x -> WebAppInfo) -> Generic WebAppInfo
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
(Int -> WebAppInfo -> ShowS)
-> (WebAppInfo -> String)
-> ([WebAppInfo] -> ShowS)
-> Show WebAppInfo
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. KeyboardButton -> Rep KeyboardButton x)
-> (forall x. Rep KeyboardButton x -> KeyboardButton)
-> Generic KeyboardButton
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
(Int -> KeyboardButton -> ShowS)
-> (KeyboardButton -> String)
-> ([KeyboardButton] -> ShowS)
-> Show KeyboardButton
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 (String -> Text
forall a. IsString a => String -> a
fromString String
s) Maybe Bool
forall a. Maybe a
Nothing Maybe Bool
forall a. Maybe a
Nothing Maybe PollType
forall a. Maybe a
Nothing Maybe WebAppInfo
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. MenuButton -> Rep MenuButton x)
-> (forall x. Rep MenuButton x -> MenuButton) -> Generic MenuButton
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. PollType -> Rep PollType x)
-> (forall x. Rep PollType x -> PollType) -> Generic PollType
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
(Int -> PollType -> ShowS)
-> (PollType -> String) -> ([PollType] -> ShowS) -> Show PollType
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 (Text -> Value) -> (PollType -> Text) -> PollType -> Value
forall b c a. (b -> c) -> (a -> b) -> a -> c
. PollType -> Text
getPollType

instance FromJSON PollType where parseJSON :: Value -> Parser PollType
parseJSON = Value -> Parser PollType
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. ReplyKeyboardRemove -> Rep ReplyKeyboardRemove x)
-> (forall x. Rep ReplyKeyboardRemove x -> ReplyKeyboardRemove)
-> Generic ReplyKeyboardRemove
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
(Int -> ReplyKeyboardRemove -> ShowS)
-> (ReplyKeyboardRemove -> String)
-> ([ReplyKeyboardRemove] -> ShowS)
-> Show ReplyKeyboardRemove
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. InlineKeyboardMarkup -> Rep InlineKeyboardMarkup x)
-> (forall x. Rep InlineKeyboardMarkup x -> InlineKeyboardMarkup)
-> Generic InlineKeyboardMarkup
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
(Int -> InlineKeyboardMarkup -> ShowS)
-> (InlineKeyboardMarkup -> String)
-> ([InlineKeyboardMarkup] -> ShowS)
-> Show InlineKeyboardMarkup
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. InlineKeyboardButton -> Rep InlineKeyboardButton x)
-> (forall x. Rep InlineKeyboardButton x -> InlineKeyboardButton)
-> Generic InlineKeyboardButton
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
(Int -> InlineKeyboardButton -> ShowS)
-> (InlineKeyboardButton -> String)
-> ([InlineKeyboardButton] -> ShowS)
-> Show InlineKeyboardButton
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 Maybe Text
forall a. Maybe a
Nothing Maybe Text
forall a. Maybe a
Nothing Maybe WebAppInfo
forall a. Maybe a
Nothing Maybe Text
forall a. Maybe a
Nothing Maybe Text
forall a. Maybe a
Nothing Maybe CallbackGame
forall a. Maybe a
Nothing Maybe Bool
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. LoginUrl -> Rep LoginUrl x)
-> (forall x. Rep LoginUrl x -> LoginUrl) -> Generic LoginUrl
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
(Int -> LoginUrl -> ShowS)
-> (LoginUrl -> String) -> ([LoginUrl] -> ShowS) -> Show LoginUrl
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. CallbackQuery -> Rep CallbackQuery x)
-> (forall x. Rep CallbackQuery x -> CallbackQuery)
-> Generic CallbackQuery
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
(Int -> CallbackQuery -> ShowS)
-> (CallbackQuery -> String)
-> ([CallbackQuery] -> ShowS)
-> Show CallbackQuery
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
(CallbackQueryId -> CallbackQueryId -> Bool)
-> (CallbackQueryId -> CallbackQueryId -> Bool)
-> Eq CallbackQueryId
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
(Int -> CallbackQueryId -> ShowS)
-> (CallbackQueryId -> String)
-> ([CallbackQueryId] -> ShowS)
-> Show CallbackQueryId
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. CallbackQueryId -> Rep CallbackQueryId x)
-> (forall x. Rep CallbackQueryId x -> CallbackQueryId)
-> Generic CallbackQueryId
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
(CallbackQueryId -> Value)
-> (CallbackQueryId -> Encoding)
-> ([CallbackQueryId] -> Value)
-> ([CallbackQueryId] -> Encoding)
-> ToJSON CallbackQueryId
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
(Value -> Parser CallbackQueryId)
-> (Value -> Parser [CallbackQueryId]) -> FromJSON 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. ForceReply -> Rep ForceReply x)
-> (forall x. Rep ForceReply x -> ForceReply) -> Generic ForceReply
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
(Int -> ForceReply -> ShowS)
-> (ForceReply -> String)
-> ([ForceReply] -> ShowS)
-> Show ForceReply
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. ChatPhoto -> Rep ChatPhoto x)
-> (forall x. Rep ChatPhoto x -> ChatPhoto) -> Generic ChatPhoto
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
(Int -> ChatPhoto -> ShowS)
-> (ChatPhoto -> String)
-> ([ChatPhoto] -> ShowS)
-> Show ChatPhoto
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. ChatInviteLink -> Rep ChatInviteLink x)
-> (forall x. Rep ChatInviteLink x -> ChatInviteLink)
-> Generic ChatInviteLink
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
(Int -> ChatInviteLink -> ShowS)
-> (ChatInviteLink -> String)
-> ([ChatInviteLink] -> ShowS)
-> Show ChatInviteLink
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.
 ChatAdministratorRights -> Rep ChatAdministratorRights x)
-> (forall x.
    Rep ChatAdministratorRights x -> ChatAdministratorRights)
-> Generic ChatAdministratorRights
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
(Int -> ChatAdministratorRights -> ShowS)
-> (ChatAdministratorRights -> String)
-> ([ChatAdministratorRights] -> ShowS)
-> Show ChatAdministratorRights
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. ChatMember -> Rep ChatMember x)
-> (forall x. Rep ChatMember x -> ChatMember) -> Generic ChatMember
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
(Int -> ChatMember -> ShowS)
-> (ChatMember -> String)
-> ([ChatMember] -> ShowS)
-> Show ChatMember
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. ChatMemberUpdated -> Rep ChatMemberUpdated x)
-> (forall x. Rep ChatMemberUpdated x -> ChatMemberUpdated)
-> Generic ChatMemberUpdated
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
(Int -> ChatMemberUpdated -> ShowS)
-> (ChatMemberUpdated -> String)
-> ([ChatMemberUpdated] -> ShowS)
-> Show ChatMemberUpdated
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. ChatJoinRequest -> Rep ChatJoinRequest x)
-> (forall x. Rep ChatJoinRequest x -> ChatJoinRequest)
-> Generic ChatJoinRequest
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
(Int -> ChatJoinRequest -> ShowS)
-> (ChatJoinRequest -> String)
-> ([ChatJoinRequest] -> ShowS)
-> Show ChatJoinRequest
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. ChatPermissions -> Rep ChatPermissions x)
-> (forall x. Rep ChatPermissions x -> ChatPermissions)
-> Generic ChatPermissions
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
(Int -> ChatPermissions -> ShowS)
-> (ChatPermissions -> String)
-> ([ChatPermissions] -> ShowS)
-> Show ChatPermissions
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. ChatLocation -> Rep ChatLocation x)
-> (forall x. Rep ChatLocation x -> ChatLocation)
-> Generic ChatLocation
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
(Int -> ChatLocation -> ShowS)
-> (ChatLocation -> String)
-> ([ChatLocation] -> ShowS)
-> Show ChatLocation
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
(Int -> ResponseParameters -> ShowS)
-> (ResponseParameters -> String)
-> ([ResponseParameters] -> ShowS)
-> Show ResponseParameters
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. ResponseParameters -> Rep ResponseParameters x)
-> (forall x. Rep ResponseParameters x -> ResponseParameters)
-> Generic ResponseParameters
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 MaskPosition
stickerMaskPosition :: Maybe MaskPosition -- ^ For mask stickers, the position where the mask should be placed.
  , Sticker -> Maybe Integer
stickerFileSize     :: Maybe Integer      -- ^ File size in bytes.
  }
  deriving ((forall x. Sticker -> Rep Sticker x)
-> (forall x. Rep Sticker x -> Sticker) -> Generic Sticker
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
(Int -> Sticker -> ShowS)
-> (Sticker -> String) -> ([Sticker] -> ShowS) -> Show Sticker
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 -> Bool
stickerSetIsAnimated    :: Bool            -- ^ 'True', if the sticker set contains animated stickers.
  , StickerSet -> Bool
stickerSetIsVideo       :: Bool            -- ^ 'True', if the sticker is a video sticker.
  , StickerSet -> Bool
stickerSetContainsMasks :: 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. StickerSet -> Rep StickerSet x)
-> (forall x. Rep StickerSet x -> StickerSet) -> Generic StickerSet
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
(Int -> StickerSet -> ShowS)
-> (StickerSet -> String)
-> ([StickerSet] -> ShowS)
-> Show StickerSet
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)

-- ** '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. MaskPosition -> Rep MaskPosition x)
-> (forall x. Rep MaskPosition x -> MaskPosition)
-> Generic MaskPosition
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
(Int -> MaskPosition -> ShowS)
-> (MaskPosition -> String)
-> ([MaskPosition] -> ShowS)
-> Show MaskPosition
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. LabeledPrice -> Rep LabeledPrice x)
-> (forall x. Rep LabeledPrice x -> LabeledPrice)
-> Generic LabeledPrice
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
(Int -> LabeledPrice -> ShowS)
-> (LabeledPrice -> String)
-> ([LabeledPrice] -> ShowS)
-> Show LabeledPrice
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. Invoice -> Rep Invoice x)
-> (forall x. Rep Invoice x -> Invoice) -> Generic Invoice
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
(Int -> Invoice -> ShowS)
-> (Invoice -> String) -> ([Invoice] -> ShowS) -> Show Invoice
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. ShippingAddress -> Rep ShippingAddress x)
-> (forall x. Rep ShippingAddress x -> ShippingAddress)
-> Generic ShippingAddress
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
(Int -> ShippingAddress -> ShowS)
-> (ShippingAddress -> String)
-> ([ShippingAddress] -> ShowS)
-> Show ShippingAddress
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. OrderInfo -> Rep OrderInfo x)
-> (forall x. Rep OrderInfo x -> OrderInfo) -> Generic OrderInfo
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
(Int -> OrderInfo -> ShowS)
-> (OrderInfo -> String)
-> ([OrderInfo] -> ShowS)
-> Show OrderInfo
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. ShippingOption -> Rep ShippingOption x)
-> (forall x. Rep ShippingOption x -> ShippingOption)
-> Generic ShippingOption
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
(Int -> ShippingOption -> ShowS)
-> (ShippingOption -> String)
-> ([ShippingOption] -> ShowS)
-> Show ShippingOption
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
(ShippingOptionId -> ShippingOptionId -> Bool)
-> (ShippingOptionId -> ShippingOptionId -> Bool)
-> Eq ShippingOptionId
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
(Int -> ShippingOptionId -> ShowS)
-> (ShippingOptionId -> String)
-> ([ShippingOptionId] -> ShowS)
-> Show ShippingOptionId
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. ShippingOptionId -> Rep ShippingOptionId x)
-> (forall x. Rep ShippingOptionId x -> ShippingOptionId)
-> Generic ShippingOptionId
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
(ShippingOptionId -> Value)
-> (ShippingOptionId -> Encoding)
-> ([ShippingOptionId] -> Value)
-> ([ShippingOptionId] -> Encoding)
-> ToJSON ShippingOptionId
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
(Value -> Parser ShippingOptionId)
-> (Value -> Parser [ShippingOptionId])
-> FromJSON 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. SuccessfulPayment -> Rep SuccessfulPayment x)
-> (forall x. Rep SuccessfulPayment x -> SuccessfulPayment)
-> Generic SuccessfulPayment
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
(Int -> SuccessfulPayment -> ShowS)
-> (SuccessfulPayment -> String)
-> ([SuccessfulPayment] -> ShowS)
-> Show SuccessfulPayment
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. ShippingQuery -> Rep ShippingQuery x)
-> (forall x. Rep ShippingQuery x -> ShippingQuery)
-> Generic ShippingQuery
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
(Int -> ShippingQuery -> ShowS)
-> (ShippingQuery -> String)
-> ([ShippingQuery] -> ShowS)
-> Show ShippingQuery
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. PreCheckoutQuery -> Rep PreCheckoutQuery x)
-> (forall x. Rep PreCheckoutQuery x -> PreCheckoutQuery)
-> Generic PreCheckoutQuery
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
(Int -> PreCheckoutQuery -> ShowS)
-> (PreCheckoutQuery -> String)
-> ([PreCheckoutQuery] -> ShowS)
-> Show PreCheckoutQuery
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. PassportData -> Rep PassportData x)
-> (forall x. Rep PassportData x -> PassportData)
-> Generic PassportData
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
(Int -> PassportData -> ShowS)
-> (PassportData -> String)
-> ([PassportData] -> ShowS)
-> Show PassportData
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. PassportFile -> Rep PassportFile x)
-> (forall x. Rep PassportFile x -> PassportFile)
-> Generic PassportFile
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
(Int -> PassportFile -> ShowS)
-> (PassportFile -> String)
-> ([PassportFile] -> ShowS)
-> Show PassportFile
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.
 EncryptedPassportElement -> Rep EncryptedPassportElement x)
-> (forall x.
    Rep EncryptedPassportElement x -> EncryptedPassportElement)
-> Generic EncryptedPassportElement
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
(Int -> EncryptedPassportElement -> ShowS)
-> (EncryptedPassportElement -> String)
-> ([EncryptedPassportElement] -> ShowS)
-> Show EncryptedPassportElement
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. PassportElementType -> Rep PassportElementType x)
-> (forall x. Rep PassportElementType x -> PassportElementType)
-> Generic PassportElementType
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
(Int -> PassportElementType -> ShowS)
-> (PassportElementType -> String)
-> ([PassportElementType] -> ShowS)
-> Show PassportElementType
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. EncryptedCredentials -> Rep EncryptedCredentials x)
-> (forall x. Rep EncryptedCredentials x -> EncryptedCredentials)
-> Generic EncryptedCredentials
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
(Int -> EncryptedCredentials -> ShowS)
-> (EncryptedCredentials -> String)
-> ([EncryptedCredentials] -> ShowS)
-> Show EncryptedCredentials
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. PassportErrorSource -> Rep PassportErrorSource x)
-> (forall x. Rep PassportErrorSource x -> PassportErrorSource)
-> Generic PassportErrorSource
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
(Int -> PassportErrorSource -> ShowS)
-> (PassportErrorSource -> String)
-> ([PassportErrorSource] -> ShowS)
-> Show PassportErrorSource
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. PassportElementError -> Rep PassportElementError x)
-> (forall x. Rep PassportElementError x -> PassportElementError)
-> Generic PassportElementError
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
(Int -> PassportElementError -> ShowS)
-> (PassportElementError -> String)
-> ([PassportElementError] -> ShowS)
-> Show PassportElementError
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. Game -> Rep Game x)
-> (forall x. Rep Game x -> Game) -> Generic Game
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
(Int -> Game -> ShowS)
-> (Game -> String) -> ([Game] -> ShowS) -> Show Game
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. CallbackGame -> Rep CallbackGame x)
-> (forall x. Rep CallbackGame x -> CallbackGame)
-> Generic CallbackGame
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
(Int -> CallbackGame -> ShowS)
-> (CallbackGame -> String)
-> ([CallbackGame] -> ShowS)
-> Show CallbackGame
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. GameHighScore -> Rep GameHighScore x)
-> (forall x. Rep GameHighScore x -> GameHighScore)
-> Generic GameHighScore
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
(Int -> GameHighScore -> ShowS)
-> (GameHighScore -> String)
-> ([GameHighScore] -> ShowS)
-> Show GameHighScore
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. CopyMessageId -> Rep CopyMessageId x)
-> (forall x. Rep CopyMessageId x -> CopyMessageId)
-> Generic CopyMessageId
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
(Int -> CopyMessageId -> ShowS)
-> (CopyMessageId -> String)
-> ([CopyMessageId] -> ShowS)
-> Show CopyMessageId
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. SomeChatId -> Rep SomeChatId x)
-> (forall x. Rep SomeChatId x -> SomeChatId) -> Generic SomeChatId
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 = SomeChatId -> Value
forall a. (Generic a, GSomeJSON (Rep a)) => a -> Value
genericSomeToJSON
instance FromJSON SomeChatId where parseJSON :: Value -> Parser SomeChatId
parseJSON = Value -> Parser SomeChatId
forall a. (Generic a, GSomeJSON (Rep a)) => Value -> Parser a
genericSomeParseJSON

instance ToHttpApiData SomeChatId where
  toUrlPiece :: SomeChatId -> Text
toUrlPiece (SomeChatId ChatId
chatid) = ChatId -> Text
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. BotCommand -> Rep BotCommand x)
-> (forall x. Rep BotCommand x -> BotCommand) -> Generic BotCommand
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
(Int -> BotCommand -> ShowS)
-> (BotCommand -> String)
-> ([BotCommand] -> ShowS)
-> Show BotCommand
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" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text
name) Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
xs

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

instance FromJSON BotCommandScope where
  parseJSON :: Value -> Parser BotCommandScope
parseJSON = String
-> (Object -> Parser BotCommandScope)
-> Value
-> Parser BotCommandScope
forall a. String -> (Object -> Parser a) -> Value -> Parser a
withObject String
"BotCommandScope" \Object
o ->
    (Object
o Object -> Key -> Parser Text
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"type" :: Parser Text) Parser Text
-> (Text -> Parser BotCommandScope) -> Parser BotCommandScope
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \case
    Text
"default" ->                BotCommandScope -> Parser BotCommandScope
forall (f :: * -> *) a. Applicative f => a -> f a
pure BotCommandScope
BotCommandScopeDefault
    Text
"all_private_chats" ->      BotCommandScope -> Parser BotCommandScope
forall (f :: * -> *) a. Applicative f => a -> f a
pure BotCommandScope
BotCommandScopeAllPrivateChats
    Text
"all_group_chats" ->        BotCommandScope -> Parser BotCommandScope
forall (f :: * -> *) a. Applicative f => a -> f a
pure BotCommandScope
BotCommandScopeAllGroupChats
    Text
"all_chat_administrators"-> BotCommandScope -> Parser BotCommandScope
forall (f :: * -> *) a. Applicative f => a -> f a
pure BotCommandScope
BotCommandScopeAllChatAdministrators
    Text
"chat" ->                        SomeChatId -> BotCommandScope
BotCommandScopeChat (SomeChatId -> BotCommandScope)
-> Parser SomeChatId -> Parser BotCommandScope
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
o Object -> Key -> Parser SomeChatId
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"chat_id"
    Text
"chat_administrators"->          SomeChatId -> BotCommandScope
BotCommandScopeChatAdministrators (SomeChatId -> BotCommandScope)
-> Parser SomeChatId -> Parser BotCommandScope
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
o Object -> Key -> Parser SomeChatId
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"chat_id"
    Text
"chat_member"->                  SomeChatId -> UserId -> BotCommandScope
BotCommandScopeChatMember (SomeChatId -> UserId -> BotCommandScope)
-> Parser SomeChatId -> Parser (UserId -> BotCommandScope)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
o Object -> Key -> Parser SomeChatId
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"chat_id" Parser (UserId -> BotCommandScope)
-> Parser UserId -> Parser BotCommandScope
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
o Object -> Key -> Parser UserId
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"user_id"
    Text
t -> String -> Parser BotCommandScope
forall (m :: * -> *) a. MonadFail m => String -> m a
fail (String -> Parser BotCommandScope)
-> String -> Parser BotCommandScope
forall a b. (a -> b) -> a -> b
$ Text -> String
Text.unpack (Text
"Unknown type: " Text -> Text -> Text
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. InputMediaGeneric -> Rep InputMediaGeneric x)
-> (forall x. Rep InputMediaGeneric x -> InputMediaGeneric)
-> Generic InputMediaGeneric
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
  , ''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 = InputMediaGeneric -> Value
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 (Text -> Text)
-> (PassportElementError -> Text) -> PassportElementError -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. PassportElementError -> Text
forall a. ToJSON a => a -> Text
encodeToLazyText

instance ToHttpApiData [PassportElementError] where
  toUrlPiece :: [PassportElementError] -> Text
toUrlPiece = Text -> Text
TL.toStrict (Text -> Text)
-> ([PassportElementError] -> Text)
-> [PassportElementError]
-> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [PassportElementError] -> Text
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 ([Input] -> [FileData Tmp] -> MultipartData Tmp
forall tag. [Input] -> [FileData tag] -> MultipartData tag
MultipartData [Input]
fields []) where
    fields :: [Input]
fields = [Maybe Input] -> [Input]
forall a. [Maybe a] -> [a]
catMaybes
      [ Maybe Text
inputMediaGenericCaption Maybe Text -> (Text -> Input) -> Maybe Input
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 Maybe Text -> (Text -> Input) -> Maybe Input
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 Maybe [MessageEntity] -> ([MessageEntity] -> Input) -> Maybe Input
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 (Text -> Text) -> Text -> Text
forall a b. (a -> b) -> a -> b
$ [MessageEntity] -> Text
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 (InputMediaGeneric -> Value
forall a. ToJSON a => a -> Value
toJSON InputMediaGeneric
inputMediaGenericGeneric)
      [Key
"thumb" Key -> Maybe InputFile -> Pair
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 -> InputMediaGeneric -> MultipartData Tmp
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 (InputMediaGeneric -> MultipartData Tmp
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 (InputMediaGeneric -> Value
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 (InputMediaGenericThumb -> Value
forall a. ToJSON a => a -> Value
toJSON InputMediaGenericThumb
imgt)
                (Text -> [Pair] -> [Pair]
addType Text
"video"
                [ Key
"width" Key -> Maybe Integer -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Maybe Integer
width
                , Key
"height" Key -> Maybe Integer -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Maybe Integer
height
                , Key
"duration" Key -> Maybe Integer -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Maybe Integer
duration
                , Key
"support_streaming" Key -> Maybe Bool -> Pair
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 (InputMediaGenericThumb -> Value
forall a. ToJSON a => a -> Value
toJSON InputMediaGenericThumb
imgt)
                (Text -> [Pair] -> [Pair]
addType Text
"animation"
                [ Key
"width" Key -> Maybe Integer -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Maybe Integer
width
                , Key
"height" Key -> Maybe Integer -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Maybe Integer
height
                , Key
"duration" Key -> Maybe Integer -> Pair
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 (InputMediaGenericThumb -> Value
forall a. ToJSON a => a -> Value
toJSON InputMediaGenericThumb
imgt)
                (Text -> [Pair] -> [Pair]
addType Text
"audio"
                [ Key
"duration" Key -> Maybe Integer -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Maybe Integer
duration
                , Key
"performer" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
performer
                , Key
"title" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Maybe Text
title
                ])
    InputMediaDocument InputMediaGenericThumb
imgt Maybe Bool
dctd ->
      Value -> [Pair] -> Value
addJsonFields (InputMediaGenericThumb -> Value
forall a. ToJSON a => a -> Value
toJSON InputMediaGenericThumb
imgt)
                (Text -> [Pair] -> [Pair]
addType Text
"document" [Key
"disable_content_type_detection" Key -> Maybe Bool -> Pair
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 ->
      [Input] -> MultipartData Tmp -> MultipartData Tmp
forall tag. [Input] -> MultipartData tag -> MultipartData tag
addMultipartFields
      [ Text -> Text -> Input
Input Text
"type" Text
"photo"
      ] (InputMediaGeneric -> MultipartData Tmp
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 ->
      [Input] -> MultipartData Tmp -> MultipartData Tmp
forall tag. [Input] -> MultipartData tag -> MultipartData tag
addMultipartFields
      (Text -> Text -> Input
Input Text
"type" Text
"video"
      Input -> [Input] -> [Input]
forall a. a -> [a] -> [a]
: [Maybe Input] -> [Input]
forall a. [Maybe a] -> [a]
catMaybes 
      [ Maybe Integer
width Maybe Integer -> (Integer -> Input) -> Maybe Input
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&>
        \Integer
t -> Text -> Text -> Input
Input Text
"width" (Text -> Text
TL.toStrict (Text -> Text) -> Text -> Text
forall a b. (a -> b) -> a -> b
$ Integer -> Text
forall a. ToJSON a => a -> Text
encodeToLazyText Integer
t)
      , Maybe Integer
height Maybe Integer -> (Integer -> Input) -> Maybe Input
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&>
        \Integer
t -> Text -> Text -> Input
Input Text
"height" (Text -> Text
TL.toStrict (Text -> Text) -> Text -> Text
forall a b. (a -> b) -> a -> b
$ Integer -> Text
forall a. ToJSON a => a -> Text
encodeToLazyText Integer
t)
      , Maybe Integer
duration Maybe Integer -> (Integer -> Input) -> Maybe Input
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&>
        \Integer
t -> Text -> Text -> Input
Input Text
"duration" (Text -> Text
TL.toStrict (Text -> Text) -> Text -> Text
forall a b. (a -> b) -> a -> b
$ Integer -> Text
forall a. ToJSON a => a -> Text
encodeToLazyText Integer
t)
      , Maybe Bool
streaming Maybe Bool -> (Bool -> Input) -> Maybe Input
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&>
        \Bool
t -> Text -> Text -> Input
Input Text
"support_streaming" (Text -> Text -> Bool -> Text
forall a. a -> a -> Bool -> a
bool Text
"false" Text
"true" Bool
t)
      ]) (InputMediaGenericThumb -> MultipartData Tmp
forall tag a. ToMultipart tag a => a -> MultipartData tag
toMultipart InputMediaGenericThumb
imgt)
    InputMediaAnimation InputMediaGenericThumb
imgt Maybe Integer
width Maybe Integer
height Maybe Integer
duration ->
      [Input] -> MultipartData Tmp -> MultipartData Tmp
forall tag. [Input] -> MultipartData tag -> MultipartData tag
addMultipartFields
      (Text -> Text -> Input
Input Text
"type" Text
"animation"
      Input -> [Input] -> [Input]
forall a. a -> [a] -> [a]
: [Maybe Input] -> [Input]
forall a. [Maybe a] -> [a]
catMaybes 
      [ Maybe Integer
width Maybe Integer -> (Integer -> Input) -> Maybe Input
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&>
        \Integer
t -> Text -> Text -> Input
Input Text
"width" (Text -> Text
TL.toStrict (Text -> Text) -> Text -> Text
forall a b. (a -> b) -> a -> b
$ Integer -> Text
forall a. ToJSON a => a -> Text
encodeToLazyText Integer
t)
      , Maybe Integer
height Maybe Integer -> (Integer -> Input) -> Maybe Input
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&>
        \Integer
t -> Text -> Text -> Input
Input Text
"height" (Text -> Text
TL.toStrict (Text -> Text) -> Text -> Text
forall a b. (a -> b) -> a -> b
$ Integer -> Text
forall a. ToJSON a => a -> Text
encodeToLazyText Integer
t)
      , Maybe Integer
duration Maybe Integer -> (Integer -> Input) -> Maybe Input
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&>
        \Integer
t -> Text -> Text -> Input
Input Text
"duration" (Text -> Text
TL.toStrict (Text -> Text) -> Text -> Text
forall a b. (a -> b) -> a -> b
$ Integer -> Text
forall a. ToJSON a => a -> Text
encodeToLazyText Integer
t)
      ]) (InputMediaGenericThumb -> MultipartData Tmp
forall tag a. ToMultipart tag a => a -> MultipartData tag
toMultipart InputMediaGenericThumb
imgt)
    InputMediaAudio InputMediaGenericThumb
imgt Maybe Integer
duration Maybe Text
performer Maybe Text
title ->
      [Input] -> MultipartData Tmp -> MultipartData Tmp
forall tag. [Input] -> MultipartData tag -> MultipartData tag
addMultipartFields
      (Text -> Text -> Input
Input Text
"type" Text
"audio"
      Input -> [Input] -> [Input]
forall a. a -> [a] -> [a]
: [Maybe Input] -> [Input]
forall a. [Maybe a] -> [a]
catMaybes 
      [ Maybe Integer
duration Maybe Integer -> (Integer -> Input) -> Maybe Input
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&>
        \Integer
t -> Text -> Text -> Input
Input Text
"duration" (Text -> Text
TL.toStrict (Text -> Text) -> Text -> Text
forall a b. (a -> b) -> a -> b
$ Integer -> Text
forall a. ToJSON a => a -> Text
encodeToLazyText Integer
t)
      , Maybe Text
performer Maybe Text -> (Text -> Input) -> Maybe Input
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 Maybe Text -> (Text -> Input) -> Maybe Input
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&>
        \Text
t -> Text -> Text -> Input
Input Text
"title" Text
t
      ]) (InputMediaGenericThumb -> MultipartData Tmp
forall tag a. ToMultipart tag a => a -> MultipartData tag
toMultipart InputMediaGenericThumb
imgt)
    InputMediaDocument InputMediaGenericThumb
imgt Maybe Bool
dctd ->
      [Input] -> MultipartData Tmp -> MultipartData Tmp
forall tag. [Input] -> MultipartData tag -> MultipartData tag
addMultipartFields
      (Text -> Text -> Input
Input Text
"type" Text
"document"
      Input -> [Input] -> [Input]
forall a. a -> [a] -> [a]
: [Maybe Input] -> [Input]
forall a. [Maybe a] -> [a]
catMaybes 
      [ Maybe Bool
dctd Maybe Bool -> (Bool -> Input) -> Maybe Input
forall (f :: * -> *) a b. Functor f => f a -> (a -> b) -> f b
<&> 
         \Bool
t -> Text -> Text -> Input
Input Text
"disable_content_type_detection" (Text -> Text -> Bool -> Text
forall a. a -> a -> Bool -> a
bool Text
"false" Text
"true" Bool
t)
      ]) (InputMediaGenericThumb -> MultipartData Tmp
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) = 
  [Input] -> [FileData Tmp] -> MultipartData Tmp
forall tag. [Input] -> [FileData tag] -> MultipartData tag
MultipartData 
    (Text -> Text -> Input
Input Text
name (Text
"attach://" Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
name) Input -> [Input] -> [Input]
forall a. a -> [a] -> [a]
: [Input]
fields) 
    (Text -> Text -> Text -> MultipartResult Tmp -> FileData Tmp
forall tag.
Text -> Text -> Text -> MultipartResult tag -> FileData tag
FileData Text
name (String -> Text
pack (String -> Text) -> String -> Text
forall a b. (a -> b) -> a -> b
$ ShowS
takeFileName String
path) Text
ct String
MultipartResult Tmp
path FileData Tmp -> [FileData Tmp] -> [FileData Tmp]
forall a. a -> [a] -> [a]
: [FileData Tmp]
files)

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

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

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