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

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

import Telegram.Bot.API.Types.Common 
import Telegram.Bot.API.Internal.Utils

-- ** 'Voice'

-- | This object represents a voice note.
data Voice = Voice
  { Voice -> FileId
voiceFileId   :: FileId -- ^ Unique identifier for this file.
  , Voice -> FileId
voiceFileUniqueId :: FileId -- ^ Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
  , Voice -> Seconds
voiceDuration :: Seconds -- ^ Duration of the audio in seconds as defined by sender.
  , Voice -> Maybe Text
voiceMimeType :: Maybe Text -- ^ MIME type of the file as defined by sender.
  , Voice -> Maybe Integer
voiceFileSize :: Maybe Integer -- ^ File size in bytes.
  }
  deriving (forall x. Rep Voice x -> Voice
forall x. Voice -> Rep Voice x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Voice x -> Voice
$cfrom :: forall x. Voice -> Rep Voice x
Generic, Int -> Voice -> ShowS
[Voice] -> ShowS
Voice -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Voice] -> ShowS
$cshowList :: [Voice] -> ShowS
show :: Voice -> String
$cshow :: Voice -> String
showsPrec :: Int -> Voice -> ShowS
$cshowsPrec :: Int -> Voice -> ShowS
Show)

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