{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeOperators #-}
module Telegram.Bot.API.WebApps where
import Data.Text (Text)
import Data.Proxy
import GHC.Generics (Generic)
import Servant.API
import Servant.Client hiding (Response)
import Telegram.Bot.API.Internal.Utils (deriveJSON')
import Telegram.Bot.API.MakingRequests (Response)
import Telegram.Bot.API.InlineMode (InlineQueryId)
import Telegram.Bot.API.InlineMode.InlineQueryResult (InlineQueryResult)
data AnswerWebAppQueryRequest = AnswerWebAppQueryRequest
{ AnswerWebAppQueryRequest -> Text
answerWebAppQueryWebAppQueryId :: Text
, AnswerWebAppQueryRequest -> InlineQueryResult
answerWebAppQueryResult :: InlineQueryResult
}
deriving (forall x.
Rep AnswerWebAppQueryRequest x -> AnswerWebAppQueryRequest
forall x.
AnswerWebAppQueryRequest -> Rep AnswerWebAppQueryRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AnswerWebAppQueryRequest x -> AnswerWebAppQueryRequest
$cfrom :: forall x.
AnswerWebAppQueryRequest -> Rep AnswerWebAppQueryRequest x
Generic, Int -> AnswerWebAppQueryRequest -> ShowS
[AnswerWebAppQueryRequest] -> ShowS
AnswerWebAppQueryRequest -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AnswerWebAppQueryRequest] -> ShowS
$cshowList :: [AnswerWebAppQueryRequest] -> ShowS
show :: AnswerWebAppQueryRequest -> String
$cshow :: AnswerWebAppQueryRequest -> String
showsPrec :: Int -> AnswerWebAppQueryRequest -> ShowS
$cshowsPrec :: Int -> AnswerWebAppQueryRequest -> ShowS
Show)
newtype SentWebAppMessage = SentWebAppMessage
{ SentWebAppMessage -> Maybe InlineQueryId
sentWebAppMessageInlineMessageId :: Maybe InlineQueryId
}
deriving (forall x. Rep SentWebAppMessage x -> SentWebAppMessage
forall x. SentWebAppMessage -> Rep SentWebAppMessage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SentWebAppMessage x -> SentWebAppMessage
$cfrom :: forall x. SentWebAppMessage -> Rep SentWebAppMessage x
Generic, Int -> SentWebAppMessage -> ShowS
[SentWebAppMessage] -> ShowS
SentWebAppMessage -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SentWebAppMessage] -> ShowS
$cshowList :: [SentWebAppMessage] -> ShowS
show :: SentWebAppMessage -> String
$cshow :: SentWebAppMessage -> String
showsPrec :: Int -> SentWebAppMessage -> ShowS
$cshowsPrec :: Int -> SentWebAppMessage -> ShowS
Show)
foldMap deriveJSON'
[ ''SentWebAppMessage
, ''AnswerWebAppQueryRequest
]
type AnswerWebAppQuery
= "answerWebAppQuery" :> ReqBody '[JSON] AnswerWebAppQueryRequest :> Post '[JSON] (Response SentWebAppMessage)
answerWebAppQuery :: AnswerWebAppQueryRequest -> ClientM (Response SentWebAppMessage)
answerWebAppQuery :: AnswerWebAppQueryRequest -> ClientM (Response SentWebAppMessage)
answerWebAppQuery = forall api.
HasClient ClientM api =>
Proxy api -> Client ClientM api
client (forall {k} (t :: k). Proxy t
Proxy @AnswerWebAppQuery)