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.FormattedText as FormattedText
import qualified TD.Data.ProxyType as ProxyType

-- | Describes an internal https://t.me or tg: link, which must be processed by the application in a special way
data InternalLinkType
  = InternalLinkTypeActiveSessions -- ^ The link is a link to the Devices section of the application. Use getActiveSessions to get the list of active sessions and show them to the user
  | InternalLinkTypeAttachmentMenuBot -- ^ The link is a link to an attachment menu bot to be opened in the specified or a chosen chat. Process given target_chat to open the chat. Then, call searchPublicChat with the given bot username, check that the user is a bot and can be added to attachment menu. Then, use getAttachmentMenuBot to receive information about the bot. If the bot isn't added to attachment menu, then show a disclaimer about Mini Apps being third-party applications, ask the user to accept their Terms of service and confirm adding the bot to side and attachment menu. If the user accept the terms and confirms adding, then use toggleBotIsAddedToAttachmentMenu to add the bot. If the attachment menu bot can't be used in the opened chat, show an error to the user. If the bot is added to attachment menu and can be used in the chat, then use openWebApp with the given URL
    { InternalLinkType -> Maybe TargetChat
target_chat  :: Maybe TargetChat.TargetChat -- ^ Target chat to be opened
    , InternalLinkType -> Maybe Text
bot_username :: Maybe T.Text                -- ^ Username of the bot
    , InternalLinkType -> Maybe Text
url          :: Maybe T.Text                -- ^ URL to be passed to openWebApp
    }
  | InternalLinkTypeAuthenticationCode -- ^ The link contains an authentication code. Call checkAuthenticationCode with the code if the current authorization state is authorizationStateWaitCode
    { InternalLinkType -> Maybe Text
code :: Maybe T.Text -- ^ The authentication code
    }
  | InternalLinkTypeBackground -- ^ The link is a link to a background. Call searchBackground with the given background name to process the link. If background is found and the user wants to apply it, then call setDefaultBackground
    { InternalLinkType -> Maybe Text
background_name :: Maybe T.Text -- ^ Name of the background
    }
  | InternalLinkTypeBotAddToChannel -- ^ The link is a link to a Telegram bot, which is expected to be added to a channel chat as an administrator. Call searchPublicChat with the given bot username and check that the user is a bot, ask the current user to select a channel chat to add the bot to as an administrator. Then, call getChatMember to receive the current bot rights in the chat and if the bot already is an administrator, check that the current user can edit its administrator rights and combine received rights with the requested administrator rights. Then, show confirmation box to the user, and call setChatMemberStatus with the chosen chat and confirmed rights
    { bot_username         :: Maybe T.Text                                          -- ^ Username of the bot
    , InternalLinkType -> Maybe ChatAdministratorRights
administrator_rights :: Maybe ChatAdministratorRights.ChatAdministratorRights -- ^ Expected administrator rights for the bot
    }
  | InternalLinkTypeBotStart -- ^ The link is a link to a chat with a Telegram bot. Call searchPublicChat with the given bot username, check that the user is a bot, show START button in the chat with the bot, and then call sendBotStartMessage with the given start parameter after the button is pressed
    { bot_username    :: Maybe T.Text -- ^ Username of the bot
    , InternalLinkType -> Maybe Text
start_parameter :: Maybe T.Text -- ^ The parameter to be passed to sendBotStartMessage
    , InternalLinkType -> Maybe Bool
autostart       :: Maybe Bool   -- ^ True, if sendBotStartMessage must be called automatically without showing the START button
    }
  | InternalLinkTypeBotStartInGroup -- ^ The link is a link to a Telegram bot, which is expected to be added to a group chat. Call searchPublicChat with the given bot username, check that the user is a bot and can be added to groups, ask the current user to select a basic group or a supergroup chat to add the bot to, taking into account that bots can be added to a public supergroup only by administrators of the supergroup. If administrator rights are provided by the link, call getChatMember to receive the current bot rights in the chat and if the bot already is an administrator, check that the current user can edit its administrator rights, combine received rights with the requested administrator rights, show confirmation box to the user, and call setChatMemberStatus with the chosen chat and confirmed administrator rights. Before call to setChatMemberStatus it may be required to upgrade the chosen basic group chat to a supergroup chat. Then, if start_parameter isn't empty, call sendBotStartMessage with the given start parameter and the chosen chat; otherwise, just send /start message with bot's username added to the chat
    { bot_username         :: Maybe T.Text                                          -- ^ Username of the bot
    , start_parameter      :: Maybe T.Text                                          -- ^ The parameter to be passed to sendBotStartMessage
    , administrator_rights :: Maybe ChatAdministratorRights.ChatAdministratorRights -- ^ Expected administrator rights for the bot; may be null
    }
  | InternalLinkTypeBusinessChat -- ^ The link is a link to a business chat. Use getBusinessChatLinkInfo with the provided link name to get information about the link, then open received private chat and replace chat draft with the provided text
    { InternalLinkType -> Maybe Text
link_name :: Maybe T.Text -- ^ Name of the link
    }
  | InternalLinkTypeBuyStars -- ^ The link is a link to the Telegram Star purchase section of the application
    { InternalLinkType -> Maybe Int
star_count :: Maybe Int    -- ^ The number of Telegram Stars that must be owned by the user
    , InternalLinkType -> Maybe Text
purpose    :: Maybe T.Text -- ^ Purpose of Telegram Star purchase. Arbitrary string specified by the server, for example, "subs" if the Telegram Stars are required to extend channel subscriptions
    }
  | InternalLinkTypeChangePhoneNumber -- ^ The link is a link to the change phone number section of the application
  | InternalLinkTypeChatBoost -- ^ The link is a link to boost a Telegram chat. Call getChatBoostLinkInfo with the given URL to process the link. If the chat is found, then call getChatBoostStatus and getAvailableChatBoostSlots to get the current boost status and check whether the chat can be boosted. If the user wants to boost the chat and the chat can be boosted, then call boostChat
    { url :: Maybe T.Text -- ^ URL to be passed to getChatBoostLinkInfo
    }
  | InternalLinkTypeChatFolderInvite -- ^ The link is an invite link to a chat folder. Call checkChatFolderInviteLink with the given invite link to process the link. If the link is valid and the user wants to join the chat folder, then call addChatFolderByInviteLink
    { InternalLinkType -> Maybe Text
invite_link :: Maybe T.Text -- ^ Internal representation of the invite link
    }
  | InternalLinkTypeChatFolderSettings -- ^ The link is a link to the folder section of the application settings
  | InternalLinkTypeChatInvite -- ^ The link is a chat invite link. Call checkChatInviteLink with the given invite link to process the link. If the link is valid and the user wants to join the chat, then call joinChatByInviteLink
    { invite_link :: Maybe T.Text -- ^ Internal representation of the invite link
    }
  | InternalLinkTypeDefaultMessageAutoDeleteTimerSettings -- ^ The link is a link to the default message auto-delete timer settings section of the application settings
  | InternalLinkTypeEditProfileSettings -- ^ The link is a link to the edit profile section of the application settings
  | InternalLinkTypeGame -- ^ The link is a link to a game. Call searchPublicChat with the given bot username, check that the user is a bot, ask the current user to select a chat to send the game, and then call sendMessage with inputMessageGame
    { bot_username    :: Maybe T.Text -- ^ Username of the bot that owns the game
    , InternalLinkType -> Maybe Text
game_short_name :: Maybe T.Text -- ^ Short name of the game
    }
  | InternalLinkTypeInstantView -- ^ The link must be opened in an Instant View. Call getWebPageInstantView with the given URL to process the link. If Instant View is found, then show it, otherwise, open the fallback URL in an external browser
    { url          :: Maybe T.Text -- ^ URL to be passed to getWebPageInstantView
    , InternalLinkType -> Maybe Text
fallback_url :: Maybe T.Text -- ^ An URL to open if getWebPageInstantView fails
    }
  | InternalLinkTypeInvoice -- ^ The link is a link to an invoice. Call getPaymentForm with the given invoice name to process the link
    { InternalLinkType -> Maybe Text
invoice_name :: Maybe T.Text -- ^ Name of the invoice
    }
  | InternalLinkTypeLanguagePack -- ^ The link is a link to a language pack. Call getLanguagePackInfo with the given language pack identifier to process the link. If the language pack is found and the user wants to apply it, then call setOption for the option "language_pack_id"
    { InternalLinkType -> Maybe Text
language_pack_id :: Maybe T.Text -- ^ Language pack identifier
    }
  | InternalLinkTypeLanguageSettings -- ^ The link is a link to the language section of the application settings
  | InternalLinkTypeMainWebApp -- ^ The link is a link to the main Web App of a bot. Call searchPublicChat with the given bot username, check that the user is a bot and has the main Web App. If the bot can be added to attachment menu, then use getAttachmentMenuBot to receive information about the bot, then if the bot isn't added to side menu, show a disclaimer about Mini Apps being third-party applications, ask the user to accept their Terms of service and confirm adding the bot to side and attachment menu, then if the user accepts the terms and confirms adding, use toggleBotIsAddedToAttachmentMenu to add the bot. Then, use getMainWebApp with the given start parameter and open the returned URL as a Web App
    { bot_username    :: Maybe T.Text -- ^ Username of the bot
    , start_parameter :: Maybe T.Text -- ^ Start parameter to be passed to getMainWebApp
    , InternalLinkType -> Maybe Bool
is_compact      :: Maybe Bool   -- ^ True, if the Web App must be opened in the compact mode instead of the full-size mode
    }
  | InternalLinkTypeMessage -- ^ The link is a link to a Telegram message or a forum topic. Call getMessageLinkInfo with the given URL to process the link, and then open received forum topic or chat and show the message there
    { url :: Maybe T.Text -- ^ URL to be passed to getMessageLinkInfo
    }
  | InternalLinkTypeMessageDraft -- ^ The link contains a message draft text. A share screen needs to be shown to the user, then the chosen chat must be opened and the text is added to the input field
    { InternalLinkType -> Maybe FormattedText
text          :: Maybe FormattedText.FormattedText -- ^ Message draft text
    , InternalLinkType -> Maybe Bool
contains_link :: Maybe Bool                        -- ^ True, if the first line of the text contains a link. If true, the input field needs to be focused and the text after the link must be selected
    }
  | InternalLinkTypePassportDataRequest -- ^ The link contains a request of Telegram passport data. Call getPassportAuthorizationForm with the given parameters to process the link if the link was received from outside of the application; otherwise, ignore it
    { InternalLinkType -> Maybe Int
bot_user_id  :: Maybe Int    -- ^ User identifier of the service's bot; the corresponding user may be unknown yet
    , InternalLinkType -> Maybe Text
scope        :: Maybe T.Text -- ^ Telegram Passport element types requested by the service
    , InternalLinkType -> Maybe Text
public_key   :: Maybe T.Text -- ^ Service's public key
    , InternalLinkType -> Maybe Text
nonce        :: Maybe T.Text -- ^ Unique request identifier provided by the service
    , InternalLinkType -> Maybe Text
callback_url :: Maybe T.Text -- ^ An HTTP URL to open once the request is finished, canceled, or failed with the parameters tg_passport=success, tg_passport=cancel, or tg_passport=error&error=... respectively. If empty, then onActivityResult method must be used to return response on Android, or the link tgbot{bot_user_id}://passport/success or tgbot{bot_user_id}://passport/cancel must be opened otherwise
    }
  | InternalLinkTypePhoneNumberConfirmation -- ^ The link can be used to confirm ownership of a phone number to prevent account deletion. Call sendPhoneNumberCode with the given phone number and with phoneNumberCodeTypeConfirmOwnership with the given hash to process the link. If succeeded, call checkPhoneNumberCode to check entered by the user code, or resendPhoneNumberCode to resend it
    { InternalLinkType -> Maybe Text
hash         :: Maybe T.Text -- ^ Hash value from the link
    , InternalLinkType -> Maybe Text
phone_number :: Maybe T.Text -- ^ Phone number value from the link
    }
  | InternalLinkTypePremiumFeatures -- ^ The link is a link to the Premium features screen of the application from which the user can subscribe to Telegram Premium. Call getPremiumFeatures with the given referrer to process the link
    { InternalLinkType -> Maybe Text
referrer :: Maybe T.Text -- ^ Referrer specified in the link
    }
  | InternalLinkTypePremiumGift -- ^ The link is a link to the screen for gifting Telegram Premium subscriptions to friends via inputInvoiceTelegram payments or in-store purchases
    { referrer :: Maybe T.Text -- ^ Referrer specified in the link
    }
  | InternalLinkTypePremiumGiftCode -- ^ The link is a link with a Telegram Premium gift code. Call checkPremiumGiftCode with the given code to process the link. If the code is valid and the user wants to apply it, then call applyPremiumGiftCode
    { code :: Maybe T.Text -- ^ The Telegram Premium gift code
    }
  | InternalLinkTypePrivacyAndSecuritySettings -- ^ The link is a link to the privacy and security section of the application settings
  | InternalLinkTypeProxy -- ^ The link is a link to a proxy. Call addProxy with the given parameters to process the link and add the proxy
    { InternalLinkType -> Maybe Text
server :: Maybe T.Text              -- ^ Proxy server domain or IP address
    , InternalLinkType -> Maybe Int
port   :: Maybe Int                 -- ^ Proxy server port
    , InternalLinkType -> Maybe ProxyType
_type  :: Maybe ProxyType.ProxyType -- ^ Type of the proxy
    }
  | InternalLinkTypePublicChat -- ^ The link is a link to a chat by its username. Call searchPublicChat with the given chat username to process the link. If the chat is found, open its profile information screen or the chat itself. If draft text isn't empty and the chat is a private chat with a regular user, then put the draft text in the input field
    { InternalLinkType -> Maybe Text
chat_username :: Maybe T.Text -- ^ Username of the chat
    , InternalLinkType -> Maybe Text
draft_text    :: Maybe T.Text -- ^ Draft text for message to send in the chat
    , InternalLinkType -> Maybe Bool
open_profile  :: Maybe Bool   -- ^ True, if chat profile information screen must be opened; otherwise, the chat itself must be opened
    }
  | InternalLinkTypeQrCodeAuthentication -- ^ The link can be used to login the current user on another device, but it must be scanned from QR-code using in-app camera. An alert similar to "This code can be used to allow someone to log in to your Telegram account. To confirm Telegram login, please go to Settings > Devices > Scan QR and scan the code" needs to be shown
  | InternalLinkTypeRestorePurchases -- ^ The link forces restore of App Store purchases when opened. For official iOS application only
  | InternalLinkTypeSettings -- ^ The link is a link to application settings
  | InternalLinkTypeStickerSet -- ^ The link is a link to a sticker set. Call searchStickerSet with the given sticker set name to process the link and show the sticker set. If the sticker set is found and the user wants to add it, then call changeStickerSet
    { InternalLinkType -> Maybe Text
sticker_set_name    :: Maybe T.Text -- ^ Name of the sticker set
    , InternalLinkType -> Maybe Bool
expect_custom_emoji :: Maybe Bool   -- ^ True, if the sticker set is expected to contain custom emoji
    }
  | InternalLinkTypeStory -- ^ The link is a link to a story. Call searchPublicChat with the given sender username, then call getStory with the received chat identifier and the given story identifier, then show the story if received
    { InternalLinkType -> Maybe Text
story_sender_username :: Maybe T.Text -- ^ Username of the sender of the story
    , InternalLinkType -> Maybe Int
story_id              :: Maybe Int    -- ^ Story identifier
    }
  | InternalLinkTypeTheme -- ^ The link is a link to a cloud theme. TDLib has no theme support yet
    { InternalLinkType -> Maybe Text
theme_name :: Maybe T.Text -- ^ Name of the theme
    }
  | InternalLinkTypeThemeSettings -- ^ The link is a link to the theme section of the application settings
  | InternalLinkTypeUnknownDeepLink -- ^ The link is an unknown tg: link. Call getDeepLinkInfo to process the link
    { InternalLinkType -> Maybe Text
link :: Maybe T.Text -- ^ Link to be passed to getDeepLinkInfo
    }
  | InternalLinkTypeUnsupportedProxy -- ^ The link is a link to an unsupported proxy. An alert can be shown to the user
  | InternalLinkTypeUserPhoneNumber -- ^ The link is a link to a user by its phone number. Call searchUserByPhoneNumber with the given phone number to process the link. If the user is found, then call createPrivateChat and open user's profile information screen or the chat itself. If draft text isn't empty, then put the draft text in the input field
    { phone_number :: Maybe T.Text -- ^ Phone number of the user
    , draft_text   :: Maybe T.Text -- ^ Draft text for message to send in the chat
    , open_profile :: Maybe Bool   -- ^ True, if user's profile information screen must be opened; otherwise, the chat itself must be opened
    }
  | InternalLinkTypeUserToken -- ^ The link is a link to a user by a temporary token. Call searchUserByToken with the given token to process the link. If the user is found, then call createPrivateChat and open the chat
    { InternalLinkType -> Maybe Text
token :: Maybe T.Text -- ^ The token
    }
  | InternalLinkTypeVideoChat -- ^ The link is a link to a video chat. Call searchPublicChat with the given chat username, and then joinGroupCall with the given invite hash to process the link
    { chat_username  :: Maybe T.Text -- ^ Username of the chat with the video chat
    , InternalLinkType -> Maybe Text
invite_hash    :: Maybe T.Text -- ^ If non-empty, invite hash to be used to join the video chat without being muted by administrators
    , InternalLinkType -> Maybe Bool
is_live_stream :: Maybe Bool   -- ^ True, if the video chat is expected to be a live stream in a channel or a broadcast group
    }
  | InternalLinkTypeWebApp -- ^ The link is a link to a Web App. Call searchPublicChat with the given bot username, check that the user is a bot, then call searchWebApp with the received bot and the given web_app_short_name. Process received foundWebApp by showing a confirmation dialog if needed. If the bot can be added to attachment or side menu, but isn't added yet, then show a disclaimer about Mini Apps being third-party applications instead of the dialog and ask the user to accept their Terms of service. If the user accept the terms and confirms adding, then use toggleBotIsAddedToAttachmentMenu to add the bot. Then, call getWebAppLinkUrl and open the returned URL as a Web App
    { bot_username       :: Maybe T.Text -- ^ Username of the bot that owns the Web App
    , InternalLinkType -> Maybe Text
web_app_short_name :: Maybe T.Text -- ^ Short name of the Web App
    , start_parameter    :: Maybe T.Text -- ^ Start parameter to be passed to getWebAppLinkUrl
    , is_compact         :: Maybe Bool   -- ^ True, if the Web App must be opened in the compact mode instead of the full-size mode
    }
  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 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_
    , is_compact :: InternalLinkType -> Maybe Bool
is_compact      = Maybe Bool
is_compact_
    }
      = 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
"is_compact"      String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
is_compact_
        ]
  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_
    , is_compact :: InternalLinkType -> Maybe Bool
is_compact         = Maybe Bool
is_compact_
    }
      = 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
"is_compact"         String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
is_compact_
        ]

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
"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_
          }
      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 Bool
is_compact_      <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"is_compact"
        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_
          , is_compact :: Maybe Bool
is_compact      = Maybe Bool
is_compact_
          }
      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 Bool
is_compact_         <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"is_compact"
        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_
          , is_compact :: Maybe Bool
is_compact         = Maybe Bool
is_compact_
          }
  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 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_
    , is_compact :: InternalLinkType -> Maybe Bool
is_compact      = Maybe Bool
is_compact_
    }
      = [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
"is_compact"      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_compact_
        ]
  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_
    , is_compact :: InternalLinkType -> Maybe Bool
is_compact         = Maybe Bool
is_compact_
    }
      = [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
"is_compact"         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_compact_
        ]