{-# LANGUAGE DeriveGeneric #-}
module Telegram.Bot.API.Types.ChatInviteLink where
import Data.Aeson (FromJSON (..), ToJSON (..))
import Data.Text (Text)
import Data.Time.Clock.POSIX (POSIXTime)
import GHC.Generics (Generic)
import Telegram.Bot.API.Types.User
import Telegram.Bot.API.Internal.Utils
data ChatInviteLink = ChatInviteLink
{ ChatInviteLink -> Text
chatInviteLinkInviteLink :: Text
, ChatInviteLink -> User
chatInviteLinkCreator :: User
, ChatInviteLink -> Bool
chatInviteLinkCreatesJoinRequest :: Bool
, ChatInviteLink -> Bool
chatInviteLinkIsPrimary :: Bool
, ChatInviteLink -> Bool
chatInviteLinkIsRevoked :: Bool
, ChatInviteLink -> Maybe Text
chatInviteLinkName :: Maybe Text
, ChatInviteLink -> Maybe POSIXTime
chatInviteLinkExpireDate :: Maybe POSIXTime
, ChatInviteLink -> Maybe Int
chatInviteLinkMemberLimit :: Maybe Int
, ChatInviteLink -> Maybe Int
chatInviteLinkPendingJoinRequestCount :: Maybe Int
}
deriving ((forall x. ChatInviteLink -> Rep ChatInviteLink x)
-> (forall x. Rep ChatInviteLink x -> ChatInviteLink)
-> Generic ChatInviteLink
forall x. Rep ChatInviteLink x -> ChatInviteLink
forall x. ChatInviteLink -> Rep ChatInviteLink x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ChatInviteLink -> Rep ChatInviteLink x
from :: forall x. ChatInviteLink -> Rep ChatInviteLink x
$cto :: forall x. Rep ChatInviteLink x -> ChatInviteLink
to :: forall x. Rep ChatInviteLink x -> ChatInviteLink
Generic, Int -> ChatInviteLink -> ShowS
[ChatInviteLink] -> ShowS
ChatInviteLink -> String
(Int -> ChatInviteLink -> ShowS)
-> (ChatInviteLink -> String)
-> ([ChatInviteLink] -> ShowS)
-> Show ChatInviteLink
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ChatInviteLink -> ShowS
showsPrec :: Int -> ChatInviteLink -> ShowS
$cshow :: ChatInviteLink -> String
show :: ChatInviteLink -> String
$cshowList :: [ChatInviteLink] -> ShowS
showList :: [ChatInviteLink] -> ShowS
Show)
instance ToJSON ChatInviteLink where toJSON :: ChatInviteLink -> Value
toJSON = ChatInviteLink -> Value
forall a (d :: Meta) (f :: * -> *).
(Generic a, GToJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
a -> Value
gtoJSON
instance FromJSON ChatInviteLink where parseJSON :: Value -> Parser ChatInviteLink
parseJSON = Value -> Parser ChatInviteLink
forall a (d :: Meta) (f :: * -> *).
(Generic a, GFromJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
Value -> Parser a
gparseJSON