{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
module Telegram.Bot.API.Types.Sticker 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.File
import Telegram.Bot.API.Types.MaskPosition
import Telegram.Bot.API.Types.PhotoSize
import Telegram.Bot.API.Internal.Utils
data Sticker = Sticker
{ Sticker -> FileId
stickerFileId :: FileId
, Sticker -> FileId
stickerFileUniqueId :: FileId
, Sticker -> Int
stickerWidth :: Int
, Sticker -> Int
stickerHeight :: Int
, Sticker -> Bool
stickerIsAnimated :: Bool
, Sticker -> Bool
stickerIsVideo :: Bool
, Sticker -> Maybe PhotoSize
stickerThumb :: Maybe PhotoSize
, Sticker -> Maybe Text
stickerEmoji :: Maybe Text
, Sticker -> Maybe Text
stickerSetName :: Maybe Text
, Sticker -> Maybe File
stickerPremiumAnimation :: Maybe File
, Sticker -> Maybe MaskPosition
stickerMaskPosition :: Maybe MaskPosition
, Sticker -> Maybe Text
stickerCustomEmojiId :: Maybe Text
, Sticker -> Maybe Integer
stickerFileSize :: Maybe Integer
}
deriving (forall x. Rep Sticker x -> Sticker
forall x. Sticker -> Rep Sticker x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Sticker x -> Sticker
$cfrom :: forall x. Sticker -> Rep Sticker x
Generic, Int -> Sticker -> ShowS
[Sticker] -> ShowS
Sticker -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Sticker] -> ShowS
$cshowList :: [Sticker] -> ShowS
show :: Sticker -> String
$cshow :: Sticker -> String
showsPrec :: Int -> Sticker -> ShowS
$cshowsPrec :: Int -> Sticker -> ShowS
Show)
instance ToJSON Sticker where toJSON :: Sticker -> 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 Sticker where parseJSON :: Value -> Parser Sticker
parseJSON = forall a (d :: Meta) (f :: * -> *).
(Generic a, GFromJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
Value -> Parser a
gparseJSON
data StickerSet = StickerSet
{ StickerSet -> Text
stickerSetName :: Text
, StickerSet -> Text
stickerSetTitle :: Text
, StickerSet -> StickerSetType
stickerSetType :: StickerSetType
, StickerSet -> Bool
stickerSetIsAnimated :: Bool
, StickerSet -> Bool
stickerSetIsVideo :: Bool
, StickerSet -> Maybe Bool
stickerSetContainsMasks :: Maybe Bool
, StickerSet -> [Sticker]
stickerSetStickers :: [Sticker]
, StickerSet -> Maybe PhotoSize
stickerSetThumb :: Maybe PhotoSize
}
deriving (forall x. Rep StickerSet x -> StickerSet
forall x. StickerSet -> Rep StickerSet x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StickerSet x -> StickerSet
$cfrom :: forall x. StickerSet -> Rep StickerSet x
Generic, Int -> StickerSet -> ShowS
[StickerSet] -> ShowS
StickerSet -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StickerSet] -> ShowS
$cshowList :: [StickerSet] -> ShowS
show :: StickerSet -> String
$cshow :: StickerSet -> String
showsPrec :: Int -> StickerSet -> ShowS
$cshowsPrec :: Int -> StickerSet -> ShowS
Show)
instance ToJSON StickerSet where toJSON :: StickerSet -> 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 StickerSet where parseJSON :: Value -> Parser StickerSet
parseJSON = forall a (d :: Meta) (f :: * -> *).
(Generic a, GFromJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
Value -> Parser a
gparseJSON
data StickerSetType
= StickerSetTypeRegular
| StickerSetTypeMask
| StickerSetTypeCustomEmoji
deriving (StickerSetType -> StickerSetType -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StickerSetType -> StickerSetType -> Bool
$c/= :: StickerSetType -> StickerSetType -> Bool
== :: StickerSetType -> StickerSetType -> Bool
$c== :: StickerSetType -> StickerSetType -> Bool
Eq, Int -> StickerSetType -> ShowS
[StickerSetType] -> ShowS
StickerSetType -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StickerSetType] -> ShowS
$cshowList :: [StickerSetType] -> ShowS
show :: StickerSetType -> String
$cshow :: StickerSetType -> String
showsPrec :: Int -> StickerSetType -> ShowS
$cshowsPrec :: Int -> StickerSetType -> ShowS
Show, forall x. Rep StickerSetType x -> StickerSetType
forall x. StickerSetType -> Rep StickerSetType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StickerSetType x -> StickerSetType
$cfrom :: forall x. StickerSetType -> Rep StickerSetType x
Generic)
instance ToJSON StickerSetType where toJSON :: StickerSetType -> 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 StickerSetType where parseJSON :: Value -> Parser StickerSetType
parseJSON = forall a (d :: Meta) (f :: * -> *).
(Generic a, GFromJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
Value -> Parser a
gparseJSON