module TD.Query.AddChatFolderByInviteLink
(AddChatFolderByInviteLink(..)
, defaultAddChatFolderByInviteLink
) 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
data AddChatFolderByInviteLink
= AddChatFolderByInviteLink
{ AddChatFolderByInviteLink -> Maybe Text
invite_link :: Maybe T.Text
, AddChatFolderByInviteLink -> Maybe [Int]
chat_ids :: Maybe [Int]
}
deriving (AddChatFolderByInviteLink -> AddChatFolderByInviteLink -> Bool
(AddChatFolderByInviteLink -> AddChatFolderByInviteLink -> Bool)
-> (AddChatFolderByInviteLink -> AddChatFolderByInviteLink -> Bool)
-> Eq AddChatFolderByInviteLink
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AddChatFolderByInviteLink -> AddChatFolderByInviteLink -> Bool
== :: AddChatFolderByInviteLink -> AddChatFolderByInviteLink -> Bool
$c/= :: AddChatFolderByInviteLink -> AddChatFolderByInviteLink -> Bool
/= :: AddChatFolderByInviteLink -> AddChatFolderByInviteLink -> Bool
Eq, Int -> AddChatFolderByInviteLink -> ShowS
[AddChatFolderByInviteLink] -> ShowS
AddChatFolderByInviteLink -> String
(Int -> AddChatFolderByInviteLink -> ShowS)
-> (AddChatFolderByInviteLink -> String)
-> ([AddChatFolderByInviteLink] -> ShowS)
-> Show AddChatFolderByInviteLink
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> AddChatFolderByInviteLink -> ShowS
showsPrec :: Int -> AddChatFolderByInviteLink -> ShowS
$cshow :: AddChatFolderByInviteLink -> String
show :: AddChatFolderByInviteLink -> String
$cshowList :: [AddChatFolderByInviteLink] -> ShowS
showList :: [AddChatFolderByInviteLink] -> ShowS
Show)
instance I.ShortShow AddChatFolderByInviteLink where
shortShow :: AddChatFolderByInviteLink -> String
shortShow
AddChatFolderByInviteLink
{ invite_link :: AddChatFolderByInviteLink -> Maybe Text
invite_link = Maybe Text
invite_link_
, chat_ids :: AddChatFolderByInviteLink -> Maybe [Int]
chat_ids = Maybe [Int]
chat_ids_
}
= String
"AddChatFolderByInviteLink"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"invite_link" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
invite_link_
, String
"chat_ids" String -> Maybe [Int] -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe [Int]
chat_ids_
]
instance AT.ToJSON AddChatFolderByInviteLink where
toJSON :: AddChatFolderByInviteLink -> Value
toJSON
AddChatFolderByInviteLink
{ invite_link :: AddChatFolderByInviteLink -> Maybe Text
invite_link = Maybe Text
invite_link_
, chat_ids :: AddChatFolderByInviteLink -> Maybe [Int]
chat_ids = Maybe [Int]
chat_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
"addChatFolderByInviteLink"
, Key
"invite_link" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
invite_link_
, Key
"chat_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]
chat_ids_
]
defaultAddChatFolderByInviteLink :: AddChatFolderByInviteLink
defaultAddChatFolderByInviteLink :: AddChatFolderByInviteLink
defaultAddChatFolderByInviteLink =
AddChatFolderByInviteLink
{ invite_link :: Maybe Text
invite_link = Maybe Text
forall a. Maybe a
Nothing
, chat_ids :: Maybe [Int]
chat_ids = Maybe [Int]
forall a. Maybe a
Nothing
}