{-# LANGUAGE DeriveGeneric #-}
module Telegram.Bot.API.Types.BusinessConnection where
import Data.Aeson (FromJSON (..), ToJSON (..))
import Data.Time.Clock.POSIX (POSIXTime)
import GHC.Generics (Generic)
import Telegram.Bot.API.Types.Common
import Telegram.Bot.API.Types.User
import Telegram.Bot.API.Internal.Utils
data BusinessConnection = BusinessConnection
{ BusinessConnection -> BusinessConnectionId
businessConnectionId :: BusinessConnectionId
, BusinessConnection -> User
businessConnectionUser :: User
, BusinessConnection -> ChatId
businessConnectionUserChatId :: ChatId
, BusinessConnection -> POSIXTime
businessConnectionDate :: POSIXTime
, BusinessConnection -> Bool
businessConnectionCanReply :: Bool
, BusinessConnection -> Bool
businessConnectionIsEnabled :: Bool
}
deriving ((forall x. BusinessConnection -> Rep BusinessConnection x)
-> (forall x. Rep BusinessConnection x -> BusinessConnection)
-> Generic BusinessConnection
forall x. Rep BusinessConnection x -> BusinessConnection
forall x. BusinessConnection -> Rep BusinessConnection x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. BusinessConnection -> Rep BusinessConnection x
from :: forall x. BusinessConnection -> Rep BusinessConnection x
$cto :: forall x. Rep BusinessConnection x -> BusinessConnection
to :: forall x. Rep BusinessConnection x -> BusinessConnection
Generic, Int -> BusinessConnection -> ShowS
[BusinessConnection] -> ShowS
BusinessConnection -> String
(Int -> BusinessConnection -> ShowS)
-> (BusinessConnection -> String)
-> ([BusinessConnection] -> ShowS)
-> Show BusinessConnection
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> BusinessConnection -> ShowS
showsPrec :: Int -> BusinessConnection -> ShowS
$cshow :: BusinessConnection -> String
show :: BusinessConnection -> String
$cshowList :: [BusinessConnection] -> ShowS
showList :: [BusinessConnection] -> ShowS
Show)
instance ToJSON BusinessConnection where toJSON :: BusinessConnection -> Value
toJSON = BusinessConnection -> Value
forall a (d :: Meta) (f :: * -> *).
(Generic a, GToJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
a -> Value
gtoJSON
instance FromJSON BusinessConnection where parseJSON :: Value -> Parser BusinessConnection
parseJSON = Value -> Parser BusinessConnection
forall a (d :: Meta) (f :: * -> *).
(Generic a, GFromJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
Value -> Parser a
gparseJSON