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

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

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

-- ** 'VideoNote'

-- | This object represents a video message (available in Telegram apps as of v.4.0).
data VideoNote = VideoNote
  { VideoNote -> FileId
videoNoteFileId   :: FileId -- ^ Unique identifier for this file.
  , VideoNote -> FileId
videoNoteFileUniqueId :: 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.
  , VideoNote -> Int
videoNoteLength   :: Int -- ^ Video width and height as defined by sender.
  , VideoNote -> Seconds
videoNoteDuration :: Seconds -- ^ Duration of the video in seconds as defined by sender.
  , VideoNote -> Maybe PhotoSize
videoNoteThumb    :: Maybe PhotoSize -- ^ Video thumbnail.
  , VideoNote -> Maybe Integer
videoNoteFileSize :: Maybe Integer -- ^ File size in bytes.
  }
  deriving (forall x. Rep VideoNote x -> VideoNote
forall x. VideoNote -> Rep VideoNote x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep VideoNote x -> VideoNote
$cfrom :: forall x. VideoNote -> Rep VideoNote x
Generic, Int -> VideoNote -> ShowS
[VideoNote] -> ShowS
VideoNote -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VideoNote] -> ShowS
$cshowList :: [VideoNote] -> ShowS
show :: VideoNote -> String
$cshow :: VideoNote -> String
showsPrec :: Int -> VideoNote -> ShowS
$cshowsPrec :: Int -> VideoNote -> ShowS
Show)

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