diff --git a/README.md b/README.md
index 1d5fa680..69d96222 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,7 @@
[](https://codecov.io/gh/pengrad/java-telegram-bot-api)
Java library for interacting with [Telegram Bot API](https://core.telegram.org/bots/api)
-- Full support of all Bot API 8.3 methods
+- Full support of all Bot API 9.0 methods
- Telegram [Passport](https://core.telegram.org/passport) and Decryption API
- Bot [Payments](https://core.telegram.org/bots/payments)
- [Gaming Platform](https://telegram.org/blog/games)
@@ -13,14 +13,14 @@ Java library for interacting with [Telegram Bot API](https://core.telegram.org/b
Gradle:
```groovy
-implementation 'com.github.pengrad:java-telegram-bot-api:8.3.0'
+implementation 'com.github.pengrad:java-telegram-bot-api:9.0.0'
```
Maven:
```xml
com.github.pengrad
java-telegram-bot-api
- 8.3.0
+ 9.0.0
```
[JAR with all dependencies on release page](https://github.com/pengrad/java-telegram-bot-api/releases)
diff --git a/README_RU.md b/README_RU.md
index 44e4b684..fc83a4f6 100644
--- a/README_RU.md
+++ b/README_RU.md
@@ -4,7 +4,7 @@
[](https://codecov.io/gh/pengrad/java-telegram-bot-api)
Java библиотека, созданная для работы с [Telegram Bot API](https://core.telegram.org/bots/api)
-- Полная поддержка всех методов BOT API 8.3
+- Полная поддержка всех методов BOT API 9.0
- Поддержка Telegram [паспорта](https://core.telegram.org/passport) и дешифровки (Decryption API);
- Поддержка [платежей](https://core.telegram.org/bots/payments);
- [Игровая платформа](https://telegram.org/blog/games).
@@ -13,14 +13,14 @@ Java библиотека, созданная для работы с [Telegram B
Gradle:
```groovy
-implementation 'com.github.pengrad:java-telegram-bot-api:8.3.0'
+implementation 'com.github.pengrad:java-telegram-bot-api:9.0.0'
```
Maven:
```xml
com.github.pengrad
java-telegram-bot-api
- 8.3.0
+ 9.0.0
```
Также JAR со всеми зависимостями можно найти [в релизах](https://github.com/pengrad/java-telegram-bot-api/releases).
diff --git a/gradle.properties b/gradle.properties
index 671b7093..eabaeda8 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -1,5 +1,5 @@
GROUP=com.github.pengrad
-VERSION_NAME=8.3.0
+VERSION_NAME=9.0.0
POM_DESCRIPTION=Java API for Telegram Bot API
POM_URL=https://github.com/pengrad/java-telegram-bot-api/
diff --git a/library/src/main/java/com/pengrad/telegrambot/model/ChatFullInfo.java b/library/src/main/java/com/pengrad/telegrambot/model/ChatFullInfo.java
index 25a06650..bbddf1b4 100644
--- a/library/src/main/java/com/pengrad/telegrambot/model/ChatFullInfo.java
+++ b/library/src/main/java/com/pengrad/telegrambot/model/ChatFullInfo.java
@@ -4,6 +4,7 @@
import com.pengrad.telegrambot.model.business.BusinessIntro;
import com.pengrad.telegrambot.model.business.BusinessLocation;
import com.pengrad.telegrambot.model.business.BusinessOpeningHours;
+import com.pengrad.telegrambot.model.gift.AcceptedGiftTypes;
import com.pengrad.telegrambot.model.reaction.ReactionType;
@@ -71,6 +72,7 @@ public enum Type {
private Long linked_chat_id;
private ChatLocation location;
private Boolean can_send_gift;
+ private AcceptedGiftTypes accepted_gift_types;
public Long id() {
return id;
@@ -247,10 +249,19 @@ public ChatLocation location() {
return location;
}
+ /**
+ *
+ * @deprecated Use 'acceptedGiftTypes' instead
+ */
+ @Deprecated
public Boolean canSendGift() {
return can_send_gift;
}
+ public AcceptedGiftTypes acceptedGiftTypes() {
+ return accepted_gift_types;
+ }
+
@Override
public boolean equals(Object o) {
if (this == o) return true;
@@ -300,7 +311,7 @@ public boolean equals(Object o) {
Objects.equals(custom_emoji_sticker_set_name, chat.custom_emoji_sticker_set_name) &&
Objects.equals(linked_chat_id, chat.linked_chat_id) &&
Objects.equals(location, chat.location) &&
- Objects.equals(can_send_gift, chat.can_send_gift);
+ Objects.equals(accepted_gift_types, chat.accepted_gift_types);
}
@Override
@@ -355,7 +366,7 @@ public String toString() {
", custom_emoji_sticker_set_name=" + custom_emoji_sticker_set_name +
", linked_chat_id=" + linked_chat_id +
", location=" + location +
- ", can_send_gift=" + can_send_gift +
+ ", accepted_gift_types=" + accepted_gift_types +
'}';
}
}
diff --git a/library/src/main/java/com/pengrad/telegrambot/model/LocationAddress.kt b/library/src/main/java/com/pengrad/telegrambot/model/LocationAddress.kt
new file mode 100644
index 00000000..511d3a79
--- /dev/null
+++ b/library/src/main/java/com/pengrad/telegrambot/model/LocationAddress.kt
@@ -0,0 +1,30 @@
+package com.pengrad.telegrambot.model
+
+@Suppress("unused")
+class LocationAddress private constructor(
+ @get:JvmName("countryCode") val countryCode: String,
+ @get:JvmName("state") var state: String?,
+ @get:JvmName("city") var city: String?,
+ @get:JvmName("street") var street: String?
+) {
+
+ constructor(countryCode: String) : this(
+ countryCode = countryCode,
+ state = null,
+ city = null,
+ street = null
+ )
+
+ fun state(state: String) = apply {
+ this.state = state
+ }
+
+ fun city(city: String) = apply {
+ this.city = city
+ }
+
+ fun street(street: String) = apply {
+ this.street = street
+ }
+
+}
\ No newline at end of file
diff --git a/library/src/main/java/com/pengrad/telegrambot/model/Message.java b/library/src/main/java/com/pengrad/telegrambot/model/Message.java
index 7a67234b..fad61402 100644
--- a/library/src/main/java/com/pengrad/telegrambot/model/Message.java
+++ b/library/src/main/java/com/pengrad/telegrambot/model/Message.java
@@ -2,6 +2,8 @@
import com.pengrad.telegrambot.model.chatbackground.ChatBackground;
import com.pengrad.telegrambot.model.chatboost.ChatBoostAdded;
+import com.pengrad.telegrambot.model.gift.GiftInfo;
+import com.pengrad.telegrambot.model.gift.unique.UniqueGiftInfo;
import com.pengrad.telegrambot.model.giveaway.Giveaway;
import com.pengrad.telegrambot.model.giveaway.GiveawayCompleted;
import com.pengrad.telegrambot.model.giveaway.GiveawayCreated;
@@ -105,6 +107,10 @@ public class Message extends MaybeInaccessibleMessage implements Serializable {
private VideoChatScheduled video_chat_scheduled;
private InlineKeyboardMarkup reply_markup;
private WebAppData web_app_data;
+ private GiftInfo gift;
+ private UniqueGiftInfo unique_gift;
+ private PaidMessagePriceChanged paid_message_price_changed;
+ private Integer paid_star_count;
public Integer messageThreadId() {
return message_thread_id;
@@ -435,6 +441,22 @@ public WebAppData webAppData() {
return web_app_data;
}
+ public GiftInfo gift() {
+ return gift;
+ }
+
+ public UniqueGiftInfo uniqueGift() {
+ return unique_gift;
+ }
+
+ public PaidMessagePriceChanged paidMessagePriceChanged() {
+ return paid_message_price_changed;
+ }
+
+ public Integer paidStarCount() {
+ return paid_star_count;
+ }
+
/**
* Only for backwards-compatibility with MaybeInaccessibleMessage
*/
@@ -545,7 +567,11 @@ public boolean equals(Object o) {
Objects.equals(video_chat_participants_invited, message.video_chat_participants_invited) &&
Objects.equals(video_chat_scheduled, message.video_chat_scheduled) &&
Objects.equals(reply_markup, message.reply_markup) &&
- Objects.equals(web_app_data, message.web_app_data);
+ Objects.equals(web_app_data, message.web_app_data) &&
+ Objects.equals(gift, message.gift) &&
+ Objects.equals(unique_gift, message.unique_gift) &&
+ Objects.equals(paid_message_price_changed, message.paid_message_price_changed) &&
+ Objects.equals(paid_star_count, message.paid_star_count);
}
@Override
@@ -641,6 +667,10 @@ public String toString() {
", video_chat_scheduled=" + video_chat_scheduled +
", reply_markup=" + reply_markup +
", web_app_data=" + web_app_data +
+ ", gift=" + gift +
+ ", unique_gift=" + unique_gift +
+ ", paid_message_price_changed=" + paid_message_price_changed +
+ ", paid_star_count=" + paid_star_count +
'}';
}
}
diff --git a/library/src/main/java/com/pengrad/telegrambot/model/PaidMessagePriceChanged.kt b/library/src/main/java/com/pengrad/telegrambot/model/PaidMessagePriceChanged.kt
new file mode 100644
index 00000000..6547d2a9
--- /dev/null
+++ b/library/src/main/java/com/pengrad/telegrambot/model/PaidMessagePriceChanged.kt
@@ -0,0 +1,5 @@
+package com.pengrad.telegrambot.model
+
+data class PaidMessagePriceChanged(
+ @get:JvmName("prizeStarCount") val prizeStarCount: Int
+)
\ No newline at end of file
diff --git a/library/src/main/java/com/pengrad/telegrambot/model/business/BusinessBotRights.kt b/library/src/main/java/com/pengrad/telegrambot/model/business/BusinessBotRights.kt
new file mode 100644
index 00000000..91b4a563
--- /dev/null
+++ b/library/src/main/java/com/pengrad/telegrambot/model/business/BusinessBotRights.kt
@@ -0,0 +1,20 @@
+package com.pengrad.telegrambot.model.business
+
+data class BusinessBotRights(
+ @get:JvmName("canReply") val canReply: Boolean,
+ @get:JvmName("canReadMessages") val canReadMessages: Boolean,
+ @get:JvmName("canDeleteSentMessages") val canDeleteSentMessages: Boolean,
+ @get:JvmName("canDeleteAllMessages") val canDeleteAllMessages: Boolean,
+ @get:JvmName("canEditName") val canEditName: Boolean,
+ @get:JvmName("canEditBio") val canEditBio: Boolean,
+ @get:JvmName("canEditProfilePhoto") val canEditProfilePhoto: Boolean,
+ @get:JvmName("canEditUsername") val canEditUsername: Boolean,
+ @get:JvmName("canChangeGiftSettings") val canChangeGiftSettings: Boolean,
+ @get:JvmName("canViewGiftsAndStars") val canViewGiftsAndStars: Boolean,
+ @get:JvmName("canConvertGiftsToStars") val canConvertGiftsToStars: Boolean,
+ @get:JvmName("canTransferAndUpgradeGifts") val canTransferAndUpgradeGifts: Boolean,
+ @get:JvmName("canTransferStars") val canTransferStars: Boolean,
+ @get:JvmName("canManageStories") val canManageStories: Boolean,
+) {
+
+}
\ No newline at end of file
diff --git a/library/src/main/java/com/pengrad/telegrambot/model/business/BusinessConnection.java b/library/src/main/java/com/pengrad/telegrambot/model/business/BusinessConnection.java
index 4c7a4009..d3fe0cbf 100644
--- a/library/src/main/java/com/pengrad/telegrambot/model/business/BusinessConnection.java
+++ b/library/src/main/java/com/pengrad/telegrambot/model/business/BusinessConnection.java
@@ -10,6 +10,7 @@ public class BusinessConnection {
private User user;
private Long user_chat_id;
private Integer date;
+ private BusinessBotRights rights;
private Boolean can_reply;
private Boolean is_enabled;
@@ -29,10 +30,18 @@ public Integer date() {
return date;
}
+ /**
+ * @deprecated Use the 'rights' field instead.
+ */
+ @Deprecated
public Boolean canReply() {
return can_reply;
}
+ public BusinessBotRights rights() {
+ return rights;
+ }
+
public Boolean isEnabled() {
return is_enabled;
}
@@ -42,12 +51,12 @@ public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
BusinessConnection that = (BusinessConnection) o;
- return Objects.equals(id, that.id) && Objects.equals(user, that.user) && Objects.equals(user_chat_id, that.user_chat_id) && Objects.equals(date, that.date) && Objects.equals(can_reply, that.can_reply) && Objects.equals(is_enabled, that.is_enabled);
+ return Objects.equals(id, that.id) && Objects.equals(user, that.user) && Objects.equals(user_chat_id, that.user_chat_id) && Objects.equals(date, that.date) && Objects.equals(rights, that.rights) && Objects.equals(is_enabled, that.is_enabled);
}
@Override
public int hashCode() {
- return Objects.hash(id, user, user_chat_id, date, can_reply, is_enabled);
+ return Objects.hash(id, user, user_chat_id, date, rights, is_enabled);
}
@Override
@@ -57,7 +66,7 @@ public String toString() {
", user=" + user +
", user_chat_id=" + user_chat_id +
", date=" + date +
- ", can_reply=" + can_reply +
+ ", rights=" + rights +
", is_enabled=" + is_enabled +
'}';
}
diff --git a/library/src/main/java/com/pengrad/telegrambot/model/gift/AcceptedGiftTypes.kt b/library/src/main/java/com/pengrad/telegrambot/model/gift/AcceptedGiftTypes.kt
new file mode 100644
index 00000000..e1072190
--- /dev/null
+++ b/library/src/main/java/com/pengrad/telegrambot/model/gift/AcceptedGiftTypes.kt
@@ -0,0 +1,8 @@
+package com.pengrad.telegrambot.model.gift
+
+data class AcceptedGiftTypes(
+ @get:JvmName("unlimitedGifts") val unlimitedGifts: Boolean,
+ @get:JvmName("limitedGifts") val limitedGifts: Boolean,
+ @get:JvmName("uniqueGifts") val uniqueGifts: Boolean,
+ @get:JvmName("premiumSubscription") val premiumSubscription: Boolean
+)
\ No newline at end of file
diff --git a/library/src/main/java/com/pengrad/telegrambot/model/gift/GiftInfo.kt b/library/src/main/java/com/pengrad/telegrambot/model/gift/GiftInfo.kt
new file mode 100644
index 00000000..84d51b52
--- /dev/null
+++ b/library/src/main/java/com/pengrad/telegrambot/model/gift/GiftInfo.kt
@@ -0,0 +1,48 @@
+package com.pengrad.telegrambot.model.gift
+
+import com.pengrad.telegrambot.model.MessageEntity
+
+data class GiftInfo(
+ @get:JvmName("gift") val gift: Gift,
+ @get:JvmName("ownedGiftId") val ownedGiftId: String?,
+ @get:JvmName("convertStarCount") val convertStarCount: Int?,
+ @get:JvmName("prepaidUpgradeStarCount") val prepaidUpgradeStarCount: Int?,
+ @get:JvmName("canBeUpgraded") val canBeUpgraded: Boolean?,
+ @get:JvmName("text") val text: String?,
+ @get:JvmName("entities") val entities: Array?,
+ @get:JvmName("isPrivate") val isPrivate: Boolean?,
+) {
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) return true
+ if (other !is GiftInfo) return false
+
+ return gift == other.gift &&
+ ownedGiftId == other.ownedGiftId &&
+ convertStarCount == other.convertStarCount &&
+ prepaidUpgradeStarCount == other.prepaidUpgradeStarCount &&
+ canBeUpgraded == other.canBeUpgraded &&
+ text == other.text &&
+ entities contentEquals other.entities &&
+ isPrivate == other.isPrivate
+ }
+
+ override fun hashCode(): Int {
+ var result = gift.hashCode()
+ result = 31 * result + (ownedGiftId?.hashCode() ?: 0)
+ result = 31 * result + (convertStarCount ?: 0)
+ result = 31 * result + (prepaidUpgradeStarCount ?: 0)
+ result = 31 * result + (canBeUpgraded?.hashCode() ?: 0)
+ result = 31 * result + (text?.hashCode() ?: 0)
+ result = 31 * result + (entities?.contentHashCode() ?: 0)
+ result = 31 * result + (isPrivate?.hashCode() ?: 0)
+ return result
+ }
+
+ override fun toString(): String {
+ return "GiftInfo(gift=$gift, ownedGiftId=$ownedGiftId, convertStarCount=$convertStarCount, " +
+ "prepaidUpgradeStarCount=$prepaidUpgradeStarCount, canBeUpgraded=$canBeUpgraded, " +
+ "text=$text, entities=${entities?.contentToString()}, isPrivate=$isPrivate)"
+ }
+
+}
\ No newline at end of file
diff --git a/library/src/main/java/com/pengrad/telegrambot/model/gift/owned/OwnedGift.kt b/library/src/main/java/com/pengrad/telegrambot/model/gift/owned/OwnedGift.kt
new file mode 100644
index 00000000..856c7591
--- /dev/null
+++ b/library/src/main/java/com/pengrad/telegrambot/model/gift/owned/OwnedGift.kt
@@ -0,0 +1,5 @@
+package com.pengrad.telegrambot.model.gift.owned
+
+open class OwnedGift(
+ @get:JvmName("type") val type: String
+)
\ No newline at end of file
diff --git a/library/src/main/java/com/pengrad/telegrambot/model/gift/owned/OwnedGiftRegular.kt b/library/src/main/java/com/pengrad/telegrambot/model/gift/owned/OwnedGiftRegular.kt
new file mode 100644
index 00000000..77fe1ca5
--- /dev/null
+++ b/library/src/main/java/com/pengrad/telegrambot/model/gift/owned/OwnedGiftRegular.kt
@@ -0,0 +1,82 @@
+package com.pengrad.telegrambot.model.gift.owned
+
+import com.pengrad.telegrambot.model.MessageEntity
+import com.pengrad.telegrambot.model.User
+import com.pengrad.telegrambot.model.gift.Gift
+
+@Suppress("unused")
+class OwnedGiftRegular private constructor(
+ @get:JvmName("gift") val gift: Gift,
+ @get:JvmName("ownedGiftId") var ownedGiftId: String?,
+ @get:JvmName("senderUser") var senderUser: User?,
+ @get:JvmName("sendDate") val sendDate: Long,
+ @get:JvmName("text") var text: String?,
+ @get:JvmName("entities") var entities: Array?,
+ @get:JvmName("isPrivate") var isPrivate: Boolean?,
+ @get:JvmName("isSaved") var isSaved: Boolean?,
+ @get:JvmName("canBeUpgraded") var canBeUpgraded: Boolean?,
+ @get:JvmName("wasRefunded") var wasRefunded: Boolean?,
+ @get:JvmName("convertStarCount") var convertStarCount: Int?,
+ @get:JvmName("prepaidUpgradeStarCount") var prepaidUpgradeStarCount: Int?
+) : OwnedGift(type = TYPE) {
+
+ companion object {
+ const val TYPE = "regular"
+ }
+
+ constructor(gift: Gift, sendDate: Long) : this(
+ gift = gift,
+ ownedGiftId = null,
+ senderUser = null,
+ sendDate = sendDate,
+ text = null,
+ entities = null,
+ isPrivate = null,
+ isSaved = null,
+ canBeUpgraded = null,
+ wasRefunded = null,
+ convertStarCount = null,
+ prepaidUpgradeStarCount = null,
+ )
+
+ fun ownedGiftId(ownedGiftId: String) = apply {
+ this.ownedGiftId = ownedGiftId
+ }
+
+ fun senderUser(senderUser: User) = apply {
+ this.senderUser = senderUser
+ }
+
+ fun text(text: String) = apply {
+ this.text = text
+ }
+
+ fun entities(entities: Array) = apply {
+ this.entities = entities
+ }
+
+ fun isPrivate(isPrivate: Boolean) = apply {
+ this.isPrivate = isPrivate
+ }
+
+ fun isSaved(isSaved: Boolean) = apply {
+ this.isSaved = isSaved
+ }
+
+ fun canBeUpgraded(canBeUpgraded: Boolean) = apply {
+ this.canBeUpgraded = canBeUpgraded
+ }
+
+ fun wasRefunded(wasRefunded: Boolean) = apply {
+ this.wasRefunded = wasRefunded
+ }
+
+ fun convertStarCount(convertStarCount: Int) = apply {
+ this.convertStarCount = convertStarCount
+ }
+
+ fun prepaidUpgradeStarCount(prepaidUpgradeStarCount: Int) = apply {
+ this.prepaidUpgradeStarCount = prepaidUpgradeStarCount
+ }
+
+}
\ No newline at end of file
diff --git a/library/src/main/java/com/pengrad/telegrambot/model/gift/owned/OwnedGiftUnique.kt b/library/src/main/java/com/pengrad/telegrambot/model/gift/owned/OwnedGiftUnique.kt
new file mode 100644
index 00000000..6ed4a04c
--- /dev/null
+++ b/library/src/main/java/com/pengrad/telegrambot/model/gift/owned/OwnedGiftUnique.kt
@@ -0,0 +1,21 @@
+package com.pengrad.telegrambot.model.gift.owned
+
+import com.pengrad.telegrambot.model.User
+import com.pengrad.telegrambot.model.gift.Gift
+
+@Suppress("unused")
+class OwnedGiftUnique(
+ @get:JvmName("gift") val gift: Gift,
+ @get:JvmName("ownedGiftId") var ownedGiftId: String?,
+ @get:JvmName("senderUser") var senderUser: User?,
+ @get:JvmName("sendDate") var sendDate: Long,
+ @get:JvmName("isSaved") var isSaved: Boolean?,
+ @get:JvmName("canBeTransferred") var canBeTransferred: Boolean?,
+ @get:JvmName("transferStarCount") var prepaidUpgradeStarCount: Int?
+) : OwnedGift(type = TYPE) {
+
+ companion object {
+ const val TYPE = "unique"
+ }
+
+}
\ No newline at end of file
diff --git a/library/src/main/java/com/pengrad/telegrambot/model/gift/owned/OwnedGifts.kt b/library/src/main/java/com/pengrad/telegrambot/model/gift/owned/OwnedGifts.kt
new file mode 100644
index 00000000..7e187835
--- /dev/null
+++ b/library/src/main/java/com/pengrad/telegrambot/model/gift/owned/OwnedGifts.kt
@@ -0,0 +1,25 @@
+package com.pengrad.telegrambot.model.gift.owned
+
+data class OwnedGifts(
+ @get:JvmName("totalAmount") var totalAmount: Int,
+ @get:JvmName("gifts") var gifts: Array,
+ @get:JvmName("nextOffset") var nextOffset: String?
+) {
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) return true
+ if (other !is OwnedGifts) return false
+
+ return totalAmount == other.totalAmount &&
+ gifts.contentEquals(other.gifts) &&
+ nextOffset == other.nextOffset
+ }
+
+ override fun hashCode(): Int {
+ var result = totalAmount
+ result = 31 * result + gifts.contentHashCode()
+ result = 31 * result + (nextOffset?.hashCode() ?: 0)
+ return result
+ }
+
+}
\ No newline at end of file
diff --git a/library/src/main/java/com/pengrad/telegrambot/model/gift/unique/UniqueGift.kt b/library/src/main/java/com/pengrad/telegrambot/model/gift/unique/UniqueGift.kt
new file mode 100644
index 00000000..0416a67d
--- /dev/null
+++ b/library/src/main/java/com/pengrad/telegrambot/model/gift/unique/UniqueGift.kt
@@ -0,0 +1,11 @@
+package com.pengrad.telegrambot.model.gift.unique
+
+@Suppress("unused")
+data class UniqueGift(
+ @get:JvmName("baseName") val baseName: String,
+ @get:JvmName("name") val name: String,
+ @get:JvmName("number") val number: Int,
+ @get:JvmName("model") val model: UniqueGiftModel,
+ @get:JvmName("symbol") val symbol: UniqueGiftSymbol,
+ @get:JvmName("backdrop") val backdrop: UniqueGiftBackdrop
+)
\ No newline at end of file
diff --git a/library/src/main/java/com/pengrad/telegrambot/model/gift/unique/UniqueGiftBackdrop.kt b/library/src/main/java/com/pengrad/telegrambot/model/gift/unique/UniqueGiftBackdrop.kt
new file mode 100644
index 00000000..6e12b447
--- /dev/null
+++ b/library/src/main/java/com/pengrad/telegrambot/model/gift/unique/UniqueGiftBackdrop.kt
@@ -0,0 +1,7 @@
+package com.pengrad.telegrambot.model.gift.unique
+
+data class UniqueGiftBackdrop(
+ @get:JvmName("name") val name: String,
+ @get:JvmName("colors") val colors: UniqueGiftBackdropColors,
+ @get:JvmName("rarityPerMille") val rarityPerMille: Int
+)
\ No newline at end of file
diff --git a/library/src/main/java/com/pengrad/telegrambot/model/gift/unique/UniqueGiftBackdropColors.kt b/library/src/main/java/com/pengrad/telegrambot/model/gift/unique/UniqueGiftBackdropColors.kt
new file mode 100644
index 00000000..f98ec13f
--- /dev/null
+++ b/library/src/main/java/com/pengrad/telegrambot/model/gift/unique/UniqueGiftBackdropColors.kt
@@ -0,0 +1,8 @@
+package com.pengrad.telegrambot.model.gift.unique
+
+data class UniqueGiftBackdropColors(
+ @get:JvmName("centerColor") val centerColor: Int,
+ @get:JvmName("edgeColor") val edgeColor: Int,
+ @get:JvmName("symbolColor") val symbolColor: Int,
+ @get:JvmName("textColor") val textColor: Int
+)
\ No newline at end of file
diff --git a/library/src/main/java/com/pengrad/telegrambot/model/gift/unique/UniqueGiftInfo.kt b/library/src/main/java/com/pengrad/telegrambot/model/gift/unique/UniqueGiftInfo.kt
new file mode 100644
index 00000000..f07f49c5
--- /dev/null
+++ b/library/src/main/java/com/pengrad/telegrambot/model/gift/unique/UniqueGiftInfo.kt
@@ -0,0 +1,9 @@
+package com.pengrad.telegrambot.model.gift.unique
+
+@Suppress("unused")
+data class UniqueGiftInfo(
+ @get:JvmName("gift") val gift: UniqueGift,
+ @get:JvmName("origin") val origin: String,
+ @get:JvmName("ownedGiftId") val ownedGiftId: String?,
+ @get:JvmName("transferStarCount") val transferStarCount: Int?
+)
\ No newline at end of file
diff --git a/library/src/main/java/com/pengrad/telegrambot/model/gift/unique/UniqueGiftModel.kt b/library/src/main/java/com/pengrad/telegrambot/model/gift/unique/UniqueGiftModel.kt
new file mode 100644
index 00000000..bd0721ed
--- /dev/null
+++ b/library/src/main/java/com/pengrad/telegrambot/model/gift/unique/UniqueGiftModel.kt
@@ -0,0 +1,9 @@
+package com.pengrad.telegrambot.model.gift.unique
+
+import com.pengrad.telegrambot.model.Sticker
+
+data class UniqueGiftModel(
+ @get:JvmName("name") val name: String,
+ @get:JvmName("sticker") val sticker: Sticker,
+ @get:JvmName("rarityPerMille") val rarityPerMille: Int
+)
\ No newline at end of file
diff --git a/library/src/main/java/com/pengrad/telegrambot/model/gift/unique/UniqueGiftSymbol.kt b/library/src/main/java/com/pengrad/telegrambot/model/gift/unique/UniqueGiftSymbol.kt
new file mode 100644
index 00000000..ed1f315a
--- /dev/null
+++ b/library/src/main/java/com/pengrad/telegrambot/model/gift/unique/UniqueGiftSymbol.kt
@@ -0,0 +1,9 @@
+package com.pengrad.telegrambot.model.gift.unique
+
+import com.pengrad.telegrambot.model.Sticker
+
+data class UniqueGiftSymbol(
+ @get:JvmName("name") val name: String,
+ @get:JvmName("sticker") val sticker: Sticker,
+ @get:JvmName("rarityPerMille") val rarityPerMille: Int
+)
\ No newline at end of file
diff --git a/library/src/main/java/com/pengrad/telegrambot/model/inputprofilephoto/InputProfilePhoto.kt b/library/src/main/java/com/pengrad/telegrambot/model/inputprofilephoto/InputProfilePhoto.kt
new file mode 100644
index 00000000..ba9f31c7
--- /dev/null
+++ b/library/src/main/java/com/pengrad/telegrambot/model/inputprofilephoto/InputProfilePhoto.kt
@@ -0,0 +1,5 @@
+package com.pengrad.telegrambot.model.inputprofilephoto
+
+open class InputProfilePhoto(
+ @get:JvmName("type") val type: String
+)
\ No newline at end of file
diff --git a/library/src/main/java/com/pengrad/telegrambot/model/inputprofilephoto/InputProfilePhotoAnimated.kt b/library/src/main/java/com/pengrad/telegrambot/model/inputprofilephoto/InputProfilePhotoAnimated.kt
new file mode 100644
index 00000000..e2a917ea
--- /dev/null
+++ b/library/src/main/java/com/pengrad/telegrambot/model/inputprofilephoto/InputProfilePhotoAnimated.kt
@@ -0,0 +1,17 @@
+package com.pengrad.telegrambot.model.inputprofilephoto
+
+@Suppress("unused")
+class InputProfilePhotoAnimated private constructor(
+ @get:JvmName("animation") val animation: String,
+ @get:JvmName("mainFrameTimestamp") var mainFrameTimestamp: Double?
+) : InputProfilePhoto(type = "animated") {
+
+ constructor(animation: String) : this(
+ animation = animation,
+ mainFrameTimestamp = null
+ )
+
+ fun mainFrameTimestamp(mainFrameTimestamp: Double) = apply {
+ this.mainFrameTimestamp = mainFrameTimestamp
+ }
+}
\ No newline at end of file
diff --git a/library/src/main/java/com/pengrad/telegrambot/model/inputprofilephoto/InputProfilePhotoStatic.kt b/library/src/main/java/com/pengrad/telegrambot/model/inputprofilephoto/InputProfilePhotoStatic.kt
new file mode 100644
index 00000000..cf2673cb
--- /dev/null
+++ b/library/src/main/java/com/pengrad/telegrambot/model/inputprofilephoto/InputProfilePhotoStatic.kt
@@ -0,0 +1,6 @@
+package com.pengrad.telegrambot.model.inputprofilephoto
+
+@Suppress("unused")
+class InputProfilePhotoStatic(
+ @get:JvmName("photo") val photo: String
+) : InputProfilePhoto(type = "static")
\ No newline at end of file
diff --git a/library/src/main/java/com/pengrad/telegrambot/model/stars/StarAmount.kt b/library/src/main/java/com/pengrad/telegrambot/model/stars/StarAmount.kt
new file mode 100644
index 00000000..6d0ab645
--- /dev/null
+++ b/library/src/main/java/com/pengrad/telegrambot/model/stars/StarAmount.kt
@@ -0,0 +1,6 @@
+package com.pengrad.telegrambot.model.stars
+
+data class StarAmount(
+ @get:JvmName("amount") val amount: Int,
+ @get:JvmName("nanostarAmount") val nanostarAmount: Long
+)
\ No newline at end of file
diff --git a/library/src/main/java/com/pengrad/telegrambot/model/stars/partner/TransactionPartnerUser.kt b/library/src/main/java/com/pengrad/telegrambot/model/stars/partner/TransactionPartnerUser.kt
index 4d2c2b9a..429702c8 100644
--- a/library/src/main/java/com/pengrad/telegrambot/model/stars/partner/TransactionPartnerUser.kt
+++ b/library/src/main/java/com/pengrad/telegrambot/model/stars/partner/TransactionPartnerUser.kt
@@ -7,13 +7,15 @@ import com.pengrad.telegrambot.model.stars.affiliate.AffiliateInfo
import com.pengrad.telegrambot.model.stars.partner.TransactionPartnerType.USER
data class TransactionPartnerUser(
+ @get:JvmName("transactionType") val transactionType: String,
@get:JvmName("user") val user: User,
@get:JvmName("affiliate") val affiliate: AffiliateInfo,
@get:JvmName("invoicePayload") val invoicePayload: String? = null,
@get:JvmName("paidMedia") val paidMedia: Array? = null,
@get:JvmName("paidMediaPayload") val paidMediaPayload: String? = null,
@get:JvmName("subscriptionPeriod") val subscriptionPeriod: Int? = null,
- @get:JvmName("gift") val gift: Gift? = null
+ @get:JvmName("gift") val gift: Gift? = null,
+ @get:JvmName("premiumSubscriptionDuration") val premiumSubscriptionDuration: Int? = null
) : TransactionPartner {
override val type: String
@@ -26,6 +28,7 @@ data class TransactionPartnerUser(
other as TransactionPartnerUser
if (subscriptionPeriod != other.subscriptionPeriod) return false
+ if (transactionType != other.transactionType) return false
if (user != other.user) return false
if (affiliate != other.affiliate) return false
if (invoicePayload != other.invoicePayload) return false
@@ -35,6 +38,7 @@ data class TransactionPartnerUser(
} else if (other.paidMedia != null) return false
if (paidMediaPayload != other.paidMediaPayload) return false
if (gift != other.gift) return false
+ if (premiumSubscriptionDuration != other.premiumSubscriptionDuration) return false
if (type != other.type) return false
return true
@@ -42,12 +46,14 @@ data class TransactionPartnerUser(
override fun hashCode(): Int {
var result = subscriptionPeriod ?: 0
+ result = 31 * result + transactionType.hashCode()
result = 31 * result + user.hashCode()
result = 31 * result + affiliate.hashCode()
result = 31 * result + (invoicePayload?.hashCode() ?: 0)
result = 31 * result + (paidMedia?.contentHashCode() ?: 0)
result = 31 * result + (paidMediaPayload?.hashCode() ?: 0)
result = 31 * result + (gift?.hashCode() ?: 0)
+ result = 31 * result + (premiumSubscriptionDuration?.hashCode() ?: 0)
result = 31 * result + type.hashCode()
return result
}
diff --git a/library/src/main/java/com/pengrad/telegrambot/model/story/StoryArea.kt b/library/src/main/java/com/pengrad/telegrambot/model/story/StoryArea.kt
new file mode 100644
index 00000000..fb2eb290
--- /dev/null
+++ b/library/src/main/java/com/pengrad/telegrambot/model/story/StoryArea.kt
@@ -0,0 +1,10 @@
+package com.pengrad.telegrambot.model.story
+
+import com.pengrad.telegrambot.model.story.area.StoryAreaPosition
+import com.pengrad.telegrambot.model.story.area.type.StoryAreaType
+
+@Suppress("unused")
+class StoryArea(
+ @get:JvmName("position") val position: StoryAreaPosition,
+ @get:JvmName("type") val type: StoryAreaType
+)
\ No newline at end of file
diff --git a/library/src/main/java/com/pengrad/telegrambot/model/story/area/StoryAreaPosition.kt b/library/src/main/java/com/pengrad/telegrambot/model/story/area/StoryAreaPosition.kt
new file mode 100644
index 00000000..25ac5a96
--- /dev/null
+++ b/library/src/main/java/com/pengrad/telegrambot/model/story/area/StoryAreaPosition.kt
@@ -0,0 +1,10 @@
+package com.pengrad.telegrambot.model.story.area
+
+data class StoryAreaPosition(
+ @get:JvmName("xPercentage") val xPercentage: Double,
+ @get:JvmName("yPercentage") val yPercentage: Double,
+ @get:JvmName("widthPercentage") val widthPercentage: Double,
+ @get:JvmName("heightPercentage") val heightPercentage: Double,
+ @get:JvmName("rotationAngle") val rotationAngle: Double,
+ @get:JvmName("cornerRadiusPercentage") val cornerRadiusPercentage: Double
+)
\ No newline at end of file
diff --git a/library/src/main/java/com/pengrad/telegrambot/model/story/area/type/StoryAreaType.kt b/library/src/main/java/com/pengrad/telegrambot/model/story/area/type/StoryAreaType.kt
new file mode 100644
index 00000000..94cb15ed
--- /dev/null
+++ b/library/src/main/java/com/pengrad/telegrambot/model/story/area/type/StoryAreaType.kt
@@ -0,0 +1,5 @@
+package com.pengrad.telegrambot.model.story.area.type
+
+open class StoryAreaType(
+ @get:JvmName("type") val type: String
+)
\ No newline at end of file
diff --git a/library/src/main/java/com/pengrad/telegrambot/model/story/area/type/StoryAreaTypeLink.kt b/library/src/main/java/com/pengrad/telegrambot/model/story/area/type/StoryAreaTypeLink.kt
new file mode 100644
index 00000000..b210fb6f
--- /dev/null
+++ b/library/src/main/java/com/pengrad/telegrambot/model/story/area/type/StoryAreaTypeLink.kt
@@ -0,0 +1,6 @@
+package com.pengrad.telegrambot.model.story.area.type
+
+@Suppress("unused")
+class StoryAreaTypeLink(
+ @get:JvmName("url") val url: String
+): StoryAreaType(type = "link")
\ No newline at end of file
diff --git a/library/src/main/java/com/pengrad/telegrambot/model/story/area/type/StoryAreaTypeLocation.kt b/library/src/main/java/com/pengrad/telegrambot/model/story/area/type/StoryAreaTypeLocation.kt
new file mode 100644
index 00000000..a6ac7493
--- /dev/null
+++ b/library/src/main/java/com/pengrad/telegrambot/model/story/area/type/StoryAreaTypeLocation.kt
@@ -0,0 +1,22 @@
+package com.pengrad.telegrambot.model.story.area.type
+
+import com.pengrad.telegrambot.model.LocationAddress
+
+@Suppress("unused")
+class StoryAreaTypeLocation private constructor(
+ @get:JvmName("latitude") val latitude: Double,
+ @get:JvmName("longitude") val longitude: Double,
+ @get:JvmName("address") var address: LocationAddress?
+): StoryAreaType(type = "location") {
+
+ constructor(latitude: Double, longitude: Double) : this(
+ latitude = latitude,
+ longitude = longitude,
+ address = null
+ )
+
+ fun address(address: LocationAddress) = apply {
+ this.address = address
+ }
+
+}
\ No newline at end of file
diff --git a/library/src/main/java/com/pengrad/telegrambot/model/story/area/type/StoryAreaTypeSuggestedReaction.kt b/library/src/main/java/com/pengrad/telegrambot/model/story/area/type/StoryAreaTypeSuggestedReaction.kt
new file mode 100644
index 00000000..71670f00
--- /dev/null
+++ b/library/src/main/java/com/pengrad/telegrambot/model/story/area/type/StoryAreaTypeSuggestedReaction.kt
@@ -0,0 +1,26 @@
+package com.pengrad.telegrambot.model.story.area.type
+
+import com.pengrad.telegrambot.model.reaction.ReactionType
+
+@Suppress("unused")
+class StoryAreaTypeSuggestedReaction private constructor(
+ @get:JvmName("reactionType") val reactionType: ReactionType,
+ @get:JvmName("isDark") var isDark: Boolean?,
+ @get:JvmName("isFlipped") var isFlipped: Boolean?
+): StoryAreaType(type = "suggested_reaction") {
+
+ constructor(reactionType: ReactionType) : this(
+ reactionType = reactionType,
+ isDark = null,
+ isFlipped = null
+ )
+
+ fun isDark(isDark: Boolean) = apply {
+ this.isDark = isDark
+ }
+
+ fun isFlipped(isFlipped: Boolean) = apply {
+ this.isFlipped = isFlipped
+ }
+
+}
diff --git a/library/src/main/java/com/pengrad/telegrambot/model/story/area/type/StoryAreaTypeUniqueGift.kt b/library/src/main/java/com/pengrad/telegrambot/model/story/area/type/StoryAreaTypeUniqueGift.kt
new file mode 100644
index 00000000..8c9abb55
--- /dev/null
+++ b/library/src/main/java/com/pengrad/telegrambot/model/story/area/type/StoryAreaTypeUniqueGift.kt
@@ -0,0 +1,6 @@
+package com.pengrad.telegrambot.model.story.area.type
+
+@Suppress("unused")
+class StoryAreaTypeUniqueGift(
+ @get:JvmName("name") val name: String
+): StoryAreaType(type = "unique_gift")
\ No newline at end of file
diff --git a/library/src/main/java/com/pengrad/telegrambot/model/story/area/type/StoryAreaTypeWeather.kt b/library/src/main/java/com/pengrad/telegrambot/model/story/area/type/StoryAreaTypeWeather.kt
new file mode 100644
index 00000000..3ed6b7b5
--- /dev/null
+++ b/library/src/main/java/com/pengrad/telegrambot/model/story/area/type/StoryAreaTypeWeather.kt
@@ -0,0 +1,8 @@
+package com.pengrad.telegrambot.model.story.area.type
+
+@Suppress("unused")
+class StoryAreaTypeWeather(
+ @get:JvmName("temperature") val temperature: Double,
+ @get:JvmName("emoji") val emoji: String,
+ @get:JvmName("backgroundColor") val backgroundColor: Int
+): StoryAreaType(type = "weather")
\ No newline at end of file
diff --git a/library/src/main/java/com/pengrad/telegrambot/model/story/inputstory/InputStoryContent.kt b/library/src/main/java/com/pengrad/telegrambot/model/story/inputstory/InputStoryContent.kt
new file mode 100644
index 00000000..87374698
--- /dev/null
+++ b/library/src/main/java/com/pengrad/telegrambot/model/story/inputstory/InputStoryContent.kt
@@ -0,0 +1,5 @@
+package com.pengrad.telegrambot.model.story.inputstory
+
+open class InputStoryContent(
+ @get:JvmName("type") val type: String
+)
\ No newline at end of file
diff --git a/library/src/main/java/com/pengrad/telegrambot/model/story/inputstory/InputStoryContentPhoto.kt b/library/src/main/java/com/pengrad/telegrambot/model/story/inputstory/InputStoryContentPhoto.kt
new file mode 100644
index 00000000..71137cd2
--- /dev/null
+++ b/library/src/main/java/com/pengrad/telegrambot/model/story/inputstory/InputStoryContentPhoto.kt
@@ -0,0 +1,6 @@
+package com.pengrad.telegrambot.model.story.inputstory
+
+@Suppress("unused")
+class InputStoryContentPhoto(
+ @get:JvmName("photo") val photo: String
+) : InputStoryContent(type = "photo")
\ No newline at end of file
diff --git a/library/src/main/java/com/pengrad/telegrambot/model/story/inputstory/InputStoryContentVideo.kt b/library/src/main/java/com/pengrad/telegrambot/model/story/inputstory/InputStoryContentVideo.kt
new file mode 100644
index 00000000..56912b55
--- /dev/null
+++ b/library/src/main/java/com/pengrad/telegrambot/model/story/inputstory/InputStoryContentVideo.kt
@@ -0,0 +1,30 @@
+package com.pengrad.telegrambot.model.story.inputstory
+
+@Suppress("unused")
+class InputStoryContentVideo private constructor(
+ @get:JvmName("video") val video: String,
+ @get:JvmName("duration") var duration: Double?,
+ @get:JvmName("coverFrameTimestamp") var coverFrameTimestamp: Double?,
+ @get:JvmName("isAnimation") var isAnimation: Boolean?
+) : InputStoryContent(type = "video") {
+
+ constructor(video: String) : this(
+ video = video,
+ duration = null,
+ coverFrameTimestamp = null,
+ isAnimation = null
+ )
+
+ fun duration(duration: Double) = apply {
+ this.duration = duration
+ }
+
+ fun coverFrameTimestamp(coverFrameTimestamp: Double) = apply {
+ this.coverFrameTimestamp = coverFrameTimestamp
+ }
+
+ fun isAnimation(isAnimation: Boolean) = apply {
+ this.isAnimation = isAnimation
+ }
+
+}
\ No newline at end of file
diff --git a/library/src/main/java/com/pengrad/telegrambot/request/GiftTelegramSubscription.kt b/library/src/main/java/com/pengrad/telegrambot/request/GiftTelegramSubscription.kt
new file mode 100644
index 00000000..4ab17673
--- /dev/null
+++ b/library/src/main/java/com/pengrad/telegrambot/request/GiftTelegramSubscription.kt
@@ -0,0 +1,40 @@
+package com.pengrad.telegrambot.request
+
+import com.pengrad.telegrambot.model.MessageEntity
+import com.pengrad.telegrambot.response.BaseResponse
+import com.pengrad.telegrambot.utility.kotlin.optionalRequestParameter
+import com.pengrad.telegrambot.utility.kotlin.requestParameter
+
+@Suppress("unused")
+class GiftTelegramSubscription private constructor(
+ userId: Long,
+ monthCount: Int,
+ starCount: Int,
+ text: String?,
+ textParseMode: String?,
+ textEntities: Array?
+): KBaseRequest(BaseResponse::class) {
+
+ constructor(userId: Long, monthCount: Int, starCount: Int) : this(
+ userId = userId,
+ monthCount = monthCount,
+ starCount = starCount,
+ text = null,
+ textParseMode = null,
+ textEntities = null
+ )
+
+ val userId: Long by requestParameter(userId, customParameterName = "user_id")
+ val monthCount: Int by requestParameter(monthCount, customParameterName = "month_count")
+ val starCount: Int by requestParameter(starCount, customParameterName = "star_count")
+
+ var text: String? by optionalRequestParameter(text, customParameterName = "text")
+ fun text(text: String) = applySelf { this.text = text }
+
+ var textParseMode: String? by optionalRequestParameter(textParseMode, customParameterName = "text_parse_mode")
+ fun textParseMode(textParseMode: String) = applySelf { this.textParseMode = textParseMode }
+
+ var textEntities: Array? by optionalRequestParameter(textEntities, customParameterName = "text_entities")
+ fun textEntities(textEntities: Array) = applySelf { this.textEntities = textEntities }
+
+}
\ No newline at end of file
diff --git a/library/src/main/java/com/pengrad/telegrambot/request/business/ConvertGiftToStars.kt b/library/src/main/java/com/pengrad/telegrambot/request/business/ConvertGiftToStars.kt
new file mode 100644
index 00000000..7d933f14
--- /dev/null
+++ b/library/src/main/java/com/pengrad/telegrambot/request/business/ConvertGiftToStars.kt
@@ -0,0 +1,16 @@
+package com.pengrad.telegrambot.request.business
+
+import com.pengrad.telegrambot.request.KBaseRequest
+import com.pengrad.telegrambot.response.BaseResponse
+import com.pengrad.telegrambot.utility.kotlin.requestParameter
+
+@Suppress("unused")
+class ConvertGiftToStars(
+ businessConnectionId: String,
+ ownedGiftId: String
+) : KBaseRequest(BaseResponse::class) {
+
+ val businessConnectionId: String by requestParameter(businessConnectionId, customParameterName = "business_connection_id")
+ val ownedGiftId: String by requestParameter(ownedGiftId, customParameterName = "owned_gift_id")
+
+}
\ No newline at end of file
diff --git a/library/src/main/java/com/pengrad/telegrambot/request/business/DeleteBusinessMessage.kt b/library/src/main/java/com/pengrad/telegrambot/request/business/DeleteBusinessMessage.kt
new file mode 100644
index 00000000..ded54912
--- /dev/null
+++ b/library/src/main/java/com/pengrad/telegrambot/request/business/DeleteBusinessMessage.kt
@@ -0,0 +1,16 @@
+package com.pengrad.telegrambot.request.business
+
+import com.pengrad.telegrambot.request.KBaseRequest
+import com.pengrad.telegrambot.response.BaseResponse
+import com.pengrad.telegrambot.utility.kotlin.requestParameter
+
+@Suppress("unused")
+class DeleteBusinessMessage(
+ businessConnectionId: String,
+ messageIds: Array
+) : KBaseRequest(BaseResponse::class) {
+
+ val businessConnectionId: String by requestParameter(businessConnectionId, customParameterName = "business_connection_id")
+ val messageIds: Array by requestParameter(messageIds, customParameterName = "message_ids")
+
+}
\ No newline at end of file
diff --git a/library/src/main/java/com/pengrad/telegrambot/request/business/DeleteStory.kt b/library/src/main/java/com/pengrad/telegrambot/request/business/DeleteStory.kt
new file mode 100644
index 00000000..24fdc38d
--- /dev/null
+++ b/library/src/main/java/com/pengrad/telegrambot/request/business/DeleteStory.kt
@@ -0,0 +1,16 @@
+package com.pengrad.telegrambot.request.business
+
+import com.pengrad.telegrambot.request.KBaseRequest
+import com.pengrad.telegrambot.response.BaseResponse
+import com.pengrad.telegrambot.utility.kotlin.requestParameter
+
+@Suppress("unused")
+class DeleteStory(
+ businessConnectionId: String,
+ storyId: Int
+): KBaseRequest(BaseResponse::class) {
+
+ val businessConnectionId: String by requestParameter(businessConnectionId, customParameterName = "business_connection_id")
+ val storyId: Int by requestParameter(storyId, customParameterName = "story_id")
+
+}
\ No newline at end of file
diff --git a/library/src/main/java/com/pengrad/telegrambot/request/business/EditStory.kt b/library/src/main/java/com/pengrad/telegrambot/request/business/EditStory.kt
new file mode 100644
index 00000000..ca7e6e87
--- /dev/null
+++ b/library/src/main/java/com/pengrad/telegrambot/request/business/EditStory.kt
@@ -0,0 +1,48 @@
+package com.pengrad.telegrambot.request.business
+
+import com.pengrad.telegrambot.model.MessageEntity
+import com.pengrad.telegrambot.model.story.StoryArea
+import com.pengrad.telegrambot.model.story.inputstory.InputStoryContent
+import com.pengrad.telegrambot.request.KBaseRequest
+import com.pengrad.telegrambot.response.EditStoryResponse
+import com.pengrad.telegrambot.utility.kotlin.optionalRequestParameter
+import com.pengrad.telegrambot.utility.kotlin.requestParameter
+
+@Suppress("unused")
+class EditStory private constructor(
+ businessConnectionId: String,
+ storyId: Int,
+ content: InputStoryContent,
+ caption: String?,
+ parseMode: String?,
+ captionEntities: Array?,
+ areas: Array?
+): KBaseRequest(EditStoryResponse::class) {
+
+ constructor(businessConnectionId: String, storyId: Int, content: InputStoryContent) : this(
+ businessConnectionId = businessConnectionId,
+ storyId = storyId,
+ content = content,
+ caption = null,
+ parseMode = null,
+ captionEntities = null,
+ areas = null
+ )
+
+ val businessConnectionId: String by requestParameter(businessConnectionId, customParameterName = "business_connection_id")
+ val storyId: Int by requestParameter(storyId, customParameterName = "story_id")
+ val content: InputStoryContent by requestParameter(content, customParameterName = "content")
+
+ var caption: String? by optionalRequestParameter(caption, customParameterName = "caption")
+ fun caption(caption: String) = applySelf { this.caption = caption }
+
+ var parseMode: String? by optionalRequestParameter(parseMode, customParameterName = "parse_mode")
+ fun parseMode(parseMode: String) = applySelf { this.parseMode = parseMode }
+
+ var captionEntities: Array? by optionalRequestParameter(captionEntities, customParameterName = "caption_entities")
+ fun captionEntities(captionEntities: Array) = applySelf { this.captionEntities = captionEntities }
+
+ var areas: Array? by optionalRequestParameter(areas, customParameterName = "areas")
+ fun areas(areas: Array) = applySelf { this.areas = areas }
+
+}
\ No newline at end of file
diff --git a/library/src/main/java/com/pengrad/telegrambot/request/business/GetBusinessAccountGifts.kt b/library/src/main/java/com/pengrad/telegrambot/request/business/GetBusinessAccountGifts.kt
new file mode 100644
index 00000000..30d62eef
--- /dev/null
+++ b/library/src/main/java/com/pengrad/telegrambot/request/business/GetBusinessAccountGifts.kt
@@ -0,0 +1,59 @@
+package com.pengrad.telegrambot.request.business
+
+import com.pengrad.telegrambot.request.KBaseRequest
+import com.pengrad.telegrambot.response.GetBusinessAccountGiftsResponse
+import com.pengrad.telegrambot.utility.kotlin.optionalRequestParameter
+import com.pengrad.telegrambot.utility.kotlin.requestParameter
+
+@Suppress("unused")
+class GetBusinessAccountGifts private constructor(
+ businessConnectionId: String,
+ excludeUnsaved: Boolean?,
+ excludeSaved: Boolean?,
+ excludeUnlimited: Boolean?,
+ excludeLimited: Boolean?,
+ excludeUnique: Boolean?,
+ sortByPrice: Boolean?,
+ offset: String?,
+ limit: Int?
+): KBaseRequest(GetBusinessAccountGiftsResponse::class) {
+
+ constructor(businessConnectionId: String) : this(
+ businessConnectionId = businessConnectionId,
+ excludeUnsaved = null,
+ excludeSaved = null,
+ excludeUnlimited = null,
+ excludeLimited = null,
+ excludeUnique = null,
+ sortByPrice = null,
+ offset = null,
+ limit = null,
+ )
+
+ val businessConnectionId: String by requestParameter(businessConnectionId, customParameterName = "business_connection_id")
+
+ var excludeUnsaved: Boolean? by optionalRequestParameter(excludeUnsaved, customParameterName = "exclude_unsaved")
+ fun excludeUnsaved(excludeUnsaved: Boolean) = applySelf { this.excludeUnsaved = excludeUnsaved }
+
+ var excludeSaved: Boolean? by optionalRequestParameter(excludeSaved, customParameterName = "exclude_saved")
+ fun excludeSaved(excludeSaved: Boolean) = applySelf { this.excludeSaved = excludeSaved }
+
+ var excludeUnlimited: Boolean? by optionalRequestParameter(excludeUnlimited, customParameterName = "exclude_unlimited")
+ fun excludeUnlimited(excludeUnlimited: Boolean) = applySelf { this.excludeUnlimited = excludeUnlimited }
+
+ var excludeLimited: Boolean? by optionalRequestParameter(excludeLimited, customParameterName = "exclude_limited")
+ fun excludeLimited(excludeLimited: Boolean) = applySelf { this.excludeLimited = excludeLimited }
+
+ var excludeUnique: Boolean? by optionalRequestParameter(excludeUnique, customParameterName = "exclude_unique")
+ fun excludeUnique(excludeUnique: Boolean) = applySelf { this.excludeUnique = excludeUnique }
+
+ var sortByPrice: Boolean? by optionalRequestParameter(sortByPrice, customParameterName = "sort_by_price")
+ fun sortByPrice(sortByPrice: Boolean) = applySelf { this.sortByPrice = sortByPrice }
+
+ var offset: String? by optionalRequestParameter(offset, customParameterName = "offset")
+ fun offset(offset: String) = applySelf { this.offset = offset }
+
+ var limit: Int? by optionalRequestParameter(limit, customParameterName = "limit")
+ fun limit(limit: Int) = applySelf { this.limit = limit }
+
+}
\ No newline at end of file
diff --git a/library/src/main/java/com/pengrad/telegrambot/request/business/GetBusinessAccountStarBalance.kt b/library/src/main/java/com/pengrad/telegrambot/request/business/GetBusinessAccountStarBalance.kt
new file mode 100644
index 00000000..d9ad399f
--- /dev/null
+++ b/library/src/main/java/com/pengrad/telegrambot/request/business/GetBusinessAccountStarBalance.kt
@@ -0,0 +1,13 @@
+package com.pengrad.telegrambot.request.business
+
+import com.pengrad.telegrambot.request.KBaseRequest
+import com.pengrad.telegrambot.response.GetBusinessAccountStarBalanceResponse
+import com.pengrad.telegrambot.utility.kotlin.requestParameter
+
+@Suppress("unused")
+class GetBusinessAccountStarBalance(
+ businessConnectionId: String
+): KBaseRequest(GetBusinessAccountStarBalanceResponse::class) {
+
+ val businessConnectionId: String by requestParameter(businessConnectionId, customParameterName = "business_connection_id")
+}
\ No newline at end of file
diff --git a/library/src/main/java/com/pengrad/telegrambot/request/business/PostStory.kt b/library/src/main/java/com/pengrad/telegrambot/request/business/PostStory.kt
new file mode 100644
index 00000000..98cd06cd
--- /dev/null
+++ b/library/src/main/java/com/pengrad/telegrambot/request/business/PostStory.kt
@@ -0,0 +1,58 @@
+package com.pengrad.telegrambot.request.business
+
+import com.pengrad.telegrambot.model.MessageEntity
+import com.pengrad.telegrambot.model.story.StoryArea
+import com.pengrad.telegrambot.model.story.inputstory.InputStoryContent
+import com.pengrad.telegrambot.request.KBaseRequest
+import com.pengrad.telegrambot.response.PostStoryResponse
+import com.pengrad.telegrambot.utility.kotlin.optionalRequestParameter
+import com.pengrad.telegrambot.utility.kotlin.requestParameter
+
+@Suppress("unused")
+class PostStory private constructor(
+ businessConnectionId: String,
+ content: InputStoryContent,
+ activePeriod: Int,
+ caption: String?,
+ parseMode: String?,
+ captionEntities: Array?,
+ areas: Array?,
+ postToChatPage: Boolean?,
+ protectContent: Boolean?
+): KBaseRequest(PostStoryResponse::class) {
+
+ constructor(businessConnectionId: String, content: InputStoryContent, activePeriod: Int) : this(
+ businessConnectionId = businessConnectionId,
+ content = content,
+ activePeriod = activePeriod,
+ caption = null,
+ parseMode = null,
+ captionEntities = null,
+ areas = null,
+ postToChatPage = null,
+ protectContent = null
+ )
+
+ val businessConnectionId: String by requestParameter(businessConnectionId, customParameterName = "business_connection_id")
+ val content: InputStoryContent by requestParameter(content, customParameterName = "content")
+ val activePeriod: Int by requestParameter(activePeriod, customParameterName = "active_period")
+
+ var caption: String? by optionalRequestParameter(caption, customParameterName = "caption")
+ fun caption(caption: String) = applySelf { this.caption = caption }
+
+ var parseMode: String? by optionalRequestParameter(parseMode, customParameterName = "parse_mode")
+ fun parseMode(parseMode: String) = applySelf { this.parseMode = parseMode }
+
+ var captionEntities: Array? by optionalRequestParameter(captionEntities, customParameterName = "caption_entities")
+ fun captionEntities(captionEntities: Array) = applySelf { this.captionEntities = captionEntities }
+
+ var areas: Array? by optionalRequestParameter(areas, customParameterName = "areas")
+ fun areas(areas: Array) = applySelf { this.areas = areas }
+
+ var postToChatPage: Boolean? by optionalRequestParameter(postToChatPage, customParameterName = "post_to_chat_page")
+ fun postToChatPage(postToChatPage: Boolean) = applySelf { this.postToChatPage = postToChatPage }
+
+ var protectContent: Boolean? by optionalRequestParameter(protectContent, customParameterName = "protect_content")
+ fun protectContent(protectContent: Boolean) = applySelf { this.protectContent = protectContent }
+
+}
\ No newline at end of file
diff --git a/library/src/main/java/com/pengrad/telegrambot/request/business/ReadBusinessMessage.kt b/library/src/main/java/com/pengrad/telegrambot/request/business/ReadBusinessMessage.kt
new file mode 100644
index 00000000..1894d1e7
--- /dev/null
+++ b/library/src/main/java/com/pengrad/telegrambot/request/business/ReadBusinessMessage.kt
@@ -0,0 +1,17 @@
+package com.pengrad.telegrambot.request.business
+
+import com.pengrad.telegrambot.request.KBaseRequest
+import com.pengrad.telegrambot.response.BaseResponse
+import com.pengrad.telegrambot.utility.kotlin.requestParameter
+
+class ReadBusinessMessage(
+ businessConnectionId: String,
+ chatId: Long,
+ messageId: Int
+) : KBaseRequest(BaseResponse::class) {
+
+ val businessConnectionId: String by requestParameter(businessConnectionId, customParameterName = "business_connection_id")
+ val chatId: Long by requestParameter(chatId, customParameterName = "chat_id")
+ val messageId: Int by requestParameter(messageId, customParameterName = "message_id")
+
+}
\ No newline at end of file
diff --git a/library/src/main/java/com/pengrad/telegrambot/request/business/RemoveBusinessAccountProfilePhoto.kt b/library/src/main/java/com/pengrad/telegrambot/request/business/RemoveBusinessAccountProfilePhoto.kt
new file mode 100644
index 00000000..48d5d87a
--- /dev/null
+++ b/library/src/main/java/com/pengrad/telegrambot/request/business/RemoveBusinessAccountProfilePhoto.kt
@@ -0,0 +1,24 @@
+package com.pengrad.telegrambot.request.business
+
+import com.pengrad.telegrambot.request.KBaseRequest
+import com.pengrad.telegrambot.response.BaseResponse
+import com.pengrad.telegrambot.utility.kotlin.optionalRequestParameter
+import com.pengrad.telegrambot.utility.kotlin.requestParameter
+
+@Suppress("unused")
+class RemoveBusinessAccountProfilePhoto private constructor(
+ businessConnectionId: String,
+ isPublic: Boolean?
+) : KBaseRequest(BaseResponse::class) {
+
+ constructor(businessConnectionId: String) : this(
+ businessConnectionId = businessConnectionId,
+ isPublic = null
+ )
+
+ val businessConnectionId: String by requestParameter(businessConnectionId, customParameterName = "business_connection_id")
+
+ var isPublic: Boolean? by optionalRequestParameter(isPublic, customParameterName = "is_public")
+ fun isPublic(isPublic: Boolean) = applySelf { this.isPublic = isPublic }
+
+}
\ No newline at end of file
diff --git a/library/src/main/java/com/pengrad/telegrambot/request/business/SetBusinessAccountBio.kt b/library/src/main/java/com/pengrad/telegrambot/request/business/SetBusinessAccountBio.kt
new file mode 100644
index 00000000..580e8d58
--- /dev/null
+++ b/library/src/main/java/com/pengrad/telegrambot/request/business/SetBusinessAccountBio.kt
@@ -0,0 +1,24 @@
+package com.pengrad.telegrambot.request.business
+
+import com.pengrad.telegrambot.request.KBaseRequest
+import com.pengrad.telegrambot.response.BaseResponse
+import com.pengrad.telegrambot.utility.kotlin.optionalRequestParameter
+import com.pengrad.telegrambot.utility.kotlin.requestParameter
+
+@Suppress("unused")
+class SetBusinessAccountBio private constructor(
+ businessConnectionId: String,
+ bio: String?
+): KBaseRequest(BaseResponse::class) {
+
+ constructor(businessConnectionId: String) : this(
+ businessConnectionId = businessConnectionId,
+ bio = null
+ )
+
+ val businessConnectionId: String by requestParameter(businessConnectionId, customParameterName = "business_connection_id")
+
+ var bio: String? by optionalRequestParameter(bio, customParameterName = "bio")
+ fun bio(bio: String) = applySelf { this.bio = bio }
+
+}
\ No newline at end of file
diff --git a/library/src/main/java/com/pengrad/telegrambot/request/business/SetBusinessAccountGiftSettings.kt b/library/src/main/java/com/pengrad/telegrambot/request/business/SetBusinessAccountGiftSettings.kt
new file mode 100644
index 00000000..183e93d9
--- /dev/null
+++ b/library/src/main/java/com/pengrad/telegrambot/request/business/SetBusinessAccountGiftSettings.kt
@@ -0,0 +1,19 @@
+package com.pengrad.telegrambot.request.business
+
+import com.pengrad.telegrambot.model.gift.AcceptedGiftTypes
+import com.pengrad.telegrambot.request.KBaseRequest
+import com.pengrad.telegrambot.response.BaseResponse
+import com.pengrad.telegrambot.utility.kotlin.requestParameter
+
+@Suppress("unused")
+class SetBusinessAccountGiftSettings(
+ businessConnectionId: String,
+ showGiftButton: Boolean,
+ acceptedGiftTypes: AcceptedGiftTypes
+): KBaseRequest(BaseResponse::class) {
+
+ val businessConnectionId: String by requestParameter(businessConnectionId, customParameterName = "business_connection_id")
+ val showGiftButton: Boolean by requestParameter(showGiftButton, customParameterName = "show_gift_button")
+ val acceptedGiftTypes: AcceptedGiftTypes by requestParameter(acceptedGiftTypes, customParameterName = "accepted_gift_types")
+
+}
\ No newline at end of file
diff --git a/library/src/main/java/com/pengrad/telegrambot/request/business/SetBusinessAccountName.kt b/library/src/main/java/com/pengrad/telegrambot/request/business/SetBusinessAccountName.kt
new file mode 100644
index 00000000..8d2551bd
--- /dev/null
+++ b/library/src/main/java/com/pengrad/telegrambot/request/business/SetBusinessAccountName.kt
@@ -0,0 +1,27 @@
+package com.pengrad.telegrambot.request.business
+
+import com.pengrad.telegrambot.request.KBaseRequest
+import com.pengrad.telegrambot.response.BaseResponse
+import com.pengrad.telegrambot.utility.kotlin.optionalRequestParameter
+import com.pengrad.telegrambot.utility.kotlin.requestParameter
+
+@Suppress("unused")
+class SetBusinessAccountName private constructor(
+ businessConnectionId: String,
+ firstName: String,
+ lastName: String?
+) : KBaseRequest(BaseResponse::class) {
+
+ constructor(businessConnectionId: String, firstName: String) : this(
+ businessConnectionId = businessConnectionId,
+ firstName = firstName,
+ lastName = null
+ )
+
+ val businessConnectionId: String by requestParameter(businessConnectionId, customParameterName = "business_connection_id")
+ val firstName: String by requestParameter(firstName, customParameterName = "first_name")
+
+ var lastName: String? by optionalRequestParameter(lastName, customParameterName = "last_name")
+ fun lastName(lastName: String) = applySelf { this.lastName = lastName }
+
+}
\ No newline at end of file
diff --git a/library/src/main/java/com/pengrad/telegrambot/request/business/SetBusinessAccountProfilePhoto.kt b/library/src/main/java/com/pengrad/telegrambot/request/business/SetBusinessAccountProfilePhoto.kt
new file mode 100644
index 00000000..ce09d449
--- /dev/null
+++ b/library/src/main/java/com/pengrad/telegrambot/request/business/SetBusinessAccountProfilePhoto.kt
@@ -0,0 +1,28 @@
+package com.pengrad.telegrambot.request.business
+
+import com.pengrad.telegrambot.model.inputprofilephoto.InputProfilePhoto
+import com.pengrad.telegrambot.request.KBaseRequest
+import com.pengrad.telegrambot.response.BaseResponse
+import com.pengrad.telegrambot.utility.kotlin.optionalRequestParameter
+import com.pengrad.telegrambot.utility.kotlin.requestParameter
+
+@Suppress("unused")
+class SetBusinessAccountProfilePhoto private constructor(
+ businessConnectionId: String,
+ photo: InputProfilePhoto,
+ isPublic: Boolean?
+) : KBaseRequest(BaseResponse::class) {
+
+ constructor(businessConnectionId: String, photo: InputProfilePhoto) : this(
+ businessConnectionId = businessConnectionId,
+ photo = photo,
+ isPublic = null
+ )
+
+ val businessConnectionId: String by requestParameter(businessConnectionId, customParameterName = "business_connection_id")
+ val photo: InputProfilePhoto by requestParameter(photo, customParameterName = "photo")
+
+ var isPublic: Boolean? by optionalRequestParameter(isPublic, customParameterName = "is_public")
+ fun isPublic(isPublic: Boolean) = applySelf { this.isPublic = isPublic }
+
+}
\ No newline at end of file
diff --git a/library/src/main/java/com/pengrad/telegrambot/request/business/SetBusinessAccountUsername.kt b/library/src/main/java/com/pengrad/telegrambot/request/business/SetBusinessAccountUsername.kt
new file mode 100644
index 00000000..bc79b0bc
--- /dev/null
+++ b/library/src/main/java/com/pengrad/telegrambot/request/business/SetBusinessAccountUsername.kt
@@ -0,0 +1,24 @@
+package com.pengrad.telegrambot.request.business
+
+import com.pengrad.telegrambot.request.KBaseRequest
+import com.pengrad.telegrambot.response.BaseResponse
+import com.pengrad.telegrambot.utility.kotlin.optionalRequestParameter
+import com.pengrad.telegrambot.utility.kotlin.requestParameter
+
+@Suppress("unused")
+class SetBusinessAccountUsername private constructor(
+ businessConnectionId: String,
+ username: String?
+): KBaseRequest(BaseResponse::class) {
+
+ constructor(businessConnectionId: String) : this(
+ businessConnectionId = businessConnectionId,
+ username = null
+ )
+
+ val businessConnectionId: String by requestParameter(businessConnectionId, customParameterName = "business_connection_id")
+
+ var username: String? by optionalRequestParameter(username, customParameterName = "username")
+ fun username(username: String) = applySelf { this.username = username }
+
+}
\ No newline at end of file
diff --git a/library/src/main/java/com/pengrad/telegrambot/request/business/TransferBusinessAccountStars.kt b/library/src/main/java/com/pengrad/telegrambot/request/business/TransferBusinessAccountStars.kt
new file mode 100644
index 00000000..9d0d633c
--- /dev/null
+++ b/library/src/main/java/com/pengrad/telegrambot/request/business/TransferBusinessAccountStars.kt
@@ -0,0 +1,16 @@
+package com.pengrad.telegrambot.request.business
+
+import com.pengrad.telegrambot.request.KBaseRequest
+import com.pengrad.telegrambot.response.BaseResponse
+import com.pengrad.telegrambot.utility.kotlin.requestParameter
+
+@Suppress("unused")
+class TransferBusinessAccountStars(
+ businessConnectionId: String,
+ starCount: Int
+): KBaseRequest(BaseResponse::class) {
+
+ val businessConnectionId: String by requestParameter(businessConnectionId, customParameterName = "business_connection_id")
+ val starCount: Int by requestParameter(starCount, customParameterName = "star_count")
+
+}
\ No newline at end of file
diff --git a/library/src/main/java/com/pengrad/telegrambot/request/business/TransferGift.kt b/library/src/main/java/com/pengrad/telegrambot/request/business/TransferGift.kt
new file mode 100644
index 00000000..e9247f06
--- /dev/null
+++ b/library/src/main/java/com/pengrad/telegrambot/request/business/TransferGift.kt
@@ -0,0 +1,30 @@
+package com.pengrad.telegrambot.request.business
+
+import com.pengrad.telegrambot.request.KBaseRequest
+import com.pengrad.telegrambot.response.BaseResponse
+import com.pengrad.telegrambot.utility.kotlin.optionalRequestParameter
+import com.pengrad.telegrambot.utility.kotlin.requestParameter
+
+@Suppress("unused")
+class TransferGift private constructor(
+ businessConnectionId: String,
+ ownedGiftId: String,
+ newOwnerChatId: Long,
+ starCount: Int?
+): KBaseRequest(BaseResponse::class) {
+
+ constructor(businessConnectionId: String, ownedGiftId: String, newOwnerChatId: Long) : this(
+ businessConnectionId = businessConnectionId,
+ ownedGiftId = ownedGiftId,
+ newOwnerChatId = newOwnerChatId,
+ starCount = null
+ )
+
+ val businessConnectionId: String by requestParameter(businessConnectionId, customParameterName = "business_connection_id")
+ val ownedGiftId: String by requestParameter(ownedGiftId, customParameterName = "owned_gift_id")
+ val newOwnerChatId: Long by requestParameter(newOwnerChatId, customParameterName = "new_owner_chat_id")
+
+ var starCount: Int? by optionalRequestParameter(starCount, customParameterName = "star_count")
+ fun starCount(starCount: Int) = applySelf { this.starCount = starCount }
+
+}
\ No newline at end of file
diff --git a/library/src/main/java/com/pengrad/telegrambot/request/business/UpgradeGift.kt b/library/src/main/java/com/pengrad/telegrambot/request/business/UpgradeGift.kt
new file mode 100644
index 00000000..bcf162f3
--- /dev/null
+++ b/library/src/main/java/com/pengrad/telegrambot/request/business/UpgradeGift.kt
@@ -0,0 +1,32 @@
+package com.pengrad.telegrambot.request.business
+
+import com.pengrad.telegrambot.request.KBaseRequest
+import com.pengrad.telegrambot.response.BaseResponse
+import com.pengrad.telegrambot.utility.kotlin.optionalRequestParameter
+import com.pengrad.telegrambot.utility.kotlin.requestParameter
+
+@Suppress("unused")
+class UpgradeGift private constructor(
+ businessConnectionId: String,
+ ownedGiftId: String,
+ keepOriginalDetails: Boolean?,
+ starCount: Int?
+): KBaseRequest(BaseResponse::class) {
+
+ constructor(businessConnectionId: String, ownedGiftId: String) : this(
+ businessConnectionId = businessConnectionId,
+ ownedGiftId = ownedGiftId,
+ keepOriginalDetails = null,
+ starCount = null
+ )
+
+ val businessConnectionId: String by requestParameter(businessConnectionId, customParameterName = "business_connection_id")
+ val ownedGiftId: String by requestParameter(ownedGiftId, customParameterName = "owned_gift_id")
+
+ var keepOriginalDetails: Boolean? by optionalRequestParameter(keepOriginalDetails, customParameterName = "keep_original_details")
+ fun keepOriginalDetails(keepOriginalDetails: Boolean) = applySelf { this.keepOriginalDetails = keepOriginalDetails }
+
+ var starCount: Int? by optionalRequestParameter(starCount, customParameterName = "star_count")
+ fun starCount(starCount: Int) = applySelf { this.starCount = starCount }
+
+}
\ No newline at end of file
diff --git a/library/src/main/java/com/pengrad/telegrambot/response/EditStoryResponse.kt b/library/src/main/java/com/pengrad/telegrambot/response/EditStoryResponse.kt
new file mode 100644
index 00000000..7ec088d7
--- /dev/null
+++ b/library/src/main/java/com/pengrad/telegrambot/response/EditStoryResponse.kt
@@ -0,0 +1,5 @@
+package com.pengrad.telegrambot.response
+
+import com.pengrad.telegrambot.model.Story
+
+data class EditStoryResponse(val result: Story) : BaseResponse()
diff --git a/library/src/main/java/com/pengrad/telegrambot/response/GetBusinessAccountGiftsResponse.kt b/library/src/main/java/com/pengrad/telegrambot/response/GetBusinessAccountGiftsResponse.kt
new file mode 100644
index 00000000..e67ddee9
--- /dev/null
+++ b/library/src/main/java/com/pengrad/telegrambot/response/GetBusinessAccountGiftsResponse.kt
@@ -0,0 +1,5 @@
+package com.pengrad.telegrambot.response
+
+import com.pengrad.telegrambot.model.gift.owned.OwnedGifts
+
+data class GetBusinessAccountGiftsResponse(val result: OwnedGifts) : BaseResponse()
diff --git a/library/src/main/java/com/pengrad/telegrambot/response/GetBusinessAccountStarBalanceResponse.kt b/library/src/main/java/com/pengrad/telegrambot/response/GetBusinessAccountStarBalanceResponse.kt
new file mode 100644
index 00000000..5ca9a358
--- /dev/null
+++ b/library/src/main/java/com/pengrad/telegrambot/response/GetBusinessAccountStarBalanceResponse.kt
@@ -0,0 +1,5 @@
+package com.pengrad.telegrambot.response
+
+import com.pengrad.telegrambot.model.stars.StarAmount
+
+data class GetBusinessAccountStarBalanceResponse(val result: StarAmount) : BaseResponse()
diff --git a/library/src/main/java/com/pengrad/telegrambot/response/PostStoryResponse.kt b/library/src/main/java/com/pengrad/telegrambot/response/PostStoryResponse.kt
new file mode 100644
index 00000000..7757c8c9
--- /dev/null
+++ b/library/src/main/java/com/pengrad/telegrambot/response/PostStoryResponse.kt
@@ -0,0 +1,5 @@
+package com.pengrad.telegrambot.response
+
+import com.pengrad.telegrambot.model.Story
+
+data class PostStoryResponse(val result: Story) : BaseResponse()
diff --git a/library/src/main/java/com/pengrad/telegrambot/utility/BotUtils.java b/library/src/main/java/com/pengrad/telegrambot/utility/BotUtils.java
index 4df59f51..323a79e0 100644
--- a/library/src/main/java/com/pengrad/telegrambot/utility/BotUtils.java
+++ b/library/src/main/java/com/pengrad/telegrambot/utility/BotUtils.java
@@ -7,6 +7,7 @@
import com.pengrad.telegrambot.model.chatbackground.BackgroundFill;
import com.pengrad.telegrambot.model.chatbackground.BackgroundType;
import com.pengrad.telegrambot.model.chatboost.source.ChatBoostSource;
+import com.pengrad.telegrambot.model.gift.owned.OwnedGift;
import com.pengrad.telegrambot.model.message.MaybeInaccessibleMessage;
import com.pengrad.telegrambot.model.message.origin.MessageOrigin;
import com.pengrad.telegrambot.model.paidmedia.PaidMedia;
@@ -38,6 +39,7 @@ private BotUtils() {}
.registerTypeAdapter(RevenueWithdrawalState.class, new RevenueWithdrawalStateTypeAdapter())
.registerTypeAdapter(TransactionPartner.class, TransactionPartnerTypeAdapter.INSTANCE)
.registerTypeAdapter(PaidMedia.class, new PaidMediaTypeAdapter())
+ .registerTypeAdapter(OwnedGift.class, new OwnedGiftTypeAdapter())
.setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES)
.create();
diff --git a/library/src/main/java/com/pengrad/telegrambot/utility/gson/OwnedGiftTypeAdapter.java b/library/src/main/java/com/pengrad/telegrambot/utility/gson/OwnedGiftTypeAdapter.java
new file mode 100644
index 00000000..0a82708d
--- /dev/null
+++ b/library/src/main/java/com/pengrad/telegrambot/utility/gson/OwnedGiftTypeAdapter.java
@@ -0,0 +1,30 @@
+package com.pengrad.telegrambot.utility.gson;
+
+import com.google.gson.*;
+import com.pengrad.telegrambot.model.gift.owned.OwnedGift;
+import com.pengrad.telegrambot.model.gift.owned.OwnedGiftRegular;
+import com.pengrad.telegrambot.model.gift.owned.OwnedGiftUnique;
+import com.pengrad.telegrambot.model.paidmedia.PaidMedia;
+import com.pengrad.telegrambot.model.paidmedia.PaidMediaPhoto;
+import com.pengrad.telegrambot.model.paidmedia.PaidMediaPreview;
+import com.pengrad.telegrambot.model.paidmedia.PaidMediaVideo;
+
+import java.lang.reflect.Type;
+
+public class OwnedGiftTypeAdapter implements JsonDeserializer {
+
+ @Override
+ public OwnedGift deserialize(JsonElement element, Type type, JsonDeserializationContext context) throws JsonParseException {
+ JsonObject object = element.getAsJsonObject();
+ JsonPrimitive primitive = object.getAsJsonPrimitive("type");
+ String discriminator = primitive != null ? primitive.getAsString() : "unknown";
+
+ if (OwnedGiftRegular.TYPE.equals(discriminator)) {
+ return context.deserialize(object, OwnedGiftRegular.class);
+ } else if (OwnedGiftUnique.TYPE.equals(discriminator)) {
+ return context.deserialize(object, OwnedGiftUnique.class);
+ }
+
+ return new OwnedGift(discriminator);
+ }
+}
diff --git a/pom.xml b/pom.xml
index dbb3742b..70627d4d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -9,7 +9,7 @@
4.0.0
com.github.pengrad
java-telegram-bot-api
- 8.3.0
+ 9.0.0
JavaTelegramBotApi
Java API for Telegram Bot API
https://github.com/pengrad/java-telegram-bot-api/