{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeOperators #-}
module Telegram.Bot.API.Methods.SendVenue 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
data SendVenueRequest = SendVenueRequest
{ SendVenueRequest -> SomeChatId
sendVenueChatId :: SomeChatId
, SendVenueRequest -> Maybe MessageThreadId
sendVenueMessageThreadId :: Maybe MessageThreadId
, SendVenueRequest -> Float
sendVenueLatitude :: Float
, SendVenueRequest -> Float
sendVenueLongitude :: Float
, SendVenueRequest -> Text
sendVenueTitle :: Text
, SendVenueRequest -> Text
sendVenueAddress :: Text
, SendVenueRequest -> Maybe Text
sendVenueFoursquareId :: Maybe Text
, SendVenueRequest -> Maybe Text
sendVenueFoursquareType :: Maybe Text
, SendVenueRequest -> Maybe Text
sendVenueGooglePlaceId :: Maybe Text
, SendVenueRequest -> Maybe Text
sendVenueGooglePlaceType :: Maybe Text
, SendVenueRequest -> Maybe Bool
sendVenueDisableNotification :: Maybe Bool
, SendVenueRequest -> Maybe Bool
sendVenueProtectContent :: Maybe Bool
, SendVenueRequest -> Maybe MessageId
sendVenueReplyToMessageId :: Maybe MessageId
, SendVenueRequest -> Maybe Bool
sendVenueAllowSendingWithoutReply :: Maybe Bool
, SendVenueRequest -> Maybe InlineKeyboardMarkup
sendVenueReplyMarkup :: Maybe InlineKeyboardMarkup
}
deriving forall x. Rep SendVenueRequest x -> SendVenueRequest
forall x. SendVenueRequest -> Rep SendVenueRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SendVenueRequest x -> SendVenueRequest
$cfrom :: forall x. SendVenueRequest -> Rep SendVenueRequest x
Generic
instance ToJSON SendVenueRequest where toJSON :: SendVenueRequest -> 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 SendVenueRequest where parseJSON :: Value -> Parser SendVenueRequest
parseJSON = forall a (d :: Meta) (f :: * -> *).
(Generic a, GFromJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
Value -> Parser a
gparseJSON
type SendVenue = "sendVenue"
:> ReqBody '[JSON] SendVenueRequest
:> Post '[JSON] (Response Message)
sendVenue :: SendVenueRequest -> ClientM (Response Message)
sendVenue :: SendVenueRequest -> ClientM (Response Message)
sendVenue = forall api.
HasClient ClientM api =>
Proxy api -> Client ClientM api
client (forall {k} (t :: k). Proxy t
Proxy @SendVenue)