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

-- ** 'Document'

-- | This object represents a general file (as opposed to photos, voice messages and audio files).
data Document = Document
  { Document -> FileId
documentFileId   :: FileId -- ^ Unique file identifier.
  , Document -> FileId
documentFileUniqueId :: 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.
  , Document -> Maybe PhotoSize
documentThumb    :: Maybe PhotoSize -- ^ Document thumbnail as defined by sender.
  , Document -> Maybe Text
documentFileName :: Maybe Text -- ^ Original filename as defined by sender.
  , Document -> Maybe Text
documentMimeType :: Maybe Text -- ^ MIME type of the file as defined by sender.
  , Document -> Maybe Integer
documentFileSize :: Maybe Integer -- ^ File size in bytes. 
  }
  deriving (forall x. Rep Document x -> Document
forall x. Document -> Rep Document x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Document x -> Document
$cfrom :: forall x. Document -> Rep Document x
Generic, Int -> Document -> ShowS
[Document] -> ShowS
Document -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Document] -> ShowS
$cshowList :: [Document] -> ShowS
show :: Document -> String
$cshow :: Document -> String
showsPrec :: Int -> Document -> ShowS
$cshowsPrec :: Int -> Document -> ShowS
Show)

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