diff --git a/telegrambots-longpolling/src/main/java/org/telegram/telegrambots/longpolling/util/TelegramOkHttpClientFactory.java b/telegrambots-longpolling/src/main/java/org/telegram/telegrambots/longpolling/util/TelegramOkHttpClientFactory.java index 38468e350..ec6747e20 100644 --- a/telegrambots-longpolling/src/main/java/org/telegram/telegrambots/longpolling/util/TelegramOkHttpClientFactory.java +++ b/telegrambots-longpolling/src/main/java/org/telegram/telegrambots/longpolling/util/TelegramOkHttpClientFactory.java @@ -75,14 +75,4 @@ public OkHttpClient get() { return okHttpClientBuilder.build(); } } - - /** - * @deprecated Use {@link HttpProxyOkHttpClientCreator} instead - */ - @Deprecated - public static class ProxyOkHttpClientCreator extends HttpProxyOkHttpClientCreator { - public ProxyOkHttpClientCreator(Supplier proxySupplier, Supplier authenticatorSupplier) { - super(proxySupplier, authenticatorSupplier); - } - } } diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/annotations/BotApiMethodJsonAnnotated.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/annotations/BotApiJsonAnnotated.java similarity index 93% rename from telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/annotations/BotApiMethodJsonAnnotated.java rename to telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/annotations/BotApiJsonAnnotated.java index ec20ee034..a55cb4b09 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/annotations/BotApiMethodJsonAnnotated.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/annotations/BotApiJsonAnnotated.java @@ -18,5 +18,5 @@ @JacksonAnnotationsInside @JsonIgnoreProperties(ignoreUnknown = true) @JsonInclude(JsonInclude.Include.NON_NULL) -public @interface BotApiMethodJsonAnnotated { +public @interface BotApiJsonAnnotated { } diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/interfaces/BotApiObject.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/interfaces/BotApiObject.java index 640e5fc0a..e2b17ec61 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/interfaces/BotApiObject.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/interfaces/BotApiObject.java @@ -1,7 +1,6 @@ package org.telegram.telegrambots.meta.api.interfaces; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; +import org.telegram.telegrambots.meta.annotations.BotApiJsonAnnotated; import java.io.Serializable; @@ -10,7 +9,6 @@ * @version 1.0 * An object from the Bots API received from Telegram Servers */ -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) +@BotApiJsonAnnotated public interface BotApiObject extends Serializable { } diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/AnswerCallbackQuery.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/AnswerCallbackQuery.java index a263f77b9..8eaa93a0c 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/AnswerCallbackQuery.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/AnswerCallbackQuery.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; @@ -32,7 +31,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class AnswerCallbackQuery extends BotApiMethodBoolean { public static final String PATH = "answercallbackquery"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/AnswerInlineQuery.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/AnswerInlineQuery.java index 3b9029003..6632530e2 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/AnswerInlineQuery.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/AnswerInlineQuery.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; @@ -32,7 +31,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class AnswerInlineQuery extends BotApiMethodBoolean { public static final String PATH = "answerInlineQuery"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/AnswerPreCheckoutQuery.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/AnswerPreCheckoutQuery.java index 7a0718f2c..4a5da3f92 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/AnswerPreCheckoutQuery.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/AnswerPreCheckoutQuery.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; @@ -32,7 +31,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class AnswerPreCheckoutQuery extends BotApiMethodBoolean { public static final String PATH = "answerPreCheckoutQuery"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/AnswerShippingQuery.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/AnswerShippingQuery.java index ab5b4d731..71d7dbc32 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/AnswerShippingQuery.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/AnswerShippingQuery.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; @@ -35,7 +34,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class AnswerShippingQuery extends BotApiMethodBoolean { public static final String PATH = "answerShippingQuery"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/CopyMessage.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/CopyMessage.java index dd1e8324d..134b7dc2d 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/CopyMessage.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/CopyMessage.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; @@ -41,7 +40,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class CopyMessage extends BotApiMethod { public static final String PATH = "copyMessage"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/CopyMessages.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/CopyMessages.java index 3d08814e8..349dbd68c 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/CopyMessages.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/CopyMessages.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; @@ -43,7 +42,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class CopyMessages extends BotApiMethod> { public static final String PATH = "copyMessages"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/ForwardMessage.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/ForwardMessage.java index 5df6371a4..89c01f01c 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/ForwardMessage.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/ForwardMessage.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; @@ -19,7 +18,6 @@ * @author Ruben Bermudez * @version 1.0 * Use this method to forward messages of any kind. - * * Service messages and messages with protected content can't be forwarded. * * On success, the Message sent is returned. @@ -32,7 +30,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class ForwardMessage extends BotApiMethodMessage { public static final String PATH = "forwardmessage"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/ForwardMessages.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/ForwardMessages.java index 137d818a2..64a54ddd9 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/ForwardMessages.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/ForwardMessages.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; @@ -39,7 +38,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class ForwardMessages extends BotApiMethod> { public static final String PATH = "forwardMessages"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/GetFile.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/GetFile.java index 63160770e..af7268a91 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/GetFile.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/GetFile.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -32,7 +31,6 @@ @RequiredArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class GetFile extends BotApiMethod { public static final String PATH = "getFile"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/GetUserProfilePhotos.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/GetUserProfilePhotos.java index 118724115..3aa96013e 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/GetUserProfilePhotos.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/GetUserProfilePhotos.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; @@ -28,7 +27,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class GetUserProfilePhotos extends BotApiMethod { public static final String PATH = "getuserprofilephotos"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/SetPassportDataErrors.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/SetPassportDataErrors.java index 2eab90b15..cdd4ab141 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/SetPassportDataErrors.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/SetPassportDataErrors.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -31,7 +30,6 @@ @RequiredArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class SetPassportDataErrors extends BotApiMethodBoolean { public static final String PATH = "setPassportDataErrors"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/SetUserEmojiStatus.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/SetUserEmojiStatus.java new file mode 100644 index 000000000..9e7714542 --- /dev/null +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/SetUserEmojiStatus.java @@ -0,0 +1,72 @@ +package org.telegram.telegrambots.meta.api.methods; + +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.methods.botapimethods.BotApiMethodBoolean; +import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException; + +/** + * @author Ruben Bermudez + * @version 8.0 + * Changes the emoji status for a given user that previously allowed the bot to manage their emoji status via the + * Mini App method requestEmojiStatusAccess. + * + * Returns True on success. + */ +@SuppressWarnings("unused") +@EqualsAndHashCode(callSuper = false) +@Getter +@Setter +@ToString +@RequiredArgsConstructor +@AllArgsConstructor +@SuperBuilder +@Jacksonized +public class SetUserEmojiStatus extends BotApiMethodBoolean { + public static final String PATH = "setUserEmojiStatus"; + + private static final String USER_ID_FIELD = "user_id"; + private static final String EMOJI_STATUS_CUSTOM_EMOJI_ID_FIELD = "emoji_status_custom_emoji_id"; + private static final String EMOJI_STATUS_EXPIRATION_DATE_FIELD = "emoji_status_expiration_date"; + + + /** + * Unique identifier of the target user + */ + @JsonProperty(USER_ID_FIELD) + @NonNull + private Integer userId; + /** + * Optional + * Custom emoji identifier of the emoji status to set. + * Pass an empty string to remove the status. + */ + @JsonProperty(EMOJI_STATUS_CUSTOM_EMOJI_ID_FIELD) + private String emojiStatusCustomEmojiId; + /** + * Optional + * Expiration date of the emoji status, if any + */ + @JsonProperty(EMOJI_STATUS_EXPIRATION_DATE_FIELD) + private Integer emojiStatusExpirationDate; + + @Override + public String getMethod() { + return PATH; + } + + @Override + public void validate() throws TelegramApiValidationException { + if (userId == 0) { + throw new TelegramApiValidationException("UserId parameter can't be empty", this); + } + } +} diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/botapimethods/BotApiMethodBoolean.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/botapimethods/BotApiMethodBoolean.java index 14d5f7218..b84d3a57f 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/botapimethods/BotApiMethodBoolean.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/botapimethods/BotApiMethodBoolean.java @@ -1,7 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.botapimethods; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; import lombok.AccessLevel; import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; @@ -13,8 +11,6 @@ * * A method of Telegram Bots Api that is fully supported in json format */ -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) @NoArgsConstructor(access = AccessLevel.PROTECTED) @SuperBuilder public abstract class BotApiMethodBoolean extends BotApiMethod { diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/botapimethods/BotApiMethodMessage.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/botapimethods/BotApiMethodMessage.java index 4a95db336..723ad298e 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/botapimethods/BotApiMethodMessage.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/botapimethods/BotApiMethodMessage.java @@ -1,7 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.botapimethods; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; import lombok.AccessLevel; import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; @@ -14,8 +12,6 @@ * * A method of Telegram Bots Api that is fully supported in json format */ -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) @NoArgsConstructor(access = AccessLevel.PROTECTED) @SuperBuilder public abstract class BotApiMethodMessage extends BotApiMethod { diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/botapimethods/BotApiMethodSerializable.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/botapimethods/BotApiMethodSerializable.java index 75655ee90..f5138184d 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/botapimethods/BotApiMethodSerializable.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/botapimethods/BotApiMethodSerializable.java @@ -1,7 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.botapimethods; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; import lombok.AccessLevel; import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; @@ -19,8 +17,6 @@ * * A method of Telegram Bots Api that is fully supported in json format */ -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonInclude(JsonInclude.Include.NON_NULL) @NoArgsConstructor(access = AccessLevel.PROTECTED) @SuperBuilder public abstract class BotApiMethodSerializable extends BotApiMethod { diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/botapimethods/PartialBotApiMethod.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/botapimethods/PartialBotApiMethod.java index e607ec307..231a14bd7 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/botapimethods/PartialBotApiMethod.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/botapimethods/PartialBotApiMethod.java @@ -8,7 +8,7 @@ import lombok.AccessLevel; import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; -import org.telegram.telegrambots.meta.annotations.BotApiMethodJsonAnnotated; +import org.telegram.telegrambots.meta.annotations.BotApiJsonAnnotated; import org.telegram.telegrambots.meta.api.interfaces.Validable; import org.telegram.telegrambots.meta.api.objects.ApiResponse; import org.telegram.telegrambots.meta.exceptions.TelegramApiRequestException; @@ -24,7 +24,7 @@ */ @NoArgsConstructor(access = AccessLevel.PROTECTED) @SuperBuilder -@BotApiMethodJsonAnnotated +@BotApiJsonAnnotated public abstract class PartialBotApiMethod implements Validable { @JsonIgnore protected static final ObjectMapper OBJECT_MAPPER = new ObjectMapper(); @@ -72,6 +72,7 @@ private T deserializeResponseInternal(String answer, JavaType type) throws Teleg @JsonProperty(BotApiMethod.METHOD_FIELD) public abstract String getMethod(); + @BotApiJsonAnnotated public static abstract class PartialBotApiMethodBuilder, B extends PartialBotApiMethodBuilder> { } diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/commands/SetMyCommands.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/commands/SetMyCommands.java index d39e15047..0b03c0397 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/commands/SetMyCommands.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/commands/SetMyCommands.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.commands; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; @@ -34,7 +33,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class SetMyCommands extends BotApiMethodBoolean { public static final String PATH = "setMyCommands"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/forum/CloseForumTopic.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/forum/CloseForumTopic.java index 94a414755..e904851bb 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/forum/CloseForumTopic.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/forum/CloseForumTopic.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.forum; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -30,7 +29,6 @@ @RequiredArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class CloseForumTopic extends BotApiMethodBoolean { public static final String PATH = "closeForumTopic"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/forum/CloseGeneralForumTopic.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/forum/CloseGeneralForumTopic.java index a7fea0ba3..48b481dd9 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/forum/CloseGeneralForumTopic.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/forum/CloseGeneralForumTopic.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.forum; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -29,7 +28,6 @@ @RequiredArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class CloseGeneralForumTopic extends BotApiMethodBoolean { public static final String PATH = "closeGeneralForumTopic"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/forum/CreateForumTopic.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/forum/CreateForumTopic.java index 88263cba0..8ea33d4e1 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/forum/CreateForumTopic.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/forum/CreateForumTopic.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.forum; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; @@ -32,7 +31,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class CreateForumTopic extends BotApiMethod { public static final String PATH = "createForumTopic"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/forum/DeleteForumTopic.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/forum/DeleteForumTopic.java index 550192193..a26b2236c 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/forum/DeleteForumTopic.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/forum/DeleteForumTopic.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.forum; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; @@ -30,7 +29,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class DeleteForumTopic extends BotApiMethodBoolean { public static final String PATH = "deleteForumTopic"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/forum/EditForumTopic.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/forum/EditForumTopic.java index dc2d6c90e..eefc4e9d1 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/forum/EditForumTopic.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/forum/EditForumTopic.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.forum; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -30,7 +29,6 @@ @RequiredArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class EditForumTopic extends BotApiMethodBoolean { public static final String PATH = "editForumTopic"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/forum/EditGeneralForumTopic.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/forum/EditGeneralForumTopic.java index 17181eead..e6ba2833e 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/forum/EditGeneralForumTopic.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/forum/EditGeneralForumTopic.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.forum; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -29,7 +28,6 @@ @RequiredArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class EditGeneralForumTopic extends BotApiMethodBoolean { public static final String PATH = "editGeneralForumTopic"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/forum/HideGeneralForumTopic.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/forum/HideGeneralForumTopic.java index 17b96c134..8bf994ad9 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/forum/HideGeneralForumTopic.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/forum/HideGeneralForumTopic.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.forum; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -30,7 +29,6 @@ @RequiredArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class HideGeneralForumTopic extends BotApiMethodBoolean { public static final String PATH = "hideGeneralForumTopic"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/forum/ReopenForumTopic.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/forum/ReopenForumTopic.java index 61494906c..93cec53b7 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/forum/ReopenForumTopic.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/forum/ReopenForumTopic.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.forum; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -31,7 +30,6 @@ @RequiredArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class ReopenForumTopic extends BotApiMethodBoolean { public static final String PATH = "reopenForumTopic"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/forum/ReopenGeneralForumTopic.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/forum/ReopenGeneralForumTopic.java index f92a65c1e..f3c8a1a2c 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/forum/ReopenGeneralForumTopic.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/forum/ReopenGeneralForumTopic.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.forum; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -30,7 +29,6 @@ @RequiredArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class ReopenGeneralForumTopic extends BotApiMethodBoolean { public static final String PATH = "reopenGeneralForumTopic"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/forum/UnhideGeneralForumTopic.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/forum/UnhideGeneralForumTopic.java index c76720feb..93d6e2217 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/forum/UnhideGeneralForumTopic.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/forum/UnhideGeneralForumTopic.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.forum; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -29,7 +28,6 @@ @RequiredArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class UnhideGeneralForumTopic extends BotApiMethodBoolean { public static final String PATH = "unhideGeneralForumTopic"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/forum/UnpinAllForumTopicMessages.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/forum/UnpinAllForumTopicMessages.java index a383c2f6b..9fe8c7176 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/forum/UnpinAllForumTopicMessages.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/forum/UnpinAllForumTopicMessages.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.forum; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -30,7 +29,6 @@ @RequiredArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class UnpinAllForumTopicMessages extends BotApiMethodBoolean { public static final String PATH = "unpinAllForumTopicMessages"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/forum/UnpinAllGeneralForumTopicMessages.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/forum/UnpinAllGeneralForumTopicMessages.java index 1e11a696d..05c3d4243 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/forum/UnpinAllGeneralForumTopicMessages.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/forum/UnpinAllGeneralForumTopicMessages.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.forum; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -30,7 +29,6 @@ @RequiredArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class UnpinAllGeneralForumTopicMessages extends BotApiMethodBoolean { public static final String PATH = "unpinAllGeneralForumTopicMessages"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/games/GetGameHighScores.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/games/GetGameHighScores.java index 16a19fef6..e84e477a0 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/games/GetGameHighScores.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/games/GetGameHighScores.java @@ -16,7 +16,6 @@ */ package org.telegram.telegrambots.meta.api.methods.games; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; @@ -56,7 +55,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class GetGameHighScores extends BotApiMethod> { public static final String PATH = "getGameHighScores"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/games/SetGameScore.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/games/SetGameScore.java index 7ae9c2e0d..bce0c7d90 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/games/SetGameScore.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/games/SetGameScore.java @@ -17,7 +17,6 @@ package org.telegram.telegrambots.meta.api.methods.games; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; @@ -53,7 +52,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class SetGameScore extends BotApiMethodSerializable { public static final String PATH = "setGameScore"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/gifts/GetAvailableGifts.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/gifts/GetAvailableGifts.java new file mode 100644 index 000000000..1b4ec0e7a --- /dev/null +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/gifts/GetAvailableGifts.java @@ -0,0 +1,39 @@ +package org.telegram.telegrambots.meta.api.methods.gifts; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; +import org.telegram.telegrambots.meta.api.methods.botapimethods.BotApiMethod; +import org.telegram.telegrambots.meta.api.objects.gifts.Gifts; +import org.telegram.telegrambots.meta.exceptions.TelegramApiRequestException; + +/** + * @author Ruben Bermudez + * @version 8.0 + * Returns the list of gifts that can be sent by the bot to users. + * Requires no parameters. + * + * Returns a Gifts object. + */ +@EqualsAndHashCode(callSuper = false) +@Getter +@Setter +@ToString +@AllArgsConstructor +@Builder +public class GetAvailableGifts extends BotApiMethod { + public static final String PATH = "getAvailableGifts"; + + @Override + public String getMethod() { + return PATH; + } + + @Override + public Gifts deserializeResponse(String answer) throws TelegramApiRequestException { + return deserializeResponse(answer, Gifts.class); + } +} diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/gifts/SendGift.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/gifts/SendGift.java new file mode 100644 index 000000000..74ed04bc7 --- /dev/null +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/gifts/SendGift.java @@ -0,0 +1,99 @@ +package org.telegram.telegrambots.meta.api.methods.gifts; + +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.Singular; +import lombok.ToString; +import lombok.experimental.SuperBuilder; +import lombok.extern.jackson.Jacksonized; +import org.telegram.telegrambots.meta.api.methods.botapimethods.BotApiMethodBoolean; +import org.telegram.telegrambots.meta.api.objects.MessageEntity; +import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException; + +import java.util.List; + +/** + * @author Ruben Bermudez + * @version 8.0 + * + * Sends a gift to the given user. + * The gift can't be converted to Telegram Stars by the user. + * Returns True on success. + */ +@EqualsAndHashCode(callSuper = false) +@Getter +@Setter +@ToString +@RequiredArgsConstructor +@AllArgsConstructor +@SuperBuilder +@Jacksonized +public class SendGift extends BotApiMethodBoolean { + public static final String PATH = "sendGift"; + + private static final String USER_ID_FIELD = "user_id"; + private static final String GIFT_ID_FIELD = "gift_id"; + private static final String TEXT_FIELD = "text"; + private static final String TEXT_PARSE_MODE_FIELD = "text_parse_mode"; + private static final String TEXT_ENTITIES_FIELD = "text_entities"; + + /** + * Unique identifier of the target user that will receive the gift + */ + @JsonProperty(USER_ID_FIELD) + @NonNull + private Integer userId; + /** + * Identifier of the gift + */ + @JsonProperty(GIFT_ID_FIELD) + @NonNull + private String giftId; + /** + * Optional + * Text that will be shown along with the gift; 0-255 characters + */ + @JsonProperty(TEXT_FIELD) + private String text; + /** + * Optional + * Mode for parsing entities in the text. + * See formatting options for more details. + * + * @apiNote Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, and “custom_emoji” are ignored. + */ + @JsonProperty(TEXT_PARSE_MODE_FIELD) + private String textParseMode; + /** + * Optional + * A JSON-serialized list of special entities that appear in the gift text. + * It can be specified instead of text_parse_mode. + * @apiNote Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, and “custom_emoji” are ignored. + */ + @JsonProperty(TEXT_ENTITIES_FIELD) + @Singular + private List textEntities; + + @Override + public void validate() throws TelegramApiValidationException { + if (userId == 0) { + throw new TelegramApiValidationException("UserId can't be empty", this); + } + if (giftId.isEmpty()) { + throw new TelegramApiValidationException("GiftId can't be empty", this); + } + if (text != null && (text.isEmpty() || text.length() > 255)) { + throw new TelegramApiValidationException("Text must be between 0 and 255 characters", this); + } + } + + @Override + public String getMethod() { + return PATH; + } +} diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/ApproveChatJoinRequest.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/ApproveChatJoinRequest.java index 91e77993c..8189a8213 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/ApproveChatJoinRequest.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/ApproveChatJoinRequest.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.groupadministration; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -28,7 +27,6 @@ @RequiredArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class ApproveChatJoinRequest extends BotApiMethodBoolean { public static final String PATH = "approveChatJoinRequest"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/BanChatMember.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/BanChatMember.java index f12a47674..37a8ecd17 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/BanChatMember.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/BanChatMember.java @@ -1,7 +1,6 @@ package org.telegram.telegrambots.meta.api.methods.groupadministration; import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; @@ -39,7 +38,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class BanChatMember extends BotApiMethodBoolean { public static final String PATH = "banChatMember"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/BanChatSenderChat.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/BanChatSenderChat.java index fa742d0c9..11f820bf3 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/BanChatSenderChat.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/BanChatSenderChat.java @@ -1,7 +1,6 @@ package org.telegram.telegrambots.meta.api.methods.groupadministration; import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; @@ -37,7 +36,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class BanChatSenderChat extends BotApiMethodBoolean { public static final String PATH = "banChatSenderChat"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/CreateChatInviteLink.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/CreateChatInviteLink.java index e6edf5912..f7f8c9404 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/CreateChatInviteLink.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/CreateChatInviteLink.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.groupadministration; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; @@ -34,7 +33,6 @@ @RequiredArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class CreateChatInviteLink extends BotApiMethod { public static final String PATH = "createChatInviteLink"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/CreateChatSubscriptionInviteLink.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/CreateChatSubscriptionInviteLink.java index 54be02c7b..a71322667 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/CreateChatSubscriptionInviteLink.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/CreateChatSubscriptionInviteLink.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.groupadministration; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.Builder; @@ -36,7 +35,6 @@ @RequiredArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class CreateChatSubscriptionInviteLink extends BotApiMethod { public static final String PATH = "createChatSubscriptionInviteLink"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/DeclineChatJoinRequest.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/DeclineChatJoinRequest.java index 2077ed34a..bf25d562d 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/DeclineChatJoinRequest.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/DeclineChatJoinRequest.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.groupadministration; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -28,7 +27,6 @@ @RequiredArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class DeclineChatJoinRequest extends BotApiMethodBoolean { public static final String PATH = "declineChatJoinRequest"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/DeleteChatPhoto.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/DeleteChatPhoto.java index 383eccca7..5e5babf35 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/DeleteChatPhoto.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/DeleteChatPhoto.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.groupadministration; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -30,7 +29,6 @@ @RequiredArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class DeleteChatPhoto extends BotApiMethodBoolean { public static final String PATH = "deleteChatPhoto"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/DeleteChatStickerSet.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/DeleteChatStickerSet.java index ea3a33f42..b388f33a7 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/DeleteChatStickerSet.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/DeleteChatStickerSet.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.groupadministration; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -29,7 +28,6 @@ @RequiredArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class DeleteChatStickerSet extends BotApiMethodBoolean { public static final String PATH = "deleteChatStickerSet"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/EditChatInviteLink.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/EditChatInviteLink.java index 61250e865..d6b2ccb3f 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/EditChatInviteLink.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/EditChatInviteLink.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.groupadministration; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; @@ -36,7 +35,6 @@ @RequiredArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class EditChatInviteLink extends BotApiMethod { public static final String PATH = "editChatInviteLink"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/EditChatSubscriptionInviteLink.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/EditChatSubscriptionInviteLink.java index 3f62d27d1..1f9cb098b 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/EditChatSubscriptionInviteLink.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/EditChatSubscriptionInviteLink.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.groupadministration; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; @@ -34,7 +33,6 @@ @RequiredArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class EditChatSubscriptionInviteLink extends BotApiMethod { public static final String PATH = "editChatSubscriptionInviteLink"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/ExportChatInviteLink.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/ExportChatInviteLink.java index d3f240091..517ab17d1 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/ExportChatInviteLink.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/ExportChatInviteLink.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.groupadministration; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -34,7 +33,6 @@ @RequiredArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class ExportChatInviteLink extends BotApiMethod { public static final String PATH = "exportChatInviteLink"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/GetChat.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/GetChat.java index 1387ced41..b2c997b56 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/GetChat.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/GetChat.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.groupadministration; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -28,7 +27,6 @@ @RequiredArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class GetChat extends BotApiMethod { public static final String PATH = "getChat"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/GetChatAdministrators.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/GetChatAdministrators.java index a8945003d..7a66f10bb 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/GetChatAdministrators.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/GetChatAdministrators.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.groupadministration; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -34,7 +33,6 @@ @RequiredArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class GetChatAdministrators extends BotApiMethod> { public static final String PATH = "getChatAdministrators"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/GetChatMember.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/GetChatMember.java index 57dab97bf..c19710a1d 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/GetChatMember.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/GetChatMember.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.groupadministration; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -30,7 +29,6 @@ @RequiredArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class GetChatMember extends BotApiMethod { public static final String PATH = "getChatMember"; 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 index f232b15fc..6cca3fd50 100644 --- 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 @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.groupadministration; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -27,7 +26,6 @@ @RequiredArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class GetChatMemberCount extends BotApiMethod { public static final String PATH = "getChatMemberCount"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/LeaveChat.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/LeaveChat.java index e5096e3cc..d3303aee4 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/LeaveChat.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/LeaveChat.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.groupadministration; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -26,7 +25,6 @@ @RequiredArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class LeaveChat extends BotApiMethodBoolean { public static final String PATH = "leaveChat"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/PromoteChatMember.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/PromoteChatMember.java index 9db3c4403..a237f9662 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/PromoteChatMember.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/PromoteChatMember.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.groupadministration; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; @@ -31,7 +30,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class PromoteChatMember extends BotApiMethodBoolean { public static final String PATH = "promoteChatMember"; 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 4fd5af8f3..2d6f90989 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 @@ -1,7 +1,6 @@ package org.telegram.telegrambots.meta.api.methods.groupadministration; import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; @@ -38,7 +37,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class RestrictChatMember extends BotApiMethodBoolean { public static final String PATH = "restrictchatmember"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/RevokeChatInviteLink.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/RevokeChatInviteLink.java index 1dba2a331..69d145b08 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/RevokeChatInviteLink.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/RevokeChatInviteLink.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.groupadministration; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -36,7 +35,6 @@ @RequiredArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class RevokeChatInviteLink extends BotApiMethod { public static final String PATH = "revokeChatInviteLink"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/SetChatAdministratorCustomTitle.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/SetChatAdministratorCustomTitle.java index 064d2fe89..f456fa343 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/SetChatAdministratorCustomTitle.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/SetChatAdministratorCustomTitle.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.groupadministration; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -27,7 +26,6 @@ @RequiredArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class SetChatAdministratorCustomTitle extends BotApiMethodBoolean { public static final String PATH = "setChatAdministratorCustomTitle"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/SetChatDescription.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/SetChatDescription.java index a58e03559..d4a8f8891 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/SetChatDescription.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/SetChatDescription.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.groupadministration; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; @@ -30,7 +29,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class SetChatDescription extends BotApiMethodBoolean { public static final String PATH = "setChatDescription"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/SetChatPermissions.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/SetChatPermissions.java index f3109a170..9ce64db16 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/SetChatPermissions.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/SetChatPermissions.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.groupadministration; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; @@ -31,7 +30,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class SetChatPermissions extends BotApiMethodBoolean { public static final String PATH = "setChatPermissions"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/SetChatPhoto.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/SetChatPhoto.java index c56877f10..715ca40b7 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/SetChatPhoto.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/SetChatPhoto.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.groupadministration; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.NonNull; @@ -31,7 +30,6 @@ @RequiredArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class SetChatPhoto extends PartialBotApiMethod { public static final String PATH = "setChatPhoto"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/SetChatStickerSet.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/SetChatStickerSet.java index 4f8ce0572..4fdea7273 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/SetChatStickerSet.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/SetChatStickerSet.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.groupadministration; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -29,7 +28,6 @@ @RequiredArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class SetChatStickerSet extends BotApiMethodBoolean { public static final String PATH = "setChatStickerSet"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/SetChatTitle.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/SetChatTitle.java index 555f331e5..d2fc12253 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/SetChatTitle.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/SetChatTitle.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.groupadministration; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -30,7 +29,6 @@ @RequiredArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class SetChatTitle extends BotApiMethodBoolean { public static final String PATH = "setChatTitle"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/UnbanChatMember.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/UnbanChatMember.java index 90dbcb04c..d2ceb20cb 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/UnbanChatMember.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/UnbanChatMember.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.groupadministration; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; @@ -35,7 +34,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class UnbanChatMember extends BotApiMethodBoolean { public static final String PATH = "unbanchatmember"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/UnbanChatSenderChat.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/UnbanChatSenderChat.java index c86c8f31d..7a6ea3eaf 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/UnbanChatSenderChat.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/groupadministration/UnbanChatSenderChat.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.groupadministration; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -29,7 +28,6 @@ @RequiredArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class UnbanChatSenderChat extends BotApiMethodBoolean { public static final String PATH = "unbanChatSenderChat"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/invoices/CreateInvoiceLink.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/invoices/CreateInvoiceLink.java index 39a3c92f3..705451dc1 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/invoices/CreateInvoiceLink.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/invoices/CreateInvoiceLink.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.invoices; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; @@ -34,7 +33,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class CreateInvoiceLink extends BotApiMethod { public static final String PATH = "createInvoiceLink"; @@ -58,6 +56,8 @@ public class CreateInvoiceLink extends BotApiMethod { public static final String SEND_PHONE_NUMBER_TO_PROVIDER_FIELD = "send_phone_number_to_provider"; public static final String SEND_EMAIL_TO_PROVIDER_FIELD = "send_email_to_provider"; public static final String IS_FLEXIBLE_FIELD = "is_flexible"; + public static final String BUSINESS_CONNECTION_ID_FIELD = "business_connection_id"; + public static final String SUBSCRIPTION_PERIOD_FIELD = "subscription_period"; /** * Product name, 1-32 characters @@ -201,6 +201,21 @@ public class CreateInvoiceLink extends BotApiMethod { @JsonProperty(SUGGESTED_TIP_AMOUNTS_FIELD) @Singular private List suggestedTipAmounts; + /** + * Optional + * Unique identifier of the business connection on behalf of which the invoice will be created + */ + @JsonProperty(BUSINESS_CONNECTION_ID_FIELD) + private String businessConnectionId; + /** + * Optional + * The number of seconds the subscription will be active for before the next payment. + * The currency must be set to “XTR” (Telegram Stars) if the parameter is used. + * + * Currently, it must always be 2592000 (30 days) if specified. + */ + @JsonProperty(SUBSCRIPTION_PERIOD_FIELD) + private Integer subscriptionPeriod; @Override public String getMethod() { diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/invoices/SendInvoice.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/invoices/SendInvoice.java index eea81cc9a..99c6f9cc4 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/invoices/SendInvoice.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/invoices/SendInvoice.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.invoices; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; @@ -35,7 +34,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class SendInvoice extends BotApiMethodMessage { public static final String PATH = "sendinvoice"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/menubutton/SetChatMenuButton.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/menubutton/SetChatMenuButton.java index 5462bfef6..9b4a33572 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/menubutton/SetChatMenuButton.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/menubutton/SetChatMenuButton.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.menubutton; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; @@ -32,7 +31,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class SetChatMenuButton extends BotApiMethodBoolean { public static final String PATH = "setChatMenuButton"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/message/SavePreparedInlineMessage.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/message/SavePreparedInlineMessage.java new file mode 100644 index 000000000..1d2e3a4df --- /dev/null +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/message/SavePreparedInlineMessage.java @@ -0,0 +1,96 @@ +package org.telegram.telegrambots.meta.api.methods.message; + +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.methods.botapimethods.BotApiMethod; +import org.telegram.telegrambots.meta.api.objects.inlinequery.result.InlineQueryResult; +import org.telegram.telegrambots.meta.api.objects.message.PreparedInlineMessage; +import org.telegram.telegrambots.meta.exceptions.TelegramApiRequestException; +import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException; + +/** + * @author Ruben Bermudez + * @version 8.0 + * Stores a message that can be sent by a user of a Mini App. + * Returns a PreparedInlineMessage object. + */ +@EqualsAndHashCode(callSuper = false) +@Getter +@Setter +@ToString +@RequiredArgsConstructor +@AllArgsConstructor +@SuperBuilder +@Jacksonized +public class SavePreparedInlineMessage extends BotApiMethod { + public static final String PATH = "savePreparedInlineMessage"; + + private static final String USER_ID_FIELD = "user_id"; + private static final String RESULT_FIELD = "result"; + private static final String ALLOW_USER_CHATS_FIELD = "allow_user_chats"; + private static final String ALLOW_BOT_CHATS_FIELD = "allow_bot_chats"; + private static final String ALLOW_GROUP_CHATS_FIELD = "allow_group_chats"; + private static final String ALLOW_CHANNEL_CHATS_FIELD = "allow_channel_chats"; + + /** + * Unique identifier of the target user that can use the prepared message + */ + @JsonProperty(USER_ID_FIELD) + @NonNull + private Integer userId; + /** + * A JSON-serialized object describing the message to be sent + */ + @JsonProperty(RESULT_FIELD) + @NonNull + private InlineQueryResult result; + /** + * Pass True if the message can be sent to private chats with users + */ + @JsonProperty(ALLOW_USER_CHATS_FIELD) + private Boolean allowUserChats; + /** + * Pass True if the message can be sent to private chats with bots + */ + @JsonProperty(ALLOW_BOT_CHATS_FIELD) + private Integer allowBotChats; + /** + * Pass True if the message can be sent to group and supergroup chats + */ + @JsonProperty(ALLOW_GROUP_CHATS_FIELD) + @NonNull + private Boolean allowGroupChats; + /** + * Pass True if the message can be sent to channel chats + */ + @JsonProperty(ALLOW_CHANNEL_CHATS_FIELD) + @NonNull + private Boolean allowChannelChats; + + @Override + public PreparedInlineMessage deserializeResponse(String answer) throws TelegramApiRequestException { + return deserializeResponse(answer, PreparedInlineMessage.class); + } + + + @Override + public void validate() throws TelegramApiValidationException { + if (userId == 0) { + throw new TelegramApiValidationException("UserId can't be empty", this); + } + result.validate(); + } + + @Override + public String getMethod() { + return PATH; + } +} diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/payments/RefundStarPayment.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/payments/RefundStarPayment.java index 866b102c5..ec9e2e932 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/payments/RefundStarPayment.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/payments/RefundStarPayment.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.payments; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -26,7 +25,6 @@ @RequiredArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class RefundStarPayment extends BotApiMethodBoolean { public static final String PATH = "refundStarPayment"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/payments/star/EditUserStarSubscription.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/payments/star/EditUserStarSubscription.java new file mode 100644 index 000000000..3ed290506 --- /dev/null +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/payments/star/EditUserStarSubscription.java @@ -0,0 +1,73 @@ +package org.telegram.telegrambots.meta.api.methods.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.ToString; +import lombok.experimental.SuperBuilder; +import lombok.extern.jackson.Jacksonized; +import org.telegram.telegrambots.meta.api.methods.botapimethods.BotApiMethodBoolean; +import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException; + +/** + * @author Ruben Bermudez + * @version 8.0 + * + * Allows the bot to cancel or re-enable extension of a subscription paid in Telegram Stars. + * Returns True on success. + */ +@EqualsAndHashCode(callSuper = false) +@Getter +@Setter +@ToString +@AllArgsConstructor +@SuperBuilder +@Jacksonized +@JsonIgnoreProperties(ignoreUnknown = true) +public class EditUserStarSubscription extends BotApiMethodBoolean { + public static final String PATH = "editUserStarSubscription"; + + private static final String USER_ID_FIELD = "user_id"; + private static final String TELEGRAM_PAYMENT_CHARGE_ID_FIELD = "telegram_payment_charge_id"; + private static final String IS_CANCELLED_FIELD = "is_canceled"; + + /** + * Identifier of the user whose subscription will be edited + */ + @JsonProperty(USER_ID_FIELD) + @NonNull + private Integer userId; + /** + * Telegram payment identifier for the subscription + */ + @JsonProperty(TELEGRAM_PAYMENT_CHARGE_ID_FIELD) + @NonNull + private String telegramPaymentChargeId; + /** + * Pass True to cancel extension of the user subscription; + * the subscription must be active up to the end of the current subscription period. + * Pass False to allow the user to re-enable a subscription that was previously canceled by the bot. + */ + @JsonProperty(IS_CANCELLED_FIELD) + @NonNull + private Boolean isCancelled; + + @Override + public String getMethod() { + return PATH; + } + + @Override + public void validate() throws TelegramApiValidationException { + if (userId == 0) { + throw new TelegramApiValidationException("UserId parameters must not be 0", this); + } + if (telegramPaymentChargeId.isEmpty()) { + throw new TelegramApiValidationException("TelegramPaymentChargeId can´t be empty", this); + } + } +} 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 index 777e6c850..96a875f5b 100644 --- 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 @@ -1,6 +1,5 @@ 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; @@ -28,7 +27,6 @@ @RequiredArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class GetStarTransactions extends BotApiMethod { public static final String PATH = "getStarTransactions"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/pinnedmessages/PinChatMessage.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/pinnedmessages/PinChatMessage.java index fff19f5f5..fd6ce8f1a 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/pinnedmessages/PinChatMessage.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/pinnedmessages/PinChatMessage.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.pinnedmessages; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; @@ -32,7 +31,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class PinChatMessage extends BotApiMethodBoolean { public static final String PATH = "pinChatMessage"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/pinnedmessages/UnpinAllChatMessages.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/pinnedmessages/UnpinAllChatMessages.java index 7f3c69e9b..d2b1fa86d 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/pinnedmessages/UnpinAllChatMessages.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/pinnedmessages/UnpinAllChatMessages.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.pinnedmessages; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -31,7 +30,6 @@ @RequiredArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class UnpinAllChatMessages extends BotApiMethodBoolean { public static final String PATH = "unpinAllChatMessages"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/pinnedmessages/UnpinChatMessage.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/pinnedmessages/UnpinChatMessage.java index 532380621..9b5b8c014 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/pinnedmessages/UnpinChatMessage.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/pinnedmessages/UnpinChatMessage.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.pinnedmessages; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; @@ -33,7 +32,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class UnpinChatMessage extends BotApiMethodBoolean { public static final String PATH = "unpinChatMessage"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/polls/SendPoll.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/polls/SendPoll.java index 6a890cb22..59597e64c 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/polls/SendPoll.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/polls/SendPoll.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.polls; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; @@ -38,7 +37,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class SendPoll extends BotApiMethodMessage { public static final String PATH = "sendPoll"; 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 f91b40eab..c423286f5 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 @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.polls; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -30,7 +29,6 @@ @RequiredArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class StopPoll extends BotApiMethod { public static final String PATH = "stopPoll"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/reactions/SetMessageReaction.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/reactions/SetMessageReaction.java index ebc6b4ed7..d9b6fcd18 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/reactions/SetMessageReaction.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/reactions/SetMessageReaction.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.reactions; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; @@ -40,7 +39,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class SetMessageReaction extends BotApiMethodBoolean { public static final String PATH = "setMessageReaction"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendAnimation.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendAnimation.java index 2bf728635..2897e455b 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendAnimation.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendAnimation.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.send; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -38,7 +37,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class SendAnimation extends SendMediaBotMethod { public static final String PATH = "sendAnimation"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendAudio.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendAudio.java index a30fa13d6..4e2aefd0a 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendAudio.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendAudio.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.send; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -39,7 +38,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class SendAudio extends SendMediaBotMethod { public static final String PATH = "sendaudio"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendChatAction.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendChatAction.java index 6eae543ad..0ad4b6780 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendChatAction.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendChatAction.java @@ -1,7 +1,6 @@ package org.telegram.telegrambots.meta.api.methods.send; import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -30,7 +29,6 @@ @RequiredArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class SendChatAction extends BotApiMethodBoolean { public static final String PATH = "sendChatAction"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendContact.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendContact.java index b32c24806..c4752bfea 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendContact.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendContact.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.send; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; @@ -31,7 +30,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class SendContact extends BotApiMethodMessage { public static final String PATH = "sendContact"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendDice.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendDice.java index 3cbd2ee4f..8df46d552 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendDice.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendDice.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.send; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; @@ -34,7 +33,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class SendDice extends BotApiMethodMessage { private static final List VALIDEMOJIS = Collections.unmodifiableList(Arrays.asList("🎲", "🎯", "🏀", "⚽", "🎳", "🎰")); diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendDocument.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendDocument.java index e95caa85b..1853ddad8 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendDocument.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendDocument.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.send; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -35,7 +34,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class SendDocument extends SendMediaBotMethod { public static final String PATH = "senddocument"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendGame.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendGame.java index 2c957b2dd..e3ecf71fa 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendGame.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendGame.java @@ -17,7 +17,6 @@ package org.telegram.telegrambots.meta.api.methods.send; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; @@ -47,7 +46,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class SendGame extends BotApiMethodMessage { public static final String PATH = "sendGame"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendLocation.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendLocation.java index ffa7732d9..5b6866542 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendLocation.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendLocation.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.send; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; @@ -30,7 +29,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class SendLocation extends BotApiMethodMessage { public static final String PATH = "sendlocation"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendMediaGroup.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendMediaGroup.java index 22a9b6be2..4e11e464f 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendMediaGroup.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendMediaGroup.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.send; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -43,7 +42,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class SendMediaGroup extends PartialBotApiMethod> { public static final String PATH = "sendMediaGroup"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendMessage.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendMessage.java index eb5c6a51b..481ae109a 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendMessage.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendMessage.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.send; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; @@ -36,7 +35,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class SendMessage extends BotApiMethodMessage { public static final String PATH = "sendmessage"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendPaidMedia.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendPaidMedia.java index a890f73d9..9810087f6 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendPaidMedia.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendPaidMedia.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.send; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -38,7 +37,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class SendPaidMedia extends PartialBotApiMethod> { public static final String PATH = "sendPaidMedia"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendPhoto.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendPhoto.java index 9090d98f8..d49d3a9e0 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendPhoto.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendPhoto.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.send; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -36,7 +35,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class SendPhoto extends SendMediaBotMethod { public static final String PATH = "sendphoto"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendSticker.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendSticker.java index 30458e000..76ccfc980 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendSticker.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendSticker.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.send; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -32,7 +31,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class SendSticker extends SendMediaBotMethod { public static final String PATH = "sendsticker"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendVenue.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendVenue.java index cab88625b..f5791e7d7 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendVenue.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendVenue.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.send; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; @@ -31,7 +30,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class SendVenue extends BotApiMethodMessage { public static final String PATH = "sendVenue"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendVideo.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendVideo.java index 5d89a0af4..eb8159904 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendVideo.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendVideo.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.send; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -36,7 +35,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class SendVideo extends SendMediaBotMethod { public static final String PATH = "sendvideo"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendVideoNote.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendVideoNote.java index bd85e1e77..5178a5852 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendVideoNote.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendVideoNote.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.send; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -33,7 +32,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class SendVideoNote extends SendMediaBotMethod { public static final String PATH = "sendvideonote"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendVoice.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendVoice.java index 20715ad46..b1596a591 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendVoice.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/send/SendVoice.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.send; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -39,7 +38,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class SendVoice extends SendMediaBotMethod { public static final String PATH = "sendVoice"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/stickers/AddStickerToSet.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/stickers/AddStickerToSet.java index f03f54fcb..a8998ed98 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/stickers/AddStickerToSet.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/stickers/AddStickerToSet.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.stickers; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.NonNull; @@ -29,7 +28,6 @@ @RequiredArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class AddStickerToSet extends PartialBotApiMethod { public static final String PATH = "addStickerToSet"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/stickers/CreateNewStickerSet.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/stickers/CreateNewStickerSet.java index 906aea6a9..b05abc586 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/stickers/CreateNewStickerSet.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/stickers/CreateNewStickerSet.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.stickers; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.EqualsAndHashCode; @@ -14,7 +13,6 @@ import lombok.extern.jackson.Jacksonized; import org.telegram.telegrambots.meta.api.methods.botapimethods.PartialBotApiMethod; import org.telegram.telegrambots.meta.api.objects.stickers.InputSticker; -import org.telegram.telegrambots.meta.exceptions.TelegramApiException; import org.telegram.telegrambots.meta.exceptions.TelegramApiRequestException; import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException; @@ -37,7 +35,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class CreateNewStickerSet extends PartialBotApiMethod { public static final String PATH = "createNewStickerSet"; @@ -92,32 +89,6 @@ public String getMethod() { return PATH; } - /** - * Returns the sticker format. Will only work if all stickers are of the same type, an exception is thrown otherwise - * @deprecated Use the format within each sticker - */ - @Deprecated - public String getStickerFormat() throws TelegramApiException { - List formats = stickers.stream().map(InputSticker::getFormat).distinct().toList(); - if (formats.size() > 1) { - throw new TelegramApiException("Multiple format present in strickers"); - } - return formats.isEmpty() ? null : formats.get(0); - } - - /** - * Returns the sticker format. - * Will only work if no sticker with other format already exists in the list - * @deprecated Use the format within each sticker - */ - @Deprecated - public void setStickerFormat(String stickerFormat) throws TelegramApiException { - String existingFormat = getStickerFormat(); - if (existingFormat == null || !existingFormat.equals(stickerFormat)) { - this.stickers.forEach(x -> x.setFormat(stickerFormat)); - } - } - @Override public Boolean deserializeResponse(String answer) throws TelegramApiRequestException { return deserializeResponse(answer, Boolean.class); diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/stickers/DeleteStickerFromSet.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/stickers/DeleteStickerFromSet.java index 610f3c321..ff8423042 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/stickers/DeleteStickerFromSet.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/stickers/DeleteStickerFromSet.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.stickers; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -25,7 +24,6 @@ @RequiredArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class DeleteStickerFromSet extends BotApiMethodBoolean { private static final String PATH = "deleteStickerFromSet"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/stickers/DeleteStickerSet.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/stickers/DeleteStickerSet.java index de14adee6..1f20ecf25 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/stickers/DeleteStickerSet.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/stickers/DeleteStickerSet.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.stickers; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -28,7 +27,6 @@ @RequiredArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class DeleteStickerSet extends BotApiMethodBoolean { public static final String PATH = "deleteStickerSet"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/stickers/GetStickerSet.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/stickers/GetStickerSet.java index 252e2f783..08872738a 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/stickers/GetStickerSet.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/stickers/GetStickerSet.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.stickers; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -27,7 +26,6 @@ @RequiredArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class GetStickerSet extends BotApiMethod { private static final String PATH = "getStickerSet"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/stickers/ReplaceStickerInSet.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/stickers/ReplaceStickerInSet.java index 07611a89f..5b8c427da 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/stickers/ReplaceStickerInSet.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/stickers/ReplaceStickerInSet.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.stickers; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.NonNull; @@ -28,7 +27,6 @@ @RequiredArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class ReplaceStickerInSet extends PartialBotApiMethod { public static final String PATH = "replaceStickerInSet"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/stickers/SetCustomEmojiStickerSetThumbnail.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/stickers/SetCustomEmojiStickerSetThumbnail.java index f83abc4af..2ec5ae57c 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/stickers/SetCustomEmojiStickerSetThumbnail.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/stickers/SetCustomEmojiStickerSetThumbnail.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.stickers; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; @@ -30,7 +29,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class SetCustomEmojiStickerSetThumbnail extends BotApiMethodBoolean { public static final String PATH = "setCustomEmojiStickerSetThumbnail"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/stickers/SetStickerEmojiList.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/stickers/SetStickerEmojiList.java index d693e39d2..54391db7d 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/stickers/SetStickerEmojiList.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/stickers/SetStickerEmojiList.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.stickers; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -32,7 +31,6 @@ @RequiredArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class SetStickerEmojiList extends BotApiMethodBoolean { public static final String PATH = "setStickerEmojiList"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/stickers/SetStickerKeywords.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/stickers/SetStickerKeywords.java index 2dc91cf42..b72ef4e0f 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/stickers/SetStickerKeywords.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/stickers/SetStickerKeywords.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.stickers; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; @@ -34,7 +33,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class SetStickerKeywords extends BotApiMethodBoolean { public static final String PATH = "setStickerKeywords"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/stickers/SetStickerMaskPosition.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/stickers/SetStickerMaskPosition.java index 6b2591ac7..5a5683b45 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/stickers/SetStickerMaskPosition.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/stickers/SetStickerMaskPosition.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.stickers; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; @@ -32,7 +31,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class SetStickerMaskPosition extends BotApiMethodBoolean { public static final String PATH = "setStickerMaskPosition"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/stickers/SetStickerPositionInSet.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/stickers/SetStickerPositionInSet.java index afe1dce50..879d2c14b 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/stickers/SetStickerPositionInSet.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/stickers/SetStickerPositionInSet.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.stickers; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -26,7 +25,6 @@ @RequiredArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class SetStickerPositionInSet extends BotApiMethodBoolean { private static final String PATH = "setStickerPositionInSet"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/stickers/SetStickerSetThumbnail.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/stickers/SetStickerSetThumbnail.java index 30c432090..352f0e57d 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/stickers/SetStickerSetThumbnail.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/stickers/SetStickerSetThumbnail.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.stickers; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -31,7 +30,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class SetStickerSetThumbnail extends BotApiMethodBoolean { public static final String PATH = "setStickerSetThumbnail"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/stickers/SetStickerSetTitle.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/stickers/SetStickerSetTitle.java index ce94d4235..c263363f4 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/stickers/SetStickerSetTitle.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/stickers/SetStickerSetTitle.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.stickers; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -28,7 +27,6 @@ @RequiredArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class SetStickerSetTitle extends BotApiMethodBoolean { public static final String PATH = "setStickerSetTitle"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/stickers/UploadStickerFile.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/stickers/UploadStickerFile.java index c582a61f0..43e7ca5cb 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/stickers/UploadStickerFile.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/stickers/UploadStickerFile.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.stickers; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.NonNull; @@ -31,7 +30,6 @@ @RequiredArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class UploadStickerFile extends PartialBotApiMethod { public static final String PATH = "uploadStickerFile"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/updates/SetWebhook.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/updates/SetWebhook.java index d5ed93ce4..a37ea1118 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/updates/SetWebhook.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/updates/SetWebhook.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.updates; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; @@ -37,7 +36,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class SetWebhook extends PartialBotApiMethod { public static final String PATH = "setWebhook"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/updatingmessages/DeleteMessage.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/updatingmessages/DeleteMessage.java index 3970303f1..446251ea8 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/updatingmessages/DeleteMessage.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/updatingmessages/DeleteMessage.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.updatingmessages; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -35,7 +34,6 @@ @RequiredArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class DeleteMessage extends BotApiMethodBoolean { public static final String PATH = "deleteMessage"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/updatingmessages/DeleteMessages.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/updatingmessages/DeleteMessages.java index f432d0032..46408bb40 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/updatingmessages/DeleteMessages.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/updatingmessages/DeleteMessages.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.updatingmessages; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -34,7 +33,6 @@ @RequiredArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class DeleteMessages extends BotApiMethodBoolean { private static final String PATH = "deleteMessages"; 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 6d6fe6146..dca6bf012 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,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.updatingmessages; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -33,7 +32,6 @@ @RequiredArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class EditMessageLiveLocation extends BotApiMethodSerializable { public static final String PATH = "editMessageLiveLocation"; 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 1d12c7c49..3024d49cd 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 @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.updatingmessages; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.core.type.TypeReference; import lombok.AllArgsConstructor; @@ -44,7 +43,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class EditMessageMedia extends PartialBotApiMethod { public static final String PATH = "editMessageMedia"; 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 c88af3c5b..44c71de34 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 @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.updatingmessages; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; @@ -40,7 +39,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class EditMessageText extends BotApiMethodSerializable { public static final String PATH = "editmessagetext"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/webapp/AnswerWebAppQuery.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/webapp/AnswerWebAppQuery.java index ee2396195..c0d665c11 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/webapp/AnswerWebAppQuery.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/methods/webapp/AnswerWebAppQuery.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.methods.webapp; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -33,7 +32,6 @@ @RequiredArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class AnswerWebAppQuery extends BotApiMethod { public static final String PATH = "answerWebAppQuery"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/ApiResponse.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/ApiResponse.java index 203b92d43..d6b021224 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/ApiResponse.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/ApiResponse.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.objects; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; @@ -16,7 +15,6 @@ * Response from Telegram Server */ @Getter -@JsonIgnoreProperties(ignoreUnknown = true) @JsonInclude(JsonInclude.Include.NON_NULL) @Builder @NoArgsConstructor diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/Audio.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/Audio.java index 8eb6b65f4..bc40be208 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/Audio.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/Audio.java @@ -1,11 +1,9 @@ package org.telegram.telegrambots.meta.api.objects; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; import lombok.Getter; -import lombok.NoArgsConstructor; import lombok.RequiredArgsConstructor; import lombok.Setter; import lombok.ToString; @@ -26,7 +24,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class Audio implements BotApiObject { private static final String FILEID_FIELD = "file_id"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/Birthdate.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/Birthdate.java index e1dfea719..df475c635 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/Birthdate.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/Birthdate.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.objects; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; @@ -26,7 +25,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class Birthdate implements BotApiObject { private static final String DAY_FIELD = "day"; private static final String MONTH_FIELD = "month"; 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 deleted file mode 100644 index e74b95498..000000000 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/Chat.java +++ /dev/null @@ -1,401 +0,0 @@ -package org.telegram.telegrambots.meta.api.objects; - -import com.fasterxml.jackson.annotation.JsonIgnore; -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.business.BusinessIntro; -import org.telegram.telegrambots.meta.api.objects.business.BusinessLocation; -import org.telegram.telegrambots.meta.api.objects.business.BusinessOpeningHours; -import org.telegram.telegrambots.meta.api.objects.message.Message; -import org.telegram.telegrambots.meta.api.objects.reactions.ReactionType; - -import java.util.List; - -/** - * This object represents a Telegram chat with a user or a group - * @author Ruben Bermudez - * @version 6.1 - * @deprecated Use {{@link org.telegram.telegrambots.meta.api.objects.chat.Chat}} - */ -@SuppressWarnings("WeakerAccess") -@EqualsAndHashCode(callSuper = false) -@Getter -@Setter -@ToString -@RequiredArgsConstructor -@AllArgsConstructor -@SuperBuilder -@Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) -@Deprecated -public class Chat implements BotApiObject { - - private static final String ID_FIELD = "id"; - private static final String TYPE_FIELD = "type"; - private static final String TITLE_FIELD = "title"; - private static final String USERNAME_FIELD = "username"; - private static final String FIRSTNAME_FIELD = "first_name"; - private static final String LASTNAME_FIELD = "last_name"; - private static final String BIO_FIELD = "bio"; - private static final String PHOTO_FIELD = "photo"; - private static final String DESCRIPTION_FIELD = "description"; - private static final String INVITELINK_FIELD = "invite_link"; - private static final String PINNEDMESSAGE_FIELD = "pinned_message"; - private static final String STICKERSETNAME_FIELD = "sticker_set_name"; - private static final String CANSETSTICKERSET_FIELD = "can_set_sticker_set"; - private static final String PERMISSIONS_FIELD = "permissions"; - private static final String SLOWMODEDELAY_FIELD = "slow_mode_delay"; - private static final String LINKEDCHATID_FIELD = "linked_chat_id"; - private static final String LOCATION_FIELD = "location"; - private static final String MESSAGEAUTODELETETIME_FIELD = "message_auto_delete_time"; - private static final String HASPRIVATEFORWARDS_FIELD = "has_private_forwards"; - private static final String HASPROTECTEDCONTENT_FIELD = "has_protected_content"; - private static final String JOINTOSENDMESSAGES_FIELD = "join_to_send_messages"; - private static final String JOINBYREQUEST_FIELD = "join_by_request"; - private static final String HASRESTRICTEDVOICEANDVIDEOMESSAGES_FIELD = "has_restricted_voice_and_video_messages"; - private static final String ISFORUM_FIELD = "is_forum"; - private static final String ACTIVEUSERNAMES_FIELD = "active_usernames"; - private static final String HASAGGRESSIVEANTISPAMENABLED_FIELD = "has_aggressive_anti_spam_enabled"; - private static final String HASHIDDENMEMBERS_FIELD = "has_hidden_members"; - private static final String AVAILABLE_REACTIONS_FIELD = "available_reactions"; - private static final String ACCENT_COLOR_ID_FIELD = "accent_color_id"; - private static final String BACKGROUND_CUSTOM_EMOJI_ID_FIELD = "background_custom_emoji_id"; - private static final String PROFILE_ACCENT_COLOR_ID_FIELD = "profile_accent_color_id"; - private static final String PROFILE_BACKGROUND_CUSTOM_EMOJI_ID_FIELD = "profile_background_custom_emoji_id"; - private static final String HAS_VISIBLE_HISTORY_FIELD = "has_visible_history"; - private static final String EMOJI_STATUS_CUSTOM_ID_FIELD = "emoji_status_custom_emoji_id"; - private static final String EMOJI_STATUS_EXPIRATION_DATE_FIELD = "emoji_status_expiration_date"; - private static final String UNRESTRICT_BOOST_COUNT_FIELD = "unrestrict_boost_count"; - private static final String CUSTOM_EMOJI_STICKER_SET_NAME_FIELD = "custom_emoji_sticker_set_name"; - private static final String BIRTHDATE_FIELD = "birthdate"; - private static final String BUSINESS_INTRO_FIELD = "business_intro"; - private static final String BUSINESS_LOCATION_FIELD = "business_location"; - private static final String BUSINESS_OPENING_HOURS_FIELD = "business_opening_hours"; - private static final String PERSONAL_CHAT_FIELD = "personal_chat"; - - private static final String USERCHATTYPE = "private"; - private static final String GROUPCHATTYPE = "group"; - private static final String CHANNELCHATTYPE = "channel"; - private static final String SUPERGROUPCHATTYPE = "supergroup"; - - /** - * Unique identifier for this chat. - * This number may be greater than 32 bits and some programming languages may - * have difficulty/silent defects in interpreting it. But it smaller than 52 bits, - * so a signed 64 bit integer or double-precision float type are safe for storing this identifier. - */ - @JsonProperty(ID_FIELD) - @NonNull - private Long id; - /** - * Type of the chat, one of “private”, “group” or “channel” or "supergroup" - */ - @JsonProperty(TYPE_FIELD) - @NonNull - private String type; - /** - * Optional. - * Title of the chat, only for channels and group chat - */ - @JsonProperty(TITLE_FIELD) - private String title; - /** - * Optional. - * Interlocutor's first name for private chats - */ - @JsonProperty(FIRSTNAME_FIELD) - private String firstName; - /** - * Optional. - * Interlocutor's last name for private chats - */ - @JsonProperty(LASTNAME_FIELD) - private String lastName; - /** - * Optional - * Username of the chat, only for private chats and channels if available - */ - @JsonProperty(USERNAME_FIELD) - private String userName; - /** - * Optional. - * Chat photo. Returned only in getChat. - */ - @JsonProperty(PHOTO_FIELD) - private ChatPhoto photo; - /** - * Optional. - * Description, for groups, supergroups and channel chats. Returned only in getChat. - */ - @JsonProperty(DESCRIPTION_FIELD) - private String description; - /** - * Optional. - * Primary invite link, for groups, supergroups and channel chats. Returned only in getChat. - */ - @JsonProperty(INVITELINK_FIELD) - private String inviteLink; - /** - * Optional. - * The most recent pinned message (by sending date). Returned only in getChat. - */ - @JsonProperty(PINNEDMESSAGE_FIELD) - private Message pinnedMessage; - /** - * Optional. - * For supergroups, name of Group sticker set. Returned only in getChat. - */ - @JsonProperty(STICKERSETNAME_FIELD) - private String stickerSetName; - /** - * Optional. - * True, if the bot can change group the sticker set. Returned only in getChat. - */ - @JsonProperty(CANSETSTICKERSET_FIELD) - private Boolean canSetStickerSet; - /** - * Optional. - * Default chat member permissions, for groups and supergroups. Returned only in getChat. - */ - @JsonProperty(PERMISSIONS_FIELD) - private ChatPermissions permissions; - /** - * Optional. - * For supergroups, the minimum allowed delay between consecutive messages sent by each unpriviledged user. - * Returned only in getChat. - */ - @JsonProperty(SLOWMODEDELAY_FIELD) - private Integer slowModeDelay; - /** - * Optional. - * Bio of the other party in a private chat. Returned only in getChat. - */ - @JsonProperty(BIO_FIELD) - private String bio; - /** - * Optional. - * Unique identifier for the linked chat, - * i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. - * This identifier may be greater than 32 bits and some programming - * languages may have difficulty/silent defects in interpreting it. - * But it is smaller than 52 bits, so a signed 64 bit integer or - * double-precision float type are safe for storing this identifier. - * Returned only in getChat. - */ - @JsonProperty(LINKEDCHATID_FIELD) - private Long linkedChatId; - /** - * Optional. For supergroups, the location to which the supergroup is connected. Returned only in getChat. - */ - @JsonProperty(LOCATION_FIELD) - private ChatLocation location; - /** - * Optional. The time after which all messages sent to the chat will be automatically deleted; in seconds. Returned only in getChat. - */ - @JsonProperty(MESSAGEAUTODELETETIME_FIELD) - private Integer messageAutoDeleteTime; - /** - * Optional. - * True, if privacy settings of the other party in the private chat allows to use tg://user?id= links only in chats with the user. - * Returned only in getChat. - */ - @JsonProperty(HASPRIVATEFORWARDS_FIELD) - private Boolean hasPrivateForwards; - /** - * Optional. - * True, if messages from the chat can't be forwarded to other chats. - * Returned only in getChat. - */ - @JsonProperty(HASPROTECTEDCONTENT_FIELD) - private Boolean hasProtectedContent; - /** - * Optional. - * True, if users need to join the supergroup before they can send messages. - * Returned only in getChat. - */ - @JsonProperty(JOINTOSENDMESSAGES_FIELD) - private Boolean joinToSendMessages; - /** - * Optional. - * True, if all users directly joining the supergroup need to be approved by supergroup administrators. - * Returned only in getChat. - */ - @JsonProperty(JOINBYREQUEST_FIELD) - private Boolean joinByRequest; - /** - * Optional. - * True, if the privacy settings of the other party restrict sending voice and video note messages in the private chat. - * Returned only in getChat. - */ - @JsonProperty(HASRESTRICTEDVOICEANDVIDEOMESSAGES_FIELD) - private Boolean hasRestrictedVoiceAndVideoMessages; - /** - * Optional. - * True, if the supergroup chat is a forum (has topics enabled) - */ - @JsonProperty(ISFORUM_FIELD) - private Boolean isForum; - /** - * Optional. - * If non-empty, the list of all active chat usernames; for private chats, supergroups and channels. - * Returned only in getChat. - */ - @JsonProperty(ACTIVEUSERNAMES_FIELD) - private List activeUsernames; - /** - * Optional. - * Custom emoji identifier of the emoji status of the chat or the other party in a private chat. - * Returned only in getChat. - */ - @JsonProperty(EMOJI_STATUS_CUSTOM_ID_FIELD) - private String emojiStatusCustomEmojiId; - /** - * Optional. - * True, if aggressive anti-spam checks are enabled in the supergroup. - * The field is only available to chat administrators. - * Returned only in getChat. - */ - @JsonProperty(HASAGGRESSIVEANTISPAMENABLED_FIELD) - private Boolean hasAggressiveAntiSpamEnabled; - /** - * Optional. - * True, if non-administrators can only get the list of bots and administrators in the chat. - * Returned only in getChat. - */ - @JsonProperty(HASHIDDENMEMBERS_FIELD) - private Boolean hasHiddenMembers; - /** - * Optional. - * Expiration date of the emoji status of the other party in a private chat, if any. - * Returned only in getChat. - */ - @JsonProperty(EMOJI_STATUS_EXPIRATION_DATE_FIELD) - private Boolean emojiStatusExpirationDate; - /** - * Optional. - * List of available reactions allowed in the chat. - * If omitted, then all emoji reactions are allowed. - * Returned only in getChat. - */ - @JsonProperty(AVAILABLE_REACTIONS_FIELD) - private List availableReactions; - /** - * Optional. - * Identifier of the accent color for the chat name and backgrounds of the chat photo, reply header, and link preview. - * See accent colors for more details. - * Returned only in getChat. - * Always returned in getChat. - */ - @JsonProperty(ACCENT_COLOR_ID_FIELD) - private Integer accentColorId; - /** - * Optional. - * Custom emoji identifier of emoji chosen by the chat for the reply header and link preview background. - * Returned only in getChat. - */ - @JsonProperty(BACKGROUND_CUSTOM_EMOJI_ID_FIELD) - private String backgroundCustomEmojiId; - /** - * Optional. - * Identifier of the accent color for the chat's profile background. - * See profile accent colors for more details. - * Returned only in getChat. - */ - @JsonProperty(PROFILE_ACCENT_COLOR_ID_FIELD) - private Boolean profileAccentColorId; - /** - * Optional. - * Custom emoji identifier of the emoji chosen by the chat for its profile background. - * Returned only in getChat. - */ - @JsonProperty(PROFILE_BACKGROUND_CUSTOM_EMOJI_ID_FIELD) - private String profileBackgroundCustomEmojiId; - /** - * Optional. - * True, if new chat members will have access to old messages; available only to chat administrators. - * Returned only in getChat. - */ - @JsonProperty(HAS_VISIBLE_HISTORY_FIELD) - private Boolean hasVisibleHistory; - /** - * Optional. - * For supergroups, the minimum number of boosts that a non-administrator - * user needs to add in order to ignore slow mode and chat permissions. - * Returned only in getChat. - */ - @JsonProperty(UNRESTRICT_BOOST_COUNT_FIELD) - private Integer unrestrictBoostCount; - /** - * Optional. - * For supergroups, the name of the group's custom emoji sticker set. Custom emoji from - * this set can be used by all users and bots in the group. - * Returned only in getChat. - */ - @JsonProperty(CUSTOM_EMOJI_STICKER_SET_NAME_FIELD) - private String customEmojiStickerSetName; - /** - * Optional. - * For private chats, the date of birth of the user. - * Returned only in getChat. - */ - @JsonProperty(BIRTHDATE_FIELD) - private Birthdate birthdate; - /** - * Optional. - * For private chats with business accounts, the intro of the business. - * Returned only in getChat. - */ - @JsonProperty(BUSINESS_INTRO_FIELD) - private BusinessIntro businessIntro; - /** - * Optional. - * For private chats with business accounts, the location of the business. - * Returned only in getChat. - */ - @JsonProperty(BUSINESS_LOCATION_FIELD) - private BusinessLocation businessLocation; - /** - * Optional. - * For private chats with business accounts, the opening hours of the business. - * Returned only in getChat. - */ - @JsonProperty(BUSINESS_OPENING_HOURS_FIELD) - private BusinessOpeningHours businessOpeningHours; - /** - * Optional. - * For private chats, the personal channel of the user. - * Returned only in getChat. - */ - @JsonProperty(PERSONAL_CHAT_FIELD) - private Chat personalChat; - - @JsonIgnore - public Boolean isGroupChat() { - return GROUPCHATTYPE.equals(type); - } - - @JsonIgnore - public Boolean isChannelChat() { - return CHANNELCHATTYPE.equals(type); - } - - @JsonIgnore - public Boolean isUserChat() { - return USERCHATTYPE.equals(type); - } - - @JsonIgnore - public Boolean isSuperGroupChat() { - return SUPERGROUPCHATTYPE.equals(type); - } -} diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/ChatLocation.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/ChatLocation.java index 0eadd160a..45111d359 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/ChatLocation.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/ChatLocation.java @@ -1,11 +1,9 @@ package org.telegram.telegrambots.meta.api.objects; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; import lombok.Getter; -import lombok.NoArgsConstructor; import lombok.RequiredArgsConstructor; import lombok.Setter; import lombok.ToString; @@ -27,7 +25,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class ChatLocation implements BotApiObject { private static final String LOCATION_FIELD = "location"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/ChatMemberUpdated.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/ChatMemberUpdated.java deleted file mode 100644 index 4369d2a7c..000000000 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/ChatMemberUpdated.java +++ /dev/null @@ -1,36 +0,0 @@ -package org.telegram.telegrambots.meta.api.objects; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.Setter; -import lombok.ToString; -import lombok.experimental.SuperBuilder; -import lombok.extern.jackson.Jacksonized; -import org.telegram.telegrambots.meta.api.objects.chat.Chat; -import org.telegram.telegrambots.meta.api.objects.chatmember.ChatMember; - -/** - * @author Ruben Bermudez - * @version 5.1 - * This object represents changes in the status of a chat member. - * @deprecated Use {{@link org.telegram.telegrambots.meta.api.objects.chatmember.ChatMemberUpdated}} - */ -@EqualsAndHashCode(callSuper = false) -@Getter -@Setter -@ToString -@SuperBuilder -@Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) -@Deprecated -public class ChatMemberUpdated extends org.telegram.telegrambots.meta.api.objects.chatmember.ChatMemberUpdated { - public ChatMemberUpdated(Chat chat, User from, Integer date, ChatMember oldChatMember, ChatMember newChatMember, - ChatInviteLink inviteLink, Boolean viaChatFolderInviteLink) { - super(chat, from, date, oldChatMember, newChatMember, inviteLink, viaChatFolderInviteLink,null); - } - - public ChatMemberUpdated() { - super(); - } -} diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/ChatPermissions.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/ChatPermissions.java index cde9d1fde..9a9209c6a 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/ChatPermissions.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/ChatPermissions.java @@ -1,12 +1,9 @@ package org.telegram.telegrambots.meta.api.objects; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; -import lombok.Builder; import lombok.EqualsAndHashCode; import lombok.Getter; -import lombok.NoArgsConstructor; import lombok.RequiredArgsConstructor; import lombok.Setter; import lombok.ToString; @@ -29,7 +26,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class ChatPermissions implements BotApiObject { private static final String CAN_SEND_MESSAGES_FIELD = "can_send_messages"; private static final String CANSENDAUDIOS_FIELD = "can_send_audios"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/ChatPhoto.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/ChatPhoto.java index e8cd2b0bb..9cc6098a0 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/ChatPhoto.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/ChatPhoto.java @@ -1,11 +1,9 @@ package org.telegram.telegrambots.meta.api.objects; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; import lombok.Getter; -import lombok.NoArgsConstructor; import lombok.RequiredArgsConstructor; import lombok.Setter; import lombok.ToString; @@ -26,7 +24,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class ChatPhoto implements BotApiObject { private static final String SMALLFILEID_FIELD = "small_file_id"; private static final String SMALLFILEUNIQUEID_FIELD = "small_file_unique_id"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/ChatShared.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/ChatShared.java index 3ee017ff7..fce685601 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/ChatShared.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/ChatShared.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.objects; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; @@ -28,7 +27,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class ChatShared implements BotApiObject { private static final String REQUEST_ID_FIELD = "request_id"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/Dice.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/Dice.java index 79aea59d6..c7d2467f9 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/Dice.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/Dice.java @@ -1,11 +1,9 @@ package org.telegram.telegrambots.meta.api.objects; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; import lombok.Getter; -import lombok.NoArgsConstructor; import lombok.RequiredArgsConstructor; import lombok.Setter; import lombok.ToString; @@ -26,7 +24,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class Dice implements BotApiObject { private static final String VALUE_FIELD = "value"; private static final String EMOJI_FIELD = "emoji"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/Document.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/Document.java index 625e46df1..a6259694b 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/Document.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/Document.java @@ -1,11 +1,9 @@ package org.telegram.telegrambots.meta.api.objects; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; import lombok.Getter; -import lombok.NoArgsConstructor; import lombok.RequiredArgsConstructor; import lombok.Setter; import lombok.ToString; @@ -27,7 +25,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class Document implements BotApiObject { private static final String FILEID_FIELD = "file_id"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/LinkPreviewOptions.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/LinkPreviewOptions.java index 39545f23c..005fdb08c 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/LinkPreviewOptions.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/LinkPreviewOptions.java @@ -1,11 +1,9 @@ package org.telegram.telegrambots.meta.api.objects; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; import lombok.Getter; -import lombok.NoArgsConstructor; import lombok.RequiredArgsConstructor; import lombok.Setter; import lombok.ToString; @@ -27,7 +25,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class LinkPreviewOptions implements BotApiObject, Validable { private static final String IS_DISABLED_FIELD = "is_disabled"; private static final String URL_FIELD = "url"; 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 548d3ec3b..1cfc2c278 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,6 +1,5 @@ package org.telegram.telegrambots.meta.api.objects; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; @@ -32,7 +31,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class LoginUrl implements Validable, BotApiObject { private static final String URL_FIELD = "url"; private static final String FORWARD_TEXT_FIELD = "forward_text"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/MemberStatus.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/MemberStatus.java deleted file mode 100644 index 68fbe834c..000000000 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/MemberStatus.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.telegram.telegrambots.meta.api.objects; - -/** - * @author Ruben Bermudez - * @version 1.0 - * Group members categories - * @deprecated Use {{@link org.telegram.telegrambots.meta.api.objects.chatmember.MemberStatus}} - */ -@Deprecated -public final class MemberStatus { - public static final String CREATOR = "creator"; - public static final String ADMINISTRATOR = "administrator"; - public static final String MEMBER = "member"; - public static final String LEFT = "left"; - public static final String KICKED = "kicked"; -} diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/MessageEntity.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/MessageEntity.java index 6b12908df..f402a9afd 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/MessageEntity.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/MessageEntity.java @@ -1,7 +1,6 @@ package org.telegram.telegrambots.meta.api.objects; import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; @@ -29,7 +28,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class MessageEntity implements BotApiObject { private static final String TYPE_FIELD = "type"; private static final String OFFSET_FIELD = "offset"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/MessageId.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/MessageId.java index f70812874..49fd46e50 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/MessageId.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/MessageId.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.objects; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; @@ -26,7 +25,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class MessageId implements BotApiObject { private static final String MESSAGEID_FIELD = "message_id"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/PhotoSize.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/PhotoSize.java index 4bb1da5ab..da9e46f7a 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/PhotoSize.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/PhotoSize.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.objects; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; @@ -25,7 +24,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class PhotoSize implements BotApiObject { private static final String FILEID_FIELD = "file_id"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/ProximityAlertTriggered.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/ProximityAlertTriggered.java index 60a6a1806..565d56754 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/ProximityAlertTriggered.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/ProximityAlertTriggered.java @@ -1,11 +1,9 @@ package org.telegram.telegrambots.meta.api.objects; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; import lombok.Getter; -import lombok.NoArgsConstructor; import lombok.RequiredArgsConstructor; import lombok.Setter; import lombok.ToString; @@ -28,7 +26,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class ProximityAlertTriggered implements BotApiObject { private static final String TRAVELER_FIELD = "traveler"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/TextQuote.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/TextQuote.java index f4df05f3f..ed16ffc24 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/TextQuote.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/TextQuote.java @@ -1,11 +1,9 @@ package org.telegram.telegrambots.meta.api.objects; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; import lombok.Getter; -import lombok.NoArgsConstructor; import lombok.RequiredArgsConstructor; import lombok.Setter; import lombok.ToString; @@ -28,7 +26,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class TextQuote implements BotApiObject { private static final String TEXT_FIELD = "text"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/User.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/User.java index 80f3b0b5e..edad9c5d6 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/User.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/User.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.objects; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; @@ -26,7 +25,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class User implements BotApiObject { private static final String ID_FIELD = "id"; private static final String FIRST_NAME_FIELD = "first_name"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/UserShared.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/UserShared.java index f86d851fb..7c130270a 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/UserShared.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/UserShared.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.objects; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; @@ -28,7 +27,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class UserShared implements BotApiObject { private static final String USER_ID_FIELD = "user_id"; private static final String FIRST_NAME_FIELD = "first_name"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/UsersShared.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/UsersShared.java index 71052fac2..016831313 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/UsersShared.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/UsersShared.java @@ -1,7 +1,5 @@ package org.telegram.telegrambots.meta.api.objects; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; @@ -14,7 +12,6 @@ import org.telegram.telegrambots.meta.api.interfaces.BotApiObject; import java.util.List; -import java.util.stream.Collectors; /** * @author Ruben Bermudez @@ -29,7 +26,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class UsersShared implements BotApiObject { private static final String REQUEST_ID_FIELD = "request_id"; private static final String USERS_FIELD = "users"; @@ -44,16 +40,4 @@ public class UsersShared implements BotApiObject { */ @JsonProperty(USERS_FIELD) private List users; - - /** - * Use {{@link UsersShared#getUsers()}} - */ - @Deprecated - @JsonIgnore - public List getUserIds() { - if (users == null) { - return null; - } - return users.stream().map(UserShared::getUserId).collect(Collectors.toList()); - } } diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/Venue.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/Venue.java index 587d1c670..57e48a2f1 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/Venue.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/Venue.java @@ -1,12 +1,9 @@ package org.telegram.telegrambots.meta.api.objects; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; - import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; import lombok.Getter; -import lombok.NoArgsConstructor; import lombok.RequiredArgsConstructor; import lombok.Setter; import lombok.ToString; @@ -27,7 +24,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class Venue implements BotApiObject { private static final String LOCATION_FIELD = "location"; private static final String TITLE_FIELD = "title"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/Video.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/Video.java index 36bbe3385..5c539fd48 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/Video.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/Video.java @@ -1,11 +1,9 @@ package org.telegram.telegrambots.meta.api.objects; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; import lombok.Getter; -import lombok.NoArgsConstructor; import lombok.RequiredArgsConstructor; import lombok.Setter; import lombok.ToString; @@ -26,7 +24,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class Video implements BotApiObject { private static final String FILEID_FIELD = "file_id"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/VideoNote.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/VideoNote.java index 878caa1b3..d114dea0d 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/VideoNote.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/VideoNote.java @@ -1,11 +1,9 @@ package org.telegram.telegrambots.meta.api.objects; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; import lombok.Getter; -import lombok.NoArgsConstructor; import lombok.RequiredArgsConstructor; import lombok.Setter; import lombok.ToString; @@ -26,7 +24,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class VideoNote implements BotApiObject { private static final String FILEID_FIELD = "file_id"; private static final String FILEUNIQUEID_FIELD = "file_unique_id"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/Voice.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/Voice.java index d1a1f627a..3d8cdfd81 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/Voice.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/Voice.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.objects; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; @@ -25,7 +24,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class Voice implements BotApiObject { private static final String FILEID_FIELD = "file_id"; private static final String FILEUNIQUEID_FIELD = "file_unique_id"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/WriteAccessAllowed.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/WriteAccessAllowed.java index 77a638106..c16638928 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/WriteAccessAllowed.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/WriteAccessAllowed.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.objects; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -25,7 +24,6 @@ @RequiredArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class WriteAccessAllowed implements BotApiObject { private static final String FROM_REQUEST_FIELD = "from_request"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/boost/ChatBoostSourceGiveaway.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/boost/ChatBoostSourceGiveaway.java index cd8d8317c..84526f3cb 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/boost/ChatBoostSourceGiveaway.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/boost/ChatBoostSourceGiveaway.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.objects.boost; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.Builder; @@ -28,7 +27,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class ChatBoostSourceGiveaway implements ChatBoostSource { private static final String SOURCE_FIELD = "source"; private static final String GIVEAWAY_MESSAGE_ID_FIELD = "giveaway_message_id"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/business/BusinessMessagesDeleted.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/business/BusinessMessagesDeleted.java index a46d7cc21..401638a72 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/business/BusinessMessagesDeleted.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/business/BusinessMessagesDeleted.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.objects.business; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; @@ -28,7 +27,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class BusinessMessagesDeleted implements BotApiObject { private static final String BUSINESS_CONNECTION_ID_FIELD = "business_connection_id"; private static final String CHAT_FIELD = "chat"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/chatmember/ChatMemberMember.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/chatmember/ChatMemberMember.java index 8b97fa8c1..de2457de7 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/chatmember/ChatMemberMember.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/chatmember/ChatMemberMember.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.objects.chatmember; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; @@ -29,7 +28,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class ChatMemberMember implements ChatMember { public static final String STATUS = "member"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/commands/BotCommand.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/commands/BotCommand.java index 620d9910e..58dcf0536 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/commands/BotCommand.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/commands/BotCommand.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.objects.commands; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -26,7 +25,6 @@ @RequiredArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class BotCommand implements BotApiObject, Validable { private static final String COMMAND_FIELD = "command"; private static final String DESCRIPTION_FIELD = "description"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/games/Animation.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/games/Animation.java index 82b325c9a..4e561676c 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/games/Animation.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/games/Animation.java @@ -26,7 +26,6 @@ import lombok.Setter; import lombok.ToString; import lombok.experimental.SuperBuilder; -import lombok.experimental.Tolerate; import lombok.extern.jackson.Jacksonized; import org.telegram.telegrambots.meta.api.interfaces.BotApiObject; import org.telegram.telegrambots.meta.api.objects.PhotoSize; @@ -114,36 +113,4 @@ public class Animation implements BotApiObject { */ @JsonProperty(FILE_SIZE_FIELD) private Long fileSize; - - /** - * @deprecated Use {{@link #getMimeType()}} instead - */ - @Deprecated - @Tolerate - public String getMimetype() { - return mimeType; - } - - /** - * @deprecated Use {{@link #setMimeType(String)}} instead - */ - @Deprecated - @Tolerate - public void setMimetype(String mimetype) { - this.mimeType = mimetype; - } - - public static abstract class AnimationBuilder> { - - /** - * @deprecated Use {{@link #mimeType(String)}} instead - */ - @Deprecated - @Tolerate - public B mimetype(String mimetype) { - this.mimeType = mimetype; - return self(); - } - } - } diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/gifts/Gift.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/gifts/Gift.java new file mode 100644 index 000000000..0bef53da0 --- /dev/null +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/gifts/Gift.java @@ -0,0 +1,68 @@ +package org.telegram.telegrambots.meta.api.objects.gifts; + +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.stickers.Sticker; + +/** + * @author Ruben Bermudez + * @version 8.0 + * + * This object represents a gift that can be sent by the bot. + */ +@EqualsAndHashCode(callSuper = false) +@Getter +@Setter +@ToString +@RequiredArgsConstructor +@AllArgsConstructor +@SuperBuilder +@Jacksonized +public class Gift implements BotApiObject { + private static final String ID_FIELD = "id"; + private static final String STICKER_FIELD = "sticker"; + private static final String STAR_COUNT_FIELD = "star_count"; + private static final String TOTAL_COUNT_FIELD = "total_count"; + private static final String REMAINING_COUNT_FIELD = "remaining_count"; + + /** + * Unique identifier of the gift + */ + @JsonProperty(ID_FIELD) + @NonNull + private String id; + /** + * The sticker that represents the gift + */ + @JsonProperty(STICKER_FIELD) + @NonNull + private Sticker sticker; + /** + * The number of Telegram Stars that must be paid to send the sticker + */ + @JsonProperty(STAR_COUNT_FIELD) + @NonNull + private Integer starCount; + /** + * Optional. + * The total number of the gifts of this type that can be sent; for limited gifts only + */ + @JsonProperty(TOTAL_COUNT_FIELD) + private Integer totalCount; + /** + * Optional. + * The number of remaining gifts of this type that can be sent; for limited gifts only + */ + @JsonProperty(REMAINING_COUNT_FIELD) + @NonNull + private Integer remainingCount; +} diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/gifts/Gifts.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/gifts/Gifts.java new file mode 100644 index 000000000..4d8db99ec --- /dev/null +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/gifts/Gifts.java @@ -0,0 +1,37 @@ +package org.telegram.telegrambots.meta.api.objects.gifts; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.AllArgsConstructor; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.NonNull; +import lombok.Setter; +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 8.0 + * + * This object represent a list of gifts. + */ +@EqualsAndHashCode(callSuper = false) +@Getter +@Setter +@ToString +@AllArgsConstructor +@SuperBuilder +@Jacksonized +public class Gifts implements BotApiObject { + private static final String GIFTS_FIELD = "gifts"; + /** + * The list of gifts + */ + @JsonProperty(GIFTS_FIELD) + @NonNull + private List gifts; +} diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/giveaway/Giveaway.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/giveaway/Giveaway.java index 5de9bd64c..4392fb9c9 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/giveaway/Giveaway.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/giveaway/Giveaway.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.objects.giveaway; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; @@ -28,7 +27,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class Giveaway implements BotApiObject { public static final String CHATS_FIELD = "chats"; public static final String WINNERS_SELECTION_DATE_FIELD = "winners_selection_date"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/giveaway/GiveawayCompleted.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/giveaway/GiveawayCompleted.java index b3ec9ec96..bd14e1b09 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/giveaway/GiveawayCompleted.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/giveaway/GiveawayCompleted.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.objects.giveaway; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; @@ -27,7 +26,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class GiveawayCompleted implements BotApiObject { public static final String WINNER_COUNT_FIELD = "winner_count"; public static final String UNCLAIMED_PRIZE_COUNT_FIELD = "unclaimed_prize_count"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/giveaway/GiveawayCreated.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/giveaway/GiveawayCreated.java index f14def4e1..55dcc4698 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/giveaway/GiveawayCreated.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/giveaway/GiveawayCreated.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.objects.giveaway; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -24,7 +23,6 @@ @RequiredArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class GiveawayCreated implements BotApiObject { private static final String PRIZE_STAR_COUNT_FIELD = "prize_star_count"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/giveaway/GiveawayWinners.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/giveaway/GiveawayWinners.java index e7d556f88..2e98da868 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/giveaway/GiveawayWinners.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/giveaway/GiveawayWinners.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.objects.giveaway; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; @@ -11,8 +10,8 @@ import lombok.experimental.SuperBuilder; import lombok.extern.jackson.Jacksonized; import org.telegram.telegrambots.meta.api.interfaces.BotApiObject; -import org.telegram.telegrambots.meta.api.objects.chat.Chat; import org.telegram.telegrambots.meta.api.objects.User; +import org.telegram.telegrambots.meta.api.objects.chat.Chat; import java.util.List; @@ -30,7 +29,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class GiveawayWinners implements BotApiObject { public static final String CHAT_FIELD = "chat"; public static final String GIVEAWAY_MESSAGE_ID_FIELD = "giveaway_message_id"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/media/paid/InputPaidMedia.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/media/paid/InputPaidMedia.java index e22d80d00..357a3d7e7 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/media/paid/InputPaidMedia.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/media/paid/InputPaidMedia.java @@ -1,7 +1,6 @@ package org.telegram.telegrambots.meta.api.objects.media.paid; import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -38,7 +37,6 @@ @RequiredArgsConstructor @AllArgsConstructor @SuperBuilder -@JsonIgnoreProperties(ignoreUnknown = true) @JsonTypeInfo( use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/message/Message.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/message/Message.java index b6ec9b830..5ff42a755 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/message/Message.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/message/Message.java @@ -1,7 +1,6 @@ package org.telegram.telegrambots.meta.api.objects.message; import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; @@ -80,7 +79,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class Message implements MaybeInaccessibleMessage { private static final String MESSAGE_ID_FIELD = "message_id"; private static final String MESSAGE_THREAD_ID_FIELD = "message_thread_id"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/message/PreparedInlineMessage.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/message/PreparedInlineMessage.java new file mode 100644 index 000000000..b63cae606 --- /dev/null +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/message/PreparedInlineMessage.java @@ -0,0 +1,44 @@ +package org.telegram.telegrambots.meta.api.objects.message; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.AllArgsConstructor; +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.interfaces.BotApiObject; + +/** + * @author Ruben Bermudez + * @version 8.0 + * + * Describes an inline message to be sent by a user of a Mini App. + */ +@EqualsAndHashCode(callSuper = false) +@Getter +@Setter +@ToString +@RequiredArgsConstructor +@AllArgsConstructor +@SuperBuilder +@Jacksonized +@JsonIgnoreProperties(ignoreUnknown = true) +public class PreparedInlineMessage implements BotApiObject { + private static final String ID_FIELD = "id"; + private static final String EXPIRATION_DATE_FIELD = "expiration_date"; + + /** + * Unique identifier of the prepared message + */ + @JsonProperty(ID_FIELD) + private String messageId; + /** + * Expiration date of the prepared message, in Unix time. Expired prepared messages can no longer be used + */ + @JsonProperty(EXPIRATION_DATE_FIELD) + private Integer expirationDate; +} diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/payments/Invoice.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/payments/Invoice.java index 706cf8366..cae5f36ab 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/payments/Invoice.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/payments/Invoice.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.objects.payments; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; @@ -27,7 +26,6 @@ @AllArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class Invoice implements BotApiObject { private static final String TITLE_FIELD = "title"; private static final String DESCRIPTION_FIELD = "description"; 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 07be72374..ae74e9189 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,6 +1,5 @@ package org.telegram.telegrambots.meta.api.objects.payments; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -26,7 +25,6 @@ @RequiredArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class LabeledPrice implements Validable, BotApiObject { private static final String LABEL_FIELD = "label"; private static final String AMOUNT_FIELD = "amount"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/payments/PaidMediaPurchased.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/payments/PaidMediaPurchased.java index cfc78c1fa..1d2327d69 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/payments/PaidMediaPurchased.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/payments/PaidMediaPurchased.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.objects.payments; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -25,7 +24,6 @@ @RequiredArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class PaidMediaPurchased implements BotApiObject { private static final String FROM_FIELD = "from"; private static final String PAID_MEDIA_PAYLOAD_FIELD = "paid_media_payload"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/payments/SuccessfulPayment.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/payments/SuccessfulPayment.java index 0980423ca..1607005b1 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/payments/SuccessfulPayment.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/payments/SuccessfulPayment.java @@ -35,6 +35,9 @@ public class SuccessfulPayment implements BotApiObject { private static final String ORDER_INFO_FIELD = "order_info"; private static final String TELEGRAM_PAYMENT_CHARGE_ID_FIELD = "telegram_payment_charge_id"; private static final String PROVIDER_PAYMENT_CHARGE_ID_FIELD = "provider_payment_charge_id"; + private static final String SUBSCRIPTION_EXPIRATION_DATE_FIELD = "subscription_expiration_date"; + private static final String IS_RECURRING_FIELD = "is_recurring"; + private static final String IS_FIRST_RECURRING_FIELD = "is_first_recurring"; /** * Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars @@ -74,4 +77,22 @@ public class SuccessfulPayment implements BotApiObject { */ @JsonProperty(PROVIDER_PAYMENT_CHARGE_ID_FIELD) private String providerPaymentChargeId; + /** + * Optional. + * Expiration date of the subscription, in Unix time; for recurring payments only + */ + @JsonProperty(SUBSCRIPTION_EXPIRATION_DATE_FIELD) + private Integer subscriptionExpirationDate; + /** + * Optional. + * True, if the payment is a recurring payment for a subscription + */ + @JsonProperty(IS_RECURRING_FIELD) + private Boolean isRecurring; + /** + * Optional. + * True, if the payment is the first payment for a subscription + */ + @JsonProperty(IS_FIRST_RECURRING_FIELD) + private Boolean isFirstRecurring; } diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/payments/paidmedia/PaidMediaPhoto.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/payments/paidmedia/PaidMediaPhoto.java index dae4f3d4e..fcfa817dc 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/payments/paidmedia/PaidMediaPhoto.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/payments/paidmedia/PaidMediaPhoto.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.objects.payments.paidmedia; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -11,7 +10,6 @@ import lombok.experimental.SuperBuilder; import lombok.extern.jackson.Jacksonized; import org.telegram.telegrambots.meta.api.objects.PhotoSize; -import org.telegram.telegrambots.meta.api.objects.payments.transactionpartner.TransactionPartner; import java.util.List; @@ -27,7 +25,6 @@ @ToString @RequiredArgsConstructor @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) @SuperBuilder public class PaidMediaPhoto implements PaidMedia { private static final String TYPE_FIELD = "type"; 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 index b0916c802..1a76e1db0 100644 --- 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 @@ -1,6 +1,5 @@ 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; @@ -28,7 +27,6 @@ @ToString @RequiredArgsConstructor @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) @SuperBuilder public class TransactionPartnerUser implements TransactionPartner { private static final String TYPE_FIELD = "type"; @@ -36,6 +34,8 @@ public class TransactionPartnerUser implements TransactionPartner { private static final String INVOICE_PAYLOAD_FIELD = "invoice_payload"; private static final String PAID_MEDIA_FIELD = "paid_media"; private static final String PAID_MEDIA_PAYLOAD_FIELD = "paid_media_payload"; + private static final String GIFT_FIELD = "gift"; + private static final String SUBSCRIPTION_PERIOD_FIELD = "subscription_period"; /** * Type of the transaction partner, always “user” @@ -67,4 +67,18 @@ public class TransactionPartnerUser implements TransactionPartner { */ @JsonProperty(PAID_MEDIA_PAYLOAD_FIELD) private String paidMediaPayload; + + /** + * Optional. + * The gift sent to the user by the bot + */ + @JsonProperty(GIFT_FIELD) + private String gift; + + /** + * Optional. + * The duration of the paid subscription + */ + @JsonProperty(SUBSCRIPTION_PERIOD_FIELD) + private Integer subscriptionPeriod; } diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/reactions/ReactionTypeEmoji.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/reactions/ReactionTypeEmoji.java index 121d644b7..c67495b28 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/reactions/ReactionTypeEmoji.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/reactions/ReactionTypeEmoji.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.objects.reactions; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Builder; import lombok.EqualsAndHashCode; @@ -26,7 +25,6 @@ @RequiredArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class ReactionTypeEmoji implements ReactionType { private static final String TYPE_FIELD = "type"; private static final String EMOJI_FIELD = "emoji"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/reactions/ReactionTypePaid.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/reactions/ReactionTypePaid.java index f32c4060e..e1010791b 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/reactions/ReactionTypePaid.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/reactions/ReactionTypePaid.java @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.objects.reactions; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Builder; import lombok.EqualsAndHashCode; @@ -26,7 +25,6 @@ @RequiredArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class ReactionTypePaid implements ReactionType { private static final String TYPE_FIELD = "type"; 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 0096df7e3..10b682524 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 @@ -1,6 +1,5 @@ package org.telegram.telegrambots.meta.api.objects.stickers; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import lombok.EqualsAndHashCode; @@ -28,7 +27,6 @@ @RequiredArgsConstructor @SuperBuilder @Jacksonized -@JsonIgnoreProperties(ignoreUnknown = true) public class MaskPosition implements Validable, BotApiObject { private static final String POINT_FIELD = "point"; private static final String XSHIFT_FIELD = "x_shift"; diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/stickers/StickerSet.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/stickers/StickerSet.java index 446dfb08e..905840d1f 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/stickers/StickerSet.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/stickers/StickerSet.java @@ -52,18 +52,6 @@ public class StickerSet implements BotApiObject { */ @JsonProperty(STICKERS_FIELD) private List stickers; - /** - * List of all set stickers - */ - @JsonProperty(IS_ANIMATED_FIELD) - @Deprecated - private Boolean isAnimated; - /** - * True, if the sticker set contains video stickers - */ - @JsonProperty(IS_VIDEO_FIELD) - @Deprecated - private Boolean isVideo; /** * Optional. * Sticker set thumbnail in the .WEBP, .TGS, or .WEBM format