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

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

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

-- ** 'Video'

-- | This object represents a video file.
data Video = Video
  { Video -> FileId
videoFileId       :: FileId -- ^ Unique identifier for this file.
  , Video -> FileId
videoFileUniqueId :: 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.
  , Video -> Int
videoWidth        :: Int -- ^ Video width as defined by sender.
  , Video -> Int
videoHeight       :: Int -- ^ Video height as defined by sender.
  , Video -> Seconds
videoDuration     :: Seconds -- ^ Duration of the video in seconds as defined by sender.
  , Video -> Maybe PhotoSize
videoThumb        :: Maybe PhotoSize -- ^ Video thumbnail.
  , Video -> Maybe Text
videoFileName     :: Maybe Text -- ^ Original filename as defined by sender.
  , Video -> Maybe Text
videoMimeType     :: Maybe Text -- ^ Mime type of a file as defined by sender.
  , Video -> Maybe Integer
videoFileSize     :: Maybe Integer -- ^ File size in bytes.
  }
  deriving (forall x. Rep Video x -> Video
forall x. Video -> Rep Video x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Video x -> Video
$cfrom :: forall x. Video -> Rep Video x
Generic, Int -> Video -> ShowS
[Video] -> ShowS
Video -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Video] -> ShowS
$cshowList :: [Video] -> ShowS
show :: Video -> String
$cshow :: Video -> String
showsPrec :: Int -> Video -> ShowS
$cshowsPrec :: Int -> Video -> ShowS
Show)

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