|
| 1 | +package org.telegram.telegrambots.meta.api.methods.verification; |
| 2 | + |
| 3 | +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; |
| 4 | +import com.fasterxml.jackson.annotation.JsonInclude; |
| 5 | +import com.fasterxml.jackson.annotation.JsonProperty; |
| 6 | +import lombok.EqualsAndHashCode; |
| 7 | +import lombok.Getter; |
| 8 | +import lombok.NonNull; |
| 9 | +import lombok.RequiredArgsConstructor; |
| 10 | +import lombok.Setter; |
| 11 | +import lombok.ToString; |
| 12 | +import lombok.experimental.SuperBuilder; |
| 13 | +import lombok.experimental.Tolerate; |
| 14 | +import lombok.extern.jackson.Jacksonized; |
| 15 | +import org.telegram.telegrambots.meta.api.methods.botapimethods.BotApiMethodBoolean; |
| 16 | +import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException; |
| 17 | +import org.telegram.telegrambots.meta.util.Validations; |
| 18 | + |
| 19 | +/** |
| 20 | + * @author Ruben Bermudez |
| 21 | + * @version 8.2 |
| 22 | + * |
| 23 | + * Removes verification from a chat that is currently verified on behalf of the organization represented by the bot. |
| 24 | + * Returns True on success. |
| 25 | + */ |
| 26 | +@EqualsAndHashCode(callSuper = false) |
| 27 | +@Getter |
| 28 | +@Setter |
| 29 | +@ToString |
| 30 | +@RequiredArgsConstructor |
| 31 | +@SuperBuilder |
| 32 | +@Jacksonized |
| 33 | +@JsonIgnoreProperties(ignoreUnknown = true) |
| 34 | +@JsonInclude(JsonInclude.Include.NON_NULL) |
| 35 | +public class RemoveChatVerification extends BotApiMethodBoolean { |
| 36 | + public static final String PATH = "removeChatVerification"; |
| 37 | + |
| 38 | + private static final String CHAT_ID_FIELD = "chat_id"; |
| 39 | + |
| 40 | + /** |
| 41 | + * Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
| 42 | + */ |
| 43 | + @JsonProperty(CHAT_ID_FIELD) |
| 44 | + @NonNull |
| 45 | + private String chatId; |
| 46 | + |
| 47 | + @Override |
| 48 | + public void validate() throws TelegramApiValidationException { |
| 49 | + Validations.requiredChatId(chatId, this); |
| 50 | + } |
| 51 | + |
| 52 | + @Override |
| 53 | + public String getMethod() { |
| 54 | + return PATH; |
| 55 | + } |
| 56 | + |
| 57 | + @Tolerate |
| 58 | + public void setChatId(@NonNull Long chatId) { |
| 59 | + this.chatId = chatId.toString(); |
| 60 | + } |
| 61 | + |
| 62 | + public abstract static class RemoveChatVerificationBuilder<C extends RemoveChatVerification, B extends RemoveChatVerification.RemoveChatVerificationBuilder<C, B>> extends BotApiMethodBooleanBuilder<C, B> { |
| 63 | + @Tolerate |
| 64 | + public RemoveChatVerification.RemoveChatVerificationBuilder<C, B> chatId(@NonNull Long chatId) { |
| 65 | + this.chatId = chatId.toString(); |
| 66 | + return this; |
| 67 | + } |
| 68 | + } |
| 69 | +} |
0 commit comments