module TD.Query.GetAllStickerEmojis
  (GetAllStickerEmojis(..)
  , defaultGetAllStickerEmojis
  ) 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

-- | Returns unique emoji that correspond to stickers to be found by the getStickers(sticker_type, query, 1000000, chat_id). Returns 'TD.Data.Emojis.Emojis'
data GetAllStickerEmojis
  = GetAllStickerEmojis
    { GetAllStickerEmojis -> Maybe StickerType
sticker_type           :: Maybe StickerType.StickerType -- ^ Type of the stickers to search for
    , GetAllStickerEmojis -> Maybe Text
query                  :: Maybe T.Text                  -- ^ Search query
    , GetAllStickerEmojis -> Maybe Int
chat_id                :: Maybe Int                     -- ^ Chat identifier for which to find stickers
    , GetAllStickerEmojis -> Maybe Bool
return_only_main_emoji :: Maybe Bool                    -- ^ Pass true if only main emoji for each found sticker must be included in the result
    }
  deriving (GetAllStickerEmojis -> GetAllStickerEmojis -> Bool
(GetAllStickerEmojis -> GetAllStickerEmojis -> Bool)
-> (GetAllStickerEmojis -> GetAllStickerEmojis -> Bool)
-> Eq GetAllStickerEmojis
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GetAllStickerEmojis -> GetAllStickerEmojis -> Bool
== :: GetAllStickerEmojis -> GetAllStickerEmojis -> Bool
$c/= :: GetAllStickerEmojis -> GetAllStickerEmojis -> Bool
/= :: GetAllStickerEmojis -> GetAllStickerEmojis -> Bool
Eq, Int -> GetAllStickerEmojis -> ShowS
[GetAllStickerEmojis] -> ShowS
GetAllStickerEmojis -> String
(Int -> GetAllStickerEmojis -> ShowS)
-> (GetAllStickerEmojis -> String)
-> ([GetAllStickerEmojis] -> ShowS)
-> Show GetAllStickerEmojis
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GetAllStickerEmojis -> ShowS
showsPrec :: Int -> GetAllStickerEmojis -> ShowS
$cshow :: GetAllStickerEmojis -> String
show :: GetAllStickerEmojis -> String
$cshowList :: [GetAllStickerEmojis] -> ShowS
showList :: [GetAllStickerEmojis] -> ShowS
Show)

instance I.ShortShow GetAllStickerEmojis where
  shortShow :: GetAllStickerEmojis -> String
shortShow
    GetAllStickerEmojis
      { sticker_type :: GetAllStickerEmojis -> Maybe StickerType
sticker_type           = Maybe StickerType
sticker_type_
      , query :: GetAllStickerEmojis -> Maybe Text
query                  = Maybe Text
query_
      , chat_id :: GetAllStickerEmojis -> Maybe Int
chat_id                = Maybe Int
chat_id_
      , return_only_main_emoji :: GetAllStickerEmojis -> Maybe Bool
return_only_main_emoji = Maybe Bool
return_only_main_emoji_
      }
        = String
"GetAllStickerEmojis"
          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
"query"                  String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
query_
          , String
"chat_id"                String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
chat_id_
          , String
"return_only_main_emoji" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
return_only_main_emoji_
          ]

instance AT.ToJSON GetAllStickerEmojis where
  toJSON :: GetAllStickerEmojis -> Value
toJSON
    GetAllStickerEmojis
      { sticker_type :: GetAllStickerEmojis -> Maybe StickerType
sticker_type           = Maybe StickerType
sticker_type_
      , query :: GetAllStickerEmojis -> Maybe Text
query                  = Maybe Text
query_
      , chat_id :: GetAllStickerEmojis -> Maybe Int
chat_id                = Maybe Int
chat_id_
      , return_only_main_emoji :: GetAllStickerEmojis -> Maybe Bool
return_only_main_emoji = Maybe Bool
return_only_main_emoji_
      }
        = [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
"getAllStickerEmojis"
          , 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
"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
"chat_id"                Key -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Int
chat_id_
          , Key
"return_only_main_emoji" Key -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Bool
return_only_main_emoji_
          ]

defaultGetAllStickerEmojis :: GetAllStickerEmojis
defaultGetAllStickerEmojis :: GetAllStickerEmojis
defaultGetAllStickerEmojis =
  GetAllStickerEmojis
    { sticker_type :: Maybe StickerType
sticker_type           = Maybe StickerType
forall a. Maybe a
Nothing
    , query :: Maybe Text
query                  = Maybe Text
forall a. Maybe a
Nothing
    , chat_id :: Maybe Int
chat_id                = Maybe Int
forall a. Maybe a
Nothing
    , return_only_main_emoji :: Maybe Bool
return_only_main_emoji = Maybe Bool
forall a. Maybe a
Nothing
    }