module TD.Query.SetCloseFriends
(SetCloseFriends(..)
) where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as AT
import qualified TD.Lib.Internal as I
data SetCloseFriends
= SetCloseFriends
{ SetCloseFriends -> Maybe [Int]
user_ids :: Maybe [Int]
}
deriving (SetCloseFriends -> SetCloseFriends -> Bool
(SetCloseFriends -> SetCloseFriends -> Bool)
-> (SetCloseFriends -> SetCloseFriends -> Bool)
-> Eq SetCloseFriends
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SetCloseFriends -> SetCloseFriends -> Bool
== :: SetCloseFriends -> SetCloseFriends -> Bool
$c/= :: SetCloseFriends -> SetCloseFriends -> Bool
/= :: SetCloseFriends -> SetCloseFriends -> Bool
Eq, Int -> SetCloseFriends -> ShowS
[SetCloseFriends] -> ShowS
SetCloseFriends -> String
(Int -> SetCloseFriends -> ShowS)
-> (SetCloseFriends -> String)
-> ([SetCloseFriends] -> ShowS)
-> Show SetCloseFriends
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SetCloseFriends -> ShowS
showsPrec :: Int -> SetCloseFriends -> ShowS
$cshow :: SetCloseFriends -> String
show :: SetCloseFriends -> String
$cshowList :: [SetCloseFriends] -> ShowS
showList :: [SetCloseFriends] -> ShowS
Show)
instance I.ShortShow SetCloseFriends where
shortShow :: SetCloseFriends -> String
shortShow
SetCloseFriends
{ user_ids :: SetCloseFriends -> Maybe [Int]
user_ids = Maybe [Int]
user_ids_
}
= String
"SetCloseFriends"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"user_ids" String -> Maybe [Int] -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe [Int]
user_ids_
]
instance AT.ToJSON SetCloseFriends where
toJSON :: SetCloseFriends -> Value
toJSON
SetCloseFriends
{ user_ids :: SetCloseFriends -> Maybe [Int]
user_ids = Maybe [Int]
user_ids_
}
= [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
"setCloseFriends"
, Key
"user_ids" 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_ids_
]