{-# LANGUAGE DeriveGeneric #-}
module Telegram.Bot.API.Types.Message where
import Data.Aeson (FromJSON (..), ToJSON (..))
import Data.Text (Text)
import Data.Time.Clock.POSIX (POSIXTime)
import GHC.Generics (Generic)
import Telegram.Bot.API.Types.Animation
import Telegram.Bot.API.Types.Audio
import Telegram.Bot.API.Types.Document
import {-# SOURCE #-} Telegram.Bot.API.Types.Chat
import Telegram.Bot.API.Types.ChatShared
import Telegram.Bot.API.Types.Common
import Telegram.Bot.API.Types.Contact
import Telegram.Bot.API.Types.Dice
import Telegram.Bot.API.Types.ForumTopicEdited
import Telegram.Bot.API.Types.ForumTopicClosed
import Telegram.Bot.API.Types.ForumTopicCreated
import Telegram.Bot.API.Types.ForumTopicReopened
import Telegram.Bot.API.Types.Game
import Telegram.Bot.API.Types.InlineKeyboardMarkup
import Telegram.Bot.API.Types.Invoice
import Telegram.Bot.API.Types.Location
import Telegram.Bot.API.Types.MessageAutoDeleteTimerChanged
import Telegram.Bot.API.Types.MessageEntity
import Telegram.Bot.API.Types.PassportData
import Telegram.Bot.API.Types.PhotoSize
import Telegram.Bot.API.Types.Poll
import Telegram.Bot.API.Types.ProximityAlertTriggered
import Telegram.Bot.API.Types.Sticker
import Telegram.Bot.API.Types.SuccessfulPayment
import Telegram.Bot.API.Types.User
import Telegram.Bot.API.Types.UserShared
import Telegram.Bot.API.Types.Venue
import Telegram.Bot.API.Types.Video
import Telegram.Bot.API.Types.VideoChatEnded
import Telegram.Bot.API.Types.VideoChatScheduled
import Telegram.Bot.API.Types.VideoChatStarted
import Telegram.Bot.API.Types.VideoNote
import Telegram.Bot.API.Types.Voice
import Telegram.Bot.API.Types.WebAppData
import Telegram.Bot.API.Types.WriteAccessAllowed
import Telegram.Bot.API.Internal.Utils
data Message = Message
{ Message -> MessageId
messageMessageId :: MessageId
, Message -> Maybe MessageThreadId
messageMessageThreadId :: Maybe MessageThreadId
, Message -> Maybe User
messageFrom :: Maybe User
, Message -> Maybe Chat
messageSenderChat :: Maybe Chat
, 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 Text
messageForwardSenderName :: Maybe Text
, Message -> Maybe POSIXTime
messageForwardDate :: Maybe POSIXTime
, Message -> Maybe Bool
messageIsTopicMessage :: Maybe Bool
, Message -> Maybe Bool
messageIsAutomaticForward :: Maybe Bool
, Message -> Maybe Message
messageReplyToMessage :: Maybe Message
, Message -> Maybe User
messageViaBot :: Maybe User
, Message -> Maybe POSIXTime
messageEditDate :: Maybe POSIXTime
, Message -> Maybe Bool
messageHasProtectedContent :: Maybe Bool
, 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 Animation
messageAnimation :: Maybe Animation
, Message -> Maybe Audio
messageAudio :: Maybe Audio
, Message -> Maybe Document
messageDocument :: Maybe Document
, Message -> Maybe [PhotoSize]
messagePhoto :: Maybe [PhotoSize]
, Message -> Maybe Sticker
messageSticker :: Maybe Sticker
, Message -> Maybe Video
messageVideo :: Maybe Video
, Message -> Maybe VideoNote
messageVideoNote :: Maybe VideoNote
, Message -> Maybe Voice
messageVoice :: Maybe Voice
, Message -> Maybe Text
messageCaption :: Maybe Text
, Message -> Maybe [MessageEntity]
messageCaptionEntities :: Maybe [MessageEntity]
, Message -> Maybe Bool
messageHasMediaSpoiler :: Maybe Bool
, Message -> Maybe Contact
messageContact :: Maybe Contact
, Message -> Maybe Dice
messageDice :: Maybe Dice
, Message -> Maybe Game
messageGame :: Maybe Game
, Message -> Maybe Poll
messagePoll :: Maybe Poll
, Message -> Maybe Venue
messageVenue :: Maybe Venue
, Message -> Maybe Location
messageLocation :: Maybe Location
, 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 MessageAutoDeleteTimerChanged
messageAutoDeleteTimerChanged :: Maybe MessageAutoDeleteTimerChanged
, Message -> Maybe Bool
messageHasAggressiveAntiSpamEnabled :: Maybe Bool
, Message -> Maybe Bool
messageHasHiddenMembers :: Maybe Bool
, Message -> Maybe ChatId
messageMigrateToChatId :: Maybe ChatId
, Message -> Maybe ChatId
messageMigrateFromChatId :: Maybe ChatId
, Message -> Maybe Message
messagePinnedMessage :: Maybe Message
, Message -> Maybe Invoice
messageInvoice :: Maybe Invoice
, Message -> Maybe SuccessfulPayment
messageSuccessfulPayment :: Maybe SuccessfulPayment
, Message -> Maybe UserShared
messageUserShared :: Maybe UserShared
, Message -> Maybe ChatShared
messageChatShared :: Maybe ChatShared
, Message -> Maybe Text
messageConnectedWebsite :: Maybe Text
, Message -> Maybe WriteAccessAllowed
messageWriteAccessAllowed :: Maybe WriteAccessAllowed
, Message -> Maybe PassportData
messagePassportData :: Maybe PassportData
, Message -> Maybe ProximityAlertTriggered
messageProximityAlertTriggered :: Maybe ProximityAlertTriggered
, Message -> Maybe ForumTopicCreated
messageForumTopicCreated :: Maybe ForumTopicCreated
, Message -> Maybe ForumTopicEdited
messageForumTopicEdited :: Maybe ForumTopicEdited
, Message -> Maybe ForumTopicClosed
messageForumTopicClosed :: Maybe ForumTopicClosed
, Message -> Maybe ForumTopicReopened
messageForumTopicReopened :: Maybe ForumTopicReopened
, Message -> Maybe VideoChatScheduled
messageVideoChatScheduled :: Maybe VideoChatScheduled
, Message -> Maybe VideoChatStarted
messageVideoChatStarted :: Maybe VideoChatStarted
, Message -> Maybe VideoChatEnded
messageVideoChatEnded :: Maybe VideoChatEnded
, Message -> Maybe VideoChatParticipantsInvited
messageVideoChatParticipantsInvited :: Maybe VideoChatParticipantsInvited
, Message -> Maybe WebAppData
messageWebAppData :: Maybe WebAppData
, Message -> Maybe InlineKeyboardMarkup
messageReplyMarkup :: Maybe InlineKeyboardMarkup
}
deriving (forall x. Rep Message x -> Message
forall x. Message -> Rep Message x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Message x -> Message
$cfrom :: forall x. Message -> Rep Message x
Generic, Int -> Message -> ShowS
[Message] -> ShowS
Message -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Message] -> ShowS
$cshowList :: [Message] -> ShowS
show :: Message -> String
$cshow :: Message -> String
showsPrec :: Int -> Message -> ShowS
$cshowsPrec :: Int -> Message -> ShowS
Show)
instance ToJSON Message where toJSON :: Message -> Value
toJSON = forall a (d :: Meta) (f :: * -> *).
(Generic a, GToJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
a -> Value
gtoJSON
instance FromJSON Message where parseJSON :: Value -> Parser Message
parseJSON = forall a (d :: Meta) (f :: * -> *).
(Generic a, GFromJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
Value -> Parser a
gparseJSON