module TD.Query.GetKeywordEmojis
  (GetKeywordEmojis(..)
  , defaultGetKeywordEmojis
  ) 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

-- | Return emojis matching the keyword. Supported only if the file database is enabled. Order of results is unspecified. Returns 'TD.Data.Emojis.Emojis'
data GetKeywordEmojis
  = GetKeywordEmojis
    { GetKeywordEmojis -> Maybe Text
text                 :: Maybe T.Text   -- ^ Text to search for
    , GetKeywordEmojis -> Maybe [Text]
input_language_codes :: Maybe [T.Text] -- ^ List of possible IETF language tags of the user's input language; may be empty if unknown
    }
  deriving (GetKeywordEmojis -> GetKeywordEmojis -> Bool
(GetKeywordEmojis -> GetKeywordEmojis -> Bool)
-> (GetKeywordEmojis -> GetKeywordEmojis -> Bool)
-> Eq GetKeywordEmojis
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GetKeywordEmojis -> GetKeywordEmojis -> Bool
== :: GetKeywordEmojis -> GetKeywordEmojis -> Bool
$c/= :: GetKeywordEmojis -> GetKeywordEmojis -> Bool
/= :: GetKeywordEmojis -> GetKeywordEmojis -> Bool
Eq, Int -> GetKeywordEmojis -> ShowS
[GetKeywordEmojis] -> ShowS
GetKeywordEmojis -> String
(Int -> GetKeywordEmojis -> ShowS)
-> (GetKeywordEmojis -> String)
-> ([GetKeywordEmojis] -> ShowS)
-> Show GetKeywordEmojis
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GetKeywordEmojis -> ShowS
showsPrec :: Int -> GetKeywordEmojis -> ShowS
$cshow :: GetKeywordEmojis -> String
show :: GetKeywordEmojis -> String
$cshowList :: [GetKeywordEmojis] -> ShowS
showList :: [GetKeywordEmojis] -> ShowS
Show)

instance I.ShortShow GetKeywordEmojis where
  shortShow :: GetKeywordEmojis -> String
shortShow
    GetKeywordEmojis
      { text :: GetKeywordEmojis -> Maybe Text
text                 = Maybe Text
text_
      , input_language_codes :: GetKeywordEmojis -> Maybe [Text]
input_language_codes = Maybe [Text]
input_language_codes_
      }
        = String
"GetKeywordEmojis"
          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 GetKeywordEmojis where
  toJSON :: GetKeywordEmojis -> Value
toJSON
    GetKeywordEmojis
      { text :: GetKeywordEmojis -> Maybe Text
text                 = Maybe Text
text_
      , input_language_codes :: GetKeywordEmojis -> 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
"getKeywordEmojis"
          , 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_
          ]

defaultGetKeywordEmojis :: GetKeywordEmojis
defaultGetKeywordEmojis :: GetKeywordEmojis
defaultGetKeywordEmojis =
  GetKeywordEmojis
    { 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
    }