Skip to content

Commit

Permalink
Undo custom annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenlagus committed Dec 2, 2024
1 parent ce38e20 commit 2324a7f
Show file tree
Hide file tree
Showing 164 changed files with 722 additions and 30 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.telegram.telegrambots.meta.api.interfaces;

import org.telegram.telegrambots.meta.annotations.BotApiJsonAnnotated;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;

import java.io.Serializable;

Expand All @@ -9,6 +10,7 @@
* @version 1.0
* An object from the Bots API received from Telegram Servers
*/
@BotApiJsonAnnotated
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public interface BotApiObject extends Serializable {
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.telegram.telegrambots.meta.api.methods;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
Expand Down Expand Up @@ -31,6 +33,8 @@
@AllArgsConstructor
@SuperBuilder
@Jacksonized
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class AnswerCallbackQuery extends BotApiMethodBoolean {
public static final String PATH = "answercallbackquery";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.telegram.telegrambots.meta.api.methods;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
Expand Down Expand Up @@ -31,6 +33,8 @@
@AllArgsConstructor
@SuperBuilder
@Jacksonized
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class AnswerInlineQuery extends BotApiMethodBoolean {
public static final String PATH = "answerInlineQuery";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.telegram.telegrambots.meta.api.methods;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
Expand Down Expand Up @@ -31,6 +33,8 @@
@AllArgsConstructor
@SuperBuilder
@Jacksonized
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class AnswerPreCheckoutQuery extends BotApiMethodBoolean {
public static final String PATH = "answerPreCheckoutQuery";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.telegram.telegrambots.meta.api.methods;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
Expand Down Expand Up @@ -34,6 +36,8 @@
@AllArgsConstructor
@SuperBuilder
@Jacksonized
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class AnswerShippingQuery extends BotApiMethodBoolean {
public static final String PATH = "answerShippingQuery";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.telegram.telegrambots.meta.api.methods;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
Expand Down Expand Up @@ -41,6 +43,8 @@
@AllArgsConstructor
@SuperBuilder
@Jacksonized
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class CopyMessage extends BotApiMethod<MessageId> {
public static final String PATH = "copyMessage";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.telegram.telegrambots.meta.api.methods;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
Expand Down Expand Up @@ -43,6 +45,8 @@
@AllArgsConstructor
@SuperBuilder
@Jacksonized
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class CopyMessages extends BotApiMethod<ArrayList<MessageId>> {
public static final String PATH = "copyMessages";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.telegram.telegrambots.meta.api.methods;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
Expand Down Expand Up @@ -31,6 +33,8 @@
@AllArgsConstructor
@SuperBuilder
@Jacksonized
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ForwardMessage extends BotApiMethodMessage {
public static final String PATH = "forwardmessage";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.telegram.telegrambots.meta.api.methods;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
Expand Down Expand Up @@ -39,6 +41,8 @@
@AllArgsConstructor
@SuperBuilder
@Jacksonized
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ForwardMessages extends BotApiMethod<ArrayList<MessageId>> {
public static final String PATH = "forwardMessages";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.telegram.telegrambots.meta.api.methods;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.EqualsAndHashCode;
import lombok.Getter;
Expand Down Expand Up @@ -31,6 +33,8 @@
@RequiredArgsConstructor
@SuperBuilder
@Jacksonized
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class GetFile extends BotApiMethod<File> {
public static final String PATH = "getFile";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.telegram.telegrambots.meta.api.methods;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
Expand Down Expand Up @@ -27,6 +29,8 @@
@AllArgsConstructor
@SuperBuilder
@Jacksonized
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class GetUserProfilePhotos extends BotApiMethod<UserProfilePhotos> {
public static final String PATH = "getuserprofilephotos";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.telegram.telegrambots.meta.api.methods;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.EqualsAndHashCode;
import lombok.Getter;
Expand Down Expand Up @@ -30,6 +32,8 @@
@RequiredArgsConstructor
@SuperBuilder
@Jacksonized
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class SetPassportDataErrors extends BotApiMethodBoolean {
public static final String PATH = "setPassportDataErrors";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.telegram.telegrambots.meta.api.methods;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
Expand Down Expand Up @@ -31,6 +33,8 @@
@AllArgsConstructor
@SuperBuilder
@Jacksonized
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class SetUserEmojiStatus extends BotApiMethodBoolean {
public static final String PATH = "setUserEmojiStatus";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.telegram.telegrambots.meta.api.methods.boosts;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
Expand Down Expand Up @@ -29,6 +31,8 @@
@NoArgsConstructor
@AllArgsConstructor
@Builder
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class GetUserChatBoosts extends BotApiMethod<UserChatBoosts> {
public static final String PATH = "getUserChatBoosts";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
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;
Expand All @@ -13,6 +15,8 @@
*/
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@SuperBuilder
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public abstract class BotApiMethodBoolean extends BotApiMethod<Boolean> {
@Override
public Boolean deserializeResponse(String answer) throws TelegramApiRequestException {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
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;
Expand All @@ -14,6 +16,8 @@
*/
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@SuperBuilder
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public abstract class BotApiMethodMessage extends BotApiMethod<Message> {
@Override
public Message deserializeResponse(String answer) throws TelegramApiRequestException {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
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;
Expand All @@ -19,6 +21,8 @@
*/
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@SuperBuilder
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public abstract class BotApiMethodSerializable extends BotApiMethod<Serializable> {
public Serializable deserializeResponseMessageOrBoolean(String answer) throws TelegramApiRequestException {
return deserializeResponseFromPossibilities(answer, Arrays.asList(Message.class, Boolean.class));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
package org.telegram.telegrambots.meta.api.methods.botapimethods;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.type.CollectionType;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
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;
Expand All @@ -24,7 +25,8 @@
*/
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@SuperBuilder
@BotApiJsonAnnotated
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public abstract class PartialBotApiMethod<T extends Serializable> implements Validable {
@JsonIgnore
protected static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
Expand Down Expand Up @@ -72,7 +74,8 @@ private T deserializeResponseInternal(String answer, JavaType type) throws Teleg
@JsonProperty(BotApiMethod.METHOD_FIELD)
public abstract String getMethod();

@BotApiJsonAnnotated
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public static abstract class PartialBotApiMethodBuilder<T extends Serializable, C extends PartialBotApiMethod<T>, B extends PartialBotApiMethodBuilder<T, C, B>> {

}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.telegram.telegrambots.meta.api.methods.commands;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
Expand Down Expand Up @@ -33,6 +35,8 @@
@AllArgsConstructor
@SuperBuilder
@Jacksonized
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class SetMyCommands extends BotApiMethodBoolean {
public static final String PATH = "setMyCommands";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.telegram.telegrambots.meta.api.methods.forum;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.EqualsAndHashCode;
import lombok.Getter;
Expand Down Expand Up @@ -30,6 +32,8 @@
@RequiredArgsConstructor
@SuperBuilder
@Jacksonized
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class CloseForumTopic extends BotApiMethodBoolean {
public static final String PATH = "closeForumTopic";

Expand Down
Loading

0 comments on commit 2324a7f

Please sign in to comment.