diff --git a/pom.xml b/pom.xml index 37ee8b5b6..9705a4079 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ org.telegram Bots pom - 7.4.2 + 7.5.0 telegrambots-meta diff --git a/telegrambots-abilities/pom.xml b/telegrambots-abilities/pom.xml index 63b30d2be..ec1069743 100644 --- a/telegrambots-abilities/pom.xml +++ b/telegrambots-abilities/pom.xml @@ -7,7 +7,7 @@ org.telegram Bots - 7.4.2 + 7.5.0 telegrambots-abilities @@ -104,12 +104,12 @@ org.telegram telegrambots-webhook - 7.4.2 + 7.5.0 org.telegram telegrambots-longpolling - 7.4.2 + 7.5.0 diff --git a/telegrambots-client/pom.xml b/telegrambots-client/pom.xml index 7f0551c4b..fa17bbdf7 100644 --- a/telegrambots-client/pom.xml +++ b/telegrambots-client/pom.xml @@ -7,7 +7,7 @@ org.telegram Bots - 7.4.2 + 7.5.0 Telegram Bots Client diff --git a/telegrambots-client/src/main/java/org/telegram/telegrambots/client/okhttp/OkHttpTelegramClient.java b/telegrambots-client/src/main/java/org/telegram/telegrambots/client/okhttp/OkHttpTelegramClient.java index 010b20126..2a3e228c5 100644 --- a/telegrambots-client/src/main/java/org/telegram/telegrambots/client/okhttp/OkHttpTelegramClient.java +++ b/telegrambots-client/src/main/java/org/telegram/telegrambots/client/okhttp/OkHttpTelegramClient.java @@ -422,6 +422,7 @@ public CompletableFuture executeAsync(EditMessageMedia editMessage builder.addPart(EditMessageMedia.CHAT_ID_FIELD, editMessageMedia.getChatId()) .addPart(EditMessageMedia.MESSAGE_ID_FIELD, editMessageMedia.getMessageId()) .addPart(EditMessageMedia.INLINE_MESSAGE_ID_FIELD, editMessageMedia.getInlineMessageId()) + .addPart(EditMessageMedia.BUSINESS_CONNECTION_ID_FIELD, editMessageMedia.getBusinessConnectionId()) .addJsonPart(EditMessageMedia.REPLY_MARKUP_FIELD, editMessageMedia.getReplyMarkup()); addInputData(builder, EditMessageMedia.MEDIA_FIELD, editMessageMedia.getMedia(), true); diff --git a/telegrambots-extensions/README.md b/telegrambots-extensions/README.md index 7ce474acd..eb5bc7db1 100644 --- a/telegrambots-extensions/README.md +++ b/telegrambots-extensions/README.md @@ -16,12 +16,12 @@ Just import add the library to your project with one of these options: org.telegram telegrambots-extensions - 7.4.2 + 7.5.0 ``` 2. Using Gradle: ```gradle - implementation 'org.telegram:telegrambots-extensions:7.4.2' + implementation 'org.telegram:telegrambots-extensions:7.5.0' ``` \ No newline at end of file diff --git a/telegrambots-extensions/pom.xml b/telegrambots-extensions/pom.xml index 42e53c751..7d99e7176 100644 --- a/telegrambots-extensions/pom.xml +++ b/telegrambots-extensions/pom.xml @@ -7,7 +7,7 @@ org.telegram Bots - 7.4.2 + 7.5.0 telegrambots-extensions @@ -89,12 +89,12 @@ org.telegram telegrambots-webhook - 7.4.2 + 7.5.0 org.telegram telegrambots-longpolling - 7.4.2 + 7.5.0 diff --git a/telegrambots-longpolling/pom.xml b/telegrambots-longpolling/pom.xml index 24e0a7a7b..85af123df 100644 --- a/telegrambots-longpolling/pom.xml +++ b/telegrambots-longpolling/pom.xml @@ -6,7 +6,7 @@ org.telegram Bots - 7.4.2 + 7.5.0 telegrambots-longpolling diff --git a/telegrambots-meta/pom.xml b/telegrambots-meta/pom.xml index c4f64e156..1406719ca 100644 --- a/telegrambots-meta/pom.xml +++ b/telegrambots-meta/pom.xml @@ -7,7 +7,7 @@ org.telegram Bots - 7.4.2 + 7.5.0 telegrambots-meta diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/StopMessageLiveLocation.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/StopMessageLiveLocation.java index 862021374..770ce88e1 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/StopMessageLiveLocation.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/StopMessageLiveLocation.java @@ -37,29 +37,40 @@ public class StopMessageLiveLocation extends BotApiMethodSerializable { public static final String PATH = "stopMessageLiveLocation"; - private static final String CHATID_FIELD = "chat_id"; - private static final String MESSAGEID_FIELD = "message_id"; + private static final String CHAT_ID_FIELD = "chat_id"; + private static final String MESSAGE_ID_FIELD = "message_id"; private static final String INLINE_MESSAGE_ID_FIELD = "inline_message_id"; - private static final String REPLYMARKUP_FIELD = "reply_markup"; + private static final String REPLY_MARKUP_FIELD = "reply_markup"; + private static final String BUSINESS_CONNECTION_ID_FIELD = "business_connection_id"; /** * Required if inline_message_id is not specified. Unique identifier for the chat to send the * message to (Or username for channels) */ - @JsonProperty(CHATID_FIELD) + @JsonProperty(CHAT_ID_FIELD) private String chatId; /** * Required if inline_message_id is not specified. Unique identifier of the sent message */ - @JsonProperty(MESSAGEID_FIELD) + @JsonProperty(MESSAGE_ID_FIELD) private Integer messageId; /** * Required if chat_id and message_id are not specified. Identifier of the inline message */ @JsonProperty(INLINE_MESSAGE_ID_FIELD) private String inlineMessageId; - @JsonProperty(REPLYMARKUP_FIELD) - private InlineKeyboardMarkup replyMarkup; ///< Optional. A JSON-serialized object for an inline keyboard. + /** + * Optional. + * A JSON-serialized object for an inline keyboard. + */ + @JsonProperty(REPLY_MARKUP_FIELD) + private InlineKeyboardMarkup replyMarkup; + /** + * Optional + * Unique identifier of the business connection on behalf of which the message to be edited was sent + */ + @JsonProperty(BUSINESS_CONNECTION_ID_FIELD) + private String businessConnectionId; @Tolerate public void setChatId(Long chatId) { diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/payments/star/GetStarTransactions.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/payments/star/GetStarTransactions.java new file mode 100644 index 000000000..777e6c850 --- /dev/null +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/payments/star/GetStarTransactions.java @@ -0,0 +1,69 @@ +package org.telegram.telegrambots.meta.api.methods.payments.star; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.RequiredArgsConstructor; +import lombok.Setter; +import lombok.ToString; +import lombok.experimental.SuperBuilder; +import lombok.extern.jackson.Jacksonized; +import org.telegram.telegrambots.meta.api.methods.botapimethods.BotApiMethod; +import org.telegram.telegrambots.meta.api.objects.payments.star.StarTransactions; +import org.telegram.telegrambots.meta.exceptions.TelegramApiRequestException; +import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException; + +/** + * @author Ruben Bermudez + * @version 7.5 + * + * Returns the bot's Telegram Star transactions in chronological order. + * On success, returns a StarTransactions object. + */ +@EqualsAndHashCode(callSuper = false) +@Getter +@Setter +@ToString +@RequiredArgsConstructor +@SuperBuilder +@Jacksonized +@JsonIgnoreProperties(ignoreUnknown = true) +public class GetStarTransactions extends BotApiMethod { + public static final String PATH = "getStarTransactions"; + + private static final String OFFSET_FIELD = "offset"; + private static final String LIMIT_FIELD = "limit"; + + /** + * Optional + * Number of transactions to skip in the response + */ + @JsonProperty(OFFSET_FIELD) + private Integer offset; + /** + * Optional + * The maximum number of transactions to be retrieved. + * Values between 1-100 are accepted. + * Defaults to 100. + */ + @JsonProperty(LIMIT_FIELD) + private Integer limit; + + @Override + public StarTransactions deserializeResponse(String answer) throws TelegramApiRequestException { + return deserializeResponse(answer, StarTransactions.class); + } + + @Override + public String getMethod() { + return PATH; + } + + @Override + public void validate() throws TelegramApiValidationException { + if (limit != null && (limit > 100 || limit < 0)) { + throw new TelegramApiValidationException("Limit parameters must be between 0 and 100", this); + } + } +} diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/polls/StopPoll.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/polls/StopPoll.java index e0376aa61..f91b40eab 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/polls/StopPoll.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/polls/StopPoll.java @@ -34,15 +34,28 @@ public class StopPoll extends BotApiMethod { public static final String PATH = "stopPoll"; - private static final String CHATID_FIELD = "chat_id"; - private static final String MESSAGEID_FIELD = "message_id"; + private static final String CHAT_ID_FIELD = "chat_id"; + private static final String MESSAGE_ID_FIELD = "message_id"; + private static final String BUSINESS_CONNECTION_ID_FIELD = "business_connection_id"; - @JsonProperty(CHATID_FIELD) + /** + * Unique identifier for the target chat or username of the target channel (in the format @channelusername) + */ + @JsonProperty(CHAT_ID_FIELD) @NonNull - private String chatId; ///< Unique identifier for the target chat or username of the target channel (in the format @channelusername) - @JsonProperty(MESSAGEID_FIELD) + private String chatId; + /** + * Identifier of the original message with the poll + */ + @JsonProperty(MESSAGE_ID_FIELD) @NonNull - private Integer messageId; ///< Identifier of the original message with the poll + private Integer messageId; + /** + * Optional + * Unique identifier of the business connection on behalf of which the message to be edited was sent + */ + @JsonProperty(BUSINESS_CONNECTION_ID_FIELD) + private String businessConnectionId; @Tolerate public void setChatId(@NonNull Long chatId) { diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/updatingmessages/EditMessageCaption.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/updatingmessages/EditMessageCaption.java index 605311c65..e6ea1b4b8 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/updatingmessages/EditMessageCaption.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/updatingmessages/EditMessageCaption.java @@ -23,7 +23,9 @@ * @author Ruben Bermudez * @version 1.0 * Use this method to edit captions of messages. - * On success, if edited message is sent by the bot, the edited Message is returned, otherwise True is returned. + * On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. + * @apiNote Note that business messages that were not sent by the bot and do not contain an inline keyboard + * can only be edited within 48 hours from the time they were sent. */ @EqualsAndHashCode(callSuper = false) @Getter @@ -35,46 +37,69 @@ public class EditMessageCaption extends BotApiMethodSerializable { public static final String PATH = "editmessagecaption"; - private static final String CHATID_FIELD = "chat_id"; - private static final String MESSAGEID_FIELD = "message_id"; + private static final String CHAT_ID_FIELD = "chat_id"; + private static final String MESSAGE_ID_FIELD = "message_id"; private static final String INLINE_MESSAGE_ID_FIELD = "inline_message_id"; private static final String CAPTION_FIELD = "caption"; - private static final String REPLYMARKUP_FIELD = "reply_markup"; - private static final String PARSEMODE_FIELD = "parse_mode"; + private static final String REPLY_MARKUP_FIELD = "reply_markup"; + private static final String PARSE_MODE_FIELD = "parse_mode"; private static final String CAPTION_ENTITIES_FIELD = "caption_entities"; private static final String SHOW_CAPTION_ABOVE_MEDIA_FIELD = "show_caption_above_media"; + private static final String BUSINESS_CONNECTION_ID_FIELD = "business_connection_id"; /** * Required if inline_message_id is not specified. Unique identifier for the chat to send the * message to (Or username for channels) */ - @JsonProperty(CHATID_FIELD) + @JsonProperty(CHAT_ID_FIELD) private String chatId; /** * Required if inline_message_id is not specified. Unique identifier of the sent message */ - @JsonProperty(MESSAGEID_FIELD) + @JsonProperty(MESSAGE_ID_FIELD) private Integer messageId; /** * Required if chat_id and message_id are not specified. Identifier of the inline message */ @JsonProperty(INLINE_MESSAGE_ID_FIELD) private String inlineMessageId; + /** + * Optional. + * New caption of the message + */ @JsonProperty(CAPTION_FIELD) - private String caption; ///< Optional. New caption of the message - @JsonProperty(REPLYMARKUP_FIELD) - private InlineKeyboardMarkup replyMarkup; ///< Optional. A JSON-serialized object for an inline keyboard. - @JsonProperty(PARSEMODE_FIELD) - private String parseMode; ///< Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. + private String caption; + /** + * Optional. + * A JSON-serialized object for an inline keyboard. + */ + @JsonProperty(REPLY_MARKUP_FIELD) + private InlineKeyboardMarkup replyMarkup; + /** + * Optional. + * Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. + */ + @JsonProperty(PARSE_MODE_FIELD) + private String parseMode; + /** + * Optional. + * List of special entities that appear in the caption, which can be specified instead of parse_mode + */ @JsonProperty(CAPTION_ENTITIES_FIELD) @Singular - private List captionEntities; ///< Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode + private List captionEntities; /** * Optional. * Pass True, if the caption must be shown above the message media */ @JsonProperty(SHOW_CAPTION_ABOVE_MEDIA_FIELD) private Boolean showCaptionAboveMedia; + /** + * Optional + * Unique identifier of the business connection on behalf of which the message to be edited was sent + */ + @JsonProperty(BUSINESS_CONNECTION_ID_FIELD) + private String businessConnectionId; @Tolerate public void setChatId(Long chatId) { diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/updatingmessages/EditMessageLiveLocation.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/updatingmessages/EditMessageLiveLocation.java index e3781c30b..6d6fe6146 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/updatingmessages/EditMessageLiveLocation.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/updatingmessages/EditMessageLiveLocation.java @@ -47,6 +47,7 @@ public class EditMessageLiveLocation extends BotApiMethodSerializable { private static final String HEADING_FIELD = "heading"; private static final String PROXIMITY_ALERT_RADIUS_FIELD = "proximity_alert_radius"; private static final String LIVE_PERIOD_FIELD = "live_period"; + private static final String BUSINESS_CONNECTION_ID_FIELD = "business_connection_id"; /** * Required if inline_message_id is not specified. Unique identifier for the chat to send the @@ -64,14 +65,24 @@ public class EditMessageLiveLocation extends BotApiMethodSerializable { */ @JsonProperty(INLINE_MESSAGE_ID_FIELD) private String inlineMessageId; + /** + * Latitude of new location + */ @JsonProperty(LATITUDE_FIELD) @NonNull - private Double latitude; ///< Latitude of new location + private Double latitude; + /** + * Longitude of new location + */ @JsonProperty(LONGITUDE_FIELD) @NonNull - private Double longitude; ///< Longitude of new location + private Double longitude; + /** + * Optional. + * A JSON-serialized object for an inline keyboard. + */ @JsonProperty(REPLY_MARKUP_FIELD) - private InlineKeyboardMarkup replyMarkup; ///< Optional. A JSON-serialized object for an inline keyboard. + private InlineKeyboardMarkup replyMarkup; /** * Optional. * The radius of uncertainty for the location, measured in meters; 0-1500 @@ -102,6 +113,13 @@ public class EditMessageLiveLocation extends BotApiMethodSerializable { */ @JsonProperty(LIVE_PERIOD_FIELD) private Integer livePeriod; + /** + * Optional + * Unique identifier of the business connection on behalf of which the message to be edited was sent + */ + @JsonProperty(BUSINESS_CONNECTION_ID_FIELD) + private String businessConnectionId; + @Tolerate public void setChatId(Long chatId) { diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/updatingmessages/EditMessageMedia.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/updatingmessages/EditMessageMedia.java index 0e7d07646..be63b8865 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/updatingmessages/EditMessageMedia.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/updatingmessages/EditMessageMedia.java @@ -27,12 +27,14 @@ /** * @author Ruben Bermudez * @version 4.0.0 - * Use this method to edit audio, document, photo, or video messages. - * f a message is part of a message album, then it can be edited only to an audio for audio albums, - * only to a document for document albums and to a photo or a video otherwise - * When an inline message is edited, a new file can't be uploaded. - * Use a previously uploaded file via its file_id or specify a URL. - * On success, if the edited message was sent by the bot, the edited Message is returned, otherwise True is returned. + * Use this method to edit animation, audio, document, photo, or video messages. + * If a message is part of a message album, then it can be edited only to an audio for audio albums, + * only to a document for document albums and to a photo or a video otherwise. + * When an inline message is edited, a new file can't be uploaded; use a previously uploaded file via its file_id or + * specify a URL. + * On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. + * @apiNote Note that business messages that were not sent by the bot and do not contain an inline + * keyboard can only be edited within 48 hours from the time they were sent. */ @EqualsAndHashCode(callSuper = false) @Getter @@ -51,6 +53,7 @@ public class EditMessageMedia extends PartialBotApiMethod { public static final String INLINE_MESSAGE_ID_FIELD = "inline_message_id"; public static final String MEDIA_FIELD = "media"; public static final String REPLY_MARKUP_FIELD = "reply_markup"; + public static final String BUSINESS_CONNECTION_ID_FIELD = "business_connection_id"; /** * Required if inline_message_id is not specified. Unique identifier for the chat to send the @@ -74,9 +77,18 @@ public class EditMessageMedia extends PartialBotApiMethod { @NonNull @JsonProperty(MEDIA_FIELD) private InputMedia media; - + /** + * Optional + * Unique identifier of the business connection on behalf of which the message to be edited was sent + */ @JsonProperty(REPLY_MARKUP_FIELD) - private InlineKeyboardMarkup replyMarkup; ///< Optional. A JSON-serialized object for an inline keyboard. + private InlineKeyboardMarkup replyMarkup; + /** + * Optional + * Unique identifier of the business connection on behalf of which the message to be edited was sent + */ + @JsonProperty(BUSINESS_CONNECTION_ID_FIELD) + private String businessConnectionId; @Tolerate public void setChatId(Long chatId) { diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/updatingmessages/EditMessageReplyMarkup.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/updatingmessages/EditMessageReplyMarkup.java index 05894777a..865298d50 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/updatingmessages/EditMessageReplyMarkup.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/updatingmessages/EditMessageReplyMarkup.java @@ -20,8 +20,9 @@ * @author Ruben Bermudez * @version 1.0 * Use this method to edit only the reply markup of messages. - * On success, if edited message is sent by the bot, the edited Message is returned, - * otherwise True is returned. + * On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. + * @apiNote Note that business messages that were not sent by the bot and do not contain an inline keyboard can + * only be edited within 48 hours from the time they were sent. */ @EqualsAndHashCode(callSuper = false) @Getter @@ -33,29 +34,40 @@ public class EditMessageReplyMarkup extends BotApiMethodSerializable { public static final String PATH = "editmessagereplymarkup"; - private static final String CHATID_FIELD = "chat_id"; - private static final String MESSAGEID_FIELD = "message_id"; + private static final String CHAT_ID_FIELD = "chat_id"; + private static final String MESSAGE_ID_FIELD = "message_id"; private static final String INLINE_MESSAGE_ID_FIELD = "inline_message_id"; - private static final String REPLYMARKUP_FIELD = "reply_markup"; + private static final String REPLY_MARKUP_FIELD = "reply_markup"; + private static final String BUSINESS_CONNECTION_ID_FIELD = "business_connection_id"; /** * Required if inline_message_id is not specified. Unique identifier for the chat to send the * message to (Or username for channels) */ - @JsonProperty(CHATID_FIELD) + @JsonProperty(CHAT_ID_FIELD) private String chatId; /** * Required if inline_message_id is not specified. Unique identifier of the sent message */ - @JsonProperty(MESSAGEID_FIELD) + @JsonProperty(MESSAGE_ID_FIELD) private Integer messageId; /** * Required if chat_id and message_id are not specified. Identifier of the inline message */ @JsonProperty(INLINE_MESSAGE_ID_FIELD) private String inlineMessageId; - @JsonProperty(REPLYMARKUP_FIELD) - private InlineKeyboardMarkup replyMarkup; ///< Optional. A JSON-serialized object for an inline keyboard. + /** + * Optional. + * A JSON-serialized object for an inline keyboard. + */ + @JsonProperty(REPLY_MARKUP_FIELD) + private InlineKeyboardMarkup replyMarkup; + /** + * Optional + * Unique identifier of the business connection on behalf of which the message to be edited was sent + */ + @JsonProperty(BUSINESS_CONNECTION_ID_FIELD) + private String businessConnectionId; @Tolerate public void setChatId(Long chatId) { diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/updatingmessages/EditMessageText.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/updatingmessages/EditMessageText.java index b2395a08c..c88af3c5b 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/updatingmessages/EditMessageText.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/updatingmessages/EditMessageText.java @@ -26,8 +26,10 @@ /** * @author Ruben Bermudez * @version 1.0 - * Use this method to edit text messages. On - * success, if edited message is sent by the bot, the edited Message is returned, otherwise True is returned. + * Use this method to edit text and game messages. + * On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. + * @apiNote Note that business messages that were not sent by the bot and do not contain an inline keyboard + * can only be edited within 48 hours from the time they were sent. */ @SuppressWarnings("unused") @EqualsAndHashCode(callSuper = false) @@ -42,26 +44,27 @@ public class EditMessageText extends BotApiMethodSerializable { public static final String PATH = "editmessagetext"; - private static final String CHATID_FIELD = "chat_id"; - private static final String MESSAGEID_FIELD = "message_id"; + private static final String CHAT_ID_FIELD = "chat_id"; + private static final String MESSAGE_ID_FIELD = "message_id"; private static final String INLINE_MESSAGE_ID_FIELD = "inline_message_id"; private static final String TEXT_FIELD = "text"; private static final String PARSE_MODE_FIELD = "parse_mode"; private static final String DISABLE_WEB_PREVIEW_FIELD = "disable_web_page_preview"; - private static final String REPLYMARKUP_FIELD = "reply_markup"; + private static final String REPLY_MARKUP_FIELD = "reply_markup"; private static final String ENTITIES_FIELD = "entities"; private static final String LINK_PREVIEW_OPTIONS_FIELD = "link_preview_options"; + private static final String BUSINESS_CONNECTION_ID_FIELD = "business_connection_id"; /** * Required if inline_message_id is not specified. Unique identifier for the chat to send the * message to (Or username for channels) */ - @JsonProperty(CHATID_FIELD) + @JsonProperty(CHAT_ID_FIELD) private String chatId; /** * Required if inline_message_id is not specified. Unique identifier of the sent message */ - @JsonProperty(MESSAGEID_FIELD) + @JsonProperty(MESSAGE_ID_FIELD) private Integer messageId; /** * Required if chat_id and message_id are not specified. Identifier of the inline message @@ -80,18 +83,36 @@ public class EditMessageText extends BotApiMethodSerializable { */ @JsonProperty(PARSE_MODE_FIELD) private String parseMode; + /** + * Optional. + * Disables link previews for links in this message + */ @JsonProperty(DISABLE_WEB_PREVIEW_FIELD) - private Boolean disableWebPagePreview; ///< Optional. Disables link previews for links in this message - @JsonProperty(REPLYMARKUP_FIELD) - private InlineKeyboardMarkup replyMarkup; ///< Optional. A JSON-serialized object for an inline keyboard. + private Boolean disableWebPagePreview; + /** + * Optional. + * A JSON-serialized object for an inline keyboard. + */ + @JsonProperty(REPLY_MARKUP_FIELD) + private InlineKeyboardMarkup replyMarkup; + /** + * Optional. + * List of special entities that appear in message text, which can be specified instead of parse_mode + */ @JsonProperty(ENTITIES_FIELD) - private List entities; ///< Optional. List of special entities that appear in message text, which can be specified instead of parse_mode + private List entities; /** * Optional * Link preview generation options for the message */ @JsonProperty(LINK_PREVIEW_OPTIONS_FIELD) private LinkPreviewOptions linkPreviewOptions; + /** + * Optional + * Unique identifier of the business connection on behalf of which the message to be edited was sent + */ + @JsonProperty(BUSINESS_CONNECTION_ID_FIELD) + private String businessConnectionId; public void disableWebPagePreview() { disableWebPagePreview = true; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/payments/star/StarTransaction.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/payments/star/StarTransaction.java new file mode 100644 index 000000000..81a4a9741 --- /dev/null +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/payments/star/StarTransaction.java @@ -0,0 +1,73 @@ +package org.telegram.telegrambots.meta.api.objects.payments.star; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.AllArgsConstructor; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.NonNull; +import lombok.RequiredArgsConstructor; +import lombok.Setter; +import lombok.ToString; +import lombok.experimental.SuperBuilder; +import lombok.extern.jackson.Jacksonized; +import org.telegram.telegrambots.meta.api.interfaces.BotApiObject; +import org.telegram.telegrambots.meta.api.objects.payments.transactionpartner.TransactionPartner; + +/** + * @author Ruben Bermudez + * @version 7.5 + * + * Describes a Telegram Star transaction. + */ +@EqualsAndHashCode(callSuper = false) +@Getter +@Setter +@ToString +@RequiredArgsConstructor +@AllArgsConstructor +@SuperBuilder +@Jacksonized +@JsonIgnoreProperties(ignoreUnknown = true) +public class StarTransaction implements BotApiObject { + private static final String ID_FIELD = "id"; + private static final String AMOUNT_FIELD = "amount"; + private static final String DATE_FIELD = "date"; + private static final String SOURCE_FIELD = "source"; + private static final String RECEIVER_FIELD = "receiver"; + + /** + * Unique identifier of the transaction. + * Coincides with the identifier of the original transaction for refund transactions. + * Coincides with SuccessfulPayment.telegram_payment_charge_id for successful incoming payments from users. + */ + @JsonProperty(ID_FIELD) + @NonNull + private String id; + /** + * Number of Telegram Stars transferred by the transaction + */ + @JsonProperty(AMOUNT_FIELD) + @NonNull + private Integer amount; + /** + * Date the transaction was created in Unix time + */ + @JsonProperty(DATE_FIELD) + @NonNull + private Integer date; + /** + * Optional. + * Source of an incoming transaction (e.g., a user purchasing goods or services, Fragment refunding a failed withdrawal). + * Only for incoming transactions + */ + @JsonProperty(SOURCE_FIELD) + private TransactionPartner source; + /** + * Optional. + * Receiver of an outgoing transaction (e.g., a user for a purchase refund, Fragment for a withdrawal). + * Only for outgoing transactions + */ + @JsonProperty(RECEIVER_FIELD) + private TransactionPartner receiver; +} diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/payments/star/StarTransactions.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/payments/star/StarTransactions.java new file mode 100644 index 000000000..5faf39872 --- /dev/null +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/payments/star/StarTransactions.java @@ -0,0 +1,42 @@ +package org.telegram.telegrambots.meta.api.objects.payments.star; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.AllArgsConstructor; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.NonNull; +import lombok.Setter; +import lombok.Singular; +import lombok.ToString; +import lombok.experimental.SuperBuilder; +import lombok.extern.jackson.Jacksonized; +import org.telegram.telegrambots.meta.api.interfaces.BotApiObject; + +import java.util.List; + +/** + * @author Ruben Bermudez + * @version 7.5 + * + * Contains a list of Telegram Star transactions. + */ +@EqualsAndHashCode(callSuper = false) +@Getter +@Setter +@ToString +@AllArgsConstructor +@SuperBuilder +@Jacksonized +@JsonIgnoreProperties(ignoreUnknown = true) +public class StarTransactions implements BotApiObject { + private static final String TRANSACTIONS_FIELD = "transactions"; + + /** + * The list of transactions + */ + @JsonProperty(TRANSACTIONS_FIELD) + @NonNull + @Singular + private List transactions; +} diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/payments/transactionpartner/TransactionPartner.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/payments/transactionpartner/TransactionPartner.java new file mode 100644 index 000000000..8ba9bceff --- /dev/null +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/payments/transactionpartner/TransactionPartner.java @@ -0,0 +1,29 @@ +package org.telegram.telegrambots.meta.api.objects.payments.transactionpartner; + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import org.telegram.telegrambots.meta.api.interfaces.BotApiObject; +import org.telegram.telegrambots.meta.api.interfaces.Validable; + +/** + * @author Ruben Bermudez + * @version 7.5 + * + * This object describes the source of a transaction, or its recipient for outgoing transactions. + * Currently, it can be one of + * TransactionPartnerFragment + * TransactionPartnerUser + * TransactionPartnerOther + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.EXISTING_PROPERTY, + property = "type" +) +@JsonSubTypes({ + @JsonSubTypes.Type(value = TransactionPartnerFragment.class, name = "fragment"), + @JsonSubTypes.Type(value = TransactionPartnerUser.class, name = "user"), + @JsonSubTypes.Type(value = TransactionPartnerOther.class, name = "other") +}) +public interface TransactionPartner extends Validable, BotApiObject { +} diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/payments/transactionpartner/TransactionPartnerFragment.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/payments/transactionpartner/TransactionPartnerFragment.java new file mode 100644 index 000000000..db2cd33f3 --- /dev/null +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/payments/transactionpartner/TransactionPartnerFragment.java @@ -0,0 +1,44 @@ +package org.telegram.telegrambots.meta.api.objects.payments.transactionpartner; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.RequiredArgsConstructor; +import lombok.Setter; +import lombok.ToString; +import lombok.experimental.SuperBuilder; +import lombok.extern.jackson.Jacksonized; +import org.telegram.telegrambots.meta.api.objects.payments.withdrawalstate.RevenueWithdrawalState; + +/** + * @author Ruben Bermudez + * @version 7.5 + * + * Describes a withdrawal transaction with Fragment. + */ + +@EqualsAndHashCode(callSuper = false) +@Getter +@Setter +@ToString +@RequiredArgsConstructor +@Jacksonized +@JsonIgnoreProperties(ignoreUnknown = true) +@SuperBuilder +public class TransactionPartnerFragment implements TransactionPartner { + private static final String TYPE_FIELD = "type"; + private static final String WITHDRAWAL_STATE_FIELD = "withdrawal_state"; + + /** + * Type of the transaction partner, always “fragment” + */ + @JsonProperty(TYPE_FIELD) + private final String type = "fragment"; + /** + * Optional. + * State of the transaction if the transaction is outgoing + */ + @JsonProperty(WITHDRAWAL_STATE_FIELD) + private RevenueWithdrawalState withdrawalState; +} diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/payments/transactionpartner/TransactionPartnerOther.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/payments/transactionpartner/TransactionPartnerOther.java new file mode 100644 index 000000000..bf21bad5b --- /dev/null +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/payments/transactionpartner/TransactionPartnerOther.java @@ -0,0 +1,35 @@ +package org.telegram.telegrambots.meta.api.objects.payments.transactionpartner; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.RequiredArgsConstructor; +import lombok.Setter; +import lombok.ToString; +import lombok.experimental.SuperBuilder; +import lombok.extern.jackson.Jacksonized; + +/** + * @author Ruben Bermudez + * @version 7.5 + * + * Describes a transaction with an unknown source or recipient. + */ +@EqualsAndHashCode(callSuper = false) +@Getter +@Setter +@ToString +@RequiredArgsConstructor +@Jacksonized +@JsonIgnoreProperties(ignoreUnknown = true) +@SuperBuilder +public class TransactionPartnerOther implements TransactionPartner { + private static final String TYPE_FIELD = "type"; + + /** + * Type of the transaction partner, always “other” + */ + @JsonProperty(TYPE_FIELD) + private final String type = "other"; +} diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/payments/transactionpartner/TransactionPartnerUser.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/payments/transactionpartner/TransactionPartnerUser.java new file mode 100644 index 000000000..8f77749d7 --- /dev/null +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/payments/transactionpartner/TransactionPartnerUser.java @@ -0,0 +1,45 @@ +package org.telegram.telegrambots.meta.api.objects.payments.transactionpartner; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.NonNull; +import lombok.RequiredArgsConstructor; +import lombok.Setter; +import lombok.ToString; +import lombok.experimental.SuperBuilder; +import lombok.extern.jackson.Jacksonized; +import org.telegram.telegrambots.meta.api.objects.User; + +/** + * @author Ruben Bermudez + * @version 7.5 + * + * Describes a transaction with a user. + */ + +@EqualsAndHashCode(callSuper = false) +@Getter +@Setter +@ToString +@RequiredArgsConstructor +@Jacksonized +@JsonIgnoreProperties(ignoreUnknown = true) +@SuperBuilder +public class TransactionPartnerUser implements TransactionPartner { + private static final String TYPE_FIELD = "type"; + private static final String USER_FIELD = "user"; + + /** + * Type of the transaction partner, always “user” + */ + @JsonProperty(TYPE_FIELD) + private final String type = "user"; + /** + * Information about the user + */ + @JsonProperty(USER_FIELD) + @NonNull + private User user; +} diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/payments/withdrawalstate/RevenueWithdrawalState.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/payments/withdrawalstate/RevenueWithdrawalState.java new file mode 100644 index 000000000..d71eb2cdc --- /dev/null +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/payments/withdrawalstate/RevenueWithdrawalState.java @@ -0,0 +1,28 @@ +package org.telegram.telegrambots.meta.api.objects.payments.withdrawalstate; + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import org.telegram.telegrambots.meta.api.interfaces.BotApiObject; +import org.telegram.telegrambots.meta.api.interfaces.Validable; + +/** + * @author Ruben Bermudez + * @version 7.5 + * + * This object describes the state of a revenue withdrawal operation. Currently, it can be one of: + * RevenueWithdrawalStatePending + * RevenueWithdrawalStateSucceeded + * RevenueWithdrawalStateFailed + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.EXISTING_PROPERTY, + property = "type" +) +@JsonSubTypes({ + @JsonSubTypes.Type(value = RevenueWithdrawalStatePending.class, name = "pending"), + @JsonSubTypes.Type(value = RevenueWithdrawalStateSucceeded.class, name = "succeeded"), + @JsonSubTypes.Type(value = RevenueWithdrawalStateFailed.class, name = "failed"), +}) +public interface RevenueWithdrawalState extends Validable, BotApiObject { +} diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/payments/withdrawalstate/RevenueWithdrawalStateFailed.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/payments/withdrawalstate/RevenueWithdrawalStateFailed.java new file mode 100644 index 000000000..18ee08041 --- /dev/null +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/payments/withdrawalstate/RevenueWithdrawalStateFailed.java @@ -0,0 +1,38 @@ +package org.telegram.telegrambots.meta.api.objects.payments.withdrawalstate; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.RequiredArgsConstructor; +import lombok.Setter; +import lombok.ToString; +import lombok.experimental.SuperBuilder; +import lombok.extern.jackson.Jacksonized; + +/** + * @author Ruben Bermudez + * @version 7.5 + * + * The withdrawal failed and the transaction was refunded. + */ + +@EqualsAndHashCode(callSuper = false) +@Getter +@Setter +@ToString +@RequiredArgsConstructor +@Jacksonized +@JsonIgnoreProperties(ignoreUnknown = true) +@SuperBuilder +public class RevenueWithdrawalStateFailed implements RevenueWithdrawalState { + private static final String TYPE_FIELD = "type"; + + /** + * Type of the state, always “failed” + */ + @JsonProperty(TYPE_FIELD) + private final String type = "failed"; + + +} diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/payments/withdrawalstate/RevenueWithdrawalStatePending.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/payments/withdrawalstate/RevenueWithdrawalStatePending.java new file mode 100644 index 000000000..ec25c4d8b --- /dev/null +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/payments/withdrawalstate/RevenueWithdrawalStatePending.java @@ -0,0 +1,38 @@ +package org.telegram.telegrambots.meta.api.objects.payments.withdrawalstate; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.RequiredArgsConstructor; +import lombok.Setter; +import lombok.ToString; +import lombok.experimental.SuperBuilder; +import lombok.extern.jackson.Jacksonized; + +/** + * @author Ruben Bermudez + * @version 7.5 + * + * The withdrawal is in progress. + */ + +@EqualsAndHashCode(callSuper = false) +@Getter +@Setter +@ToString +@RequiredArgsConstructor +@Jacksonized +@JsonIgnoreProperties(ignoreUnknown = true) +@SuperBuilder +public class RevenueWithdrawalStatePending implements RevenueWithdrawalState { + private static final String TYPE_FIELD = "type"; + + /** + * Type of the state, always “pending” + */ + @JsonProperty(TYPE_FIELD) + private final String type = "pending"; + + +} diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/payments/withdrawalstate/RevenueWithdrawalStateSucceeded.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/payments/withdrawalstate/RevenueWithdrawalStateSucceeded.java new file mode 100644 index 000000000..2f71a9d47 --- /dev/null +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/payments/withdrawalstate/RevenueWithdrawalStateSucceeded.java @@ -0,0 +1,50 @@ +package org.telegram.telegrambots.meta.api.objects.payments.withdrawalstate; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.RequiredArgsConstructor; +import lombok.Setter; +import lombok.ToString; +import lombok.experimental.SuperBuilder; +import lombok.extern.jackson.Jacksonized; + +/** + * @author Ruben Bermudez + * @version 7.5 + * + * The withdrawal succeeded. + */ + +@EqualsAndHashCode(callSuper = false) +@Getter +@Setter +@ToString +@RequiredArgsConstructor +@Jacksonized +@JsonIgnoreProperties(ignoreUnknown = true) +@SuperBuilder +public class RevenueWithdrawalStateSucceeded implements RevenueWithdrawalState { + private static final String TYPE_FIELD = "type"; + private static final String DATE_FIELD = "date"; + private static final String URL_FIELD = "url"; + + /** + * Type of the state, always “succeeded” + */ + @JsonProperty(TYPE_FIELD) + private final String type = "succeeded"; + /** + * Date the withdrawal was completed in Unix time + */ + @JsonProperty(DATE_FIELD) + private Integer date; + /** + * An HTTPS URL that can be used to see transaction details + */ + @JsonProperty(URL_FIELD) + private String url; + + +} diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/replykeyboard/buttons/InlineKeyboardButton.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/replykeyboard/buttons/InlineKeyboardButton.java index e5c5e9d8e..7de3b3d2a 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/replykeyboard/buttons/InlineKeyboardButton.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/replykeyboard/buttons/InlineKeyboardButton.java @@ -64,8 +64,7 @@ public class InlineKeyboardButton implements Validable, BotApiObject { private String url; /** * Optional. - * Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes. - * @apiNote Not supported for messages sent on behalf of a Telegram Business account. + * Data to be sent in a callback query to the bot when the button is pressed, 1-64 bytes */ @JsonProperty(CALLBACK_DATA_FIELD) private String callbackData; diff --git a/telegrambots-meta/src/test/java/org/telegram/telegrambots/meta/api/objects/payments/star/TestStarTransactions.java b/telegrambots-meta/src/test/java/org/telegram/telegrambots/meta/api/objects/payments/star/TestStarTransactions.java new file mode 100644 index 000000000..fd7ec1bbb --- /dev/null +++ b/telegrambots-meta/src/test/java/org/telegram/telegrambots/meta/api/objects/payments/star/TestStarTransactions.java @@ -0,0 +1,97 @@ +package org.telegram.telegrambots.meta.api.objects.payments.star; + +import com.fasterxml.jackson.databind.ObjectMapper; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.telegram.telegrambots.meta.api.objects.User; +import org.telegram.telegrambots.meta.api.objects.payments.transactionpartner.TransactionPartnerFragment; +import org.telegram.telegrambots.meta.api.objects.payments.transactionpartner.TransactionPartnerOther; +import org.telegram.telegrambots.meta.api.objects.payments.transactionpartner.TransactionPartnerUser; +import org.telegram.telegrambots.meta.api.objects.payments.withdrawalstate.RevenueWithdrawalStateFailed; +import org.telegram.telegrambots.meta.api.objects.payments.withdrawalstate.RevenueWithdrawalStatePending; +import org.telegram.telegrambots.meta.api.objects.payments.withdrawalstate.RevenueWithdrawalStateSucceeded; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.fail; + +public class TestStarTransactions { + private ObjectMapper mapper; + + @BeforeEach + void setUp() { + mapper = new ObjectMapper(); + } + + @Test + public void testTransactionPartner() { + StarTransactions starTransactions = StarTransactions + .builder() + .transaction(StarTransaction + .builder() + .id("TestId1") + .date(12345) + .amount(100) + .source(TransactionPartnerFragment + .builder() + .withdrawalState(RevenueWithdrawalStateSucceeded + .builder() + .date(98765) + .url("url") + .build()) + .build()) + .receiver(TransactionPartnerFragment + .builder() + .withdrawalState(RevenueWithdrawalStateFailed + .builder() + .build()) + .build()) + .build()) + .transaction(StarTransaction + .builder() + .id("TestId2") + .date(12345) + .amount(100) + .source(TransactionPartnerFragment + .builder() + .withdrawalState(RevenueWithdrawalStatePending + .builder() + .build()) + .build()) + .receiver(TransactionPartnerOther + .builder() + .build()) + .build()) + .transaction(StarTransaction + .builder() + .id("TestId3") + .date(12345) + .amount(100) + .source(TransactionPartnerUser + .builder() + .user(User + .builder() + .id(1L) + .firstName("FirstName") + .isBot(false) + .build()) + .build()) + .receiver(TransactionPartnerUser + .builder() + .user(User + .builder() + .id(1L) + .firstName("FirstName") + .isBot(false) + .build()) + .build()) + .build()) + .build(); + + try { + String result = mapper.writeValueAsString(starTransactions); + assertEquals(starTransactions, mapper.readValue(result, StarTransactions.class)); + } catch (Exception e) { + fail(e); + } + } +} diff --git a/telegrambots-springboot-longpolling-starter/pom.xml b/telegrambots-springboot-longpolling-starter/pom.xml index c3638e001..309cf1af5 100644 --- a/telegrambots-springboot-longpolling-starter/pom.xml +++ b/telegrambots-springboot-longpolling-starter/pom.xml @@ -7,7 +7,7 @@ org.telegram Bots - 7.4.2 + 7.5.0 telegrambots-springboot-longpolling-starter @@ -71,7 +71,7 @@ UTF-8 UTF-8 - 7.4.2 + 7.5.0 3.2.3 diff --git a/telegrambots-springboot-webhook-starter/pom.xml b/telegrambots-springboot-webhook-starter/pom.xml index c156dd718..027f23765 100644 --- a/telegrambots-springboot-webhook-starter/pom.xml +++ b/telegrambots-springboot-webhook-starter/pom.xml @@ -6,7 +6,7 @@ org.telegram Bots - 7.4.2 + 7.5.0 telegrambots-springboot-webhook-starter @@ -71,7 +71,7 @@ UTF-8 UTF-8 - 7.4.2 + 7.5.0 3.2.3 2.16.1 diff --git a/telegrambots-test-reports/pom.xml b/telegrambots-test-reports/pom.xml index 33d8a43f6..cf5bb3681 100644 --- a/telegrambots-test-reports/pom.xml +++ b/telegrambots-test-reports/pom.xml @@ -6,7 +6,7 @@ org.telegram Bots - 7.4.2 + 7.5.0 telegrambots-test-reports diff --git a/telegrambots-webhook/pom.xml b/telegrambots-webhook/pom.xml index 195f5ea4d..87771b26f 100644 --- a/telegrambots-webhook/pom.xml +++ b/telegrambots-webhook/pom.xml @@ -6,7 +6,7 @@ org.telegram Bots - 7.4.2 + 7.5.0 telegrambots-webhook