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

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

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

-- ** Chat photo

-- | Chat photo. Returned only in getChat.
data ChatPhoto = ChatPhoto
  { ChatPhoto -> FileId
chatPhotoSmallFileId       :: FileId -- ^ Unique file identifier of small (160x160) chat photo. This file_id can be used only for photo download.
  , ChatPhoto -> FileId
chatPhotoSmallFileUniqueId :: FileId -- ^ Unique file identifier of small (160x160) chat photo, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
  , ChatPhoto -> FileId
chatPhotoBigFileId         :: FileId -- ^ Unique file identifier of big (640x640) chat photo. This file_id can be used only for photo download.
  , ChatPhoto -> FileId
chatPhotoBigFileUniqueId   :: FileId -- ^ Unique file identifier of big (640x640) chat photo, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
  }
  deriving ((forall x. ChatPhoto -> Rep ChatPhoto x)
-> (forall x. Rep ChatPhoto x -> ChatPhoto) -> Generic ChatPhoto
forall x. Rep ChatPhoto x -> ChatPhoto
forall x. ChatPhoto -> Rep ChatPhoto x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ChatPhoto -> Rep ChatPhoto x
from :: forall x. ChatPhoto -> Rep ChatPhoto x
$cto :: forall x. Rep ChatPhoto x -> ChatPhoto
to :: forall x. Rep ChatPhoto x -> ChatPhoto
Generic, Int -> ChatPhoto -> ShowS
[ChatPhoto] -> ShowS
ChatPhoto -> String
(Int -> ChatPhoto -> ShowS)
-> (ChatPhoto -> String)
-> ([ChatPhoto] -> ShowS)
-> Show ChatPhoto
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ChatPhoto -> ShowS
showsPrec :: Int -> ChatPhoto -> ShowS
$cshow :: ChatPhoto -> String
show :: ChatPhoto -> String
$cshowList :: [ChatPhoto] -> ShowS
showList :: [ChatPhoto] -> ShowS
Show)

instance ToJSON   ChatPhoto where toJSON :: ChatPhoto -> Value
toJSON = ChatPhoto -> Value
forall a (d :: Meta) (f :: * -> *).
(Generic a, GToJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
a -> Value
gtoJSON
instance FromJSON ChatPhoto where parseJSON :: Value -> Parser ChatPhoto
parseJSON = Value -> Parser ChatPhoto
forall a (d :: Meta) (f :: * -> *).
(Generic a, GFromJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
Value -> Parser a
gparseJSON