module TD.Query.GetStickerEmojis
  (GetStickerEmojis(..)
  ) where

import qualified Data.Aeson as A
import qualified Data.Aeson.Types as AT
import qualified TD.Lib.Internal as I
import qualified TD.Data.InputFile as InputFile

-- | Returns emoji corresponding to a sticker. The list is only for informational purposes, because a sticker is always sent with a fixed emoji from the corresponding Sticker object. Returns 'TD.Data.Emojis.Emojis'
data GetStickerEmojis
  = GetStickerEmojis
    { GetStickerEmojis -> Maybe InputFile
sticker :: Maybe InputFile.InputFile -- ^ Sticker file identifier
    }
  deriving (GetStickerEmojis -> GetStickerEmojis -> Bool
(GetStickerEmojis -> GetStickerEmojis -> Bool)
-> (GetStickerEmojis -> GetStickerEmojis -> Bool)
-> Eq GetStickerEmojis
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GetStickerEmojis -> GetStickerEmojis -> Bool
== :: GetStickerEmojis -> GetStickerEmojis -> Bool
$c/= :: GetStickerEmojis -> GetStickerEmojis -> Bool
/= :: GetStickerEmojis -> GetStickerEmojis -> Bool
Eq, Int -> GetStickerEmojis -> ShowS
[GetStickerEmojis] -> ShowS
GetStickerEmojis -> String
(Int -> GetStickerEmojis -> ShowS)
-> (GetStickerEmojis -> String)
-> ([GetStickerEmojis] -> ShowS)
-> Show GetStickerEmojis
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GetStickerEmojis -> ShowS
showsPrec :: Int -> GetStickerEmojis -> ShowS
$cshow :: GetStickerEmojis -> String
show :: GetStickerEmojis -> String
$cshowList :: [GetStickerEmojis] -> ShowS
showList :: [GetStickerEmojis] -> ShowS
Show)

instance I.ShortShow GetStickerEmojis where
  shortShow :: GetStickerEmojis -> String
shortShow
    GetStickerEmojis
      { sticker :: GetStickerEmojis -> Maybe InputFile
sticker = Maybe InputFile
sticker_
      }
        = String
"GetStickerEmojis"
          String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
          [ String
"sticker" String -> Maybe InputFile -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe InputFile
sticker_
          ]

instance AT.ToJSON GetStickerEmojis where
  toJSON :: GetStickerEmojis -> Value
toJSON
    GetStickerEmojis
      { sticker :: GetStickerEmojis -> Maybe InputFile
sticker = Maybe InputFile
sticker_
      }
        = [Pair] -> Value
A.object
          [ Key
"@type"   Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"getStickerEmojis"
          , Key
"sticker" Key -> Maybe InputFile -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe InputFile
sticker_
          ]