{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeOperators #-}
module Telegram.Bot.API.Methods.GetMyShortDescription where
import Data.Aeson (FromJSON (..), ToJSON (..))
import Data.Proxy
import GHC.Generics (Generic)
import Data.Text (Text)
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.Internal.TH
newtype GetMyShortDescriptionRequest = GetMyShortDescriptionRequest
{ GetMyShortDescriptionRequest -> Maybe Text
getMyShortDescriptionLanguageCode :: Maybe Text
}
deriving (forall x.
GetMyShortDescriptionRequest -> Rep GetMyShortDescriptionRequest x)
-> (forall x.
Rep GetMyShortDescriptionRequest x -> GetMyShortDescriptionRequest)
-> Generic GetMyShortDescriptionRequest
forall x.
Rep GetMyShortDescriptionRequest x -> GetMyShortDescriptionRequest
forall x.
GetMyShortDescriptionRequest -> Rep GetMyShortDescriptionRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetMyShortDescriptionRequest x -> GetMyShortDescriptionRequest
$cfrom :: forall x.
GetMyShortDescriptionRequest -> Rep GetMyShortDescriptionRequest x
Generic
instance ToJSON GetMyShortDescriptionRequest where toJSON :: GetMyShortDescriptionRequest -> Value
toJSON = GetMyShortDescriptionRequest -> Value
forall a (d :: Meta) (f :: * -> *).
(Generic a, GToJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
a -> Value
gtoJSON
instance FromJSON GetMyShortDescriptionRequest where parseJSON :: Value -> Parser GetMyShortDescriptionRequest
parseJSON = Value -> Parser GetMyShortDescriptionRequest
forall a (d :: Meta) (f :: * -> *).
(Generic a, GFromJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
Value -> Parser a
gparseJSON
type GetMyShortDescription = "getMyShortDescription"
:> ReqBody '[JSON] GetMyShortDescriptionRequest
:> Post '[JSON] (Response BotShortDescription)
getMyShortDescription :: GetMyShortDescriptionRequest -> ClientM (Response BotShortDescription)
getMyShortDescription :: GetMyShortDescriptionRequest
-> ClientM (Response BotShortDescription)
getMyShortDescription = Proxy GetMyShortDescription -> Client ClientM GetMyShortDescription
forall api.
HasClient ClientM api =>
Proxy api -> Client ClientM api
client (Proxy GetMyShortDescription
forall k (t :: k). Proxy t
Proxy @GetMyShortDescription)
makeDefault ''GetMyShortDescriptionRequest