{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DerivingVia #-}
module Web.Telegram.Types
(
User (..),
Message (..),
MessageMetadata (..),
MessageEntity (..),
MessageContent (..),
ParseMode (..),
ChatId (..),
Chat (..),
ChatPermissions (..),
ChatPhoto (..),
ChatMember (..),
PhotoSize (..),
Audio (..),
Animation (..),
Document (..),
Video (..),
Voice (..),
VideoNote (..),
Contact (..),
Location (..),
Venue (..),
PollOption (..),
Poll (..),
PollType (..),
PollAnswer (..),
UserProfilePhotos (..),
File (..),
Sticker (..),
StickerSet (..),
MaskPosition (..),
SuccessfulPayment (..),
coe,
liftUnion,
QueryR,
Default (..),
)
where
import Data.Aeson
import Data.Coerce
import Data.OpenUnion
import Data.Text (Text)
import Deriving.Aeson
import Servant.API
import Web.Telegram.Types.Internal.Common
import Web.Telegram.Types.Internal.Media
import Web.Telegram.Types.Internal.Sticker
import Web.Telegram.Types.Internal.User
import Web.Telegram.Types.Internal.Utils
import Web.Telegram.Types.Internal.InputMedia
data ChatId
= ChatId Integer
| ChanId Text
deriving (Show, Eq, Generic, Default)
deriving (FromJSON, ToJSON) via UntaggedSum ChatId
instance ToHttpApiData ChatId where
toQueryParam (ChatId i) = toQueryParam i
toQueryParam (ChanId t) = t
coe :: Coercible a b => a -> b
coe = coerce
type QueryR = QueryParam' '[Required, Strict]