{-# 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. ForumTopicCreated -> Rep ForumTopicCreated x)
-> (forall x. Rep ForumTopicCreated x -> ForumTopicCreated)
-> Generic ForumTopicCreated
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
$cfrom :: forall x. ForumTopicCreated -> Rep ForumTopicCreated x
from :: forall x. ForumTopicCreated -> Rep ForumTopicCreated x
$cto :: forall x. Rep ForumTopicCreated x -> ForumTopicCreated
to :: forall x. Rep ForumTopicCreated x -> ForumTopicCreated
Generic, Int -> ForumTopicCreated -> ShowS
[ForumTopicCreated] -> ShowS
ForumTopicCreated -> String
(Int -> ForumTopicCreated -> ShowS)
-> (ForumTopicCreated -> String)
-> ([ForumTopicCreated] -> ShowS)
-> Show ForumTopicCreated
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ForumTopicCreated -> ShowS
showsPrec :: Int -> ForumTopicCreated -> ShowS
$cshow :: ForumTopicCreated -> String
show :: ForumTopicCreated -> String
$cshowList :: [ForumTopicCreated] -> ShowS
showList :: [ForumTopicCreated] -> ShowS
Show)

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