module TD.Query.GetChatInviteLink
(GetChatInviteLink(..)
, defaultGetChatInviteLink
) 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 GetChatInviteLink
= GetChatInviteLink
{ GetChatInviteLink -> Maybe Int
chat_id :: Maybe Int
, GetChatInviteLink -> Maybe Text
invite_link :: Maybe T.Text
}
deriving (GetChatInviteLink -> GetChatInviteLink -> Bool
(GetChatInviteLink -> GetChatInviteLink -> Bool)
-> (GetChatInviteLink -> GetChatInviteLink -> Bool)
-> Eq GetChatInviteLink
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GetChatInviteLink -> GetChatInviteLink -> Bool
== :: GetChatInviteLink -> GetChatInviteLink -> Bool
$c/= :: GetChatInviteLink -> GetChatInviteLink -> Bool
/= :: GetChatInviteLink -> GetChatInviteLink -> Bool
Eq, Int -> GetChatInviteLink -> ShowS
[GetChatInviteLink] -> ShowS
GetChatInviteLink -> String
(Int -> GetChatInviteLink -> ShowS)
-> (GetChatInviteLink -> String)
-> ([GetChatInviteLink] -> ShowS)
-> Show GetChatInviteLink
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GetChatInviteLink -> ShowS
showsPrec :: Int -> GetChatInviteLink -> ShowS
$cshow :: GetChatInviteLink -> String
show :: GetChatInviteLink -> String
$cshowList :: [GetChatInviteLink] -> ShowS
showList :: [GetChatInviteLink] -> ShowS
Show)
instance I.ShortShow GetChatInviteLink where
shortShow :: GetChatInviteLink -> String
shortShow
GetChatInviteLink
{ chat_id :: GetChatInviteLink -> Maybe Int
chat_id = Maybe Int
chat_id_
, invite_link :: GetChatInviteLink -> Maybe Text
invite_link = Maybe Text
invite_link_
}
= String
"GetChatInviteLink"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"chat_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
chat_id_
, String
"invite_link" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
invite_link_
]
instance AT.ToJSON GetChatInviteLink where
toJSON :: GetChatInviteLink -> Value
toJSON
GetChatInviteLink
{ chat_id :: GetChatInviteLink -> Maybe Int
chat_id = Maybe Int
chat_id_
, invite_link :: GetChatInviteLink -> Maybe Text
invite_link = Maybe Text
invite_link_
}
= [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
"getChatInviteLink"
, Key
"chat_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
chat_id_
, 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_
]
defaultGetChatInviteLink :: GetChatInviteLink
defaultGetChatInviteLink :: GetChatInviteLink
defaultGetChatInviteLink =
GetChatInviteLink
{ chat_id :: Maybe Int
chat_id = Maybe Int
forall a. Maybe a
Nothing
, invite_link :: Maybe Text
invite_link = Maybe Text
forall a. Maybe a
Nothing
}