{-# LANGUAGE DeriveGeneric #-}
module Telegram.Bot.API.Types.ReplyParameters where
import Data.Aeson (FromJSON (..), ToJSON (..))
import Data.Text (Text)
import GHC.Generics (Generic)
import Telegram.Bot.API.Types.Common
import Telegram.Bot.API.Types.MessageEntity
import Telegram.Bot.API.Types.ParseMode
import Telegram.Bot.API.Internal.Utils
data ReplyParameters = ReplyParameters
{ ReplyParameters -> MessageId
replyParametersMessageId :: MessageId
, ReplyParameters -> Maybe SomeChatId
replyParametersChatId :: Maybe SomeChatId
, ReplyParameters -> Maybe Bool
replyParametersAllowSendingWithoutReply :: Maybe Bool
, ReplyParameters -> Maybe Text
replyParametersQuote :: Maybe Text
, ReplyParameters -> Maybe ParseMode
replyParametersQuoteParseMode :: Maybe ParseMode
, ReplyParameters -> Maybe [MessageEntity]
replyParametersQuoteEntities :: Maybe [MessageEntity]
, ReplyParameters -> Maybe Int
replyParametersQuotePosition :: Maybe Int
} deriving ((forall x. ReplyParameters -> Rep ReplyParameters x)
-> (forall x. Rep ReplyParameters x -> ReplyParameters)
-> Generic ReplyParameters
forall x. Rep ReplyParameters x -> ReplyParameters
forall x. ReplyParameters -> Rep ReplyParameters x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ReplyParameters -> Rep ReplyParameters x
from :: forall x. ReplyParameters -> Rep ReplyParameters x
$cto :: forall x. Rep ReplyParameters x -> ReplyParameters
to :: forall x. Rep ReplyParameters x -> ReplyParameters
Generic, Int -> ReplyParameters -> ShowS
[ReplyParameters] -> ShowS
ReplyParameters -> String
(Int -> ReplyParameters -> ShowS)
-> (ReplyParameters -> String)
-> ([ReplyParameters] -> ShowS)
-> Show ReplyParameters
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ReplyParameters -> ShowS
showsPrec :: Int -> ReplyParameters -> ShowS
$cshow :: ReplyParameters -> String
show :: ReplyParameters -> String
$cshowList :: [ReplyParameters] -> ShowS
showList :: [ReplyParameters] -> ShowS
Show)
instance ToJSON ReplyParameters where toJSON :: ReplyParameters -> Value
toJSON = ReplyParameters -> Value
forall a (d :: Meta) (f :: * -> *).
(Generic a, GToJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
a -> Value
gtoJSON
instance FromJSON ReplyParameters where parseJSON :: Value -> Parser ReplyParameters
parseJSON = Value -> Parser ReplyParameters
forall a (d :: Meta) (f :: * -> *).
(Generic a, GFromJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
Value -> Parser a
gparseJSON