module TD.Query.ClearRecentStickers
  (ClearRecentStickers(..)
  ) where

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

-- | Clears the list of recently used stickers. Returns 'TD.Data.Ok.Ok'
data ClearRecentStickers
  = ClearRecentStickers
    { ClearRecentStickers -> Maybe Bool
is_attached :: Maybe Bool -- ^ Pass true to clear the list of stickers recently attached to photo or video files; pass false to clear the list of recently sent stickers
    }
  deriving (ClearRecentStickers -> ClearRecentStickers -> Bool
(ClearRecentStickers -> ClearRecentStickers -> Bool)
-> (ClearRecentStickers -> ClearRecentStickers -> Bool)
-> Eq ClearRecentStickers
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ClearRecentStickers -> ClearRecentStickers -> Bool
== :: ClearRecentStickers -> ClearRecentStickers -> Bool
$c/= :: ClearRecentStickers -> ClearRecentStickers -> Bool
/= :: ClearRecentStickers -> ClearRecentStickers -> Bool
Eq, Int -> ClearRecentStickers -> ShowS
[ClearRecentStickers] -> ShowS
ClearRecentStickers -> String
(Int -> ClearRecentStickers -> ShowS)
-> (ClearRecentStickers -> String)
-> ([ClearRecentStickers] -> ShowS)
-> Show ClearRecentStickers
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ClearRecentStickers -> ShowS
showsPrec :: Int -> ClearRecentStickers -> ShowS
$cshow :: ClearRecentStickers -> String
show :: ClearRecentStickers -> String
$cshowList :: [ClearRecentStickers] -> ShowS
showList :: [ClearRecentStickers] -> ShowS
Show)

instance I.ShortShow ClearRecentStickers where
  shortShow :: ClearRecentStickers -> String
shortShow
    ClearRecentStickers
      { is_attached :: ClearRecentStickers -> Maybe Bool
is_attached = Maybe Bool
is_attached_
      }
        = String
"ClearRecentStickers"
          String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
          [ String
"is_attached" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
is_attached_
          ]

instance AT.ToJSON ClearRecentStickers where
  toJSON :: ClearRecentStickers -> Value
toJSON
    ClearRecentStickers
      { is_attached :: ClearRecentStickers -> Maybe Bool
is_attached = Maybe Bool
is_attached_
      }
        = [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
"clearRecentStickers"
          , Key
"is_attached" Key -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Bool
is_attached_
          ]