module TD.Query.SearchStickerSet
(SearchStickerSet(..)
, defaultSearchStickerSet
) where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as AT
import qualified TD.Lib.Internal as I
import qualified Data.Text as T
data SearchStickerSet
= SearchStickerSet
{ SearchStickerSet -> Maybe Text
name :: Maybe T.Text
, SearchStickerSet -> Maybe Bool
ignore_cache :: Maybe Bool
}
deriving (SearchStickerSet -> SearchStickerSet -> Bool
(SearchStickerSet -> SearchStickerSet -> Bool)
-> (SearchStickerSet -> SearchStickerSet -> Bool)
-> Eq SearchStickerSet
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SearchStickerSet -> SearchStickerSet -> Bool
== :: SearchStickerSet -> SearchStickerSet -> Bool
$c/= :: SearchStickerSet -> SearchStickerSet -> Bool
/= :: SearchStickerSet -> SearchStickerSet -> Bool
Eq, Int -> SearchStickerSet -> ShowS
[SearchStickerSet] -> ShowS
SearchStickerSet -> String
(Int -> SearchStickerSet -> ShowS)
-> (SearchStickerSet -> String)
-> ([SearchStickerSet] -> ShowS)
-> Show SearchStickerSet
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SearchStickerSet -> ShowS
showsPrec :: Int -> SearchStickerSet -> ShowS
$cshow :: SearchStickerSet -> String
show :: SearchStickerSet -> String
$cshowList :: [SearchStickerSet] -> ShowS
showList :: [SearchStickerSet] -> ShowS
Show)
instance I.ShortShow SearchStickerSet where
shortShow :: SearchStickerSet -> String
shortShow
SearchStickerSet
{ name :: SearchStickerSet -> Maybe Text
name = Maybe Text
name_
, ignore_cache :: SearchStickerSet -> Maybe Bool
ignore_cache = Maybe Bool
ignore_cache_
}
= String
"SearchStickerSet"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"name" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
name_
, String
"ignore_cache" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
ignore_cache_
]
instance AT.ToJSON SearchStickerSet where
toJSON :: SearchStickerSet -> Value
toJSON
SearchStickerSet
{ name :: SearchStickerSet -> Maybe Text
name = Maybe Text
name_
, ignore_cache :: SearchStickerSet -> Maybe Bool
ignore_cache = Maybe Bool
ignore_cache_
}
= [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
"searchStickerSet"
, Key
"name" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
name_
, Key
"ignore_cache" Key -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Bool
ignore_cache_
]
defaultSearchStickerSet :: SearchStickerSet
defaultSearchStickerSet :: SearchStickerSet
defaultSearchStickerSet =
SearchStickerSet
{ name :: Maybe Text
name = Maybe Text
forall a. Maybe a
Nothing
, ignore_cache :: Maybe Bool
ignore_cache = Maybe Bool
forall a. Maybe a
Nothing
}