module TD.Query.SearchStickers
(SearchStickers(..)
, defaultSearchStickers
) 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
import qualified Data.Text as T
data SearchStickers
= SearchStickers
{ SearchStickers -> Maybe StickerType
sticker_type :: Maybe StickerType.StickerType
, SearchStickers -> Maybe Text
emojis :: Maybe T.Text
, SearchStickers -> Maybe Text
query :: Maybe T.Text
, SearchStickers -> Maybe [Text]
input_language_codes :: Maybe [T.Text]
, SearchStickers -> Maybe Int
offset :: Maybe Int
, SearchStickers -> Maybe Int
limit :: Maybe Int
}
deriving (SearchStickers -> SearchStickers -> Bool
(SearchStickers -> SearchStickers -> Bool)
-> (SearchStickers -> SearchStickers -> Bool) -> Eq SearchStickers
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SearchStickers -> SearchStickers -> Bool
== :: SearchStickers -> SearchStickers -> Bool
$c/= :: SearchStickers -> SearchStickers -> Bool
/= :: SearchStickers -> SearchStickers -> Bool
Eq, Int -> SearchStickers -> ShowS
[SearchStickers] -> ShowS
SearchStickers -> String
(Int -> SearchStickers -> ShowS)
-> (SearchStickers -> String)
-> ([SearchStickers] -> ShowS)
-> Show SearchStickers
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SearchStickers -> ShowS
showsPrec :: Int -> SearchStickers -> ShowS
$cshow :: SearchStickers -> String
show :: SearchStickers -> String
$cshowList :: [SearchStickers] -> ShowS
showList :: [SearchStickers] -> ShowS
Show)
instance I.ShortShow SearchStickers where
shortShow :: SearchStickers -> String
shortShow
SearchStickers
{ sticker_type :: SearchStickers -> Maybe StickerType
sticker_type = Maybe StickerType
sticker_type_
, emojis :: SearchStickers -> Maybe Text
emojis = Maybe Text
emojis_
, query :: SearchStickers -> Maybe Text
query = Maybe Text
query_
, input_language_codes :: SearchStickers -> Maybe [Text]
input_language_codes = Maybe [Text]
input_language_codes_
, offset :: SearchStickers -> Maybe Int
offset = Maybe Int
offset_
, limit :: SearchStickers -> Maybe Int
limit = Maybe Int
limit_
}
= String
"SearchStickers"
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_
, String
"emojis" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
emojis_
, String
"query" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
query_
, String
"input_language_codes" String -> Maybe [Text] -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe [Text]
input_language_codes_
, String
"offset" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
offset_
, String
"limit" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
limit_
]
instance AT.ToJSON SearchStickers where
toJSON :: SearchStickers -> Value
toJSON
SearchStickers
{ sticker_type :: SearchStickers -> Maybe StickerType
sticker_type = Maybe StickerType
sticker_type_
, emojis :: SearchStickers -> Maybe Text
emojis = Maybe Text
emojis_
, query :: SearchStickers -> Maybe Text
query = Maybe Text
query_
, input_language_codes :: SearchStickers -> Maybe [Text]
input_language_codes = Maybe [Text]
input_language_codes_
, offset :: SearchStickers -> Maybe Int
offset = Maybe Int
offset_
, limit :: SearchStickers -> Maybe Int
limit = Maybe Int
limit_
}
= [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
"searchStickers"
, 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_
, Key
"emojis" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
emojis_
, Key
"query" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
query_
, Key
"input_language_codes" Key -> Maybe [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe [Text]
input_language_codes_
, Key
"offset" Key -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Int
offset_
, Key
"limit" Key -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Int
limit_
]
defaultSearchStickers :: SearchStickers
defaultSearchStickers :: SearchStickers
defaultSearchStickers =
SearchStickers
{ sticker_type :: Maybe StickerType
sticker_type = Maybe StickerType
forall a. Maybe a
Nothing
, emojis :: Maybe Text
emojis = Maybe Text
forall a. Maybe a
Nothing
, query :: Maybe Text
query = Maybe Text
forall a. Maybe a
Nothing
, input_language_codes :: Maybe [Text]
input_language_codes = Maybe [Text]
forall a. Maybe a
Nothing
, offset :: Maybe Int
offset = Maybe Int
forall a. Maybe a
Nothing
, limit :: Maybe Int
limit = Maybe Int
forall a. Maybe a
Nothing
}