module TD.Query.SearchEmojis
(SearchEmojis(..)
, defaultSearchEmojis
) 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 SearchEmojis
= SearchEmojis
{ SearchEmojis -> Maybe Text
text :: Maybe T.Text
, SearchEmojis -> Maybe [Text]
input_language_codes :: Maybe [T.Text]
}
deriving (SearchEmojis -> SearchEmojis -> Bool
(SearchEmojis -> SearchEmojis -> Bool)
-> (SearchEmojis -> SearchEmojis -> Bool) -> Eq SearchEmojis
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SearchEmojis -> SearchEmojis -> Bool
== :: SearchEmojis -> SearchEmojis -> Bool
$c/= :: SearchEmojis -> SearchEmojis -> Bool
/= :: SearchEmojis -> SearchEmojis -> Bool
Eq, Int -> SearchEmojis -> ShowS
[SearchEmojis] -> ShowS
SearchEmojis -> String
(Int -> SearchEmojis -> ShowS)
-> (SearchEmojis -> String)
-> ([SearchEmojis] -> ShowS)
-> Show SearchEmojis
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SearchEmojis -> ShowS
showsPrec :: Int -> SearchEmojis -> ShowS
$cshow :: SearchEmojis -> String
show :: SearchEmojis -> String
$cshowList :: [SearchEmojis] -> ShowS
showList :: [SearchEmojis] -> ShowS
Show)
instance I.ShortShow SearchEmojis where
shortShow :: SearchEmojis -> String
shortShow
SearchEmojis
{ text :: SearchEmojis -> Maybe Text
text = Maybe Text
text_
, input_language_codes :: SearchEmojis -> Maybe [Text]
input_language_codes = Maybe [Text]
input_language_codes_
}
= String
"SearchEmojis"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"text" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
text_
, String
"input_language_codes" String -> Maybe [Text] -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe [Text]
input_language_codes_
]
instance AT.ToJSON SearchEmojis where
toJSON :: SearchEmojis -> Value
toJSON
SearchEmojis
{ text :: SearchEmojis -> Maybe Text
text = Maybe Text
text_
, input_language_codes :: SearchEmojis -> Maybe [Text]
input_language_codes = Maybe [Text]
input_language_codes_
}
= [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
"searchEmojis"
, Key
"text" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
text_
, 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_
]
defaultSearchEmojis :: SearchEmojis
defaultSearchEmojis :: SearchEmojis
defaultSearchEmojis =
SearchEmojis
{ text :: Maybe Text
text = Maybe Text
forall a. Maybe a
Nothing
, input_language_codes :: Maybe [Text]
input_language_codes = Maybe [Text]
forall a. Maybe a
Nothing
}