module TD.Query.AddStickerToSet
(AddStickerToSet(..)
, defaultAddStickerToSet
) 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
import qualified TD.Data.InputSticker as InputSticker
data AddStickerToSet
= AddStickerToSet
{ AddStickerToSet -> Maybe Int
user_id :: Maybe Int
, AddStickerToSet -> Maybe Text
name :: Maybe T.Text
, AddStickerToSet -> Maybe InputSticker
sticker :: Maybe InputSticker.InputSticker
}
deriving (AddStickerToSet -> AddStickerToSet -> Bool
(AddStickerToSet -> AddStickerToSet -> Bool)
-> (AddStickerToSet -> AddStickerToSet -> Bool)
-> Eq AddStickerToSet
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AddStickerToSet -> AddStickerToSet -> Bool
== :: AddStickerToSet -> AddStickerToSet -> Bool
$c/= :: AddStickerToSet -> AddStickerToSet -> Bool
/= :: AddStickerToSet -> AddStickerToSet -> Bool
Eq, Int -> AddStickerToSet -> ShowS
[AddStickerToSet] -> ShowS
AddStickerToSet -> String
(Int -> AddStickerToSet -> ShowS)
-> (AddStickerToSet -> String)
-> ([AddStickerToSet] -> ShowS)
-> Show AddStickerToSet
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> AddStickerToSet -> ShowS
showsPrec :: Int -> AddStickerToSet -> ShowS
$cshow :: AddStickerToSet -> String
show :: AddStickerToSet -> String
$cshowList :: [AddStickerToSet] -> ShowS
showList :: [AddStickerToSet] -> ShowS
Show)
instance I.ShortShow AddStickerToSet where
shortShow :: AddStickerToSet -> String
shortShow
AddStickerToSet
{ user_id :: AddStickerToSet -> Maybe Int
user_id = Maybe Int
user_id_
, name :: AddStickerToSet -> Maybe Text
name = Maybe Text
name_
, sticker :: AddStickerToSet -> Maybe InputSticker
sticker = Maybe InputSticker
sticker_
}
= String
"AddStickerToSet"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"user_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
user_id_
, String
"name" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
name_
, String
"sticker" String -> Maybe InputSticker -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe InputSticker
sticker_
]
instance AT.ToJSON AddStickerToSet where
toJSON :: AddStickerToSet -> Value
toJSON
AddStickerToSet
{ user_id :: AddStickerToSet -> Maybe Int
user_id = Maybe Int
user_id_
, name :: AddStickerToSet -> Maybe Text
name = Maybe Text
name_
, sticker :: AddStickerToSet -> Maybe InputSticker
sticker = Maybe InputSticker
sticker_
}
= [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
"addStickerToSet"
, Key
"user_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
user_id_
, Key
"name" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
name_
, Key
"sticker" Key -> Maybe InputSticker -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe InputSticker
sticker_
]
defaultAddStickerToSet :: AddStickerToSet
defaultAddStickerToSet :: AddStickerToSet
defaultAddStickerToSet =
AddStickerToSet
{ user_id :: Maybe Int
user_id = Maybe Int
forall a. Maybe a
Nothing
, name :: Maybe Text
name = Maybe Text
forall a. Maybe a
Nothing
, sticker :: Maybe InputSticker
sticker = Maybe InputSticker
forall a. Maybe a
Nothing
}