{-# LANGUAGE DeriveGeneric #-}
module Telegram.Bot.API.Types.Animation 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

-- ** 'Animation'

-- | This object represents an animation file (GIF or H.264/MPEG-4 AVC video without sound).
data Animation = Animation
  { Animation -> FileId
animationFileId       :: FileId          -- ^ Identifier for this file, which can be used to download or reuse the file.
  , Animation -> FileId
animationFileUniqueId :: 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.
  , Animation -> Int
animationWidth        :: Int           -- ^ Video width as defined by sender.
  , Animation -> Int
animationHeight       :: Int           -- ^ Video height as defined by sender.
  , Animation -> Seconds
animationDuration     :: Seconds         -- ^ Duration of the video in seconds as defined by sender.
  , Animation -> Maybe PhotoSize
animationThumbnail    :: Maybe PhotoSize -- ^ Animation thumbnail as defined by sender.
  , Animation -> Maybe Text
animationFileName     :: Maybe Text      -- ^ Original animation filename as defined by sender.
  , Animation -> Maybe Text
animationMimeType     :: Maybe Text      -- ^ MIME type of the file as defined by sender.
  , Animation -> Maybe Integer
animationFileSize     :: Maybe Integer   -- ^ File size in bytes.
  }
  deriving (forall x. Rep Animation x -> Animation
forall x. Animation -> Rep Animation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Animation x -> Animation
$cfrom :: forall x. Animation -> Rep Animation x
Generic, Int -> Animation -> ShowS
[Animation] -> ShowS
Animation -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Animation] -> ShowS
$cshowList :: [Animation] -> ShowS
show :: Animation -> String
$cshow :: Animation -> String
showsPrec :: Int -> Animation -> ShowS
$cshowsPrec :: Int -> Animation -> ShowS
Show)

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