module TD.Data.InternalLinkType
(InternalLinkType(..)) where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as AT
import qualified TD.Lib.Internal as I
import {-# SOURCE #-} qualified TD.Data.TargetChat as TargetChat
import qualified Data.Text as T
import qualified TD.Data.ChatAdministratorRights as ChatAdministratorRights
import qualified TD.Data.WebAppOpenMode as WebAppOpenMode
import qualified TD.Data.FormattedText as FormattedText
import qualified TD.Data.ProxyType as ProxyType
data InternalLinkType
= InternalLinkTypeActiveSessions
|
{ InternalLinkType -> Maybe TargetChat
target_chat :: Maybe TargetChat.TargetChat
, InternalLinkType -> Maybe Text
bot_username :: Maybe T.Text
, InternalLinkType -> Maybe Text
url :: Maybe T.Text
}
| InternalLinkTypeAuthenticationCode
{ InternalLinkType -> Maybe Text
code :: Maybe T.Text
}
| InternalLinkTypeBackground
{ InternalLinkType -> Maybe Text
background_name :: Maybe T.Text
}
| InternalLinkTypeBotAddToChannel
{ bot_username :: Maybe T.Text
, InternalLinkType -> Maybe ChatAdministratorRights
administrator_rights :: Maybe ChatAdministratorRights.ChatAdministratorRights
}
| InternalLinkTypeBotStart
{ bot_username :: Maybe T.Text
, InternalLinkType -> Maybe Text
start_parameter :: Maybe T.Text
, InternalLinkType -> Maybe Bool
autostart :: Maybe Bool
}
| InternalLinkTypeBotStartInGroup
{ bot_username :: Maybe T.Text
, start_parameter :: Maybe T.Text
, administrator_rights :: Maybe ChatAdministratorRights.ChatAdministratorRights
}
| InternalLinkTypeBusinessChat
{ InternalLinkType -> Maybe Text
link_name :: Maybe T.Text
}
| InternalLinkTypeBuyStars
{ InternalLinkType -> Maybe Int
star_count :: Maybe Int
, InternalLinkType -> Maybe Text
purpose :: Maybe T.Text
}
| InternalLinkTypeChangePhoneNumber
| InternalLinkTypeChatAffiliateProgram
{ InternalLinkType -> Maybe Text
username :: Maybe T.Text
, InternalLinkType -> Maybe Text
referrer :: Maybe T.Text
}
| InternalLinkTypeChatBoost
{ url :: Maybe T.Text
}
| InternalLinkTypeChatFolderInvite
{ InternalLinkType -> Maybe Text
invite_link :: Maybe T.Text
}
| InternalLinkTypeChatFolderSettings
| InternalLinkTypeChatInvite
{ invite_link :: Maybe T.Text
}
| InternalLinkTypeDefaultMessageAutoDeleteTimerSettings
| InternalLinkTypeEditProfileSettings
| InternalLinkTypeGame
{ bot_username :: Maybe T.Text
, InternalLinkType -> Maybe Text
game_short_name :: Maybe T.Text
}
| InternalLinkTypeInstantView
{ url :: Maybe T.Text
, InternalLinkType -> Maybe Text
fallback_url :: Maybe T.Text
}
| InternalLinkTypeInvoice
{ InternalLinkType -> Maybe Text
invoice_name :: Maybe T.Text
}
| InternalLinkTypeLanguagePack
{ InternalLinkType -> Maybe Text
language_pack_id :: Maybe T.Text
}
| InternalLinkTypeLanguageSettings
| InternalLinkTypeMainWebApp
{ bot_username :: Maybe T.Text
, start_parameter :: Maybe T.Text
, InternalLinkType -> Maybe WebAppOpenMode
mode :: Maybe WebAppOpenMode.WebAppOpenMode
}
| InternalLinkTypeMessage
{ url :: Maybe T.Text
}
| InternalLinkTypeMessageDraft
{ InternalLinkType -> Maybe FormattedText
text :: Maybe FormattedText.FormattedText
, InternalLinkType -> Maybe Bool
contains_link :: Maybe Bool
}
| InternalLinkTypePassportDataRequest
{ InternalLinkType -> Maybe Int
bot_user_id :: Maybe Int
, InternalLinkType -> Maybe Text
scope :: Maybe T.Text
, InternalLinkType -> Maybe Text
public_key :: Maybe T.Text
, InternalLinkType -> Maybe Text
nonce :: Maybe T.Text
, InternalLinkType -> Maybe Text
callback_url :: Maybe T.Text
}
| InternalLinkTypePhoneNumberConfirmation
{ InternalLinkType -> Maybe Text
hash :: Maybe T.Text
, InternalLinkType -> Maybe Text
phone_number :: Maybe T.Text
}
| InternalLinkTypePremiumFeatures
{ referrer :: Maybe T.Text
}
| InternalLinkTypePremiumGift
{ referrer :: Maybe T.Text
}
| InternalLinkTypePremiumGiftCode
{ code :: Maybe T.Text
}
| InternalLinkTypePrivacyAndSecuritySettings
| InternalLinkTypeProxy
{ InternalLinkType -> Maybe Text
server :: Maybe T.Text
, InternalLinkType -> Maybe Int
port :: Maybe Int
, InternalLinkType -> Maybe ProxyType
_type :: Maybe ProxyType.ProxyType
}
| InternalLinkTypePublicChat
{ InternalLinkType -> Maybe Text
chat_username :: Maybe T.Text
, InternalLinkType -> Maybe Text
draft_text :: Maybe T.Text
, InternalLinkType -> Maybe Bool
open_profile :: Maybe Bool
}
| InternalLinkTypeQrCodeAuthentication
| InternalLinkTypeRestorePurchases
| InternalLinkTypeSettings
| InternalLinkTypeStickerSet
{ InternalLinkType -> Maybe Text
sticker_set_name :: Maybe T.Text
, InternalLinkType -> Maybe Bool
expect_custom_emoji :: Maybe Bool
}
| InternalLinkTypeStory
{ InternalLinkType -> Maybe Text
story_sender_username :: Maybe T.Text
, InternalLinkType -> Maybe Int
story_id :: Maybe Int
}
| InternalLinkTypeTheme
{ InternalLinkType -> Maybe Text
theme_name :: Maybe T.Text
}
| InternalLinkTypeThemeSettings
| InternalLinkTypeUnknownDeepLink
{ InternalLinkType -> Maybe Text
link :: Maybe T.Text
}
| InternalLinkTypeUnsupportedProxy
| InternalLinkTypeUserPhoneNumber
{ phone_number :: Maybe T.Text
, draft_text :: Maybe T.Text
, open_profile :: Maybe Bool
}
| InternalLinkTypeUserToken
{ InternalLinkType -> Maybe Text
token :: Maybe T.Text
}
| InternalLinkTypeVideoChat
{ chat_username :: Maybe T.Text
, InternalLinkType -> Maybe Text
invite_hash :: Maybe T.Text
, InternalLinkType -> Maybe Bool
is_live_stream :: Maybe Bool
}
| InternalLinkTypeWebApp
{ bot_username :: Maybe T.Text
, InternalLinkType -> Maybe Text
web_app_short_name :: Maybe T.Text
, start_parameter :: Maybe T.Text
, mode :: Maybe WebAppOpenMode.WebAppOpenMode
}
deriving (InternalLinkType -> InternalLinkType -> Bool
(InternalLinkType -> InternalLinkType -> Bool)
-> (InternalLinkType -> InternalLinkType -> Bool)
-> Eq InternalLinkType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: InternalLinkType -> InternalLinkType -> Bool
== :: InternalLinkType -> InternalLinkType -> Bool
$c/= :: InternalLinkType -> InternalLinkType -> Bool
/= :: InternalLinkType -> InternalLinkType -> Bool
Eq, Int -> InternalLinkType -> ShowS
[InternalLinkType] -> ShowS
InternalLinkType -> String
(Int -> InternalLinkType -> ShowS)
-> (InternalLinkType -> String)
-> ([InternalLinkType] -> ShowS)
-> Show InternalLinkType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> InternalLinkType -> ShowS
showsPrec :: Int -> InternalLinkType -> ShowS
$cshow :: InternalLinkType -> String
show :: InternalLinkType -> String
$cshowList :: [InternalLinkType] -> ShowS
showList :: [InternalLinkType] -> ShowS
Show)
instance I.ShortShow InternalLinkType where
shortShow :: InternalLinkType -> String
shortShow InternalLinkType
InternalLinkTypeActiveSessions
= String
"InternalLinkTypeActiveSessions"
shortShow InternalLinkTypeAttachmentMenuBot
{ target_chat :: InternalLinkType -> Maybe TargetChat
target_chat = Maybe TargetChat
target_chat_
, bot_username :: InternalLinkType -> Maybe Text
bot_username = Maybe Text
bot_username_
, url :: InternalLinkType -> Maybe Text
url = Maybe Text
url_
}
= String
"InternalLinkTypeAttachmentMenuBot"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"target_chat" String -> Maybe TargetChat -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe TargetChat
target_chat_
, String
"bot_username" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
bot_username_
, String
"url" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
url_
]
shortShow InternalLinkTypeAuthenticationCode
{ code :: InternalLinkType -> Maybe Text
code = Maybe Text
code_
}
= String
"InternalLinkTypeAuthenticationCode"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"code" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
code_
]
shortShow InternalLinkTypeBackground
{ background_name :: InternalLinkType -> Maybe Text
background_name = Maybe Text
background_name_
}
= String
"InternalLinkTypeBackground"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"background_name" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
background_name_
]
shortShow InternalLinkTypeBotAddToChannel
{ bot_username :: InternalLinkType -> Maybe Text
bot_username = Maybe Text
bot_username_
, administrator_rights :: InternalLinkType -> Maybe ChatAdministratorRights
administrator_rights = Maybe ChatAdministratorRights
administrator_rights_
}
= String
"InternalLinkTypeBotAddToChannel"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"bot_username" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
bot_username_
, String
"administrator_rights" String -> Maybe ChatAdministratorRights -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe ChatAdministratorRights
administrator_rights_
]
shortShow InternalLinkTypeBotStart
{ bot_username :: InternalLinkType -> Maybe Text
bot_username = Maybe Text
bot_username_
, start_parameter :: InternalLinkType -> Maybe Text
start_parameter = Maybe Text
start_parameter_
, autostart :: InternalLinkType -> Maybe Bool
autostart = Maybe Bool
autostart_
}
= String
"InternalLinkTypeBotStart"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"bot_username" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
bot_username_
, String
"start_parameter" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
start_parameter_
, String
"autostart" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
autostart_
]
shortShow InternalLinkTypeBotStartInGroup
{ bot_username :: InternalLinkType -> Maybe Text
bot_username = Maybe Text
bot_username_
, start_parameter :: InternalLinkType -> Maybe Text
start_parameter = Maybe Text
start_parameter_
, administrator_rights :: InternalLinkType -> Maybe ChatAdministratorRights
administrator_rights = Maybe ChatAdministratorRights
administrator_rights_
}
= String
"InternalLinkTypeBotStartInGroup"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"bot_username" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
bot_username_
, String
"start_parameter" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
start_parameter_
, String
"administrator_rights" String -> Maybe ChatAdministratorRights -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe ChatAdministratorRights
administrator_rights_
]
shortShow InternalLinkTypeBusinessChat
{ link_name :: InternalLinkType -> Maybe Text
link_name = Maybe Text
link_name_
}
= String
"InternalLinkTypeBusinessChat"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"link_name" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
link_name_
]
shortShow InternalLinkTypeBuyStars
{ star_count :: InternalLinkType -> Maybe Int
star_count = Maybe Int
star_count_
, purpose :: InternalLinkType -> Maybe Text
purpose = Maybe Text
purpose_
}
= String
"InternalLinkTypeBuyStars"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"star_count" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
star_count_
, String
"purpose" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
purpose_
]
shortShow InternalLinkType
InternalLinkTypeChangePhoneNumber
= String
"InternalLinkTypeChangePhoneNumber"
shortShow InternalLinkTypeChatAffiliateProgram
{ username :: InternalLinkType -> Maybe Text
username = Maybe Text
username_
, referrer :: InternalLinkType -> Maybe Text
referrer = Maybe Text
referrer_
}
= String
"InternalLinkTypeChatAffiliateProgram"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"username" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
username_
, String
"referrer" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
referrer_
]
shortShow InternalLinkTypeChatBoost
{ url :: InternalLinkType -> Maybe Text
url = Maybe Text
url_
}
= String
"InternalLinkTypeChatBoost"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"url" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
url_
]
shortShow InternalLinkTypeChatFolderInvite
{ invite_link :: InternalLinkType -> Maybe Text
invite_link = Maybe Text
invite_link_
}
= String
"InternalLinkTypeChatFolderInvite"
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_
]
shortShow InternalLinkType
InternalLinkTypeChatFolderSettings
= String
"InternalLinkTypeChatFolderSettings"
shortShow InternalLinkTypeChatInvite
{ invite_link :: InternalLinkType -> Maybe Text
invite_link = Maybe Text
invite_link_
}
= String
"InternalLinkTypeChatInvite"
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_
]
shortShow InternalLinkType
InternalLinkTypeDefaultMessageAutoDeleteTimerSettings
= String
"InternalLinkTypeDefaultMessageAutoDeleteTimerSettings"
shortShow InternalLinkType
InternalLinkTypeEditProfileSettings
= String
"InternalLinkTypeEditProfileSettings"
shortShow InternalLinkTypeGame
{ bot_username :: InternalLinkType -> Maybe Text
bot_username = Maybe Text
bot_username_
, game_short_name :: InternalLinkType -> Maybe Text
game_short_name = Maybe Text
game_short_name_
}
= String
"InternalLinkTypeGame"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"bot_username" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
bot_username_
, String
"game_short_name" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
game_short_name_
]
shortShow InternalLinkTypeInstantView
{ url :: InternalLinkType -> Maybe Text
url = Maybe Text
url_
, fallback_url :: InternalLinkType -> Maybe Text
fallback_url = Maybe Text
fallback_url_
}
= String
"InternalLinkTypeInstantView"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"url" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
url_
, String
"fallback_url" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
fallback_url_
]
shortShow InternalLinkTypeInvoice
{ invoice_name :: InternalLinkType -> Maybe Text
invoice_name = Maybe Text
invoice_name_
}
= String
"InternalLinkTypeInvoice"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"invoice_name" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
invoice_name_
]
shortShow InternalLinkTypeLanguagePack
{ language_pack_id :: InternalLinkType -> Maybe Text
language_pack_id = Maybe Text
language_pack_id_
}
= String
"InternalLinkTypeLanguagePack"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"language_pack_id" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
language_pack_id_
]
shortShow InternalLinkType
InternalLinkTypeLanguageSettings
= String
"InternalLinkTypeLanguageSettings"
shortShow InternalLinkTypeMainWebApp
{ bot_username :: InternalLinkType -> Maybe Text
bot_username = Maybe Text
bot_username_
, start_parameter :: InternalLinkType -> Maybe Text
start_parameter = Maybe Text
start_parameter_
, mode :: InternalLinkType -> Maybe WebAppOpenMode
mode = Maybe WebAppOpenMode
mode_
}
= String
"InternalLinkTypeMainWebApp"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"bot_username" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
bot_username_
, String
"start_parameter" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
start_parameter_
, String
"mode" String -> Maybe WebAppOpenMode -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe WebAppOpenMode
mode_
]
shortShow InternalLinkTypeMessage
{ url :: InternalLinkType -> Maybe Text
url = Maybe Text
url_
}
= String
"InternalLinkTypeMessage"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"url" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
url_
]
shortShow InternalLinkTypeMessageDraft
{ text :: InternalLinkType -> Maybe FormattedText
text = Maybe FormattedText
text_
, contains_link :: InternalLinkType -> Maybe Bool
contains_link = Maybe Bool
contains_link_
}
= String
"InternalLinkTypeMessageDraft"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"text" String -> Maybe FormattedText -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe FormattedText
text_
, String
"contains_link" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
contains_link_
]
shortShow InternalLinkTypePassportDataRequest
{ bot_user_id :: InternalLinkType -> Maybe Int
bot_user_id = Maybe Int
bot_user_id_
, scope :: InternalLinkType -> Maybe Text
scope = Maybe Text
scope_
, public_key :: InternalLinkType -> Maybe Text
public_key = Maybe Text
public_key_
, nonce :: InternalLinkType -> Maybe Text
nonce = Maybe Text
nonce_
, callback_url :: InternalLinkType -> Maybe Text
callback_url = Maybe Text
callback_url_
}
= String
"InternalLinkTypePassportDataRequest"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"bot_user_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
bot_user_id_
, String
"scope" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
scope_
, String
"public_key" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
public_key_
, String
"nonce" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
nonce_
, String
"callback_url" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
callback_url_
]
shortShow InternalLinkTypePhoneNumberConfirmation
{ hash :: InternalLinkType -> Maybe Text
hash = Maybe Text
hash_
, phone_number :: InternalLinkType -> Maybe Text
phone_number = Maybe Text
phone_number_
}
= String
"InternalLinkTypePhoneNumberConfirmation"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"hash" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
hash_
, String
"phone_number" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
phone_number_
]
shortShow InternalLinkTypePremiumFeatures
{ referrer :: InternalLinkType -> Maybe Text
referrer = Maybe Text
referrer_
}
= String
"InternalLinkTypePremiumFeatures"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"referrer" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
referrer_
]
shortShow InternalLinkTypePremiumGift
{ referrer :: InternalLinkType -> Maybe Text
referrer = Maybe Text
referrer_
}
= String
"InternalLinkTypePremiumGift"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"referrer" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
referrer_
]
shortShow InternalLinkTypePremiumGiftCode
{ code :: InternalLinkType -> Maybe Text
code = Maybe Text
code_
}
= String
"InternalLinkTypePremiumGiftCode"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"code" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
code_
]
shortShow InternalLinkType
InternalLinkTypePrivacyAndSecuritySettings
= String
"InternalLinkTypePrivacyAndSecuritySettings"
shortShow InternalLinkTypeProxy
{ server :: InternalLinkType -> Maybe Text
server = Maybe Text
server_
, port :: InternalLinkType -> Maybe Int
port = Maybe Int
port_
, _type :: InternalLinkType -> Maybe ProxyType
_type = Maybe ProxyType
_type_
}
= String
"InternalLinkTypeProxy"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"server" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
server_
, String
"port" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
port_
, String
"_type" String -> Maybe ProxyType -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe ProxyType
_type_
]
shortShow InternalLinkTypePublicChat
{ chat_username :: InternalLinkType -> Maybe Text
chat_username = Maybe Text
chat_username_
, draft_text :: InternalLinkType -> Maybe Text
draft_text = Maybe Text
draft_text_
, open_profile :: InternalLinkType -> Maybe Bool
open_profile = Maybe Bool
open_profile_
}
= String
"InternalLinkTypePublicChat"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"chat_username" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
chat_username_
, String
"draft_text" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
draft_text_
, String
"open_profile" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
open_profile_
]
shortShow InternalLinkType
InternalLinkTypeQrCodeAuthentication
= String
"InternalLinkTypeQrCodeAuthentication"
shortShow InternalLinkType
InternalLinkTypeRestorePurchases
= String
"InternalLinkTypeRestorePurchases"
shortShow InternalLinkType
InternalLinkTypeSettings
= String
"InternalLinkTypeSettings"
shortShow InternalLinkTypeStickerSet
{ sticker_set_name :: InternalLinkType -> Maybe Text
sticker_set_name = Maybe Text
sticker_set_name_
, expect_custom_emoji :: InternalLinkType -> Maybe Bool
expect_custom_emoji = Maybe Bool
expect_custom_emoji_
}
= String
"InternalLinkTypeStickerSet"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"sticker_set_name" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
sticker_set_name_
, String
"expect_custom_emoji" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
expect_custom_emoji_
]
shortShow InternalLinkTypeStory
{ story_sender_username :: InternalLinkType -> Maybe Text
story_sender_username = Maybe Text
story_sender_username_
, story_id :: InternalLinkType -> Maybe Int
story_id = Maybe Int
story_id_
}
= String
"InternalLinkTypeStory"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"story_sender_username" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
story_sender_username_
, String
"story_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
story_id_
]
shortShow InternalLinkTypeTheme
{ theme_name :: InternalLinkType -> Maybe Text
theme_name = Maybe Text
theme_name_
}
= String
"InternalLinkTypeTheme"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"theme_name" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
theme_name_
]
shortShow InternalLinkType
InternalLinkTypeThemeSettings
= String
"InternalLinkTypeThemeSettings"
shortShow InternalLinkTypeUnknownDeepLink
{ link :: InternalLinkType -> Maybe Text
link = Maybe Text
link_
}
= String
"InternalLinkTypeUnknownDeepLink"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"link" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
link_
]
shortShow InternalLinkType
InternalLinkTypeUnsupportedProxy
= String
"InternalLinkTypeUnsupportedProxy"
shortShow InternalLinkTypeUserPhoneNumber
{ phone_number :: InternalLinkType -> Maybe Text
phone_number = Maybe Text
phone_number_
, draft_text :: InternalLinkType -> Maybe Text
draft_text = Maybe Text
draft_text_
, open_profile :: InternalLinkType -> Maybe Bool
open_profile = Maybe Bool
open_profile_
}
= String
"InternalLinkTypeUserPhoneNumber"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"phone_number" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
phone_number_
, String
"draft_text" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
draft_text_
, String
"open_profile" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
open_profile_
]
shortShow InternalLinkTypeUserToken
{ token :: InternalLinkType -> Maybe Text
token = Maybe Text
token_
}
= String
"InternalLinkTypeUserToken"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"token" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
token_
]
shortShow InternalLinkTypeVideoChat
{ chat_username :: InternalLinkType -> Maybe Text
chat_username = Maybe Text
chat_username_
, invite_hash :: InternalLinkType -> Maybe Text
invite_hash = Maybe Text
invite_hash_
, is_live_stream :: InternalLinkType -> Maybe Bool
is_live_stream = Maybe Bool
is_live_stream_
}
= String
"InternalLinkTypeVideoChat"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"chat_username" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
chat_username_
, String
"invite_hash" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
invite_hash_
, String
"is_live_stream" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
is_live_stream_
]
shortShow InternalLinkTypeWebApp
{ bot_username :: InternalLinkType -> Maybe Text
bot_username = Maybe Text
bot_username_
, web_app_short_name :: InternalLinkType -> Maybe Text
web_app_short_name = Maybe Text
web_app_short_name_
, start_parameter :: InternalLinkType -> Maybe Text
start_parameter = Maybe Text
start_parameter_
, mode :: InternalLinkType -> Maybe WebAppOpenMode
mode = Maybe WebAppOpenMode
mode_
}
= String
"InternalLinkTypeWebApp"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"bot_username" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
bot_username_
, String
"web_app_short_name" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
web_app_short_name_
, String
"start_parameter" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
start_parameter_
, String
"mode" String -> Maybe WebAppOpenMode -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe WebAppOpenMode
mode_
]
instance AT.FromJSON InternalLinkType where
parseJSON :: Value -> Parser InternalLinkType
parseJSON v :: Value
v@(AT.Object Object
obj) = do
String
t <- Object
obj Object -> Key -> Parser String
forall a. FromJSON a => Object -> Key -> Parser a
A..: Key
"@type" :: AT.Parser String
case String
t of
String
"internalLinkTypeActiveSessions" -> InternalLinkType -> Parser InternalLinkType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure InternalLinkType
InternalLinkTypeActiveSessions
String
"internalLinkTypeAttachmentMenuBot" -> Value -> Parser InternalLinkType
parseInternalLinkTypeAttachmentMenuBot Value
v
String
"internalLinkTypeAuthenticationCode" -> Value -> Parser InternalLinkType
parseInternalLinkTypeAuthenticationCode Value
v
String
"internalLinkTypeBackground" -> Value -> Parser InternalLinkType
parseInternalLinkTypeBackground Value
v
String
"internalLinkTypeBotAddToChannel" -> Value -> Parser InternalLinkType
parseInternalLinkTypeBotAddToChannel Value
v
String
"internalLinkTypeBotStart" -> Value -> Parser InternalLinkType
parseInternalLinkTypeBotStart Value
v
String
"internalLinkTypeBotStartInGroup" -> Value -> Parser InternalLinkType
parseInternalLinkTypeBotStartInGroup Value
v
String
"internalLinkTypeBusinessChat" -> Value -> Parser InternalLinkType
parseInternalLinkTypeBusinessChat Value
v
String
"internalLinkTypeBuyStars" -> Value -> Parser InternalLinkType
parseInternalLinkTypeBuyStars Value
v
String
"internalLinkTypeChangePhoneNumber" -> InternalLinkType -> Parser InternalLinkType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure InternalLinkType
InternalLinkTypeChangePhoneNumber
String
"internalLinkTypeChatAffiliateProgram" -> Value -> Parser InternalLinkType
parseInternalLinkTypeChatAffiliateProgram Value
v
String
"internalLinkTypeChatBoost" -> Value -> Parser InternalLinkType
parseInternalLinkTypeChatBoost Value
v
String
"internalLinkTypeChatFolderInvite" -> Value -> Parser InternalLinkType
parseInternalLinkTypeChatFolderInvite Value
v
String
"internalLinkTypeChatFolderSettings" -> InternalLinkType -> Parser InternalLinkType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure InternalLinkType
InternalLinkTypeChatFolderSettings
String
"internalLinkTypeChatInvite" -> Value -> Parser InternalLinkType
parseInternalLinkTypeChatInvite Value
v
String
"internalLinkTypeDefaultMessageAutoDeleteTimerSettings" -> InternalLinkType -> Parser InternalLinkType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure InternalLinkType
InternalLinkTypeDefaultMessageAutoDeleteTimerSettings
String
"internalLinkTypeEditProfileSettings" -> InternalLinkType -> Parser InternalLinkType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure InternalLinkType
InternalLinkTypeEditProfileSettings
String
"internalLinkTypeGame" -> Value -> Parser InternalLinkType
parseInternalLinkTypeGame Value
v
String
"internalLinkTypeInstantView" -> Value -> Parser InternalLinkType
parseInternalLinkTypeInstantView Value
v
String
"internalLinkTypeInvoice" -> Value -> Parser InternalLinkType
parseInternalLinkTypeInvoice Value
v
String
"internalLinkTypeLanguagePack" -> Value -> Parser InternalLinkType
parseInternalLinkTypeLanguagePack Value
v
String
"internalLinkTypeLanguageSettings" -> InternalLinkType -> Parser InternalLinkType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure InternalLinkType
InternalLinkTypeLanguageSettings
String
"internalLinkTypeMainWebApp" -> Value -> Parser InternalLinkType
parseInternalLinkTypeMainWebApp Value
v
String
"internalLinkTypeMessage" -> Value -> Parser InternalLinkType
parseInternalLinkTypeMessage Value
v
String
"internalLinkTypeMessageDraft" -> Value -> Parser InternalLinkType
parseInternalLinkTypeMessageDraft Value
v
String
"internalLinkTypePassportDataRequest" -> Value -> Parser InternalLinkType
parseInternalLinkTypePassportDataRequest Value
v
String
"internalLinkTypePhoneNumberConfirmation" -> Value -> Parser InternalLinkType
parseInternalLinkTypePhoneNumberConfirmation Value
v
String
"internalLinkTypePremiumFeatures" -> Value -> Parser InternalLinkType
parseInternalLinkTypePremiumFeatures Value
v
String
"internalLinkTypePremiumGift" -> Value -> Parser InternalLinkType
parseInternalLinkTypePremiumGift Value
v
String
"internalLinkTypePremiumGiftCode" -> Value -> Parser InternalLinkType
parseInternalLinkTypePremiumGiftCode Value
v
String
"internalLinkTypePrivacyAndSecuritySettings" -> InternalLinkType -> Parser InternalLinkType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure InternalLinkType
InternalLinkTypePrivacyAndSecuritySettings
String
"internalLinkTypeProxy" -> Value -> Parser InternalLinkType
parseInternalLinkTypeProxy Value
v
String
"internalLinkTypePublicChat" -> Value -> Parser InternalLinkType
parseInternalLinkTypePublicChat Value
v
String
"internalLinkTypeQrCodeAuthentication" -> InternalLinkType -> Parser InternalLinkType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure InternalLinkType
InternalLinkTypeQrCodeAuthentication
String
"internalLinkTypeRestorePurchases" -> InternalLinkType -> Parser InternalLinkType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure InternalLinkType
InternalLinkTypeRestorePurchases
String
"internalLinkTypeSettings" -> InternalLinkType -> Parser InternalLinkType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure InternalLinkType
InternalLinkTypeSettings
String
"internalLinkTypeStickerSet" -> Value -> Parser InternalLinkType
parseInternalLinkTypeStickerSet Value
v
String
"internalLinkTypeStory" -> Value -> Parser InternalLinkType
parseInternalLinkTypeStory Value
v
String
"internalLinkTypeTheme" -> Value -> Parser InternalLinkType
parseInternalLinkTypeTheme Value
v
String
"internalLinkTypeThemeSettings" -> InternalLinkType -> Parser InternalLinkType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure InternalLinkType
InternalLinkTypeThemeSettings
String
"internalLinkTypeUnknownDeepLink" -> Value -> Parser InternalLinkType
parseInternalLinkTypeUnknownDeepLink Value
v
String
"internalLinkTypeUnsupportedProxy" -> InternalLinkType -> Parser InternalLinkType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure InternalLinkType
InternalLinkTypeUnsupportedProxy
String
"internalLinkTypeUserPhoneNumber" -> Value -> Parser InternalLinkType
parseInternalLinkTypeUserPhoneNumber Value
v
String
"internalLinkTypeUserToken" -> Value -> Parser InternalLinkType
parseInternalLinkTypeUserToken Value
v
String
"internalLinkTypeVideoChat" -> Value -> Parser InternalLinkType
parseInternalLinkTypeVideoChat Value
v
String
"internalLinkTypeWebApp" -> Value -> Parser InternalLinkType
parseInternalLinkTypeWebApp Value
v
String
_ -> Parser InternalLinkType
forall a. Monoid a => a
mempty
where
parseInternalLinkTypeAttachmentMenuBot :: A.Value -> AT.Parser InternalLinkType
parseInternalLinkTypeAttachmentMenuBot :: Value -> Parser InternalLinkType
parseInternalLinkTypeAttachmentMenuBot = String
-> (Object -> Parser InternalLinkType)
-> Value
-> Parser InternalLinkType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InternalLinkTypeAttachmentMenuBot" ((Object -> Parser InternalLinkType)
-> Value -> Parser InternalLinkType)
-> (Object -> Parser InternalLinkType)
-> Value
-> Parser InternalLinkType
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe TargetChat
target_chat_ <- Object
o Object -> Key -> Parser (Maybe TargetChat)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"target_chat"
Maybe Text
bot_username_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"bot_username"
Maybe Text
url_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"url"
InternalLinkType -> Parser InternalLinkType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InternalLinkType -> Parser InternalLinkType)
-> InternalLinkType -> Parser InternalLinkType
forall a b. (a -> b) -> a -> b
$ InternalLinkTypeAttachmentMenuBot
{ target_chat :: Maybe TargetChat
target_chat = Maybe TargetChat
target_chat_
, bot_username :: Maybe Text
bot_username = Maybe Text
bot_username_
, url :: Maybe Text
url = Maybe Text
url_
}
parseInternalLinkTypeAuthenticationCode :: A.Value -> AT.Parser InternalLinkType
parseInternalLinkTypeAuthenticationCode :: Value -> Parser InternalLinkType
parseInternalLinkTypeAuthenticationCode = String
-> (Object -> Parser InternalLinkType)
-> Value
-> Parser InternalLinkType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InternalLinkTypeAuthenticationCode" ((Object -> Parser InternalLinkType)
-> Value -> Parser InternalLinkType)
-> (Object -> Parser InternalLinkType)
-> Value
-> Parser InternalLinkType
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Text
code_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"code"
InternalLinkType -> Parser InternalLinkType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InternalLinkType -> Parser InternalLinkType)
-> InternalLinkType -> Parser InternalLinkType
forall a b. (a -> b) -> a -> b
$ InternalLinkTypeAuthenticationCode
{ code :: Maybe Text
code = Maybe Text
code_
}
parseInternalLinkTypeBackground :: A.Value -> AT.Parser InternalLinkType
parseInternalLinkTypeBackground :: Value -> Parser InternalLinkType
parseInternalLinkTypeBackground = String
-> (Object -> Parser InternalLinkType)
-> Value
-> Parser InternalLinkType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InternalLinkTypeBackground" ((Object -> Parser InternalLinkType)
-> Value -> Parser InternalLinkType)
-> (Object -> Parser InternalLinkType)
-> Value
-> Parser InternalLinkType
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Text
background_name_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"background_name"
InternalLinkType -> Parser InternalLinkType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InternalLinkType -> Parser InternalLinkType)
-> InternalLinkType -> Parser InternalLinkType
forall a b. (a -> b) -> a -> b
$ InternalLinkTypeBackground
{ background_name :: Maybe Text
background_name = Maybe Text
background_name_
}
parseInternalLinkTypeBotAddToChannel :: A.Value -> AT.Parser InternalLinkType
parseInternalLinkTypeBotAddToChannel :: Value -> Parser InternalLinkType
parseInternalLinkTypeBotAddToChannel = String
-> (Object -> Parser InternalLinkType)
-> Value
-> Parser InternalLinkType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InternalLinkTypeBotAddToChannel" ((Object -> Parser InternalLinkType)
-> Value -> Parser InternalLinkType)
-> (Object -> Parser InternalLinkType)
-> Value
-> Parser InternalLinkType
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Text
bot_username_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"bot_username"
Maybe ChatAdministratorRights
administrator_rights_ <- Object
o Object -> Key -> Parser (Maybe ChatAdministratorRights)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"administrator_rights"
InternalLinkType -> Parser InternalLinkType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InternalLinkType -> Parser InternalLinkType)
-> InternalLinkType -> Parser InternalLinkType
forall a b. (a -> b) -> a -> b
$ InternalLinkTypeBotAddToChannel
{ bot_username :: Maybe Text
bot_username = Maybe Text
bot_username_
, administrator_rights :: Maybe ChatAdministratorRights
administrator_rights = Maybe ChatAdministratorRights
administrator_rights_
}
parseInternalLinkTypeBotStart :: A.Value -> AT.Parser InternalLinkType
parseInternalLinkTypeBotStart :: Value -> Parser InternalLinkType
parseInternalLinkTypeBotStart = String
-> (Object -> Parser InternalLinkType)
-> Value
-> Parser InternalLinkType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InternalLinkTypeBotStart" ((Object -> Parser InternalLinkType)
-> Value -> Parser InternalLinkType)
-> (Object -> Parser InternalLinkType)
-> Value
-> Parser InternalLinkType
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Text
bot_username_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"bot_username"
Maybe Text
start_parameter_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"start_parameter"
Maybe Bool
autostart_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"autostart"
InternalLinkType -> Parser InternalLinkType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InternalLinkType -> Parser InternalLinkType)
-> InternalLinkType -> Parser InternalLinkType
forall a b. (a -> b) -> a -> b
$ InternalLinkTypeBotStart
{ bot_username :: Maybe Text
bot_username = Maybe Text
bot_username_
, start_parameter :: Maybe Text
start_parameter = Maybe Text
start_parameter_
, autostart :: Maybe Bool
autostart = Maybe Bool
autostart_
}
parseInternalLinkTypeBotStartInGroup :: A.Value -> AT.Parser InternalLinkType
parseInternalLinkTypeBotStartInGroup :: Value -> Parser InternalLinkType
parseInternalLinkTypeBotStartInGroup = String
-> (Object -> Parser InternalLinkType)
-> Value
-> Parser InternalLinkType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InternalLinkTypeBotStartInGroup" ((Object -> Parser InternalLinkType)
-> Value -> Parser InternalLinkType)
-> (Object -> Parser InternalLinkType)
-> Value
-> Parser InternalLinkType
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Text
bot_username_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"bot_username"
Maybe Text
start_parameter_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"start_parameter"
Maybe ChatAdministratorRights
administrator_rights_ <- Object
o Object -> Key -> Parser (Maybe ChatAdministratorRights)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"administrator_rights"
InternalLinkType -> Parser InternalLinkType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InternalLinkType -> Parser InternalLinkType)
-> InternalLinkType -> Parser InternalLinkType
forall a b. (a -> b) -> a -> b
$ InternalLinkTypeBotStartInGroup
{ bot_username :: Maybe Text
bot_username = Maybe Text
bot_username_
, start_parameter :: Maybe Text
start_parameter = Maybe Text
start_parameter_
, administrator_rights :: Maybe ChatAdministratorRights
administrator_rights = Maybe ChatAdministratorRights
administrator_rights_
}
parseInternalLinkTypeBusinessChat :: A.Value -> AT.Parser InternalLinkType
parseInternalLinkTypeBusinessChat :: Value -> Parser InternalLinkType
parseInternalLinkTypeBusinessChat = String
-> (Object -> Parser InternalLinkType)
-> Value
-> Parser InternalLinkType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InternalLinkTypeBusinessChat" ((Object -> Parser InternalLinkType)
-> Value -> Parser InternalLinkType)
-> (Object -> Parser InternalLinkType)
-> Value
-> Parser InternalLinkType
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Text
link_name_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"link_name"
InternalLinkType -> Parser InternalLinkType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InternalLinkType -> Parser InternalLinkType)
-> InternalLinkType -> Parser InternalLinkType
forall a b. (a -> b) -> a -> b
$ InternalLinkTypeBusinessChat
{ link_name :: Maybe Text
link_name = Maybe Text
link_name_
}
parseInternalLinkTypeBuyStars :: A.Value -> AT.Parser InternalLinkType
parseInternalLinkTypeBuyStars :: Value -> Parser InternalLinkType
parseInternalLinkTypeBuyStars = String
-> (Object -> Parser InternalLinkType)
-> Value
-> Parser InternalLinkType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InternalLinkTypeBuyStars" ((Object -> Parser InternalLinkType)
-> Value -> Parser InternalLinkType)
-> (Object -> Parser InternalLinkType)
-> Value
-> Parser InternalLinkType
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Int
star_count_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"star_count"
Maybe Text
purpose_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"purpose"
InternalLinkType -> Parser InternalLinkType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InternalLinkType -> Parser InternalLinkType)
-> InternalLinkType -> Parser InternalLinkType
forall a b. (a -> b) -> a -> b
$ InternalLinkTypeBuyStars
{ star_count :: Maybe Int
star_count = Maybe Int
star_count_
, purpose :: Maybe Text
purpose = Maybe Text
purpose_
}
parseInternalLinkTypeChatAffiliateProgram :: A.Value -> AT.Parser InternalLinkType
parseInternalLinkTypeChatAffiliateProgram :: Value -> Parser InternalLinkType
parseInternalLinkTypeChatAffiliateProgram = String
-> (Object -> Parser InternalLinkType)
-> Value
-> Parser InternalLinkType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InternalLinkTypeChatAffiliateProgram" ((Object -> Parser InternalLinkType)
-> Value -> Parser InternalLinkType)
-> (Object -> Parser InternalLinkType)
-> Value
-> Parser InternalLinkType
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Text
username_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"username"
Maybe Text
referrer_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"referrer"
InternalLinkType -> Parser InternalLinkType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InternalLinkType -> Parser InternalLinkType)
-> InternalLinkType -> Parser InternalLinkType
forall a b. (a -> b) -> a -> b
$ InternalLinkTypeChatAffiliateProgram
{ username :: Maybe Text
username = Maybe Text
username_
, referrer :: Maybe Text
referrer = Maybe Text
referrer_
}
parseInternalLinkTypeChatBoost :: A.Value -> AT.Parser InternalLinkType
parseInternalLinkTypeChatBoost :: Value -> Parser InternalLinkType
parseInternalLinkTypeChatBoost = String
-> (Object -> Parser InternalLinkType)
-> Value
-> Parser InternalLinkType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InternalLinkTypeChatBoost" ((Object -> Parser InternalLinkType)
-> Value -> Parser InternalLinkType)
-> (Object -> Parser InternalLinkType)
-> Value
-> Parser InternalLinkType
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Text
url_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"url"
InternalLinkType -> Parser InternalLinkType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InternalLinkType -> Parser InternalLinkType)
-> InternalLinkType -> Parser InternalLinkType
forall a b. (a -> b) -> a -> b
$ InternalLinkTypeChatBoost
{ url :: Maybe Text
url = Maybe Text
url_
}
parseInternalLinkTypeChatFolderInvite :: A.Value -> AT.Parser InternalLinkType
parseInternalLinkTypeChatFolderInvite :: Value -> Parser InternalLinkType
parseInternalLinkTypeChatFolderInvite = String
-> (Object -> Parser InternalLinkType)
-> Value
-> Parser InternalLinkType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InternalLinkTypeChatFolderInvite" ((Object -> Parser InternalLinkType)
-> Value -> Parser InternalLinkType)
-> (Object -> Parser InternalLinkType)
-> Value
-> Parser InternalLinkType
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Text
invite_link_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"invite_link"
InternalLinkType -> Parser InternalLinkType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InternalLinkType -> Parser InternalLinkType)
-> InternalLinkType -> Parser InternalLinkType
forall a b. (a -> b) -> a -> b
$ InternalLinkTypeChatFolderInvite
{ invite_link :: Maybe Text
invite_link = Maybe Text
invite_link_
}
parseInternalLinkTypeChatInvite :: A.Value -> AT.Parser InternalLinkType
parseInternalLinkTypeChatInvite :: Value -> Parser InternalLinkType
parseInternalLinkTypeChatInvite = String
-> (Object -> Parser InternalLinkType)
-> Value
-> Parser InternalLinkType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InternalLinkTypeChatInvite" ((Object -> Parser InternalLinkType)
-> Value -> Parser InternalLinkType)
-> (Object -> Parser InternalLinkType)
-> Value
-> Parser InternalLinkType
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Text
invite_link_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"invite_link"
InternalLinkType -> Parser InternalLinkType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InternalLinkType -> Parser InternalLinkType)
-> InternalLinkType -> Parser InternalLinkType
forall a b. (a -> b) -> a -> b
$ InternalLinkTypeChatInvite
{ invite_link :: Maybe Text
invite_link = Maybe Text
invite_link_
}
parseInternalLinkTypeGame :: A.Value -> AT.Parser InternalLinkType
parseInternalLinkTypeGame :: Value -> Parser InternalLinkType
parseInternalLinkTypeGame = String
-> (Object -> Parser InternalLinkType)
-> Value
-> Parser InternalLinkType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InternalLinkTypeGame" ((Object -> Parser InternalLinkType)
-> Value -> Parser InternalLinkType)
-> (Object -> Parser InternalLinkType)
-> Value
-> Parser InternalLinkType
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Text
bot_username_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"bot_username"
Maybe Text
game_short_name_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"game_short_name"
InternalLinkType -> Parser InternalLinkType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InternalLinkType -> Parser InternalLinkType)
-> InternalLinkType -> Parser InternalLinkType
forall a b. (a -> b) -> a -> b
$ InternalLinkTypeGame
{ bot_username :: Maybe Text
bot_username = Maybe Text
bot_username_
, game_short_name :: Maybe Text
game_short_name = Maybe Text
game_short_name_
}
parseInternalLinkTypeInstantView :: A.Value -> AT.Parser InternalLinkType
parseInternalLinkTypeInstantView :: Value -> Parser InternalLinkType
parseInternalLinkTypeInstantView = String
-> (Object -> Parser InternalLinkType)
-> Value
-> Parser InternalLinkType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InternalLinkTypeInstantView" ((Object -> Parser InternalLinkType)
-> Value -> Parser InternalLinkType)
-> (Object -> Parser InternalLinkType)
-> Value
-> Parser InternalLinkType
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Text
url_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"url"
Maybe Text
fallback_url_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"fallback_url"
InternalLinkType -> Parser InternalLinkType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InternalLinkType -> Parser InternalLinkType)
-> InternalLinkType -> Parser InternalLinkType
forall a b. (a -> b) -> a -> b
$ InternalLinkTypeInstantView
{ url :: Maybe Text
url = Maybe Text
url_
, fallback_url :: Maybe Text
fallback_url = Maybe Text
fallback_url_
}
parseInternalLinkTypeInvoice :: A.Value -> AT.Parser InternalLinkType
parseInternalLinkTypeInvoice :: Value -> Parser InternalLinkType
parseInternalLinkTypeInvoice = String
-> (Object -> Parser InternalLinkType)
-> Value
-> Parser InternalLinkType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InternalLinkTypeInvoice" ((Object -> Parser InternalLinkType)
-> Value -> Parser InternalLinkType)
-> (Object -> Parser InternalLinkType)
-> Value
-> Parser InternalLinkType
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Text
invoice_name_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"invoice_name"
InternalLinkType -> Parser InternalLinkType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InternalLinkType -> Parser InternalLinkType)
-> InternalLinkType -> Parser InternalLinkType
forall a b. (a -> b) -> a -> b
$ InternalLinkTypeInvoice
{ invoice_name :: Maybe Text
invoice_name = Maybe Text
invoice_name_
}
parseInternalLinkTypeLanguagePack :: A.Value -> AT.Parser InternalLinkType
parseInternalLinkTypeLanguagePack :: Value -> Parser InternalLinkType
parseInternalLinkTypeLanguagePack = String
-> (Object -> Parser InternalLinkType)
-> Value
-> Parser InternalLinkType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InternalLinkTypeLanguagePack" ((Object -> Parser InternalLinkType)
-> Value -> Parser InternalLinkType)
-> (Object -> Parser InternalLinkType)
-> Value
-> Parser InternalLinkType
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Text
language_pack_id_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"language_pack_id"
InternalLinkType -> Parser InternalLinkType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InternalLinkType -> Parser InternalLinkType)
-> InternalLinkType -> Parser InternalLinkType
forall a b. (a -> b) -> a -> b
$ InternalLinkTypeLanguagePack
{ language_pack_id :: Maybe Text
language_pack_id = Maybe Text
language_pack_id_
}
parseInternalLinkTypeMainWebApp :: A.Value -> AT.Parser InternalLinkType
parseInternalLinkTypeMainWebApp :: Value -> Parser InternalLinkType
parseInternalLinkTypeMainWebApp = String
-> (Object -> Parser InternalLinkType)
-> Value
-> Parser InternalLinkType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InternalLinkTypeMainWebApp" ((Object -> Parser InternalLinkType)
-> Value -> Parser InternalLinkType)
-> (Object -> Parser InternalLinkType)
-> Value
-> Parser InternalLinkType
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Text
bot_username_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"bot_username"
Maybe Text
start_parameter_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"start_parameter"
Maybe WebAppOpenMode
mode_ <- Object
o Object -> Key -> Parser (Maybe WebAppOpenMode)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"mode"
InternalLinkType -> Parser InternalLinkType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InternalLinkType -> Parser InternalLinkType)
-> InternalLinkType -> Parser InternalLinkType
forall a b. (a -> b) -> a -> b
$ InternalLinkTypeMainWebApp
{ bot_username :: Maybe Text
bot_username = Maybe Text
bot_username_
, start_parameter :: Maybe Text
start_parameter = Maybe Text
start_parameter_
, mode :: Maybe WebAppOpenMode
mode = Maybe WebAppOpenMode
mode_
}
parseInternalLinkTypeMessage :: A.Value -> AT.Parser InternalLinkType
parseInternalLinkTypeMessage :: Value -> Parser InternalLinkType
parseInternalLinkTypeMessage = String
-> (Object -> Parser InternalLinkType)
-> Value
-> Parser InternalLinkType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InternalLinkTypeMessage" ((Object -> Parser InternalLinkType)
-> Value -> Parser InternalLinkType)
-> (Object -> Parser InternalLinkType)
-> Value
-> Parser InternalLinkType
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Text
url_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"url"
InternalLinkType -> Parser InternalLinkType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InternalLinkType -> Parser InternalLinkType)
-> InternalLinkType -> Parser InternalLinkType
forall a b. (a -> b) -> a -> b
$ InternalLinkTypeMessage
{ url :: Maybe Text
url = Maybe Text
url_
}
parseInternalLinkTypeMessageDraft :: A.Value -> AT.Parser InternalLinkType
parseInternalLinkTypeMessageDraft :: Value -> Parser InternalLinkType
parseInternalLinkTypeMessageDraft = String
-> (Object -> Parser InternalLinkType)
-> Value
-> Parser InternalLinkType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InternalLinkTypeMessageDraft" ((Object -> Parser InternalLinkType)
-> Value -> Parser InternalLinkType)
-> (Object -> Parser InternalLinkType)
-> Value
-> Parser InternalLinkType
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe FormattedText
text_ <- Object
o Object -> Key -> Parser (Maybe FormattedText)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"text"
Maybe Bool
contains_link_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"contains_link"
InternalLinkType -> Parser InternalLinkType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InternalLinkType -> Parser InternalLinkType)
-> InternalLinkType -> Parser InternalLinkType
forall a b. (a -> b) -> a -> b
$ InternalLinkTypeMessageDraft
{ text :: Maybe FormattedText
text = Maybe FormattedText
text_
, contains_link :: Maybe Bool
contains_link = Maybe Bool
contains_link_
}
parseInternalLinkTypePassportDataRequest :: A.Value -> AT.Parser InternalLinkType
parseInternalLinkTypePassportDataRequest :: Value -> Parser InternalLinkType
parseInternalLinkTypePassportDataRequest = String
-> (Object -> Parser InternalLinkType)
-> Value
-> Parser InternalLinkType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InternalLinkTypePassportDataRequest" ((Object -> Parser InternalLinkType)
-> Value -> Parser InternalLinkType)
-> (Object -> Parser InternalLinkType)
-> Value
-> Parser InternalLinkType
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Int
bot_user_id_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"bot_user_id"
Maybe Text
scope_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"scope"
Maybe Text
public_key_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"public_key"
Maybe Text
nonce_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"nonce"
Maybe Text
callback_url_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"callback_url"
InternalLinkType -> Parser InternalLinkType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InternalLinkType -> Parser InternalLinkType)
-> InternalLinkType -> Parser InternalLinkType
forall a b. (a -> b) -> a -> b
$ InternalLinkTypePassportDataRequest
{ bot_user_id :: Maybe Int
bot_user_id = Maybe Int
bot_user_id_
, scope :: Maybe Text
scope = Maybe Text
scope_
, public_key :: Maybe Text
public_key = Maybe Text
public_key_
, nonce :: Maybe Text
nonce = Maybe Text
nonce_
, callback_url :: Maybe Text
callback_url = Maybe Text
callback_url_
}
parseInternalLinkTypePhoneNumberConfirmation :: A.Value -> AT.Parser InternalLinkType
parseInternalLinkTypePhoneNumberConfirmation :: Value -> Parser InternalLinkType
parseInternalLinkTypePhoneNumberConfirmation = String
-> (Object -> Parser InternalLinkType)
-> Value
-> Parser InternalLinkType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InternalLinkTypePhoneNumberConfirmation" ((Object -> Parser InternalLinkType)
-> Value -> Parser InternalLinkType)
-> (Object -> Parser InternalLinkType)
-> Value
-> Parser InternalLinkType
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Text
hash_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"hash"
Maybe Text
phone_number_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"phone_number"
InternalLinkType -> Parser InternalLinkType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InternalLinkType -> Parser InternalLinkType)
-> InternalLinkType -> Parser InternalLinkType
forall a b. (a -> b) -> a -> b
$ InternalLinkTypePhoneNumberConfirmation
{ hash :: Maybe Text
hash = Maybe Text
hash_
, phone_number :: Maybe Text
phone_number = Maybe Text
phone_number_
}
parseInternalLinkTypePremiumFeatures :: A.Value -> AT.Parser InternalLinkType
parseInternalLinkTypePremiumFeatures :: Value -> Parser InternalLinkType
parseInternalLinkTypePremiumFeatures = String
-> (Object -> Parser InternalLinkType)
-> Value
-> Parser InternalLinkType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InternalLinkTypePremiumFeatures" ((Object -> Parser InternalLinkType)
-> Value -> Parser InternalLinkType)
-> (Object -> Parser InternalLinkType)
-> Value
-> Parser InternalLinkType
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Text
referrer_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"referrer"
InternalLinkType -> Parser InternalLinkType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InternalLinkType -> Parser InternalLinkType)
-> InternalLinkType -> Parser InternalLinkType
forall a b. (a -> b) -> a -> b
$ InternalLinkTypePremiumFeatures
{ referrer :: Maybe Text
referrer = Maybe Text
referrer_
}
parseInternalLinkTypePremiumGift :: A.Value -> AT.Parser InternalLinkType
parseInternalLinkTypePremiumGift :: Value -> Parser InternalLinkType
parseInternalLinkTypePremiumGift = String
-> (Object -> Parser InternalLinkType)
-> Value
-> Parser InternalLinkType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InternalLinkTypePremiumGift" ((Object -> Parser InternalLinkType)
-> Value -> Parser InternalLinkType)
-> (Object -> Parser InternalLinkType)
-> Value
-> Parser InternalLinkType
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Text
referrer_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"referrer"
InternalLinkType -> Parser InternalLinkType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InternalLinkType -> Parser InternalLinkType)
-> InternalLinkType -> Parser InternalLinkType
forall a b. (a -> b) -> a -> b
$ InternalLinkTypePremiumGift
{ referrer :: Maybe Text
referrer = Maybe Text
referrer_
}
parseInternalLinkTypePremiumGiftCode :: A.Value -> AT.Parser InternalLinkType
parseInternalLinkTypePremiumGiftCode :: Value -> Parser InternalLinkType
parseInternalLinkTypePremiumGiftCode = String
-> (Object -> Parser InternalLinkType)
-> Value
-> Parser InternalLinkType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InternalLinkTypePremiumGiftCode" ((Object -> Parser InternalLinkType)
-> Value -> Parser InternalLinkType)
-> (Object -> Parser InternalLinkType)
-> Value
-> Parser InternalLinkType
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Text
code_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"code"
InternalLinkType -> Parser InternalLinkType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InternalLinkType -> Parser InternalLinkType)
-> InternalLinkType -> Parser InternalLinkType
forall a b. (a -> b) -> a -> b
$ InternalLinkTypePremiumGiftCode
{ code :: Maybe Text
code = Maybe Text
code_
}
parseInternalLinkTypeProxy :: A.Value -> AT.Parser InternalLinkType
parseInternalLinkTypeProxy :: Value -> Parser InternalLinkType
parseInternalLinkTypeProxy = String
-> (Object -> Parser InternalLinkType)
-> Value
-> Parser InternalLinkType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InternalLinkTypeProxy" ((Object -> Parser InternalLinkType)
-> Value -> Parser InternalLinkType)
-> (Object -> Parser InternalLinkType)
-> Value
-> Parser InternalLinkType
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Text
server_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"server"
Maybe Int
port_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"port"
Maybe ProxyType
_type_ <- Object
o Object -> Key -> Parser (Maybe ProxyType)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"type"
InternalLinkType -> Parser InternalLinkType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InternalLinkType -> Parser InternalLinkType)
-> InternalLinkType -> Parser InternalLinkType
forall a b. (a -> b) -> a -> b
$ InternalLinkTypeProxy
{ server :: Maybe Text
server = Maybe Text
server_
, port :: Maybe Int
port = Maybe Int
port_
, _type :: Maybe ProxyType
_type = Maybe ProxyType
_type_
}
parseInternalLinkTypePublicChat :: A.Value -> AT.Parser InternalLinkType
parseInternalLinkTypePublicChat :: Value -> Parser InternalLinkType
parseInternalLinkTypePublicChat = String
-> (Object -> Parser InternalLinkType)
-> Value
-> Parser InternalLinkType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InternalLinkTypePublicChat" ((Object -> Parser InternalLinkType)
-> Value -> Parser InternalLinkType)
-> (Object -> Parser InternalLinkType)
-> Value
-> Parser InternalLinkType
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Text
chat_username_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"chat_username"
Maybe Text
draft_text_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"draft_text"
Maybe Bool
open_profile_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"open_profile"
InternalLinkType -> Parser InternalLinkType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InternalLinkType -> Parser InternalLinkType)
-> InternalLinkType -> Parser InternalLinkType
forall a b. (a -> b) -> a -> b
$ InternalLinkTypePublicChat
{ chat_username :: Maybe Text
chat_username = Maybe Text
chat_username_
, draft_text :: Maybe Text
draft_text = Maybe Text
draft_text_
, open_profile :: Maybe Bool
open_profile = Maybe Bool
open_profile_
}
parseInternalLinkTypeStickerSet :: A.Value -> AT.Parser InternalLinkType
parseInternalLinkTypeStickerSet :: Value -> Parser InternalLinkType
parseInternalLinkTypeStickerSet = String
-> (Object -> Parser InternalLinkType)
-> Value
-> Parser InternalLinkType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InternalLinkTypeStickerSet" ((Object -> Parser InternalLinkType)
-> Value -> Parser InternalLinkType)
-> (Object -> Parser InternalLinkType)
-> Value
-> Parser InternalLinkType
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Text
sticker_set_name_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"sticker_set_name"
Maybe Bool
expect_custom_emoji_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"expect_custom_emoji"
InternalLinkType -> Parser InternalLinkType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InternalLinkType -> Parser InternalLinkType)
-> InternalLinkType -> Parser InternalLinkType
forall a b. (a -> b) -> a -> b
$ InternalLinkTypeStickerSet
{ sticker_set_name :: Maybe Text
sticker_set_name = Maybe Text
sticker_set_name_
, expect_custom_emoji :: Maybe Bool
expect_custom_emoji = Maybe Bool
expect_custom_emoji_
}
parseInternalLinkTypeStory :: A.Value -> AT.Parser InternalLinkType
parseInternalLinkTypeStory :: Value -> Parser InternalLinkType
parseInternalLinkTypeStory = String
-> (Object -> Parser InternalLinkType)
-> Value
-> Parser InternalLinkType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InternalLinkTypeStory" ((Object -> Parser InternalLinkType)
-> Value -> Parser InternalLinkType)
-> (Object -> Parser InternalLinkType)
-> Value
-> Parser InternalLinkType
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Text
story_sender_username_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"story_sender_username"
Maybe Int
story_id_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"story_id"
InternalLinkType -> Parser InternalLinkType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InternalLinkType -> Parser InternalLinkType)
-> InternalLinkType -> Parser InternalLinkType
forall a b. (a -> b) -> a -> b
$ InternalLinkTypeStory
{ story_sender_username :: Maybe Text
story_sender_username = Maybe Text
story_sender_username_
, story_id :: Maybe Int
story_id = Maybe Int
story_id_
}
parseInternalLinkTypeTheme :: A.Value -> AT.Parser InternalLinkType
parseInternalLinkTypeTheme :: Value -> Parser InternalLinkType
parseInternalLinkTypeTheme = String
-> (Object -> Parser InternalLinkType)
-> Value
-> Parser InternalLinkType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InternalLinkTypeTheme" ((Object -> Parser InternalLinkType)
-> Value -> Parser InternalLinkType)
-> (Object -> Parser InternalLinkType)
-> Value
-> Parser InternalLinkType
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Text
theme_name_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"theme_name"
InternalLinkType -> Parser InternalLinkType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InternalLinkType -> Parser InternalLinkType)
-> InternalLinkType -> Parser InternalLinkType
forall a b. (a -> b) -> a -> b
$ InternalLinkTypeTheme
{ theme_name :: Maybe Text
theme_name = Maybe Text
theme_name_
}
parseInternalLinkTypeUnknownDeepLink :: A.Value -> AT.Parser InternalLinkType
parseInternalLinkTypeUnknownDeepLink :: Value -> Parser InternalLinkType
parseInternalLinkTypeUnknownDeepLink = String
-> (Object -> Parser InternalLinkType)
-> Value
-> Parser InternalLinkType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InternalLinkTypeUnknownDeepLink" ((Object -> Parser InternalLinkType)
-> Value -> Parser InternalLinkType)
-> (Object -> Parser InternalLinkType)
-> Value
-> Parser InternalLinkType
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Text
link_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"link"
InternalLinkType -> Parser InternalLinkType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InternalLinkType -> Parser InternalLinkType)
-> InternalLinkType -> Parser InternalLinkType
forall a b. (a -> b) -> a -> b
$ InternalLinkTypeUnknownDeepLink
{ link :: Maybe Text
link = Maybe Text
link_
}
parseInternalLinkTypeUserPhoneNumber :: A.Value -> AT.Parser InternalLinkType
parseInternalLinkTypeUserPhoneNumber :: Value -> Parser InternalLinkType
parseInternalLinkTypeUserPhoneNumber = String
-> (Object -> Parser InternalLinkType)
-> Value
-> Parser InternalLinkType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InternalLinkTypeUserPhoneNumber" ((Object -> Parser InternalLinkType)
-> Value -> Parser InternalLinkType)
-> (Object -> Parser InternalLinkType)
-> Value
-> Parser InternalLinkType
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Text
phone_number_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"phone_number"
Maybe Text
draft_text_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"draft_text"
Maybe Bool
open_profile_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"open_profile"
InternalLinkType -> Parser InternalLinkType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InternalLinkType -> Parser InternalLinkType)
-> InternalLinkType -> Parser InternalLinkType
forall a b. (a -> b) -> a -> b
$ InternalLinkTypeUserPhoneNumber
{ phone_number :: Maybe Text
phone_number = Maybe Text
phone_number_
, draft_text :: Maybe Text
draft_text = Maybe Text
draft_text_
, open_profile :: Maybe Bool
open_profile = Maybe Bool
open_profile_
}
parseInternalLinkTypeUserToken :: A.Value -> AT.Parser InternalLinkType
parseInternalLinkTypeUserToken :: Value -> Parser InternalLinkType
parseInternalLinkTypeUserToken = String
-> (Object -> Parser InternalLinkType)
-> Value
-> Parser InternalLinkType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InternalLinkTypeUserToken" ((Object -> Parser InternalLinkType)
-> Value -> Parser InternalLinkType)
-> (Object -> Parser InternalLinkType)
-> Value
-> Parser InternalLinkType
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Text
token_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"token"
InternalLinkType -> Parser InternalLinkType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InternalLinkType -> Parser InternalLinkType)
-> InternalLinkType -> Parser InternalLinkType
forall a b. (a -> b) -> a -> b
$ InternalLinkTypeUserToken
{ token :: Maybe Text
token = Maybe Text
token_
}
parseInternalLinkTypeVideoChat :: A.Value -> AT.Parser InternalLinkType
parseInternalLinkTypeVideoChat :: Value -> Parser InternalLinkType
parseInternalLinkTypeVideoChat = String
-> (Object -> Parser InternalLinkType)
-> Value
-> Parser InternalLinkType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InternalLinkTypeVideoChat" ((Object -> Parser InternalLinkType)
-> Value -> Parser InternalLinkType)
-> (Object -> Parser InternalLinkType)
-> Value
-> Parser InternalLinkType
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Text
chat_username_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"chat_username"
Maybe Text
invite_hash_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"invite_hash"
Maybe Bool
is_live_stream_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"is_live_stream"
InternalLinkType -> Parser InternalLinkType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InternalLinkType -> Parser InternalLinkType)
-> InternalLinkType -> Parser InternalLinkType
forall a b. (a -> b) -> a -> b
$ InternalLinkTypeVideoChat
{ chat_username :: Maybe Text
chat_username = Maybe Text
chat_username_
, invite_hash :: Maybe Text
invite_hash = Maybe Text
invite_hash_
, is_live_stream :: Maybe Bool
is_live_stream = Maybe Bool
is_live_stream_
}
parseInternalLinkTypeWebApp :: A.Value -> AT.Parser InternalLinkType
parseInternalLinkTypeWebApp :: Value -> Parser InternalLinkType
parseInternalLinkTypeWebApp = String
-> (Object -> Parser InternalLinkType)
-> Value
-> Parser InternalLinkType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"InternalLinkTypeWebApp" ((Object -> Parser InternalLinkType)
-> Value -> Parser InternalLinkType)
-> (Object -> Parser InternalLinkType)
-> Value
-> Parser InternalLinkType
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Text
bot_username_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"bot_username"
Maybe Text
web_app_short_name_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"web_app_short_name"
Maybe Text
start_parameter_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"start_parameter"
Maybe WebAppOpenMode
mode_ <- Object
o Object -> Key -> Parser (Maybe WebAppOpenMode)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"mode"
InternalLinkType -> Parser InternalLinkType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (InternalLinkType -> Parser InternalLinkType)
-> InternalLinkType -> Parser InternalLinkType
forall a b. (a -> b) -> a -> b
$ InternalLinkTypeWebApp
{ bot_username :: Maybe Text
bot_username = Maybe Text
bot_username_
, web_app_short_name :: Maybe Text
web_app_short_name = Maybe Text
web_app_short_name_
, start_parameter :: Maybe Text
start_parameter = Maybe Text
start_parameter_
, mode :: Maybe WebAppOpenMode
mode = Maybe WebAppOpenMode
mode_
}
parseJSON Value
_ = Parser InternalLinkType
forall a. Monoid a => a
mempty
instance AT.ToJSON InternalLinkType where
toJSON :: InternalLinkType -> Value
toJSON InternalLinkType
InternalLinkTypeActiveSessions
= [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
"internalLinkTypeActiveSessions"
]
toJSON InternalLinkTypeAttachmentMenuBot
{ target_chat :: InternalLinkType -> Maybe TargetChat
target_chat = Maybe TargetChat
target_chat_
, bot_username :: InternalLinkType -> Maybe Text
bot_username = Maybe Text
bot_username_
, url :: InternalLinkType -> Maybe Text
url = Maybe Text
url_
}
= [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
"internalLinkTypeAttachmentMenuBot"
, Key
"target_chat" Key -> Maybe TargetChat -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe TargetChat
target_chat_
, Key
"bot_username" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
bot_username_
, Key
"url" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
url_
]
toJSON InternalLinkTypeAuthenticationCode
{ code :: InternalLinkType -> Maybe Text
code = Maybe Text
code_
}
= [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
"internalLinkTypeAuthenticationCode"
, Key
"code" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
code_
]
toJSON InternalLinkTypeBackground
{ background_name :: InternalLinkType -> Maybe Text
background_name = Maybe Text
background_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
"internalLinkTypeBackground"
, Key
"background_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
background_name_
]
toJSON InternalLinkTypeBotAddToChannel
{ bot_username :: InternalLinkType -> Maybe Text
bot_username = Maybe Text
bot_username_
, administrator_rights :: InternalLinkType -> Maybe ChatAdministratorRights
administrator_rights = Maybe ChatAdministratorRights
administrator_rights_
}
= [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
"internalLinkTypeBotAddToChannel"
, Key
"bot_username" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
bot_username_
, Key
"administrator_rights" Key -> Maybe ChatAdministratorRights -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe ChatAdministratorRights
administrator_rights_
]
toJSON InternalLinkTypeBotStart
{ bot_username :: InternalLinkType -> Maybe Text
bot_username = Maybe Text
bot_username_
, start_parameter :: InternalLinkType -> Maybe Text
start_parameter = Maybe Text
start_parameter_
, autostart :: InternalLinkType -> Maybe Bool
autostart = Maybe Bool
autostart_
}
= [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
"internalLinkTypeBotStart"
, Key
"bot_username" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
bot_username_
, Key
"start_parameter" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
start_parameter_
, Key
"autostart" Key -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Bool
autostart_
]
toJSON InternalLinkTypeBotStartInGroup
{ bot_username :: InternalLinkType -> Maybe Text
bot_username = Maybe Text
bot_username_
, start_parameter :: InternalLinkType -> Maybe Text
start_parameter = Maybe Text
start_parameter_
, administrator_rights :: InternalLinkType -> Maybe ChatAdministratorRights
administrator_rights = Maybe ChatAdministratorRights
administrator_rights_
}
= [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
"internalLinkTypeBotStartInGroup"
, Key
"bot_username" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
bot_username_
, Key
"start_parameter" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
start_parameter_
, Key
"administrator_rights" Key -> Maybe ChatAdministratorRights -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe ChatAdministratorRights
administrator_rights_
]
toJSON InternalLinkTypeBusinessChat
{ link_name :: InternalLinkType -> Maybe Text
link_name = Maybe Text
link_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
"internalLinkTypeBusinessChat"
, Key
"link_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
link_name_
]
toJSON InternalLinkTypeBuyStars
{ star_count :: InternalLinkType -> Maybe Int
star_count = Maybe Int
star_count_
, purpose :: InternalLinkType -> Maybe Text
purpose = Maybe Text
purpose_
}
= [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
"internalLinkTypeBuyStars"
, Key
"star_count" Key -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Int
star_count_
, Key
"purpose" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
purpose_
]
toJSON InternalLinkType
InternalLinkTypeChangePhoneNumber
= [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
"internalLinkTypeChangePhoneNumber"
]
toJSON InternalLinkTypeChatAffiliateProgram
{ username :: InternalLinkType -> Maybe Text
username = Maybe Text
username_
, referrer :: InternalLinkType -> Maybe Text
referrer = Maybe Text
referrer_
}
= [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
"internalLinkTypeChatAffiliateProgram"
, Key
"username" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
username_
, Key
"referrer" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
referrer_
]
toJSON InternalLinkTypeChatBoost
{ url :: InternalLinkType -> Maybe Text
url = Maybe Text
url_
}
= [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
"internalLinkTypeChatBoost"
, Key
"url" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
url_
]
toJSON InternalLinkTypeChatFolderInvite
{ invite_link :: InternalLinkType -> 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
"internalLinkTypeChatFolderInvite"
, 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_
]
toJSON InternalLinkType
InternalLinkTypeChatFolderSettings
= [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
"internalLinkTypeChatFolderSettings"
]
toJSON InternalLinkTypeChatInvite
{ invite_link :: InternalLinkType -> 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
"internalLinkTypeChatInvite"
, 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_
]
toJSON InternalLinkType
InternalLinkTypeDefaultMessageAutoDeleteTimerSettings
= [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
"internalLinkTypeDefaultMessageAutoDeleteTimerSettings"
]
toJSON InternalLinkType
InternalLinkTypeEditProfileSettings
= [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
"internalLinkTypeEditProfileSettings"
]
toJSON InternalLinkTypeGame
{ bot_username :: InternalLinkType -> Maybe Text
bot_username = Maybe Text
bot_username_
, game_short_name :: InternalLinkType -> Maybe Text
game_short_name = Maybe Text
game_short_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
"internalLinkTypeGame"
, Key
"bot_username" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
bot_username_
, Key
"game_short_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
game_short_name_
]
toJSON InternalLinkTypeInstantView
{ url :: InternalLinkType -> Maybe Text
url = Maybe Text
url_
, fallback_url :: InternalLinkType -> Maybe Text
fallback_url = Maybe Text
fallback_url_
}
= [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
"internalLinkTypeInstantView"
, Key
"url" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
url_
, Key
"fallback_url" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
fallback_url_
]
toJSON InternalLinkTypeInvoice
{ invoice_name :: InternalLinkType -> Maybe Text
invoice_name = Maybe Text
invoice_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
"internalLinkTypeInvoice"
, Key
"invoice_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
invoice_name_
]
toJSON InternalLinkTypeLanguagePack
{ language_pack_id :: InternalLinkType -> Maybe Text
language_pack_id = Maybe Text
language_pack_id_
}
= [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
"internalLinkTypeLanguagePack"
, Key
"language_pack_id" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
language_pack_id_
]
toJSON InternalLinkType
InternalLinkTypeLanguageSettings
= [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
"internalLinkTypeLanguageSettings"
]
toJSON InternalLinkTypeMainWebApp
{ bot_username :: InternalLinkType -> Maybe Text
bot_username = Maybe Text
bot_username_
, start_parameter :: InternalLinkType -> Maybe Text
start_parameter = Maybe Text
start_parameter_
, mode :: InternalLinkType -> Maybe WebAppOpenMode
mode = Maybe WebAppOpenMode
mode_
}
= [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
"internalLinkTypeMainWebApp"
, Key
"bot_username" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
bot_username_
, Key
"start_parameter" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
start_parameter_
, Key
"mode" Key -> Maybe WebAppOpenMode -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe WebAppOpenMode
mode_
]
toJSON InternalLinkTypeMessage
{ url :: InternalLinkType -> Maybe Text
url = Maybe Text
url_
}
= [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
"internalLinkTypeMessage"
, Key
"url" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
url_
]
toJSON InternalLinkTypeMessageDraft
{ text :: InternalLinkType -> Maybe FormattedText
text = Maybe FormattedText
text_
, contains_link :: InternalLinkType -> Maybe Bool
contains_link = Maybe Bool
contains_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
"internalLinkTypeMessageDraft"
, Key
"text" Key -> Maybe FormattedText -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe FormattedText
text_
, Key
"contains_link" Key -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Bool
contains_link_
]
toJSON InternalLinkTypePassportDataRequest
{ bot_user_id :: InternalLinkType -> Maybe Int
bot_user_id = Maybe Int
bot_user_id_
, scope :: InternalLinkType -> Maybe Text
scope = Maybe Text
scope_
, public_key :: InternalLinkType -> Maybe Text
public_key = Maybe Text
public_key_
, nonce :: InternalLinkType -> Maybe Text
nonce = Maybe Text
nonce_
, callback_url :: InternalLinkType -> Maybe Text
callback_url = Maybe Text
callback_url_
}
= [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
"internalLinkTypePassportDataRequest"
, Key
"bot_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
bot_user_id_
, Key
"scope" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
scope_
, Key
"public_key" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
public_key_
, Key
"nonce" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
nonce_
, Key
"callback_url" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
callback_url_
]
toJSON InternalLinkTypePhoneNumberConfirmation
{ hash :: InternalLinkType -> Maybe Text
hash = Maybe Text
hash_
, phone_number :: InternalLinkType -> Maybe Text
phone_number = Maybe Text
phone_number_
}
= [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
"internalLinkTypePhoneNumberConfirmation"
, Key
"hash" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
hash_
, Key
"phone_number" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
phone_number_
]
toJSON InternalLinkTypePremiumFeatures
{ referrer :: InternalLinkType -> Maybe Text
referrer = Maybe Text
referrer_
}
= [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
"internalLinkTypePremiumFeatures"
, Key
"referrer" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
referrer_
]
toJSON InternalLinkTypePremiumGift
{ referrer :: InternalLinkType -> Maybe Text
referrer = Maybe Text
referrer_
}
= [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
"internalLinkTypePremiumGift"
, Key
"referrer" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
referrer_
]
toJSON InternalLinkTypePremiumGiftCode
{ code :: InternalLinkType -> Maybe Text
code = Maybe Text
code_
}
= [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
"internalLinkTypePremiumGiftCode"
, Key
"code" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
code_
]
toJSON InternalLinkType
InternalLinkTypePrivacyAndSecuritySettings
= [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
"internalLinkTypePrivacyAndSecuritySettings"
]
toJSON InternalLinkTypeProxy
{ server :: InternalLinkType -> Maybe Text
server = Maybe Text
server_
, port :: InternalLinkType -> Maybe Int
port = Maybe Int
port_
, _type :: InternalLinkType -> Maybe ProxyType
_type = Maybe ProxyType
_type_
}
= [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
"internalLinkTypeProxy"
, Key
"server" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
server_
, Key
"port" Key -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Int
port_
, Key
"type" Key -> Maybe ProxyType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe ProxyType
_type_
]
toJSON InternalLinkTypePublicChat
{ chat_username :: InternalLinkType -> Maybe Text
chat_username = Maybe Text
chat_username_
, draft_text :: InternalLinkType -> Maybe Text
draft_text = Maybe Text
draft_text_
, open_profile :: InternalLinkType -> Maybe Bool
open_profile = Maybe Bool
open_profile_
}
= [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
"internalLinkTypePublicChat"
, Key
"chat_username" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
chat_username_
, Key
"draft_text" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
draft_text_
, Key
"open_profile" Key -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Bool
open_profile_
]
toJSON InternalLinkType
InternalLinkTypeQrCodeAuthentication
= [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
"internalLinkTypeQrCodeAuthentication"
]
toJSON InternalLinkType
InternalLinkTypeRestorePurchases
= [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
"internalLinkTypeRestorePurchases"
]
toJSON InternalLinkType
InternalLinkTypeSettings
= [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
"internalLinkTypeSettings"
]
toJSON InternalLinkTypeStickerSet
{ sticker_set_name :: InternalLinkType -> Maybe Text
sticker_set_name = Maybe Text
sticker_set_name_
, expect_custom_emoji :: InternalLinkType -> Maybe Bool
expect_custom_emoji = Maybe Bool
expect_custom_emoji_
}
= [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
"internalLinkTypeStickerSet"
, Key
"sticker_set_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
sticker_set_name_
, Key
"expect_custom_emoji" Key -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Bool
expect_custom_emoji_
]
toJSON InternalLinkTypeStory
{ story_sender_username :: InternalLinkType -> Maybe Text
story_sender_username = Maybe Text
story_sender_username_
, story_id :: InternalLinkType -> Maybe Int
story_id = Maybe Int
story_id_
}
= [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
"internalLinkTypeStory"
, Key
"story_sender_username" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
story_sender_username_
, Key
"story_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
story_id_
]
toJSON InternalLinkTypeTheme
{ theme_name :: InternalLinkType -> Maybe Text
theme_name = Maybe Text
theme_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
"internalLinkTypeTheme"
, Key
"theme_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
theme_name_
]
toJSON InternalLinkType
InternalLinkTypeThemeSettings
= [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
"internalLinkTypeThemeSettings"
]
toJSON InternalLinkTypeUnknownDeepLink
{ link :: InternalLinkType -> Maybe Text
link = Maybe Text
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
"internalLinkTypeUnknownDeepLink"
, Key
"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
link_
]
toJSON InternalLinkType
InternalLinkTypeUnsupportedProxy
= [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
"internalLinkTypeUnsupportedProxy"
]
toJSON InternalLinkTypeUserPhoneNumber
{ phone_number :: InternalLinkType -> Maybe Text
phone_number = Maybe Text
phone_number_
, draft_text :: InternalLinkType -> Maybe Text
draft_text = Maybe Text
draft_text_
, open_profile :: InternalLinkType -> Maybe Bool
open_profile = Maybe Bool
open_profile_
}
= [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
"internalLinkTypeUserPhoneNumber"
, Key
"phone_number" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
phone_number_
, Key
"draft_text" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
draft_text_
, Key
"open_profile" Key -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Bool
open_profile_
]
toJSON InternalLinkTypeUserToken
{ token :: InternalLinkType -> Maybe Text
token = Maybe Text
token_
}
= [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
"internalLinkTypeUserToken"
, Key
"token" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
token_
]
toJSON InternalLinkTypeVideoChat
{ chat_username :: InternalLinkType -> Maybe Text
chat_username = Maybe Text
chat_username_
, invite_hash :: InternalLinkType -> Maybe Text
invite_hash = Maybe Text
invite_hash_
, is_live_stream :: InternalLinkType -> Maybe Bool
is_live_stream = Maybe Bool
is_live_stream_
}
= [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
"internalLinkTypeVideoChat"
, Key
"chat_username" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
chat_username_
, Key
"invite_hash" 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_hash_
, Key
"is_live_stream" 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_live_stream_
]
toJSON InternalLinkTypeWebApp
{ bot_username :: InternalLinkType -> Maybe Text
bot_username = Maybe Text
bot_username_
, web_app_short_name :: InternalLinkType -> Maybe Text
web_app_short_name = Maybe Text
web_app_short_name_
, start_parameter :: InternalLinkType -> Maybe Text
start_parameter = Maybe Text
start_parameter_
, mode :: InternalLinkType -> Maybe WebAppOpenMode
mode = Maybe WebAppOpenMode
mode_
}
= [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
"internalLinkTypeWebApp"
, Key
"bot_username" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
bot_username_
, Key
"web_app_short_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
web_app_short_name_
, Key
"start_parameter" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
start_parameter_
, Key
"mode" Key -> Maybe WebAppOpenMode -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe WebAppOpenMode
mode_
]