module TD.Query.GetEmojiCategories
  (GetEmojiCategories(..)
  ) 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.EmojiCategoryType as EmojiCategoryType

-- | Returns available emoji categories. Returns 'TD.Data.EmojiCategories.EmojiCategories'
data GetEmojiCategories
  = GetEmojiCategories
    { GetEmojiCategories -> Maybe EmojiCategoryType
_type :: Maybe EmojiCategoryType.EmojiCategoryType -- ^ Type of emoji categories to return; pass null to get default emoji categories
    }
  deriving (GetEmojiCategories -> GetEmojiCategories -> Bool
(GetEmojiCategories -> GetEmojiCategories -> Bool)
-> (GetEmojiCategories -> GetEmojiCategories -> Bool)
-> Eq GetEmojiCategories
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GetEmojiCategories -> GetEmojiCategories -> Bool
== :: GetEmojiCategories -> GetEmojiCategories -> Bool
$c/= :: GetEmojiCategories -> GetEmojiCategories -> Bool
/= :: GetEmojiCategories -> GetEmojiCategories -> Bool
Eq, Int -> GetEmojiCategories -> ShowS
[GetEmojiCategories] -> ShowS
GetEmojiCategories -> String
(Int -> GetEmojiCategories -> ShowS)
-> (GetEmojiCategories -> String)
-> ([GetEmojiCategories] -> ShowS)
-> Show GetEmojiCategories
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GetEmojiCategories -> ShowS
showsPrec :: Int -> GetEmojiCategories -> ShowS
$cshow :: GetEmojiCategories -> String
show :: GetEmojiCategories -> String
$cshowList :: [GetEmojiCategories] -> ShowS
showList :: [GetEmojiCategories] -> ShowS
Show)

instance I.ShortShow GetEmojiCategories where
  shortShow :: GetEmojiCategories -> String
shortShow
    GetEmojiCategories
      { _type :: GetEmojiCategories -> Maybe EmojiCategoryType
_type = Maybe EmojiCategoryType
_type_
      }
        = String
"GetEmojiCategories"
          String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
          [ String
"_type" String -> Maybe EmojiCategoryType -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe EmojiCategoryType
_type_
          ]

instance AT.ToJSON GetEmojiCategories where
  toJSON :: GetEmojiCategories -> Value
toJSON
    GetEmojiCategories
      { _type :: GetEmojiCategories -> Maybe EmojiCategoryType
_type = Maybe EmojiCategoryType
_type_
      }
        = [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
"getEmojiCategories"
          , Key
"type"  Key -> Maybe EmojiCategoryType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe EmojiCategoryType
_type_
          ]