module TD.Query.GetStickers
(GetStickers(..)
, defaultGetStickers
) 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 GetStickers
= GetStickers
{ GetStickers -> Maybe StickerType
sticker_type :: Maybe StickerType.StickerType
, GetStickers -> Maybe Text
query :: Maybe T.Text
, GetStickers -> Maybe Int
limit :: Maybe Int
, GetStickers -> Maybe Int
chat_id :: Maybe Int
}
deriving (GetStickers -> GetStickers -> Bool
(GetStickers -> GetStickers -> Bool)
-> (GetStickers -> GetStickers -> Bool) -> Eq GetStickers
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GetStickers -> GetStickers -> Bool
== :: GetStickers -> GetStickers -> Bool
$c/= :: GetStickers -> GetStickers -> Bool
/= :: GetStickers -> GetStickers -> Bool
Eq, Int -> GetStickers -> ShowS
[GetStickers] -> ShowS
GetStickers -> String
(Int -> GetStickers -> ShowS)
-> (GetStickers -> String)
-> ([GetStickers] -> ShowS)
-> Show GetStickers
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GetStickers -> ShowS
showsPrec :: Int -> GetStickers -> ShowS
$cshow :: GetStickers -> String
show :: GetStickers -> String
$cshowList :: [GetStickers] -> ShowS
showList :: [GetStickers] -> ShowS
Show)
instance I.ShortShow GetStickers where
shortShow :: GetStickers -> String
shortShow
GetStickers
{ sticker_type :: GetStickers -> Maybe StickerType
sticker_type = Maybe StickerType
sticker_type_
, query :: GetStickers -> Maybe Text
query = Maybe Text
query_
, limit :: GetStickers -> Maybe Int
limit = Maybe Int
limit_
, chat_id :: GetStickers -> Maybe Int
chat_id = Maybe Int
chat_id_
}
= String
"GetStickers"
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
"limit" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
limit_
, String
"chat_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
chat_id_
]
instance AT.ToJSON GetStickers where
toJSON :: GetStickers -> Value
toJSON
GetStickers
{ sticker_type :: GetStickers -> Maybe StickerType
sticker_type = Maybe StickerType
sticker_type_
, query :: GetStickers -> Maybe Text
query = Maybe Text
query_
, limit :: GetStickers -> Maybe Int
limit = Maybe Int
limit_
, chat_id :: GetStickers -> Maybe Int
chat_id = Maybe Int
chat_id_
}
= [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
"getStickers"
, 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
"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_
, 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_
]
defaultGetStickers :: GetStickers
defaultGetStickers :: GetStickers
defaultGetStickers =
GetStickers
{ sticker_type :: Maybe StickerType
sticker_type = Maybe StickerType
forall a. Maybe a
Nothing
, query :: Maybe Text
query = Maybe Text
forall a. Maybe a
Nothing
, limit :: Maybe Int
limit = Maybe Int
forall a. Maybe a
Nothing
, chat_id :: Maybe Int
chat_id = Maybe Int
forall a. Maybe a
Nothing
}