{-# LANGUAGE DeriveGeneric #-}
module Telegram.Bot.API.Types.PhotoSize where
import Data.Aeson (FromJSON (..), ToJSON (..))
import GHC.Generics (Generic)
import Telegram.Bot.API.Types.Common
import Telegram.Bot.API.Internal.Utils
data PhotoSize = PhotoSize
{ PhotoSize -> FileId
photoSizeFileId :: FileId
, PhotoSize -> FileId
photoSizeFileUniqueId :: FileId
, PhotoSize -> Int
photoSizeWidth :: Int
, PhotoSize -> Int
photoSizeHeight :: Int
, PhotoSize -> Maybe Int
photoSizeFileSize :: Maybe Int
}
deriving (forall x. Rep PhotoSize x -> PhotoSize
forall x. PhotoSize -> Rep PhotoSize x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PhotoSize x -> PhotoSize
$cfrom :: forall x. PhotoSize -> Rep PhotoSize x
Generic, Int -> PhotoSize -> ShowS
[PhotoSize] -> ShowS
PhotoSize -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PhotoSize] -> ShowS
$cshowList :: [PhotoSize] -> ShowS
show :: PhotoSize -> String
$cshow :: PhotoSize -> String
showsPrec :: Int -> PhotoSize -> ShowS
$cshowsPrec :: Int -> PhotoSize -> ShowS
Show)
instance ToJSON PhotoSize where toJSON :: PhotoSize -> 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 PhotoSize where parseJSON :: Value -> Parser PhotoSize
parseJSON = forall a (d :: Meta) (f :: * -> *).
(Generic a, GFromJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
Value -> Parser a
gparseJSON