From 6b18fbb54564c1484a7f2cb7a6c3656800fcb2ab Mon Sep 17 00:00:00 2001 From: rubenlagus Date: Sat, 31 Oct 2020 13:04:38 +0000 Subject: [PATCH] Remove deprecated versions --- .../commandbot/commands/CommandRegistry.java | 17 +---- .../api/interfaces/InputBotApiObject.java | 17 ----- .../DeleteStickerSetName.java | 14 ---- .../GetChatMemberCount.java | 11 --- .../RestrictChatMember.java | 68 ----------------- .../EditMessageLiveLocation.java | 21 +---- .../telegrambots/meta/api/objects/Chat.java | 8 -- .../meta/api/objects/ChatMember.java | 8 -- .../meta/api/objects/InputFile.java | 4 +- .../meta/api/objects/LoginUrl.java | 4 +- .../InputMessageContent.java | 4 +- .../inlinequery/result/InlineQueryResult.java | 4 +- .../chached/InlineQueryResultCachedAudio.java | 15 ---- .../InlineQueryResultCachedDocument.java | 16 ---- .../chached/InlineQueryResultCachedGif.java | 13 ---- .../InlineQueryResultCachedMpeg4Gif.java | 13 ---- .../chached/InlineQueryResultCachedPhoto.java | 13 ---- .../InlineQueryResultCachedSticker.java | 16 ---- .../chached/InlineQueryResultCachedVideo.java | 13 ---- .../chached/InlineQueryResultCachedVoice.java | 15 ---- .../meta/api/objects/media/InputMedia.java | 6 +- .../dataerror/PassportElementError.java | 4 +- .../api/objects/payments/LabeledPrice.java | 6 +- .../api/objects/payments/ShippingOption.java | 4 +- .../objects/replykeyboard/ApiResponse.java | 76 ------------------- .../objects/replykeyboard/ReplyKeyboard.java | 3 +- .../buttons/InlineKeyboardButton.java | 12 +-- .../replykeyboard/buttons/KeyboardButton.java | 4 +- .../api/objects/stickers/MaskPosition.java | 4 +- 29 files changed, 31 insertions(+), 382 deletions(-) delete mode 100644 telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/interfaces/InputBotApiObject.java delete mode 100644 telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/DeleteStickerSetName.java delete mode 100644 telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/GetChatMemberCount.java delete mode 100644 telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/inlinequery/result/chached/InlineQueryResultCachedAudio.java delete mode 100644 telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/inlinequery/result/chached/InlineQueryResultCachedDocument.java delete mode 100644 telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/inlinequery/result/chached/InlineQueryResultCachedGif.java delete mode 100644 telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/inlinequery/result/chached/InlineQueryResultCachedMpeg4Gif.java delete mode 100644 telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/inlinequery/result/chached/InlineQueryResultCachedPhoto.java delete mode 100644 telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/inlinequery/result/chached/InlineQueryResultCachedSticker.java delete mode 100644 telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/inlinequery/result/chached/InlineQueryResultCachedVideo.java delete mode 100644 telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/inlinequery/result/chached/InlineQueryResultCachedVoice.java delete mode 100644 telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/replykeyboard/ApiResponse.java diff --git a/telegrambots-extensions/src/main/java/org/telegram/telegrambots/extensions/bots/commandbot/commands/CommandRegistry.java b/telegrambots-extensions/src/main/java/org/telegram/telegrambots/extensions/bots/commandbot/commands/CommandRegistry.java index 33fdfe17..dcbf84aa 100644 --- a/telegrambots-extensions/src/main/java/org/telegram/telegrambots/extensions/bots/commandbot/commands/CommandRegistry.java +++ b/telegrambots-extensions/src/main/java/org/telegram/telegrambots/extensions/bots/commandbot/commands/CommandRegistry.java @@ -24,21 +24,6 @@ public final class CommandRegistry implements ICommandRegistry { private final Supplier botUsernameSupplier; private BiConsumer defaultConsumer; - /** - * Creates a Command registry - * - * @param allowCommandsWithUsername True to allow commands with username, false otherwise - * @param botUsername Bot username - * @throws java.lang.NullPointerException if {@code botUsername} is {@code null} - * @deprecated Use {@link #CommandRegistry(boolean, java.util.function.Supplier)} instead - */ - @Deprecated - public CommandRegistry(boolean allowCommandsWithUsername, String botUsername) { - Objects.requireNonNull(botUsername, "Bot username must not be null"); - this.allowCommandsWithUsername = allowCommandsWithUsername; - this.botUsernameSupplier = () -> botUsername; - } - /** * Creates a Command registry * @param allowCommandsWithUsername True to allow commands with username, false otherwise @@ -103,7 +88,7 @@ public final class CommandRegistry implements ICommandRegistry { /** * Executes a command action if the command is registered. * - * @note If the command is not registered and there is a default consumer, + * @apiNote If the command is not registered and there is a default consumer, * that action will be performed * * @param absSender absSender diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/interfaces/InputBotApiObject.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/interfaces/InputBotApiObject.java deleted file mode 100644 index 518f0fe0..00000000 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/interfaces/InputBotApiObject.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.telegram.telegrambots.meta.api.interfaces; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; - -/** - * @author Ruben Bermudez - * @version 1.0 - * An object used in the Bots API to answer updates - * - * @deprecated Please, use BotApiObject directly - */ -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Deprecated -public interface InputBotApiObject extends BotApiObject { -} diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/DeleteStickerSetName.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/DeleteStickerSetName.java deleted file mode 100644 index 23154628..00000000 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/DeleteStickerSetName.java +++ /dev/null @@ -1,14 +0,0 @@ -package org.telegram.telegrambots.meta.api.methods.groupadministration; - -/** - * @author Ruben Bermudez - * @version 3.4 - * Use this method to delete a group sticker set from a supergroup. - * The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. - * Use the field can_set_sticker_set optionally returned in getChat requests to check if the bot can use this method. - * Returns True on success. - * @deprecated Replaced by {@link DeleteChatStickerSet} - */ -@Deprecated -public class DeleteStickerSetName extends DeleteChatStickerSet { -} diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/GetChatMemberCount.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/GetChatMemberCount.java deleted file mode 100644 index 6724a9ec..00000000 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/GetChatMemberCount.java +++ /dev/null @@ -1,11 +0,0 @@ -package org.telegram.telegrambots.meta.api.methods.groupadministration; - -/** - * @author Ruben Bermudez - * @version 1.0 - * Use this method to get the number of members in a chat. Returns Int on success. - * @deprecated Replaced by {@link GetChatMembersCount} - */ -@Deprecated -public class GetChatMemberCount extends GetChatMembersCount { -} diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/RestrictChatMember.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/RestrictChatMember.java index b68e417b..137c66bb 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/RestrictChatMember.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/RestrictChatMember.java @@ -123,74 +123,6 @@ public class RestrictChatMember extends BotApiMethod { return setUntilDate(Instant.now().plusMillis(duration.toMillis())); } - /** - * @deprecated Use {@link #getPermissions()} instead - */ - @Deprecated - public Boolean getCanSendMessages() { - return canSendMessages; - } - - /** - * @deprecated Use {@link #setPermissions(ChatPermissions)} instead - */ - @Deprecated - public RestrictChatMember setCanSendMessages(Boolean canSendMessages) { - this.canSendMessages = canSendMessages; - return this; - } - - /** - * @deprecated Use {@link #getPermissions()} instead - */ - @Deprecated - public Boolean getCanSendMediaMessages() { - return canSendMediaMessages; - } - - /** - * @deprecated Use {@link #setPermissions(ChatPermissions)} instead - */ - @Deprecated - public RestrictChatMember setCanSendMediaMessages(Boolean canSendMediaMessages) { - this.canSendMediaMessages = canSendMediaMessages; - return this; - } - - /** - * @deprecated Use {@link #getPermissions()} instead - */ - @Deprecated - public Boolean getCanSendOtherMessages() { - return canSendOtherMessages; - } - - /** - * @deprecated Use {@link #setPermissions(ChatPermissions)} instead - */ - @Deprecated - public RestrictChatMember setCanSendOtherMessages(Boolean canSendOtherMessages) { - this.canSendOtherMessages = canSendOtherMessages; - return this; - } - - /** - * @deprecated Use {@link #getPermissions()} instead - */ - @Deprecated - public Boolean getCanAddWebPagePreviews() { - return canAddWebPagePreviews; - } - - /** - * @deprecated Use {@link #setPermissions(ChatPermissions)} instead - */ - @Deprecated - public RestrictChatMember setCanAddWebPagePreviews(Boolean canAddWebPagePreviews) { - this.canAddWebPagePreviews = canAddWebPagePreviews; - return this; - } - public ChatPermissions getPermissions() { return permissions; } 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 196e0752..2aa85ebc 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 @@ -1,11 +1,10 @@ package org.telegram.telegrambots.meta.api.methods.updatingmessages; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.core.type.TypeReference; import org.telegram.telegrambots.meta.api.methods.BotApiMethod; -import org.telegram.telegrambots.meta.api.objects.Message; import org.telegram.telegrambots.meta.api.objects.ApiResponse; +import org.telegram.telegrambots.meta.api.objects.Message; import org.telegram.telegrambots.meta.api.objects.replykeyboard.InlineKeyboardMarkup; import org.telegram.telegrambots.meta.exceptions.TelegramApiRequestException; import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException; @@ -110,28 +109,10 @@ public class EditMessageLiveLocation extends BotApiMethod { return this; } - /** - * @deprecated Replaced by {@link #getLongitude()} - */ - @Deprecated - @JsonIgnore - public Float getLongitud() { - return longitude; - } - public Float getLongitude() { return longitude; } - /** - * @deprecated Replaced by {@link #setLongitude(Float)} - */ - @Deprecated - @JsonIgnore - public EditMessageLiveLocation setLongitud(Float longitude) { - return setLongitude(longitude); - } - public EditMessageLiveLocation setLongitude(Float longitude) { Objects.requireNonNull(longitude); this.longitude = longitude; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/Chat.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/Chat.java index 2fedbf9c..266c5692 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/Chat.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/Chat.java @@ -127,14 +127,6 @@ public class Chat implements BotApiObject { return permissions; } - /** - * @deprecated Use {@link #getPermissions()} instead - */ - @Deprecated - public Boolean getAllMembersAreAdministrators() { - return allMembersAreAdministrators; - } - public ChatPhoto getPhoto() { return photo; } diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/ChatMember.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/ChatMember.java index 3ab0c240..3da476d3 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/ChatMember.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/ChatMember.java @@ -121,14 +121,6 @@ public class ChatMember implements BotApiObject { return canRestrictMembers; } - /** - * @deprecated Use {{@link #getCanRestrictMembers()}} - */ - @Deprecated - public Boolean getCanRestrictUsers() { - return canRestrictMembers; - } - public Boolean getCanPinMessages() { return canPinMessages; } diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/InputFile.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/InputFile.java index 7619ead4..9326d2e9 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/InputFile.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/InputFile.java @@ -2,7 +2,7 @@ package org.telegram.telegrambots.meta.api.objects; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import org.telegram.telegrambots.meta.api.interfaces.InputBotApiObject; +import org.telegram.telegrambots.meta.api.interfaces.BotApiObject; import org.telegram.telegrambots.meta.api.interfaces.Validable; import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException; @@ -17,7 +17,7 @@ import java.io.InputStream; */ @SuppressWarnings({"WeakerAccess", "UnusedReturnValue"}) @JsonSerialize(using = InputFileSerializer.class, as = String.class) -public class InputFile implements InputBotApiObject, Validable { +public class InputFile implements Validable, BotApiObject { private String attachName; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/LoginUrl.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/LoginUrl.java index c3d85987..4b4821c7 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/LoginUrl.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/LoginUrl.java @@ -1,7 +1,7 @@ package org.telegram.telegrambots.meta.api.objects; import com.fasterxml.jackson.annotation.JsonProperty; -import org.telegram.telegrambots.meta.api.interfaces.InputBotApiObject; +import org.telegram.telegrambots.meta.api.interfaces.BotApiObject; import org.telegram.telegrambots.meta.api.interfaces.Validable; import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException; @@ -18,7 +18,7 @@ import static com.google.common.base.Preconditions.checkNotNull; * All the user needs to do is tap/click a button and confirm that they want to log in. */ @SuppressWarnings("unused") -public class LoginUrl implements InputBotApiObject, Validable { +public class LoginUrl implements Validable, BotApiObject { private static final String URL_FIELD = "url"; private static final String FORWARD_TEXT_FIELD = "forward_text"; private static final String BOT_USERNAME_FIELD = "bot_username"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/inlinequery/inputmessagecontent/InputMessageContent.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/inlinequery/inputmessagecontent/InputMessageContent.java index 3c69ec1e..c8054213 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/inlinequery/inputmessagecontent/InputMessageContent.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/inlinequery/inputmessagecontent/InputMessageContent.java @@ -1,7 +1,7 @@ package org.telegram.telegrambots.meta.api.objects.inlinequery.inputmessagecontent; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import org.telegram.telegrambots.meta.api.interfaces.InputBotApiObject; +import org.telegram.telegrambots.meta.api.interfaces.BotApiObject; import org.telegram.telegrambots.meta.api.interfaces.Validable; import org.telegram.telegrambots.meta.api.objects.inlinequery.inputmessagecontent.serialization.InputMessageContentDeserializer; @@ -12,5 +12,5 @@ import org.telegram.telegrambots.meta.api.objects.inlinequery.inputmessageconten * query. */ @JsonDeserialize(using = InputMessageContentDeserializer.class) -public interface InputMessageContent extends InputBotApiObject, Validable { +public interface InputMessageContent extends Validable, BotApiObject { } diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/inlinequery/result/InlineQueryResult.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/inlinequery/result/InlineQueryResult.java index 3950bd38..67d7c6b0 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/inlinequery/result/InlineQueryResult.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/inlinequery/result/InlineQueryResult.java @@ -1,7 +1,7 @@ package org.telegram.telegrambots.meta.api.objects.inlinequery.result; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import org.telegram.telegrambots.meta.api.interfaces.InputBotApiObject; +import org.telegram.telegrambots.meta.api.interfaces.BotApiObject; import org.telegram.telegrambots.meta.api.interfaces.Validable; import org.telegram.telegrambots.meta.api.objects.inlinequery.result.serialization.InlineQueryResultDeserializer; @@ -11,5 +11,5 @@ import org.telegram.telegrambots.meta.api.objects.inlinequery.result.serializati * This object represents one result of an inline query. */ @JsonDeserialize(using = InlineQueryResultDeserializer.class) -public interface InlineQueryResult extends InputBotApiObject, Validable { +public interface InlineQueryResult extends Validable, BotApiObject { } diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/inlinequery/result/chached/InlineQueryResultCachedAudio.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/inlinequery/result/chached/InlineQueryResultCachedAudio.java deleted file mode 100644 index 68ac6663..00000000 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/inlinequery/result/chached/InlineQueryResultCachedAudio.java +++ /dev/null @@ -1,15 +0,0 @@ -package org.telegram.telegrambots.meta.api.objects.inlinequery.result.chached; - -/** - * @author Ruben Bermudez - * @version 1.0 - * Represents a link to an mp3 audio file stored on the Telegram servers. By default, this - * audio file will be sent by the user. Alternatively, you can use input_message_content to send a - * message with the specified content instead of the audio. - * @note This will only work in Telegram versions released after 9 April, 2016. Older clients will - * ignore them. - * @deprecated Replaced by {@link org.telegram.telegrambots.meta.api.objects.inlinequery.result.cached.InlineQueryResultCachedAudio} - */ -@Deprecated -public class InlineQueryResultCachedAudio extends org.telegram.telegrambots.meta.api.objects.inlinequery.result.cached.InlineQueryResultCachedAudio { -} diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/inlinequery/result/chached/InlineQueryResultCachedDocument.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/inlinequery/result/chached/InlineQueryResultCachedDocument.java deleted file mode 100644 index e20809af..00000000 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/inlinequery/result/chached/InlineQueryResultCachedDocument.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.telegram.telegrambots.meta.api.objects.inlinequery.result.chached; - -/** - * @author Ruben Bermudez - * @version 1.0 - * Represents a link to a file stored on the Telegram servers. By default, this file will be - * sent by the user with an optional caption. Alternatively, you can use input_message_content to - * send a message with the specified content instead of the file. - * @note Currently, only pdf-files and zip archives can be sent using this method. - * @note This will only work in Telegram versions released after 9 April, 2016. Older clients will - * ignore them. - * @deprecated Replaced by {@link org.telegram.telegrambots.meta.api.objects.inlinequery.result.cached.InlineQueryResultCachedDocument} - */ -@Deprecated -public class InlineQueryResultCachedDocument extends org.telegram.telegrambots.meta.api.objects.inlinequery.result.cached.InlineQueryResultCachedDocument { -} diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/inlinequery/result/chached/InlineQueryResultCachedGif.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/inlinequery/result/chached/InlineQueryResultCachedGif.java deleted file mode 100644 index d5c89e03..00000000 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/inlinequery/result/chached/InlineQueryResultCachedGif.java +++ /dev/null @@ -1,13 +0,0 @@ -package org.telegram.telegrambots.meta.api.objects.inlinequery.result.chached; - -/** - * @author Ruben Bermudez - * @version 1.0 - * Represents a link to an animated GIF file stored on the Telegram servers. By default, this - * animated GIF file will be sent by the user with an optional caption. Alternatively, you can use - * input_message_content to send a message with specified content instead of the animation. - * @deprecated Replaced by {@link org.telegram.telegrambots.meta.api.objects.inlinequery.result.cached.InlineQueryResultCachedGif} - */ -@Deprecated -public class InlineQueryResultCachedGif extends org.telegram.telegrambots.meta.api.objects.inlinequery.result.cached.InlineQueryResultCachedGif { -} diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/inlinequery/result/chached/InlineQueryResultCachedMpeg4Gif.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/inlinequery/result/chached/InlineQueryResultCachedMpeg4Gif.java deleted file mode 100644 index ff756d70..00000000 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/inlinequery/result/chached/InlineQueryResultCachedMpeg4Gif.java +++ /dev/null @@ -1,13 +0,0 @@ -package org.telegram.telegrambots.meta.api.objects.inlinequery.result.chached; - -/** - * @author Ruben Bermudez - * @version 1.0 - * Represents a link to a video animation (H.264/MPEG-4 AVC video without sound). By default, - * this animated MPEG-4 file will be sent by the user with optional caption. Alternatively, you can - * use input_message_content to send a message with the specified content instead of the animation. - * @deprecated Replaced by {@link org.telegram.telegrambots.meta.api.objects.inlinequery.result.cached.InlineQueryResultCachedMpeg4Gif} - */ -@Deprecated -public class InlineQueryResultCachedMpeg4Gif extends org.telegram.telegrambots.meta.api.objects.inlinequery.result.cached.InlineQueryResultCachedMpeg4Gif { -} diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/inlinequery/result/chached/InlineQueryResultCachedPhoto.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/inlinequery/result/chached/InlineQueryResultCachedPhoto.java deleted file mode 100644 index 50224520..00000000 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/inlinequery/result/chached/InlineQueryResultCachedPhoto.java +++ /dev/null @@ -1,13 +0,0 @@ -package org.telegram.telegrambots.meta.api.objects.inlinequery.result.chached; - -/** - * @author Ruben Bermudez - * @version 1.0 - * Represents a link to a photo stored on the Telegram servers. By default, this photo will - * be sent by the user with an optional caption. Alternatively, you can use input_message_content to - * send a message with the specified content instead of the photo. - * @deprecated Replaced by {@link org.telegram.telegrambots.meta.api.objects.inlinequery.result.cached.InlineQueryResultCachedPhoto} - */ -@Deprecated -public class InlineQueryResultCachedPhoto extends org.telegram.telegrambots.meta.api.objects.inlinequery.result.cached.InlineQueryResultCachedPhoto { -} diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/inlinequery/result/chached/InlineQueryResultCachedSticker.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/inlinequery/result/chached/InlineQueryResultCachedSticker.java deleted file mode 100644 index 299b5280..00000000 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/inlinequery/result/chached/InlineQueryResultCachedSticker.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.telegram.telegrambots.meta.api.objects.inlinequery.result.chached; - -/** - * @author Ruben Bermudez - * @version 1.0 - * Represents a link to a sticker stored on the Telegram servers. By default, this sticker - * will be sent by the user. Alternatively, you can use input_message_content to send a message with - * the specified content instead of the sticker. - * @note This will only work in Telegram versions released after 9 April, 2016. Older clients will - * ignore them. - * @deprecated Replaced by {@link org.telegram.telegrambots.meta.api.objects.inlinequery.result.cached.InlineQueryResultCachedSticker} - */ -@Deprecated -public class InlineQueryResultCachedSticker extends org.telegram.telegrambots.meta.api.objects.inlinequery.result.cached.InlineQueryResultCachedSticker { - -} diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/inlinequery/result/chached/InlineQueryResultCachedVideo.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/inlinequery/result/chached/InlineQueryResultCachedVideo.java deleted file mode 100644 index 6bde7323..00000000 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/inlinequery/result/chached/InlineQueryResultCachedVideo.java +++ /dev/null @@ -1,13 +0,0 @@ -package org.telegram.telegrambots.meta.api.objects.inlinequery.result.chached; - -/** - * @author Ruben Bermudez - * @version 1.0 - * Represents a link to a video file stored on the Telegram servers. By default, this video - * file will be sent by the user with an optional caption. Alternatively, you can use - * input_message_content to send a message with the specified content instead of the video. - * @deprecated Replaced by {@link org.telegram.telegrambots.meta.api.objects.inlinequery.result.cached.InlineQueryResultCachedVideo} - */ -@Deprecated -public class InlineQueryResultCachedVideo extends org.telegram.telegrambots.meta.api.objects.inlinequery.result.cached.InlineQueryResultCachedVideo { -} diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/inlinequery/result/chached/InlineQueryResultCachedVoice.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/inlinequery/result/chached/InlineQueryResultCachedVoice.java deleted file mode 100644 index b53ade0d..00000000 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/inlinequery/result/chached/InlineQueryResultCachedVoice.java +++ /dev/null @@ -1,15 +0,0 @@ -package org.telegram.telegrambots.meta.api.objects.inlinequery.result.chached; - -/** - * @author Ruben Bermudez - * @version 1.0 - * Represents a link to a voice message stored on the Telegram servers. By default, this - * voice message will be sent by the user. Alternatively, you can use input_message_content to send - * a message with the specified content instead of the voice message. - * @note This will only work in Telegram versions released after 9 April, 2016. Older clients will - * ignore them. - * @deprecated Replaced by {@link org.telegram.telegrambots.meta.api.objects.inlinequery.result.cached.InlineQueryResultCachedVoice} - */ -@Deprecated -public class InlineQueryResultCachedVoice extends org.telegram.telegrambots.meta.api.objects.inlinequery.result.cached.InlineQueryResultCachedVoice { -} diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/media/InputMedia.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/media/InputMedia.java index d83f3190..45855293 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/media/InputMedia.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/media/InputMedia.java @@ -4,7 +4,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import org.telegram.telegrambots.meta.api.interfaces.InputBotApiObject; +import org.telegram.telegrambots.meta.api.interfaces.BotApiObject; import org.telegram.telegrambots.meta.api.interfaces.Validable; import org.telegram.telegrambots.meta.api.objects.media.serialization.InputMediaDeserializer; import org.telegram.telegrambots.meta.api.objects.media.serialization.InputMediaSerializer; @@ -20,7 +20,7 @@ import java.io.InputStream; @SuppressWarnings({"unchecked"}) @JsonSerialize(using = InputMediaSerializer.class) @JsonDeserialize(using = InputMediaDeserializer.class) -public abstract class InputMedia implements InputBotApiObject, Validable { +public abstract class InputMedia implements Validable, BotApiObject { public static final String TYPE_FIELD = "type"; public static final String MEDIA_FIELD = "media"; public static final String CAPTION_FIELD = "caption"; @@ -117,7 +117,7 @@ public abstract class InputMedia implements InputBotApiObject, Validable { return caption; } - public InputMedia setCaption(String caption) { + public InputMedia setCaption(String caption) { this.caption = caption; return this; } diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/passport/dataerror/PassportElementError.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/passport/dataerror/PassportElementError.java index 4b1dd918..744203f7 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/passport/dataerror/PassportElementError.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/passport/dataerror/PassportElementError.java @@ -1,7 +1,7 @@ package org.telegram.telegrambots.meta.api.objects.passport.dataerror; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import org.telegram.telegrambots.meta.api.interfaces.InputBotApiObject; +import org.telegram.telegrambots.meta.api.interfaces.BotApiObject; import org.telegram.telegrambots.meta.api.interfaces.Validable; import org.telegram.telegrambots.meta.api.objects.passport.dataerror.serialization.PassportElementErrorDeserializer; @@ -22,5 +22,5 @@ import org.telegram.telegrambots.meta.api.objects.passport.dataerror.serializati * PassportElementErrorTranslationFiles */ @JsonDeserialize(using = PassportElementErrorDeserializer.class) -public interface PassportElementError extends InputBotApiObject, Validable { +public interface PassportElementError extends Validable, BotApiObject { } diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/payments/LabeledPrice.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/payments/LabeledPrice.java index 38f03403..9ddcd105 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/payments/LabeledPrice.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/payments/LabeledPrice.java @@ -1,7 +1,7 @@ package org.telegram.telegrambots.meta.api.objects.payments; import com.fasterxml.jackson.annotation.JsonProperty; -import org.telegram.telegrambots.meta.api.interfaces.InputBotApiObject; +import org.telegram.telegrambots.meta.api.interfaces.BotApiObject; import org.telegram.telegrambots.meta.api.interfaces.Validable; import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException; @@ -12,17 +12,17 @@ import static com.google.common.base.Preconditions.checkNotNull; * @version 1.0 * This object represents a portion of goods price. */ -public class LabeledPrice implements InputBotApiObject, Validable { +public class LabeledPrice implements Validable, BotApiObject { private static final String LABEL_FIELD = "label"; private static final String AMOUNT_FIELD = "amount"; @JsonProperty(LABEL_FIELD) private String label; ///< Portion label - @JsonProperty(AMOUNT_FIELD) /** * Price of the product in the smallest units of the currency (integer, not float/double). * For example, for a price of US$ 1.45 pass amount = 145. */ + @JsonProperty(AMOUNT_FIELD) private Integer amount; /** diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/payments/ShippingOption.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/payments/ShippingOption.java index 58a6446f..ea883ff2 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/payments/ShippingOption.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/payments/ShippingOption.java @@ -1,7 +1,7 @@ package org.telegram.telegrambots.meta.api.objects.payments; import com.fasterxml.jackson.annotation.JsonProperty; -import org.telegram.telegrambots.meta.api.interfaces.InputBotApiObject; +import org.telegram.telegrambots.meta.api.interfaces.BotApiObject; import org.telegram.telegrambots.meta.api.interfaces.Validable; import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException; @@ -15,7 +15,7 @@ import static com.google.common.base.Preconditions.checkNotNull; * * This object represents one shipping option. */ -public class ShippingOption implements InputBotApiObject, Validable { +public class ShippingOption implements Validable, BotApiObject { private static final String ID_FIELD = "id"; private static final String TITLE_FIELD = "title"; private static final String PRICES_FIELD = "prices"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/replykeyboard/ApiResponse.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/replykeyboard/ApiResponse.java deleted file mode 100644 index bcaa1082..00000000 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/replykeyboard/ApiResponse.java +++ /dev/null @@ -1,76 +0,0 @@ -package org.telegram.telegrambots.meta.api.objects.replykeyboard; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -import org.telegram.telegrambots.meta.api.objects.ResponseParameters; - -import java.io.Serializable; - -/** - * @author Ruben Bermudez - * @version 1.0 - * Response from Telegram Server - * - * @deprecated Please, use {@link org.telegram.telegrambots.meta.api.objects.ApiResponse} instead. - * This class will be removed - */ -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) -@Deprecated -public class ApiResponse implements Serializable { - private static final String OK_FIELD = "ok"; - private static final String ERROR_CODE_FIELD = "error_code"; - private static final String DESCRIPTION_CODE_FIELD = "description"; - private static final String PARAMETERS_FIELD = "parameters"; - private static final String RESULT_FIELD = "result"; - - @JsonProperty(OK_FIELD) - private Boolean ok; - @JsonProperty(ERROR_CODE_FIELD) - private Integer errorCode; - @JsonProperty(DESCRIPTION_CODE_FIELD) - private String errorDescription; - @JsonProperty(PARAMETERS_FIELD) - private ResponseParameters parameters; - @JsonProperty(RESULT_FIELD) - private T result; - - public Boolean getOk() { - return ok; - } - - public Integer getErrorCode() { - return errorCode; - } - - public String getErrorDescription() { - return errorDescription; - } - - public T getResult() { - return result; - } - - public ResponseParameters getParameters() { - return parameters; - } - - @Override - public String toString() { - if (ok) { - return "ApiResponse{" + - "ok=" + ok + - ", result=" + result + - '}'; - } else { - return "ApiResponse{" + - "ok=" + ok + - ", errorCode=" + errorCode + - ", errorDescription='" + errorDescription + '\'' + - ", parameters='" + parameters + '\'' + - '}'; - } - } -} diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/replykeyboard/ReplyKeyboard.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/replykeyboard/ReplyKeyboard.java index d07ee5e7..e6487914 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/replykeyboard/ReplyKeyboard.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/replykeyboard/ReplyKeyboard.java @@ -2,7 +2,6 @@ package org.telegram.telegrambots.meta.api.objects.replykeyboard; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import org.telegram.telegrambots.meta.api.interfaces.BotApiObject; -import org.telegram.telegrambots.meta.api.interfaces.InputBotApiObject; import org.telegram.telegrambots.meta.api.interfaces.Validable; import org.telegram.telegrambots.meta.api.objects.replykeyboard.serialization.KeyboardDeserializer; @@ -12,5 +11,5 @@ import org.telegram.telegrambots.meta.api.objects.replykeyboard.serialization.Ke * Reply keyboard abstract type */ @JsonDeserialize(using = KeyboardDeserializer.class) -public interface ReplyKeyboard extends InputBotApiObject, BotApiObject, Validable { +public interface ReplyKeyboard extends BotApiObject, Validable { } 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 7bd349fb..20017a11 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 @@ -1,7 +1,7 @@ package org.telegram.telegrambots.meta.api.objects.replykeyboard.buttons; import com.fasterxml.jackson.annotation.JsonProperty; -import org.telegram.telegrambots.meta.api.interfaces.InputBotApiObject; +import org.telegram.telegrambots.meta.api.interfaces.BotApiObject; import org.telegram.telegrambots.meta.api.interfaces.Validable; import org.telegram.telegrambots.meta.api.objects.LoginUrl; import org.telegram.telegrambots.meta.api.objects.games.CallbackGame; @@ -16,10 +16,10 @@ import static com.google.common.base.Preconditions.checkNotNull; * @version 1.0 * This object represents one button of an inline keyboard. You must use exactly one of the * optional fields. - * @note This will only work in Telegram versions released after 9 April, 2016. Older clients will + * @apiNote This will only work in Telegram versions released after 9 April, 2016. Older clients will * display unsupported message. */ -public class InlineKeyboardButton implements InputBotApiObject, Validable { +public class InlineKeyboardButton implements Validable, BotApiObject { private static final String TEXT_FIELD = "text"; private static final String URL_FIELD = "url"; @@ -39,7 +39,7 @@ public class InlineKeyboardButton implements InputBotApiObject, Validable { /** * Optional. Description of the game that will be launched when the user presses the button. * - * @note This type of button must always be the first button in the first row. + * @apiNote This type of button must always be the first button in the first row. */ @JsonProperty(CALLBACK_GAME_FIELD) private CallbackGame callbackGame; @@ -49,7 +49,7 @@ public class InlineKeyboardButton implements InputBotApiObject, Validable { * open that chat and insert the bot‘s username and the specified inline query in the input field. * Can be empty, in which case just the bot’s username will be inserted. * - * @note This offers an easy way for users to start using your bot in inline mode when + * @apiNote This offers an easy way for users to start using your bot in inline mode when * they are currently in a private chat with it. * Especially useful when combined with switch_pm… actions – in this case the user will * be automatically returned to the chat they switched from, skipping the chat selection screen. @@ -67,7 +67,7 @@ public class InlineKeyboardButton implements InputBotApiObject, Validable { /** * Optional. Specify True, to send a Buy button. * - * @note This type of button must always be the first button in the first row. + * @apiNote This type of button must always be the first button in the first row. */ @JsonProperty(PAY_FIELD) private Boolean pay; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/replykeyboard/buttons/KeyboardButton.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/replykeyboard/buttons/KeyboardButton.java index 091d8d12..dbf087e7 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/replykeyboard/buttons/KeyboardButton.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/replykeyboard/buttons/KeyboardButton.java @@ -1,7 +1,7 @@ package org.telegram.telegrambots.meta.api.objects.replykeyboard.buttons; import com.fasterxml.jackson.annotation.JsonProperty; -import org.telegram.telegrambots.meta.api.interfaces.InputBotApiObject; +import org.telegram.telegrambots.meta.api.interfaces.BotApiObject; import org.telegram.telegrambots.meta.api.interfaces.Validable; import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException; @@ -19,7 +19,7 @@ import java.util.Objects; * @apiNote request_poll option will only work in Telegram versions released after 1X January, 2020. * Older clients will receive unsupported message. */ -public class KeyboardButton implements InputBotApiObject, Validable { +public class KeyboardButton implements Validable, BotApiObject { private static final String TEXT_FIELD = "text"; private static final String REQUEST_CONTACT_FIELD = "request_contact"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/stickers/MaskPosition.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/stickers/MaskPosition.java index 647cec40..b69d9cba 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/stickers/MaskPosition.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/stickers/MaskPosition.java @@ -2,7 +2,7 @@ package org.telegram.telegrambots.meta.api.objects.stickers; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; -import org.telegram.telegrambots.meta.api.interfaces.InputBotApiObject; +import org.telegram.telegrambots.meta.api.interfaces.BotApiObject; import org.telegram.telegrambots.meta.api.interfaces.Validable; import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException; @@ -12,7 +12,7 @@ import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException; * This object describes the position on faces where a mask should be placed by default. */ @JsonTypeInfo(use=JsonTypeInfo.Id.NONE) -public class MaskPosition implements InputBotApiObject, Validable { +public class MaskPosition implements Validable, BotApiObject { private static final String POINT_FIELD = "point"; private static final String XSHIFT_FIELD = "x_shift"; private static final String YSHIFT_FIELD = "y_shift";