{-# LANGUAGE DeriveGeneric #-}
module Telegram.Bot.API.Types.ForumTopicCreated where

import Data.Aeson (FromJSON (..), ToJSON (..))
import Data.Text (Text)
import GHC.Generics (Generic)

import Telegram.Bot.API.Internal.Utils

-- ** 'ForumTopicCreated'

-- | This object represents a service message about a new forum topic created in the chat.
data ForumTopicCreated = ForumTopicCreated
  { ForumTopicCreated -> Text
forumTopicCreatedName              :: Text       -- ^ Name of the topic.
  , ForumTopicCreated -> Integer
forumTopicCreatedIconColor         :: Integer    -- ^ Color of the topic icon in RGB format.
  , ForumTopicCreated -> Maybe Text
forumTopicCreatedIconCustomEmojiId :: Maybe Text -- ^ Unique identifier of the custom emoji shown as the topic icon.
  }
  deriving (forall x. Rep ForumTopicCreated x -> ForumTopicCreated
forall x. ForumTopicCreated -> Rep ForumTopicCreated x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ForumTopicCreated x -> ForumTopicCreated
$cfrom :: forall x. ForumTopicCreated -> Rep ForumTopicCreated x
Generic, Int -> ForumTopicCreated -> ShowS
[ForumTopicCreated] -> ShowS
ForumTopicCreated -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ForumTopicCreated] -> ShowS
$cshowList :: [ForumTopicCreated] -> ShowS
show :: ForumTopicCreated -> String
$cshow :: ForumTopicCreated -> String
showsPrec :: Int -> ForumTopicCreated -> ShowS
$cshowsPrec :: Int -> ForumTopicCreated -> ShowS
Show)

instance ToJSON   ForumTopicCreated where toJSON :: ForumTopicCreated -> 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 ForumTopicCreated where parseJSON :: Value -> Parser ForumTopicCreated
parseJSON = forall a (d :: Meta) (f :: * -> *).
(Generic a, GFromJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
Value -> Parser a
gparseJSON