module TD.Query.ChangeStickerSet
(ChangeStickerSet(..)
, defaultChangeStickerSet
) where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as AT
import qualified TD.Lib.Internal as I
data ChangeStickerSet
= ChangeStickerSet
{ ChangeStickerSet -> Maybe Int
set_id :: Maybe Int
, ChangeStickerSet -> Maybe Bool
is_installed :: Maybe Bool
, ChangeStickerSet -> Maybe Bool
is_archived :: Maybe Bool
}
deriving (ChangeStickerSet -> ChangeStickerSet -> Bool
(ChangeStickerSet -> ChangeStickerSet -> Bool)
-> (ChangeStickerSet -> ChangeStickerSet -> Bool)
-> Eq ChangeStickerSet
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ChangeStickerSet -> ChangeStickerSet -> Bool
== :: ChangeStickerSet -> ChangeStickerSet -> Bool
$c/= :: ChangeStickerSet -> ChangeStickerSet -> Bool
/= :: ChangeStickerSet -> ChangeStickerSet -> Bool
Eq, Int -> ChangeStickerSet -> ShowS
[ChangeStickerSet] -> ShowS
ChangeStickerSet -> String
(Int -> ChangeStickerSet -> ShowS)
-> (ChangeStickerSet -> String)
-> ([ChangeStickerSet] -> ShowS)
-> Show ChangeStickerSet
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ChangeStickerSet -> ShowS
showsPrec :: Int -> ChangeStickerSet -> ShowS
$cshow :: ChangeStickerSet -> String
show :: ChangeStickerSet -> String
$cshowList :: [ChangeStickerSet] -> ShowS
showList :: [ChangeStickerSet] -> ShowS
Show)
instance I.ShortShow ChangeStickerSet where
shortShow :: ChangeStickerSet -> String
shortShow
ChangeStickerSet
{ set_id :: ChangeStickerSet -> Maybe Int
set_id = Maybe Int
set_id_
, is_installed :: ChangeStickerSet -> Maybe Bool
is_installed = Maybe Bool
is_installed_
, is_archived :: ChangeStickerSet -> Maybe Bool
is_archived = Maybe Bool
is_archived_
}
= String
"ChangeStickerSet"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"set_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
set_id_
, String
"is_installed" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
is_installed_
, String
"is_archived" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
is_archived_
]
instance AT.ToJSON ChangeStickerSet where
toJSON :: ChangeStickerSet -> Value
toJSON
ChangeStickerSet
{ set_id :: ChangeStickerSet -> Maybe Int
set_id = Maybe Int
set_id_
, is_installed :: ChangeStickerSet -> Maybe Bool
is_installed = Maybe Bool
is_installed_
, is_archived :: ChangeStickerSet -> Maybe Bool
is_archived = Maybe Bool
is_archived_
}
= [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
"changeStickerSet"
, Key
"set_id" Key -> Maybe Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= (Int -> Value) -> Maybe Int -> Maybe Value
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Int -> Value
I.writeInt64 Maybe Int
set_id_
, Key
"is_installed" Key -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Bool
is_installed_
, Key
"is_archived" Key -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Bool
is_archived_
]
defaultChangeStickerSet :: ChangeStickerSet
defaultChangeStickerSet :: ChangeStickerSet
defaultChangeStickerSet =
ChangeStickerSet
{ set_id :: Maybe Int
set_id = Maybe Int
forall a. Maybe a
Nothing
, is_installed :: Maybe Bool
is_installed = Maybe Bool
forall a. Maybe a
Nothing
, is_archived :: Maybe Bool
is_archived = Maybe Bool
forall a. Maybe a
Nothing
}