{-# LANGUAGE DeriveGeneric #-}
module Telegram.Bot.API.Types.Contact 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 Contact = Contact
{ Contact -> Text
contactPhoneNumber :: Text
, Contact -> Text
contactFirstName :: Text
, Contact -> Maybe Text
contactLastName :: Maybe Text
, Contact -> Maybe UserId
contactUserId :: Maybe UserId
, Contact -> Maybe Text
contactVcard :: Maybe Text
}
deriving (forall x. Rep Contact x -> Contact
forall x. Contact -> Rep Contact x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Contact x -> Contact
$cfrom :: forall x. Contact -> Rep Contact x
Generic, Int -> Contact -> ShowS
[Contact] -> ShowS
Contact -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Contact] -> ShowS
$cshowList :: [Contact] -> ShowS
show :: Contact -> String
$cshow :: Contact -> String
showsPrec :: Int -> Contact -> ShowS
$cshowsPrec :: Int -> Contact -> ShowS
Show)
instance ToJSON Contact where toJSON :: Contact -> 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 Contact where parseJSON :: Value -> Parser Contact
parseJSON = forall a (d :: Meta) (f :: * -> *).
(Generic a, GFromJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
Value -> Parser a
gparseJSON