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