{-# LANGUAGE DeriveGeneric #-}
module Telegram.Bot.API.Types.ChatBackground where
import Data.Aeson (FromJSON (..), ToJSON (..))
import GHC.Generics (Generic)
import Telegram.Bot.API.Internal.Utils
import Telegram.Bot.API.Types.BackgroundType
data ChatBackground = ChatBackground
{ ChatBackground -> BackgroundType
chatBackgroundType :: BackgroundType
}
deriving ((forall x. ChatBackground -> Rep ChatBackground x)
-> (forall x. Rep ChatBackground x -> ChatBackground)
-> Generic ChatBackground
forall x. Rep ChatBackground x -> ChatBackground
forall x. ChatBackground -> Rep ChatBackground x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ChatBackground -> Rep ChatBackground x
from :: forall x. ChatBackground -> Rep ChatBackground x
$cto :: forall x. Rep ChatBackground x -> ChatBackground
to :: forall x. Rep ChatBackground x -> ChatBackground
Generic, Int -> ChatBackground -> ShowS
[ChatBackground] -> ShowS
ChatBackground -> String
(Int -> ChatBackground -> ShowS)
-> (ChatBackground -> String)
-> ([ChatBackground] -> ShowS)
-> Show ChatBackground
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ChatBackground -> ShowS
showsPrec :: Int -> ChatBackground -> ShowS
$cshow :: ChatBackground -> String
show :: ChatBackground -> String
$cshowList :: [ChatBackground] -> ShowS
showList :: [ChatBackground] -> ShowS
Show)
instance ToJSON ChatBackground where toJSON :: ChatBackground -> Value
toJSON = ChatBackground -> Value
forall a (d :: Meta) (f :: * -> *).
(Generic a, GToJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
a -> Value
gtoJSON
instance FromJSON ChatBackground where parseJSON :: Value -> Parser ChatBackground
parseJSON = Value -> Parser ChatBackground
forall a (d :: Meta) (f :: * -> *).
(Generic a, GFromJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
Value -> Parser a
gparseJSON