module TD.Query.GetChatInviteLinks
(GetChatInviteLinks(..)
, defaultGetChatInviteLinks
) 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 GetChatInviteLinks
= GetChatInviteLinks
{ GetChatInviteLinks -> Maybe Int
chat_id :: Maybe Int
, GetChatInviteLinks -> Maybe Int
creator_user_id :: Maybe Int
, GetChatInviteLinks -> Maybe Bool
is_revoked :: Maybe Bool
, GetChatInviteLinks -> Maybe Int
offset_date :: Maybe Int
, GetChatInviteLinks -> Maybe Text
offset_invite_link :: Maybe T.Text
, GetChatInviteLinks -> Maybe Int
limit :: Maybe Int
}
deriving (GetChatInviteLinks -> GetChatInviteLinks -> Bool
(GetChatInviteLinks -> GetChatInviteLinks -> Bool)
-> (GetChatInviteLinks -> GetChatInviteLinks -> Bool)
-> Eq GetChatInviteLinks
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GetChatInviteLinks -> GetChatInviteLinks -> Bool
== :: GetChatInviteLinks -> GetChatInviteLinks -> Bool
$c/= :: GetChatInviteLinks -> GetChatInviteLinks -> Bool
/= :: GetChatInviteLinks -> GetChatInviteLinks -> Bool
Eq, Int -> GetChatInviteLinks -> ShowS
[GetChatInviteLinks] -> ShowS
GetChatInviteLinks -> String
(Int -> GetChatInviteLinks -> ShowS)
-> (GetChatInviteLinks -> String)
-> ([GetChatInviteLinks] -> ShowS)
-> Show GetChatInviteLinks
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GetChatInviteLinks -> ShowS
showsPrec :: Int -> GetChatInviteLinks -> ShowS
$cshow :: GetChatInviteLinks -> String
show :: GetChatInviteLinks -> String
$cshowList :: [GetChatInviteLinks] -> ShowS
showList :: [GetChatInviteLinks] -> ShowS
Show)
instance I.ShortShow GetChatInviteLinks where
shortShow :: GetChatInviteLinks -> String
shortShow
GetChatInviteLinks
{ chat_id :: GetChatInviteLinks -> Maybe Int
chat_id = Maybe Int
chat_id_
, creator_user_id :: GetChatInviteLinks -> Maybe Int
creator_user_id = Maybe Int
creator_user_id_
, is_revoked :: GetChatInviteLinks -> Maybe Bool
is_revoked = Maybe Bool
is_revoked_
, offset_date :: GetChatInviteLinks -> Maybe Int
offset_date = Maybe Int
offset_date_
, offset_invite_link :: GetChatInviteLinks -> Maybe Text
offset_invite_link = Maybe Text
offset_invite_link_
, limit :: GetChatInviteLinks -> Maybe Int
limit = Maybe Int
limit_
}
= String
"GetChatInviteLinks"
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
"creator_user_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
creator_user_id_
, String
"is_revoked" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
is_revoked_
, String
"offset_date" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
offset_date_
, String
"offset_invite_link" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
offset_invite_link_
, String
"limit" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
limit_
]
instance AT.ToJSON GetChatInviteLinks where
toJSON :: GetChatInviteLinks -> Value
toJSON
GetChatInviteLinks
{ chat_id :: GetChatInviteLinks -> Maybe Int
chat_id = Maybe Int
chat_id_
, creator_user_id :: GetChatInviteLinks -> Maybe Int
creator_user_id = Maybe Int
creator_user_id_
, is_revoked :: GetChatInviteLinks -> Maybe Bool
is_revoked = Maybe Bool
is_revoked_
, offset_date :: GetChatInviteLinks -> Maybe Int
offset_date = Maybe Int
offset_date_
, offset_invite_link :: GetChatInviteLinks -> Maybe Text
offset_invite_link = Maybe Text
offset_invite_link_
, limit :: GetChatInviteLinks -> Maybe Int
limit = Maybe Int
limit_
}
= [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
"getChatInviteLinks"
, 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
"creator_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
creator_user_id_
, Key
"is_revoked" 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_revoked_
, Key
"offset_date" Key -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Int
offset_date_
, Key
"offset_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
offset_invite_link_
, Key
"limit" Key -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Int
limit_
]
defaultGetChatInviteLinks :: GetChatInviteLinks
defaultGetChatInviteLinks :: GetChatInviteLinks
defaultGetChatInviteLinks =
GetChatInviteLinks
{ chat_id :: Maybe Int
chat_id = Maybe Int
forall a. Maybe a
Nothing
, creator_user_id :: Maybe Int
creator_user_id = Maybe Int
forall a. Maybe a
Nothing
, is_revoked :: Maybe Bool
is_revoked = Maybe Bool
forall a. Maybe a
Nothing
, offset_date :: Maybe Int
offset_date = Maybe Int
forall a. Maybe a
Nothing
, offset_invite_link :: Maybe Text
offset_invite_link = Maybe Text
forall a. Maybe a
Nothing
, limit :: Maybe Int
limit = Maybe Int
forall a. Maybe a
Nothing
}