{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeOperators #-}
module Telegram.Bot.API.Methods.CopyMessage where
import Data.Aeson (FromJSON (..), ToJSON (..))
import Data.Proxy
import Data.Text
import GHC.Generics (Generic)
import Servant.API
import Servant.Client hiding (Response)
import Telegram.Bot.API.Internal.Utils
import Telegram.Bot.API.MakingRequests
import Telegram.Bot.API.Types
import Telegram.Bot.API.Types.ParseMode
type CopyMessage
= "copyMessage"
:> ReqBody '[JSON] CopyMessageRequest
:> Post '[JSON] (Response CopyMessageId)
copyMessage :: CopyMessageRequest -> ClientM (Response CopyMessageId)
copyMessage :: CopyMessageRequest -> ClientM (Response CopyMessageId)
copyMessage = forall api.
HasClient ClientM api =>
Proxy api -> Client ClientM api
client (forall {k} (t :: k). Proxy t
Proxy @CopyMessage)
data CopyMessageRequest = CopyMessageRequest
{ CopyMessageRequest -> SomeChatId
copyMessageChatId :: SomeChatId
, CopyMessageRequest -> Maybe Message
copyMessageMessageThreadId :: Maybe Message
, CopyMessageRequest -> SomeChatId
copyMessageFromChatId :: SomeChatId
, CopyMessageRequest -> MessageId
copyMessageMessageId :: MessageId
, CopyMessageRequest -> Maybe Text
copyMessageCaption :: Maybe Text
, CopyMessageRequest -> Maybe ParseMode
copyMessageParseMode :: Maybe ParseMode
, CopyMessageRequest -> Maybe [MessageEntity]
copyMessageCaptionEntities :: Maybe [MessageEntity]
, CopyMessageRequest -> Maybe Bool
copyMessageDisableNotification :: Maybe Bool
, CopyMessageRequest -> Maybe Bool
copyMessageProtectContent :: Maybe Bool
, CopyMessageRequest -> Maybe MessageId
copyMessageReplyToMessageId :: Maybe MessageId
, CopyMessageRequest -> Maybe Bool
copyMessageAllowSendingWithoutReply :: Maybe Bool
, CopyMessageRequest -> Maybe InlineKeyboardMarkup
copyMessageReplyMarkup :: Maybe InlineKeyboardMarkup
}
deriving forall x. Rep CopyMessageRequest x -> CopyMessageRequest
forall x. CopyMessageRequest -> Rep CopyMessageRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CopyMessageRequest x -> CopyMessageRequest
$cfrom :: forall x. CopyMessageRequest -> Rep CopyMessageRequest x
Generic
instance ToJSON CopyMessageRequest where toJSON :: CopyMessageRequest -> 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 CopyMessageRequest where parseJSON :: Value -> Parser CopyMessageRequest
parseJSON = forall a (d :: Meta) (f :: * -> *).
(Generic a, GFromJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
Value -> Parser a
gparseJSON