{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeApplications #-}
module Telegram.Bot.API.Types where
import Data.Aeson (ToJSON(..), FromJSON(..))
import Data.Coerce (coerce)
import Data.Int (Int32)
import Data.Hashable (Hashable)
import Data.String
import Data.Text (Text, pack)
import Data.Time.Clock.POSIX (POSIXTime)
import GHC.Generics (Generic)
import Servant.API
import Telegram.Bot.API.Internal.Utils
type RequiredQueryParam = QueryParam' '[Required, Strict]
newtype Seconds = Seconds Int32
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)
data User = User
{ User -> UserId
userId :: UserId
, User -> Bool
userIsBot :: Bool
, User -> Text
userFirstName :: Text
, User -> Maybe Text
userLastName :: Maybe Text
, User -> Maybe Text
userUsername :: Maybe Text
, User -> Maybe Text
userLanguageCode :: Maybe Text
} 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)
newtype UserId = UserId Int32
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 Int32 => Int32 -> String
forall a. Show a => a -> String
show @Int32 (Int32 -> String) -> (UserId -> Int32) -> UserId -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. UserId -> Int32
forall a b. Coercible a b => a -> b
coerce
data Chat = Chat
{ Chat -> ChatId
chatId :: ChatId
, Chat -> ChatType
chatType :: ChatType
, Chat -> Maybe Text
chatTitle :: Maybe Text
, Chat -> Maybe Text
chatUsername :: Maybe Text
, Chat -> Maybe Text
chatFirstName :: Maybe Text
, Chat -> Maybe Text
chatLastName :: Maybe Text
, Chat -> Maybe Bool
chatAllMembersAreAdministrators :: Maybe Bool
, Chat -> Maybe ChatPhoto
chatPhoto :: Maybe ChatPhoto
, Chat -> Maybe Text
chatDescription :: Maybe Text
, Chat -> Maybe Text
chatInviteLink :: Maybe Text
, Chat -> Maybe Message
chatPinnedMessage :: Maybe Message
, Chat -> Maybe Text
chatStickerSetName :: Maybe Text
, Chat -> Maybe Bool
chatCanSetStickerSet :: Maybe Bool
} 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)
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, Int -> ChatId -> Int
ChatId -> Int
(Int -> ChatId -> Int) -> (ChatId -> Int) -> Hashable ChatId
forall a. (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: ChatId -> Int
$chash :: ChatId -> Int
hashWithSalt :: Int -> ChatId -> Int
$chashWithSalt :: Int -> ChatId -> Int
Hashable)
instance ToHttpApiData ChatId where toUrlPiece :: ChatId -> Text
toUrlPiece a :: 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
forall a b. Coercible a b => a -> b
coerce ChatId
a
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
data Message = Message
{ Message -> MessageId
messageMessageId :: MessageId
, Message -> Maybe User
messageFrom :: Maybe User
, Message -> POSIXTime
messageDate :: POSIXTime
, Message -> Chat
messageChat :: Chat
, Message -> Maybe User
messageForwardFrom :: Maybe User
, Message -> Maybe Chat
messageForwardFromChat :: Maybe Chat
, Message -> Maybe MessageId
messageForwardFromMessageId :: Maybe MessageId
, Message -> Maybe Text
messageForwardSignature :: Maybe Text
, Message -> Maybe POSIXTime
messageForwardDate :: Maybe POSIXTime
, Message -> Maybe Message
messageReplyToMessage :: Maybe Message
, Message -> Maybe POSIXTime
messageEditDate :: Maybe POSIXTime
, Message -> Maybe MediaGroupId
messageMediaGroupId :: Maybe MediaGroupId
, Message -> Maybe Text
messageAuthorSignature :: Maybe Text
, Message -> Maybe Text
messageText :: Maybe Text
, Message -> Maybe [MessageEntity]
messageEntities :: Maybe [MessageEntity]
, Message -> Maybe [MessageEntity]
messageCaptionEntities :: Maybe [MessageEntity]
, Message -> Maybe Audio
messageAudio :: Maybe Audio
, Message -> Maybe Document
messageDocument :: Maybe Document
, Message -> Maybe [PhotoSize]
messagePhoto :: Maybe [PhotoSize]
, Message -> Maybe Video
messageVideo :: Maybe Video
, Message -> Maybe Voice
messageVoice :: Maybe Voice
, Message -> Maybe VideoNote
messageVideoNote :: Maybe VideoNote
, Message -> Maybe Text
messageCaption :: Maybe Text
, Message -> Maybe Contact
messageContact :: Maybe Contact
, Message -> Maybe Location
messageLocation :: Maybe Location
, Message -> Maybe Venue
messageVenue :: Maybe Venue
, Message -> Maybe [User]
messageNewChatMembers :: Maybe [User]
, Message -> Maybe User
messageLeftChatMember :: Maybe User
, Message -> Maybe Text
messageNewChatTitle :: Maybe Text
, Message -> Maybe [PhotoSize]
messageNewChatPhoto :: Maybe [PhotoSize]
, Message -> Maybe Bool
messageDeleteChatPhoto :: Maybe Bool
, Message -> Maybe Bool
messageGroupChatCreated :: Maybe Bool
, Message -> Maybe Bool
messageSupergroupChatCreated :: Maybe Bool
, Message -> Maybe Bool
messageChannelChatCreated :: Maybe Bool
, Message -> Maybe ChatId
messageMigrateToChatId :: Maybe ChatId
, Message -> Maybe ChatId
messageMigrateFromChatId :: Maybe ChatId
, Message -> Maybe Message
messagePinnedMessage :: Maybe Message
} 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)
newtype MessageId = MessageId Int32
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, Int -> MessageId -> Int
MessageId -> Int
(Int -> MessageId -> Int)
-> (MessageId -> Int) -> Hashable MessageId
forall a. (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: MessageId -> Int
$chash :: MessageId -> Int
hashWithSalt :: Int -> MessageId -> Int
$chashWithSalt :: Int -> MessageId -> Int
Hashable)
instance ToHttpApiData MessageId where toUrlPiece :: MessageId -> Text
toUrlPiece a :: MessageId
a = String -> Text
pack (String -> Text) -> (Int32 -> String) -> Int32 -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Show Int32 => Int32 -> String
forall a. Show a => a -> String
show @Int32 (Int32 -> Text) -> Int32 -> Text
forall a b. (a -> b) -> a -> b
$ MessageId -> Int32
forall a b. Coercible a b => a -> b
coerce MessageId
a
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)
data MessageEntity = MessageEntity
{ MessageEntity -> MessageEntityType
messageEntityType :: MessageEntityType
, MessageEntity -> Int32
messageEntityOffset :: Int32
, MessageEntity -> Int32
messageEntityLength :: Int32
, MessageEntity -> Maybe Text
messageEntityUrl :: Maybe Text
, MessageEntity -> Maybe User
messageEntityUser :: Maybe User
} 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)
data MessageEntityType
= MessageEntityMention
| MessageEntityHashtag
| MessageEntityBotCommand
| MessageEntityUrl
| MessageEntityEmail
| MessageEntityBold
| MessageEntityItalic
| MessageEntityUnderline
| MessageEntityStrikethrough
| MessageEntityCode
| MessageEntityPre
| MessageEntityTextLink
| MessageEntityTextMention
| MessageEntityCashtag
| MessageEntityPhoneNumber
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)
instance ToJSON MessageEntityType where toJSON :: MessageEntityType -> Value
toJSON = MessageEntityType -> Value
forall a (d :: Meta) (f :: * -> *).
(Generic a, GToJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
a -> Value
gtoJSON
instance FromJSON MessageEntityType where parseJSON :: Value -> Parser MessageEntityType
parseJSON = Value -> Parser MessageEntityType
forall a (d :: Meta) (f :: * -> *).
(Generic a, GFromJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
Value -> Parser a
gparseJSON
data PhotoSize = PhotoSize
{ PhotoSize -> FileId
photoSizeFileId :: FileId
, PhotoSize -> Int32
photoSizeWidth :: Int32
, PhotoSize -> Int32
photoSizeHeight :: Int32
, PhotoSize -> Maybe Int32
photoSizeFileSize :: Maybe Int32
} 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)
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)
data Audio = Audio
{ Audio -> FileId
audioFileId :: FileId
, Audio -> Seconds
audioDuration :: Seconds
, Audio -> Maybe Text
audioPerformer :: Maybe Text
, Audio -> Maybe Text
audioTitle :: Maybe Text
, Audio -> Maybe Text
audioMimeType :: Maybe Text
, Audio -> Maybe Int32
audioFileSize :: Maybe Int32
} 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)
data Document = Document
{ Document -> FileId
documentFileId :: FileId
, Document -> Maybe PhotoSize
documentThumb :: Maybe PhotoSize
, Document -> Maybe Text
documentFileName :: Maybe Text
, Document -> Maybe Text
documentMimeType :: Maybe Text
, Document -> Maybe Int32
documentFileSize :: Maybe Int32
} 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)
data Video = Video
{ Video -> FileId
videoFileId :: FileId
, Video -> Int32
videoWidth :: Int32
, Video -> Int32
videoHeight :: Int32
, Video -> Seconds
videoDuration :: Seconds
, Video -> Maybe PhotoSize
videoThumb :: Maybe PhotoSize
, Video -> Maybe Text
videoMimeType :: Maybe Text
, Video -> Maybe Int32
videoFileSize :: Maybe Int32
} 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)
data Voice = Voice
{ Voice -> FileId
voiceFileId :: FileId
, Voice -> Seconds
voiceDuration :: Seconds
, Voice -> Maybe Text
voiceMimeType :: Maybe Text
, Voice -> Maybe Int32
voiceFileSize :: Maybe Int32
} 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)
data VideoNote = VideoNote
{ VideoNote -> Text
videoNoteFileId :: Text
, VideoNote -> Int32
videoNoteLength :: Int32
, VideoNote -> Seconds
videoNoteDuration :: Seconds
, VideoNote -> Maybe PhotoSize
videoNoteThumb :: Maybe PhotoSize
, VideoNote -> Maybe Int32
videoNoteFileSize :: Maybe Int32
} 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)
data Contact = Contact
{ Contact -> Text
contactPhoneNumber :: Text
, Contact -> Text
contactFirstName :: Text
, Contact -> Maybe Text
contactLastName :: Maybe Text
, Contact -> Maybe UserId
contactUserId :: Maybe UserId
} 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)
data Location = Location
{ Location -> Float
locationLongitude :: Float
, Location -> Float
locationLatitude :: Float
} 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)
data Venue = Venue
{ Venue -> Location
venueLocation :: Location
, Venue -> Text
venueTitle :: Text
, Venue -> Text
venueAddress :: Text
, Venue -> Maybe Text
venueFoursquareId :: Maybe Text
} 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)
data UserProfilePhotos = UserProfilePhotos
{ UserProfilePhotos -> Int32
userProfilePhotosTotalCount :: Int32
, UserProfilePhotos -> [[PhotoSize]]
userProfilePhotosPhotos :: [[PhotoSize]]
} 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)
data File = File
{ File -> FileId
fileFileId :: FileId
, File -> Maybe Int32
fileFileSize :: Maybe Int32
, File -> Maybe Text
fileFilePath :: Maybe Text
} 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)
data ReplyKeyboardMarkup = ReplyKeyboardMarkup
{ ReplyKeyboardMarkup -> [[KeyboardButton]]
replyKeyboardMarkupKeyboard :: [[KeyboardButton]]
, ReplyKeyboardMarkup -> Maybe Bool
replyKeyboardMarkupResizeKeyboard :: Maybe Bool
, ReplyKeyboardMarkup -> Maybe Bool
replyKeyboardMarkupOneTimeKeyboard :: Maybe Bool
, ReplyKeyboardMarkup -> Maybe Bool
replyKeyboardMarkupSelective :: Maybe Bool
} 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)
data KeyboardButton = KeyboardButton
{ KeyboardButton -> Text
keyboardButtonText :: Text
, KeyboardButton -> Maybe Bool
keyboardButtonRequestContact :: Maybe Bool
, KeyboardButton -> Maybe Bool
keyboardButtonRequestLocation :: Maybe Bool
} 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 s :: String
s = Text -> Maybe Bool -> Maybe Bool -> 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
data ReplyKeyboardRemove = ReplyKeyboardRemove
{ ReplyKeyboardRemove -> Bool
replyKeyboardRemoveRemoveKeyboard :: Bool
, ReplyKeyboardRemove -> Maybe Bool
replyKeyboardRemoveSelective :: Maybe Bool
} 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)
data InlineKeyboardMarkup = InlineKeyboardMarkup
{ InlineKeyboardMarkup -> [[InlineKeyboardButton]]
inlineKeyboardMarkupInlineKeyboard :: [[InlineKeyboardButton]]
} 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)
data InlineKeyboardButton = InlineKeyboardButton
{ InlineKeyboardButton -> Text
inlineKeyboardButtonText :: Text
, InlineKeyboardButton -> Maybe Text
inlineKeyboardButtonUrl :: Maybe Text
, InlineKeyboardButton -> Maybe Text
inlineKeyboardButtonCallbackData :: Maybe Text
, InlineKeyboardButton -> Maybe Text
inlineKeyboardButtonSwitchInlineQuery :: Maybe Text
, InlineKeyboardButton -> Maybe Text
inlineKeyboardButtonSwitchInlineQueryCurrentChat :: Maybe Text
, InlineKeyboardButton -> Maybe Bool
inlineKeyboardButtonPay :: Maybe Bool
} 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 label :: Text
label = Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> InlineKeyboardButton
InlineKeyboardButton Text
label Maybe Text
forall a. Maybe a
Nothing Maybe Text
forall a. Maybe a
Nothing Maybe Text
forall a. Maybe a
Nothing Maybe Text
forall a. Maybe a
Nothing Maybe Bool
forall a. Maybe a
Nothing
data CallbackQuery = CallbackQuery
{ CallbackQuery -> CallbackQueryId
callbackQueryId :: CallbackQueryId
, CallbackQuery -> User
callbackQueryFrom :: User
, CallbackQuery -> Maybe Message
callbackQueryMessage :: Maybe Message
, CallbackQuery -> Maybe MessageId
callbackQueryInlineMessageId :: Maybe MessageId
, CallbackQuery -> Text
callbackQueryChatInstance :: Text
, CallbackQuery -> Maybe Text
callbackQueryData :: Maybe Text
, CallbackQuery -> Maybe Text
callbackQueryGameShortName :: Maybe Text
} 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)
data ForceReply = ForceReply
{ ForceReply -> Bool
forceReplyForceReply :: Bool
, ForceReply -> Maybe Bool
forceReplySelective :: Maybe Bool
} 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)
data ChatPhoto = ChatPhoto
{ ChatPhoto -> FileId
chatPhotoSmallFileId :: FileId
, ChatPhoto -> FileId
chatPhotoBigFileId :: FileId
} 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)
data ChatMember = ChatMember
{ ChatMember -> User
chatMemberUser :: User
, ChatMember -> Text
chatMemberStatus :: Text
, ChatMember -> Maybe POSIXTime
chatMemberUntilDate :: Maybe POSIXTime
, ChatMember -> Maybe Bool
chatMemberCanBeEdited :: Maybe Bool
, ChatMember -> Maybe Bool
chatMemberCanChangeInfo :: Maybe Bool
, ChatMember -> Maybe Bool
chatMemberCanPostMessages :: Maybe Bool
, ChatMember -> Maybe Bool
chatMemberCanEditMessages :: Maybe Bool
, ChatMember -> Maybe Bool
chatMemberCanDeleteMessages :: Maybe Bool
, ChatMember -> Maybe Bool
chatMemberCanInviteUsers :: Maybe Bool
, ChatMember -> Maybe Bool
chatMemberCanRestrictMembers :: Maybe Bool
, ChatMember -> Maybe Bool
chatMemberCanPinMessages :: Maybe Bool
, ChatMember -> Maybe Bool
chatMemberCanPromoteMembers :: Maybe Bool
, ChatMember -> Maybe Bool
chatMemberCanSendMessages :: Maybe Bool
, ChatMember -> Maybe Bool
chatMemberCanSendMediaMessages :: Maybe Bool
, ChatMember -> Maybe Bool
chatMemberCanSendOtherMessages :: Maybe Bool
, ChatMember -> Maybe Bool
chatMemberCanAddWebPagePreviews :: Maybe Bool
} 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)
data ResponseParameters = ResponseParameters
{ ResponseParameters -> Maybe ChatId
responseParametersMigrateToChatId :: Maybe ChatId
, ResponseParameters -> Maybe Seconds
responseParametersRetryAfter :: Maybe Seconds
} 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)
deriveJSON' ''User
deriveJSON' ''Chat
deriveJSON' ''Message
deriveJSON' ''MessageEntity
deriveJSON' ''PhotoSize
deriveJSON' ''Audio
deriveJSON' ''Document
deriveJSON' ''Video
deriveJSON' ''Voice
deriveJSON' ''VideoNote
deriveJSON' ''Contact
deriveJSON' ''Location
deriveJSON' ''Venue
deriveJSON' ''UserProfilePhotos
deriveJSON' ''File
deriveJSON' ''ReplyKeyboardMarkup
deriveJSON' ''KeyboardButton
deriveJSON' ''ReplyKeyboardRemove
deriveJSON' ''InlineKeyboardMarkup
deriveJSON' ''InlineKeyboardButton
deriveJSON' ''CallbackQuery
deriveJSON' ''ForceReply
deriveJSON' ''ChatPhoto
deriveJSON' ''ChatMember
deriveJSON' ''ResponseParameters