{-# LANGUAGE DeriveGeneric #-}
module Telegram.Bot.API.Types.User where
import Data.Aeson (FromJSON (..), ToJSON (..))
import Data.Text (Text)
import GHC.Generics (Generic)
import Telegram.Bot.API.Types.Common
import Telegram.Bot.API.Internal.Utils
data User = User
{ User -> UserId
userId :: UserId
, User -> Bool
userIsBot :: Bool
, User -> Text
userFirstName :: Text
, User -> Maybe Text
userLastName :: Maybe Text
, User -> Maybe Text
userUsername :: Maybe Text
, User -> Maybe Text
userLanguageCode :: Maybe Text
, User -> Maybe Bool
userIsPremium :: Maybe Bool
, :: Maybe Bool
, User -> Maybe Bool
userCanJoinGroups :: Maybe Bool
, User -> Maybe Bool
userCanReadAllGroupMessages :: Maybe Bool
, User -> Maybe Bool
userSupportsInlineQueries :: Maybe Bool
}
deriving (Int -> User -> ShowS
[User] -> ShowS
User -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [User] -> ShowS
$cshowList :: [User] -> ShowS
show :: User -> String
$cshow :: User -> String
showsPrec :: Int -> User -> ShowS
$cshowsPrec :: Int -> User -> ShowS
Show, forall x. Rep User x -> User
forall x. User -> Rep User x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep User x -> User
$cfrom :: forall x. User -> Rep User x
Generic)
instance ToJSON User where toJSON :: User -> 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 User where parseJSON :: Value -> Parser User
parseJSON = forall a (d :: Meta) (f :: * -> *).
(Generic a, GFromJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
Value -> Parser a
gparseJSON