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