{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeOperators #-}
module Telegram.Bot.API.Methods.SendChatAction where
import Data.Aeson (ToJSON (..))
import Data.Proxy
import Data.Text (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
data SendChatActionRequest = SendChatActionRequest
{ SendChatActionRequest -> Maybe BusinessConnectionId
sendChatActionBusinessConnectionId :: Maybe BusinessConnectionId
, SendChatActionRequest -> ChatId
sendChatActionChatId :: ChatId
, SendChatActionRequest -> Maybe MessageThreadId
sendChatActionMessageThreadId :: Maybe MessageThreadId
, SendChatActionRequest -> Text
sendChatActionAction :: Text
}
deriving (forall x. SendChatActionRequest -> Rep SendChatActionRequest x)
-> (forall x. Rep SendChatActionRequest x -> SendChatActionRequest)
-> Generic SendChatActionRequest
forall x. Rep SendChatActionRequest x -> SendChatActionRequest
forall x. SendChatActionRequest -> Rep SendChatActionRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. SendChatActionRequest -> Rep SendChatActionRequest x
from :: forall x. SendChatActionRequest -> Rep SendChatActionRequest x
$cto :: forall x. Rep SendChatActionRequest x -> SendChatActionRequest
to :: forall x. Rep SendChatActionRequest x -> SendChatActionRequest
Generic
instance ToJSON SendChatActionRequest where toJSON :: SendChatActionRequest -> Value
toJSON = SendChatActionRequest -> Value
forall a (d :: Meta) (f :: * -> *).
(Generic a, GToJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
a -> Value
gtoJSON
type SendChatAction = "sendChatAction"
:> ReqBody '[JSON] SendChatActionRequest
:> Post '[JSON] (Response Bool)
sendChatAction :: SendChatActionRequest -> ClientM (Response Bool)
sendChatAction :: SendChatActionRequest -> ClientM (Response Bool)
sendChatAction = Proxy SendChatAction -> Client ClientM SendChatAction
forall api.
HasClient ClientM api =>
Proxy api -> Client ClientM api
client (forall t. Proxy t
forall {k} (t :: k). Proxy t
Proxy @SendChatAction)