module TD.Query.GetInstalledStickerSets
  (GetInstalledStickerSets(..)
  ) 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.StickerType as StickerType

-- | Returns a list of installed sticker sets. Returns 'TD.Data.StickerSets.StickerSets'
data GetInstalledStickerSets
  = GetInstalledStickerSets
    { GetInstalledStickerSets -> Maybe StickerType
sticker_type :: Maybe StickerType.StickerType -- ^ Type of the sticker sets to return
    }
  deriving (GetInstalledStickerSets -> GetInstalledStickerSets -> Bool
(GetInstalledStickerSets -> GetInstalledStickerSets -> Bool)
-> (GetInstalledStickerSets -> GetInstalledStickerSets -> Bool)
-> Eq GetInstalledStickerSets
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GetInstalledStickerSets -> GetInstalledStickerSets -> Bool
== :: GetInstalledStickerSets -> GetInstalledStickerSets -> Bool
$c/= :: GetInstalledStickerSets -> GetInstalledStickerSets -> Bool
/= :: GetInstalledStickerSets -> GetInstalledStickerSets -> Bool
Eq, Int -> GetInstalledStickerSets -> ShowS
[GetInstalledStickerSets] -> ShowS
GetInstalledStickerSets -> String
(Int -> GetInstalledStickerSets -> ShowS)
-> (GetInstalledStickerSets -> String)
-> ([GetInstalledStickerSets] -> ShowS)
-> Show GetInstalledStickerSets
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GetInstalledStickerSets -> ShowS
showsPrec :: Int -> GetInstalledStickerSets -> ShowS
$cshow :: GetInstalledStickerSets -> String
show :: GetInstalledStickerSets -> String
$cshowList :: [GetInstalledStickerSets] -> ShowS
showList :: [GetInstalledStickerSets] -> ShowS
Show)

instance I.ShortShow GetInstalledStickerSets where
  shortShow :: GetInstalledStickerSets -> String
shortShow
    GetInstalledStickerSets
      { sticker_type :: GetInstalledStickerSets -> Maybe StickerType
sticker_type = Maybe StickerType
sticker_type_
      }
        = String
"GetInstalledStickerSets"
          String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
          [ String
"sticker_type" String -> Maybe StickerType -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe StickerType
sticker_type_
          ]

instance AT.ToJSON GetInstalledStickerSets where
  toJSON :: GetInstalledStickerSets -> Value
toJSON
    GetInstalledStickerSets
      { sticker_type :: GetInstalledStickerSets -> Maybe StickerType
sticker_type = Maybe StickerType
sticker_type_
      }
        = [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
"getInstalledStickerSets"
          , Key
"sticker_type" Key -> Maybe StickerType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe StickerType
sticker_type_
          ]