module TD.Query.RemoveFavoriteSticker
  (RemoveFavoriteSticker(..)
  ) 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

-- | Removes a sticker from the list of favorite stickers. Returns 'TD.Data.Ok.Ok'
data RemoveFavoriteSticker
  = RemoveFavoriteSticker
    { RemoveFavoriteSticker -> Maybe InputFile
sticker :: Maybe InputFile.InputFile -- ^ Sticker file to delete from the list
    }
  deriving (RemoveFavoriteSticker -> RemoveFavoriteSticker -> Bool
(RemoveFavoriteSticker -> RemoveFavoriteSticker -> Bool)
-> (RemoveFavoriteSticker -> RemoveFavoriteSticker -> Bool)
-> Eq RemoveFavoriteSticker
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: RemoveFavoriteSticker -> RemoveFavoriteSticker -> Bool
== :: RemoveFavoriteSticker -> RemoveFavoriteSticker -> Bool
$c/= :: RemoveFavoriteSticker -> RemoveFavoriteSticker -> Bool
/= :: RemoveFavoriteSticker -> RemoveFavoriteSticker -> Bool
Eq, Int -> RemoveFavoriteSticker -> ShowS
[RemoveFavoriteSticker] -> ShowS
RemoveFavoriteSticker -> String
(Int -> RemoveFavoriteSticker -> ShowS)
-> (RemoveFavoriteSticker -> String)
-> ([RemoveFavoriteSticker] -> ShowS)
-> Show RemoveFavoriteSticker
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> RemoveFavoriteSticker -> ShowS
showsPrec :: Int -> RemoveFavoriteSticker -> ShowS
$cshow :: RemoveFavoriteSticker -> String
show :: RemoveFavoriteSticker -> String
$cshowList :: [RemoveFavoriteSticker] -> ShowS
showList :: [RemoveFavoriteSticker] -> ShowS
Show)

instance I.ShortShow RemoveFavoriteSticker where
  shortShow :: RemoveFavoriteSticker -> String
shortShow
    RemoveFavoriteSticker
      { sticker :: RemoveFavoriteSticker -> Maybe InputFile
sticker = Maybe InputFile
sticker_
      }
        = String
"RemoveFavoriteSticker"
          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 RemoveFavoriteSticker where
  toJSON :: RemoveFavoriteSticker -> Value
toJSON
    RemoveFavoriteSticker
      { sticker :: RemoveFavoriteSticker -> 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
"removeFavoriteSticker"
          , 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_
          ]