{-# 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

-- ** 'Dice'

-- | This object represents an animated emoji that displays a random value.
data Dice = Dice
  { Dice -> Text
diceEmoji :: Text -- ^ Emoji on which the dice throw animation is based.
  , Dice -> Int
diceValue :: Int  -- ^ Value of the dice, 1-6 for “🎲”, “🎯” and “🎳” base emoji, 1-5 for “🏀” and “⚽” base emoji, 1-64 for “🎰” base emoji
  }
  deriving (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
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 = 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 = forall a (d :: Meta) (f :: * -> *).
(Generic a, GFromJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
Value -> Parser a
gparseJSON