module TD.Query.EditChatInviteLink
(EditChatInviteLink(..)
, defaultEditChatInviteLink
) 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 EditChatInviteLink
= EditChatInviteLink
{ EditChatInviteLink -> Maybe Int
chat_id :: Maybe Int
, EditChatInviteLink -> Maybe Text
invite_link :: Maybe T.Text
, EditChatInviteLink -> Maybe Text
name :: Maybe T.Text
, EditChatInviteLink -> Maybe Int
expiration_date :: Maybe Int
, EditChatInviteLink -> Maybe Int
member_limit :: Maybe Int
, EditChatInviteLink -> Maybe Bool
creates_join_request :: Maybe Bool
}
deriving (EditChatInviteLink -> EditChatInviteLink -> Bool
(EditChatInviteLink -> EditChatInviteLink -> Bool)
-> (EditChatInviteLink -> EditChatInviteLink -> Bool)
-> Eq EditChatInviteLink
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: EditChatInviteLink -> EditChatInviteLink -> Bool
== :: EditChatInviteLink -> EditChatInviteLink -> Bool
$c/= :: EditChatInviteLink -> EditChatInviteLink -> Bool
/= :: EditChatInviteLink -> EditChatInviteLink -> Bool
Eq, Int -> EditChatInviteLink -> ShowS
[EditChatInviteLink] -> ShowS
EditChatInviteLink -> String
(Int -> EditChatInviteLink -> ShowS)
-> (EditChatInviteLink -> String)
-> ([EditChatInviteLink] -> ShowS)
-> Show EditChatInviteLink
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> EditChatInviteLink -> ShowS
showsPrec :: Int -> EditChatInviteLink -> ShowS
$cshow :: EditChatInviteLink -> String
show :: EditChatInviteLink -> String
$cshowList :: [EditChatInviteLink] -> ShowS
showList :: [EditChatInviteLink] -> ShowS
Show)
instance I.ShortShow EditChatInviteLink where
shortShow :: EditChatInviteLink -> String
shortShow
EditChatInviteLink
{ chat_id :: EditChatInviteLink -> Maybe Int
chat_id = Maybe Int
chat_id_
, invite_link :: EditChatInviteLink -> Maybe Text
invite_link = Maybe Text
invite_link_
, name :: EditChatInviteLink -> Maybe Text
name = Maybe Text
name_
, expiration_date :: EditChatInviteLink -> Maybe Int
expiration_date = Maybe Int
expiration_date_
, member_limit :: EditChatInviteLink -> Maybe Int
member_limit = Maybe Int
member_limit_
, creates_join_request :: EditChatInviteLink -> Maybe Bool
creates_join_request = Maybe Bool
creates_join_request_
}
= String
"EditChatInviteLink"
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_
, String
"name" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
name_
, String
"expiration_date" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
expiration_date_
, String
"member_limit" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
member_limit_
, String
"creates_join_request" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
creates_join_request_
]
instance AT.ToJSON EditChatInviteLink where
toJSON :: EditChatInviteLink -> Value
toJSON
EditChatInviteLink
{ chat_id :: EditChatInviteLink -> Maybe Int
chat_id = Maybe Int
chat_id_
, invite_link :: EditChatInviteLink -> Maybe Text
invite_link = Maybe Text
invite_link_
, name :: EditChatInviteLink -> Maybe Text
name = Maybe Text
name_
, expiration_date :: EditChatInviteLink -> Maybe Int
expiration_date = Maybe Int
expiration_date_
, member_limit :: EditChatInviteLink -> Maybe Int
member_limit = Maybe Int
member_limit_
, creates_join_request :: EditChatInviteLink -> Maybe Bool
creates_join_request = Maybe Bool
creates_join_request_
}
= [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
"editChatInviteLink"
, 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_
, Key
"name" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
name_
, Key
"expiration_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
expiration_date_
, Key
"member_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
member_limit_
, Key
"creates_join_request" Key -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Bool
creates_join_request_
]
defaultEditChatInviteLink :: EditChatInviteLink
defaultEditChatInviteLink :: EditChatInviteLink
defaultEditChatInviteLink =
EditChatInviteLink
{ 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
, name :: Maybe Text
name = Maybe Text
forall a. Maybe a
Nothing
, expiration_date :: Maybe Int
expiration_date = Maybe Int
forall a. Maybe a
Nothing
, member_limit :: Maybe Int
member_limit = Maybe Int
forall a. Maybe a
Nothing
, creates_join_request :: Maybe Bool
creates_join_request = Maybe Bool
forall a. Maybe a
Nothing
}