module TD.Query.EditChatSubscriptionInviteLink
(EditChatSubscriptionInviteLink(..)
, defaultEditChatSubscriptionInviteLink
) 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 EditChatSubscriptionInviteLink
= EditChatSubscriptionInviteLink
{ EditChatSubscriptionInviteLink -> Maybe Int
chat_id :: Maybe Int
, EditChatSubscriptionInviteLink -> Maybe Text
invite_link :: Maybe T.Text
, EditChatSubscriptionInviteLink -> Maybe Text
name :: Maybe T.Text
}
deriving (EditChatSubscriptionInviteLink
-> EditChatSubscriptionInviteLink -> Bool
(EditChatSubscriptionInviteLink
-> EditChatSubscriptionInviteLink -> Bool)
-> (EditChatSubscriptionInviteLink
-> EditChatSubscriptionInviteLink -> Bool)
-> Eq EditChatSubscriptionInviteLink
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: EditChatSubscriptionInviteLink
-> EditChatSubscriptionInviteLink -> Bool
== :: EditChatSubscriptionInviteLink
-> EditChatSubscriptionInviteLink -> Bool
$c/= :: EditChatSubscriptionInviteLink
-> EditChatSubscriptionInviteLink -> Bool
/= :: EditChatSubscriptionInviteLink
-> EditChatSubscriptionInviteLink -> Bool
Eq, Int -> EditChatSubscriptionInviteLink -> ShowS
[EditChatSubscriptionInviteLink] -> ShowS
EditChatSubscriptionInviteLink -> String
(Int -> EditChatSubscriptionInviteLink -> ShowS)
-> (EditChatSubscriptionInviteLink -> String)
-> ([EditChatSubscriptionInviteLink] -> ShowS)
-> Show EditChatSubscriptionInviteLink
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> EditChatSubscriptionInviteLink -> ShowS
showsPrec :: Int -> EditChatSubscriptionInviteLink -> ShowS
$cshow :: EditChatSubscriptionInviteLink -> String
show :: EditChatSubscriptionInviteLink -> String
$cshowList :: [EditChatSubscriptionInviteLink] -> ShowS
showList :: [EditChatSubscriptionInviteLink] -> ShowS
Show)
instance I.ShortShow EditChatSubscriptionInviteLink where
shortShow :: EditChatSubscriptionInviteLink -> String
shortShow
EditChatSubscriptionInviteLink
{ chat_id :: EditChatSubscriptionInviteLink -> Maybe Int
chat_id = Maybe Int
chat_id_
, invite_link :: EditChatSubscriptionInviteLink -> Maybe Text
invite_link = Maybe Text
invite_link_
, name :: EditChatSubscriptionInviteLink -> Maybe Text
name = Maybe Text
name_
}
= String
"EditChatSubscriptionInviteLink"
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_
]
instance AT.ToJSON EditChatSubscriptionInviteLink where
toJSON :: EditChatSubscriptionInviteLink -> Value
toJSON
EditChatSubscriptionInviteLink
{ chat_id :: EditChatSubscriptionInviteLink -> Maybe Int
chat_id = Maybe Int
chat_id_
, invite_link :: EditChatSubscriptionInviteLink -> Maybe Text
invite_link = Maybe Text
invite_link_
, name :: EditChatSubscriptionInviteLink -> Maybe Text
name = Maybe Text
name_
}
= [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
"editChatSubscriptionInviteLink"
, 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_
]
defaultEditChatSubscriptionInviteLink :: EditChatSubscriptionInviteLink
defaultEditChatSubscriptionInviteLink :: EditChatSubscriptionInviteLink
defaultEditChatSubscriptionInviteLink =
EditChatSubscriptionInviteLink
{ 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
}