Skip to content

Commit

Permalink
jvmApiDump and fix of CreateInvoiceLink API bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
InsanusMokrassar committed Dec 6, 2024
1 parent 4343d6d commit 04b2d1d
Show file tree
Hide file tree
Showing 3 changed files with 558 additions and 46 deletions.
39 changes: 35 additions & 4 deletions tgbotapi.api/api/tgbotapi.api.api
Original file line number Diff line number Diff line change
Expand Up @@ -898,6 +898,15 @@ public final class dev/inmo/tgbotapi/extensions/api/edit/media/EditInlineMessage
public static synthetic fun editMessageMedia-FrLM24I$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ljava/lang/String;Ldev/inmo/tgbotapi/types/media/TelegramFreeMedia;Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
}

public final class dev/inmo/tgbotapi/extensions/api/edit/payments/EditUserStarSubscriptionKt {
public static final fun cancelUserStarSubscription-0SkZb-I (Ldev/inmo/tgbotapi/bot/RequestsExecutor;JLjava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static final fun cancelUserStarSubscription-AASCvMI (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/User;Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static final fun editUserStarSubscription-0x-hEcU (Ldev/inmo/tgbotapi/bot/RequestsExecutor;JLjava/lang/String;ZLkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static final fun editUserStarSubscription-TFuYNzM (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/User;Ljava/lang/String;ZLkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static final fun enableUserStarSubscription-0SkZb-I (Ldev/inmo/tgbotapi/bot/RequestsExecutor;JLjava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static final fun enableUserStarSubscription-AASCvMI (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/User;Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
}

public final class dev/inmo/tgbotapi/extensions/api/edit/reply_markup/EditChatMessageReplyMarkupKt {
public static final fun editMessageReplyMarkup-iJMbh4A (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/message/abstracts/AccessibleMessage;Ljava/lang/String;Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static synthetic fun editMessageReplyMarkup-iJMbh4A$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/message/abstracts/AccessibleMessage;Ljava/lang/String;Ldev/inmo/tgbotapi/types/buttons/InlineKeyboardMarkup;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
Expand Down Expand Up @@ -1076,6 +1085,28 @@ public final class dev/inmo/tgbotapi/extensions/api/get/GetUserProfilePhotosKt {
public static synthetic fun getUserProfilePhotos-4iNBclM$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;JLjava/lang/Integer;Ljava/lang/Integer;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
}

public final class dev/inmo/tgbotapi/extensions/api/gifts/GetAvailableGiftsKt {
public static final fun getAvailableGifts (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
}

public final class dev/inmo/tgbotapi/extensions/api/gifts/SendGiftKt {
public static final fun sendGift (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/User;Ldev/inmo/tgbotapi/types/gifts/Gift;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static final fun sendGift (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/User;Ldev/inmo/tgbotapi/types/gifts/Gift;Ljava/util/List;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static final fun sendGift-1FWvrZc (Ldev/inmo/tgbotapi/bot/RequestsExecutor;JLjava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static final fun sendGift-4iNBclM (Ldev/inmo/tgbotapi/bot/RequestsExecutor;JLdev/inmo/tgbotapi/types/gifts/Gift;Ljava/util/List;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static final fun sendGift-GROm3fU (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/User;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static final fun sendGift-WnQQACc (Ldev/inmo/tgbotapi/bot/RequestsExecutor;JLjava/lang/String;Ljava/util/List;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static final fun sendGift-xkmhVIQ (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/User;Ljava/lang/String;Ljava/util/List;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static final fun sendGift-ySMgKnk (Ldev/inmo/tgbotapi/bot/RequestsExecutor;JLdev/inmo/tgbotapi/types/gifts/Gift;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
}

public final class dev/inmo/tgbotapi/extensions/api/inline/SavePreparedInlineMessageKt {
public static final fun savePreparedInlineMessage (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/User;Ldev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/abstracts/InlineQueryResult;ZZZZLkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static synthetic fun savePreparedInlineMessage$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/User;Ldev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/abstracts/InlineQueryResult;ZZZZLkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
public static final fun savePreparedInlineMessage-W2FzMBY (Ldev/inmo/tgbotapi/bot/RequestsExecutor;JLdev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/abstracts/InlineQueryResult;ZZZZLkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static synthetic fun savePreparedInlineMessage-W2FzMBY$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;JLdev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/abstracts/InlineQueryResult;ZZZZLkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
}

public final class dev/inmo/tgbotapi/extensions/api/passport/SetPassportDataErrorsKt {
public static final fun setPassportDataErrors (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/User;Ldev/inmo/tgbotapi/types/passport/PassportData;Ldev/inmo/tgbotapi/utils/passport/Decryptor;Lkotlin/jvm/functions/Function3;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static final fun setPassportDataErrors (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/User;Ljava/util/List;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
Expand Down Expand Up @@ -2120,10 +2151,10 @@ public final class dev/inmo/tgbotapi/extensions/api/send/media/SendVoiceKt {
}

public final class dev/inmo/tgbotapi/extensions/api/send/payments/CreateInvoiceLinkKt {
public static final fun createInvoiceLink (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/util/List;Ljava/lang/Integer;Ljava/util/List;Ljava/lang/String;ZZZZZZZLkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static final fun createInvoiceLink (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/util/List;Ljava/lang/Integer;Ljava/util/List;Ljava/lang/String;ZZZZZZZLkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static synthetic fun createInvoiceLink$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/util/List;Ljava/lang/Integer;Ljava/util/List;Ljava/lang/String;ZZZZZZZLkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
public static synthetic fun createInvoiceLink$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/util/List;Ljava/lang/Integer;Ljava/util/List;Ljava/lang/String;ZZZZZZZLkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
public static final fun createInvoiceLink-1vVIECE (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/util/List;Ljava/lang/String;Lkotlin/time/Duration;Ljava/lang/Integer;Ljava/util/List;Ljava/lang/String;ZZZZZZZLkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static synthetic fun createInvoiceLink-1vVIECE$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/util/List;Ljava/lang/String;Lkotlin/time/Duration;Ljava/lang/Integer;Ljava/util/List;Ljava/lang/String;ZZZZZZZLkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
public static final fun createInvoiceLink-B82mBWQ (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/util/List;Ljava/lang/String;Ljava/lang/Integer;Ljava/util/List;Ljava/lang/String;ZZZZZZZLkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static synthetic fun createInvoiceLink-B82mBWQ$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/util/List;Ljava/lang/String;Ljava/lang/Integer;Ljava/util/List;Ljava/lang/String;ZZZZZZZLkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
}

public final class dev/inmo/tgbotapi/extensions/api/send/payments/RefundStarPaymentKt {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ package dev.inmo.tgbotapi.extensions.api.send.payments

import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.send.payments.CreateInvoiceLink
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.payments.LabeledPrice
import dev.inmo.tgbotapi.types.payments.abstracts.Currency
import dev.inmo.tgbotapi.types.payments.abstracts.XTR
import korlibs.time.TimeSpan

public suspend fun TelegramBot.createInvoiceLink(
title: String,
Expand All @@ -13,6 +15,7 @@ public suspend fun TelegramBot.createInvoiceLink(
providerToken: String,
currency: Currency,
prices: List<LabeledPrice>,
businessConnectionId: BusinessConnectionId? = null,
maxTipAmount: Int? = null,
suggestedTipAmounts: List<Int>? = null,
providerData: String? = null,
Expand All @@ -24,7 +27,26 @@ public suspend fun TelegramBot.createInvoiceLink(
shouldSendEmailToProvider: Boolean = false,
priceDependOnShipAddress: Boolean = false
): String = execute(
CreateInvoiceLink(title, description, payload, providerToken, currency, prices, maxTipAmount, suggestedTipAmounts ?.sorted(), providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress)
CreateInvoiceLink(
title = title,
description = description,
payload = payload,
providerToken = providerToken,
currency = currency,
businessConnectionId = businessConnectionId,
prices = prices,
subscriptionPeriod = null,
maxTipAmount = maxTipAmount,
suggestedTipAmounts = suggestedTipAmounts ?.sorted(),
providerData = providerData,
requireName = requireName,
requirePhoneNumber = requirePhoneNumber,
requireEmail = requireEmail,
requireShippingAddress = requireShippingAddress,
shouldSendPhoneNumberToProvider = shouldSendPhoneNumberToProvider,
shouldSendEmailToProvider = shouldSendEmailToProvider,
priceDependOnShipAddress = priceDependOnShipAddress
)
)

/**
Expand All @@ -35,6 +57,8 @@ public suspend fun TelegramBot.createInvoiceLink(
description: String,
payload: String,
prices: List<LabeledPrice>,
businessConnectionId: BusinessConnectionId? = null,
subscriptionPeriod: TimeSpan? = null,
maxTipAmount: Int? = null,
suggestedTipAmounts: List<Int>? = null,
providerData: String? = null,
Expand All @@ -46,5 +70,24 @@ public suspend fun TelegramBot.createInvoiceLink(
shouldSendEmailToProvider: Boolean = false,
priceDependOnShipAddress: Boolean = false
): String = execute(
CreateInvoiceLink(title, description, payload, null, Currency.XTR, prices, maxTipAmount, suggestedTipAmounts ?.sorted(), providerData, requireName, requirePhoneNumber, requireEmail, requireShippingAddress, shouldSendPhoneNumberToProvider, shouldSendEmailToProvider, priceDependOnShipAddress)
CreateInvoiceLink(
title = title,
description = description,
payload = payload,
providerToken = null,
currency = Currency.XTR,
businessConnectionId = businessConnectionId,
prices = prices,
subscriptionPeriod = subscriptionPeriod,
maxTipAmount = maxTipAmount,
suggestedTipAmounts = suggestedTipAmounts ?.sorted(),
providerData = providerData,
requireName = requireName,
requirePhoneNumber = requirePhoneNumber,
requireEmail = requireEmail,
requireShippingAddress = requireShippingAddress,
shouldSendPhoneNumberToProvider = shouldSendPhoneNumberToProvider,
shouldSendEmailToProvider = shouldSendEmailToProvider,
priceDependOnShipAddress = priceDependOnShipAddress
)
)
Loading

0 comments on commit 04b2d1d

Please sign in to comment.