module TD.Query.ViewTrendingStickerSets
  (ViewTrendingStickerSets(..)
  ) where

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

-- | Informs the server that some trending sticker sets have been viewed by the user. Returns 'TD.Data.Ok.Ok'
data ViewTrendingStickerSets
  = ViewTrendingStickerSets
    { ViewTrendingStickerSets -> Maybe [Int]
sticker_set_ids :: Maybe [Int] -- ^ Identifiers of viewed trending sticker sets
    }
  deriving (ViewTrendingStickerSets -> ViewTrendingStickerSets -> Bool
(ViewTrendingStickerSets -> ViewTrendingStickerSets -> Bool)
-> (ViewTrendingStickerSets -> ViewTrendingStickerSets -> Bool)
-> Eq ViewTrendingStickerSets
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ViewTrendingStickerSets -> ViewTrendingStickerSets -> Bool
== :: ViewTrendingStickerSets -> ViewTrendingStickerSets -> Bool
$c/= :: ViewTrendingStickerSets -> ViewTrendingStickerSets -> Bool
/= :: ViewTrendingStickerSets -> ViewTrendingStickerSets -> Bool
Eq, Int -> ViewTrendingStickerSets -> ShowS
[ViewTrendingStickerSets] -> ShowS
ViewTrendingStickerSets -> String
(Int -> ViewTrendingStickerSets -> ShowS)
-> (ViewTrendingStickerSets -> String)
-> ([ViewTrendingStickerSets] -> ShowS)
-> Show ViewTrendingStickerSets
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ViewTrendingStickerSets -> ShowS
showsPrec :: Int -> ViewTrendingStickerSets -> ShowS
$cshow :: ViewTrendingStickerSets -> String
show :: ViewTrendingStickerSets -> String
$cshowList :: [ViewTrendingStickerSets] -> ShowS
showList :: [ViewTrendingStickerSets] -> ShowS
Show)

instance I.ShortShow ViewTrendingStickerSets where
  shortShow :: ViewTrendingStickerSets -> String
shortShow
    ViewTrendingStickerSets
      { sticker_set_ids :: ViewTrendingStickerSets -> Maybe [Int]
sticker_set_ids = Maybe [Int]
sticker_set_ids_
      }
        = String
"ViewTrendingStickerSets"
          String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
          [ String
"sticker_set_ids" String -> Maybe [Int] -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe [Int]
sticker_set_ids_
          ]

instance AT.ToJSON ViewTrendingStickerSets where
  toJSON :: ViewTrendingStickerSets -> Value
toJSON
    ViewTrendingStickerSets
      { sticker_set_ids :: ViewTrendingStickerSets -> Maybe [Int]
sticker_set_ids = Maybe [Int]
sticker_set_ids_
      }
        = [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
"viewTrendingStickerSets"
          , Key
"sticker_set_ids" Key -> Maybe [Value] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= ([Int] -> [Value]) -> Maybe [Int] -> Maybe [Value]
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((Int -> Value) -> [Int] -> [Value]
forall a b. (a -> b) -> [a] -> [b]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Int -> Value
I.writeInt64 ) Maybe [Int]
sticker_set_ids_
          ]