{-# LANGUAGE DeriveGeneric #-}
module Telegram.Bot.API.Types.Chat where
import Data.Aeson (ToJSON(..), FromJSON(..))
import Data.Time.Clock.POSIX (POSIXTime)
import Data.Text (Text)
import GHC.Generics (Generic)
import Telegram.Bot.API.Types.ChatLocation
import Telegram.Bot.API.Types.ChatPhoto
import Telegram.Bot.API.Types.ChatPermissions
import Telegram.Bot.API.Types.Common
import Telegram.Bot.API.Types.Message
import Telegram.Bot.API.Internal.Utils
data Chat = Chat
{ Chat -> ChatId
chatId :: ChatId
, Chat -> ChatType
chatType :: ChatType
, Chat -> Maybe Text
chatTitle :: Maybe Text
, Chat -> Maybe Text
chatUsername :: Maybe Text
, Chat -> Maybe Text
chatFirstName :: Maybe Text
, Chat -> Maybe Text
chatLastName :: Maybe Text
, Chat -> Maybe Bool
chatIsForum :: Maybe Bool
, Chat -> Maybe ChatPhoto
chatPhoto :: Maybe ChatPhoto
, Chat -> Maybe Text
chatActiveUsernames :: Maybe Text
, Chat -> Maybe Text
chatEmojiStatusCustomEmojiId :: Maybe Text
, Chat -> Maybe Text
chatBio :: Maybe Text
, Chat -> Maybe Bool
chatHasPrivateForwards :: Maybe Bool
, Chat -> Maybe Bool
chatHasRestrictedVoiceAndVideoMessages :: Maybe Bool
, Chat -> Maybe Bool
chatJoinToSendMessages :: Maybe Bool
, Chat -> Maybe Bool
chatJoinByRequest :: Maybe Bool
, Chat -> Maybe Text
chatDescription :: Maybe Text
, Chat -> Maybe Text
chatInviteLink :: Maybe Text
, Chat -> Maybe Message
chatPinnedMessage :: Maybe Message
, Chat -> Maybe ChatPermissions
chatPermissions :: Maybe ChatPermissions
, Chat -> Maybe Int
chatSlowModeDelay :: Maybe Int
, Chat -> Maybe POSIXTime
chatMessageAutoDeleteTime :: Maybe POSIXTime
, Chat -> Maybe Bool
chatHasProtectedContent :: Maybe Bool
, Chat -> Maybe Text
chatStickerSetName :: Maybe Text
, Chat -> Maybe Bool
chatCanSetStickerSet :: Maybe Bool
, Chat -> Maybe ChatId
chatLinkedChatId :: Maybe ChatId
, Chat -> Maybe ChatLocation
chatLocation :: Maybe ChatLocation
}
deriving (forall x. Rep Chat x -> Chat
forall x. Chat -> Rep Chat x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Chat x -> Chat
$cfrom :: forall x. Chat -> Rep Chat x
Generic, Int -> Chat -> ShowS
[Chat] -> ShowS
Chat -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Chat] -> ShowS
$cshowList :: [Chat] -> ShowS
show :: Chat -> String
$cshow :: Chat -> String
showsPrec :: Int -> Chat -> ShowS
$cshowsPrec :: Int -> Chat -> ShowS
Show)
instance ToJSON Chat where toJSON :: Chat -> 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 Chat where parseJSON :: Value -> Parser Chat
parseJSON = forall a (d :: Meta) (f :: * -> *).
(Generic a, GFromJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
Value -> Parser a
gparseJSON
data ChatType
= ChatTypePrivate
| ChatTypeGroup
| ChatTypeSupergroup
| ChatTypeChannel
deriving (forall x. Rep ChatType x -> ChatType
forall x. ChatType -> Rep ChatType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ChatType x -> ChatType
$cfrom :: forall x. ChatType -> Rep ChatType x
Generic, Int -> ChatType -> ShowS
[ChatType] -> ShowS
ChatType -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ChatType] -> ShowS
$cshowList :: [ChatType] -> ShowS
show :: ChatType -> String
$cshow :: ChatType -> String
showsPrec :: Int -> ChatType -> ShowS
$cshowsPrec :: Int -> ChatType -> ShowS
Show)
instance ToJSON ChatType where
toJSON :: ChatType -> 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 ChatType where
parseJSON :: Value -> Parser ChatType
parseJSON = forall a (d :: Meta) (f :: * -> *).
(Generic a, GFromJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
Value -> Parser a
gparseJSON