{-# 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

-- ** 'Sticker'

-- | This object represents a sticker.
data Sticker = Sticker
  { Sticker -> FileId
stickerFileId       :: FileId             -- ^ Identifier for this file, which can be used to download or reuse the file.
  , Sticker -> FileId
stickerFileUniqueId :: 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.
  , Sticker -> Int
stickerWidth        :: Int              -- ^ Sticker width.
  , Sticker -> Int
stickerHeight       :: Int              -- ^ Sticker height.
  , Sticker -> Bool
stickerIsAnimated   :: Bool               -- ^ 'True', if the sticker is animated.
  , Sticker -> Bool
stickerIsVideo      :: Bool               -- ^ 'True', if the sticker is a video sticker.
  , Sticker -> Maybe PhotoSize
stickerThumb        :: Maybe PhotoSize    -- ^ Sticker thumbnail in the .WEBP or .JPG format.
  , Sticker -> Maybe Text
stickerEmoji        :: Maybe Text         -- ^ Emoji associated with the sticker.
  , Sticker -> Maybe Text
stickerSetName      :: Maybe Text         -- ^ Name of the sticker set to which the sticker belongs.
  , Sticker -> Maybe File
stickerPremiumAnimation :: Maybe File    -- ^ For premium regular stickers, premium animation for the sticker.
  , Sticker -> Maybe MaskPosition
stickerMaskPosition :: Maybe MaskPosition -- ^ For mask stickers, the position where the mask should be placed.
  , Sticker -> Maybe Text
stickerCustomEmojiId :: Maybe Text        -- ^ For custom emoji stickers, unique identifier of the custom emoji.
  , Sticker -> Maybe Integer
stickerFileSize     :: Maybe Integer      -- ^ File size in bytes.
  }
  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

-- ** 'StickerSet'

-- | This object represents a sticker set.
data StickerSet = StickerSet
  { StickerSet -> Text
stickerSetName          :: Text            -- ^ Sticker set name.
  , StickerSet -> Text
stickerSetTitle         :: Text            -- ^ Sticker set title.
  , StickerSet -> StickerSetType
stickerSetType          :: StickerSetType  -- ^ Type of stickers in the set, currently one of “regular”, “mask”, “custom_emoji”.
  , StickerSet -> Bool
stickerSetIsAnimated    :: Bool            -- ^ 'True', if the sticker set contains animated stickers.
  , StickerSet -> Bool
stickerSetIsVideo       :: Bool            -- ^ 'True', if the sticker is a video sticker.
  , StickerSet -> Maybe Bool
stickerSetContainsMasks :: Maybe Bool      -- ^ True, if the sticker set contains masks.
  , StickerSet -> [Sticker]
stickerSetStickers      :: [Sticker]       -- ^ List of all set stickers.
  , StickerSet -> Maybe PhotoSize
stickerSetThumb         :: Maybe PhotoSize -- ^ Sticker set thumbnail in the .WEBP or .TGS format.
  }
  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


-- | Type of stickers in the set, currently one of “regular”, “mask”, “custom_emoji”.
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